/* ===========================================================
   Hail Estimator Pro — Estimate Control
   Black + signal-orange brand. Light workspace, dark chrome.
   =========================================================== */

:root {
  /* chrome (sidebar, dark surfaces) */
  --ink: #0B0B0C;
  --ink-2: #141416;
  --ink-3: #1C1C1F;
  --ink-line: rgba(255, 255, 255, .08);
  --ink-line-strong: rgba(255, 255, 255, .14);
  --ink-text: #A1A1AA;
  --ink-mute: #71717A;

  /* workspace — dark glass */
  --bg: #0B0B0C;
  --card-bg: rgba(24, 24, 27, .52);
  --card-sub: rgba(255, 255, 255, .035);
  --field-bg: rgba(0, 0, 0, .28);
  --hover-bg: rgba(255, 255, 255, .05);
  --popover-bg: rgba(30, 30, 33, .82);
  --glass-edge: rgba(255, 255, 255, .1);
  --glass-highlight: rgba(255, 255, 255, .09);

  /* text */
  --text: #F4F4F5;
  --text-2: #D4D4D8;
  --muted: #A1A1AA;
  --faint: #71717A;

  /* lines */
  --border: rgba(255, 255, 255, .09);
  --border-strong: rgba(255, 255, 255, .15);
  --line-soft: rgba(255, 255, 255, .06);

  /* brand */
  --accent: #FF6A1A;
  --accent-hover: #FF7D38;
  --accent-deep: #FF9A5C;
  --accent-bg: rgba(255, 106, 26, .12);
  --accent-line: rgba(255, 106, 26, .35);
  --accent-ring: rgba(255, 106, 26, .28);

  /* status (tinted for dark surfaces) */
  --danger: #F97066;
  --danger-dark: #D92D20;
  --danger-line: rgba(240, 68, 56, .4);
  --danger-bg: rgba(240, 68, 56, .12);
  --good: #47CD89;
  --good-dot: #17B26A;
  --good-bg: rgba(23, 178, 106, .14);
  --warn: #FDB022;
  --warn-dot: #F79009;
  --warn-bg: rgba(247, 144, 9, .14);
  --info: #84ADFF;
  --info-bg: rgba(83, 138, 255, .15);
  --supplement: #BDB4FE;
  --supplement-dot: #9E77ED;
  --supplement-bg: rgba(158, 119, 237, .12);
  --supplement-line: rgba(158, 119, 237, .35);

  /* type */
  --display: "Space Grotesk", "Geist", system-ui, sans-serif;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow-xs: 0 1px 2px rgba(24, 24, 27, .05);
  --shadow: 0 1px 2px rgba(24, 24, 27, .04), 0 4px 16px -6px rgba(24, 24, 27, .08);
  --shadow-lg: 0 24px 48px -12px rgba(24, 24, 27, .22), 0 6px 14px -4px rgba(24, 24, 27, .08);

  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  --sidebar-w: 248px;

  /* printed documents */
  --invoice-black: #0B0B0C;
  --invoice-orange: #FF6A1A;

  color-scheme: dark;
}

/* Printed documents (and their on-screen preview) stay paper-white. */
.invoice-sheet,
.report-print {
  --card-bg: #FFFFFF;
  --card-sub: #FAFAF8;
  --text: #18181B;
  --text-2: #3F3F46;
  --muted: #71717A;
  --faint: #A1A1AA;
  --border: #E7E6E2;
  --border-strong: #D6D5D0;
  --line-soft: #F1F0EC;
  --accent-deep: #C2410C;
  --supplement: #6941C6;
  --supplement-bg: #F7F4FF;
  --good: #067647;
  --good-bg: #ECFDF3;
  --warn: #B54708;
  --warn-bg: #FFFAEB;
  --info: #1D4ED8;
  --info-bg: #EFF4FF;
  color-scheme: light;
  color: var(--text);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
  background: var(--ink);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent); color: var(--ink); }

/* ---------- app shell -------------------------------------- */

.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

/* ---------- ambient background ----------------------------- */
/* Blurred black + orange light behind the workspace. Fixed, so cards scroll
   over it; the sidebar and topbar are frosted glass and let it show through. */

.ambient {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1200px 800px at 85% -10%, #2A1307 0%, transparent 60%),
    radial-gradient(900px 700px at 0% 100%, #1F0E05 0%, transparent 60%),
    var(--ink);
}

.ambient-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  will-change: transform;
}

.ambient-blob-1 {
  width: 620px;
  height: 620px;
  top: -180px;
  right: -120px;
  background: radial-gradient(closest-side, #FF6A1A, rgba(255, 106, 26, 0));
  animation: blobA 26s ease-in-out infinite alternate;
}

.ambient-blob-2 {
  width: 520px;
  height: 520px;
  bottom: -200px;
  left: 12%;
  background: radial-gradient(closest-side, #C2410C, rgba(194, 65, 12, 0));
  opacity: .5;
  animation: blobB 32s ease-in-out infinite alternate;
}

.ambient-blob-3 {
  width: 380px;
  height: 380px;
  top: 38%;
  left: 52%;
  background: radial-gradient(closest-side, #FF9A5C, rgba(255, 154, 92, 0));
  opacity: .22;
  animation: blobC 38s ease-in-out infinite alternate;
}

/* hail-dot grain so the dark areas never read as flat */
.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .045) 1px, transparent 1.3px);
  background-size: 18px 18px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 85%);
  -webkit-mask-image: radial-gradient(120% 90% at 50% 0%, #000 30%, transparent 85%);
}

.main {
  margin-left: var(--sidebar-w);
  min-width: 0;
}

.content {
  max-width: 1240px;
  margin: 0 auto;
  padding: 8px 36px 96px;
}

/* ---------- sidebar ---------------------------------------- */

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 14px;
  background:
    radial-gradient(420px 260px at -10% -6%, rgba(255, 106, 26, .16), transparent 60%),
    linear-gradient(180deg, rgba(20, 20, 22, .72), rgba(11, 11, 12, .6));
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-right: 1px solid var(--ink-line);
  color: var(--ink-text);
}

