:root {
    color-scheme: light;
    --canvas: #f3f7fb;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, .91);
    --ink: #102a43;
    --ink-strong: #071f33;
    --muted: #687d91;
    --line: #dbe5ee;
    --line-soft: #eaf0f5;
    --navy: #082f49;
    --blue: #0f6cbd;
    --blue-soft: #e0f2fe;
    --cyan: #0891b2;
    --teal: #0f766e;
    --teal-soft: #ccfbf1;
    --green: #15803d;
    --green-soft: #dcfce7;
    --amber: #b45309;
    --amber-soft: #fef3c7;
    --red: #b42318;
    --red-soft: #fee4e2;
    --violet: #6d28d9;
    --violet-soft: #ede9fe;
    --sidebar-width: 244px;
    --radius-lg: 22px;
    --radius-md: 14px;
    --shadow-sm: 0 7px 24px rgba(16, 42, 67, .055);
    --shadow-lg: 0 24px 70px rgba(8, 47, 73, .14);
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 80% -20%, rgba(56, 189, 248, .13), transparent 34rem),
        var(--canvas);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .54; }
img { max-width: 100%; }
[hidden] { display: none !important; }

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

.skip-link {
    position: fixed;
    z-index: 999;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    border-radius: 9px;
    background: var(--navy);
    color: #fff;
    text-decoration: none;
    transform: translateY(-150%);
}
.skip-link:focus { transform: translateY(0); }

.ambient {
    position: fixed;
    z-index: -1;
    border-radius: 999px;
    filter: blur(12px);
    pointer-events: none;
}
.ambient--one { top: -210px; left: -170px; width: 450px; height: 450px; background: rgba(14, 165, 233, .13); }
.ambient--two { right: -220px; bottom: -240px; width: 520px; height: 520px; background: rgba(20, 184, 166, .10); }

