/* DealerSource AI · Dealership Solutions — shared UI layer for the dealer portal and the admin
   dashboard. Builds on /shared/brand/css/styles.css (a copy of /admin/css/styles.css, kept identical by a test) (same tokens: navy #011B40, electric blue #0077F9). */

/* ---------- Site-style header (matches dealersourceai.com) ---------- */
.site-bar {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-bar .inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  height: var(--header-h); display: flex; align-items: center; gap: 14px;
}
.site-bar .logo { height: 30px; width: auto; }
.site-bar .tag {
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--blue-ink); border-left: 1px solid var(--line); padding-left: 12px;
}
.site-bar .spacer { flex: 1; }
.site-bar .who { font-size: .85rem; color: var(--muted); text-align: right; line-height: 1.25; }
.site-bar .who strong { color: var(--navy); display: block; }
.btn-outline {
  background: var(--white); color: var(--navy); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .85rem; cursor: pointer;
}
.btn-outline:hover { border-color: var(--blue); background: var(--soft-blue); }

/* ---------- Navy hero band (site hero) ---------- */
.hero-band {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--navy); color: rgba(255,255,255,.86);
  border-radius: var(--radius); padding: 22px 22px 20px; margin-bottom: 16px;
}
.hero-band::before {
  content: ""; position: absolute; z-index: -1; border-radius: 50%;
  width: 520px; height: 520px; right: -200px; top: -260px;
  background: radial-gradient(closest-side, rgba(0,119,249,.5), rgba(0,119,249,0));
}
.hero-band h1 { color: var(--white); margin-bottom: 6px; }
.hero-band p { color: rgba(255,255,255,.8); margin: 0; font-size: .95rem; }
.hero-band .kicker {
  display: inline-flex; align-items: center; gap: .5em; font-size: .75rem; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--blue-light); margin-bottom: 8px;
}
.hero-band .kicker::before { content: ""; width: 22px; height: 2px; background: currentColor; border-radius: 2px; }
.hero-band .hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.btn-light { background: var(--white); color: var(--navy); }
.btn-light:hover { background: var(--soft-blue); }
.btn-ghost-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,.45); }

/* ---------- App layout: sidebar on desktop, bottom tabs on phones ---------- */
.shell { max-width: 1200px; margin: 0 auto; padding: 20px 20px 96px; display: grid; gap: 20px; }
@media (min-width: 960px) {
  .shell { grid-template-columns: 220px 1fr; padding-bottom: 48px; }
}
.side-nav { display: none; }
@media (min-width: 960px) {
  .side-nav { display: block; position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
}
.side-nav a, .sheet a {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm); color: var(--navy);
  text-decoration: none; font-weight: 600; font-size: .95rem;
}
.side-nav a:hover, .sheet a:hover { background: var(--white); }
.side-nav a[aria-current="page"] { background: var(--white); color: var(--blue-ink); box-shadow: var(--shadow); }
.side-nav .group { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 14px 12px 6px; }
.count {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; display: inline-grid; place-items: center;
  background: var(--blue-ink); color: var(--white); font-size: .72rem; font-weight: 750;
}
.count.zero { background: #EEF1F5; color: var(--muted); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  background: var(--white); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 960px) { .tabbar { display: none; } }
.tabbar a, .tabbar button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 9px;
  font-size: .7rem; font-weight: 650; color: var(--muted); text-decoration: none;
  background: none; border: 0; cursor: pointer; position: relative;
}
.tabbar svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--blue-ink); }
.tabbar .dot {
  position: absolute; top: 4px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: var(--blue); color: #fff; font-size: .62rem; display: grid; place-items: center;
}
.sheet-backdrop { position: fixed; inset: 0; background: rgba(1,27,64,.4); z-index: 60; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--soft);
  border-radius: 18px 18px 0 0; padding: 14px 14px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
}
.sheet h3 { margin: 4px 8px 8px; }