/* faint hail-dot texture on the chrome */
.sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .055) 1px, transparent 1.2px);
  background-size: 14px 14px;
  mask-image: linear-gradient(180deg, #000, transparent 45%);
  -webkit-mask-image: linear-gradient(180deg, #000, transparent 45%);
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 26px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(160deg, #FF8A47, var(--accent) 55%, #EB5A0C);
  color: var(--ink);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, .12) inset,
    0 8px 22px -6px rgba(255, 106, 26, .6);
}

.brand-mark svg { width: 22px; height: 22px; }

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #fff;
  white-space: nowrap;
}

.brand-sub {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}

.tabs {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
}

.nav-group {
  margin: 18px 10px 8px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

.nav-group:first-child { margin-top: 0; }

.tab-btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-text);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}

.tab-btn[hidden] { display: none; }

.tab-btn .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: .8;
  transition: color .2s var(--ease), opacity .2s var(--ease), transform .3s var(--ease-spring);
}

.tab-btn:hover { background: rgba(255, 255, 255, .05); color: #fff; }
.tab-btn:hover .nav-icon { opacity: 1; transform: translateX(1px); }
.tab-btn:active { transform: scale(.98); }

.tab-btn.active {
  background: linear-gradient(90deg, rgba(255, 106, 26, .16), rgba(255, 106, 26, .04));
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 106, 26, .18);
}

.tab-btn.active .nav-icon { color: var(--accent); opacity: 1; }

.tab-btn.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  animation: navMarker .35s var(--ease-spring);
}

.tab-btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--accent); }

/* user chip pinned to the bottom of the sidebar */
.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--ink-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, .03);
}

.header-user[hidden] { display: none; }

.header-user-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 99px;
  background: var(--ink-3) center / cover no-repeat;
  border: 1px solid var(--ink-line-strong);
  color: #fff;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
}

.header-user-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: #E4E4E7;
}

.header-sign-out {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-text);
}

.header-sign-out svg { width: 16px; height: 16px; }
.header-sign-out:hover { background: rgba(255, 255, 255, .06); border-color: var(--ink-line); color: #fff; }

.sidebar-scrim { display: none; }

/* ---------- topbar ----------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 26px max(36px, calc((100% - 1168px) / 2)) 22px;
  margin-bottom: 24px;
  background: rgba(11, 11, 12, .35);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--ink-line);
}

.topbar-copy { min-width: 0; flex: 1; }

.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.8px;
  line-height: 1.1;
  color: #fff;
}

.topbar h1.swap { animation: titleIn .45s var(--ease); }

.subtitle {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--ink-text);
}

.subtitle.swap { animation: titleIn .45s var(--ease) .04s both; }

.menu-btn,
.topbar-brand { display: none; }

/* ---------- tab panels ------------------------------------- */

.tab-panel { display: none; }

.tab-panel.active {
  display: block;
  animation: panelIn .5s var(--ease) both;
}

.tab-panel.active > * { animation: riseIn .55s var(--ease) both; }
.tab-panel.active > *:nth-child(2) { animation-delay: .07s; }
.tab-panel.active > *:nth-child(3) { animation-delay: .14s; }

/* ---------- cards ------------------------------------------ */

.card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015) 40%),
    var(--card-bg);
  backdrop-filter: blur(30px) saturate(170%);
  -webkit-backdrop-filter: blur(30px) saturate(170%);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 20px;
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 30px 60px -24px rgba(0, 0, 0, .65),
    0 8px 20px -10px rgba(0, 0, 0, .4);
}

.card h2 {
  margin: 0 0 20px;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: var(--text);
}

/* ---------- PDF import ------------------------------------- */

.pdf-import {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 4px;
  padding: 22px 24px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  background:
    radial-gradient(500px 140px at 0% 0%, rgba(255, 106, 26, .07), transparent 70%),
    var(--card-sub);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .25s var(--ease), background-color .25s var(--ease), box-shadow .25s var(--ease), transform .25s var(--ease);
}

.pdf-import:hover {
  border-color: var(--accent);
  background-color: var(--accent-bg);
  box-shadow: 0 10px 30px -14px rgba(255, 106, 26, .55);
  transform: translateY(-1px);
}

.pdf-import.drag-active {
  border-style: solid;
  border-color: var(--accent);
  background-color: var(--accent-bg);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.pdf-import-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.pdf-import-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--ink);
  color: var(--accent);
  box-shadow: 0 8px 18px -8px rgba(11, 11, 12, .6);
  transition: transform .35s var(--ease-spring);
}

.pdf-import:hover .pdf-import-icon { transform: translateY(-2px) rotate(-4deg); }

.pdf-import-icon svg { width: 22px; height: 22px; }

.pdf-import-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.pdf-import-title {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.pdf-import-subtitle {
  font-size: 13px;
  color: var(--muted);
}

.pdf-import-cta {
  flex-shrink: 0;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--hover-bg);
  border: 1px solid var(--border-strong);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}

.pdf-import:hover .pdf-import-cta {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.pdf-import-status {
  min-height: 18px;
  margin: 10px 0 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.pdf-import-status.success { color: var(--good); }
.pdf-import-status.error { color: var(--danger); }

/* ---------- fields ----------------------------------------- */

.vin-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0 16px;
  margin-bottom: 4px;
}

.field[hidden] { display: none; }

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 18px;
  min-width: 0;
}

label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  background: var(--field-bg);
  color: var(--text);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background-color .18s var(--ease);
}

input[type="checkbox"] { width: auto; min-height: 0; box-shadow: none; }

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  cursor: pointer;
}

input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .26); }

select option { background: #1C1C1F; color: var(--text); }

input::placeholder, textarea::placeholder { color: var(--faint); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

textarea { line-height: 1.5; resize: vertical; }

input[type="number"],
input[type="date"],
#vin {
  font-family: var(--mono);
  font-size: 13.5px;
}

#vin {
  min-height: 48px;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 15px;
  font-weight: 500;
}

