/* Dealer Portal prototype. Follows docs/DESIGN.md. Demo only, fake data. Light theme, Inter, mobile first. */
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Regular.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Inter"; src: url("../fonts/Inter-Bold.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --brand: #ea2327;
  --accent: #c8191d;
  --accent-hover: #a81418;
  --accent-tint: #fdecec;
  --ink: #1a2030;
  --muted: #566070;
  --line: #dfe3ea;
  --field: #8a93a3;
  --bg: #f6f7f9;
  --card: #ffffff;
  --ok: #17653f;   --ok-bg: #e3f4ea;
  --warn: #7a4b00; --warn-bg: #fff1cc;
  --bad: #a4231a;  --bad-bg: #fde7e4;
  --info: #1d4f9f; --info-bg: #e4edfb;
  --r-control: 8px; --r-card: 12px; --r-pill: 99px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --gutter: 16px;
  --shadow-float: 0 8px 24px rgba(26, 32, 48, .14);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1 { font-size: 24px; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 var(--s1); font-weight: 700; }
h2 { font-size: 20px; line-height: 1.3; margin: 0 0 var(--s3); font-weight: 700; }
h3 { font-size: 16px; line-height: 1.4; margin: 0 0 var(--s2); font-weight: 700; }
p { margin: 0 0 var(--s3); }
.muted { color: var(--muted); }
.small { font-size: 14px; line-height: 1.45; }
.caption { font-size: 13px; line-height: 1.4; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.stack > * + * { margin-top: var(--s4); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: var(--s3) var(--s4); z-index: 100; }
.skip:focus { left: var(--s2); top: var(--s2); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* prototype strip (not part of the real product) */
.protobar {
  background: #1a2030; color: #d5dbe8; font-size: 13px; padding: 6px var(--gutter);
  display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; justify-content: space-between;
}
.protobar a { color: #fff; text-decoration: none; padding: 2px 10px; border-radius: var(--r-pill); border: 1px solid #5a6479; }
.protobar a.on { background: #fff; color: #1a2030; border-color: #fff; }

/* header */
.topbar {
  background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: var(--s3); padding: var(--s2) var(--gutter); min-height: 60px;
}
.burger {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--r-control); width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); touch-action: manipulation;
}
.brand { display: flex; align-items: center; gap: var(--s3); text-decoration: none; color: var(--ink); min-width: 0; }
.brand img { height: 32px; width: auto; display: block; }
.brand .sep { width: 1px; height: 32px; background: var(--line); }
.brand .t1 { font-weight: 700; line-height: 1.15; font-size: 15px; }
.brand .t2 { font-size: 12px; color: var(--muted); line-height: 1.2; }
.spacer { flex: 1; }
.picker, .userbtn { display: none; }
.picker select { max-width: 260px; }
.userbtn { font-size: 14px; color: var(--muted); }

/* layout */
.shell { display: block; }
.nav { display: none; background: var(--card); border-bottom: 1px solid var(--line); padding: var(--s2); }
.nav.open { display: block; }
.nav a {
  display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s3); border-radius: var(--r-control);
  color: var(--ink); text-decoration: none; min-height: 44px; transition: background-color 150ms;
}
.nav a:hover { background: var(--bg); }
.nav a.active { background: var(--accent-tint); color: var(--accent-hover); font-weight: 700; }
.nav svg { flex: none; }
.nav .grp { font-size: 13px; color: var(--muted); padding: var(--s4) var(--s3) var(--s1); }
.nav .mobile-picker { padding: var(--s2) var(--s3) var(--s3); }
main { padding: var(--s5) var(--gutter); max-width: 1100px; margin: 0 auto; }
footer.foot {
  color: var(--muted); font-size: 13px; padding: var(--s5) var(--gutter) var(--s6);
  display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); justify-content: center; text-align: center;
}
footer.foot a { color: var(--muted); }

@media (min-width: 900px) {
  :root { --gutter: 32px; }
  h1 { font-size: 28px; }
  .burger { display: none; }
  .picker, .userbtn { display: block; }
  .shell { display: grid; grid-template-columns: 240px 1fr; align-items: start; }
  .nav { display: block; border-bottom: 0; border-right: 1px solid var(--line); min-height: calc(100vh - 96px); position: sticky; top: 61px; padding: var(--s3); }
  .nav .mobile-picker { display: none; }
  main { padding-top: var(--s6); }
}

