:root {
    --ink: #13263a;
    --muted: #667789;
    --line: #dfe8ed;
    --surface: #ffffff;
    --surface-soft: #f5f9fa;
    --canvas: #edf4f5;
    --teal: #159b96;
    --teal-dark: #0c716f;
    --teal-soft: #e5f7f4;
    --blue: #3179db;
    --coral: #f47f72;
    --coral-soft: #fff0ed;
    --amber: #cc862a;
    --amber-soft: #fff5df;
    --danger: #c64e56;
    --danger-soft: #ffeff0;
    --shadow: 0 18px 55px rgba(30, 63, 75, .09);
    --shadow-soft: 0 8px 25px rgba(30, 63, 75, .06);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 13px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    text-rendering: optimizeLegibility;
}

body {
    margin: 0;
    min-height: 100vh;
}

button,
input,
select {
    font: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

code {
    overflow-wrap: anywhere;
    color: var(--teal-dark);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9em;
}

.api-tabs {
    display: flex;
    gap: 8px;
    margin: -8px 0 24px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, .72);
}

.api-tab {
    padding: 11px 16px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 750;
}

.api-tab:hover,
.api-tab.active {
    background: var(--surface);
    color: var(--teal-dark);
    box-shadow: var(--shadow-soft);
}

.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.section-gap-small { margin-top: 18px; }
.connection-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.connection-card { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-soft); }
.connection-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.connection-card-heading span:first-child { color: var(--muted); font-size: 11px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.connection-card h4 { margin: 5px 0 0; font-size: 17px; }
.detail-list.compact .detail-row { display: block; }
.detail-list.compact dd { margin-top: 5px; text-align: left; }
.guide-steps { display: grid; gap: 16px; margin: 0; padding-left: 24px; }
.guide-steps li { padding-left: 7px; }
.guide-steps strong, .guide-steps span { display: block; }
.guide-steps span { margin-top: 4px; color: var(--muted); line-height: 1.55; }
.text-link { color: var(--blue); font-weight: 700; }
.notice { padding: 14px 16px; border-left: 4px solid var(--teal); border-radius: 10px; background: var(--teal-soft); color: var(--ink); line-height: 1.55; }

@media (max-width: 1050px) {
    .connection-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .api-tabs { display: grid; grid-template-columns: 1fr; }
}

.skip-link {
    position: fixed;
    z-index: 999;
    top: 12px;
    left: 12px;
    padding: 10px 14px;
    transform: translateY(-150%);
    border-radius: 10px;
    background: var(--ink);
    color: #fff;
}

.skip-link:focus {
    transform: translateY(0);
}

.admin-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 24px 18px;
    border-right: 1px solid rgba(255, 255, 255, .14);
    overflow-y: auto;
    background:
        radial-gradient(circle at 20% 5%, rgba(52, 211, 194, .2), transparent 28%),
        linear-gradient(165deg, #102f3b 0%, #0b2632 55%, #112d40 100%);
    color: #fff;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 2px 8px 28px;
}

.brand-mark {
    width: 45px;
    height: 45px;
    border-radius: 13px;
    box-shadow: 0 10px 24px rgba(22, 169, 166, .25);
}

.brand-copy strong,
.brand-copy span {
    display: block;
}

.brand-copy strong {
    font-size: 19px;
    letter-spacing: -.02em;
}

.brand-copy span {
    margin-top: 2px;
    color: #9fc2cb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.nav-section {
    margin: 18px 10px 8px;
    color: #759ba6;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.nav {
    display: grid;
    gap: 5px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #bfd4da;
    font-size: 14px;
    font-weight: 650;
    transition: .18s ease;
}

.nav-link:hover {
    background: rgba(255, 255, 255, .06);
    color: #fff;
}

.nav-link.active {
    border-color: rgba(100, 225, 209, .18);
    background: linear-gradient(110deg, rgba(38, 185, 177, .2), rgba(53, 131, 213, .12));
    color: #fff;
}

.nav-icon {
    display: inline-grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, .08);
    color: #8fe0d6;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .02em;
}

.nav-link.active .nav-icon {
    background: #36bdb3;
    color: #062e34;
}

.billing-nav-group {
    position: relative;
}

.nav-submenu {
    position: fixed;
    z-index: 50;
    top: 50%;
    left: 268px;
    display: grid;
    width: 236px;
    max-height: min(72vh, 620px);
    overflow-y: auto;
    gap: 3px;
    padding: 10px;
    border: 1px solid color-mix(in srgb, var(--sidebar-text) 18%, transparent);
    border-radius: 12px;
    background: var(--sidebar-bg);
    box-shadow: 0 18px 46px rgba(0, 0, 0, .28);
    opacity: 0;
    visibility: hidden;
    transform: translate(-6px, -50%);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}

.billing-nav-group:hover .nav-submenu,
.billing-nav-group:focus-within .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translate(0, -50%);
}

.billing-nav-group:hover > .nav-link,
.billing-nav-group:focus-within > .nav-link {
    color: var(--sidebar-text);
    background: color-mix(in srgb, var(--sidebar-text) 12%, transparent);
}

.admin-shell.is-collapsed .nav-submenu {
    left: 74px;
}

.nav-sublink {
    color: var(--sidebar-muted);
    border-radius: 8px;
    padding: 7px 9px;
    font-size: .82rem;
    line-height: 1.25;
    text-decoration: none;
}

.nav-sublink:hover,
.nav-sublink.active {
    color: var(--sidebar-text);
    background: color-mix(in srgb, var(--sidebar-text) 15%, transparent);
}

