:root {
    color-scheme: light;
    --ink: #202638;
    --muted: #6e778a;
    --line: #e5e8ef;
    --purple: #6851c8;
    --teal: #168575;
    font-family: "Segoe UI", system-ui, sans-serif;
    font-size: 14px;
    color: var(--ink);
    background: #f5f6fa;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--purple); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; padding: .65rem 1rem; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); }
button:hover { background: #f0edf9; }
button:disabled { cursor: default; opacity: .5; }
.primary { background: var(--purple); color: white; border-color: var(--purple); font-weight: 600; }
.primary:hover { background: #5440ac; }
input, select, textarea { width: 100%; border: 1px solid #d9deea; border-radius: 6px; padding: .65rem; background: white; color: var(--ink); }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #b9adea; outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: .4rem; font-size: .85rem; font-weight: 600; }
small { display: block; font-size: .8rem; color: var(--muted); margin-top: .35rem; }
h1 { font-size: 2rem; letter-spacing: -.04em; margin: .25rem 0 .5rem; }
h2 { font-size: 1.1rem; margin: 0 0 1.25rem; font-weight: 650; }
h3 { font-size: .95rem; margin: 1rem 0; }
p { line-height: 1.6; }
.muted, .section-note { color: var(--muted); }
.section-note { font-size: .85rem; margin: .7rem 0 1.25rem; }
.eyebrow { color: var(--purple); font-size: .7rem; letter-spacing: .15em; font-weight: 700; margin: 0; }
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 230px; flex-shrink: 0; padding: 30px 20px; background: #202339; color: #dedff1; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; color: white; font-size: 1.5rem; font-weight: 600; }
.brand small { color: #9d9fb8; font-size: .52rem; letter-spacing: .07em; }
.brand-mark { display: inline-grid; place-items: center; border-radius: 11px; width: 42px; height: 42px; background: #7f66d8; color: white; font-size: 1.6rem; font-weight: 700; flex-shrink: 0; }
.nav-label { color: #9092ab; font-size: .65rem; letter-spacing: .12em; margin: 45px 10px 15px; }
nav { display: flex; flex-direction: column; gap: 8px; }
nav a { color: #bfc1d5; padding: 13px 14px; border-radius: 8px; }
nav a:hover, nav a.active { color: white; background: #35334f; text-decoration: none; }
nav a.active { box-shadow: inset 3px 0 #a58ae9; }
.sidebar-footer { margin-top: auto; padding-top: 35px; font-size: .85rem; }
.sidebar-footer small { font-size: .7rem; color: #9296ac; margin-top: 20px; }
.link-button { background: transparent; border: 0; color: #c5b6fa; padding: .6rem 0; }
.main-content { width: calc(100% - 230px); max-width: 1800px; padding: 36px 38px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-header p { margin-bottom: 0; }
.refresh-label { font-size: .75rem; white-space: nowrap; }
.filters { display: flex; flex-wrap: wrap; align-items: end; gap: 14px; padding: 18px; background: white; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 22px; }
.filters label { flex: 1; min-width: 130px; }
.metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; margin: 20px 0 26px; }
.metric { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.metric > span { color: var(--muted); font-size: .8rem; }
.metric > strong { display: block; font-size: 2.15rem; margin: 12px 0; line-height: 1.15; word-break: break-word; }
.metric > small { font-size: .72rem; }
.danger-text { color: #b74a55; }
.panel { background: white; border: 1px solid var(--line); border-radius: 10px; padding: 24px; margin-bottom: 24px; min-width: 0; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.chart-row { display: grid; grid-template-columns: minmax(130px, 1fr) 1fr 25px; align-items: center; gap: 12px; margin: 19px 0; font-size: .8rem; }
.bar-track { background: #f0edf8; height: 9px; border-radius: 6px; overflow: hidden; }
.bar { background: #8f7ad5; height: 100%; border-radius: 6px; }
.daily-chart { display: flex; gap: 14px; height: 180px; padding-top: 10px; overflow-x: auto; }
.daily-column { flex: 1; min-width: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; font-size: .8rem; }
.daily-track { height: 110px; width: 24px; display: flex; align-items: flex-end; margin-top: auto; }
.daily-bar { background: #6eb4a9; width: 100%; border-radius: 4px 4px 0 0; min-height: 2px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 10px; }
.section-heading h2 { margin: 0; }
.section-heading > a { font-size: .85rem; }
.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; font-size: .85rem; }
th { padding: 15px 12px; color: var(--muted); font-weight: 600; font-size: .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 17px 12px; border-bottom: 1px solid #f0f1f5; vertical-align: top; }
td small { max-width: 260px; overflow-wrap: anywhere; }
td > a { white-space: nowrap; }
.badge { display: inline-block; border-radius: 5px; padding: .35rem .55rem; font-size: .72rem; white-space: nowrap; }
.good { color: #177968; background: #e7f4ef; }
.bad { color: #a23e4b; background: #fbecef; }
.neutral { color: #6e5ba7; background: #efedf9; }
.empty { text-align: center; padding: 30px 12px; color: var(--muted); font-size: .9rem; }
.attention-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid #f0f1f5; }
.attention-item > div { flex: 1; }
.attention-item p { color: var(--muted); font-size: .82rem; margin: .35rem 0 0; }
.attention-item > a { white-space: nowrap; font-size: .82rem; }
.attention-dot { height: 8px; width: 8px; border-radius: 50%; background: #d9a061; flex-shrink: 0; }
.pagination { display: flex; align-items: center; justify-content: end; gap: 10px; margin-top: 18px; }
.pagination > span { margin-right: auto; color: var(--muted); font-size: .8rem; }
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 24px 0; }
dt { color: var(--muted); font-size: .75rem; }
dd { margin: .5rem 0 0; overflow-wrap: anywhere; }
.identifier { font-size: .8rem; font-family: ui-monospace, monospace; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 25px; border-top: 1px solid var(--line); padding-top: 20px; }
.summary-strip span { font-size: .8rem; color: var(--muted); }
.summary-strip strong { display: block; font-size: 1.3rem; color: var(--ink); margin-top: .5rem; }
.timeline-item { display: flex; align-items: center; gap: 14px; margin: 18px 0; font-size: .9rem; }
.timeline-dot { height: 9px; width: 9px; background: #9b8acb; border-radius: 50%; flex-shrink: 0; }
.search { max-width: 450px; margin-bottom: 20px; }
.error-detail { max-width: 400px; font-size: .8rem; margin: 0 0 8px; overflow-wrap: anywhere; }
.agent-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
.agent-grid form label { margin-bottom: 16px; }
.checkbox { flex-direction: row; align-items: center; }
.checkbox input { width: auto; }
.actions { display: flex; gap: 10px; }
.alert { border: 1px solid #f0c9ce; border-radius: 7px; padding: 14px 18px; background: #fff2f3; color: #8e3d48; overflow-wrap: anywhere; }
.success-note { background: #eaf5ef; padding: 12px 18px; border-radius: 7px; color: #226a4d; }
.secret-card { background: #efedf9; border: 1px solid #cfc5ec; border-radius: 10px; padding: 24px; margin-bottom: 20px; }
.secret-card code { display: block; padding: 14px; background: white; overflow-wrap: anywhere; margin: 16px 0; user-select: all; }
.validation-message, .validation-errors { color: #a23e4b; }
.login-shell { display: grid; place-items: center; min-height: 100vh; padding: 24px; background: radial-gradient(ellipse at top, #e8e3f7, #f5f6fa 65%); }
.login-card { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 40px; width: min(440px, 100%); box-shadow: 0 20px 70px #24293a0c; }
.login-card .brand-mark { margin-bottom: 25px; }
.login-card h1 { font-size: 1.8rem; }
.login-card form { display: flex; flex-direction: column; gap: 20px; margin-top: 28px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 25px 0; }
@media (max-width: 1200px) {
    .sidebar { width: 195px; padding: 25px 15px; }
    .main-content { width: calc(100% - 195px); padding: 28px 22px; }
    .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .agent-grid { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
    .app-shell { display: block; }
    .sidebar { position: static; width: 100%; height: auto; padding: 18px; }
    .brand { font-size: 1.2rem; }
    .nav-label { display: none; }
    .sidebar-footer { display: flex; align-items: center; gap: 16px; margin-top: 0; padding-top: 12px; }
    .sidebar-footer small { display: none; }
    nav { flex-direction: row; flex-wrap: wrap; margin-top: 18px; gap: 3px; }
    nav a { padding: 10px; font-size: .8rem; }
    .main-content { width: 100%; padding: 24px 14px; }
    .page-header { flex-wrap: wrap; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .metric { padding: 16px; }
    .metric > strong { font-size: 1.7rem; }
    .chart-grid { grid-template-columns: 1fr; gap: 0; }
    .panel { padding: 18px; }
    .detail-grid { grid-template-columns: 1fr 1fr; }
    .attention-item { flex-wrap: wrap; }
}
