/* Administrator authentication */
.auth-page {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #eef1f4;
    color: #15202b;
    font-family: "Segoe UI", sans-serif;
}

.auth-panel {
    width: min(100%, 420px);
    padding: 32px;
    border: 1px solid #ccd3da;
    border-top: 4px solid #d22f2f;
    background: #fff;
    box-shadow: 0 18px 45px rgba(28, 39, 49, .12);
}

.auth-panel h1 {
    margin: 4px 0 24px;
    font-size: 28px;
}

.auth-panel form {
    display: grid;
    gap: 10px;
}

.auth-panel input {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid #aeb8c2;
    font: inherit;
}

.auth-panel button {
    margin-top: 10px;
}

.auth-notice {
    display: grid;
    gap: 6px;
    padding: 12px;
    border-left: 3px solid #d22f2f;
    background: #f4f6f8;
}

.auth-notice code {
    overflow-wrap: anywhere;
}
:root {
    --console-ink: #1d2926;
    --console-muted: #687772;
    --console-canvas: #f3f7f5;
    --console-surface: #ffffff;
    --console-quiet: #f8fbfa;
    --console-line: #dce5e1;
    --console-line-strong: #c9d7d1;
    --console-accent: #007d6c;
    --console-accent-deep: #005d51;
    --console-highlight: #e5ff74;
    --console-danger: #bc3f4c;
}

html,
body {
    background: var(--console-canvas);
    color: var(--console-ink);
    font-family: Bahnschrift, Aptos, "Arial Narrow", sans-serif;
    font-size: 16px;
}

