:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172b4d;background:#f5f7fb;font-synthesis:none;text-rendering:optimizeLegibility;--navy:#142b4a;--blue:#2457d6;--line:#e3e9f2;--muted:#6f7f95;--green:#147d64;--amber:#a76412;--red:#b84040}
*{box-sizing:border-box}body{margin:0;min-width:320px}.shell{min-height:100vh}.sidebar{width:240px;position:fixed;inset:0 auto 0 0;background:var(--navy);color:#fff;padding:25px 16px;display:flex;flex-direction:column;overflow:hidden;z-index:2}.brand{display:flex;align-items:center;gap:11px;color:#fff;text-decoration:none;font-weight:700;font-size:15px;padding:0 8px 20px}.brand small{display:block;color:#a9bbd2;font-size:11px;font-weight:500;margin-top:3px;letter-spacing:.03em}.brand-mark{width:34px;height:34px;border-radius:10px;background:#5f82f3;display:grid;place-items:center;font-weight:800;font-size:19px}.sidebar nav{display:grid;gap:3px;overflow-y:auto;min-height:0;padding-right:2px;scrollbar-width:thin;scrollbar-color:#ffffff40 transparent}.nav-link{color:#becadd;text-decoration:none;border-radius:8px;padding:8px 12px;display:flex;align-items:center;gap:12px;font-size:14px}.nav-icon{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;opacity:.9}
.icon-sprite{position:absolute;width:0;height:0;overflow:hidden}.nav-link:hover,.nav-link.active{background:#ffffff16;color:#fff}.nav-link.active{box-shadow:inset 3px 0 #7999ff}.sidebar-foot{margin-top:auto;color:#b7c5d7;font-size:12px;padding:14px 10px;border-top:1px solid #ffffff1c}.status-dot{display:inline-block;width:8px;height:8px;border-radius:50%;background:#54d1a1;margin-right:8px}.main-area{margin-left:240px;min-height:100vh;display:flex;flex-direction:column}.topbar{height:68px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:13px;padding:0 36px}.topbar-spacer{flex:1}.mobile-brand{display:none;align-items:center;gap:8px;font-weight:700}.mobile-brand .brand-mark{width:28px;height:28px;font-size:16px}.env-chip,.meta-chip{background:#f0f3f8;color:#53657c;border-radius:20px;padding:7px 11px;font-size:12px}.env-dev{background:#fff4dc;color:#905600}.content{padding:32px 36px;flex:1;max-width:1500px;width:100%;margin:0 auto}.page-footer{padding:16px 36px;color:#8693a5;border-top:1px solid var(--line);font-size:11px}.page-heading{display:flex;justify-content:space-between;align-items:center;gap:18px;margin-bottom:24px}.eyebrow{font-size:10px;letter-spacing:.16em;color:#71839a;font-weight:700;margin:0 0 8px}.page-heading h1,.empty-page h1{font-size:27px;margin:0;color:#142b4a;letter-spacing:-.03em}.subheading{color:var(--muted);margin:8px 0 0;font-size:14px}.panel,.search-panel{background:#fff;border:1px solid var(--line);border-radius:12px;padding:22px;margin-bottom:20px;box-shadow:0 2px 8px #192f4c06}.panel-heading{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:18px}.panel-heading h2{font-size:16px;margin:0;color:#213653}.panel-heading p{margin:6px 0 0}.muted,.field-label{color:var(--muted);font-size:12px}.summary-row{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-bottom:18px}.status-badge{padding:6px 10px;border-radius:18px;background:#eef3f8;color:#53657c;font-size:12px}.status-badge.success{background:#e5f5ef;color:var(--green)}.status-badge.failed{background:#fff0ef;color:var(--red)}.stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:20px}.stat-card{border:1px solid var(--line);background:#fff;border-radius:12px;padding:18px;min-height:103px;box-shadow:0 2px 8px #192f4c06}.stat-card .label{font-size:12px;color:var(--muted)}.stat-card .value{font-size:27px;font-weight:700;letter-spacing:-.03em;color:#1a3152;margin-top:10px}.stat-card.accent-blue{border-top:3px solid #5276e8}.stat-card.accent-green{border-top:3px solid #43aa87}.stat-card.accent-orange{border-top:3px solid #eda43e}.stat-card.accent-red{border-top:3px solid #d66565}.state-panel{border:1px dashed #d5deeb;border-radius:10px;background:#fff;color:#697b92;padding:24px;text-align:center;margin:10px 0 20px}.state-panel.error,.inline-state.error{color:var(--red)}.inline-state{color:var(--muted);font-size:13px;padding:8px 0}.global-message{position:fixed;right:20px;top:78px;z-index:5;background:#183353;color:#fff;border-radius:9px;padding:13px 16px;box-shadow:0 6px 24px #13264030;max-width:min(420px,calc(100vw - 30px));font-size:13px}.global-message.error{background:#8d2d2d}.button{border:1px solid transparent;border-radius:8px;padding:9px 13px;font:inherit;font-size:13px;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;white-space:nowrap}.button:disabled{opacity:.5;cursor:wait}.button-primary{background:var(--blue);color:#fff}.button-primary:hover{background:#1947bd}.button-secondary{border-color:#d7e0ec;background:#fff;color:#294360}.button-quiet{background:#f4f6fa;color:#52647c;border-color:#e5eaf1}.search-panel{display:flex;align-items:end;gap:14px;flex-wrap:wrap}.search-panel label{display:grid;gap:7px;font-size:12px;color:#53657c;flex:1;min-width:210px}.search-panel input{width:100%;padding:10px 11px;border-radius:8px;border:1px solid #d9e1ec;color:#203752;font:inherit;font-size:13px;outline:none}.search-panel input:focus{border-color:#7392ec;box-shadow:0 0 0 3px #5276e820}.search-actions{display:flex;gap:8px}.table-wrap{width:100%;overflow-x:auto}table{border-collapse:collapse;width:100%;font-size:12px;white-space:nowrap}th{text-align:left;color:#718198;background:#f7f9fc;font-weight:600;padding:12px 10px;border-bottom:1px solid var(--line)}td{padding:13px 10px;border-bottom:1px solid #edf0f5;color:#344962}tbody tr:hover{background:#f8faff}.user-link{color:#2457d6;text-decoration:none;font-weight:600}.user-link:hover{text-decoration:underline}.uuid{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:#53657c}.mapping-pill{background:#eef3f8;color:#61738a;padding:5px 8px;border-radius:14px}.mapping-pill.mapped{background:#e8f5ef;color:var(--green)}.pagination{display:flex;justify-content:space-between;align-items:center;padding-top:16px}.pagination>div{display:flex;gap:8px}.user-identity{display:flex;gap:60px;flex-wrap:wrap}.user-identity h2{font-size:17px;margin:8px 0 0}.user-identity code{display:block;margin-top:8px;color:#465c76;word-break:break-all}.field-label{display:block}.date-filter{margin-bottom:18px}.chart-container{width:100%;min-height:290px;overflow-x:auto}.chart-svg{display:block;width:100%;min-width:620px;height:290px;overflow:visible}.chart-grid{stroke:#e9edf4;stroke-width:1}.chart-axis{fill:#78879a;font-size:10px}.chart-line{fill:none;stroke-width:2.5;stroke-linecap:round;stroke-linejoin:round}.chart-point{stroke:#fff;stroke-width:2;cursor:crosshair}.chart-legend{display:flex;gap:12px 18px;flex-wrap:wrap;margin:12px 0 4px}.legend-item{display:flex;align-items:center;gap:7px;color:#586b83;font-size:11px}.legend-swatch{width:9px;height:9px;border-radius:50%}.chart-tooltip{position:fixed;z-index:4;display:none;padding:9px 11px;border-radius:7px;background:#172d49;color:#fff;box-shadow:0 4px 16px #152a4528;font-size:11px;pointer-events:none;white-space:pre-line}.missing-dates{display:flex;gap:6px;flex-wrap:wrap;margin-top:12px}.missing-date{padding:5px 8px;border:1px dashed #c7a15d;border-radius:6px;color:#8a5b13;background:#fffaf1;font-size:11px}.empty-page{min-height:55vh;display:grid;justify-items:center;align-content:center;text-align:center}.empty-page .eyebrow{margin-top:16px}.empty-page .subheading{margin-bottom:22px}.empty-icon{width:58px;height:58px;display:grid;place-items:center;border-radius:50%;background:#edf2fa;color:#54709c;font-size:26px}.page-empty-note{padding:26px;text-align:center;color:#718198;font-size:13px}
@media(max-width:1050px){.stat-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.content{padding:27px 25px}.topbar{padding:0 25px}}
@media(max-width:760px){.sidebar{position:static;width:100%;height:auto;padding:10px 12px;display:block}.brand,.sidebar-foot{display:none}.sidebar nav{display:flex;gap:4px;overflow-x:auto}.nav-link{padding:10px 12px;white-space:nowrap;font-size:12px}.nav-link span{font-size:15px}.nav-link.active{box-shadow:inset 0 -2px #7999ff}.main-area{margin-left:0}.topbar{height:56px;padding:0 16px}.mobile-brand{display:flex;font-size:13px}.topbar .env-chip{font-size:10px;padding:6px 8px}.topbar .button{font-size:11px;padding:8px}.content{padding:23px 15px}.page-footer{padding:13px 15px}.page-heading h1{font-size:23px}.subheading{font-size:12px}.panel,.search-panel{padding:16px;margin-bottom:14px}.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.stat-card{padding:14px;min-height:89px}.stat-card .value{font-size:23px}.search-panel{align-items:stretch;gap:11px}.search-panel label{min-width:100%}.search-actions{width:100%}.search-actions .button{flex:1}.user-identity{gap:20px}.chart-container{margin-left:-4px}.chart-svg{height:255px}.page-heading{align-items:flex-start}.page-heading>.button{font-size:11px}}
.billing-form{display:grid;grid-template-columns:repeat(3,minmax(150px,1fr));gap:14px;align-items:end}.billing-form label{display:grid;gap:7px;font-size:12px;color:#53657c}.billing-form input{width:100%;padding:10px 11px;border-radius:8px;border:1px solid #d9e1ec;color:#203752;font:inherit;font-size:14px}.billing-actions{display:flex;gap:8px}.receipt-summary{padding:12px;border-radius:8px;background:#f3f6fc;color:#314a67;font-size:13px;line-height:1.65;white-space:pre-line}.billing-warning-row{background:#fff9eb}.billing-warning-row td{color:#805414}
@media(max-width:760px){.billing-form{grid-template-columns:1fr}.billing-actions{width:100%}.billing-actions .button{flex:1}}
.billing-history-tabs{display:flex;gap:8px;border-bottom:1px solid var(--line);margin-bottom:18px;padding-bottom:10px}.billing-history-tabs [aria-selected="true"]{background:#eaf0ff;color:#234fc4;border-color:#cbd8ff}.billing-history-summary{grid-template-columns:repeat(3,minmax(0,1fr));margin:0 0 16px}.billing-history-summary .stat-card{min-height:82px;padding:14px}.billing-history-summary .value{font-size:21px;margin-top:6px}.billing-history-filter{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px;margin:8px 0 14px}.billing-history-filter select{min-width:220px;border:1px solid #d9e1ec;border-radius:8px;padding:9px 11px;background:#fff;color:#203752;font:inherit;font-size:13px}@media(max-width:760px){.billing-history-summary{grid-template-columns:1fr}.billing-history-filter{align-items:stretch;flex-direction:column}.billing-history-filter select{width:100%}}
#user-billing-summary{grid-template-columns:repeat(4,minmax(0,1fr))}@media(max-width:760px){#user-billing-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
.sync-environment{margin:0 0 8px}.sync-status-note{margin:0 0 18px}.sync-stage-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}.sync-stage-card{border:1px solid var(--line);border-radius:9px;background:#fbfcfe;padding:14px}.sync-stage-card h3{font-size:14px;margin:0 0 12px;color:#213653}.sync-stage-card p{margin:8px 0}.sync-stage-card strong{font-size:12px;display:block;margin-top:4px;color:#314a67}.sync-counters{display:flex;gap:7px;flex-wrap:wrap;margin-top:10px}.sync-counters span{font-size:11px;border-radius:14px;background:#eef3f8;color:#53657c;padding:5px 8px}.sync-error-category{background:#fff4e8;color:#8a5215}.sync-task-list{display:grid;gap:9px}.sync-task-item{border:1px solid var(--line);border-radius:9px;padding:0 14px;background:#fff}.sync-task-item summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:minmax(70px,.5fr) minmax(155px,1fr) minmax(200px,1.3fr) minmax(120px,.8fr);align-items:center;gap:12px;padding:13px 0;font-size:12px;color:#344962}.sync-task-item summary::-webkit-details-marker{display:none}.sync-task-item summary:after{content:"查看阶段详情";font-size:11px;color:var(--blue);grid-column:1/-1}.sync-task-item[open] summary:after{content:"收起阶段详情"}.sync-task-detail{border-top:1px solid var(--line);padding:10px 0 14px}.sync-stage-status.success{color:var(--green)}.sync-stage-status.failed{color:var(--red)}.sync-stage-status.running{color:var(--amber)}.sync-stage-status.interrupted{color:#6b5b9a}
@media(max-width:760px){.sync-stage-grid{grid-template-columns:1fr}.sync-task-item summary{grid-template-columns:1fr auto;gap:7px}.sync-task-item summary .muted{grid-column:1/-1}.sync-task-item summary:after{grid-column:1/-1}}
.auth-page{min-height:100vh;display:grid;place-items:center;padding:24px;background:#f4f7fb}.auth-card{width:min(100%,480px);padding:30px;border:1px solid #dce5ef;border-radius:14px;background:#fff;box-shadow:0 14px 36px #17324d12}.auth-card h1{margin-top:0}.auth-card form{display:grid;gap:12px;margin-top:20px}.auth-card input:not([type=checkbox]){width:100%;min-height:44px;padding:10px 12px;border:1px solid #b8c6d5;border-radius:8px;font-size:1rem}.auth-qr{display:block;width:220px;height:220px;margin:18px auto}.auth-card code{overflow-wrap:anywhere;user-select:all}.auth-card #recovery-codes{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 24px;font-family:ui-monospace,monospace}.auth-card #recovery-codes li{min-width:0;padding:4px;user-select:all;overflow-wrap:anywhere;word-break:break-all;font-size:.92rem}@media (max-width:560px){.auth-card #recovery-codes{grid-template-columns:1fr}}.auth-ack{display:flex;align-items:flex-start;gap:12px;margin:18px 0 14px;padding:14px 16px;border:1px solid #d7e2f0;border-radius:12px;background:#f7faff;font-size:.95rem;line-height:1.5;color:#203752;cursor:pointer;transition:background .15s,border-color .15s}.auth-ack:hover{background:#eef4fd;border-color:#b9cdec}.auth-ack input[type=checkbox]{flex:0 0 auto;width:20px;height:20px;min-height:0;margin:1px 0 0;padding:0;border-radius:4px;accent-color:#2457d6;cursor:pointer}.auth-card #recovery-panel h2{font-size:1.05rem;margin:22px 0 6px}.auth-card #recovery-codes{margin:10px 0 2px;padding-left:1.4em;line-height:1.6}.auth-recovery-note{font-size:.85rem;color:#71839a;margin:12px 0 4px}.auth-card #continue-button{width:100%;margin-top:8px}
 .mock-data-banner{margin:0 36px;padding:10px 14px;border:1px solid #ead19a;border-radius:8px;background:#fff8e8;color:#76520c;font-size:12px;font-weight:600}
@media(max-width:760px){.mock-data-banner{margin:0 15px}}

/* Card list page: select styling matches the text inputs, status colours stay readable. */
.search-panel select{width:100%;padding:10px 11px;border-radius:8px;border:1px solid #d9e1ec;color:#203752;font:inherit;font-size:13px;outline:none;background:#fff}
.search-panel select:focus{border-color:#7392ec;box-shadow:0 0 0 3px #5276e820}
.card-status{font-weight:600}
.card-status.status-activated{color:#16866d}
.card-status.status-frozen{color:#7757c8}
.card-status.status-deleted{color:#c85252}
.card-status.status-not_activated{color:#d39a2e}

/* Stat tiles double as drill-down links to the filtered card list. */
a.stat-card-link{display:block;text-decoration:none;color:inherit;transition:transform .12s ease,box-shadow .12s ease}
a.stat-card-link:hover{transform:translateY(-2px);box-shadow:0 8px 20px #192f4c14}
a.stat-card-link:focus-visible{outline:2px solid #5276e8;outline-offset:2px}
a.stat-card-link::after{content:"查看明细 →";display:block;margin-top:8px;font-size:11px;color:#7b8ca2}
a.stat-card-link:hover::after{color:#2457d6}

/* Budget pools: one card per budget so shared vs personal is obvious. */
.budget-pool{border:1px solid var(--line);border-radius:12px;padding:18px;margin-bottom:16px;background:#fff}
.budget-pool:last-child{margin-bottom:0}
.budget-pool-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;flex-wrap:wrap;margin-bottom:14px}
.budget-pool-head h3{margin:0 0 6px;font-size:15px;color:#213653;display:flex;align-items:center;gap:8px}
.budget-pool-head h3 .mapping-pill{font-size:11px;font-weight:600}
.budget-pool-stats{display:flex;gap:22px;flex-wrap:wrap}
.budget-pool-stats .label{font-size:11px;color:var(--muted)}
.budget-pool-stats .value{font-size:19px;font-weight:700;color:#1a3152;margin-top:4px}
.budget-pool-stats .budget-negative .value{color:#c85252}

/* Daily card openings: a compact inline bar keeps the table readable. */
.opening-bar{display:inline-block;height:10px;border-radius:5px;background:#5276e8;vertical-align:middle}

/* Data-quality warnings only appear when a count is non-zero. */
.overview-warning{background:#fff8e8;border:1px solid #f0d79a;color:#7a5a12;border-radius:10px;padding:13px 16px;margin:0 0 18px;font-size:13px}
.overview-warning a{color:#8a5b13;font-weight:600}

/* Loud reminder while a Production deployment runs on Sandbox data. */
.trial-banner{background:#8d2d2d;color:#fff;padding:11px 16px;border-radius:9px;margin:0 0 16px;font-size:13px}
.trial-banner strong{font-weight:700}

/* Marks cards whose spending limit is fixed at creation. */
.lock-pill{background:#fff1e6;color:#a15a13;font-weight:600}

/* Card funds type: two kinds, plus a marker for inferred values. */
.pool-pill{background:#e8f2fb;color:#1c5f92;font-weight:600}
.lock-pill{background:#fff1e6;color:#a15a13;font-weight:600}
.derived-pill{outline:1px dashed #b98a4a}

/* Merchant spend bars on the spending page. */
.spending-bar{display:inline-block;height:10px;border-radius:5px;background:#2457d6;vertical-align:middle}

/* Sortable column headers on the card list. */
.sort-header{background:#eef3fb;border:1px solid #d7e2f2;border-radius:6px;padding:3px 8px;font:inherit;font-weight:600;color:#2a4a72;cursor:pointer;display:inline-flex;align-items:center;gap:5px}
.sort-header:hover{background:#dde9fa;border-color:#b9cdea;color:#1d4ed8}
.sort-header.sorting{background:#2457d6;border-color:#2457d6;color:#fff}
.sort-arrow{font-size:11px;color:#7b8ca2}
.sort-header.sorting .sort-arrow{color:#fff}

/* Last four digits, shown for reconciling against BILL's card list. */
.card-last-four{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:#6b7c92;font-weight:600}

/* Mirrored horizontal scrollbar shown above wide tables. */
.table-scroll-top{position:relative;height:12px;margin:0 0 6px;border-radius:6px;background:#f2f5f9;touch-action:none}
.table-scroll-top[hidden]{display:none}
.table-scroll-thumb{position:absolute;top:1px;left:0;height:10px;border-radius:6px;background:#c3cede;cursor:grab}
.table-scroll-thumb:hover{background:#a9b8cc}
.table-scroll-thumb:active{cursor:grabbing;background:#94a6bd}

.budget-changes{margin-top:14px;border-top:1px solid #e6ecf5;padding-top:10px}
.budget-changes summary{cursor:pointer;font-size:13px;font-weight:600;color:#2457d6}
.budget-changes ul{margin:8px 0 0;padding-left:18px;font-size:13px;line-height:1.7}
.budget-changes li strong{color:#1a3152;margin:0 2px}

.budget-summary-row{display:flex;justify-content:space-between;gap:24px;flex-wrap:wrap}
.budget-summary-item .label{display:block;font-size:12px;color:var(--muted)}
.budget-summary-item strong{font-size:22px;color:#1a3152}
.budget-summary-right{text-align:right}
.budget-bar{display:flex;height:26px;border-radius:4px;overflow:hidden;background:#e6ecf5;margin:14px 0 8px}
.budget-bar span{display:block;height:100%}
#budget-bar-spent{background:#0f3d2e}
#budget-bar-assigned{background:#2f9c8a}
.budget-limit-line{text-align:right;font-size:13px;color:var(--muted);margin:0}
.budget-columns{display:grid;grid-template-columns:1.05fr 1fr;gap:18px;align-items:start}
@media (max-width:1100px){.budget-columns{grid-template-columns:1fr}}
.budget-policy{list-style:none;margin:0;padding:0;font-size:14px;line-height:2}
.budget-policy li{border-bottom:1px solid #eef2f8}
.budget-txn-line{font-size:15px;margin:6px 0 12px}

.usage-bar{display:inline-block;width:96px;height:10px;border-radius:5px;background:#e6ecf5;overflow:hidden;vertical-align:middle;margin-right:8px}
.usage-bar span{display:block;height:100%}
.usage-ok{background:#2f9c8a}
.usage-warn{background:#d39a2e}
.usage-danger{background:#c85252}
.usage-label{font-size:13px;color:#1a3152}

.health-alert{border:1px solid #e0a3a3;background:#fdf3f3;color:#8d2b2b;border-radius:10px;padding:12px 16px;margin-bottom:16px;font-size:14px;line-height:1.8}
.health-alert a{color:#8d2b2b;text-decoration:underline;margin-right:2px}

.health-total-row td{font-weight:700;background:#f4f7fb;border-top:2px solid #d8e2f0}

/* Data caveat: tells the reader a history is incomplete. Amber, not red,
   because the page still works — the warning is about missing history. */
.data-caveat{display:flex;gap:10px;align-items:flex-start;background:#fff7e6;border:1px solid #f0c36d;border-left:6px solid #d98b00;border-radius:8px;padding:12px 16px;margin:0 0 16px;color:#7a4b00;font-size:14px;line-height:1.7}
.data-caveat strong{color:#a35c00}
.data-caveat::before{content:"⚠";font-size:18px;line-height:1.4;color:#d98b00}

.core-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(74px,1fr));gap:8px}
.core-cell{text-align:center;font-size:11px;color:var(--muted)}
.core-bar{height:70px;background:#e6ecf5;border-radius:6px;display:flex;align-items:flex-end;overflow:hidden}
.core-bar span{display:block;width:100%;transition:height .3s}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:16px}
@media (max-width:1100px){.two-col{grid-template-columns:1fr}}

.billing-bulk-toggle{display:flex;align-items:center;gap:8px;font-size:14px}

.risk-high{background:#fdf3f3;border-color:#e0a3a3;border-left-color:#c85252;color:#8d2b2b}
.risk-high strong{color:#a32020}
.risk-medium{background:#fff7e6;border-color:#f0c36d;border-left-color:#d98b00}
.risk-ok{background:#eefaf4;border-color:#9fd8bf;border-left-color:#1a9c74;color:#1b5e46}
.ip-chips{display:flex;flex-wrap:wrap;gap:8px}
.ip-chip{background:#fdecec;border:1px solid #e0a3a3;color:#8d2b2b;border-radius:6px;padding:3px 9px;font-size:13px;font-family:ui-monospace,monospace}

.layer-list{display:flex;flex-direction:column;gap:10px;margin-bottom:16px}
.layer-row{border-left:4px solid #2457d6;background:#f6f9fe;border-radius:6px;padding:10px 14px}
.layer-row p{margin:4px 0 0;font-size:13px}

/* Public join form: self-contained page, no sidebar. */
.apply-body{min-height:100vh;display:grid;place-items:center;padding:28px 18px;background:linear-gradient(180deg,#f7f9fd,#eef3fa)}
.apply-shell{width:100%;max-width:440px;display:grid;gap:16px}
.apply-brand{display:flex;align-items:center;gap:11px}
.apply-brand strong{display:block;font-size:17px;color:var(--navy)}
.apply-brand small{display:block;margin-top:3px;font-size:12px;color:var(--muted)}
.apply-card{display:grid;gap:14px;margin:0}
.apply-card label{display:grid;gap:7px;font-size:12px;color:#53657c}
.apply-card input{padding:11px 12px;border-radius:8px;border:1px solid #d9e1ec;font:inherit;font-size:14px;color:#203752;outline:none;width:100%}
.apply-card input:focus{border-color:#7392ec;box-shadow:0 0 0 3px #5276e820}
.apply-name-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.apply-honeypot{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.apply-submit{width:100%;padding:12px}
.apply-message{margin:0;min-height:18px;font-size:13px;color:var(--green)}
.apply-message.error{color:var(--red)}
.apply-note{margin:0;text-align:center;font-size:12px;color:var(--muted);line-height:1.6}
@media (max-width:420px){.apply-name-row{grid-template-columns:1fr}}

.invite-code-reveal{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:16px 0 6px;padding:16px 18px;border:2px solid #5276e8;border-radius:12px;background:#eef3ff}
.invite-code-reveal[hidden]{display:none}
.invite-code-main{display:grid;gap:6px;min-width:0}
.invite-code-label{font-size:12px;color:#53657c}
#invite-code-value{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:26px;letter-spacing:.14em;color:#142b4a;word-break:break-all}
.invite-code-hint{font-size:12px;color:#5a6c85}
.invite-code-hint.copied{color:#147d64;font-weight:600}

/* Sidebar groups: the menu is short until you open the section you need. */
.nav-group{margin-bottom:2px}
.nav-group-toggle{width:100%;display:flex;align-items:center;gap:7px;background:none;border:0;padding:9px 12px 5px;color:#8fa3bd;font:inherit;font-size:11px;font-weight:700;letter-spacing:.08em;cursor:pointer;text-align:left}
.nav-group-toggle:hover{color:#cfdbec}
.nav-group-toggle:focus-visible{outline:2px solid #7999ff;outline-offset:-2px;border-radius:6px}
.nav-group-caret{width:12px;height:12px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transform:rotate(90deg);transition:transform .15s ease}
.nav-group.is-collapsed .nav-group-caret{transform:rotate(0deg)}
.nav-group.is-collapsed .nav-group-links{display:none}
.nav-group-links{display:grid;gap:3px}
@media(max-width:760px){.nav-group-toggle{padding:10px 4px 4px}}

/* Web traffic page: funnel rows, simple CSS bars, two-column tables. */
.wt-funnel{display:grid;gap:8px}
.wt-funnel-row{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:10px 14px;border-radius:8px;background:#f7f9fd;font-size:13px;color:#42566f}
.wt-funnel-row strong{font-size:18px;color:#142b4a}
.wt-series{display:grid;gap:6px;max-height:300px;overflow-y:auto;padding-right:6px}
.wt-series-row{display:grid;grid-template-columns:150px 1fr 60px;align-items:center;gap:12px;font-size:12px;color:#53657c}
.wt-series-label{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:#6f7f95}
.wt-bar-track{background:#eef2f9;border-radius:6px;height:12px;overflow:hidden}
.wt-bar{background:#5f82f3;height:100%;border-radius:6px}
.wt-series-value{text-align:right;font-weight:600;color:#1a3152}
.wt-columns{display:grid;grid-template-columns:1fr 1fr;gap:20px;align-items:start}
.wt-stale{color:#a76412;font-weight:600}
@media(max-width:1100px){.wt-columns{grid-template-columns:1fr}.wt-series-row{grid-template-columns:110px 1fr 46px}}

/* Attack alerts: impossible to miss, one click to dismiss. */
.alert-banner{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:0 0 16px;padding:14px 18px;border:2px solid #d66565;border-radius:10px;background:#fff2f1;color:#7d2b2b}
.alert-banner[hidden]{display:none}
.alert-banner-text{display:grid;gap:4px;min-width:0}
.alert-banner-text strong{font-size:15px}
.alert-banner-text span{font-size:13px;color:#8d4a4a}
.alert-banner-actions{display:flex;gap:8px}
.nav-badge{margin-left:auto;min-width:20px;padding:1px 6px;border-radius:10px;background:#d66565;color:#fff;font-size:11px;font-weight:700;text-align:center}
.nav-badge[hidden]{display:none}
.wt-alerts{display:grid;gap:10px}
.wt-alert{border-left:4px solid #d66565;background:#fff5f4;border-radius:8px;padding:12px 14px}
.wt-alert strong{display:block;color:#7d2b2b;font-size:14px}
.wt-alert p{margin:4px 0 0;font-size:13px;color:#8d4a4a}
.wt-alert .wt-alert-ips{margin:6px 0 0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:#7d5b5b}

/* Budget names in the per-employee summary open that budget. */
.budget-summary-link{color:#2457d6;text-decoration:none;font-weight:600}
.budget-summary-link:hover{text-decoration:underline}
.budget-summary-link.mapping-pill{color:var(--green)}
.budget-summary-link.mapping-pill:hover{text-decoration:underline}

/* A budget that tolerates overspend is a risk, not a number to skim past. */
.budget-warning{border-top:3px solid #d66565}
.budget-warning-text{color:#b84040}