#vin::placeholder { letter-spacing: .06em; }

/* decoded-from-VIN fields read as derived, not typed */
#year, #make, #model { background: var(--card-sub); }

input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: .45;
  cursor: pointer;
}

.vin-banner {
  padding: 16px 18px;
  margin-bottom: 18px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
  background: var(--accent-bg);
  font-size: 13.5px;
  color: #FFD8BC;
  animation: riseIn .35s var(--ease);
}

.vin-banner[hidden] { display: none; }

.vin-banner-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.approval-hint {
  font-size: 11.5px;
  font-weight: 600;
  min-height: 15px;
  margin-top: 1px;
}

.approval-hint.pct-good { color: var(--good); }
.approval-hint.pct-mid { color: var(--warn); }
.approval-hint.pct-low { color: var(--danger); }

/* ---------- line items ------------------------------------- */

.items-table-scroll {
  overflow-x: auto;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  -webkit-overflow-scrolling: touch;
}

.items-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
}

.items-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 11px 10px;
  background: var(--card-sub);
  border-bottom: 1px solid var(--border);
}

.items-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.items-table tbody tr:last-child td { border-bottom: none; }
.items-table tbody tr { animation: rowIn .3s var(--ease) both; }

.items-table input { border-color: var(--border); box-shadow: none; min-height: 38px; }

.items-table td:nth-child(2) input { text-align: center; }
.items-table td:nth-child(3) input { text-align: right; }

.items-table td:nth-child(2) { width: 80px; }
.items-table td:nth-child(3) { width: 132px; }
.items-table td:nth-child(4) { width: 156px; }
.items-table td:nth-child(5) { width: 116px; }
.items-table td:nth-child(6) { width: 44px; text-align: center; }

tr.item-row-supplement { background: var(--supplement-bg); }

tr.item-row-supplement td:first-child {
  box-shadow: inset 3px 0 0 var(--supplement-dot);
}

.item-supplement-tag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--supplement);
  background: rgba(158, 119, 237, .2);
  border-radius: 5px;
  padding: 2px 7px;
  margin-bottom: 5px;
}

.item-date-dash {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 13px;
  padding-left: 6px;
}

.subtotal-cell {
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text);
  text-align: right;
  white-space: nowrap;
}

.remove-item-btn,
.remove-address-btn {
  width: 30px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: none;
  color: var(--faint);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.remove-address-btn { width: 36px; height: 36px; flex-shrink: 0; }

.remove-item-btn:hover,
.remove-address-btn:hover { background: var(--danger-bg); color: var(--danger); }

.items-actions { display: flex; gap: 10px; }

/* ---------- totals bar ------------------------------------- */

.total-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 26px;
  margin: 26px -28px 0;
  padding: 22px 28px;
  background:
    radial-gradient(400px 120px at 100% 0%, rgba(255, 106, 26, .2), transparent 70%),
    rgba(0, 0, 0, .4);
  border-top: 1px solid var(--border);
}

.total-lines {
  display: flex;
  align-items: center;
  gap: 26px;
  text-align: right;
}

.total-line-supplement {
  font-family: var(--mono);
  font-size: 13.5px;
  color: #C4B5FD;
  margin: 0;
  padding-right: 26px;
  border-right: 1px solid var(--ink-line-strong);
}

.total-line-main {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-text);
}

.total-line-main strong {
  font-family: var(--display);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.total-line-main strong.bump { animation: bump .4s var(--ease-spring); }

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* the estimate form's actions share the dark footer */
.total-row + .form-actions {
  margin: 0 -28px -26px;
  padding: 0 28px 22px;
  background: rgba(0, 0, 0, .4);
  border-radius: 0 0 var(--radius) var(--radius);
}

.total-row + .form-actions .btn-secondary {
  background: transparent;
  color: #E4E4E7;
  border-color: var(--ink-line-strong);
}

.total-row + .form-actions .btn-secondary:hover { background: rgba(255, 255, 255, .06); }

/* ---------- buttons ---------------------------------------- */

button {
  position: relative;
  cursor: pointer;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  border-radius: var(--radius-sm);
  border: none;
  padding: 11px 18px;
  transition:
    background-color .18s var(--ease),
    color .18s var(--ease),
    border-color .18s var(--ease),
    box-shadow .18s var(--ease),
    transform .18s var(--ease);
}

button:active:not(:disabled) { transform: translateY(1px) scale(.985); }
button:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }
button:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 6px 16px -6px rgba(255, 106, 26, .7);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .35) inset, 0 10px 22px -8px rgba(255, 106, 26, .85);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, .06);
  color: var(--text-2);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) { background: rgba(255, 255, 255, .11); border-color: rgba(255, 255, 255, .26); color: #fff; }

.btn-supplement {
  background: var(--supplement-bg);
  color: var(--supplement);
  border: 1px solid var(--supplement-line);
}

.btn-supplement:hover { background: rgba(158, 119, 237, .24); color: #fff; }

.btn-danger { background: var(--danger-dark); color: #fff; }
.btn-danger:hover { background: #B42318; }

/* ---------- list header + filters -------------------------- */

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.list-header h2 { margin-bottom: 0; }

.list-header-actions { display: flex; gap: 8px; }

.list-header + .stats-grid { margin-top: 22px; }
.list-header-actions select { width: auto; }

.list-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0 4px;
}

.list-filters .filter-search {
  flex: 1;
  min-width: 220px;
  padding-left: 40px;
  background: var(--field-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 13px center / 17px;
}

.list-filters select { width: auto; min-width: 180px; }

.status-msg {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  min-height: 18px;
  margin: 8px 0 12px;
}

.status-msg.error { color: var(--danger); }

/* ---------- data tables ------------------------------------ */

.table-wrap {
  overflow-x: auto;
  margin: 0 -28px -26px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}

#estimates-table,
#analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

#estimates-table { min-width: 900px; }
#analytics-table { min-width: 1240px; }

#estimates-table th,
#analytics-table th {
  position: sticky;
  top: 0;
  text-align: left;
  padding: 12px 14px;
  background: var(--card-sub);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

#estimates-table th:first-child,
#analytics-table th:first-child,
#estimates-table td:first-child,
#analytics-table td:first-child { padding-left: 28px; }

#estimates-table th:last-child,
#analytics-table th:last-child,
#estimates-table td:last-child,
#analytics-table td:last-child { padding-right: 28px; }

#estimates-table td,
#analytics-table td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--text-2);
  transition: background-color .15s var(--ease);
}

#estimates-table tbody tr:last-child td,
#analytics-table tbody tr:last-child td { border-bottom: none; }

#estimates-table tbody tr:hover td,
#analytics-table tbody tr:hover td { background: rgba(255, 255, 255, .035); }

#estimates-table tbody tr:hover td:first-child,
#analytics-table tbody tr:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

#estimates-table td:nth-child(1),
#estimates-table td:nth-child(5),
#estimates-table td:nth-child(6),
#estimates-table td:nth-child(7),
#analytics-table td:nth-child(1),
#analytics-table td:nth-child(5),
#analytics-table td:nth-child(6),
#analytics-table td:nth-child(7),
#analytics-table td:nth-child(8),
#analytics-table td:nth-child(9),
#analytics-table td:nth-child(10) {
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
}

#estimates-table td:nth-child(1),
#analytics-table td:nth-child(1) { color: var(--faint); }

#estimates-table th:nth-child(5),
#estimates-table td:nth-child(5),
#estimates-table th:nth-child(7),
#estimates-table td:nth-child(7),
#analytics-table th:nth-child(5),
#analytics-table td:nth-child(5),
#analytics-table th:nth-child(6),
#analytics-table td:nth-child(6),
#analytics-table th:nth-child(8),
#analytics-table td:nth-child(8),
#analytics-table th:nth-child(9),
#analytics-table td:nth-child(9),
#analytics-table th:nth-child(10),
#analytics-table td:nth-child(10) {
  text-align: right;
}

#estimates-table td:nth-child(3),
#analytics-table td:nth-child(3) {
  font-weight: 600;
  color: var(--text);
}

