:root {
    --bg: #f6f8fb;
    --panel: rgba(255,255,255,0.95);
    --panel-strong: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --muted: #64748b;
    --soft: #94a3b8;
    --brand: #2563eb;
    --brand-2: #1d4ed8;
    --warning: #d97706;
    --danger: #dc2626;
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
}
body {
    font-family: 'Inter', system-ui, sans-serif;
    background:
        radial-gradient(circle at 15% 10%, rgba(37,99,235,.16), transparent 30%),
        radial-gradient(circle at 86% 12%, rgba(15,23,42,.08), transparent 30%),
        #f8fafc;
    color: var(--text);
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.platform-shell {
    height: 100vh;
    min-height: 100vh;
    position: relative;
    display: grid;
    grid-template-columns: 284px minmax(0, 1fr);
    background: transparent;
    overflow: hidden;
}

.platform-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(80px);
    pointer-events: none;
}
.glow-left { width: 380px; height: 380px; left: -120px; top: 80px; background: rgba(37,99,235,0.14); }
.glow-center { width: 520px; height: 520px; left: 30%; top: -80px; background: rgba(59,130,246,0.08); }
.glow-right { width: 420px; height: 420px; right: -80px; top: 120px; background: rgba(14,165,233,0.10); }

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 25;
    border-right: 1px solid rgba(255,255,255,.08);
    background: linear-gradient(180deg, #0f172a, #111827);
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(148,163,184,.45) transparent;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 6px 18px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
    width: 44px;
    height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, #34d399, #38bdf8 60%, #2563eb);
    box-shadow: 0 18px 36px rgba(37,99,235,.36);
}
.brand-title { font-size: 18px; font-weight: 700; line-height: 1.1; }
.brand-subtitle { font-size: 12px; color: #cbd5e1; margin-top: 3px; }

.sidebar-section { padding: 0; }
.sidebar-label, .eyebrow {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #94a3b8;
}
.stack-list { display: grid; gap: 10px; margin-top: 12px; }

.nav-chip, .nav-card, .action-row, .secondary-button, .primary-button {
    transition: all .18s ease;
}
.nav-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.05);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.78);
}
.nav-chip.active {
    background: rgba(52,211,153,0.15);
    border-color: rgba(74,222,128,0.30);
    color: white;
}
.nav-chip.muted { cursor: default; }
.nav-chip.active-app { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.15); color: white; }
.dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--brand);
}
.pill {
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 10px;
    text-transform: lowercase;
}
.pill-live { background: rgba(52,211,153,0.20); color: #a7f3d0; }
.pill-soon { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.42); }
.pill-active { background: rgba(52,211,153,0.20); color: #a7f3d0; }
.pill-in-progress { background: rgba(251,191,36,0.15); color: rgba(251,191,36,0.85); }
.app-chip-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.app-chip-body > span:first-child {
    color: #e2e8f0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}
.app-chip-desc {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 400;
    line-height: 1.35;
}

.nav-card {
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,.03);
    background: rgba(255,255,255,.03);
    color: #e2e8f0;
}
.nav-card:hover {
    background: rgba(255,255,255,.06);
    border-color: rgba(255,255,255,.08);
}
.nav-card.current {
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.12);
    box-shadow: inset 3px 0 0 #60a5fa;
}
.nav-card-title { font-weight: 700; font-size: 15px; line-height: 1.2; }
.nav-card-hint { margin-top: 4px; font-size: 12px; color: #9ca3af; line-height: 1.35; }

.context-box {
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 14px 8px 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    background: transparent;
}
.context-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #cbd5e1;
}
.context-row span { color: #94a3b8; }
.context-row strong { font-size: 12px; font-weight: 600; }

.content-area {
    position: relative;
    z-index: 1;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 40px;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: rgba(100,116,139,.45) transparent;
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 74px;
    padding: 0 30px;
    border-bottom: 1px solid var(--border);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px);
}

.sidebar::-webkit-scrollbar,
.content-area::-webkit-scrollbar {
    width: 10px;
}

