@font-face {
  font-family: "EVOO Inter";
  src: url("./fonts/Inter-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "EVOO Inter";
  src: url("./fonts/Inter-SemiBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
}
@font-face {
  font-family: "EVOO Inter";
  src: url("./fonts/Inter-ExtraBold.woff2") format("woff2");
  font-style: normal;
  font-weight: 800 900;
  font-display: swap;
}

:root {
  --bg: #f3f2f0;
  --surface: #ffffff;
  --surface-soft: #f8f8f6;
  --ink: #191919;
  --muted: #696969;
  --line: #deddda;
  --dark: #111111;
  --dark-soft: #242424;
  --cyan: #08c7c9;
  --cyan-dark: #007f82;
  --lime: #dfff00;
  --success: #287653;
  --danger: #bd2634;
  --warning: #b36b00;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(17, 17, 17, .08);
  font-family: "EVOO Inter", ui-sans-serif, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}

* { box-sizing: border-box; }
.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; }
html { min-width: 320px; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.skip-link {
  position: fixed; left: 16px; top: -80px; z-index: 1000;
  padding: 10px 16px; border-radius: 8px; background: var(--lime); color: #000;
}
.skip-link:focus { top: 16px; }

.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    radial-gradient(circle at 82% 18%, rgba(8,199,201,.22), transparent 28%),
    radial-gradient(circle at 16% 90%, rgba(223,255,0,.15), transparent 28%),
    var(--dark);
}
.auth-card {
  width: min(540px, 100%); padding: clamp(28px, 5vw, 54px); border-radius: 28px;
  background: var(--surface); box-shadow: 0 40px 100px rgba(0,0,0,.28);
}
.brand-mark {
  width: 48px; height: 48px; display: grid; place-items: center; margin-bottom: 34px;
  border-radius: 14px; background: var(--lime); color: #000; font-weight: 900; font-size: 22px;
}
.eyebrow { margin: 0 0 10px; color: var(--cyan-dark); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.auth-card h1 { margin: 0; max-width: 440px; font-size: clamp(30px, 6vw, 46px); line-height: 1.04; letter-spacing: -.04em; }
.auth-card .muted { margin: 20px 0 0; line-height: 1.6; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.auth-actions:has(.auth-form) { display: block; }
.auth-form { display: grid; gap: 14px; width: 100%; }
.auth-form .button { width: 100%; }
.auth-error { margin: 0; padding: 11px 12px; border-radius: 10px; color: var(--danger); background: #fde8ea; font-size: 12px; line-height: 1.45; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-google-button { width: 100%; }
.loading-bar { height: 4px; margin-top: 34px; overflow: hidden; border-radius: 99px; background: var(--line); }
.loading-bar span { display: block; width: 38%; height: 100%; background: var(--cyan); animation: loading 1.2s ease-in-out infinite alternate; }
@keyframes loading { to { transform: translateX(165%); } }

.shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  padding: 24px 18px; color: #f7f7f5; background: var(--dark);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 6px 8px 28px; }
.brand .brand-mark { width: 38px; height: 38px; margin: 0; border-radius: 11px; font-size: 18px; }
.brand strong { display: block; font-size: 15px; letter-spacing: .02em; }
.brand small { color: #9a9a9a; font-size: 11px; letter-spacing: .12em; }
.nav { display: grid; gap: 6px; }
.nav-link {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 14px;
  border-radius: 12px; color: #b8b8b8; text-decoration: none; font-size: 14px; font-weight: 650;
}
.nav-link:hover, .nav-link:focus-visible { color: #fff; background: #202020; outline: none; }
.nav-link.active { color: #000; background: var(--lime); }
.nav-icon { width: 20px; text-align: center; font-size: 16px; }
.sidebar-footer { margin-top: auto; padding: 18px 8px 2px; border-top: 1px solid #303030; }
.sidebar-footer p { margin: 0; color: #ddd; font-size: 12px; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer small { color: #808080; }

.workspace { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center;
  min-height: 76px; padding: 14px clamp(20px, 4vw, 48px); border-bottom: 1px solid rgba(222,221,218,.8);
  background: rgba(243,242,240,.9); backdrop-filter: blur(14px);
}
.breadcrumbs { color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.env-badge { padding: 6px 9px; border-radius: 99px; background: #e5e4e1; color: #535353; font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.user-pill { display: flex; align-items: center; gap: 9px; padding: 6px 9px 6px 6px; border-radius: 99px; background: #fff; border: 1px solid var(--line); }
.avatar { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--dark); color: var(--lime); font-size: 11px; font-weight: 800; }
.user-pill span { max-width: 190px; overflow: hidden; text-overflow: ellipsis; font-size: 12px; white-space: nowrap; }

.content { width: min(1500px, 100%); margin: 0 auto; padding: 38px clamp(20px, 4vw, 48px) 70px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; }
.page-head h1 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1; letter-spacing: -.045em; }
.page-head p { margin: 12px 0 0; color: var(--muted); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  padding: 0 16px; border: 1px solid transparent; border-radius: 11px; cursor: pointer;
  background: var(--dark); color: #fff; text-decoration: none; font-weight: 750; font-size: 13px;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible { outline: 3px solid rgba(8,199,201,.35); outline-offset: 2px; }
.button-primary { background: var(--lime); color: #000; }
.button-secondary { border-color: var(--line); background: var(--surface); color: var(--ink); }
.button-danger { background: #fff0f1; color: var(--danger); }
.button-small { min-height: 34px; padding: 0 11px; font-size: 12px; }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi-card { position: relative; overflow: hidden; min-height: 154px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.kpi-card::after { content: ""; position: absolute; right: -28px; bottom: -44px; width: 110px; height: 110px; border-radius: 50%; background: rgba(8,199,201,.08); }
.kpi-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.kpi-value { display: block; margin-top: 17px; font-size: clamp(30px, 4vw, 42px); font-weight: 800; letter-spacing: -.045em; }
.kpi-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--muted); font-size: 11px; }
.trend { font-weight: 800; }
.trend.up { color: var(--danger); }
.trend.down { color: var(--success); }
.trend.neutral { color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); gap: 18px; margin-bottom: 18px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 1px 0 rgba(17,17,17,.02); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 19px 22px; border-bottom: 1px solid var(--line); }
.panel-head h2 { margin: 0; font-size: 16px; }
.panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.panel-body { padding: 20px 22px; }
.panel-flush { padding: 0; }
.mb-14 { margin-bottom: 14px; }
.mb-18 { margin-bottom: 18px; }
.kpi-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.matrix-panel { overflow: hidden; }
.matrix-summary { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.price-matrix-wrap { max-height: 68vh; overflow: auto; overscroll-behavior: contain; }
.price-matrix { min-width: 1050px; border-collapse: separate; border-spacing: 0; }
.price-matrix th, .price-matrix td { border-right: 1px solid #ecebe8; border-bottom: 1px solid #ecebe8; }
.price-matrix thead th { position: sticky; top: 0; z-index: 3; height: 54px; background: var(--dark); color: #fff; text-align: center; }
.price-matrix .matrix-corner { left: 0; z-index: 5; min-width: 168px; text-align: left; }
.matrix-model { color: var(--lime); font-size: 15px; letter-spacing: .02em; text-transform: none; }
.price-matrix .matrix-country { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 10px; min-width: 168px; height: 100%; background: var(--surface-soft); text-transform: none; letter-spacing: 0; }
.matrix-country .country-code { flex: 0 0 38px; background: #e8e8e5; color: var(--ink); }
.matrix-country strong { display: block; max-width: 96px; color: var(--ink); font-size: 12px; line-height: 1.2; }
.matrix-country small { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; text-transform: uppercase; }
.price-matrix td { min-width: 220px; padding: 0; vertical-align: top; background: #fff; }
.matrix-cell { display: grid; }
.matrix-variant { display: grid; gap: 3px; min-height: 76px; padding: 12px 14px; border-bottom: 1px solid #ecebe8; color: var(--ink); text-decoration: none; }
.matrix-variant:last-child { border-bottom: 0; }
.matrix-variant:hover, .matrix-variant:focus-visible { position: relative; z-index: 1; outline: none; background: #f5ffbd; box-shadow: inset 3px 0 0 var(--cyan-dark); }
.matrix-variant-name { color: var(--muted); font-size: 10px; line-height: 1.3; }
.matrix-variant strong { font-size: 13px; font-variant-numeric: tabular-nums; }
.matrix-variant small { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-matrix .matrix-empty { padding: 28px 14px; color: #aaa; text-align: center; vertical-align: middle; }

.status-list { display: grid; gap: 9px; }
.status-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 10px; }
.country-code { width: 38px; padding: 6px 0; border-radius: 8px; background: var(--surface-soft); text-align: center; font-size: 11px; font-weight: 850; }
.status-row strong { font-size: 13px; }
.status-row small { display: block; margin-top: 2px; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(40,118,83,.1); }
.status-dot.partial { background: var(--warning); box-shadow: 0 0 0 4px rgba(179,107,0,.1); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 4px rgba(189,38,52,.1); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid #ecebe8; text-align: left; vertical-align: middle; font-size: 12px; }
th { color: var(--muted); background: var(--surface-soft); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: #fbfbf8; }
.amount { font-variant-numeric: tabular-nums; font-weight: 750; white-space: nowrap; }
.subtle { color: var(--muted); }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 9px; border-radius: 99px; background: #ededeb; color: #555; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.badge.changed { color: #8a4e00; background: #fff1d7; }
.badge.added, .badge.active { color: #1c6b49; background: #e4f5ec; }
.badge.removed, .badge.inactive { color: #9d2631; background: #fde8ea; }
.delta { font-variant-numeric: tabular-nums; font-weight: 800; }
.delta.positive { color: var(--danger); }
.delta.negative { color: var(--success); }

.filters { display: grid; grid-template-columns: minmax(220px, 1fr) 180px auto; gap: 10px; margin-bottom: 18px; }
.field { display: grid; gap: 7px; }
.field label { color: var(--muted); font-size: 11px; font-weight: 750; }
.input, .select {
  width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid #cfcfcb; border-radius: 10px;
  background: #fff; color: var(--ink); outline: none;
}
.input:focus, .select:focus { border-color: var(--cyan-dark); box-shadow: 0 0 0 3px rgba(8,199,201,.14); }
.field-error { color: var(--danger); font-size: 11px; }

.model-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.model-card { display: flex; flex-direction: column; min-height: 245px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: .18s ease; }
.model-card:hover { border-color: #bfbfba; transform: translateY(-3px); box-shadow: var(--shadow); }
.model-card-top { display: flex; justify-content: space-between; gap: 12px; }
.model-card h2 { margin: 19px 0 4px; font-size: 24px; letter-spacing: -.03em; }
.model-card p { margin: 0; color: var(--muted); }
.model-price { margin-top: auto; padding-top: 26px; }
.model-price strong { display: block; font-size: 23px; letter-spacing: -.025em; }
.model-price small { color: var(--muted); }
.model-counts { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 17px; }

.detail-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: end; padding: 28px; margin-bottom: 18px; border-radius: 24px; background: var(--dark); color: #fff; }
.detail-hero h1 { margin: 10px 0 7px; font-size: clamp(36px, 6vw, 66px); letter-spacing: -.055em; }
.detail-hero p { margin: 0; color: #aaa; }
.detail-price { text-align: right; }
.detail-price strong { display: block; color: var(--lime); font-size: 30px; }
.detail-price span { color: #aaa; font-size: 12px; }

.empty { padding: 42px 24px; text-align: center; color: var(--muted); }
.empty strong { display: block; margin-bottom: 7px; color: var(--ink); }
.skeleton { min-height: 160px; border-radius: var(--radius); background: linear-gradient(90deg, #ecebe8, #f7f6f4, #ecebe8); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.56); backdrop-filter: blur(4px); }
.modal { width: min(720px, 100%); max-height: min(86vh, 760px); overflow: auto; border-radius: 22px; background: #fff; box-shadow: 0 32px 90px rgba(0,0,0,.35); }
.modal-head { position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); background: #fff; }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-close { width: 36px; height: 36px; border: 0; border-radius: 50%; cursor: pointer; background: var(--surface-soft); font-size: 20px; }
.modal-body { padding: 22px; }
.form-grid { display: grid; grid-template-columns: 1fr 180px; gap: 14px; }
.chart { width: 100%; height: auto; overflow: visible; }
.chart-line { fill: none; stroke: var(--cyan-dark); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#chartGradient); }
.chart-dot { fill: #fff; stroke: var(--cyan-dark); stroke-width: 2.5; }
.chart-grid { stroke: #e4e3df; stroke-width: 1; }
.chart-label { fill: #7a7a7a; font-size: 10px; }

.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: grid; gap: 8px; }
.toast { max-width: 360px; padding: 13px 16px; border-radius: 12px; background: var(--dark); color: #fff; box-shadow: var(--shadow); font-size: 12px; animation: toast-in .2s ease-out; }
.toast.error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .shell { display: block; padding-bottom: 68px; }
  .sidebar { position: fixed; top: auto; bottom: 0; z-index: 40; width: 100%; height: 68px; padding: 8px 10px; border-top: 1px solid #333; }
  .brand, .sidebar-footer { display: none; }
  .nav { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .nav-link { flex-direction: column; justify-content: center; gap: 3px; min-height: 52px; padding: 4px 6px; border-radius: 9px; font-size: 10px; }
  .nav-icon { font-size: 15px; }
  .topbar { min-height: 62px; padding: 10px 16px; }
  .breadcrumbs, .user-pill span { display: none; }
  .content { padding: 26px 16px 40px; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .button { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { min-height: 132px; padding: 17px; }
  .kpi-value { font-size: 28px; }
  .filters { grid-template-columns: 1fr; }
  .model-grid { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-price { text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  th, td { padding: 12px; }
  .matrix-panel .panel-head { align-items: flex-start; flex-direction: column; }
  .matrix-summary { justify-content: flex-start; }
  .price-matrix-wrap { max-height: 66vh; }
  .price-matrix { min-width: 920px; }
  .price-matrix .matrix-corner, .price-matrix .matrix-country { min-width: 126px; }
  .matrix-country strong { max-width: 58px; }
  .price-matrix td { min-width: 198px; }
}

@media (max-width: 430px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 115px; }
  .top-actions .button { width: 38px; padding: 0; font-size: 0; }
  .top-actions .button::after { content: "↗"; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
