:root {
    --brand: #0057b7;
    --brand-dark: #003f86;
    --ink: #132238;
    --muted: #68758a;
    --line: #dce3ec;
    --surface: #ffffff;
    --canvas: #f4f7fb;
    --success: #16794b;
    --warning: #9a6500;
    --danger: #b42318;
    font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--ink);
    background: var(--canvas);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px; background: radial-gradient(circle at 15% 20%, #dbeeff 0, transparent 30%), linear-gradient(135deg, #f8fbff, #eaf2fb); }
.login-card { width: min(440px, 100%); background: rgba(255,255,255,.96); border: 1px solid rgba(0,87,183,.15); border-radius: 20px; padding: 38px; box-shadow: 0 24px 70px rgba(26,55,92,.14); }
.brand-mark { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; color: white; background: linear-gradient(145deg, var(--brand), #1d78d7); font: 800 26px Georgia, serif; box-shadow: 0 9px 25px rgba(0,87,183,.25); }
.brand-mark.small { width: 38px; height: 38px; border-radius: 11px; font-size: 20px; flex: 0 0 auto; }
.eyebrow { margin: 18px 0 6px; color: var(--brand); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-size: 27px; letter-spacing: -.02em; }
h2 { margin-bottom: 0; font-size: 18px; }
.muted { color: var(--muted); line-height: 1.65; font-size: 14px; }
.stack-form { display: grid; gap: 16px; margin-top: 28px; }
.stack-form label, .compact-field { display: grid; gap: 7px; font-size: 13px; color: #41506a; font-weight: 650; }
input, select { width: 100%; border: 1px solid #cfd8e5; border-radius: 9px; background: white; color: var(--ink); outline: none; }
input { min-height: 43px; padding: 10px 12px; }
select { min-height: 38px; padding: 7px 30px 7px 10px; }
input:focus, select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,87,183,.12); }
.button { border: 1px solid transparent; border-radius: 9px; padding: 9px 14px; font-weight: 700; color: var(--ink); background: white; transition: .16s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--brand); box-shadow: 0 5px 14px rgba(0,87,183,.2); }
.button.primary:hover { background: var(--brand-dark); }
.button.secondary { border-color: #cfd8e5; }
.button.danger { border-color: #f2c7c2; color: var(--danger); background: #fff8f7; }
.button.small { padding: 5px 9px; font-size: 12px; }
.button.wide { width: 100%; min-height: 45px; }
.button:disabled { opacity: .55; transform: none; cursor: wait; }
.form-error { min-height: 20px; margin: -3px 0; color: var(--danger); font-size: 13px; }
.security-note { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 224px; display: flex; flex-direction: column; padding: 24px 16px; color: white; background: #0d2b4d; z-index: 10; }
.brand-lockup { display: flex; gap: 11px; align-items: center; padding: 0 8px 23px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-lockup strong, .brand-lockup small { display: block; }
.brand-lockup small { margin-top: 3px; color: #a9bdd4; font-size: 11px; }
#main-nav { display: grid; gap: 4px; margin-top: 22px; }
.nav-button { width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; color: #bed0e3; background: transparent; text-align: left; font-weight: 650; }
.nav-button:hover, .nav-button.active { color: white; background: rgba(255,255,255,.12); }
.sidebar-foot { margin-top: auto; padding: 17px 8px 0; border-top: 1px solid rgba(255,255,255,.12); color: #b8c9db; font-size: 12px; }
.sidebar-foot span { display: block; margin-bottom: 7px; }
.text-button { border: 0; padding: 0; color: white; background: none; font-weight: 700; }
.workspace { min-height: 100vh; margin-left: 224px; padding: 30px 34px 22px; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 20px; }
.topbar .eyebrow { margin-top: 0; }
.topbar h1 { margin: 0; }
.topbar-actions { display: flex; align-items: flex-end; gap: 10px; }
.compact-field { min-width: 126px; }
.health-banner { display: flex; align-items: center; gap: 12px; min-height: 50px; margin-bottom: 18px; padding: 12px 16px; border: 1px solid #b9dfcc; border-radius: 11px; color: #125f3d; background: #effbf5; font-size: 13px; }
.health-banner.warning { color: #7a5100; border-color: #ead39c; background: #fff9e8; }
.health-banner.danger { color: #8f2018; border-color: #f0c4c0; background: #fff6f5; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px rgba(22,121,75,.12); }
.attribution-banner { display: grid; gap: 5px; margin-bottom: 16px; padding: 15px 17px; border: 1px solid #ead39c; border-left: 5px solid var(--warning); border-radius: 11px; color: #6f4d08; background: #fff9e8; font-size: 13px; line-height: 1.55; }
.attribution-banner.danger { border-color: #f0c4c0; border-left-color: var(--danger); color: #8f2018; background: #fff6f5; }
.attribution-banner small { color: inherit; opacity: .78; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi-card { min-height: 116px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 5px 18px rgba(21,45,75,.04); }
.kpi-card small { color: var(--muted); font-size: 12px; }
.kpi-card strong { display: block; margin-top: 13px; font-size: 27px; letter-spacing: -.03em; }
.kpi-card span { display: block; margin-top: 5px; color: #8a96a8; font-size: 11px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .7fr); gap: 16px; margin-bottom: 16px; }
.panel { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: 0 5px 18px rgba(21,45,75,.04); }
.overview-grid .panel { padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 17px; }
.panel-head .eyebrow { margin: 0 0 5px; }
.trend-row { display: grid; grid-template-columns: 82px 1fr 82px; align-items: center; gap: 10px; min-height: 31px; font-size: 12px; }
.trend-track { height: 9px; overflow: hidden; border-radius: 10px; background: #e8edf4; }
.trend-fill { height: 100%; min-width: 2px; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #55a5ee); }
.trend-value { color: var(--muted); text-align: right; }
.empty-box { padding: 30px 16px; border: 1px dashed #ccd7e4; border-radius: 9px; color: var(--muted); text-align: center; font-size: 13px; }
.export-actions { display: flex; gap: 9px; margin: 18px 0; }
.report-result { padding: 12px; border-radius: 8px; color: var(--muted); background: #f5f7fa; font-size: 12px; line-height: 1.65; word-break: break-all; }
.report-result a { color: var(--brand); font-weight: 700; }
.detail-panel { overflow: hidden; }
.detail-panel .panel-head { padding: 20px 20px 0; }
.count-pill { padding: 4px 9px; border-radius: 999px; color: var(--brand); background: #eaf3ff; font-size: 12px; font-weight: 800; }
.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; font-size: 12px; }
th { position: sticky; top: 0; padding: 11px 13px; border-bottom: 1px solid var(--line); color: #53627a; background: #f7f9fc; text-align: left; font-weight: 800; }
td { max-width: 360px; overflow: hidden; padding: 11px 13px; border-bottom: 1px solid #edf0f4; color: #283750; text-overflow: ellipsis; }
tbody tr:hover { background: #f8fbff; }
.level { padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.level.strong { color: #0d6940; background: #e7f7ef; }
.level.medium { color: #785400; background: #fff4d6; }
.level.weak { color: #68758a; background: #edf1f5; }
.attribution { padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.attribution.client { color: #0d6940; background: #e7f7ef; }
.attribution.internal { color: #124f86; background: #e5f1fb; }
.attribution.unknown { color: #8f2018; background: #fff0ee; }
.table-status { padding: 0 20px 14px; color: var(--muted); font-size: 12px; }
.pagination { display: flex; justify-content: flex-end; align-items: center; gap: 9px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.admin-form { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr auto; gap: 9px; padding: 0 20px 18px; }
.admin-form input, .admin-form select { min-height: 38px; }
.row-actions { display: flex; gap: 6px; }
dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 24px 80px rgba(10,31,55,.3); }
dialog::backdrop { background: rgba(12,31,52,.5); backdrop-filter: blur(2px); }
.dialog-card { display: grid; gap: 18px; padding: 25px; }
.dialog-card .eyebrow { margin-top: 0; }
.dialog-card label { display: grid; gap: 7px; color: #41506a; font-size: 13px; font-weight: 650; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
footer { padding: 20px 4px 0; color: #8490a2; font-size: 11px; text-align: center; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; max-width: min(420px, calc(100vw - 48px)); padding: 12px 16px; border-radius: 9px; color: white; background: #173758; box-shadow: 0 10px 28px rgba(9,31,56,.25); opacity: 0; pointer-events: none; transform: translateY(10px); transition: .18s; font-size: 13px; }
.toast.show { opacity: 1; transform: translateY(0); }
@media (max-width: 1080px) { .kpi-grid { grid-template-columns: repeat(2, 1fr); } .overview-grid { grid-template-columns: 1fr; } .topbar { align-items: flex-start; flex-direction: column; } }
@media (max-width: 760px) { .sidebar { position: static; width: auto; min-height: auto; } .sidebar-foot { margin-top: 20px; } .workspace { margin-left: 0; padding: 22px 16px; } .app-shell { display: block; } .topbar-actions { width: 100%; flex-wrap: wrap; } .compact-field { flex: 1; } .kpi-grid { grid-template-columns: 1fr 1fr; } .admin-form { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .kpi-grid { grid-template-columns: 1fr; } .login-card { padding: 28px 22px; } }