.sidebar::-webkit-scrollbar-track,
.content-area::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(148,163,184,.45);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.content-area::-webkit-scrollbar-thumb {
    background: rgba(100,116,139,.45);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
.topbar-title { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-note {
    border: 1px solid var(--border);
    background: #ffffff;
    border-radius: 999px;
    padding: 10px 14px;
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}
.primary-button, .secondary-button {
    border-radius: 14px;
    border: 1px solid var(--border);
    padding: 10px 16px;
    min-height: 44px;
    cursor: pointer;
    font-weight: 800;
    font-size: 14px;
}
.primary-button {
    background: var(--brand);
    color: #ffffff;
    font-weight: 600;
    border-color: transparent;
}
.secondary-button {
    background: #ffffff;
    color: var(--text);
}
.primary-button:hover, .secondary-button:hover, .action-row:hover, .nav-chip:hover, .nav-card:hover, .table-row:hover {
    transform: translateY(-1px);
}

.stats-grid, .page-head, .main-grid {
    padding-left: 32px;
    padding-right: 32px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    padding-top: 28px;
}
.stat-card, .panel {
    border: 1px solid var(--border);
    background: var(--panel);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .10);
    backdrop-filter: blur(16px);
}
.stat-card { padding: 20px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 750; }
.stat-value { margin-top: 8px; font-size: 40px; font-weight: 700; letter-spacing: -.05em; line-height: 1; }

.page-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    padding-top: 28px;
}
.page-title { margin: 0; font-size: 28px; letter-spacing: -.04em; line-height: 1.2; }
.page-description {
    margin: 10px 0 0;
    max-width: 980px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.65;
}
.toolbar-form {
    display: flex;
    gap: 12px;
    width: min(540px, 100%);
}
.search-input {
    flex: 1;
    min-width: 0;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    padding: 14px 16px;
    outline: none;
}
.search-input::placeholder { color: #94a3b8; }

select.search-input {
    color: var(--text);
    background-color: #ffffff;
}

select.search-input option {
    color: var(--text);
    background-color: #ffffff;
}

.main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    padding-top: 20px;
}
.panel { padding: 16px; }
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 4px 6px 16px;
}
.panel-head.compact { padding-top: 2px; }
.panel-title { font-size: 24px; font-weight: 700; }
.panel-title.big { font-size: 32px; }
.panel-subtitle { margin-top: 6px; color: var(--muted); font-size: 14px; }

.table-wrap {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--border);
}
.table-header, .table-row {
    display: grid;
    align-items: center;
}
.licenses-table { grid-template-columns: 1.2fr 0.9fr 0.9fr 0.8fr 1fr 0.9fr; }
.users-table { grid-template-columns: 1.1fr 1.2fr 0.9fr 0.8fr 0.8fr; }
.failures-table { grid-template-columns: 1.2fr 0.8fr 0.9fr 0.6fr 1fr 1fr; }
.table-header {
    background: #f8fafc;
    padding: 14px 18px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #64748b;
}
.table-row {
    padding: 16px 18px;
    border-top: 1px solid #eef2f7;
    color: #1e293b;
}
.table-row.selected { background: linear-gradient(90deg, rgba(37,99,235,.08), rgba(14,165,233,.06)); }
.cell-link { display: block; }
.cell-title { color: #0f172a; font-weight: 600; }
.holiday-break-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.cell-subtitle { margin-top: 4px; font-size: 13px; color: #64748b; }

.details-panel { padding: 20px; }
.hero-card {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 16px;
    padding: 18px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.hero-title { font-size: 30px; font-weight: 700; }
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}
.failure-message {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    color: #334155;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
}
.detail-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    border-radius: 22px;
    border: 1px solid var(--border);
    background: #ffffff;
}
.detail-card span { font-size: 14px; color: #64748b; }
.detail-card strong { font-size: 16px; }

.actions-box {
    margin-top: 18px;
    padding: 16px;
    border-radius: 26px;
    border: 1px solid var(--border);
    background: #ffffff;
}
.actions-title { margin-bottom: 12px; color: var(--muted); font-weight: 600; }
.failure-section-title { margin-bottom: 12px; color: var(--muted); font-weight: 600; }
.action-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    margin-top: 10px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
}

.table-actions-cell {
    position: relative;
    display: flex;
    justify-content: flex-end;
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    cursor: pointer;
}

.icon-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    min-width: 220px;
    padding: 8px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .14);
}

.action-menu-item {
    display: flex;
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    text-align: left;
}