/* cards, stats, tiles */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); }
@media (min-width: 900px) { .card { padding: var(--s5); } }
.stats { display: grid; grid-template-columns: 1fr; gap: var(--s3); margin: var(--s5) 0; }
@media (min-width: 600px) { .stats { grid-template-columns: 1fr 1fr; gap: var(--s4); } }
.stat .label { color: var(--muted); font-size: 14px; }
.stat .value { font-size: 40px; line-height: 1.1; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; margin: var(--s1) 0 var(--s2); }
.stat.over { border-color: #f0b8b2; }
.stat.over .value { color: var(--bad); }
.tiles { display: grid; grid-template-columns: 1fr; gap: var(--s3); }
@media (min-width: 600px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
  display: flex; gap: var(--s4); align-items: flex-start; text-decoration: none; color: var(--ink); background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-card); padding: var(--s4); min-height: 88px;
  transition: border-color 150ms, background-color 150ms;
}
.tile:hover { border-color: var(--accent); color: var(--ink); }
.tile .ico { flex: none; width: 44px; height: 44px; border-radius: var(--r-control); background: var(--accent-tint); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.tile .name { font-weight: 700; line-height: 1.3; }
.tile .hint { color: var(--muted); font-size: 14px; line-height: 1.4; }

/* forms */
label { display: block; font-weight: 700; margin: var(--s4) 0 var(--s1); font-size: 15px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select {
  width: 100%; font: inherit; color: var(--ink); padding: 0 var(--s3); border: 1px solid var(--field);
  border-radius: var(--r-control); background: var(--card); min-height: 46px;
}
input:focus, select:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[aria-invalid=true] { border-color: var(--bad); }
.field-error { color: var(--bad); font-size: 14px; margin-top: var(--s1); }
.check { display: flex; gap: var(--s3); align-items: flex-start; font-weight: 400; margin: var(--s4) 0; }
.check input { width: 22px; height: 22px; flex: none; margin-top: 1px; accent-color: var(--accent); }
.hint { color: var(--muted); font-size: 14px; margin-top: var(--s1); }
.rules { color: var(--muted); font-size: 14px; margin: var(--s1) 0 0; padding-left: var(--s5); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); font: inherit; font-weight: 700;
  padding: 0 var(--s4); min-height: 46px; border-radius: var(--r-control); border: 1px solid transparent;
  background: var(--accent); color: #fff; cursor: pointer; text-decoration: none; touch-action: manipulation;
  transition: background-color 150ms, transform 100ms;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:active { transform: scale(0.98); }
.btn.block { display: flex; width: 100%; }
.btn.secondary { background: var(--card); color: var(--ink); border-color: var(--field); }
.btn.secondary:hover { background: var(--bg); color: var(--ink); }
.btn[disabled], .btn[aria-disabled=true] { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* badges, notices */
.badge { display: inline-block; padding: 2px 10px; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge.neutral { background: #eceff4; color: #3b4558; }
.notice { border-radius: var(--r-control); padding: var(--s3) var(--s4); margin: var(--s4) 0; font-size: 15px; }
.notice.info { background: var(--info-bg); color: #163f80; }
.notice.warn { background: var(--warn-bg); color: #5f3a00; }
.notice.ok { background: var(--ok-bg); color: #0f5232; }
.notice.bad { background: var(--bad-bg); color: #861c14; }

/* auth pages */
/* The sign-in page sits near the top (about a sixteenth of the screen down) instead of the middle, so it is not pushed low on a tall laptop screen, and the card stays compact. */
.authwrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: clamp(12px, 4vh, 64px) var(--gutter) var(--s5); border-top: 6px solid var(--brand); position: relative; }
.authwrap::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--yellow, #f7ca16); }
.authcard { width: 100%; max-width: 440px; }
.authhead { text-align: center; margin-bottom: var(--s5); }
/* Sign-in header: the Erafone logo, a divider and live text. Sizes are variables so they can be tuned; they step down on narrow screens so the line never runs off the page. */
.lockup { --lk-logo: 200px; --lk-bar: 80px; --lk-gap: 20px; --lk-t1: 37px; --lk-t2: 12px; display: flex; align-items: center; justify-content: center; gap: var(--lk-gap); }
.lockup img { width: var(--lk-logo); height: auto; display: block; flex: none; }
.lockup .bar { width: 1px; height: var(--lk-bar); background: var(--line); flex: none; }
.lockup .t1 { font-size: var(--lk-t1); font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; white-space: nowrap; text-align: left; }
.lockup .t2 { font-size: var(--lk-t2); color: var(--muted); line-height: 1.2; white-space: nowrap; text-align: left; }
@media (max-width: 560px) { .lockup { --lk-logo: 150px; --lk-bar: 60px; --lk-gap: 14px; --lk-t1: 28px; } }
@media (max-width: 400px) { .lockup { --lk-logo: 118px; --lk-bar: 48px; --lk-gap: 10px; --lk-t1: 22px; } }
.otp { letter-spacing: .5em; text-align: center; font-size: 24px; }

/* data list: real table from 700px, stacked rows below (docs/DESIGN.md section 3) */
.dt { width: 100%; border-collapse: collapse; }
.dt th { text-align: left; color: var(--muted); font-size: 14px; font-weight: 400; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); }
.dt td { padding: var(--s3); border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
.dt th.num, .dt td.num { text-align: right; }
.dt tfoot td { font-weight: 700; border-bottom: 0; }
@media (max-width: 699px) {
  .dt, .dt tbody, .dt tfoot, .dt tr, .dt td { display: block; width: 100%; }
  .dt thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .dt tr { padding: var(--s3) 0; border-bottom: 1px solid var(--line); }
  .dt td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: var(--s4); text-align: right; }
  .dt td::before { content: attr(data-label); color: var(--muted); text-align: left; flex: none; }
  .dt td.primary { font-size: 16px; font-weight: 700; text-align: left; justify-content: flex-start; }
  .dt td.primary::before { content: none; }
  .dt td.hide-phone { display: none; }
}
.only-phone { display: inline; }
@media (min-width: 900px) { .only-phone { display: none; } }
.empty { text-align: center; padding: var(--s6) var(--s4); }
.empty .ico { width: 48px; height: 48px; margin: 0 auto var(--s3); border-radius: 50%; background: var(--bg); color: var(--muted); display: flex; align-items: center; justify-content: center; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .btn:active { transform: none; }
}
@media (prefers-contrast: more) {
  :root { --line: #8a93a3; --muted: #3b4558; }
}