#estimates-table td:nth-child(3),
#estimates-table td:nth-child(4),
#analytics-table td:nth-child(3),
#analytics-table td:nth-child(4) { min-width: 130px; }

#estimates-table td:nth-child(5),
#analytics-table td:nth-child(5) {
  font-weight: 600;
  color: var(--text);
}

.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--text); }

.sortable::after {
  content: "↕";
  display: inline-block;
  margin-left: 6px;
  opacity: .4;
}

.sortable.sorted-asc::after { content: "↑"; opacity: 1; color: var(--accent); }
.sortable.sorted-desc::after { content: "↓"; opacity: 1; color: var(--accent); }

.vin-cell {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .01em;
  color: var(--muted);
  white-space: nowrap;
}

.supplement-count {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--supplement);
  background: rgba(158, 119, 237, .2);
  border-radius: 5px;
  padding: 1px 6px;
  margin-left: 6px;
}

.empty-row td {
  text-align: center !important;
  color: var(--faint) !important;
  font-family: var(--sans) !important;
  font-size: 13.5px;
  padding: 56px 24px !important;
}

/* ---------- badges ----------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.3;
  border: none;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: currentColor;
}

.badge-awaiting_payment { background: var(--warn-bg); color: var(--warn); box-shadow: inset 0 0 0 1px rgba(247, 144, 9, .3); }
.badge-paid { background: var(--good-bg); color: var(--good); box-shadow: inset 0 0 0 1px rgba(23, 178, 106, .3); }
.badge-package { background: var(--info-bg); color: var(--info); box-shadow: inset 0 0 0 1px rgba(83, 138, 255, .3); }
/* estimate on a package that hasn't been paid yet */
.badge-package.badge-package-unpaid { background: var(--danger-bg); color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-line); }
.badge-used_up { background: var(--line-soft); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); }

.badge-awaiting_payment::before { animation: pulse 2s ease-in-out infinite; }

button.status-trigger {
  font-family: inherit;
  cursor: pointer;
}

button.status-trigger:hover { filter: brightness(.97); transform: translateY(-1px); }
button.status-trigger:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }

.pct-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.pct-badge.pct-good { background: var(--good-bg); color: var(--good); }
.pct-badge.pct-mid { background: var(--warn-bg); color: var(--warn); }
.pct-badge.pct-low { background: var(--danger-bg); color: var(--danger-dark); }

/* ---------- row actions ------------------------------------ */

/* the cell stays a table-cell (flex would break column alignment) and is
   pinned to the right so actions stay reachable while the table scrolls */
td.row-actions {
  position: sticky;
  right: 0;
  text-align: right;
  white-space: nowrap;
  background: #18181B;
  box-shadow: -18px 0 18px -16px rgba(0, 0, 0, .7);
}

#estimates-table th:last-child {
  position: sticky;
  right: 0;
  z-index: 1;
}

.row-actions button {
  vertical-align: middle;
  margin-left: 4px;
  padding: 7px 11px;
  font-size: 12px;
  border-radius: 8px;
}

.row-actions button:first-child { margin-left: 0; }

.row-actions .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  padding: 0;
}

.row-actions .icon-btn svg { width: 15px; height: 15px; }

/* tooltips for icon-only actions */
.row-actions button[title]::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 4px);
  transition: opacity .15s var(--ease), transform .15s var(--ease);
}

.row-actions button[title]:hover::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.row-actions button.icon-btn-danger { padding: 0; }

.icon-btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  padding: 0;
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid var(--danger-line);
  border-radius: 8px;
}

.icon-btn-danger:hover { background: var(--danger-bg); border-color: var(--danger); }
.icon-btn-danger svg { width: 15px; height: 15px; }

/* ---------- full-screen PDF drop overlay ------------------- */