.action-menu-item:hover,
.action-menu-item-button:hover {
    background: #f8fbff;
}

.action-menu-item-button {
    cursor: pointer;
    font: inherit;
}

.action-menu-item-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.10);
}
.status-active { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.status-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.status-danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

@media (max-width: 1400px) {
    .main-grid { grid-template-columns: 1fr; }
    .details-panel { order: -1; }
}

@media (max-width: 1180px) {
    .platform-shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100vh;
        width: 280px;
        z-index: 150;
        border-right: 1px solid rgba(255,255,255,.08);
        border-bottom: 0;
        background: linear-gradient(180deg, #0f172a, #111827);
        transform: translateX(-100%);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    .sidebar.mobile-open { transform: translateX(0); }
    .mobile-menu-btn { display: flex; }
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-head { flex-direction: column; align-items: stretch; }
    .toolbar-form { width: 100%; }
    .topbar { padding-left: 64px; }
}

@media (max-width: 860px) {
    .stats-grid, .page-head, .main-grid { padding-left: 18px; padding-right: 18px; }
    .topbar { padding-left: 64px; padding-right: 18px; flex-direction: column; align-items: stretch; gap: 14px; }
    .topbar-actions { flex-wrap: wrap; }
    .topbar-note { display: none; }
    .page-title { font-size: 40px; }
    .details-grid { grid-template-columns: 1fr; }
    .toolbar-form { flex-direction: column; }
    .licenses-table, .users-table, .failures-table, .table-header, .table-row { grid-template-columns: 1fr; }
    .table-header { display: none; }
    .table-row { gap: 10px; }
}

/* ─── KIVO / KSeF table grids ────────────────────────────────────── */
.schools-table { grid-template-columns: 1.4fr 0.9fr 1fr 0.8fr 0.9fr 0.8fr 0.5fr; }
.invoices-table { grid-template-columns: 0.4fr 1.5fr 0.9fr 0.9fr; }
.invoices-table-full { grid-template-columns: 0.4fr 1.5fr 0.9fr 0.7fr 1fr 0.9fr; }
.kivo-users-table { grid-template-columns: 1.2fr 1.4fr 0.8fr 0.5fr; }
.tenants-table { grid-template-columns: 0.4fr 1.4fr 1fr 0.7fr; }

/* ─── Nav section headers (inside navigation stack) ─────────────── */
.nav-section-header {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #64748b;
    padding: 8px 4px 0;
}

/* ─── Alert bars ─────────────────────────────────────────────────── */
.alert-bar {
    margin: 12px 32px 0;
    padding: 14px 18px;
    border-radius: 18px;
    font-size: 14px;
    font-weight: 500;
}
.alert-success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
}
.alert-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ─── Filter chips row (Schools page) ───────────────────────────── */
.filters-row {
    padding: 12px 32px 0;
}
.filter-chips-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.filter-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--muted);
    font-size: 14px;
    cursor: pointer;
    transition: all .18s ease;
}
.filter-chip input[type="checkbox"] { display: none; }
.filter-chip.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.filter-chip:hover { transform: translateY(-1px); }

/* ─── Utility text colours ────────────────────────────────────────── */
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }

/* ─── Form labels ─────────────────────────────────────────────────── */
.form-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.modal-open {
    overflow: hidden;
}

.modal-shell {
    position: fixed;
    inset: 0;
    z-index: 200;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15,23,42,0.35);
    backdrop-filter: blur(10px);
}

.modal-card {
    position: relative;
    width: min(680px, calc(100% - 32px));
    margin: 72px auto 0;
    padding: 20px;
    border-radius: 28px;
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .16);
}

.modal-summary-grid {
    margin-top: 6px;
}

.modal-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 6px;
}

/* ─── Auth / Login ─────────────────────────────────────────────── */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.auth-glow {
    position: absolute;
    border-radius: 999px;
    filter: blur(100px);
    pointer-events: none;
}
.auth-glow-left  { width: 500px; height: 500px; left: -160px; top: 50%; transform: translateY(-60%); background: rgba(37,99,235,0.14); }
.auth-glow-right { width: 420px; height: 420px; right: -100px; bottom: 0; background: rgba(14,165,233,0.12); }

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 24px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 32px;
    padding: 40px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
    backdrop-filter: blur(20px);
}