/* ---------- Content helpers ---------- */
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.section-title p { color: var(--muted); margin: 0; font-size: .92rem; }
.stack { display: grid; gap: 16px; }
.row-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white);
}
.row .title { font-weight: 700; color: var(--navy); }
.row .sub { color: var(--muted); font-size: .85rem; }
.row .body { font-size: .92rem; margin-top: 6px; }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--soft-blue); color: var(--blue-ink); font-weight: 750;
}
.avatar.navy { background: var(--navy); color: var(--white); }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-sm { min-height: 34px; padding: .35em .95em; font-size: .85rem; }
.btn-danger-outline { background: var(--white); color: var(--danger); border-color: #F5C2C0; }
.btn-danger-outline:hover { background: var(--danger-bg); }
.progress { height: 10px; border-radius: 999px; background: #E6ECF4; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: .9rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; color: var(--ink); }
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.data td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr:last-child td { border-bottom: 0; }
.dept-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.dept { padding: 6px 12px; border-radius: 999px; font-size: .8rem; font-weight: 650; border: 1px solid var(--line); background: var(--white); color: var(--muted); }
.dept.live { background: var(--navy); color: var(--white); border-color: var(--navy); }
.pill-price { font-weight: 750; color: var(--navy); background: var(--soft-blue); padding: 4px 12px; border-radius: 999px; font-size: .85rem; }
.form-grid { display: grid; gap: 10px; }
.form-grid label { font-size: .85rem; font-weight: 600; color: var(--navy); display: grid; gap: 4px; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); color: var(--ink);
}
.form-grid textarea { min-height: 90px; resize: vertical; }
.check-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; }
.check-list .ok { color: var(--success); font-weight: 800; }
.check-list .bad { color: var(--danger); font-weight: 800; }
.check-list .wait { color: var(--warn); font-weight: 800; }
.chip-navy { background: var(--navy); color: var(--white); }
.notice { font-size: .85rem; color: var(--muted); background: var(--white); border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 10px 12px; }
.auth-card form { display: grid; gap: 10px; margin-bottom: 14px; }
.auth-card input[type=email], .auth-card input[type=password] {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
}
.auth-card .btn { width: 100%; }
.auth-card .tagline { font-size: .8rem; color: var(--muted); margin-top: -10px; margin-bottom: 14px; }
.demo-accounts { font-size: .78rem; color: var(--muted); }
.demo-accounts button { background: none; border: 0; color: var(--blue-ink); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.admin-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px; scrollbar-width: none; }
.admin-tabs a {
  flex: none; padding: 8px 14px; border-radius: 999px; background: var(--white); border: 1px solid var(--line);
  color: var(--navy); font-weight: 600; font-size: .88rem; text-decoration: none;
}
.admin-tabs a[aria-current="page"] { background: var(--navy); color: var(--white); border-color: var(--navy); }
.account-picker { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.account-picker select { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-weight: 600; color: var(--navy); }
.kanban { display: grid; gap: 12px; }
@media (min-width: 900px) { .kanban { grid-template-columns: repeat(5, 1fr); } }
.kanban .col { background: #EAF0F7; border-radius: var(--radius-sm); padding: 10px; min-height: 80px; }
.kanban .col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kanban .card { padding: 12px; box-shadow: none; }
@media (max-width: 600px) {
  .shell { padding: 14px 12px 96px; }
  .site-bar .inner { padding: 0 12px; gap: 10px; }
  .site-bar .tag { display: none; }
  .site-bar .logo { height: 24px; }
  .row { grid-template-columns: auto 1fr; }
  .row > :last-child:not(:first-child):not(:nth-child(2)) { grid-column: 1 / -1; }
  .hero-band h1 { font-size: 1.35rem; }
}
.footer-note a { color: var(--muted); }
.row > .chip { justify-self: start; }
.btn-outline { white-space: nowrap; }
@media (max-width: 600px) {
  .site-bar .who { font-size: .78rem; }
  .site-bar .who .who-sub { display: none; }
  .btn-outline { padding: 5px 10px; font-size: .78rem; }
}
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.btn[disabled] { background: #C9D3E0; color: #3C4A5E; cursor: not-allowed; }
/* r7 one sign-in card: visible labels, email-first steps, loading state, forgot-password note. */
.auth-card form label { font-size: .85rem; font-weight: 600; color: var(--navy); margin-bottom: -4px; }
.auth-card input[type=email]:focus, .auth-card input[type=password]:focus { outline: 2px solid var(--blue-ink); outline-offset: 1px; border-color: var(--blue-ink); }
.auth-card input[readonly] { background: var(--soft); color: var(--muted); }
.auth-card .pw-step { display: grid; gap: 10px; }
.auth-card .pw-step.hidden { display: none !important; }
.auth-card .as-email { font-size: .85rem; color: var(--muted); margin: -2px 0 0; overflow-wrap: anywhere; }
.auth-card .as-email strong { color: var(--ink); font-weight: 600; }
.auth-card .link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue-ink); text-decoration: underline; cursor: pointer; }
.auth-card .forgot { font-size: .85rem; }
.auth-card .auth-note { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.auth-card .btn[aria-busy="true"], .auth-card .btn[aria-busy="true"]:hover { cursor: progress; background: var(--blue-ink); color: var(--white); opacity: .85; }
.auth-card .save-status:empty { display: none; }
.auth-card .save-status { font-size: .88rem; }
/* r9 mobile pass: the sign-in buttons (Continue / Sign in) measured 43 px tall on phones; 44 px minimum tap target */
.auth-card .btn { min-height: 44px; }
