:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #64748b;
  --line: #dbe4ee;
  --surface: #ffffff;
  --canvas: #f3f7fb;
  --navy: #102a43;
  --blue: #2563eb;
  --teal: #0f9d8a;
  --orange: #d97706;
  --red: #c2413b;
  --green: #15803d;
  --shadow: 0 10px 30px rgba(16, 42, 67, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.topbar { min-height: 76px; padding: 14px clamp(18px, 4vw, 56px); background: var(--navy); color: white; display: flex; align-items: center; justify-content: space-between; gap: 20px; box-shadow: 0 8px 24px rgba(15, 42, 67, .18); }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #2dd4bf, #2563eb); color: white; font-weight: 800; letter-spacing: -.04em; }
.topbar h1 { font-size: 18px; margin: 1px 0 0; font-weight: 700; }
.eyebrow { margin: 0; color: #0f766e; font-size: 11px; letter-spacing: .12em; font-weight: 800; }
.topbar .eyebrow { color: #93c5fd; }
.topbar-actions { display: flex; gap: 12px; align-items: end; }
.project-picker { display: grid; gap: 4px; font-size: 11px; color: #cbd5e1; }
select, input { min-height: 42px; border: 1px solid var(--line); border-radius: 9px; padding: 0 12px; background: white; color: var(--ink); }
.project-picker select { min-width: min(360px, 45vw); background: #193b5c; color: white; border-color: #365a7c; }
.ghost-button, .secondary-button, .primary-button, .icon-button { border: 0; border-radius: 9px; min-height: 42px; padding: 0 15px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; }
.ghost-button { background: transparent; color: white; border: 1px solid #4b6b88; }
.secondary-button { background: #edf4fb; color: var(--navy); border: 1px solid #c9d9e8; }
.secondary-button:disabled { opacity: .55; cursor: wait; }
.primary-button { background: var(--navy); color: white; width: 100%; }
.primary-button:disabled { opacity: .55; cursor: wait; }
.dashboard-shell { max-width: 1500px; margin: 0 auto; padding: 30px clamp(16px, 4vw, 48px) 60px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.project-heading { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.heading-actions { display: flex; gap: 10px; align-items: center; }
.project-heading h2 { margin: 4px 0; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; }
.muted { margin: 4px 0 0; color: var(--muted); }
.metric-grid { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.metric-card, .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.metric-card { padding: 18px 20px; }
.metric-card p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.metric-card strong { display: block; font-size: clamp(23px, 2.5vw, 32px); letter-spacing: -.035em; }
.metric-card strong[data-tone="danger"] { color: var(--red); }
.metric-card strong[data-tone="warn"] { color: var(--orange); }
.metric-card strong[data-tone="good"] { color: var(--green); }
.metric-card span { display: block; color: var(--muted); margin-top: 6px; font-size: 12px; }
.panel { padding: 22px; min-width: 0; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: 1 / -1; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel h3 { margin: 4px 0 0; font-size: 19px; }
.compact-status { color: var(--muted); font-size: 13px; text-align: right; }
.chart { width: 100%; min-height: 260px; position: relative; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--muted); font-size: 11px; }
.grid-line { stroke: #e7edf4; stroke-width: 1; }
.actual-line, .expected-line { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.actual-line { stroke: var(--blue); stroke-width: 3; }
.expected-line { stroke: var(--teal); stroke-width: 2; stroke-dasharray: 7 6; }
.actual-dot { fill: white; stroke: var(--blue); stroke-width: 3; }
.chart-hit { fill: transparent; pointer-events: all; }
.hover-guide { stroke: #94a3b8; stroke-width: 1; stroke-dasharray: 3 4; pointer-events: none; }
.chart-tooltip { position: absolute; z-index: 3; min-width: 220px; max-width: 300px; padding: 10px 12px; border-radius: 9px; background: var(--navy); color: white; box-shadow: 0 12px 30px rgba(15, 42, 67, .22); pointer-events: none; font-size: 12px; line-height: 1.5; }
.chart-tooltip strong, .chart-tooltip span { display: block; }
.chart-tooltip span { color: #dbeafe; }
.action-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.action-list li { display: grid; grid-template-columns: auto 1fr; align-items: start; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.action-list li:last-child { border: 0; padding-bottom: 0; }
.action-list strong { font-size: 13px; }
.action-list p { margin: 4px 0 0; color: #334155; line-height: 1.45; font-size: 13px; }
.priority { border-radius: 99px; padding: 4px 8px; font-size: 10px; font-weight: 800; background: #eef2ff; color: #3730a3; }
.priority-alta { background: #fee2e2; color: #991b1b; }
.priority-media { background: #ffedd5; color: #9a3412; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.compact-tabs { margin: 0; }
.compact-tabs .tab-button { font-size: 12px; }
.quota-note { margin: 10px 0 0; font-size: .82rem; }
.tab-button { border: 0; background: transparent; color: var(--muted); padding: 8px 11px; border-radius: 8px; font-weight: 700; cursor: pointer; }
.tab-button.active { background: var(--navy); color: white; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { text-align: left; color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 12px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
.data-table td:not(:first-child), .data-table th:not(:first-child) { text-align: right; }
.data-table small { display: block; color: var(--muted); margin-top: 3px; }
.quota-progress { width: 110px; max-width: 100%; height: 6px; background: #e8eef5; border-radius: 99px; overflow: hidden; margin-left: auto; }
.quota-progress span { display: block; width: 0; height: 100%; background: #94a3b8; border-radius: inherit; }
.quota-progress span[data-tone="good"] { background: var(--green); }
.quota-progress span[data-tone="warn"] { background: var(--orange); }
.quota-progress span[data-tone="bad"] { background: var(--red); }
.key-actions { margin: 0; padding-left: 18px; display: grid; gap: 10px; }
.key-actions p { margin: 0; line-height: 1.45; }
.definition-list { margin: 0; display: grid; gap: 0; }
.definition-list div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.definition-list div:last-child { border: 0; }
.definition-list dt { color: var(--muted); font-size: 13px; }
.definition-list dd { margin: 0; font-weight: 800; text-align: right; }
.issue-heading { align-items: end; }
.issue-tools { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; justify-content: flex-end; }
.search-field { display: grid; gap: 4px; color: var(--muted); font-size: 11px; }
.search-field input { min-width: 250px; }
.clickable-row { cursor: pointer; }
.clickable-row:hover, .clickable-row:focus { background: #f4f8fc; outline: none; }
.category-badge { display: inline-block; border-radius: 99px; padding: 4px 8px; background: #e9f2fb; color: #234b73; font-size: 10px; font-weight: 800; }
.empty-state { color: var(--muted); text-align: center; padding: 26px; }
.issue-dialog { border: 0; padding: 0; border-radius: 16px; width: min(760px, calc(100vw - 28px)); max-height: calc(100vh - 36px); box-shadow: 0 24px 80px rgba(15, 42, 67, .3); }
.issue-dialog::backdrop { background: rgba(15, 23, 42, .55); }
.dialog-shell { padding: 24px; }
.dialog-heading { display: flex; justify-content: space-between; gap: 20px; }
.dialog-heading h3 { margin: 4px 0; }
.icon-button { background: #edf2f7; color: var(--navy); font-size: 24px; width: 42px; padding: 0; flex: 0 0 42px; }
.info-button { border: 1px solid #8aa4bd; border-radius: 50%; width: 18px; height: 18px; padding: 0; background: #fff; color: var(--navy); font-size: 12px; font-weight: 800; line-height: 16px; cursor: pointer; vertical-align: 1px; }
.info-button:hover, .info-button:focus { background: #e8f3fb; outline: 2px solid #1b75bb; outline-offset: 1px; }
.dialog-actions { margin: 18px 0; }
.identity-groups { display: grid; gap: 20px; max-height: 55vh; overflow-y: auto; padding-right: 4px; }
.identity-groups h4 { margin: 0 0 8px; }
.identity-list { display: grid; gap: 7px; }
.identity-list div { display: grid; grid-template-columns: minmax(120px, .6fr) minmax(180px, 1fr); gap: 10px; padding: 9px 11px; border-radius: 8px; background: #f4f7fa; }
.identity-list code { color: var(--navy); font-weight: 800; overflow-wrap: anywhere; }
.identity-list span { color: var(--muted); overflow-wrap: anywhere; }
.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.qa-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qa-card > span { min-width: 58px; text-align: center; padding: 4px 7px; border-radius: 999px; background: #e8f6f1; color: #08745f; font-size: 11px; font-weight: 800; }
.qa-card[data-status="warn"] > span { background: #fff2df; color: #a45a00; }
.qa-card[data-status="fail"] > span { background: #ffe7e4; color: #b42318; }
.qa-card p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.auth-page { min-height: 100vh; background: radial-gradient(circle at 20% 15%, #dbeafe 0, transparent 33%), radial-gradient(circle at 80% 85%, #ccfbf1 0, transparent 30%), var(--canvas); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(460px, 100%); padding: 38px; background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 24px 70px rgba(15, 42, 67, .16); }
.auth-card .brand-mark { margin-bottom: 18px; }
.auth-card h1 { margin: 6px 0 10px; font-size: 30px; letter-spacing: -.04em; }
.auth-copy { color: var(--muted); line-height: 1.55; }
.auth-form { display: grid; gap: 9px; margin-top: 24px; }
.auth-form label { font-size: 12px; font-weight: 800; }
.form-status { min-height: 22px; color: #0f766e; font-weight: 700; font-size: 13px; }
.security-note { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.error-panel { grid-column: 1 / -1; }
@media (max-width: 1050px) {
  .dashboard-shell { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-3 { grid-column: 1 / -1; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .budget-panel { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .topbar { align-items: flex-start; }
  .topbar, .topbar-actions, .project-heading, .panel-heading, .issue-tools { flex-direction: column; align-items: stretch; }
  .heading-actions { align-items: stretch; }
  .project-picker select, .search-field input { min-width: 0; width: 100%; }
  .dashboard-shell { grid-template-columns: 1fr; padding-top: 20px; }
  .span-2, .span-3, .budget-panel { grid-column: 1; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .compact-status { text-align: left; }
  .identity-list div { grid-template-columns: 1fr; }
}
@media (max-width: 440px) {
  .metric-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 26px; }
}