.pdf-drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(600px 400px at 50% 50%, rgba(255, 106, 26, .35), transparent 70%),
    rgba(11, 11, 12, .88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  animation: fadeIn .2s var(--ease);
}

.pdf-drop-overlay[hidden] { display: none; }

.pdf-drop-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 56px 72px;
  border: 2px dashed rgba(255, 106, 26, .7);
  border-radius: 28px;
  animation: popIn .35s var(--ease-spring);
}

.pdf-drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  background: var(--accent);
  color: var(--ink);
  box-shadow: 0 20px 50px -10px rgba(255, 106, 26, .8);
  animation: float 1.6s ease-in-out infinite;
}

.pdf-drop-icon svg { width: 40px; height: 40px; }

.pdf-drop-text {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.6px;
  color: #fff;
}

.pdf-drop-sub { font-size: 14px; color: var(--ink-text); }

body.pdf-dragging .app {
  filter: blur(2px);
  transition: filter .2s var(--ease);
}

/* ---------- popovers --------------------------------------- */

.status-popover,
.delete-popover,
.report-popover {
  position: fixed;
  z-index: 50;
  background: var(--popover-bg);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-edge);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  transform-origin: top center;
  animation: popIn .22s var(--ease-spring);
}

.status-popover { width: 270px; max-width: calc(100vw - 16px); }
.report-popover { width: 260px; max-width: calc(100vw - 16px); }
.delete-popover { min-width: 240px; }

.status-popover p,
.delete-popover p,
.report-popover p {
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.delete-popover p { margin-bottom: 14px; }

.status-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.status-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--hover-bg);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.status-option:hover { background: rgba(255, 255, 255, .09); }

.status-option::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 99px;
  background: var(--faint);
}

.status-option[data-status="paid"].active::before { background: var(--good-dot); }
.status-option[data-status="awaiting_payment"].active::before { background: var(--warn-dot); }

.status-option.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
  color: var(--text);
}

.status-popover-date-field { margin-bottom: 14px; }
.status-popover-date-field label { font-size: 11.5px; }

.delete-popover-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.delete-popover-actions button { padding: 8px 14px; font-size: 13px; }

.report-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
}

.report-option input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- analytics KPIs --------------------------------- */

.stats-grid {
  display: grid;
  grid-template-columns: 1.3fr repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));
  overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -16px rgba(24, 24, 27, .25);
  border-color: var(--border-strong);
}

.stat-card-money {
  background:
    radial-gradient(260px 160px at 100% 0%, rgba(255, 106, 26, .35), transparent 70%),
    var(--ink);
  border-color: var(--ink);
  cursor: pointer;
  user-select: none;
}

.stat-card-money:hover { border-color: var(--ink); box-shadow: 0 18px 36px -14px rgba(255, 106, 26, .45); }

.stat-card-money:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--accent-ring); }

.stat-card-money .stat-label { color: var(--ink-text); }
.stat-card-money .stat-value { color: #fff; }

.stat-card-money-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-reveal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 9px;
  border: 1px solid var(--ink-line-strong);
  background: rgba(255, 255, 255, .04);
  color: var(--ink-text);
}

.stat-reveal-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.stat-reveal-btn svg { width: 15px; height: 15px; }
.stat-reveal-btn svg[hidden] { display: none; }

.stat-charged-line {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-text);
}

.stat-charged-line #stat-total-charged { color: var(--accent); }

.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.8px;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-value.reveal { animation: revealIn .45s var(--ease); }

/* ---------- customer volume chart -------------------------- */

.chart-title {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.chart-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 28px;
}

.chart-row {
  display: grid;
  grid-template-columns: 160px 1fr 44px;
  align-items: center;
  gap: 14px;
  padding: 5px 8px;
  margin: 0 -8px;
  border-radius: 8px;
  transition: background .15s var(--ease);
}

.chart-row:hover { background: var(--card-sub); }
.chart-row:hover .chart-bar-fill { filter: brightness(1.08); }

.chart-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-bar-track {
  height: 12px;
  background: var(--line-soft);
  border-radius: 99px;
  overflow: hidden;
}

.chart-bar-fill {
  height: 100%;
  min-width: 6px;
  background: linear-gradient(90deg, #FF9A5C, var(--accent));
  border-radius: 99px;
  transform-origin: left center;
  animation: growX .9s var(--ease) both;
}

.chart-row:nth-child(2) .chart-bar-fill { animation-delay: .05s; }
.chart-row:nth-child(3) .chart-bar-fill { animation-delay: .1s; }
.chart-row:nth-child(4) .chart-bar-fill { animation-delay: .15s; }
.chart-row:nth-child(5) .chart-bar-fill { animation-delay: .2s; }
.chart-row:nth-child(n+6) .chart-bar-fill { animation-delay: .25s; }

.chart-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: right;
}

.chart-empty {
  font-size: 13.5px;
  color: var(--faint);
  margin: 0 0 24px;
}

/* ---------- customers -------------------------------------- */

.address-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.address-row {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: rowIn .3s var(--ease) both;
}

.address-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.address-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 20;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--popover-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--glass-edge);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  animation: popIn .18s var(--ease);
}

.address-suggestions li {
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}

.address-suggestions li:hover { background: var(--accent-bg); color: var(--text); }

.customers-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr));
  gap: 14px;
}

.customer-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  background: var(--card-sub);
  animation: riseIn .4s var(--ease) both;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease);
}

.customer-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 14px 30px -18px rgba(24, 24, 27, .3);
  transform: translateY(-1px);
}

.customer-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.customer-card-header h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.customer-card-header h3 .badge {
  margin-left: 6px;
  vertical-align: middle;
  font-family: var(--sans);
}

.customer-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.customer-card-actions button:not(.icon-btn-danger) { padding: 8px 13px; font-size: 12.5px; }

.customer-address-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.customer-address-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.customer-address-empty {
  justify-content: flex-start;
  color: var(--faint);
  font-size: 13px;
}

.customer-address-text {
  font-size: 13px;
  color: var(--text-2);
}