.eyebrow {
    margin: 0 0 6px;
    color: var(--blue);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.eyebrow--danger { color: var(--red); }

.auth-gate {
    display: grid;
    min-height: 100vh;
    padding: 26px;
    place-items: center;
}
.auth-card {
    position: relative;
    width: min(470px, 100%);
    padding: 46px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 30px;
    background: var(--surface-glass);
    box-shadow: var(--shadow-lg);
    text-align: center;
    backdrop-filter: blur(20px);
}
.auth-card::before {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 5px;
    background: linear-gradient(90deg, #0ea5e9, #14b8a6, #8b5cf6);
    content: "";
}
.auth-brand { position: relative; width: 72px; margin: 0 auto 22px; }
.brand-glyph {
    display: grid;
    width: 66px;
    height: 66px;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(145deg, #0f6cbd, #082f49);
    box-shadow: 0 15px 35px rgba(15, 108, 189, .25);
    color: #fff;
    font-size: 31px;
    font-weight: 850;
}
.brand-glyph--small { width: 42px; height: 42px; border-radius: 13px; font-size: 21px; }
.brand-pulse {
    position: absolute;
    right: 0;
    bottom: -2px;
    width: 18px;
    height: 18px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: #22c55e;
}
.auth-card h1 { margin: 5px 0 13px; color: var(--ink-strong); font-size: clamp(29px, 6vw, 39px); line-height: 1.12; letter-spacing: -.045em; }
.auth-message { margin: 0 0 25px; color: var(--muted); }
.auth-message strong { color: var(--ink); }
.auth-message.is-error { color: var(--red); }
.auth-footnote { margin: 19px auto 0; color: var(--muted); font-size: 12px; }
.config-notice { margin-top: 15px; padding: 11px; border: 1px solid #fcd34d; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: 13px; }
.google-mark { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: #fff; color: #4285f4; font-weight: 850; }

.button, .icon-button {
    border: 1px solid transparent;
    font-weight: 750;
    transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.button {
    display: inline-flex;
    min-height: 41px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 11px;
    white-space: nowrap;
}
.button:hover:not(:disabled), .icon-button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, .icon-button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
    outline: 3px solid rgba(14, 165, 233, .22);
    outline-offset: 2px;
}
.button--wide { width: 100%; }
.button--primary { background: linear-gradient(135deg, var(--blue), #075985); box-shadow: 0 10px 22px rgba(15, 108, 189, .18); color: #fff; }
.button--primary:hover:not(:disabled) { box-shadow: 0 13px 27px rgba(15, 108, 189, .25); }
.button--soft { border-color: var(--line); background: #fff; color: var(--ink); }
.button--ghost { border-color: transparent; background: transparent; color: var(--muted); }
.button--danger { border-color: #fecaca; background: #fff; color: var(--red); }
.button--danger-solid { background: var(--red); color: #fff; }
.button--success { border-color: #bbf7d0; background: #f0fdf4; color: var(--green); }
.button--small { min-height: 34px; padding: 6px 10px; border-radius: 9px; font-size: 12px; }
.icon-button { display: grid; width: 39px; height: 39px; padding: 0; place-items: center; border-color: var(--line); border-radius: 11px; background: #fff; color: var(--muted); font-size: 18px; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--sidebar-width);
    padding: 24px 16px 20px;
    flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.09);
    background: linear-gradient(180deg, #082f49 0%, #0b3b56 70%, #093a47 100%);
    box-shadow: 12px 0 35px rgba(8,47,73,.08);
    color: #fff;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 25px; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand strong { font-size: 16px; }
.sidebar-brand small { color: rgba(255,255,255,.58); font-size: 11px; letter-spacing: .06em; }
.nav-list { display: grid; gap: 5px; }
.nav-link {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: rgba(255,255,255,.68);
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
}
.nav-link > span:first-child { display: grid; width: 22px; place-items: center; font-size: 17px; }
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-link.is-active { border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.11); color: #fff; }
.nav-badge { min-width: 22px; margin-left: auto; padding: 2px 6px; border-radius: 999px; background: #fbbf24; color: #422006; font-size: 10px; text-align: center; }
.sidebar-note { display: flex; align-items: flex-start; gap: 10px; margin-top: auto; padding: 13px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px; background: rgba(255,255,255,.055); }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { font-size: 11px; }
.sidebar-note small { margin-top: 2px; color: rgba(255,255,255,.55); font-size: 10px; line-height: 1.4; }
.live-dot { display: inline-block; flex: 0 0 auto; width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 5px rgba(74,222,128,.12); }
.live-dot--large { width: 10px; height: 10px; margin: 0; box-shadow: 0 0 0 7px rgba(74,222,128,.13); }

.workspace { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 72px;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 11px clamp(18px, 3vw, 38px);
    border-bottom: 1px solid rgba(219,229,238,.9);
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(18px);
}
.topbar-left, .topbar-actions, .admin-identity { display: flex; align-items: center; gap: 11px; }
.topbar-kicker { margin: 0; color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.topbar-title { display: block; color: var(--ink-strong); line-height: 1.25; }
.menu-button { display: none; }
.avatar { width: 38px; height: 38px; border: 2px solid #fff; border-radius: 50%; background: var(--blue-soft); box-shadow: 0 3px 10px rgba(8,47,73,.1); object-fit: cover; }
.admin-copy { min-width: 0; max-width: 220px; }
.admin-copy strong, .admin-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-copy strong { font-size: 12px; }
.admin-copy small { color: var(--muted); font-size: 10px; }

.page-content { width: min(1480px, calc(100% - clamp(32px, 6vw, 76px))); margin: 0 auto; padding: 35px 0 70px; }
.section-anchor { scroll-margin-top: 92px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding: 6px 1px 27px; }
.hero h1 { margin: 0 0 9px; color: var(--ink-strong); font-size: clamp(29px, 4vw, 43px); line-height: 1.15; letter-spacing: -.045em; }
.hero > div > p:last-child { max-width: 760px; margin: 0; color: var(--muted); }
.hero-status { display: flex; flex: 0 0 auto; align-items: center; gap: 14px; padding: 14px 17px; border: 1px solid #bbf7d0; border-radius: var(--radius-md); background: rgba(240,253,244,.8); }
.hero-status small, .hero-status strong { display: block; }
.hero-status small { color: var(--muted); font-size: 10px; }
.hero-status strong { color: var(--green); font-size: 13px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card { display: flex; min-width: 0; align-items: center; gap: 13px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-glass); box-shadow: var(--shadow-sm); }
.metric-icon { display: grid; flex: 0 0 auto; width: 43px; height: 43px; place-items: center; border-radius: 13px; font-size: 12px; font-weight: 900; }
.metric-icon--blue { background: var(--blue-soft); color: var(--blue); }
.metric-icon--green { background: var(--green-soft); color: var(--green); }
.metric-icon--amber { background: var(--amber-soft); color: var(--amber); }
.metric-icon--violet { background: var(--violet-soft); color: var(--violet); }
.metric-card small, .metric-card strong, .metric-card div > span { display: block; }
.metric-card small { color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.metric-card strong { margin: 1px 0; overflow: hidden; color: var(--ink-strong); font-size: 23px; letter-spacing: -.03em; text-overflow: ellipsis; white-space: nowrap; }
.metric-card div > span { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }

.section-block { margin-top: 31px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 0 2px 14px; }
.section-heading h2, .panel-heading h2 { margin: 0; color: var(--ink-strong); font-size: 20px; letter-spacing: -.025em; }
.quiet-chip, .security-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.75); color: var(--muted); font-size: 10px; font-weight: 750; }
.security-chip { border-color: #a7f3d0; background: #ecfdf5; color: #047857; }
.product-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.product-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: var(--shadow-sm); }
.product-accent { height: 4px; background: var(--product-accent, var(--blue)); }
.product-content { padding: 19px; }
.product-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.product-identity { display: flex; min-width: 0; align-items: center; gap: 11px; }
.product-logo { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: var(--product-soft, var(--blue-soft)); color: var(--product-accent, var(--blue)); font-size: 12px; font-weight: 900; }
.product-identity strong, .product-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.product-identity strong { color: var(--ink-strong); }
.product-identity small { color: var(--muted); font-size: 10px; }
.health-pill { display: inline-flex; align-items: center; gap: 5px; color: var(--green); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.health-pill::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.health-pill--warning { color: var(--amber); }
.health-pill--offline { color: var(--red); }
.product-description { min-height: 40px; margin: 15px 0; color: var(--muted); font-size: 12px; }
.product-stats { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.product-stat { padding: 9px 10px; border-radius: 10px; background: #f7fafc; }
.product-stat small, .product-stat strong { display: block; }
.product-stat small { color: var(--muted); font-size: 9px; }
.product-stat strong { color: var(--ink-strong); font-size: 14px; }
.product-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line-soft); }
.product-footer span { color: var(--muted); font-size: 9px; }
.product-link { color: var(--product-accent, var(--blue)); font-size: 11px; font-weight: 800; text-decoration: none; }

.panel { margin-top: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-glass); box-shadow: var(--shadow-sm); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 21px 23px; border-bottom: 1px solid var(--line); }
.panel-heading > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.count-badge { display: inline-grid; min-width: 24px; min-height: 24px; margin-left: 4px; padding: 2px 7px; place-items: center; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11px; vertical-align: 2px; }

.pending-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; padding: 18px 22px 22px; }
.pending-card { display: grid; min-width: 0; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fcfdff; }
.pending-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.pending-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-chip { padding: 4px 7px; border-radius: 7px; background: #f1f5f9; color: var(--muted); font-size: 10px; }
.pending-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }

.person { display: flex; min-width: 0; align-items: center; gap: 10px; }
.person-avatar { display: grid; flex: 0 0 auto; width: 39px; height: 39px; place-items: center; overflow: hidden; border-radius: 50%; background: linear-gradient(145deg, var(--blue-soft), var(--teal-soft)); color: var(--navy); font-size: 12px; font-weight: 850; text-transform: uppercase; }
.person-avatar img { width: 100%; height: 100%; object-fit: cover; }
.person-copy { min-width: 0; }
.person-copy strong, .person-copy span, .person-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person-copy strong { color: var(--ink-strong); font-size: 12px; }
.person-copy span { color: var(--muted); font-size: 10px; }
.person-copy small { margin-top: 2px; color: #94a3b8; font-size: 9px; }

.filter-bar { display: flex; align-items: center; gap: 8px; }
.filter-bar select, .filter-bar input { min-height: 38px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: 12px; }
.filter-bar select { min-width: 145px; padding: 7px 30px 7px 10px; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box > span:first-child { position: absolute; left: 11px; color: var(--muted); }
.search-box input { width: min(240px, 25vw); padding: 7px 10px 7px 32px; }

.table-scroll { overflow-x: auto; }
.member-table { width: 100%; min-width: 1080px; border-collapse: collapse; }
.member-table th { padding: 11px 14px; background: #f7fafc; color: var(--muted); font-size: 9px; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.member-table td { padding: 14px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.member-table tbody tr:first-child td { border-top: 0; }
.member-table tbody tr:hover { background: rgba(240,249,255,.48); }
.align-right { text-align: right !important; }
.product-tag, .status-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 999px; font-size: 9px; font-weight: 800; }
.product-tag { background: var(--tag-soft, var(--blue-soft)); color: var(--tag-color, var(--blue)); }
.status-pill::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-pill--active { background: var(--green-soft); color: var(--green); }
.status-pill--pending { background: var(--amber-soft); color: var(--amber); }
.status-pill--paused, .status-pill--expired, .status-pill--deletion_scheduled { background: var(--red-soft); color: var(--red); }
.status-stack { display: grid; justify-items: start; gap: 5px; }
.expiry-copy { color: var(--muted); font-size: 9px; }
.usage-compact { display: grid; min-width: 190px; gap: 7px; }
.usage-line { display: grid; gap: 3px; }
.usage-copy { display: flex; justify-content: space-between; gap: 9px; color: var(--muted); font-size: 9px; }
.usage-copy strong { color: var(--ink); font-weight: 700; }
.progress { height: 5px; overflow: hidden; border-radius: 999px; background: #e8eef3; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--blue); }
.progress > span.is-warning { background: #f59e0b; }
.progress > span.is-danger { background: #ef4444; }
.row-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.action-menu { position: relative; }
.action-menu > summary { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); cursor: pointer; list-style: none; }
.action-menu > summary::-webkit-details-marker { display: none; }
.action-popover { position: absolute; z-index: 12; top: 40px; right: 0; display: grid; min-width: 170px; padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: var(--shadow-lg); }
.action-popover button { padding: 8px 9px; border: 0; border-radius: 7px; background: transparent; color: var(--ink); font-size: 11px; text-align: left; }
.action-popover button:hover { background: #f1f5f9; }
.action-popover button.is-danger { color: var(--red); }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }

.account-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, .7fr); gap: 20px; padding: 21px 23px 24px; }
.shared-account-list { display: grid; gap: 10px; align-content: start; }
.shared-account-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fcfdff; }
.membership-dots { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.architecture-note { padding: 18px; border: 1px solid #bae6fd; border-radius: 15px; background: linear-gradient(145deg, #f0f9ff, #f0fdfa); }
.architecture-note h3 { margin: 0 0 9px; color: var(--ink-strong); }
.architecture-note ul { display: grid; gap: 8px; margin: 0; padding-left: 18px; color: var(--muted); font-size: 11px; }

.audit-list { padding: 8px 23px 20px; }
.audit-item { display: grid; grid-template-columns: 24px minmax(0,1fr) auto; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.audit-item:last-child { border-bottom: 0; }
.audit-dot { display: grid; width: 23px; height: 23px; place-items: center; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-size: 10px; font-weight: 850; }
.audit-copy strong, .audit-copy span { display: block; }
.audit-copy strong { color: var(--ink-strong); font-size: 11px; }
.audit-copy span, .audit-time { color: var(--muted); font-size: 9px; }
.audit-placeholder { display: grid; padding: 36px 16px; place-items: center; color: var(--muted); text-align: center; }
.audit-placeholder span { display: grid; width: 45px; height: 45px; margin-bottom: 9px; place-items: center; border-radius: 14px; background: var(--blue-soft); color: var(--blue); font-size: 21px; }
.audit-placeholder strong { color: var(--ink); }
.audit-placeholder p { max-width: 500px; margin: 4px 0 0; font-size: 11px; }
.empty-state, .empty-inline { color: var(--muted); text-align: center; }
.empty-state { padding: 42px 18px; }
.empty-state > span { display: block; margin-bottom: 6px; font-size: 25px; }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 4px 0 0; font-size: 11px; }
.empty-inline { grid-column: 1 / -1; padding: 28px 12px; font-size: 12px; }

.modal { width: min(620px, calc(100% - 28px)); max-height: min(820px, calc(100vh - 28px)); padding: 0; overflow: auto; border: 0; border-radius: 20px; background: #fff; box-shadow: 0 35px 100px rgba(8,47,73,.28); color: var(--ink); }
.modal::backdrop { background: rgba(7, 31, 51, .54); backdrop-filter: blur(4px); }
.modal form { padding: 23px; }
.modal-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.modal-heading h2 { margin: 0; color: var(--ink-strong); font-size: 22px; letter-spacing: -.025em; }
.modal-heading p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.modal-fields { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; padding: 19px 0; }
.field { display: block; }
.field--wide { grid-column: 1 / -1; }
.field > span { display: block; margin-bottom: 5px; color: var(--ink); font-size: 10px; font-weight: 800; }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); }
.field input, .field select { min-height: 40px; padding: 7px 10px; }
.field textarea { padding: 9px 10px; resize: vertical; }
.field small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding-top: 16px; border-top: 1px solid var(--line); }
.danger-callout { margin: 18px 0; padding: 12px 13px; border: 1px solid #fecaca; border-radius: 10px; background: #fff7f7; color: #991b1b; font-size: 11px; }
.modal--danger .field { margin-top: 14px; }

.loading-overlay { position: fixed; z-index: 200; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: rgba(243,247,251,.72); color: var(--navy); backdrop-filter: blur(3px); }
.loading-overlay strong { font-size: 12px; }
.spinner { width: 38px; height: 38px; border: 4px solid var(--blue-soft); border-top-color: var(--blue); border-radius: 50%; animation: spin .72s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast-region { position: fixed; z-index: 220; right: 17px; bottom: 17px; display: grid; width: min(390px, calc(100% - 34px)); gap: 8px; }
.toast { padding: 12px 14px; border: 1px solid var(--line); border-left: 4px solid var(--blue); border-radius: 10px; background: #fff; box-shadow: var(--shadow-lg); color: var(--ink); font-size: 11px; animation: toast-in .2s ease-out; }
.toast--success { border-left-color: var(--green); }
.toast--error { border-left-color: var(--red); }
@keyframes toast-in { from { opacity: 0; transform: translateY(7px); } }
.sidebar-backdrop { display: none; }

/* Cổng tài khoản giáo viên */
.account-body { background: radial-gradient(circle at 12% -10%, rgba(14,165,233,.15), transparent 33rem), radial-gradient(circle at 92% 12%, rgba(139,92,246,.1), transparent 29rem), var(--canvas); }
.account-shell { min-height: 100vh; }
.account-auth-card { width: min(490px, 100%); }
.account-topbar {
    position: sticky;
    z-index: 30;
    top: 0;
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 10px max(20px, calc((100vw - 1220px) / 2));
    border-bottom: 1px solid rgba(219,229,238,.9);
    background: rgba(255,255,255,.89);
    backdrop-filter: blur(18px);
}
.account-brand, .account-topbar-actions { display: flex; align-items: center; gap: 11px; }
.account-brand { color: inherit; text-decoration: none; }
.account-brand strong, .account-brand small { display: block; }
.account-brand strong { color: var(--ink-strong); line-height: 1.2; }
.account-brand small { color: var(--muted); font-size: 10px; }
.account-main { width: min(1220px, calc(100% - 40px)); margin: 0 auto; padding: 38px 0 65px; }
.account-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr); gap: 17px; }
.account-profile-card, .identity-explainer { border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm); }
.account-profile-card { display: flex; align-items: center; gap: 22px; padding: clamp(24px, 4vw, 38px); background: linear-gradient(135deg, #fff, #f0f9ff); }
.account-avatar-large { flex: 0 0 auto; width: 94px; height: 94px; border: 5px solid #fff; border-radius: 50%; background: var(--blue-soft); box-shadow: 0 12px 35px rgba(15,108,189,.17); object-fit: cover; }
.account-profile-copy { min-width: 0; }
.account-profile-copy h1 { margin: 0; overflow: hidden; color: var(--ink-strong); font-size: clamp(25px, 4vw, 36px); letter-spacing: -.04em; text-overflow: ellipsis; white-space: nowrap; }
.account-profile-copy > p:not(.eyebrow) { margin: 2px 0 13px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.account-security-line { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 10px; font-weight: 750; }
.account-security-line span { display: grid; width: 15px; height: 15px; place-items: center; border-radius: 50%; background: var(--green); color: #fff; font-size: 8px; }
.identity-explainer { padding: clamp(22px, 3vw, 31px); background: linear-gradient(145deg, #082f49, #0b4f67); color: #fff; }
.identity-explainer .eyebrow { color: #7dd3fc; }
.identity-explainer h2 { margin: 0 0 7px; font-size: 21px; letter-spacing: -.025em; }
.identity-explainer > p:last-of-type { margin: 0; color: rgba(255,255,255,.67); font-size: 12px; }
.identity-flow { display: flex; align-items: center; gap: 8px; margin-top: 20px; }
.identity-flow span { padding: 6px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px; background: rgba(255,255,255,.08); font-size: 9px; font-weight: 750; }
.identity-flow i { color: rgba(255,255,255,.42); font-style: normal; }
.account-products-section { margin-top: 31px; }
.account-section-heading > div > p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.account-product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.account-product-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-top: 4px solid var(--account-product-accent, var(--blue)); border-radius: 17px; background: #fff; box-shadow: var(--shadow-sm); }
.account-product-head { display: flex; align-items: center; gap: 12px; }
.account-product-logo { display: grid; flex: 0 0 auto; width: 45px; height: 45px; place-items: center; border-radius: 13px; background: var(--account-product-soft, var(--blue-soft)); color: var(--account-product-accent, var(--blue)); font-size: 12px; font-weight: 900; }
.account-product-title { display: flex; min-width: 0; flex: 1; align-items: center; justify-content: space-between; gap: 12px; }
.account-product-title h3 { margin: 0; overflow: hidden; color: var(--ink-strong); font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.account-product-description { min-height: 39px; margin: 14px 0; color: var(--muted); font-size: 11px; }
.account-membership-detail { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.account-detail-item { min-width: 0; padding: 8px 9px; border-radius: 9px; background: #f6f9fb; }
.account-detail-item small, .account-detail-item strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-detail-item small { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.account-detail-item strong { margin-top: 2px; color: var(--ink); font-size: 9px; }
.account-product-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft); }
.account-product-actions a[aria-disabled="true"] { pointer-events: none; opacity: .55; }
.account-public-link { color: var(--muted); font-size: 9px; font-weight: 700; text-decoration: none; }
.account-public-link:hover { color: var(--blue); }
.account-help-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 20px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.8); box-shadow: var(--shadow-sm); }
.account-help-card h2 { margin: 0; color: var(--ink-strong); font-size: 18px; }
.account-help-card > div > p:last-child { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.account-quick-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.account-quick-links a { padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font-size: 9px; font-weight: 750; text-decoration: none; }
.account-quick-links a:hover { border-color: #7dd3fc; color: var(--blue); }
.request-info { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0; padding: 11px; border: 1px solid #bae6fd; border-radius: 10px; background: #f0f9ff; color: #075985; }
.request-info span { display: grid; flex: 0 0 auto; width: 19px; height: 19px; place-items: center; border-radius: 50%; background: #0ea5e9; color: #fff; font-size: 10px; font-weight: 800; }
.request-info p { margin: 1px 0 0; font-size: 10px; }
.request-modal .field { margin-bottom: 18px; }

@media (max-width: 1180px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .product-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .product-card:last-child { grid-column: 1 / -1; }
    .panel-heading--wrap { align-items: flex-start; flex-direction: column; }
    .filter-bar { width: 100%; }
    .search-box { flex: 1; }
    .search-box input { width: 100%; }
}

@media (max-width: 900px) {
    .sidebar { transform: translateX(-105%); transition: transform .22s ease; }
    .app-shell.is-menu-open .sidebar { transform: translateX(0); }
    .workspace { margin-left: 0; }
    .menu-button { display: grid; }
    .sidebar-backdrop { position: fixed; z-index: 35; inset: 0; display: block; border: 0; background: rgba(7,31,51,.45); }
    .account-layout { grid-template-columns: 1fr; }
    .account-hero { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .auth-gate { padding: 16px; }
    .auth-card { padding: 35px 23px; border-radius: 23px; }
    .topbar { min-height: 65px; padding: 9px 13px; }
    .topbar-title, .topbar-kicker, .admin-copy, .desktop-label { display: none; }
    .page-content { width: min(100% - 24px, 1480px); padding-top: 24px; }
    .hero { align-items: flex-start; flex-direction: column; }
    .hero-status { width: 100%; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .metric-card { align-items: flex-start; padding: 13px; }
    .metric-icon { width: 36px; height: 36px; border-radius: 10px; }
    .metric-card strong { font-size: 19px; }
    .metric-card div > span { white-space: normal; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .product-grid, .pending-list { grid-template-columns: 1fr; }
    .product-card:last-child { grid-column: auto; }
    .panel { border-radius: 16px; }
    .panel-heading { align-items: flex-start; flex-direction: column; padding: 18px; }
    .pending-list { padding: 14px; }
    .filter-bar { display: grid; grid-template-columns: 1fr 1fr; }
    .search-box { grid-column: 1 / -1; }
    .filter-bar select { width: 100%; min-width: 0; }
    .member-table { min-width: 0; }
    .member-table thead { display: none; }
    .member-table, .member-table tbody, .member-table tr, .member-table td { display: block; width: 100%; }
    .member-table tbody { padding: 5px 14px 15px; }
    .member-table tr { margin-top: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
    .member-table td { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 8px 0; border: 0; }
    .member-table td::before { flex: 0 0 88px; color: var(--muted); font-size: 9px; font-weight: 750; content: attr(data-label); text-transform: uppercase; }
    .member-table td:first-child { padding-top: 0; }
    .member-table td:last-child { padding-bottom: 0; }
    .member-table .person { flex: 1; justify-content: flex-end; text-align: right; }
    .status-stack { justify-items: end; text-align: right; }
    .usage-compact { min-width: min(210px, calc(100vw - 145px)); }
    .row-actions { flex-wrap: wrap; }
    .action-popover { top: auto; right: 0; bottom: 40px; }
    .account-layout { padding: 17px; }
    .shared-account-card { align-items: flex-start; flex-direction: column; }
    .membership-dots { justify-content: flex-start; }
    .modal-fields { grid-template-columns: 1fr; }
    .field--wide { grid-column: auto; }
    .account-topbar { padding: 9px 13px; }
    .account-brand small { display: none; }
    .account-topbar-actions { gap: 6px; }
    .account-topbar-actions .avatar { display: none; }
    .account-main { width: calc(100% - 24px); padding-top: 24px; }
    .account-profile-card { align-items: flex-start; flex-direction: column; }
    .account-avatar-large { width: 78px; height: 78px; }
    .account-product-grid { grid-template-columns: 1fr; }
    .account-help-card { align-items: flex-start; flex-direction: column; }
    .account-quick-links { justify-content: flex-start; }
}

@media (max-width: 430px) {
    .metric-grid { grid-template-columns: 1fr; }
    .metric-card { align-items: center; }
    .pending-card-head { flex-direction: column; }
    .pending-actions { justify-content: stretch; }
    .pending-actions .button { flex: 1; }
    .member-table td { flex-direction: column; gap: 5px; }
    .member-table td::before { flex-basis: auto; }
    .member-table .person { justify-content: flex-start; text-align: left; }
    .status-stack { justify-items: start; text-align: left; }
    .usage-compact { width: 100%; min-width: 0; }
    .row-actions { justify-content: flex-start; }
    .modal form { padding: 18px; }
    .modal-actions .button { flex: 1; }
    .account-brand span:last-child { display: none; }
    .account-product-title { align-items: flex-start; flex-direction: column; gap: 5px; }
    .account-membership-detail { grid-template-columns: 1fr; }
    .account-product-actions { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
