:root {
    font-family: "Segoe UI", system-ui, sans-serif;
    color: #172838;
    background: #f4f7f8;
    color-scheme: light;
    --ink: #172838;
    --muted: #4f6675;
    --line: #dbe5ea;
    --navy: #16232b;
    --brand-red: #9c3519;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: progress; opacity: .65; }
:focus-visible { outline: 3px solid #b63229; outline-offset: 3px; }
.topbar {
    display: flex; align-items: center; gap: 20px;
    min-height: 68px; padding: 12px clamp(18px, 5vw, 74px);
    color: white; background: var(--navy);
}
.brand { display: inline-flex; align-items: center; flex: none; padding: 4px 9px; border-radius: 6px; background: white; }
.brand img { display: block; width: 142px; height: auto; }
.topbar-divider { border-left: 1px solid #566c7d; height: 22px; }
.portal-label { color: #d3e1e9; font-size: .84rem; }
.account { margin-left: auto; display: flex; gap: 12px; align-items: center; }
#account-email { color: #e2edf3; font-size: .86rem; overflow-wrap: anywhere; }
main { max-width: 1440px; margin: 0 auto; padding: clamp(30px, 5vw, 64px) clamp(18px, 5vw, 74px); }
.button {
    border: 1px solid transparent; border-radius: 7px; min-height: 42px; padding: 9px 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 9px;
    font-size: .9rem; font-weight: 650; line-height: 1.3; text-decoration: none;
}
.primary { background: var(--brand-red); color: white; }
.primary:hover { background: #892019; }
.secondary { background: white; border-color: #cbd9df; color: var(--ink); }
.secondary:hover { background: #eef4f7; }
.ghost { background: transparent; color: white; border-color: #617687; }
.ghost:hover { background: #353e62; }
.danger { background: #fff4f1; color: #9b2b20; border-color: #e8c8c2; }
.danger:hover { background: #fce4e0; }
.eyebrow { color: var(--brand-red); font-size: .72rem; font-weight: 800; letter-spacing: .13em; line-height: 1.5; }
h1 { font-size: clamp(2.8rem, 6vw, 5rem); line-height: 1; letter-spacing: -.055em; font-weight: 740; margin: 10px 0 14px; }
.product-title { font-size: clamp(2.4rem, 5vw, 4.35rem); }
h2 { font-size: 1.38rem; letter-spacing: -.025em; }
h3 { font-size: 1.16rem; }
.lede { color: var(--muted); font-size: 1.02rem; line-height: 1.55; max-width: 35ch; }
.heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 30px; }
.heading-row .lede { max-width: none; }
.heading-row > button { margin-bottom: 4px; flex: none; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.metric { border: 1px solid var(--line); border-radius: 11px; padding: 19px 21px; background: white; }
.metric dt { color: var(--muted); font-size: .88rem; font-weight: 600; }
.metric dd { font-size: 2.25rem; line-height: 1.1; letter-spacing: -.045em; font-variant-numeric: tabular-nums; margin: 7px 0 0; }
.metric-active { background: #e6f7ee; border-color: #c4e9d6; }
.list-panel { background: white; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list-header { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 21px 22px; flex-wrap: wrap; }
.list-header p { color: var(--muted); font-size: .87rem; margin-top: 4px; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
input, select {
    width: 100%; min-width: 0; min-height: 41px; padding: 9px 10px;
    background: #fff; border: 1px solid #bccbd3; border-radius: 7px; color: var(--ink);
}
input::placeholder { color: #637987; }
.filters input, .filters select { font-size: .89rem; }
.filters select { width: auto; }
.search-wrap { position: relative; width: 235px; }
.search-wrap span { position: absolute; left: 10px; top: 7px; font-size: 1.15rem; color: #3f6478; pointer-events: none; }
.search-wrap input { padding-left: 30px; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; min-width: 710px; text-align: left; }
th, td { padding: 12px 17px; vertical-align: middle; }
th { background: #ecf2f5; color: #3b5565; font-size: .78rem; }
th:first-child, td:first-child { padding-left: 22px; }
td { border-bottom: 1px solid var(--line); font-size: .89rem; }
td:first-child { overflow-wrap: anywhere; }
td .user-name { font-weight: 700; display: block; }
td small { display: block; color: var(--muted); margin-top: 4px; }
.pill { border-radius: 24px; padding: 4px 9px; display: inline-block; font-size: .76rem; font-weight: 700; background: #edf1f5; color: #42586a; }
.pill-active { background: #def4e8; color: #115e43; }
.pill-invited { background: #fbf1d8; color: #744e13; }
.pill-revoked { background: #f9e7e4; color: #8c271f; }
.pill-scheduled { background: #e2f0ff; color: #1d557e; }
.empty-state { text-align: center; padding: 34px 16px 42px; border-top: 1px solid #e6edf1; }
.empty-icon { display: grid; place-items: center; margin: 0 auto 12px; width: 40px; height: 40px; border: 1px solid #d6e4ec; border-radius: 8px; color: #305d75; font-size: 1.15rem; }
.empty-state p { margin: 8px auto 0; max-width: 48ch; color: var(--muted); font-size: .93rem; line-height: 1.45; }
.empty-state .button { margin-top: 14px; }
.list-footer { padding: 12px 22px; font-size: .82rem; color: var(--muted); }
.activation-note { display: flex; align-items: center; gap: 13px; margin-top: 22px; padding: 15px 17px; border: 1px solid #cfe3e9; border-radius: 10px; background: #eaf3f5; }
.note-mark { display: grid; place-items: center; padding: 3px; width: 32px; height: 32px; border-radius: 6px; background: white; color: #17694f; flex: none; font-weight: 750; }
.activation-note h2 { font-size: .94rem; }
.activation-note p { font-size: .85rem; color: #3e5969; margin-top: 3px; line-height: 1.45; }
.signed-out { display: grid; grid-template-columns: 1.1fr .9fr; gap: 0; max-width: 1010px; box-shadow: 0 18px 52px #1d3e4f13; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 3vh auto 0; }
.login-intro { position: relative; overflow: hidden; padding: clamp(28px, 5vw, 64px); min-height: 365px; color: #fff; background: var(--navy); isolation: isolate; }
.login-intro .eyebrow { color: #ffc2b9; }
.login-intro .lede { color: #d6e8f0; padding-top: 6px; }
.plan-lines { position: absolute; width: 280px; height: 190px; right: -90px; bottom: -55px; transform: rotate(-20deg); border: 2px solid #6f9baf44; background-size: 35px 35px; background-image: linear-gradient(to right, #6f9baf44 1px, transparent 1px), linear-gradient(to bottom, #6f9baf44 1px, transparent 1px); z-index: -1; }
.login-panel { padding: clamp(28px, 5vw, 60px); background: white; align-content: center; }
.login-panel h2 { margin-top: 5px; font-size: 1.9rem; }
#login-message { margin: 10px 0 16px; color: var(--muted); line-height: 1.5; }
#development-login { display: grid; gap: 12px; margin-top: 12px; }
dialog { width: min(590px, calc(100% - 28px)); max-height: 90vh; padding: 24px; border: 1px solid #c6d4da; border-radius: 13px; color: var(--ink); background: #fff; box-shadow: 0 20px 65px #0b273e40; }
dialog::backdrop { background: #112e48a6; }
.dialog-top { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; margin-bottom: 15px; }
.dialog-top h2 { font-size: 1.62rem; }
.icon-button { border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); font-size: 1.35rem; line-height: 1; width: 36px; height: 36px; }
.icon-button:hover { background: #eef4f7; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
form label { display: block; font-size: .88rem; font-weight: 650; min-width: 0; }
form label input { margin-top: 4px; font-weight: 400; }
.optional { color: var(--muted); font-size: .76rem; font-weight: 400; margin-left: 3px; }
.field-hint, .muted { font-size: .84rem; color: var(--muted); line-height: 1.45; margin: 9px 0 0; }
#edit-details { margin: 0 0 13px; }
.dialog-actions, .admin-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.admin-actions { border-top: 1px solid var(--line); padding-top: 12px; }
.notice { padding: 10px 12px; margin-bottom: 12px; border-radius: 7px; background: #e6f7ee; color: #124e3b; line-height: 1.45; font-size: .91rem; }
.notice.error { background: #fff0ed; color: #8f2d22; margin-top: 9px; }
.code-value { font-family: ui-monospace, Consolas, monospace; font-size: clamp(1rem, 4vw, 1.4rem); padding: 11px; margin-top: 10px; background: #edf6f8; }
.visually-hidden { clip-path: inset(50%); height: 1px; width: 1px; padding: 0; border: 0; overflow: hidden; position: absolute; white-space: nowrap; }

@media (max-width: 780px) {
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .signed-out { grid-template-columns: 1fr; margin-top: 0; }
    .login-intro { min-height: 0; }
    .login-intro br { display: none; }
    .login-intro h1 { margin: 5px 0; }
    .login-intro h1 br::after { content: " "; }
    .topbar-divider, .portal-label { display: none; }
    #account-email { font-size: .78rem; }
}
@media (max-width: 470px) {
    .brand img { width: 120px; }
    .heading-row { align-items: flex-start; flex-direction: column; }
    .form-grid { grid-template-columns: 1fr; }
    #account-email { display: none; }
    .list-header { padding: 17px; }
    .filters { width: 100%; }
    .search-wrap { width: 100%; }
    .metric { padding: 13px; }
    .metric dt { font-size: .8rem; }
}