.btn-copy-address {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--hover-bg);
  color: var(--text-2);
}

.btn-copy-address:hover { background: var(--card-sub); color: var(--text); }
.btn-copy-address svg { width: 13px; height: 13px; }

.btn-copy-address.copied {
  border-color: var(--good-dot);
  background: var(--good-bg);
  color: var(--good);
  animation: bump .35s var(--ease-spring);
}

/* customers typed on old records that aren't registered yet */
.unregistered-customers {
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--accent-line);
  border-radius: 14px;
  background: var(--accent-bg);
  animation: riseIn .4s var(--ease) both;
}

.unregistered-customers[hidden] { display: none; }

.unregistered-title {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.unregistered-help {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
}

.unregistered-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.unregistered-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--field-bg);
}

.unregistered-name { font-weight: 600; color: var(--text); }

.unregistered-count {
  margin-right: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.unregistered-list button { padding: 7px 12px; font-size: 12.5px; }

/* ---------- packages --------------------------------------- */

.package-hint { color: var(--info); }

.package-credit-picker {
  display: flex;
  gap: 8px;
}

.package-credit-picker input { flex: 1; min-width: 0; }

.package-credit-preset { padding: 9px 15px; min-width: 46px; }

.package-credit-preset.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  box-shadow: 0 0 0 3px var(--accent-ring);
  color: var(--accent-deep);
}

.package-number {
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-deep);
  background: var(--accent-bg);
  border-radius: 6px;
  padding: 2px 7px;
  margin-right: 6px;
}

.package-usage { margin-bottom: 10px; }

.package-usage-numbers {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 9px;
  font-size: 13px;
  color: var(--text-2);
}

.package-usage-numbers strong {
  font-family: var(--display);
  font-size: 24px;
  letter-spacing: -.5px;
  color: var(--text);
}

.package-usage-numbers span {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.package-usage .chart-bar-track { height: 8px; }
.package-usage .chart-bar-fill.package-bar-full { background: var(--good-dot); }

.package-meta {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.package-estimate-item { padding: 8px 12px; }

.package-card .customer-card-header { flex-wrap: wrap; align-items: flex-start; }
.package-card .customer-card-header h3 { flex: 1 1 240px; line-height: 1.7; }
.package-card .customer-card-header h3 .badge + .badge { margin-left: 4px; }
.package-card .customer-card-actions { flex-wrap: wrap; }

.package-invoice-note { font-size: 12px; color: var(--muted); }
.package-invoice-table td:nth-child(2) { width: 100%; }
.invoice-total-row .report-included.package-invoice-paid { color: var(--good); font-weight: 600; }

/* ---------- users ------------------------------------------ */

.user-form {
  display: grid;
  grid-template-columns: 1fr 190px auto;
  gap: 16px;
  align-items: end;
}

.user-form .field { margin-bottom: 0; }
.user-form button { min-height: 42px; }

.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card-sub);
  animation: riseIn .35s var(--ease) both;
}

.user-row-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.user-row-email {
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.user-row-you { font-weight: 500; color: var(--muted); }

.user-row-meta {
  font-size: 12px;
  color: var(--muted);
}

.user-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.user-row-actions select { width: auto; min-height: 34px; padding: 6px 32px 6px 10px; font-size: 12.5px; }

.badge-role-owner { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: inset 0 0 0 1px var(--border-strong); }
.badge-role-owner::before { background: var(--accent); }
.badge-role-admin { background: var(--accent-bg); color: var(--accent-deep); box-shadow: inset 0 0 0 1px var(--accent-line); }
.badge-role-member { background: var(--line-soft); color: var(--text-2); }

/* ---------- invoice ---------------------------------------- */

.invoice-helper {
  margin: -12px 0 20px;
  font-size: 13.5px;
  color: var(--muted);
}

/* a helper under a header row (no h2 margin to absorb) needs breathing room */
.list-header + .invoice-helper { margin-top: 8px; }

.invoice-sheet {
  background: #fff;
  border: none;
  border-radius: var(--radius);
  box-shadow: 0 30px 60px -24px rgba(0, 0, 0, .65), 0 8px 20px -10px rgba(0, 0, 0, .4);
  overflow: hidden;
}

.invoice-sheet:not([hidden]) { animation: riseIn .5s var(--ease); }

.invoice-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(255, 106, 26, .22), transparent 70%),
    var(--invoice-black);
  padding: 28px 30px;
}

.invoice-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.invoice-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 11px;
  background: var(--invoice-orange);
  color: var(--invoice-black);
}

.invoice-brand-mark svg { width: 24px; height: 24px; }

.invoice-brand-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
}

.invoice-brand-copy p {
  margin: 3px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--invoice-orange);
}

.invoice-meta { text-align: right; }

.invoice-meta p {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 0 10px;
}

.invoice-meta p:last-child { margin-bottom: 0; }

.invoice-meta span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #8A8A8A;
}

.invoice-meta strong {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.invoice-section-label {
  margin: 26px 30px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-deep);
  border-left: 3px solid var(--invoice-orange);
  padding-left: 9px;
}

.invoice-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.invoice-table th {
  text-align: left;
  padding: 10px 30px;
  background: var(--card-sub);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.invoice-table td {
  padding: 13px 30px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text-2);
}

.invoice-table th:last-child,
.invoice-table td:last-child {
  text-align: right;
  font-family: var(--mono);
  white-space: nowrap;
}

.invoice-total-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 16px;
  padding: 20px 30px 28px;
}

.invoice-total-row span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.invoice-total-row strong {
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  color: var(--invoice-black);
  border-bottom: 3px solid var(--invoice-orange);
  padding-bottom: 2px;
}

/* payment details at the foot of the invoice */
.invoice-payment {
  border-top: 1px solid var(--border);
  padding-bottom: 26px;
}

.invoice-payment .invoice-section-label { margin-top: 22px; }

.invoice-payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 0 30px;
}

.invoice-payment-method {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--invoice-orange);
  border-radius: 8px;
  background: var(--card-sub);
}

