:root { --bg:#f4f6f8; --ink:#1b1f23; --muted:#6b7280; --brand:#0f766e; --card:#ffffff; --border:#e5e7eb; }
* { box-sizing: border-box; }
body { margin:0; font-family: Arial, sans-serif; background:var(--bg); color:var(--ink); }
header { background:#0b3d3a; color:#fff; padding:16px 24px; display:flex; align-items:center; justify-content:space-between; position:sticky; top:0; z-index:100; box-shadow:0 2px 10px rgba(0,0,0,0.08); }
header a { color:#fff; text-decoration:none; margin-right:12px; }
body.nav-open { overflow:hidden; }
.mobile-nav-toggle { display:none; }
.mobile-nav-overlay { position:fixed; inset:0; background:rgba(15,23,42,0.45); opacity:0; pointer-events:none; transition:opacity .2s ease; z-index:1190; }
main { padding:24px; max-width:1100px; margin:0 auto; }
main.main-wide { max-width:100%; margin:0; padding:0; }
.app-layout { --sidebar-width:280px; --content-max:1200px; display:grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); gap:24px; align-items:start; padding:24px; }
.app-sidebar { position: sticky; top: 84px; align-self:start; }
.app-sidebar .app-nav-head { display:flex; align-items:center; justify-content:space-between; gap:10px; padding-bottom:8px; border-bottom:1px solid var(--border); }
.app-sidebar .app-nav-title { font-weight:700; font-size:15px; }
.app-sidebar .app-nav-actions { display:flex; gap:6px; flex-wrap:wrap; margin-top:auto; padding-top:10px; border-top:1px solid var(--border); }
.app-sidebar .app-nav-actions .btn { height:30px; padding:0 10px; font-size:12px; }
.app-sidebar .app-nav-group { margin-top:10px; }
.app-sidebar .app-nav-group h4 { margin:0 0 6px; font-size:12px; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.app-sidebar .app-nav-sub { font-size:12px; color:var(--muted); margin:4px 0; }
.app-sidebar .app-nav-links { list-style:none; padding:0; margin:0; }
.app-sidebar .app-nav-links li { margin:4px 0; display:flex; align-items:center; gap:8px; }
.app-sidebar .app-nav-links a { color:var(--brand); text-decoration:none; display:flex; align-items:center; gap:8px; padding:4px 6px; border-radius:6px; }
.app-sidebar .app-nav-links a:hover { background:#f1f5f9; }
.app-sidebar .app-nav-links a.active { background:#e7f4f3; font-weight:600; }
.app-sidebar .app-nav-mainmenu { display:none; }
.app-sidebar .app-nav-icon { width:16px; height:16px; border-radius:4px; flex:0 0 auto; }
.app-sidebar { scrollbar-gutter: stable both-edges; }
.app-content { max-width:var(--content-max); margin:0; width:100%; }
main.main-wide .app-content { max-width:none; }
@media (max-width: 900px) {
    body {
        overflow-x: hidden;
    }
    header {
        padding: 10px 12px;
        gap: 8px;
        align-items: center;
        justify-content: space-between;
    }
    header nav {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        min-width: 0;
    }
    header nav > a,
    header nav > .nav-group {
        display: none;
    }
    header nav > a[href="/logout"],
    header nav > a[href="/login"] {
        display: inline-flex;
    }
    main {
        padding: 12px;
    }
    .card {
        padding: 12px;
        border-radius: 12px;
    }
    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .inline {
        flex-direction: column;
        gap: 8px;
    }
    .inline > div {
        flex: 1 1 auto;
        width: 100%;
    }
    .inline-zip-city > div:first-child,
    .inline-zip-city > div:last-child {
        flex: 1 1 auto;
    }
    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        border-spacing: 0 8px;
    }
    th, td {
        white-space: nowrap;
    }
    .m365-row {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
        padding: 10px 10px 10px 14px;
        gap: 10px;
    }
    .m365-row-bottom {
        grid-template-columns: repeat(2, minmax(140px, 1fr));
    }
    .m365-tenant-grid { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
    .m365-actions {
        align-items: stretch;
        border-left: none;
        border-top: 1px solid #e4eaf2;
        padding-left: 0;
        padding-top: 10px;
        grid-column: 1 / -1;
    }
    .m365-actions .btn {
        min-height: 38px;
    }
    .plan-grid { grid-template-columns: 1fr; }
    .card-head {
        flex-direction: column;
        align-items: flex-start;
    }
    .card-head .btn {
        width: auto;
    }
    .app-layout { grid-template-columns: 1fr; padding:16px; }
    .app-content { max-width:none; }
    .mobile-nav-toggle { display:inline-flex; }
    .mobile-nav-overlay { display:block; }
    .app-sidebar .app-nav-mainmenu { display:block; }
    .app-sidebar .app-nav-shortcuts { display:none; }
    .app-sidebar .app-nav-actions { display:none; }
    .app-sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        width: 80vw;
        max-width: 320px;
        height: 100dvh;
        max-height: 100dvh;
        transform: translateX(-110%);
        transition: transform .2s ease;
        background: var(--card);
        z-index: 1200;
        box-shadow: 0 12px 40px rgba(0,0,0,0.2);
        padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }
    .app-content {
        min-width: 0;
        overflow-x: hidden;
    }
    .app-content * {
        max-width: 100%;
    }
    .app-content pre {
        overflow: auto;
    }
    .app-content [style*="display:flex"] {
        flex-wrap: wrap !important;
        gap: 10px !important;
    }
    .app-content [style*="min-width"] {
        min-width: 0 !important;
        width: 100% !important;
    }
    .app-content [style*="max-width"] {
        max-width: 100% !important;
    }
    .app-content [style*="padding-top:22px"] {
        padding-top: 0 !important;
    }
    .app-content .right {
        text-align: left;
    }
    .app-content .right .btn {
        width: auto;
    }
    .app-sidebar .app-nav-head {
        position: sticky;
        top: 0;
        z-index: 2;
        background: var(--card);
        padding-top: 2px;
    }
    body.nav-open .app-sidebar { transform:translateX(0); }
    body.nav-open .mobile-nav-overlay { opacity:1; pointer-events:auto; }
}
.card { background:var(--card); border:1px solid var(--border); border-radius:10px; padding:16px; margin-bottom:16px; }
.grid { display:grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap:16px; }
.muted { color:var(--muted); }
.panel-soft { background:#f8fafc; }
.inline-form { display:inline; }
.table-wrap { width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }
.inline-block { display:inline-block; }
.d-none { display:none; }
.items-center { align-items:center; }
.items-end { align-items:flex-end; }
.flex { display:flex; }
.flex-between { display:flex; align-items:center; justify-content:space-between; }
.gap-8 { gap:8px; }
.gap-10 { gap:10px; }
.gap-12 { gap:12px; }
.gap-14 { gap:14px; }
.wrap-gap-10 { flex-wrap:wrap; gap:10px; }
.wrap-gap-14 { flex-wrap:wrap; gap:14px; }
.grid-gap-6 { display:grid; gap:6px; }
.m-0 { margin:0; }
.ml-6 { margin-left:6px; }
.ml-18 { margin-left:18px; }
.mt-8 { margin-top:8px; }
.mt-10 { margin-top:10px; }
.mt-12 { margin-top:12px; }
.mt-14 { margin-top:14px; }
.mt-16 { margin-top:16px; }
.mt-20 { margin-top:20px; }
.mt-0 { margin-top:0; }
.mt-2 { margin-top:2px; }
.mt-4 { margin-top:4px; }
.mt-6 { margin-top:6px; }
.mb-6 { margin-bottom:6px; }
.mb-8 { margin-bottom:8px; }
.mb-10 { margin-bottom:10px; }
.mb-12 { margin-bottom:12px; }
.mr-6 { margin-right:6px; }
.mr-8 { margin-right:8px; }
.p-10 { padding:10px; }
.mw-520 { max-width:520px; }
.mw-620 { max-width:620px; }
.mw-720 { max-width:720px; }
.mw-80 { max-width:80px; }
.minw-180 { min-width:180px; }
.minw-220 { min-width:220px; }
.minw-260 { min-width:260px; }
.minw-280 { min-width:280px; }
.minw-320 { min-width:320px; }
.w-35 { width:35%; }
.w-90 { width:90px; }
.maxh-220 { max-height:220px; }
.maxh-520 { max-height:520px; }
.overflow-auto { overflow:auto; }
.pre-wrap { white-space:pre-wrap; }
.fs-12 { font-size:12px; }
.flex-1 { flex:1; }
.flex-0-auto { flex:0 0 auto; }
.grid-2 { display:grid; grid-template-columns:1fr 1fr; }
.grid-320-1 { display:grid; grid-template-columns:320px 1fr; }
.notice-success { background:#dcfce7; border-color:#bbf7d0; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 14px;
    text-align: center;
    border-radius: 10px;
    border: 1px solid #d4dbe6;
    background: linear-gradient(180deg, #ffffff 0%, #f7fafc 100%);
    color: #0f172a;
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .08s ease;
}
.btn:hover {
    border-color: #bfccde;
    background: linear-gradient(180deg, #ffffff 0%, #eef4fb 100%);
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}
.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.25), 0 1px 2px rgba(15, 23, 42, 0.08);
}
.btn:disabled,
.btn[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.btn-equal { min-width: 118px; }
.btn-primary {
    background: linear-gradient(180deg, #109489 0%, #0f766e 100%);
    color: #fff;
    border-color: #0f766e;
}
.btn-primary:hover {
    border-color: #0d6a63;
    background: linear-gradient(180deg, #14a79b 0%, #0f8278 100%);
}
table { width:100%; border-collapse:separate; border-spacing:0 14px; border:none; background:transparent; }
th, td { padding:8px 10px; text-align:left; }
thead th { background:#f8fafc; font-weight:600; border:1px solid var(--border); }
thead th:first-child { border-top-left-radius:10px; border-bottom-left-radius:10px; }
thead th:last-child { border-top-right-radius:10px; border-bottom-right-radius:10px; }
tbody td { background:#fff; border-top:1px solid var(--border); border-bottom:1px solid var(--border); }
tbody td:first-child { border-left:1px solid var(--border); border-top-left-radius:10px; border-bottom-left-radius:10px; }
tbody td:last-child { border-right:1px solid var(--border); border-top-right-radius:10px; border-bottom-right-radius:10px; }
label { display:block; margin:8px 0 4px; }
.checkbox-inline { display:flex; align-items:center; gap:8px; margin:10px 0; }
.checkbox-inline input { width:auto; }
.dsgvo-module-picker {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    max-height: 340px;
    overflow: auto;
    background: #fff;
}
.dsgvo-module-cat {
    position: sticky;
    top: -8px;
    z-index: 1;
    margin: 10px 0 6px;
    padding: 5px 8px;
    border-radius: 6px;
    background: #f1f5f9;
    font-size: 12px;
    color: #334155;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.dsgvo-module-cat:first-child { margin-top: 0; }
.dsgvo-module-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    margin: 0;
}
.dsgvo-module-item:hover { background: #f8fafc; }
.dsgvo-module-item input {
    width: auto;
    margin-top: 2px;
}
input, select, textarea { width:100%; padding:8px; border:1px solid var(--border); border-radius:6px; }
.inline { display:flex; gap:12px; }
.inline > div { flex:1; }
.inline-zip-city > div:first-child { flex:0 0 20%; }
.inline-zip-city > div:last-child { flex:0 0 80%; }
.badge { display:inline-block; padding:2px 8px; border-radius:999px; background:#e2e8f0; font-size:12px; }
.badge-blue { background:#dbeafe; color:#1e3a8a; }
.badge-green { background:#dcfce7; color:#166534; }
.badge-yellow { background:#fef9c3; color:#854d0e; }
.badge-red { background:#fee2e2; color:#991b1b; }
.right { text-align:right; }
.notice { padding:10px 12px; background:#ecfeff; border:1px solid #a5f3fc; border-radius:8px; }
.notice-error { background:#fee2e2; border-color:#fecaca; }
nav .active { text-decoration: underline; }
.nav-group { position: relative; display: inline-block; }
.nav-group > a { display:inline-block; }
.nav-menu { display:none; position:absolute; right:0; top:100%; background:#0b3d3a; border:1px solid rgba(255,255,255,0.2); border-radius:8px; padding:8px; min-width:180px; z-index:50; }
.nav-menu a { display:block; margin:4px 0; }
.nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu { display:block; }

/* Shared card/list UI (project-wide) */
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}
.section-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}
.list-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.list-card {
    border: 1px solid #cfd8e3;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}
.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.card-head .right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

/* Global modal shells */
body.modal-open { overflow: hidden; }
.wp-modal,
.m365-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    z-index: 100;
}
.wp-modal .wp-modal-card,
.m365-modal-card {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.wp-modal .wp-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.wp-modal pre {
    background: #f8fafc;
    padding: 12px;
    border-radius: 8px;
    overflow: auto;
}
.m365-modal-card table { border-spacing: 0; }
.m365-modal-card td {
    background: #fff;
    border: 1px solid var(--border);
    border-left: none;
    border-right: none;
}
.m365-modal-card td:first-child {
    width: 220px;
    font-weight: 600;
}

/* Chips / pills */
.domain-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2f7;
    font-size: 12px;
    border: 1px solid #e5e7eb;
    margin-right: 4px;
    margin-bottom: 4px;
}
.domain-chip.green {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}
.domain-chip.blue {
    background: #dbeafe;
    color: #1e3a8a;
    border-color: #bfdbfe;
}
.domain-chip.is-click {
    background: #e0f2fe;
    border-color: #bae6fd;
    cursor: pointer;
}
.domain-chip.is-click:hover { background: #bae6fd; }
.chip-more { display: none; }
.chip-more.is-open { display: inline; }
.chip-toggle {
    border: none;
    background: transparent;
    color: #0f766e;
    font-size: 12px;
    margin-left: 4px;
    cursor: pointer;
}
.chip-toggle:hover { text-decoration: underline; }
.pill {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 12px;
    background: #e2e8f0;
}
.pill-green { background: #dcfce7; color: #166534; }
.pill-red { background: #fee2e2; color: #991b1b; }
.pill-yellow { background: #fef9c3; color: #854d0e; }
.pill-blue { background: #dbeafe; color: #1e3a8a; }
.pill-gray { background: #e5e7eb; color: #374151; }

/* M365 / billing cards */
.m365-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.m365-item {
    position: relative;
    border: 1px solid #cfd8e3;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}
.m365-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--card-accent, #94a3b8);
}
.m365-item.alt { background: #fcfdff; }
.m365-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr)) minmax(150px, 170px);
    gap: 12px;
    align-items: start;
    padding: 12px 12px 12px 18px;
}
.m365-row-top {
    background: #f6f9fd;
    border-bottom: 1px solid #e4eaf2;
}
.m365-item.alt .m365-row-top { background: #f2f7fd; }
.m365-row-bottom {
    margin-top: 0;
    padding-top: 12px;
    background: #fbfdff;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}
.m365-tenant-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.m365-tenant-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px;
    background: #fff;
}
.m365-col { min-width: 0; }
.m365-label {
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 4px;
}
.m365-value { font-weight: 600; color: #111827; }
.m365-sub { font-size: 12px; color: #6b7280; margin-top: 2px; }
.m365-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    border-left: 1px solid #e4eaf2;
    padding-left: 12px;
}
.m365-actions form { width: 100%; }
.m365-actions .btn {
    width: 100%;
    justify-content: center;
    border-radius: 10px;
}

/* Billing section accents */
.billing-section {
    border-width: 2px;
}
.billing-section h3 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.billing-section-hosting-expiring {
    background: #fff7ed;
    border-color: #fdba74;
}
.billing-section-hosting-new {
    background: #f0f9ff;
    border-color: #7dd3fc;
}
.billing-section-domain-overdue {
    background: #fef2f2;
    border-color: #fca5a5;
}
.billing-section-domain-14 {
    background: #fff7ed;
    border-color: #fdba74;
}
.billing-section-domain-30 {
    background: #fefce8;
    border-color: #fde047;
}
.billing-section-domain-45 {
    background: #eff6ff;
    border-color: #93c5fd;
}
.billing-section-m365-new {
    background: #ecfeff;
    border-color: #67e8f9;
}
.billing-section-m365-14 {
    background: #fff7ed;
    border-color: #fdba74;
}
.billing-section-m365-30 {
    background: #fefce8;
    border-color: #fde047;
}
.billing-section-m365-45 {
    background: #eff6ff;
    border-color: #93c5fd;
}
.billing-step {
    width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    padding: 4px 8px;
    border: 1px solid transparent;
    margin-bottom: 4px;
}
.billing-step-todo {
    background: #dbeafe;
    color: #1e40af;
    border-color: #bfdbfe;
}
.billing-step-open {
    background: #fef3c7;
    color: #92400e;
    border-color: #fde68a;
}
.billing-step-done {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}
.billing-step-neutral {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

/* Antagus contacts */
table.handles-table {
    border: none;
    background: transparent;
    border-collapse: separate;
    border-spacing: 0 22px;
}
table.handles-table .handle-main td,
table.handles-table .row-sub td {
    background: #fff;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
}
table.handles-table .handle-main td { border-top: 1px solid var(--border); }
table.handles-table .row-sub td {
    border-bottom: 1px solid var(--border);
    border-top: none;
}
table.handles-table .handle-main td:first-child { border-top-left-radius: 12px; }
table.handles-table .handle-main td:last-child { border-top-right-radius: 12px; }
table.handles-table .row-sub td:first-child { border-bottom-left-radius: 12px; }
table.handles-table .row-sub td:last-child { border-bottom-right-radius: 12px; }
.row-sub { background: #f8fafc; }
.row-sub td {
    font-size: 12px;
    color: #374151;
    padding-bottom: 22px;
}
.row-label {
    font-weight: 600;
    margin-right: 8px;
    color: #111827;
}
.domain-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    line-height: 1.2;
}
.handles-table { border-spacing: 0; background: transparent; }
.handles-table tbody tr { display: block; }
.handles-table tbody td {
    display: block;
    border: none;
    padding: 0;
    background: transparent;
}
.handle-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    padding: 12px;
}
.handle-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.handle-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 10px;
    font-size: 12px;
    color: #374151;
}
.handle-domains { margin-top: 10px; }
.handles-table .handle-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}
.handle-gap { height: 16px; }
.row-gap td {
    padding: 0;
    height: 16px;
    border: none;
    background: transparent;
}
.meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 12px;
    color: #374151;
}
.meta-item { white-space: nowrap; }
.meta-item span.value { white-space: normal; }
.btn-compact {
    min-width: 0;
    height: 32px;
    padding: 0 10px;
}
.row-sub-actions {
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

/* Antagus domains */
.handle-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    background: #eef2f7;
    font-size: 12px;
    position: relative;
    cursor: help;
}
.handle-pill .tip {
    display: none;
    position: absolute;
    top: 24px;
    left: 0;
    z-index: 20;
    background: #111827;
    color: #fff;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 12px;
    min-width: 220px;
    max-width: 340px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    white-space: pre-line;
}
.handle-pill:hover .tip { display: block; }
.handle-pill .muted { color: #9ca3af; }
.handle-actions {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.domain-table {
    border-spacing: 0;
    border: none;
    background: transparent;
}
.domain-row { background: #fff; border-top: 1px solid #e5e7eb; }
.domain-detail-row td {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}
.domain-table td {
    border-left: none;
    border-right: 1px solid #e5e7eb;
}
.domain-table .domain-row td,
.domain-table .domain-detail-row td {
    border-top: 1px solid #e5e7eb;
}
.domain-row td:first-child,
.domain-detail-row td:first-child {
    box-shadow: inset 0 0 0 transparent;
}
.domain-row.is-highlight td:first-child,
.domain-detail-row.is-highlight td:first-child {
    box-shadow: inset 3px 0 0 #10b981;
}
.domain-row td:first-child,
.domain-row td:last-child,
.domain-detail-row td:first-child,
.domain-detail-row td:last-child { border-radius: 0; }
.domain-row td:first-child { border-top-left-radius: 0; }
.domain-row td:last-child { border-top-right-radius: 10px; }
.domain-row + .domain-detail-row td:first-child { border-bottom-left-radius: 0; }
.domain-row + .domain-detail-row td:last-child { border-bottom-right-radius: 10px; }
.domain-detail-row td {
    border-bottom-width: 6px;
    border-bottom-color: #f4f6f8;
}
.domain-detail-row + .domain-row td { padding-top: 16px; }
.domain-spacer td {
    padding: 0;
    height: 16px;
    border: none;
    background: transparent;
}

/* Contracts summaries */
.status-active { color: #166534; font-weight: 600; }
.status-inactive { color: #6b7280; }
.status-mu { color: #1e3a8a; font-weight: 600; }
.status-dropin { color: #7c3aed; font-weight: 600; }
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.summary-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 8px 10px;
    border-radius: 8px;
}
.summary-item.summary-danger {
    background: #fef2f2;
    border-color: #fecaca;
}
.summary-item.summary-danger .summary-value { color: #b91c1c; }
.summary-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .03em;
    margin-bottom: 4px;
}
.summary-value { font-weight: 600; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* Contract plan forms */
.plan-form { display: flex; flex-direction: column; gap: 14px; }
.plan-sections { display: grid; gap: 12px; }
.plan-section { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.plan-section h3 { margin: 0 0 8px; font-size: 16px; }
.plan-section-customer { background: #f0f9ff; border-color: #bae6fd; }
.plan-section-package { background: #f0fdf4; border-color: #bbf7d0; }
.plan-section-tech { background: #fff7ed; border-color: #fed7aa; }
.plan-section-billing { background: #f8fafc; border-color: #dbe4ea; }
.plan-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.plan-grid > div { min-width: 0; }
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Dashboard widgets */
.dashboard-widgets { display: flex; flex-direction: column; gap: 16px; }
.dashboard-widget { position: relative; }
.dashboard-widget.dragging { opacity: .55; }
.dashboard-widget .widget-handle {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: move;
    color: #94a3b8;
    font-size: 16px;
    user-select: none;
}
.dashboard-widget.widget-hidden { display: none; }
.widget-order-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.widget-order-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f8fafc;
    cursor: move;
}
.widget-order-item .drag-hint {
    color: #94a3b8;
    font-weight: 700;
    user-select: none;
}
.widget-order-item.dragging { opacity: .55; }

/* Favorites + custom navigation */
.fav-group { margin-top: 10px; }
.fav-group > .fav-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.fav-subhead,
.nav-subhead {
    font-size: 12px;
    color: #6b7280;
    margin: 6px 0 2px;
}
.fav-item,
.nav-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    margin: 6px 0;
}
.fav-left,
.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.fav-icon,
.nav-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex: 0 0 auto;
}
.fav-title,
.nav-title { font-weight: 600; }
.fav-url,
.nav-url {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 520px;
}
.fav-roles { font-size: 12px; color: #6b7280; }
.nav-sort-list { margin-top: 4px; }
.nav-item.dragging { opacity: 0.55; }
.nav-drag-handle {
    font-size: 12px;
    color: #6b7280;
    border: 1px dashed #d1d5db;
    border-radius: 6px;
    padding: 3px 6px;
    cursor: grab;
    user-select: none;
}
.nav-edit {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px;
    background: #f8fafc;
    margin: 0 0 8px 0;
}
.nav-edit .grid { margin-top: 6px; }

/* M365 audit */
.m365-audit-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.m365-audit-table td,
.m365-audit-table th { vertical-align: top; }
.m365-audit-table .raw-cell {
    max-width: 420px;
    word-break: break-word;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
}
.m365-audit-table .issues-list {
    margin: 0;
    padding-left: 18px;
}
.rustdesk-stats {
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.rustdesk-filter-row {
    flex-wrap: wrap;
    gap: 14px;
}
.rustdesk-filter-check {
    padding-top: 22px;
}
.rustdesk-check-label {
    display: flex;
    gap: 6px;
    align-items: center;
}
.contracts-wp-actions,
.contracts-actions-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 6px;
}
.contracts-actions-wrap {
    justify-content: flex-end;
}

@media (max-width: 600px) {
    .btn {
        width: 100%;
    }
    .card-head .btn {
        width: auto;
    }
    table.responsive-table {
        display: block;
        width: 100%;
        overflow: visible;
        white-space: normal;
        border-spacing: 0;
    }
    table.responsive-table thead {
        display: none;
    }
    table.responsive-table tbody {
        display: block;
    }
    table.responsive-table tbody tr {
        display: block;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: #fff;
        margin-bottom: 10px;
        overflow: hidden;
    }
    table.responsive-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;
        padding: 8px 10px;
        white-space: normal;
        border: none;
        border-bottom: 1px solid #eef2f7;
        border-radius: 0;
        background: transparent;
    }
    table.responsive-table tbody td:first-child,
    table.responsive-table tbody td:last-child {
        border-left: none;
        border-right: none;
        border-radius: 0;
    }
    table.responsive-table tbody td:last-child {
        border-bottom: none;
    }
    table.responsive-table tbody td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        font-size: 12px;
        color: var(--muted);
        font-weight: 600;
    }
    table.responsive-table tbody td .muted,
    table.responsive-table tbody td strong,
    table.responsive-table tbody td a {
        word-break: break-word;
        overflow-wrap: anywhere;
    }
    table.responsive-table tbody td .btn,
    table.responsive-table tbody td button.btn {
        white-space: nowrap;
        overflow-wrap: normal;
        word-break: normal;
    }
    table.responsive-table tbody td.right {
        justify-content: flex-start;
    }
    table.responsive-table tbody td.right form {
        width: 100%;
    }
    table.responsive-table tbody td.right .btn {
        width: 100%;
    }
    table.responsive-table tbody td.contracts-wp-cell,
    table.responsive-table tbody td.contracts-actions-cell {
        display: block;
    }
    table.responsive-table tbody td.contracts-wp-cell::before,
    table.responsive-table tbody td.contracts-actions-cell::before {
        display: block;
        margin-bottom: 8px;
    }
    .contracts-wp-actions,
    .contracts-actions-wrap {
        width: 100%;
        margin-top: 8px;
    }
    .contracts-wp-actions .btn,
    .contracts-actions-wrap .btn,
    .contracts-actions-wrap form {
        width: 100%;
    }
    .contracts-actions-wrap {
        justify-content: flex-start;
    }
    table.domain-table,
    table.handles-table {
        display: block;
        width: 100%;
        overflow-x: auto;
        white-space: nowrap;
        border-spacing: 0;
    }
    .m365-item::before {
        width: 3px;
    }
    .rustdesk-stats {
        align-items: flex-start;
    }
.rustdesk-filter-check {
        padding-top: 0;
    }
    .m365-row,
    .m365-row-bottom { grid-template-columns: 1fr; }
    .m365-tenant-grid { grid-template-columns: 1fr; }
    .handle-top { grid-template-columns: 1fr; }
}

/* Simple WYSIWYG editor */
.wysiwyg-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}
.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid var(--border);
    background: #f8fafc;
}
.wysiwyg-toolbar button {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
}
.wysiwyg-toolbar button.active {
    background: #e2e8f0;
}
.wysiwyg-toolbar button:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.wysiwyg-editor,
.wysiwyg-source {
    width: 100%;
    min-height: 320px;
    padding: 12px;
    border: 0;
    outline: 0;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}
.wysiwyg-editor:empty::before {
    content: 'Inhalt eingeben ...';
    color: #94a3b8;
}
