:root {
    --ink: #17232b;
    --muted: #607078;
    --line: #d9e0df;
    --canvas: #f5f7f5;
    --panel: #ffffff;
    --sidebar: #1b302f;
    --sidebar-muted: #b7c7c2;
    --teal: #097d75;
    --teal-soft: #d9f0eb;
    --coral: #bf553a;
    --coral-soft: #fbe5de;
    --gold: #a96d00;
    --gold-soft: #f7ecd2;
    --violet: #7156a5;
    --violet-soft: #ede5f7;
    --green: #28764a;
    --green-soft: #dff2e5;
    --red: #b23e42;
    --red-soft: #f8e2e2;
    --blue: #356e9e;
    --blue-soft: #e0eef8;
    --radius: 8px;
    font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }

html, body { width: 100%; min-width: 320px; }
body { margin: 0; min-height: 100vh; background: var(--canvas); overflow-x: hidden; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .52; }
a { color: inherit; text-decoration: none; }
svg { width: 18px; height: 18px; stroke-width: 2; flex: 0 0 auto; }

.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; }
.app-shell { width: 100%; max-width: 100%; min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { background: var(--sidebar); color: #f7fffb; padding: 22px 14px 18px; display: flex; flex-direction: column; min-height: 100vh; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 5px 10px 24px; font-weight: 750; font-size: 16px; letter-spacing: 0; }
.brand-mark { display: inline-flex; justify-content: center; align-items: center; width: 31px; height: 31px; border-radius: 7px; background: #e6f4ea; color: #17695f; }
.brand-mark.large { width: 52px; height: 52px; border-radius: 8px; }
.brand-mark.large svg { width: 27px; height: 27px; }
.nav-list { display: grid; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 43px; border-radius: 6px; padding: 0 11px; color: var(--sidebar-muted); font-size: 14px; }
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active { background: #e5f4ea; color: #18534e; font-weight: 700; }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.14); padding: 18px 10px 3px; }
.sidebar-label { display: block; color: #8ea59e; font-size: 11px; letter-spacing: 0; margin-bottom: 9px; }
.mini-connection { display: flex; align-items: center; gap: 8px; color: #e7f0ed; font-size: 13px; overflow: hidden; }
.mini-connection span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #83908b; flex: 0 0 auto; }
.status-dot.active { background: #45c277; box-shadow: 0 0 0 3px rgba(69,194,119,.18); }

.main-content { width: 100%; min-width: 0; }
.topbar { height: 66px; border-bottom: 1px solid var(--line); padding: 0 clamp(20px, 3vw, 42px); background: rgba(255,255,255,.9); display: flex; align-items: center; justify-content: space-between; }
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.breadcrumb strong { color: var(--ink); font-weight: 700; }
.breadcrumb svg { width: 15px; height: 15px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.topbar-actions form { margin: 0; }
.admin-identity { display: inline-flex; align-items: center; gap: 6px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 13px; }
.admin-identity svg { width: 15px; height: 15px; }
.page-content { width: min(1440px, 100%); min-width: 0; margin: 0 auto; padding: 32px clamp(20px, 3vw, 42px) 48px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-heading.compact { margin-bottom: 22px; }
.page-heading h1, .auth-card h1, .setup-panel h1 { margin: 4px 0 7px; font-size: 28px; line-height: 1.22; letter-spacing: 0; }
.page-heading p:not(.eyebrow), .panel-heading p, .connection-row p, .note-panel p, .empty-copy, .login-brand p, .auth-card > p, .setup-panel > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.eyebrow { margin: 0; color: var(--teal); font-size: 11px; font-weight: 760; letter-spacing: 0; text-transform: uppercase; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.header-actions form { margin: 0; }

.button { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 6px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.button-primary { background: var(--teal); color: #fff; }
.button-primary:hover { background: #06675f; }
.button-secondary { background: #eef4f2; border-color: #d5e2de; color: #27524e; }
.button-secondary:hover { background: #e0ebe7; }
.button-danger { background: var(--red-soft); color: #943a3d; border-color: #edc9ca; margin-top: 18px; }
.button-danger:hover { background: #f3d5d5; }
.button-full { width: 100%; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: #506068; }
.icon-button:hover { background: #eef4f2; color: var(--teal); border-color: #bdd9d2; }
.icon-button.danger:hover { background: var(--red-soft); color: var(--red); border-color: #eabfc0; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-height: 112px; border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius); padding: 18px; display: flex; align-items: center; gap: 14px; }
.metric-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 7px; }
.metric-icon.coral { color: var(--coral); background: var(--coral-soft); }.metric-icon.gold { color: var(--gold); background: var(--gold-soft); }.metric-icon.teal { color: var(--teal); background: var(--teal-soft); }.metric-icon.violet { color: var(--violet); background: var(--violet-soft); }
.metric-card span { display: block; color: var(--muted); font-size: 13px; margin-bottom: 2px; }.metric-card strong { display: block; font-size: 27px; line-height: 1.15; }
.split-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }.dashboard-grid { margin-bottom: 18px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 21px; min-width: 0; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.panel-heading h2, .note-panel h2, .login-panel h2 { margin: 3px 0 4px; font-size: 17px; line-height: 1.35; letter-spacing: 0; }.panel-icon { color: #6a8580; width: 20px; height: 20px; }
.connection-row { display: flex; gap: 12px; padding: 8px 0 20px; }.connection-row strong { display: block; margin-bottom: 3px; font-size: 14px; }
.text-link { display: inline-flex; align-items: center; gap: 5px; color: #1a756d; font-size: 13px; font-weight: 700; }.text-link:hover { color: #075b54; }.text-link svg { width: 15px; height: 15px; }.text-link.centered { justify-content: center; margin-top: 15px; width: 100%; }
.detail-list { margin: 0 0 20px; display: grid; gap: 12px; }.detail-list div { display: flex; justify-content: space-between; gap: 16px; align-items: center; }.detail-list dt { color: var(--muted); font-size: 13px; }.detail-list dd { margin: 0; font-size: 13px; text-align: right; }
.status-badge { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 750; white-space: nowrap; }.status-badge.active, .status-badge.success, .status-badge.published { background: var(--green-soft); color: var(--green); }.status-badge.expired, .status-badge.failed { background: var(--red-soft); color: var(--red); }.status-badge.disabled { background: #e9edeb; color: #68726f; }.status-badge.scheduled, .status-badge.running { background: var(--blue-soft); color: var(--blue); }.status-badge.partial { background: var(--gold-soft); color: var(--gold); }
.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }.action-tile { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 17px; display: grid; grid-template-columns: 22px minmax(0, 1fr) 18px; align-items: center; gap: 12px; color: #37615c; }.action-tile:hover { border-color: #9ec7bd; background: #fbfefc; }.action-tile span { min-width: 0; }.action-tile strong, .action-tile small { display: block; }.action-tile strong { color: var(--ink); font-size: 14px; margin-bottom: 3px; }.action-tile small { color: var(--muted); font-size: 12px; }.action-tile > svg:last-child { color: #6b8580; width: 16px; height: 16px; }

.content-grid { display: grid; gap: 18px; align-items: start; }.narrow-wide { grid-template-columns: minmax(290px, .8fr) minmax(300px, 1.2fr); }.form-table-grid { grid-template-columns: minmax(290px, .75fr) minmax(420px, 1.5fr); }.form-panel { position: sticky; top: 20px; }.form-stack { display: grid; gap: 15px; }.form-stack label { display: grid; gap: 7px; color: #3d4d53; font-size: 13px; font-weight: 700; }.form-stack input, .form-stack textarea, .form-stack select { width: 100%; border: 1px solid #cbd5d2; background: #fff; color: var(--ink); border-radius: 6px; padding: 10px 11px; outline: none; font-weight: 450; }.form-stack textarea { resize: vertical; min-height: 92px; line-height: 1.5; }.form-stack input:focus, .form-stack textarea:focus, .form-stack select:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(9,125,117,.12); }.form-stack .button { margin-top: 4px; }
.form-stack .field-note { color: var(--muted); font-size: 11px; font-weight: 450; line-height: 1.35; }
.checkbox-label { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }
.checkbox-label > span:last-child, .checkbox-label > span:only-child { display: inline-flex; align-items: center; gap: 8px; font-weight: 450; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; margin: 0; padding: 0; accent-color: var(--teal); }
.permission-fieldset { display: grid; gap: 9px; margin: 0; padding: 12px; border: 1px solid #d8e1de; border-radius: 6px; }
.permission-fieldset legend { padding: 0 4px; color: #3d4d53; font-size: 13px; font-weight: 700; }
.permission-fieldset .checkbox-label { min-height: 22px; }
.note-panel { padding: 28px; }.note-panel > svg { color: var(--gold); width: 26px; height: 26px; margin-bottom: 14px; }.note-panel h2 { font-size: 20px; margin-bottom: 8px; }.connected-account { display: flex; align-items: center; gap: 13px; padding: 8px 0 8px; }.avatar-placeholder { display: inline-flex; align-items: center; justify-content: center; width: 45px; height: 45px; background: var(--teal-soft); color: var(--teal); border-radius: 50%; }.connected-account strong { font-size: 15px; display: block; }.connected-account p, .connected-account small { display: block; margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.table-panel { padding: 0; overflow: hidden; }.table-panel > .panel-heading { padding: 21px 21px 0; }.table-scroll { overflow-x: auto; }.table-scroll table { width: 100%; min-width: 650px; border-collapse: collapse; font-size: 13px; }.table-scroll th { color: var(--muted); text-align: left; font-size: 11px; font-weight: 750; background: #f8faf9; }.table-scroll th, .table-scroll td { padding: 13px 14px; border-top: 1px solid #e4e9e7; vertical-align: middle; }.table-scroll td:first-child, .table-scroll th:first-child { padding-left: 21px; }.table-scroll td:last-child, .table-scroll th:last-child { padding-right: 21px; }.table-scroll td strong { display: block; font-size: 13px; }.table-scroll td small { color: var(--muted); display: block; margin-top: 3px; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }.reason-cell { max-width: 210px; color: #48565b; line-height: 1.45; }.table-actions { display: flex; gap: 6px; justify-content: flex-end; }.table-actions form { margin: 0; }.empty-state { display: grid; justify-items: center; gap: 9px; padding: 48px 20px; color: var(--muted); }.empty-state p { margin: 0; font-size: 14px; }.empty-state svg { width: 24px; height: 24px; color: #9ca9a6; }
.announcement-list { display: grid; }.announcement-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 16px; border-top: 1px solid #e4e9e7; padding: 16px 21px; }.announcement-date { display: grid; align-content: start; gap: 7px; color: var(--muted); font-size: 12px; }.announcement-copy strong { font-size: 14px; }.announcement-copy p { margin: 5px 0 0; color: #526268; font-size: 13px; line-height: 1.55; word-break: break-word; }

.flash { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 18px; padding: 12px 14px; border-radius: 6px; border: 1px solid; font-size: 13px; line-height: 1.45; }.flash.success { color: #256a43; background: var(--green-soft); border-color: #bee0c9; }.flash.error { color: #963b3f; background: var(--red-soft); border-color: #ebc4c6; }.flash.warning { color: #85550a; background: var(--gold-soft); border-color: #e7d59d; }.flash svg { width: 17px; height: 17px; margin-top: 1px; }
.failure-page { max-width: 520px; padding: 62px 0; display: grid; justify-items: start; gap: 14px; }.failure-page > svg { color: var(--coral); width: 34px; height: 34px; }.failure-page h1 { margin: 0; font-size: 25px; }.failure-page p { margin: 0 0 4px; color: var(--muted); line-height: 1.6; }

.login-body { min-height: 100vh; background: #eef3f1; color: var(--ink); }.login-shell { min-height: 100vh; width: min(1000px, 100%); margin: auto; padding: 38px 28px; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, .9fr); align-items: center; gap: 72px; }.login-brand h1 { margin: 18px 0 10px; font-size: 38px; line-height: 1.14; letter-spacing: 0; }.login-brand > p:last-child { max-width: 360px; font-size: 16px; }.login-panel, .auth-card, .setup-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }.login-panel { display: grid; gap: 22px; }.login-panel h2 { font-size: 22px; }.auth-step { min-height: calc(100vh - 66px - 80px); display: grid; place-items: center; }.auth-card { width: min(100%, 440px); text-align: center; }.auth-card .eyebrow, .auth-card > p { text-align: center; }.auth-card > p { margin-bottom: 24px; }.auth-symbol { margin: 0 auto 17px; width: 45px; height: 45px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; }.auth-symbol svg { width: 22px; height: 22px; }.auth-card .form-stack { text-align: left; }.setup-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; }.setup-panel { width: min(100%, 590px); }.setup-panel h1 { margin-top: 17px; }.issue-list { margin: 20px 0; padding-left: 21px; color: var(--coral); line-height: 1.8; font-weight: 700; }.setup-note { font-size: 13px !important; }code { padding: 1px 5px; border-radius: 4px; background: #edf1ef; color: #38524f; }
.login-shell.login-shell-compact { width: min(440px, 100%); grid-template-columns: 1fr; gap: 0; }

@media (max-width: 1080px) { .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }.form-table-grid { grid-template-columns: minmax(270px, .72fr) minmax(390px, 1.28fr); }.action-grid { grid-template-columns: 1fr; }.action-tile { max-width: none; } }
@media (max-width: 820px) { .app-shell { display: block; }.sidebar { position: static; min-height: auto; height: auto; padding: 12px 16px; }.brand { padding: 4px 0 13px; }.nav-list { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 2px; }.nav-item { min-height: 38px; padding: 0 9px; }.nav-item span { font-size: 13px; }.sidebar-footer { display: none; }.topbar { height: 57px; padding: 0 20px; }.page-content { padding: 24px 20px 38px; }.form-table-grid, .narrow-wide { grid-template-columns: 1fr; }.form-panel { position: static; }.login-shell { grid-template-columns: 1fr; gap: 30px; align-content: center; }.login-brand { text-align: center; }.login-brand > p:last-child { margin-inline: auto; }.login-brand .brand-mark { margin-inline: auto; } }
@media (max-width: 560px) { .page-heading { display: grid; gap: 14px; }.page-heading h1 { font-size: 24px; }.header-actions { width: 100%; }.header-actions > *, .header-actions .button { flex: 1; }.metrics { grid-template-columns: 1fr 1fr; gap: 10px; }.metric-card { min-height: 95px; padding: 13px; gap: 10px; }.metric-icon { width: 35px; height: 35px; }.metric-card strong { font-size: 23px; }.metric-card span { font-size: 11px; }.split-grid { grid-template-columns: 1fr; }.panel { padding: 17px; }.table-panel { padding: 0; }.table-panel > .panel-heading { padding: 17px 17px 0; }.announcement-row { grid-template-columns: 1fr; padding: 16px 17px; gap: 10px; }.announcement-date { grid-auto-flow: row; grid-template-columns: 1fr; justify-content: start; align-items: start; }.announcement-row .table-actions { justify-content: flex-start; }.breadcrumb > span, .breadcrumb > svg { display: none; }.login-shell { padding: 28px 20px; }.login-brand h1 { font-size: 30px; }.login-panel, .auth-card, .setup-panel { padding: 23px; } }

.status-badge.queued { background: var(--blue-soft); color: var(--blue); }
.world-scope, .created-by { color: var(--muted); font-size: 11px; }