.invoice-payment-method span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.invoice-payment-method strong {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* ---------- customer report (print-only) ------------------- */

.report-print { display: none; }

.report-list-table th.num,
.report-list-table td.num {
  text-align: right;
  font-family: var(--mono);
  white-space: nowrap;
}

.report-list-table td.vin-cell { padding-left: 30px; }

.report-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 28px;
  padding: 0 30px 6px;
}

.report-info-grid span,
.report-summary-row span {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}

.report-info-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.report-mono { font-family: var(--mono); letter-spacing: .03em; }

/* status pills on printed lists: no pulsing dot, never wrap */
.report-status { font-size: 10.5px; padding: 2px 8px 2px 7px; }
.report-status::before { animation: none !important; }
.report-list-table td:has(.report-status) { white-space: nowrap; }

.report-summary { padding: 0 30px 6px; }

.report-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.report-summary-row strong {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.report-summary-total strong {
  font-family: var(--display);
  font-size: 22px;
  color: var(--invoice-black);
  border-bottom: 3px solid var(--invoice-orange);
  padding-bottom: 2px;
}

.report-fees-table td:nth-child(3),
.report-fees-table th:nth-child(3),
.report-fees-table td:nth-child(4),
.report-fees-table th:nth-child(4) { text-align: right; }

.report-fees-table td:nth-child(4) { font-family: var(--mono); white-space: nowrap; }

.report-row-supplement { background: var(--supplement-bg); }

.invoice-total-row .report-included {
  margin-right: auto;
  text-transform: none;
  letter-spacing: 0;
  font-size: 13px;
  color: var(--supplement);
}

.report-notes {
  margin: 0;
  padding: 0 30px 26px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-2);
  white-space: pre-wrap;
}

/* ---------- sign-in gate ----------------------------------- */

body.signed-out .app { display: none; }

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
  background: var(--ink);
}

/* hail-grid backdrop */
.auth-gate::before {
  content: "";
  position: absolute;
  inset: -50%;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: radial-gradient(closest-side, #000, transparent);
  -webkit-mask-image: radial-gradient(closest-side, #000, transparent);
  animation: drift 40s linear infinite;
}

.auth-gate[hidden] { display: none; }

.auth-glow {
  position: absolute;
  width: 720px;
  height: 720px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 106, 26, .32), transparent);
  filter: blur(30px);
  animation: breathe 6s ease-in-out infinite;
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 32px 32px;
  background: linear-gradient(180deg, rgba(28, 28, 31, .92), rgba(16, 16, 18, .92));
  border: 1px solid var(--ink-line-strong);
  border-radius: 24px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .03) inset;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: popIn .6s var(--ease-spring);
}

.auth-card .brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  margin-bottom: 22px;
}

.auth-card .brand-mark svg { width: 32px; height: 32px; }

.auth-eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: #fff;
}

.auth-subtitle {
  margin: 0 0 28px;
  font-size: 14px;
  color: var(--ink-text);
}

.auth-button { min-height: 44px; }

.auth-msg {
  min-height: 18px;
  margin: 16px 0 0;
  font-size: 13px;
  color: var(--ink-text);
}

.auth-msg.error { color: #FDA29B; }

/* ---------- scrollbars ------------------------------------- */

*::-webkit-scrollbar { height: 10px; width: 10px; }

*::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}

.sidebar *::-webkit-scrollbar-thumb { background: var(--ink-3); background-clip: content-box; }

/* ---------- motion ----------------------------------------- */

@keyframes panelIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes rowIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

@keyframes titleIn {
  from { opacity: 0; transform: translateY(6px); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-4px) scale(.96); }
  to { opacity: 1; transform: none; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

@keyframes revealIn {
  from { opacity: 0; filter: blur(6px); }
  to { opacity: 1; filter: none; }
}

@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

@keyframes navMarker { from { transform: scaleY(0); } to { transform: scaleY(1); } }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.12); opacity: 1; }
}

@keyframes drift { to { transform: translate(22px, 22px); } }

@keyframes blobA { to { transform: translate(-220px, 140px) scale(1.15); } }
@keyframes blobB { to { transform: translate(260px, -120px) scale(.9); } }
@keyframes blobC { to { transform: translate(-280px, -160px) scale(1.3); } }

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

/* ---------- print ------------------------------------------ */

/* Printing always goes through #report-print: app.js copies the document
   (invoice, report, list, statement) there and hides the app, so the page
   holds nothing but the document. */
@page {
  size: auto;
  margin: 12mm;
}

