:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #66716a;
  --paper: #f4f6f2;
  --card: #ffffff;
  --line: #dfe5de;
  --green: #1b7251;
  --green-soft: #e5f3ec;
  --gold: #ad7722;
  --red: #b33a36;
  --shadow: 0 16px 40px rgba(31, 53, 42, .08);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--green); }
button, select, input { font: inherit; }
button { border: 0; border-radius: 10px; background: var(--green); color: white; padding: .72rem 1rem; font-weight: 700; cursor: pointer; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(24px, calc((100vw - 1440px)/2)); background: #14251d; color: white; }
.topbar h1 { margin: 0; font-size: 1.35rem; }
.eyebrow { margin: 0 0 2px; color: #71b898; font-size: .68rem; font-weight: 800; letter-spacing: .18em; }
.quiet-button { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.18); }
.dashboard-shell { width: min(1440px, calc(100% - 40px)); margin: 28px auto 60px; }
.toolbar { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.toolbar form { display: flex; align-items: end; gap: 10px; }
label { display: grid; gap: 5px; color: var(--muted); font-size: .8rem; font-weight: 700; }
select, input { min-height: 43px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--ink); padding: 0 12px; }
.freshness { color: var(--muted); font-size: .82rem; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--gold); }
.status-dot.ok { background: var(--green); }
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.kpi-grid article, .panel { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.panel { min-width: 0; }
.kpi-grid article { padding: 18px; min-height: 130px; display: flex; flex-direction: column; }
.kpi-grid span, .kpi-grid small { color: var(--muted); }
.kpi-grid strong { margin: auto 0 1px; font-size: clamp(1.25rem, 2vw, 2rem); line-height: 1.15; }
.panel { padding: 22px; margin-bottom: 14px; }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.panel-heading h2 { margin: 0; font-size: 1.18rem; }
.count-pill { padding: 5px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: .75rem; font-weight: 800; }
.chart { min-height: 280px; display: grid; place-items: center; overflow: hidden; }
.chart svg { width: 100%; height: 280px; overflow: visible; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke-width: 3; vector-effect: non-scaling-stroke; }
.sessions-line { stroke: var(--green); }
.purchases-line { stroke: var(--gold); }
.chart-legend { justify-self: start; display: flex; gap: 16px; font-size: .78rem; color: var(--muted); }
.chart-legend span::before { content: ""; display: inline-block; width: 18px; height: 3px; margin-right: 6px; vertical-align: middle; background: var(--green); }
.chart-legend .purchases::before { background: var(--gold); }
.recommendation-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.recommendation { border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 12px; padding: 16px; }
.recommendation.high { border-left-color: var(--red); }
.recommendation.low { border-left-color: var(--green); }
.recommendation h3 { margin: 8px 0 5px; font-size: 1rem; }
.recommendation p { margin: 5px 0; color: var(--muted); }
.recommendation .action { color: var(--ink); }
.recommendation-meta { display: flex; gap: 7px; text-transform: uppercase; font-size: .64rem; font-weight: 900; letter-spacing: .08em; color: var(--muted); }
.recommendation-meta span:first-child { color: var(--red); }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th { color: var(--muted); text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; }
th, td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td:not(:first-child), th:not(:first-child) { text-align: right; white-space: nowrap; }
.url-cell { max-width: 650px; overflow-wrap: anywhere; direction: ltr; }
.empty-state { padding: 40px 20px; text-align: center; color: var(--muted); }
.muted { color: var(--muted); }
footer { padding: 30px; color: var(--muted); text-align: center; font-size: .75rem; }
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 20% 10%, #e7f2eb, transparent 40%), #f4f6f2; }
.login-card { width: min(420px, 100%); padding: 38px; background: white; border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.login-card h1 { margin: 2px 0; }
.brand-mark { width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 20px; border-radius: 14px; background: var(--green); color: white; font-size: 1.4rem; font-weight: 900; }
.login-form { display: grid; gap: 15px; margin-top: 25px; }
.alert { margin-top: 18px; padding: 10px 12px; border-radius: 9px; background: #fbeaea; color: #8c2c29; }
@media (max-width: 1100px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 760px) {
  .topbar { height: 76px; padding: 0 18px; }
  .dashboard-shell { width: min(100% - 24px, 1440px); margin-top: 18px; }
  .toolbar, .two-column { display: grid; grid-template-columns: 1fr; }
  .toolbar form { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar form button { grid-column: 1 / -1; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid article { min-height: 115px; padding: 14px; }
  .panel { padding: 16px; }
  .recommendation-list { grid-template-columns: 1fr; }
  .trend-panel { display: none; }
}
@media (max-width: 420px) { .kpi-grid { grid-template-columns: 1fr; } .login-card { padding: 28px 22px; } }