body { min-width: 320px; overflow-x: clip; }
a { color: var(--console-accent-deep); text-decoration-color: rgba(0, 93, 81, 0.28); text-underline-offset: 0.16em; }
a:hover { color: #00483f; }
body main { background: var(--console-canvas); }
body .sidebar { background: #15211f !important; }
body .content { margin: 0 auto; max-width: 1440px; padding-bottom: 3.5rem !important; padding-top: 2.5rem !important; }

body .page-heading { align-items: flex-end; display: flex; gap: 1.5rem; justify-content: space-between; margin-bottom: 2.25rem; }
body .eyebrow { color: var(--console-accent); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; margin: 0 0 0.5rem; text-transform: uppercase; }
body .page-heading h1,
body .section-heading h2,
body .settings-section h2 { color: var(--console-ink); font-weight: 750; letter-spacing: 0; }
body .page-heading h1 { font-size: 2.25rem; line-height: 1.05; margin: 0; }
body .page-summary,
body .field-note,
body .muted { color: var(--console-muted); }
body .page-summary { font-size: 0.98rem; line-height: 1.55; margin: 0.65rem 0 0; max-width: 48rem; }
body .heading-actions { align-items: flex-end; display: flex; flex-direction: column; gap: 0.5rem; }
body .heading-timestamp { color: var(--console-muted); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }

body .btn { border-radius: 5px; font-size: 0.84rem; font-weight: 750; min-height: 2.45rem; padding: 0.53rem 0.85rem; }
body .btn-primary { background: var(--console-accent); border-color: var(--console-accent); box-shadow: 0 2px 0 rgba(0, 56, 48, 0.18); }
body .btn-primary:hover,
body .btn-primary:focus { background: var(--console-accent-deep); border-color: var(--console-accent-deep); }
body .btn-outline-primary { border-color: #a7c9c0; color: var(--console-accent-deep); }
body .btn-outline-primary:hover { background: #e5f4ef; border-color: var(--console-accent); color: var(--console-accent-deep); }
body .btn-outline-danger { border-color: #e2b4ba; color: #a62f3e; }
body .btn-outline-danger:hover { background: #fff1f2; border-color: var(--console-danger); color: #942333; }

body .status-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 2.5rem; }
body .status-panel,
body .settings-section,
body .work-list,
body .data-section { background: var(--console-surface); border: 1px solid var(--console-line); border-radius: 7px; box-shadow: 0 8px 20px rgba(27, 49, 41, 0.035); }
body .status-panel { border-top: 3px solid var(--console-accent); display: flex; flex-direction: column; min-height: 10.25rem; padding: 1.25rem; }
body .status-panel:nth-child(2) { border-top-color: #9d740d; }
body .status-panel:nth-child(3) { border-top-color: #596f89; }
body .status-label { color: var(--console-muted); font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; margin-bottom: auto; text-transform: uppercase; }
body .status-panel strong { font-size: 1.48rem; line-height: 1.2; margin: 1rem 0 0.45rem; }
body .status-panel small,
body .work-item small { color: var(--console-muted); font-size: 0.82rem; line-height: 1.4; }
body .status-dot { border-radius: 50%; display: inline-block; height: 0.55rem; margin-right: 0.42rem; vertical-align: 0.08em; width: 0.55rem; }
body .healthy { background: #16a875; box-shadow: 0 0 0 3px #ddf5eb; }
body .pending { background: #d18a20; box-shadow: 0 0 0 3px #fff1d8; }

body .work-list { overflow: hidden; }
body .section-heading { border-bottom: 1px solid var(--console-line); padding: 1.35rem 1.5rem 1.1rem; }
body .section-heading h2,
body .settings-section h2 { font-size: 1.16rem; margin: 0; }
body .work-item { align-items: center; border-bottom: 1px solid var(--console-line); display: grid; gap: 1rem; grid-template-columns: 2.2rem 1fr auto; padding: 1.15rem 1.5rem; text-decoration: none; transition: background-color 140ms ease; }
body .work-item:last-child { border-bottom: 0; }
body .work-item:not(.disabled):hover { background: #f3fbf8; }
body .work-item strong,
body .work-item small { display: block; }
body .work-item strong { color: var(--console-ink); font-size: 0.94rem; margin-bottom: 0.18rem; }
body .work-index { color: var(--console-accent); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; }
body .work-action { color: var(--console-accent-deep); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }

body .settings-stack { display: grid; gap: 1rem; max-width: 1100px; }
body .settings-section { padding: 1.5rem; }
body .settings-stack,
body .settings-stack > *,
body .settings-section,
body .settings-section > *,
body .form-grid > * { min-width: 0; }
body .directory-create { margin-bottom: 1.5rem; max-width: 1100px; }
body .settings-section-header { align-items: flex-start; border-bottom: 1px solid var(--console-line); display: flex; justify-content: space-between; margin-bottom: 1.35rem; padding-bottom: 1rem; }
body .profile-accordion { background: var(--console-surface); border: 1px solid var(--console-line); border-radius: 7px; box-shadow: 0 8px 20px rgba(27, 49, 41, 0.035); overflow: clip; }
body .profile-accordion > summary { align-items: center; cursor: pointer; display: flex; gap: 1rem; justify-content: space-between; list-style: none; padding: 1.15rem 3.65rem 1.15rem 1.5rem; position: relative; }
body .profile-accordion > summary::-webkit-details-marker { display: none; }
body .profile-accordion > summary::after { color: var(--console-accent-deep); content: "+"; font-size: 1.35rem; font-weight: 500; line-height: 1; position: absolute; right: 1.5rem; top: 50%; transform: translateY(-50%); }
body .profile-accordion[open] > summary { background: #fbfdfc; border-bottom: 1px solid var(--console-line); }
body .profile-accordion[open] > summary::after { content: "−"; }
body .profile-accordion h2 { color: var(--console-ink); font-size: 1.16rem; font-weight: 750; letter-spacing: 0; margin: 0; }
body .profile-accordion .eyebrow { margin-bottom: 0.35rem; }
body .profile-accordion-body { min-width: 0; padding: 1.5rem; }
body .profile-accordion-body > .field-note:first-child { margin-top: 0; }
body .profile-protocol-fields { border-top: 1px solid var(--console-line); margin-top: 1.5rem; padding-top: 1.35rem; }
body .profile-protocol-fields .eyebrow { margin-bottom: 1rem; }
body .accordion-count { color: var(--console-muted); font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
body .profile-accordion-danger { border-color: #efd1d5; }
body .profile-accordion-danger .eyebrow { color: #a62f3e; }
body .switch-control,
body .filter-control { align-items: center; color: #4d5f58; display: inline-flex; font-size: 0.8rem; font-weight: 700; gap: 0.5rem; }
body .switch-control input,
body .filter-control input { accent-color: var(--console-accent); height: 1rem; width: 1rem; }
body .form-grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
body .directory-form-grid,
body .policy-form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body .form-grid label { color: #33443d; display: block; font-size: 0.78rem; font-weight: 800; margin-bottom: 0.43rem; }
body .form-control,
body .form-select { background: #fff; border-color: var(--console-line-strong); border-radius: 5px; color: var(--console-ink); max-width: 100%; min-height: 2.6rem; width: 100%; }
body .form-control:hover,
body .form-select:hover { border-color: #9db7ae; }
body .form-control:focus,
body .form-select:focus { border-color: var(--console-accent); box-shadow: 0 0 0 0.2rem rgba(0, 125, 108, 0.12); }
body .profile-subnets { min-height: 7rem; resize: vertical; }
body .field-note { font-size: 0.78rem; line-height: 1.45; margin: 0.6rem 0 0; }
body .form-actions { align-items: center; border-top: 1px solid var(--console-line); display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: flex-end; margin-top: 1.35rem; padding-top: 1.15rem; }
body .save-confirmation { color: #087552; font-size: 0.82rem; font-weight: 750; }
body .form-error { color: #aa2e3e; font-size: 0.82rem; font-weight: 750; margin-right: auto; }
body .upgrade-failure { background: #fff8f8; border: 1px solid #edc9ce; border-left: 3px solid var(--console-danger); border-radius: 5px; margin-top: 1.25rem; overflow: hidden; }
body .upgrade-failure-heading { align-items: center; border-bottom: 1px solid #f0d8db; color: #982b3a; display: flex; font-size: 0.82rem; font-weight: 800; justify-content: space-between; padding: 0.7rem 0.85rem; }
body .upgrade-failure-heading small { color: #8a6a6f; font-size: 0.66rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; }
body .upgrade-log { background: #241e20; color: #f4e9eb; font-family: Consolas, "Courier New", monospace; font-size: 0.75rem; line-height: 1.55; margin: 0; max-height: 24rem; overflow: auto; padding: 0.9rem; white-space: pre-wrap; word-break: break-word; }
body .invitation-profile-picker { border-top: 1px solid var(--console-line); margin-top: 1.35rem; }
body .invitation-profile-picker .data-section-header { padding-left: 0; padding-right: 0; }
body .invitation-profile-picker input[type="checkbox"] { accent-color: var(--console-accent); height: 1rem; width: 1rem; }

body .data-section { overflow: hidden; }
body .data-section-header { align-items: flex-end; border-bottom: 1px solid var(--console-line); display: flex; justify-content: space-between; padding: 1.35rem 1.5rem; }
body .data-section-header h2 { font-size: 1.15rem; margin: 0; }
body .empty-state { color: var(--console-muted); font-size: 0.9rem; margin: 0; padding: 1.5rem; }
body .table-wrap { overflow-x: auto; }
body .data-table { border-collapse: collapse; min-width: 760px; width: 100%; }
body .data-table th { background: var(--console-quiet); border-bottom: 1px solid var(--console-line); color: #63736c; font-size: 0.65rem; font-weight: 800; letter-spacing: 0.1em; padding: 0.85rem 1.5rem; text-align: left; text-transform: uppercase; white-space: nowrap; }
body .data-table td { border-bottom: 1px solid var(--console-line); color: #374740; font-size: 0.86rem; padding: 1rem 1.5rem; vertical-align: middle; }
body .data-table tbody tr:last-child td { border-bottom: 0; }
body .data-table tbody tr:hover { background: #f6fbf9; }
body .data-table strong,
body .data-table small { display: block; }
body .data-table strong { color: var(--console-ink); font-size: 0.9rem; }
body .data-table small { color: var(--console-muted); font-size: 0.76rem; margin-top: 0.16rem; }
body .data-table code { background: #eff5f2; border: 1px solid #dce8e2; border-radius: 4px; color: #38554a; font-size: 0.72rem; padding: 0.2rem 0.3rem; }
body .origin-badge,
body .state-badge { border-radius: 999px; display: inline-block; font-size: 0.69rem; font-weight: 800; letter-spacing: 0.02em; padding: 0.28rem 0.55rem; }
body .origin-badge { background: #e6f2ee; color: #176451; }
body .state-active { background: #dff5e9; color: #08734e; }
body .state-pending { background: #fff0d9; color: #9c5b09; }
body .state-muted { background: #eef2f0; color: #64726c; }
body .state-revoked { background: #fce5e7; color: #a42a3c; }

body .drive-topbar { align-items: center; background: rgba(255, 255, 255, 0.92); border-bottom: 1px solid var(--console-line); display: flex; height: 4.25rem; justify-content: space-between; }
body .topbar-context { align-items: center; display: flex; gap: 0.7rem; }
body .topbar-logo { display: block; height: 1.65rem; width: 1.65rem; }
body .topbar-kicker { color: #6b7874; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; }
body .topbar-title { color: #24332e; font-size: 0.94rem; font-weight: 700; }
body .topbar-health { align-items: center; color: #4f5f59; display: flex; font-size: 0.78rem; font-weight: 650; gap: 0.45rem; }
body .topbar-health-dot { background: #18a877; border-radius: 50%; box-shadow: 0 0 0 3px #dff6ec; height: 0.45rem; width: 0.45rem; }

body .sidebar .brand-block { align-items: flex-start; border-bottom: 1px solid rgba(255, 255, 255, 0.1); display: flex; flex-direction: column; height: 5.75rem; justify-content: center; padding: 0 1.4rem; }
body .sidebar .navbar-brand { align-items: center; display: flex; text-decoration: none; }
body .sidebar .brand-logo { display: block; height: auto; max-width: 100%; width: 11.6rem; }
body .sidebar .product-version { color: #8fa29a; font-size: 0.66rem; font-weight: 750; margin-top: 0.4rem; }
body .sidebar .nav-item { font-size: 0.9rem; padding: 0 0.8rem 0.25rem; }
body .sidebar .nav-item .nav-link { align-items: center; background: transparent; border: 1px solid transparent; border-radius: 6px; color: #b7c7c1; display: flex; gap: 0.75rem; height: 2.8rem; line-height: 1; width: 100%; }
body .sidebar .nav-item .nav-link span:last-child { white-space: nowrap; }
body .sidebar .nav-item a.active { background: rgba(229, 255, 116, 0.1); border-color: rgba(229, 255, 116, 0.18); color: #f8fffa; }
body .sidebar .nav-item .nav-link:hover { background: rgba(255, 255, 255, 0.055); color: #f8fffa; }
body .sidebar .nav-index { color: #70857d; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.08em; width: 1.45rem; }
body .sidebar .nav-item a.active .nav-index { color: var(--console-highlight); }
body .sidebar .nav-section-label { color: #71837c; font-size: 0.62rem; font-weight: 800; letter-spacing: 0.14em; margin: 1.55rem 1.4rem 0.7rem; text-transform: uppercase; }
body .sidebar .nav-section-system { margin-top: 2.15rem; }
body .drive-topbar .topbar-health { white-space: nowrap; }

body .console-drawer-backdrop { background: rgba(19, 35, 30, 0.38); inset: 0; position: fixed; z-index: 100; }
body .console-drawer { background: var(--console-surface); border-left: 1px solid var(--console-line); box-shadow: -18px 0 42px rgba(20, 42, 35, 0.18); display: flex; flex-direction: column; height: 100vh; inset: 0 0 0 auto; max-width: 44rem; position: fixed; width: min(44rem, 100vw); z-index: 101; }
body .console-drawer-header { align-items: flex-start; border-bottom: 1px solid var(--console-line); display: flex; justify-content: space-between; padding: 2rem 2rem 1.35rem; }
body .console-drawer-header h2 { color: var(--console-ink); font-size: 1.4rem; margin: 0; }
body .console-drawer-header .field-note { margin-bottom: 0; max-width: 34rem; }
body .console-drawer-close { align-items: center; background: var(--console-quiet); border: 1px solid var(--console-line); border-radius: 5px; color: var(--console-ink); cursor: pointer; display: inline-flex; font-size: 1.5rem; height: 2.4rem; justify-content: center; line-height: 1; margin-left: 1rem; width: 2.4rem; }
body .console-drawer-close:hover { background: #edf5f1; border-color: var(--console-line-strong); }
body .console-drawer-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.5rem 2rem 2rem; }
body .console-drawer-body .settings-section { border: 0; box-shadow: none; padding: 0; }
body .console-drawer-body .form-actions { margin-bottom: 0; }
body .profile-setup-steps { display: grid; gap: 0.5rem; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; margin: 0 0 1.75rem; padding: 0; }
body .profile-setup-steps li { align-items: center; color: var(--console-muted); display: flex; font-size: 0.74rem; font-weight: 750; gap: 0.45rem; min-width: 0; white-space: nowrap; }
body .profile-setup-steps span { align-items: center; background: #e9efec; border: 1px solid var(--console-line); border-radius: 50%; display: inline-flex; flex: 0 0 auto; height: 1.45rem; justify-content: center; width: 1.45rem; }
body .profile-setup-steps .is-current { color: var(--console-accent-deep); }
body .profile-setup-steps .is-current span { background: var(--console-accent); border-color: var(--console-accent); color: #fff; }
body .profile-setup-steps .is-complete { color: #08734e; }
body .profile-setup-steps .is-complete span { background: #dff5e9; border-color: #b8e4cd; }
body .profile-setup-step h3 { color: var(--console-ink); font-size: 1.05rem; margin: 0 0 1.35rem; }
body .profile-setup-wide { grid-column: 1 / -1; }
body .profile-setup-toggle { align-items: flex-start; background: var(--console-quiet); border: 1px solid var(--console-line); border-radius: 6px; cursor: pointer; display: flex !important; gap: 0.75rem; margin-top: 1.25rem; padding: 0.95rem 1rem; }
body .profile-setup-toggle input { accent-color: var(--console-accent); flex: 0 0 auto; height: 1rem; margin-top: 0.2rem; width: 1rem; }
body .profile-setup-toggle strong { color: var(--console-ink); display: block; font-size: 0.84rem; }
body .profile-setup-toggle small { color: var(--console-muted); display: block; font-size: 0.78rem; font-weight: 400; line-height: 1.4; margin-top: 0.25rem; }
body .setup-callout { background: #fff7e5; border: 1px solid #efd9a5; border-radius: 6px; color: #79530b; font-size: 0.84rem; line-height: 1.5; margin: 0; padding: 1rem; }

@media (min-width: 641px) {
    body .page { display: block; min-height: 100vh; }
    body .sidebar { bottom: 0; height: 100vh; left: 0; min-width: 264px; position: fixed; top: 0; width: 264px !important; z-index: 10; }
    body .page > main { margin-left: 264px; min-width: 0; overflow-x: clip; width: calc(100% - 264px); }
    body .page > main .content { box-sizing: border-box; min-width: 0; width: 100%; }
    body .sidebar .nav-scrollable { display: flex; flex-direction: column; height: calc(100vh - 5.75rem); overflow-x: hidden; overflow-y: auto; }
    body .sidebar .nav { flex: 1 1 auto; min-height: 0; }
    body .top-row,
    body article { padding-left: 2.5rem !important; padding-right: 2.5rem !important; }
    body .data-section { min-width: 0; }
    body .table-wrap { max-width: 100%; overscroll-behavior-inline: contain; }
}

@media (max-width: 760px) {
    body .page-heading { align-items: flex-start; flex-direction: column; margin-bottom: 1.5rem; }
    body .heading-actions { align-items: flex-start; }
    body .status-grid,
    body .form-grid,
    body .directory-form-grid,
    body .policy-form-grid { grid-template-columns: 1fr; }
    body .content { padding: 1.35rem 1rem 2.5rem !important; }
    body .settings-section { padding: 1.1rem; }
    body .data-section-header { align-items: flex-start; gap: 1rem; padding: 1.1rem; }
    body .form-actions { align-items: stretch; flex-direction: column; }
    body .form-actions .btn { width: 100%; }
    body .console-drawer { max-width: none; width: 100vw; }
    body .console-drawer-header { padding: 1.35rem 1rem 1rem; }
    body .console-drawer-body { padding: 1.1rem 1rem 1.5rem; }
}