@media print {
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
    animation: none !important;
    transition: none !important;
  }

  /* the dark theme's color-scheme would paint the page margins black */
  :root { color-scheme: light; }
  html, body { background: #fff !important; }
  body { font-size: 11px; }
  .ambient, .app, .sidebar-scrim, .pdf-drop-overlay,
  .status-popover, .delete-popover, .report-popover { display: none !important; }
  .report-print { display: block !important; }

  .report-print .invoice-sheet {
    width: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  /* one shared 18px gutter so header, labels, table and totals line up */
  .report-print .invoice-header {
    padding: 18px;
    background: var(--invoice-black);
    break-inside: avoid;
  }

  .report-print .invoice-brand-mark { width: 34px; height: 34px; border-radius: 8px; }
  .report-print .invoice-brand-mark svg { width: 20px; height: 20px; }
  .report-print .invoice-brand-copy h1 { font-size: 17px; }
  .report-print .invoice-brand-copy p { font-size: 9.5px; }
  .report-print .invoice-meta span { font-size: 8.5px; }
  .report-print .invoice-meta strong { font-size: 12px; }

  .report-print .invoice-section-label {
    margin: 18px 18px 8px;
    font-size: 9.5px;
    break-after: avoid;
  }

  .report-print .invoice-table {
    width: 100%;
    font-size: 10.5px;
    border-collapse: collapse;
  }

  .report-print .invoice-table thead { display: table-header-group; }
  .report-print .invoice-table tr { break-inside: avoid; }

  .report-print .invoice-table th,
  .report-print .invoice-table td {
    padding: 7px 8px;
    vertical-align: top;
    line-height: 1.35;
  }

  .report-print .invoice-table th { font-size: 8.5px; }
  .report-print .invoice-table th:first-child,
  .report-print .invoice-table td:first-child { padding-left: 18px; }
  .report-print .invoice-table th:last-child,
  .report-print .invoice-table td:last-child { padding-right: 18px; }

  /* short fixed-format values never wrap; text columns take the rest */
  .report-print .invoice-table td:first-child,
  .report-print .invoice-table th:first-child { width: 1%; white-space: nowrap; }
  .report-print .vin-cell,
  .report-print .invoice-table .num,
  .report-print .invoice-table td:last-child { white-space: nowrap; }
  .report-print .vin-cell { font-size: 9.5px; }

  .report-print .invoice-total-row {
    padding: 14px 18px 18px;
    break-inside: avoid;
  }

  .report-print .invoice-total-row strong { font-size: 19px; }

  .report-print .invoice-payment { padding-bottom: 18px; break-inside: avoid; }
  .report-print .invoice-payment .invoice-section-label { margin-top: 16px; }
  .report-print .invoice-payment-methods { padding: 0 18px; gap: 10px; }
  .report-print .invoice-payment-method { padding: 9px 12px; }
  .report-print .invoice-payment-method span { font-size: 8.5px; }
  .report-print .invoice-payment-method strong { font-size: 13px; }

  .report-print .report-info-grid,
  .report-print .report-summary { padding: 0 18px 4px; }
  .report-print .report-notes { padding: 0 18px 18px; font-size: 10.5px; }
  .report-print .report-list-table td.vin-cell { padding-left: 8px; }
}

/* ---------- responsive ------------------------------------- */

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1100px) {
  .grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 960px) {
  .main { margin-left: 0; }

  .sidebar {
    width: min(300px, 84vw);
    transform: translateX(-102%);
    transition: transform .38s var(--ease), box-shadow .38s var(--ease);
    padding-top: calc(22px + env(safe-area-inset-top));
    padding-bottom: calc(14px + env(safe-area-inset-bottom));
  }

  body.nav-open .sidebar { transform: none; box-shadow: 30px 0 60px -20px rgba(0, 0, 0, .5); }

  .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(11, 11, 12, .5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--ease);
  }

  body.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  .topbar {
    padding: calc(14px + env(safe-area-inset-top)) 20px 14px;
    background: rgba(11, 11, 12, .6);
    margin-bottom: 20px;
  }

  .topbar h1 { font-size: 19px; letter-spacing: -.3px; }
  .topbar .subtitle { display: none; }

  .menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 11px;
    border: 1px solid var(--ink-line-strong);
    background: rgba(255, 255, 255, .04);
    color: #fff;
  }

  .menu-btn svg { width: 20px; height: 20px; }

  .topbar-brand { display: inline-flex; }
  .topbar-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .topbar-brand .brand-mark svg { width: 19px; height: 19px; }

  .content { padding: 0 20px 80px; }
}

@media (max-width: 700px) {
  .content { padding: 0 12px 64px; }
  .card { padding: 20px 16px; border-radius: 14px; }
  .total-row { margin: 22px -16px 0; padding: 18px 16px; flex-wrap: wrap; }
  .total-row + .form-actions { margin: 0 -16px -20px; padding: 0 16px 18px; border-radius: 0 0 14px 14px; }
  .total-lines { flex-wrap: wrap; gap: 14px; justify-content: flex-end; }
  .total-line-supplement { border-right: none; padding-right: 0; }
  .table-wrap { margin: 0 -16px -20px; }
  td.row-actions, #estimates-table th:last-child { position: static; box-shadow: none; }
  #estimates-table th:first-child, #analytics-table th:first-child,
  #estimates-table td:first-child, #analytics-table td:first-child { padding-left: 16px; }
  #estimates-table th:last-child, #analytics-table th:last-child,
  #estimates-table td:last-child, #analytics-table td:last-child { padding-right: 16px; }
  .pdf-import { flex-direction: column; align-items: stretch; padding: 18px; }
  .pdf-import-cta { text-align: center; }
  .vin-info-grid { grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
  .chart-row { grid-template-columns: 96px 1fr 32px; gap: 10px; }
  .chart-label { font-size: 12px; }
  .invoice-header { flex-direction: column; padding: 22px 18px; }
  .invoice-meta { text-align: left; }
  .invoice-table { font-size: 12px; }
  .invoice-table th, .invoice-table td { padding: 10px 14px; }
  .invoice-section-label { margin: 20px 14px 10px; }
  .invoice-total-row { padding: 14px 14px 20px; }
  .invoice-payment-methods { padding: 0 14px; grid-template-columns: 1fr; }
  .user-form { grid-template-columns: 1fr; }
  .user-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .vin-info-grid { grid-template-columns: 1fr; gap: 0; }
  .vin-info-grid .field { margin-bottom: 18px; }
  .vin-info-grid { margin-bottom: 0; }
  .stats-grid { grid-template-columns: 1fr; }
  .pdf-import-subtitle { display: none; }
  .list-header { flex-wrap: wrap; gap: 10px; }
  .list-filters > * { flex: 1 1 100%; min-width: 0; }
  .list-filters select { width: 100%; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions button { width: 100%; }
  .items-actions { flex-direction: column; }
  .items-actions button { width: 100%; }
  .vin-banner-actions { flex-direction: column; }
  .vin-banner-actions button { width: 100%; }
  .customer-card-header { flex-direction: column; align-items: flex-start; }
  .customer-address-item { flex-direction: column; align-items: flex-start; }
  .btn-copy-address { align-self: flex-end; }
  input, select, textarea,
  input[type="number"], input[type="date"], #vin { font-size: 16px; }
}

@media (max-width: 560px) {
  /* stacked header: the title's flex-basis would otherwise become its height */
  .package-card .customer-card-header h3 { flex: none; }
}