.auth-brand {
    border-bottom: none;
    padding: 0 0 28px;
    margin-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.auth-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 12px;
    line-height: 1.2;
}

.auth-desc {
    font-size: 14px;
    color: var(--muted);
    margin: 0 0 28px;
    line-height: 1.6;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.microsoft-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    border-radius: 18px;
    border: 1px solid var(--border);
    background: #ffffff;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
}
.microsoft-button:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.ms-icon { flex-shrink: 0; }

/* ─── Mobile Sidebar Toggle ──────────────────────────────────────── */
.mobile-menu-btn {
    display: none;
    position: fixed;
    top: 24px;
    left: 16px;
    z-index: 140;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,.92);
    backdrop-filter: blur(12px);
    color: var(--text);
    cursor: pointer;
    transition: all .18s ease;
}
.mobile-menu-btn:hover {
    background: #ffffff;
    border-color: #cbd5e1;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 149;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* ─── App Drawer ─────────────────────────────────────────────────── */
.drawer-toggle-btn {
    margin-left: auto;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 12px;
    color: #e2e8f0;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .18s ease;
    flex-shrink: 0;
}
.drawer-toggle-btn:hover {
    color: #ffffff;
    background: rgba(255,255,255,.12);
    border-color: rgba(255,255,255,.25);
}

.drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0,0,0,0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.app-drawer {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 290px;
    z-index: 200;
    background: linear-gradient(180deg, #0f172a, #111827);
    border-right: 1px solid rgba(255,255,255,.08);
    padding: 24px 20px;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.app-drawer.open {
    transform: translateX(0);
}

.app-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.drawer-close-btn {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    color: #cbd5e1;
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .18s ease;
}
.drawer-close-btn:hover {
    color: #ffffff;
    background: rgba(255,255,255,.10);
    border-color: rgba(255,255,255,.25);
}

.drawer-empty {
    color: #cbd5e1;
    font-size: 14px;
    padding: 4px 0;
}

@media (max-width: 480px) {
    .app-drawer { width: 100%; }
}

.inline-form {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

/* ─── Home Screen ────────────────────────────────────────────────── */
.home-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}
.home-login-button {
    display: block;
    text-align: center;
    width: 100%;
    padding: 14px 20px;
    font-size: 15px;
    border-radius: 18px;
}
.home-login-button:hover, .home-login-button:focus-visible { transform: translateY(-1px); }

/* ─── EntraID ────────────────────────────────────────────────────── */
.entra-users-table { grid-template-columns: 1.1fr 1.2fr 1fr 1.4fr 0.7fr; }

.tag-chip {
    display: inline-block;
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
    padding: 2px 7px;
    margin: 2px 3px 2px 0;
    white-space: nowrap;
}

.alert-banner {
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 14px;
    margin: 0 32px 16px;
}
.alert-success { background: #dcfce7; border: 1px solid #bbf7d0; color: #166534; }
.alert-warning { background: #fef3c7; border: 1px solid #fde68a; color: #92400e; }
.alert-error   { background: #fee2e2; border: 1px solid #fecaca; color: #991b1b; }
.alert-banner a { color: inherit; text-decoration: underline; }

.table-empty {
    padding: 28px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.panel-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}

.main-grid.single-col {
    grid-template-columns: 1fr;
}

.details-empty {
    padding: 24px 20px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Settings list (EntraID app config panel) */
.settings-list {
    padding: 8px 0;
}
.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-info { flex: 1 1 auto; }
.settings-title { font-size: 14px; font-weight: 500; }

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 42px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    inset: 0;
    background: #e2e8f0;
    border-radius: 12px;
    transition: background 0.2s;
}
.toggle-slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: #6366f1; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }

@media (max-width: 900px) {
    .entra-users-table { grid-template-columns: 1fr; }
}

/* ─── Infinite scroll ────────────────────────────────────────────── */
.scroll-sentinel { height: 1px; }
.scroll-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 16px;
}
.scroll-loading-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--brand);
    animation: scroll-bounce 1.2s infinite ease-in-out;
}
.scroll-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.scroll-loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes scroll-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
.scroll-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    font-size: 13px;
    color: var(--danger);
}