.nav-sublink.active {
    box-shadow: inset 3px 0 0 #36bdb3;
    font-weight: 700;
}

@media (max-width: 820px) {
    .nav-submenu {
        position: static;
        width: auto;
        max-height: none;
        margin: 4px 0 8px 38px;
        border-radius: 9px;
        box-shadow: none;
        transform: translateY(-4px);
    }

    .billing-nav-group:hover .nav-submenu,
    .billing-nav-group:focus-within .nav-submenu {
        transform: translateY(0);
    }
}

.billing-function-card {
    display: block;
    color: inherit;
    text-decoration: none;
}

.billing-function-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.financial-statement .numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.statement-deduction td:first-child {
    padding-left: 32px;
}

.statement-subtotal td,
.statement-total td,
.statement-grand-total td {
    font-weight: 750;
}

.statement-subtotal td {
    border-top: 1px solid var(--line);
}

.statement-total td,
.statement-grand-total td {
    border-top: 2px solid var(--line);
}

.statement-grand-total td {
    background: var(--surface-soft);
    font-size: 1.02rem;
}

.amount-negative { color: var(--danger); }
.amount-positive { color: var(--teal); }

.report-footnote {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px 18px;
    padding: 14px 18px;
    color: var(--muted);
    font-size: 12px;
}

.sidebar-footer {
    margin-top: auto;
    padding: 20px 8px 4px;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 16px;
    background: rgba(255, 255, 255, .045);
}

.avatar {
    display: inline-grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #43d1c3, #3a8ae5);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.avatar.small {
    width: 32px;
    height: 32px;
    font-size: 11px;
}

.sidebar-user-copy {
    min-width: 0;
    flex: 1;
}

.sidebar-user-copy strong,
.sidebar-user-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-copy strong {
    font-size: 13px;
}

.sidebar-user-copy span {
    margin-top: 3px;
    color: #8cabb4;
    font-size: 11px;
}

.main {
    min-width: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.page {
    flex: 1 0 auto;
}

.legal-footer {
    display: grid;
    flex: 0 0 auto;
    gap: 3px;
    padding: 18px clamp(20px, 4vw, 48px) max(18px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    color: var(--muted);
    text-align: center;
    font-size: 12px;
    line-height: 1.6;
}

.legal-footer span {
    color: var(--ink);
    font-weight: 750;
}

.legal-footer small {
    font-size: 12px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 16px clamp(20px, 4vw, 48px);
    border-bottom: 1px solid rgba(210, 224, 228, .8);
    backdrop-filter: blur(18px);
    background: rgba(245, 249, 250, .84);
}

.topbar-title span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.topbar-title h1 {
    margin: 0;
    font-size: clamp(19px, 2vw, 25px);
    letter-spacing: -.03em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.button.mobile-menu {
    display: none;
}

.page {
    width: min(1500px, 100%);
    margin: 0 auto;
    padding: 34px clamp(20px, 4vw, 48px) 56px;
}

.page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.page-heading h2 {
    margin: 0 0 7px;
    font-size: clamp(24px, 3vw, 34px);
    letter-spacing: -.045em;
}

.page-heading p {
    max-width: 700px;
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.grid {
    display: grid;
    gap: 20px;
}

.metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.two-column {
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
}

.metric-card,
.panel {
    border: 1px solid rgba(215, 228, 232, .95);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.metric-card {
    position: relative;
    min-height: 164px;
    padding: 22px;
    overflow: hidden;
}

.metric-card::after {
    position: absolute;
    width: 92px;
    height: 92px;
    right: -28px;
    bottom: -35px;
    border-radius: 50%;
    background: var(--accent-soft, var(--teal-soft));
    content: "";
}

.metric-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.metric-symbol {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: var(--accent-soft, var(--teal-soft));
    color: var(--accent, var(--teal));
    font-size: 12px;
    font-weight: 850;
}

.metric-value {
    margin-top: 24px;
    font-size: clamp(31px, 4vw, 42px);
    font-weight: 800;
    letter-spacing: -.055em;
}

.metric-foot {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.accent-blue {
    --accent: var(--blue);
    --accent-soft: #eaf2ff;
}

.accent-coral {
    --accent: var(--coral);
    --accent-soft: var(--coral-soft);
}

.accent-amber {
    --accent: var(--amber);
    --accent-soft: var(--amber-soft);
}

.panel {
    overflow: hidden;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--line);
}

.panel-title h3 {
    margin: 0;
    font-size: 17px;
    letter-spacing: -.025em;
}

.panel-title p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.panel-body {
    padding: 22px;
}

.panel-body.flush {
    padding: 0;
}

.section-gap {
    margin-top: 22px;
}

.button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 11px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 750;
    line-height: 1;
    transition: .18s ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--teal), #2386c7);
    color: #fff;
    box-shadow: 0 8px 20px rgba(23, 150, 150, .18);
}

.button-secondary {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
}

.button-danger {
    border-color: #f4cdd0;
    background: var(--danger-soft);
    color: var(--danger);
}

.button-ghost {
    border-color: rgba(255, 255, 255, .12);
    background: transparent;
    color: #c4d8dd;
}

.button-small {
    min-height: 34px;
    padding: 7px 11px;
    font-size: 12px;
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    white-space: nowrap;
}

.status::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    content: "";
}

.status-active,
.status-healthy,
.status-configured {
    background: var(--teal-soft);
    color: var(--teal-dark);
}

.status-suspended,
.status-failed {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-pending {
    background: var(--amber-soft);
    color: var(--amber);
}

.status-closed,
.status-canceled,
.status-expired,
.status-dismissed {
    background: #edf1f2;
    color: #58686f;
}

.status-open,
.status-reviewing,
.status-grace_period,
.status-past_due {
    background: var(--amber-soft);
    color: var(--amber);
}

.status-resolved {
    background: var(--teal-soft);
    color: var(--teal-dark);
}

.status-refunded,
.status-chargeback {
    background: var(--danger-soft);
    color: var(--danger);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 18px;
}

.form-stack {
    display: grid;
    gap: 12px;
}

.form-stack textarea.input {
    min-height: 96px;
    resize: vertical;
}

.detail-list dt {
    margin-top: 14px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    text-transform: uppercase;
}

.detail-list dd {
    margin: 4px 0 0;
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }
}

.table-wrap {
    max-width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    color: #6c7d89;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: left;
    text-transform: uppercase;
}

.table td {
    padding: 15px 18px;
    border-bottom: 1px solid #edf2f4;
    vertical-align: middle;
}

.table tr:last-child td {
    border-bottom: 0;
}

.table tbody tr {
    transition: background .15s ease;
}

.table tbody tr:hover {
    background: #fbfdfd;
}

.person {
    display: flex;
    min-width: 190px;
    align-items: center;
    gap: 10px;
}

.person-copy {
    min-width: 0;
}

.person-copy strong,
.person-copy span {
    display: block;
}

.person-copy strong {
    overflow: hidden;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-copy span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.empty {
    padding: 44px 24px;
    color: var(--muted);
    text-align: center;
}

.empty strong {
    display: block;
    margin-bottom: 6px;
    color: var(--ink);
}

.activity-list,
.check-list,
.detail-list {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-item,
.check-item,
.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid #edf2f4;
}

.activity-item:first-child,
.check-item:first-child,
.detail-row:first-child {
    padding-top: 0;
}

.activity-item:last-child,
.check-item:last-child,
.detail-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.activity-copy strong,
.activity-copy span {
    display: block;
}

.activity-copy strong {
    font-size: 13px;
}

.activity-copy span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
}

.activity-time {
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.module-card {
    min-height: 120px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(155deg, #fff, #f7fbfb);
}

.module-card span {
    display: inline-block;
    margin-bottom: 14px;
    color: var(--teal);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.module-card strong {
    display: block;
    font-size: 14px;
}

.module-card p {
    margin: 7px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.filters {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 180px auto;
    gap: 12px;
}

.input,
.select {
    width: 100%;
    min-height: 42px;
    padding: 10px 13px;
    border: 1px solid #d6e1e5;
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font-size: 13px;
}

.input:focus,
.select:focus {
    border-color: #72c9c2;
    box-shadow: 0 0 0 3px rgba(40, 181, 172, .12);
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding: 13px 15px;
    border: 1px solid #bee6df;
    border-radius: 13px;
    background: var(--teal-soft);
    color: var(--teal-dark);
    font-size: 13px;
    font-weight: 650;
}

.flash-error {
    border-color: #f1c7cb;
    background: var(--danger-soft);
    color: var(--danger);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
}

.pagination-actions {
    display: flex;
    gap: 8px;
}

.profile-hero {
    display: flex;
    align-items: center;
    gap: 18px;
}

.profile-hero .avatar {
    width: 62px;
    height: 62px;
    font-size: 20px;
}

.profile-hero h2 {
    margin: 0 0 6px;
    font-size: 26px;
    letter-spacing: -.04em;
}

.profile-hero p {
    margin: 0;
    color: var(--muted);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.tag {
    display: inline-flex;
    padding: 6px 9px;
    border-radius: 8px;
    background: #edf5f7;
    color: #3c6570;
    font-size: 11px;
    font-weight: 700;
}

.detail-row dt {
    color: var(--muted);
    font-size: 12px;
}

.detail-row dd {
    margin: 0;
    max-width: 65%;
    font-size: 13px;
    font-weight: 650;
    text-align: right;
    word-break: break-word;
}

.action-stack {
    display: grid;
    gap: 10px;
}

.action-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.action-card strong {
    display: block;
    margin-bottom: 5px;
    font-size: 13px;
}

.action-card p {
    margin: 0 0 13px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 14%, rgba(52, 211, 194, .18), transparent 28%),
        radial-gradient(circle at 88% 80%, rgba(59, 130, 246, .14), transparent 30%),
        #edf5f5;
}

.login-card {
    display: grid;
    width: min(980px, 100%);
    min-height: 570px;
    grid-template-columns: 1.05fr .95fr;
    overflow: hidden;
    border: 1px solid rgba(208, 223, 226, .9);
    border-radius: 30px;
    background: #fff;
    box-shadow: var(--shadow);
}

.login-story {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(34px, 6vw, 62px);
    overflow: hidden;
    background:
        radial-gradient(circle at 80% 10%, rgba(64, 222, 207, .21), transparent 28%),
        linear-gradient(155deg, #0b303a, #123f50 58%, #1b5570);
    color: #fff;
}

.login-story::after {
    position: absolute;
    width: 350px;
    height: 350px;
    right: -170px;
    bottom: -190px;
    border: 70px solid rgba(255, 255, 255, .04);
    border-radius: 50%;
    content: "";
}

.login-brand {
    display: flex;
    align-items: center;
    gap: 13px;
}

.login-brand img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.login-brand strong {
    display: block;
    font-size: 20px;
}

.login-brand span {
    display: block;
    margin-top: 3px;
    color: #a7ccd2;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.login-story-copy {
    position: relative;
    z-index: 1;
}

.login-story-copy span {
    display: inline-flex;
    padding: 7px 10px;
    border: 1px solid rgba(114, 225, 213, .2);
    border-radius: 999px;
    background: rgba(48, 190, 180, .1);
    color: #7be0d5;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.login-story h1 {
    margin: 20px 0 16px;
    font-size: clamp(32px, 5vw, 50px);
    line-height: 1.05;
    letter-spacing: -.055em;
}

.login-story p {
    max-width: 450px;
    margin: 0;
    color: #bad0d6;
    line-height: 1.75;
}

.login-foot {
    color: #779fa9;
    font-size: 11px;
}

.login-form {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(34px, 6vw, 64px);
}

.login-form .eyebrow {
    color: var(--teal);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.login-form h2 {
    margin: 11px 0 10px;
    font-size: 31px;
    letter-spacing: -.045em;
}

.login-form > p {
    margin: 0 0 28px;
    color: var(--muted);
    line-height: 1.65;
}

.sso-button {
    width: 100%;
    min-height: 52px;
    border-radius: 14px;
    font-size: 14px;
}

.security-note {
    display: flex;
    gap: 10px;
    margin-top: 22px;
    padding: 14px;
    border-radius: 13px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.security-dot {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-top: 5px;
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 4px var(--teal-soft);
}

.button:disabled,
.button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .52;
    transform: none;
}

.selection-single-action[aria-disabled="true"] {
    background: var(--surface-soft);
    border-style: dashed;
}

.button-ghost-light {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.page-heading-actions,
.row-actions,
.bulk-actions,
.list-commandbar,
.list-titlebar,
.list-footer,
.per-page,
.form-actions {
    display: flex;
    align-items: center;
}

.page-heading-actions,
.row-actions,
.bulk-actions,
.per-page,
.form-actions {
    gap: 8px;
}

.list-commandbar {
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
}

.list-commandbar .filters {
    min-width: 0;
    flex: 1;
    grid-template-columns: minmax(240px, 1fr) 170px auto auto;
}

.list-titlebar {
    justify-content: space-between;
    gap: 18px;
    padding: 19px 22px;
    border-bottom: 1px solid var(--line);
}

.bulk-actions .select {
    width: 190px;
}

.selection-count {
    min-width: 92px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-align: right;
}

.account-environment-panel {
    display: grid;
    gap: 18px;
    margin-bottom: 22px;
    padding: 22px;
}

.account-environment-panel .panel-title h2 {
    margin: 0;
    font-size: clamp(20px, 2.4vw, 27px);
    letter-spacing: -.035em;
}

.account-environment-panel .panel-title p,
.account-environment-boundary {
    max-width: 900px;
    margin: 7px 0 0;
    color: var(--muted);
    line-height: 1.65;
}

.account-environment-panel .page-heading-actions,
.user-list-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.user-list-panel .list-commandbar {
    align-items: stretch;
    flex-wrap: wrap;
}

.user-list-panel .list-commandbar .filters {
    flex: 1 1 100%;
}

.user-list-actions {
    width: 100%;
}

.selection-hint {
    padding: 9px 22px;
    border-bottom: 1px solid var(--line);
    background: #fbfdfd;
    color: var(--muted);
    font-size: 11px;
}

.select-column {
    width: 48px;
    padding-right: 4px !important;
    text-align: center !important;
}

.select-column input[type="checkbox"],
.check-card input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--teal);
    cursor: pointer;
}

.selectable-table tbody tr[data-selectable-row] {
    cursor: default;
}

.selectable-table tbody tr.is-selected {
    background: var(--teal-soft);
}

.selectable-table tbody tr.is-selected:hover {
    background: #dff4f0;
}

.actions-column {
    min-width: 190px;
    text-align: right !important;
}

.row-actions {
    justify-content: flex-end;
    white-space: nowrap;
}

.row-actions form {
    margin: 0;
}

.inline-editor {
    position: relative;
}

.inline-editor > summary {
    list-style: none;
}

.inline-editor > summary::-webkit-details-marker {
    display: none;
}

.inline-editor[open] > form {
    display: grid;
    gap: 12px;
    min-width: min(340px, 82vw);
    margin-top: 10px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    text-align: left;
    white-space: normal;
}

.inline-editor label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.list-footer {
    justify-content: space-between;
    gap: 18px;
    padding: 16px 22px;
    border-top: 1px solid var(--line);
    background: #fbfdfd;
    color: var(--muted);
    font-size: 12px;
}

.list-range {
    min-width: 220px;
}

.per-page label {
    white-space: nowrap;
}

.per-page .select {
    width: 76px;
    min-height: 34px;
    padding: 6px 9px;
}

.page-link {
    display: inline-flex;
    min-width: 34px;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
}

.page-link:hover {
    border-color: #9fd5d0;
    color: var(--teal-dark);
}

.page-link.active {
    border-color: var(--teal);
    background: var(--teal);
    color: #fff;
}

.page-link[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .45;
}

.form-panel {
    max-width: 920px;
}

.member-form-panel {
    max-width: 1080px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.form-group {
    display: grid;
    align-content: start;
    gap: 7px;
}

.form-group label {
    color: var(--ink);
    font-size: 12px;
    font-weight: 750;
}

.form-span-2 {
    grid-column: span 2;
}

.form-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.form-fieldset legend {
    margin-bottom: 2px;
    padding: 0;
    color: var(--ink);
    font-size: 12px;
    font-weight: 750;
}

.field-help {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.5;
}

.check-card {
    display: flex !important;
    align-items: flex-start;
    gap: 11px;
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    cursor: pointer;
}

.check-card input {
    flex: 0 0 auto;
    margin-top: 2px;
}

.check-card strong,
.check-card small {
    display: block;
}

.member-form-person {
    width: fit-content;
    min-width: min(100%, 320px);
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.permission-groups {
    display: grid;
    gap: 12px;
}

.permission-group {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.permission-group h4 {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: .09em;
}

.permission-group .check-card {
    background: var(--surface);
}

.compact-check-card {
    min-width: 0;
    padding: 10px 12px;
}

.compact-check-card strong {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11px;
}

.guardians-list {
    max-width: 240px;
    white-space: normal;
}

.check-card small {
    margin-top: 5px;
    color: var(--muted);
    font-weight: 400;
    line-height: 1.5;
}

.form-actions {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 18px;
    align-items: start;
}

.settings-form,
.settings-sidebar {
    min-width: 0;
}

.setting-source {
    width: fit-content;
    padding: 4px 7px;
    border-radius: 7px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
}

.settings-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.settings-integration {
    align-items: flex-start;
}

.settings-integration .status {
    flex: 0 0 auto;
}

.danger-zone {
    border-color: #f0c9cc;
    background: var(--danger-soft);
}

@media (max-width: 1100px) {
    .metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .two-column {
        grid-template-columns: 1fr;
    }

    .settings-layout {
        grid-template-columns: 1fr;
    }

    .list-footer {
        flex-wrap: wrap;
    }

    .list-range {
        flex: 1;
    }
}

@media (max-width: 820px) {
    .admin-shell {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        transform: translateX(-105%);
        width: min(310px, 88vw);
        box-shadow: 24px 0 60px rgba(3, 26, 35, .25);
        transition: transform .22s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .button.mobile-menu {
        display: inline-flex;
    }

    .topbar {
        min-height: 68px;
    }

    .login-card {
        grid-template-columns: 1fr;
    }

    .login-story {
        min-height: 300px;
    }

    .login-foot {
        display: none;
    }

    .list-commandbar,
    .list-titlebar {
        align-items: stretch;
        flex-direction: column;
    }

    .list-commandbar .filters {
        width: 100%;
        grid-template-columns: minmax(200px, 1fr) 160px auto;
    }

    .bulk-actions {
        flex-wrap: wrap;
    }

    .selection-count {
        margin-right: auto;
        text-align: left;
    }
}

@media (max-width: 620px) {
    .topbar {
        gap: 8px;
        padding: 10px 20px;
    }

    .topbar > .topbar-actions:first-child {
        min-width: 0;
        flex: 1;
    }

    .topbar-title {
        min-width: 0;
    }

    .topbar-title span {
        display: none;
    }

    .topbar-title h1 {
        overflow: hidden;
        font-size: 16px;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar .status {
        padding: 5px 7px;
        font-size: 10px;
    }

    .button.mobile-menu {
        min-height: 36px;
        padding: 8px 11px;
    }

    .page {
        padding-top: 24px;
    }

    .metrics,
    .module-grid {
        grid-template-columns: 1fr;
    }

    .page-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .filters {
        grid-template-columns: 1fr;
    }

    .list-commandbar .filters,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-span-2 {
        grid-column: span 1;
    }

    .list-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .list-range {
        min-width: 0;
    }

    .pagination-actions {
        flex-wrap: wrap;
    }

    .page-heading-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .topbar-actions > a.button-secondary {
        display: none;
    }

    .login-page {
        padding: 0;
    }

    .login-card {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .login-story {
        min-height: 250px;
        padding: 28px;
    }

    .login-story h1 {
        font-size: 34px;
    }

    .login-story p {
        font-size: 13px;
    }

    .login-form {
        padding: 34px 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

.rbac-form { margin-top: 18px; }
.rbac-toolbar { position: sticky; top: 72px; z-index: 5; background: var(--surface); }
.rbac-tree { display: grid; gap: 18px; margin-top: 18px; }
.rbac-cluster, .rbac-screen { border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.rbac-node-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.rbac-cluster-row { background: var(--surface-elevated); border-radius: 16px 16px 0 0; }
.rbac-node-icon, .rbac-action-icon { width: 36px; height: 36px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 10px; flex: 0 0 auto; }
.rbac-node-icon > svg, .rbac-action-icon > svg { width: 20px; height: 20px; max-width: 20px; max-height: 20px; display: block; flex: 0 0 auto; }
.rbac-node-copy { display: grid; gap: 3px; flex: 1; }.rbac-node-copy small, .rbac-action small { color: var(--muted); }
.rbac-children { position: relative; display: grid; gap: 12px; padding: 14px 14px 14px 46px; }
.rbac-children::before { content: ""; position: absolute; top: 0; bottom: 32px; left: 25px; width: 2px; background: var(--border); }
.rbac-screen { position: relative; overflow: visible; }
.rbac-screen::before { content: ""; position: absolute; top: 31px; left: -21px; width: 21px; height: 2px; background: var(--border); }
.rbac-actions { position: relative; display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 1px; padding-left: 30px; background: var(--border); border-top: 1px solid var(--border); overflow: hidden; }
.rbac-actions::before { content: ""; position: absolute; top: 0; bottom: 25px; left: 15px; width: 2px; background: var(--border); z-index: 1; }
.rbac-action { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface); cursor: pointer; }
.rbac-action::before { content: ""; position: absolute; top: 50%; left: -15px; width: 15px; height: 2px; background: var(--border); }
.rbac-action > input { position: absolute; opacity: 0; pointer-events: none; }.rbac-action > span:nth-child(3) { display: grid; gap: 2px; flex: 1; }
.rbac-switch { width: 44px; height: 26px; border: 0; border-radius: 999px; padding: 3px; background: var(--muted); cursor: pointer; }
.rbac-switch span { display: block; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); transform: translateX(0); transition: transform .16s; }
.rbac-switch[aria-checked="true"], .rbac-action input:checked ~ .visual-switch { background: var(--accent); }.rbac-switch[aria-checked="true"] span, .rbac-action input:checked ~ .visual-switch span { transform: translateX(18px); }.rbac-switch.is-mixed { background: var(--warning); }
.visual-switch { pointer-events: none; flex: 0 0 auto; }
@media (max-width: 700px) { .rbac-children { padding-left: 38px; }.rbac-children::before { left: 19px; }.rbac-screen::before { left: -19px; width: 19px; }.rbac-actions { grid-template-columns: 1fr; }.rbac-toolbar { position: static; }.rbac-node-row { padding: 12px; } }

/* Cross-page readability and touch-target floor. */
:where(.admin-shell,.login-page) :where(small,.eyebrow,.metric-label,.metric-foot,.table-subtext,th,.selection-count){font-size:max(12px,1em)}
@media (max-width:900px),(pointer:coarse){
    :where(.button,button,input,select,textarea,[role="button"]){min-height:44px}
    :where(input,select,textarea){font-size:16px}
    :where(input[type="checkbox"],input[type="radio"]){min-width:24px;min-height:24px}
}

/* eMyHome Admin design layer — aligned with the AI Portal visual rules. */
:root {
    color-scheme: light;
    --canvas: #f3f7f4;
    --surface: #ffffff;
    --surface-soft: #f7faf8;
    --ink: #17261c;
    --muted: #5a6b61;
    --line: rgba(28, 75, 46, .2);
    --teal: #0c7038;
    --teal-dark: #07572a;
    --teal-soft: #e7f5eb;
    --blue: #286c4b;
    --shadow: 0 18px 50px rgba(20, 55, 33, .08);
    --shadow-soft: 0 6px 18px rgba(20, 55, 33, .06);
    --sidebar-bg: #0b100d;
    --sidebar-text: #d5e1d8;
    --sidebar-muted: #7f9185;
    --control-bg: #ffffff;
    --focus-ring: #075f30;
    --disabled-bg: #e4ebe6;
    --disabled-text: #52645a;
    --on-accent: #ffffff;
}

:root[data-theme-resolved="dark"] {
    color-scheme: dark;
    --canvas: #070b09;
    --surface: #101712;
    --surface-soft: #162019;
    --ink: #f1f7f3;
    --muted: #9aaba0;
    --line: rgba(255, 255, 255, .13);
    --teal: #83ef9e;
    --teal-dark: #a1f8b3;
    --teal-soft: rgba(71, 185, 97, .13);
    --blue: #92d7aa;
    --coral-soft: rgba(244, 127, 114, .12);
    --amber-soft: rgba(204, 134, 42, .12);
    --danger-soft: rgba(198, 78, 86, .13);
    --shadow: 0 18px 50px rgba(0, 0, 0, .28);
    --shadow-soft: 0 6px 18px rgba(0, 0, 0, .2);
    --sidebar-bg: #050806;
    --sidebar-text: #d7e3da;
    --sidebar-muted: #84948a;
    --control-bg: #0b120e;
    --focus-ring: #a8ffbc;
    --disabled-bg: #1b241e;
    --disabled-text: #9aaba0;
    --on-accent: #071009;
}

:where(a,button,input,select,textarea,[tabindex]):focus-visible {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

:where(button,input,select,textarea):disabled {
    color: var(--disabled-text);
    background-color: var(--disabled-bg);
    opacity: 1;
}

body,
.main {
    background: var(--canvas);
    color: var(--ink);
}

.admin-shell {
    grid-template-columns: 270px minmax(0, 1fr);
    transition: grid-template-columns .2s ease;
}

.admin-shell.is-collapsed {
    grid-template-columns: 78px minmax(0, 1fr);
}

.sidebar {
    height: 100dvh;
    padding: 22px 16px;
    /* The menu scrolls inside the sticky rail; overflow: visible let a long
       menu spill past the shell onto the page footer. Flyout submenus are
       position: fixed, so clipping the rail does not cut them off. */
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .28) transparent;
    border-right-color: rgba(255, 255, 255, .1);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    transition: padding .2s ease, width .2s ease;
}

.sidebar-brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 52px;
    margin-bottom: 24px;
}

.brand {
    min-width: 0;
    padding: 0;
}

.brand-mark {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 11px;
    box-shadow: none;
}

.brand-copy span,
.nav-section {
    color: var(--sidebar-muted);
}

.sidebar-collapse,
.icon-button,
.theme-cycle,
.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    cursor: pointer;
}

.sidebar-collapse {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-color: rgba(255, 255, 255, .14);
    border-radius: 9px;
    background: rgba(255, 255, 255, .06);
    color: var(--sidebar-text);
}

.sidebar-collapse svg {
    transition: transform .2s ease;
}

.admin-shell.is-collapsed .sidebar {
    padding-inline: 12px;
}

.admin-shell.is-collapsed .sidebar-brand-row {
    justify-content: center;
    flex-direction: column;
}

.admin-shell.is-collapsed .brand-copy,
.admin-shell.is-collapsed .nav-section,
.admin-shell.is-collapsed .nav-label,
.admin-shell.is-collapsed .sidebar-footer-note span {
    display: none;
}

.admin-shell.is-collapsed .nav-link {
    justify-content: center;
    padding-inline: 8px;
}

.admin-shell.is-collapsed .sidebar-collapse svg {
    transform: rotate(180deg);
}

.nav-link {
    color: var(--sidebar-text);
}

.nav-link:hover,
.nav-link.active {
    border-color: rgba(131, 239, 158, .22);
    background: rgba(131, 239, 158, .09);
    color: #ffffff;
}

.nav-icon,
.nav-link.active .nav-icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    color: #a8dcb7;
}

.nav-icon svg,
.admin-icon,
.ui-icon,
.button svg,
.health-link svg,
.theme-cycle svg,
.user-menu svg,
.sidebar-footer-note svg {
    width: 18px;
    height: 18px;
    max-width: 18px;
    max-height: 18px;
    flex: 0 0 18px;
}

.sidebar-footer-note {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    padding: 16px 10px 4px;
    color: var(--sidebar-muted);
    font-size: 12px;
}

.topbar {
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: blur(14px);
}

.topbar-leading,
.topbar-trailing {
    min-width: 0;
}

.topbar-trailing {
    justify-content: flex-end;
}

.icon-button,
.theme-cycle,
.health-link,
.language-switch,
.user-menu-trigger {
    min-height: 38px;
    border-radius: 10px;
}

.icon-button {
    width: 38px;
}

.mobile-menu {
    display: none;
}

.health-link,
.theme-cycle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.language-switch {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.language-switch button {
    min-width: 34px;
    height: 30px;
    padding: 0 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.language-switch button.active {
    background: var(--surface);
    color: var(--teal-dark);
    box-shadow: var(--shadow-soft);
}

.theme-cycle:hover,
.health-link:hover,
.icon-button:hover,
.user-menu-trigger:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

.user-menu {
    position: relative;
}

.user-menu-trigger {
    gap: 8px;
    padding: 4px 8px 4px 5px;
}

.user-menu-trigger .avatar {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    font-size: 11px;
}

.user-menu-name {
    max-width: 140px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-menu-panel {
    position: absolute;
    z-index: 70;
    top: calc(100% + 9px);
    right: 0;
    width: 246px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.user-menu-panel[hidden] {
    display: none;
}

.user-menu-summary {
    display: grid;
    gap: 3px;
    padding: 10px 11px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 5px;
}

.user-menu-summary span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
}

.user-menu-panel a,
.user-menu-panel button {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    font-size: 13px;
    text-align: left;
}

.user-menu-panel a:hover,
.user-menu-panel button:hover {
    background: var(--surface-soft);
}

.page {
    max-width: 1500px;
}

.eyebrow {
    display: block;
    margin-bottom: 8px;
    color: var(--teal-dark);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .14em;
}

.panel,
.metric-card,
.module-card,
.action-card,
.connection-card,
.api-tabs,
.input,
.select,
.button-secondary,
.button-ghost-light,
.page-link {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink);
    box-shadow: none;
}

.panel,
.metric-card,
.module-card,
.action-card {
    border: 1px solid var(--line);
}

.button {
    gap: 7px;
}

.button-primary {
    background: var(--teal-dark);
    color: var(--on-accent);
}

.button.icon-only {
    width: 34px;
    min-height: 34px;
    padding: 0;
}

.input,
.select {
    background: var(--control-bg);
}

.search-field {
    position: relative;
    display: flex;
    min-width: 250px;
    align-items: center;
}

.search-field svg {
    position: absolute;
    left: 12px;
    width: 17px;
    color: var(--muted);
    pointer-events: none;
}

.search-field .input {
    width: 100%;
    padding-left: 38px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.list-commandbar,
.list-titlebar,
.selection-hint,
.list-footer {
    border-color: var(--line);
    background: var(--surface-soft);
}

.list-titlebar {
    background: var(--surface);
}

.table th {
    background: var(--surface-soft);
    color: var(--muted);
}

.table td {
    border-color: var(--line);
    background: var(--surface);
}

.table tbody tr:hover td,
.selectable-table tbody tr.is-selected td {
    background: var(--teal-soft);
}

.selection-count,
.selection-hint,
.list-range,
.panel-title p,
.person-copy span {
    color: var(--muted);
}

input[type="checkbox"] {
    accent-color: var(--teal-dark);
}

/* Domain administration follows the same panel, metric and list language as core operations. */
.domain-metrics .metric-card {
    min-height: 148px;
}

.button-count {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--teal-soft);
    color: var(--teal-dark);
    font-size: 11px;
    font-weight: 850;
}

.filters-wide {
    grid-template-columns: minmax(260px, 1fr) 170px 170px auto auto !important;
}

.bulk-note {
    width: min(280px, 24vw);
}

.domain-avatar {
    background: linear-gradient(145deg, var(--teal-soft), #eaf2ff);
    color: var(--teal-dark);
}

.domain-avatar-large {
    display: inline-grid;
    width: 68px !important;
    height: 68px !important;
    place-items: center;
    font-size: 20px !important;
}

.domain-profile-hero {
    align-items: center;
}

.domain-profile-copy {
    min-width: 0;
    flex: 1;
}

.domain-profile-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.domain-profile-title h3 {
    margin: 0;
    font-size: clamp(22px, 3vw, 30px);
    letter-spacing: -.04em;
}

.domain-profile-copy > p {
    margin: 6px 0 12px;
    color: var(--muted);
}

.mono-reference {
    overflow-wrap: anywhere;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .9em;
}

.table-subtext {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.compact-person {
    min-width: 150px;
}

.compact-empty {
    padding: 22px 14px;
}

.notice strong,
.notice span {
    display: block;
}

.notice span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.notice-warning {
    margin-bottom: 16px;
    border-left-color: var(--amber);
    background: var(--amber-soft);
}

.domain-action-card {
    display: grid;
    gap: 12px;
}

.domain-action-card .form-group > span,
.form-stack .form-group > span {
    color: var(--ink);
    font-size: 12px;
    font-weight: 750;
}

.domain-action-card textarea {
    min-height: 92px;
    resize: vertical;
}

.detail-list .detail-row dt span,
.detail-list .detail-row dd span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
}

.plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.plan-card {
    display: flex;
    min-height: 245px;
    flex-direction: column;
    padding: 19px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(155deg, var(--surface), var(--surface-soft));
}

.plan-card-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.plan-card h4 {
    margin: 0;
    font-size: 18px;
}

.plan-card p {
    margin: 10px 0 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.plan-price {
    margin-top: 24px;
    font-size: clamp(25px, 3vw, 34px);
    font-weight: 820;
    letter-spacing: -.045em;
}

.plan-price small {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0;
}

.plan-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: auto;
}

.plan-meta span {
    display: block;
    padding: 10px;
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font-size: 10px;
}

.plan-meta strong {
    display: block;
    margin-bottom: 3px;
    color: var(--ink);
    font-size: 13px;
}

.privacy-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.privacy-notice svg {
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    max-width: 20px;
    max-height: 20px;
    color: var(--teal-dark);
}

.report-description {
    margin-top: 18px;
    padding: 15px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.report-description > span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.report-description p {
    margin: 8px 0 0;
    line-height: 1.6;
}

.moderation-timeline {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.moderation-timeline li {
    position: relative;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 18px;
}

.moderation-timeline li:not(:last-child)::before {
    position: absolute;
    top: 12px;
    bottom: -2px;
    left: 6px;
    width: 2px;
    background: var(--line);
    content: "";
}

.timeline-marker {
    position: relative;
    z-index: 1;
    width: 14px;
    height: 14px;
    margin-top: 5px;
    border: 3px solid var(--surface);
    border-radius: 50%;
    background: var(--teal);
    box-shadow: 0 0 0 1px var(--teal);
}

.timeline-card {
    padding: 15px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
}

.timeline-heading,
.timeline-heading > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.timeline-heading {
    justify-content: space-between;
    margin-bottom: 12px;
}

.timeline-heading time {
    color: var(--muted);
    font-size: 11px;
}

.timeline-card > strong {
    font-size: 13px;
}

.timeline-card p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

@media (max-width: 1180px) {
    .filters-wide {
        grid-template-columns: minmax(240px, 1fr) 160px 160px auto !important;
    }

    .filters-wide .button-ghost-light {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .bulk-note {
        width: min(100%, 360px);
    }

    .domain-profile-title,
    .timeline-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .choice-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .filters-wide,
    .list-commandbar .filters-wide,
    .plan-grid {
        grid-template-columns: 1fr !important;
    }

    .filters-wide .button-ghost-light {
        grid-column: auto;
    }

    .domain-profile-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .bulk-actions .select,
    .bulk-note,
    .bulk-actions .button {
        width: 100%;
    }
}

:where(a, button, input, select):focus-visible {
    outline: 3px solid color-mix(in srgb, var(--teal) 38%, transparent);
    outline-offset: 2px;
}

@media (max-width: 820px) {
    .sidebar {
        overflow-x: hidden;
        overflow-y: auto;
    }
}

.sidebar-backdrop {
    display: none;
}

@media (max-width: 1080px) {
    .health-link span,
    .topbar-status,
    .user-menu-name {
        display: none;
    }
}

@media (max-width: 820px) {
    .admin-shell,
    .admin-shell.is-collapsed {
        display: block;
    }

    .admin-shell.is-collapsed .sidebar {
        padding: 22px 16px;
    }

    .admin-shell.is-collapsed .sidebar-brand-row {
        justify-content: space-between;
        flex-direction: row;
    }

    .admin-shell.is-collapsed .brand-copy,
    .admin-shell.is-collapsed .nav-section,
    .admin-shell.is-collapsed .nav-label,
    .admin-shell.is-collapsed .sidebar-footer-note span {
        display: block;
    }

    .admin-shell.is-collapsed .nav-link {
        justify-content: flex-start;
        padding-inline: 12px;
    }

    .sidebar-collapse {
        display: none;
    }

    .sidebar-backdrop.open {
        position: fixed;
        z-index: 25;
        inset: 0;
        display: block;
        border: 0;
        background: rgba(2, 7, 4, .58);
    }

    .mobile-menu {
        display: inline-flex !important;
    }
}

@media (max-width: 680px) {
    .topbar {
        padding-inline: 14px;
    }

    .health-link,
    .theme-cycle span,
    .topbar-title span {
        display: none;
    }

    .theme-cycle {
        width: 38px;
        padding: 0;
    }

    .language-switch button {
        min-width: 30px;
        padding-inline: 5px;
    }

    .page {
        padding-inline: 16px;
    }

    .search-field {
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}

.input-action-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-action-wrap .input {
    padding-inline-end: 52px;
}

.input-action-button {
    position: absolute;
    inset-inline-end: 8px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
}

.input-action-button:hover,
.input-action-button:focus-visible,
.input-action-button[aria-pressed="true"] {
    color: var(--teal-dark);
    border-color: var(--line);
    background: var(--teal-soft);
    outline: none;
}

.input-action-button:focus-visible {
    box-shadow: 0 0 0 3px var(--focus-ring);
}
