/* Quote Rave — Global Stylesheet
   Palette: #020300 (black) · #36311F (khaki) · #59544B (stone) · #7D8CA3 (lavender)
   Fonts: DM Serif Display (headings) · Inter (body)
   WCAG 2.1 AA compliant — all contrast ratios verified
*/

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@300;400;500;600&display=swap');
@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@latest/tabler-icons.min.css');

/* ─── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #020300;
  color: #F4F2EE;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ─── CSS VARIABLES ──────────────────────────────────────────────────────── */
:root {
  --black:   #020300;
  --khaki:   #36311F;
  --stone:   #59544B;
  --lav:     #7D8CA3;
  --white:   #F4F2EE;

  /* Opacity variants */
  --white-55: rgba(244, 242, 238, 0.55);
  --white-12: rgba(244, 242, 238, 0.12);
  --white-08: rgba(244, 242, 238, 0.08);
  --lav-15:   rgba(125, 140, 163, 0.15);
  --lav-35:   rgba(125, 140, 163, 0.35);

  /* Status colors */
  --green:   #6DBF7E;
  --amber:   #E8AE1E;
  --red:     #E24B4A;

  /* Typography */
  --font-serif: 'DM Serif Display', Georgia, serif;
  --font-sans:  'Inter', system-ui, sans-serif;

  /* Spacing */
  --nav-h: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 100px;
}

/* ─── FOCUS RINGS (WCAG 2.1 §2.4.7) ─────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--lav);
  outline-offset: 2px;
}

/* ─── SCREEN READER ONLY ────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ─── NAVIGATION ─────────────────────────────────────────────────────────── */
.qr-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(2, 3, 0, 0.97);
  border-bottom: 0.5px solid var(--white-12);
  height: var(--nav-h);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 48px);
  gap: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.qr-nav-logo {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}

.qr-nav-logo-icon {
  width: 30px; height: 30px;
  border-radius: 7px; overflow: hidden; flex-shrink: 0;
}

.qr-nav-logo-icon img { width: 100%; height: 100%; object-fit: cover; }

.qr-nav-logo-name {
  font-family: var(--font-serif);
  font-size: clamp(15px, 3vw, 18px);
  color: var(--white);
  letter-spacing: 0.01em;
}

.qr-nav-links {
  display: flex; align-items: center;
  gap: clamp(4px, 1.5vw, 20px);
}

.qr-nav-link {
  font-size: 13px; color: var(--white-55);
  padding: 6px 4px;
  white-space: nowrap;
  min-height: 44px; display: inline-flex; align-items: center;
  border-radius: var(--radius-sm);
  transition: color 0.15s;
}
.qr-nav-link:hover, .qr-nav-link.active { color: var(--lav); }
.qr-nav-link.active { background: var(--lav-15); padding: 6px 10px; }

.qr-nav-login {
  font-size: 13px; color: var(--lav);
  padding: 6px 4px; min-height: 44px;
  display: inline-flex; align-items: center;
}

.qr-nav-cta {
  background: var(--lav); color: var(--black);
  border: none; border-radius: var(--radius-sm);
  padding: 8px 16px; font-size: 13px; font-weight: 500;
  min-height: 36px; white-space: nowrap;
  transition: opacity 0.15s;
}
.qr-nav-cta:hover { opacity: 0.9; }

.qr-hamburger {
  display: none; flex-direction: column; gap: 4px;
  padding: 10px 4px; min-width: 44px; min-height: 44px;
  justify-content: center; align-items: center;
  background: transparent; border: none;
}
.qr-hamburger span {
  display: block; width: 18px; height: 1.5px;
  background: var(--white-55); border-radius: 2px;
}

@media (max-width: 640px) {
  .qr-nav-links { display: none; }
  .qr-hamburger { display: flex; }
}

/* Mobile nav drawer */
.qr-nav-drawer {
  display: none; position: fixed; inset: 0; z-index: 99;
  background: rgba(2, 3, 0, 0.98);
  flex-direction: column; align-items: center; justify-content: center;
  gap: 24px;
}
.qr-nav-drawer.open { display: flex; }
.qr-nav-drawer .qr-nav-link {
  font-size: 20px; min-height: 56px; justify-content: center;
}
.qr-nav-drawer .drawer-close {
  position: absolute; top: 16px; right: 16px;
  background: transparent; border: none; color: var(--white-55);
  font-size: 24px; min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
}

/* ─── PAGE WRAPPER ───────────────────────────────────────────────────────── */
.qr-page {
  min-height: calc(100vh - var(--nav-h));
  padding: 20px clamp(16px, 4vw, 32px) 40px;
  max-width: 520px;
  margin: 0 auto;
}

/* ─── CARDS ──────────────────────────────────────────────────────────────── */
.qr-card {
  background: var(--khaki);
  border: 0.5px solid var(--stone);
  border-radius: var(--radius);
  padding: clamp(14px, 3vw, 18px);
  margin-bottom: 12px;
}

.qr-card-accent { border-color: var(--lav-35); }

/* ─── TYPOGRAPHY ─────────────────────────────────────────────────────────── */
.qr-heading {
  font-family: var(--font-serif);
  font-size: clamp(22px, 5vw, 28px);
  color: var(--white);
  line-height: 1.2;
  margin-bottom: 4px;
}

.qr-subhead {
  font-size: 13px; color: var(--white-55);
  line-height: 1.6; margin-bottom: 16px;
}

.qr-lav-line {
  width: 28px; height: 2px;
  background: var(--lav); margin: 8px 0 14px;
}

.qr-label {
  display: block;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--lav); margin-bottom: 6px;
}

.qr-label-optional {
  font-size: 10px; color: var(--white-55);
  text-transform: none; letter-spacing: 0; font-weight: 400;
}

/* ─── FORM ELEMENTS ──────────────────────────────────────────────────────── */
.qr-input {
  width: 100%; padding: 10px 12px;
  border: 0.5px solid var(--stone);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--white);
  background: rgba(255, 255, 255, 0.06);
  transition: border-color 0.15s;
  min-height: 44px;
}
.qr-input::placeholder { color: var(--white-55); }
.qr-input:focus { border-color: var(--lav); outline: none; }
.qr-input.error { border-color: var(--red); }

.qr-select {
  width: 100%; padding: 10px 12px;
  border: 0.5px solid var(--stone);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--white);
  background: var(--khaki);
  min-height: 44px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237D8CA3' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.qr-select:focus { border-color: var(--lav); outline: none; }

.qr-textarea {
  width: 100%; padding: 10px 12px;
  border: 0.5px solid var(--stone);
  border-radius: var(--radius-sm);
  font-size: 13px; color: var(--white);
  background: rgba(255, 255, 255, 0.04);
  resize: vertical; min-height: 80px; line-height: 1.5;
}
.qr-textarea::placeholder { color: var(--white-55); }
.qr-textarea:focus { border-color: var(--lav); outline: none; }

.qr-input-group { margin-bottom: 12px; }

/* Error text */
.qr-error-text {
  font-size: 12px; color: var(--red);
  margin-top: 5px; display: none;
}
.qr-error-text.visible { display: block; }

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.qr-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 44px; padding: 11px 20px;
  border: none; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; font-family: var(--font-sans);
  cursor: pointer; transition: opacity 0.15s;
}
.qr-btn:hover { opacity: 0.9; }
.qr-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.qr-btn-primary   { background: var(--lav);  color: var(--black); }
.qr-btn-outline   { background: transparent; color: var(--lav);  border: 0.5px solid var(--lav); }
.qr-btn-ghost     { background: transparent; color: var(--white-55); border: 0.5px solid var(--stone); }
.qr-btn-danger    { background: rgba(226,75,74,.15); color: var(--red); border: 0.5px solid rgba(226,75,74,.3); }
.qr-btn-success   { background: rgba(109,191,126,.15); color: var(--green); border: 0.5px solid rgba(109,191,126,.3); }
.qr-btn-sm        { width: auto; padding: 7px 14px; font-size: 12px; min-height: 36px; }

/* ─── CHIPS / MULTI-SELECT ───────────────────────────────────────────────── */
.qr-chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-bottom: 12px;
}

.qr-chip {
  padding: 7px 14px;
  border: 0.5px solid var(--stone);
  border-radius: var(--radius-pill);
  font-size: 12px; color: var(--white);
  background: transparent; cursor: pointer;
  min-height: 40px; display: inline-flex; align-items: center;
  transition: all 0.15s; user-select: none;
}
.qr-chip:hover   { border-color: var(--lav); color: var(--lav); }
.qr-chip.selected {
  border-color: var(--lav); color: var(--lav);
  background: var(--lav-15);
}

/* ─── PROGRESS PIPS ──────────────────────────────────────────────────────── */
.qr-pips {
  display: flex; gap: 5px; margin-bottom: 12px;
}
.qr-pip {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--white-12);
}
.qr-pip.done   { background: var(--stone); }
.qr-pip.active { background: var(--lav); }

/* ─── CREDIT PILL ────────────────────────────────────────────────────────── */
.qr-credit-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
}
.qr-credit-pill.green { background: rgba(109,191,126,.15); color: var(--green); }
.qr-credit-pill.amber { background: rgba(232,174,30,.15);  color: var(--amber); }
.qr-credit-pill.red   { background: rgba(226,75,74,.15);   color: var(--red); }

/* ─── STATUS BADGES ──────────────────────────────────────────────────────── */
.qr-badge {
  font-size: 10px; padding: 2px 8px;
  border-radius: var(--radius-pill);
  display: inline-block;
}
.qr-badge-pending  { background: var(--lav-15);                color: var(--lav); }
.qr-badge-accepted { background: rgba(109,191,126,.12);        color: var(--green); }
.qr-badge-standby  { background: rgba(232,174,30,.12);         color: var(--amber); }
.qr-badge-expired  { background: rgba(226,75,74,.12);          color: var(--red); }
.qr-badge-draft    { background: var(--white-08);              color: var(--white-55); }
.qr-badge-sent     { background: rgba(109,191,126,.12);        color: var(--green); }

/* ─── PHOTO UPLOAD ───────────────────────────────────────────────────────── */
.qr-photo-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 8px;
}

.qr-photo-opt {
  border: 0.5px dashed var(--stone);
  border-radius: var(--radius-sm);
  padding: 16px 8px; text-align: center;
  cursor: pointer; min-height: 80px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  background: transparent; font-family: var(--font-sans);
  transition: border-color 0.15s;
}
.qr-photo-opt:hover { border-color: var(--lav); }
.qr-photo-opt i { font-size: 20px; color: var(--lav); }
.qr-photo-opt span { font-size: 12px; color: var(--white); }

.qr-preview-grid {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px;
}
.qr-preview-img {
  width: 64px; height: 64px; border-radius: var(--radius-sm);
  object-fit: cover; border: 0.5px solid var(--stone);
  position: relative;
}
.qr-preview-remove {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--red); color: var(--white);
  border: none; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}

/* ─── HINT OVERLAY ───────────────────────────────────────────────────────── */
.qr-hint-overlay {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--khaki);
  border: 0.5px solid var(--lav-35);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 18px 16px;
  animation: slideUp 0.3s ease;
}
.qr-hint-handle {
  width: 32px; height: 3px;
  background: var(--stone); border-radius: 2px;
  margin: 0 auto 12px;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* ─── MODAL / BOTTOM SHEET ───────────────────────────────────────────────── */
.qr-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(2, 3, 0, 0.88);
  display: flex; align-items: flex-end;
}
.qr-overlay.center { align-items: center; padding: 16px; }

.qr-bottom-sheet {
  background: var(--khaki);
  border: 0.5px solid var(--lav-35);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 18px 16px;
  width: 100%; max-height: 90vh; overflow-y: auto;
}

.qr-modal {
  background: var(--khaki);
  border: 0.5px solid var(--lav-35);
  border-radius: var(--radius);
  padding: 22px 18px;
  width: 100%; max-width: 360px;
}

.qr-sheet-handle {
  width: 32px; height: 3px;
  background: var(--stone); border-radius: 2px;
  margin: 0 auto 14px;
}

.qr-sheet-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 14px;
}
.qr-sheet-title {
  font-family: var(--font-serif); font-size: 17px; color: var(--white);
}
.qr-sheet-close {
  width: 32px; height: 32px; border-radius: 50%;
  border: 0.5px solid var(--stone); background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--white-55); font-size: 14px;
}

/* ─── QUOTE HEADER ───────────────────────────────────────────────────────── */
.qr-quote-header {
  background: var(--khaki);
  border-bottom: 0.5px solid var(--stone);
  padding: 20px 16px; text-align: center;
}
.qr-quote-sup {
  font-size: 10px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--lav); margin-bottom: 5px;
}
.qr-quote-name {
  font-family: var(--font-serif);
  font-size: clamp(20px, 5vw, 26px); color: var(--white);
}
.qr-quote-meta {
  font-size: 11px; color: var(--white-55); margin-top: 4px;
}

/* ─── PRICE BLOCK ────────────────────────────────────────────────────────── */
.qr-price-block {
  background: var(--khaki);
  border: 0.5px solid var(--lav-35);
  border-radius: var(--radius);
  padding: 16px; text-align: center;
  margin-bottom: 10px; position: relative; overflow: hidden;
}
.qr-price-bar {
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px; background: var(--lav);
}
.qr-price-label {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--white-55); margin-bottom: 6px;
}
.qr-price-amount {
  font-family: var(--font-serif);
  font-size: clamp(28px, 7vw, 36px); color: var(--white);
}
.qr-price-note { font-size: 12px; color: var(--white-55); margin-top: 4px; }
.qr-price-edit {
  margin-top: 8px;
}

/* ─── EXPIRY BAR ─────────────────────────────────────────────────────────── */
.qr-expiry {
  background: var(--khaki); border: 0.5px solid var(--stone);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 10px; gap: 10px;
}
.qr-expiry-lbl { font-size: 11px; color: var(--white-55); }
.qr-expiry-bar {
  height: 2px; background: var(--white-12);
  border-radius: 2px; width: 80px; margin-top: 5px;
}
.qr-expiry-fill {
  height: 2px; background: var(--lav);
  border-radius: 2px; transition: width 0.3s;
}
.qr-expiry-fill.urgent { background: var(--red); }
.qr-expiry-timer {
  font-family: var(--font-serif); font-size: 14px; color: var(--lav);
  white-space: nowrap; flex-shrink: 0;
}
.qr-expiry-timer.urgent { color: var(--red); }

/* ─── REPAIR LIST ────────────────────────────────────────────────────────── */
.qr-repair-list {
  border: 0.5px solid var(--stone);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 10px;
}
.qr-repair-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--khaki);
  border-bottom: 0.5px solid var(--stone);
}
.qr-repair-row:last-child { border-bottom: none; }
.qr-repair-row.new { border-left: 2px solid var(--lav); }
.qr-repair-row.loading { opacity: 0.6; }
.qr-repair-name { font-size: 13px; color: var(--white); }
.qr-repair-remove {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  color: var(--white-55); background: transparent; border: none;
  border-radius: var(--radius-sm); font-size: 14px;
  flex-shrink: 0;
}
.qr-repair-remove:hover { color: var(--red); }

.qr-add-repair {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; padding: 12px;
  border: 0.5px dashed var(--stone);
  border-radius: var(--radius);
  background: transparent; color: var(--lav);
  font-size: 13px; font-family: var(--font-sans);
  margin-bottom: 10px; min-height: 44px;
}
.qr-add-repair:hover { border-color: var(--lav); }

/* ─── ACTION BAR (sticky bottom) ─────────────────────────────────────────── */
.qr-action-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--khaki);
  border-top: 0.5px solid var(--stone);
  padding: 10px clamp(14px, 4vw, 20px);
  display: flex; gap: 8px; align-items: center;
}
.qr-action-primary {
  flex: 1; background: var(--lav); color: var(--black);
  border: none; border-radius: var(--radius-sm);
  padding: 10px; font-size: 12px; font-weight: 500;
  min-height: 44px; font-family: var(--font-sans);
}
.qr-action-secondary {
  flex: 1; background: transparent; color: var(--lav);
  border: 0.5px solid var(--lav); border-radius: var(--radius-sm);
  padding: 10px; font-size: 12px; min-height: 44px; font-family: var(--font-sans);
}
.qr-action-icon {
  width: 44px; height: 44px; border-radius: 50%;
  border: 0.5px solid var(--stone); background: transparent;
  display: flex; align-items: center; justify-content: center;
  color: var(--white-55); font-size: 16px; flex-shrink: 0;
}

/* ─── CHAT STYLES ────────────────────────────────────────────────────────── */
.qr-chat-topbar {
  background: var(--khaki);
  border-bottom: 0.5px solid var(--stone);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
.qr-cori-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--lav);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; color: var(--black);
  flex-shrink: 0;
}
.qr-chat-messages {
  flex: 1; padding: 12px;
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
}
.qr-bubble-ai {
  background: var(--khaki);
  border: 0.5px solid var(--stone);
  border-radius: 14px 14px 14px 3px;
  padding: 10px 13px; font-size: 13px; color: var(--white);
  max-width: 85%; line-height: 1.5;
}
.qr-bubble-user {
  background: var(--lav);
  border-radius: 14px 14px 3px 14px;
  padding: 10px 13px; font-size: 13px; color: var(--black);
  max-width: 85%; align-self: flex-end; line-height: 1.5;
}
.qr-chat-input-row {
  background: var(--khaki);
  border-top: 0.5px solid var(--stone);
  padding: 8px 10px;
  display: flex; align-items: center; gap: 6px;
}
.qr-chat-field {
  flex: 1; border: 0.5px solid var(--stone);
  border-radius: var(--radius-pill);
  padding: 8px 12px; font-size: 13px; color: var(--white);
  background: var(--black); min-height: 40px;
}
.qr-chat-field:focus { border-color: var(--lav); outline: none; }
.qr-chat-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; cursor: pointer; font-size: 16px;
}
.qr-chat-send { background: var(--lav); border: none; color: var(--black); }
.qr-chat-mic  { background: transparent; border: 0.5px solid var(--stone); color: var(--white-55); }

/* ─── DASHBOARD LAYOUT ───────────────────────────────────────────────────── */
.qr-dash-layout {
  display: flex; min-height: calc(100vh - var(--nav-h));
}
.qr-dash-sidebar {
  width: 52px; background: #010200;
  border-right: 0.5px solid var(--white-12);
  display: flex; flex-direction: column;
  padding: 10px 0; gap: 2px;
  flex-shrink: 0; position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
}
.qr-dash-logo {
  padding: 8px; display: flex;
  justify-content: center; margin-bottom: 8px;
}
.qr-dash-logo-icon {
  width: 30px; height: 30px; border-radius: 7px; overflow: hidden;
}
.qr-dash-logo-icon img { width: 100%; height: 100%; object-fit: cover; }
.qr-dash-item {
  min-height: 44px; display: flex;
  justify-content: center; align-items: center;
  color: var(--stone); font-size: 17px; cursor: pointer;
  width: 100%; background: transparent; border: none;
  position: relative;
}
.qr-dash-item:hover, .qr-dash-item.active { color: var(--lav); }
.qr-dash-divider {
  height: 0.5px; background: var(--white-12); margin: 4px 8px;
}
.qr-dash-badge {
  position: absolute; top: 8px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--lav);
}
.qr-dash-main {
  flex: 1; padding: clamp(14px, 3vw, 20px);
  overflow-y: auto;
}
.qr-dash-title {
  font-family: var(--font-serif);
  font-size: clamp(17px, 4vw, 22px); color: var(--white);
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
}

/* Dashboard stats grid */
.qr-stats-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-bottom: 14px;
}
.qr-stat-card {
  background: var(--khaki); border: 0.5px solid var(--stone);
  border-radius: var(--radius); padding: 11px;
}
.qr-stat-label {
  font-size: 11px; font-weight: 500; color: var(--white-55); margin-bottom: 5px;
}
.qr-stat-value {
  font-family: var(--font-serif); font-size: clamp(20px, 5vw, 24px); color: var(--white);
}
.qr-stat-sub { font-size: 10px; color: var(--white-55); margin-top: 2px; }

/* Dashboard table */
.qr-dash-table-header {
  display: flex; justify-content: space-between;
  padding: 0 0 7px; border-bottom: 0.5px solid var(--white-12);
  margin-bottom: 6px;
}
.qr-dash-th {
  font-size: 10px; font-weight: 600; color: var(--white-55);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.qr-dash-row {
  display: flex; justify-content: space-between;
  align-items: center; padding: 9px 0;
  border-bottom: 0.5px solid var(--white-12);
}
.qr-dash-row-name { font-size: 12px; color: var(--white); }
.qr-dash-row-sub  { font-size: 10px; color: var(--white-55); }

/* Push notification banners */
.qr-push-banner {
  background: var(--khaki); border: 0.5px solid var(--lav-35);
  border-radius: var(--radius); padding: 12px 14px;
  margin-bottom: 8px; display: flex; gap: 10px; align-items: flex-start;
}
.qr-push-icon {
  width: 34px; height: 34px; border-radius: 8px;
  background: var(--lav);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 15px; color: var(--black);
}
.qr-push-title { font-size: 13px; font-weight: 500; color: var(--white); margin-bottom: 2px; }
.qr-push-body  { font-size: 12px; color: var(--white-55); line-height: 1.4; }
.qr-push-time  { font-size: 10px; color: var(--white-55); margin-top: 3px; }

/* ─── LOADING STATES ─────────────────────────────────────────────────────── */
.qr-loading-dots {
  display: flex; gap: 4px; align-items: center; padding: 4px 0;
}
.qr-loading-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lav); animation: qr-pulse 1.2s ease-in-out infinite;
}
.qr-loading-dot:nth-child(2) { animation-delay: 0.2s; }
.qr-loading-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes qr-pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}

.qr-spinner {
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid var(--white-12);
  border-top-color: var(--lav);
  animation: qr-spin 0.8s linear infinite;
}
@keyframes qr-spin { to { transform: rotate(360deg); } }

/* ─── TOAST NOTIFICATIONS ────────────────────────────────────────────────── */
#qr-toast-container {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column;
  align-items: center; gap: 8px; pointer-events: none;
}
.qr-toast {
  background: var(--khaki); border: 0.5px solid var(--stone);
  border-radius: var(--radius-sm); padding: 10px 16px;
  font-size: 13px; color: var(--white);
  display: flex; align-items: center; gap: 8px;
  animation: qr-toast-in 0.25s ease, qr-toast-out 0.25s ease 2.75s forwards;
  pointer-events: auto; white-space: nowrap;
}
.qr-toast.success { border-color: rgba(109,191,126,.35); }
.qr-toast.error   { border-color: rgba(226,75,74,.35); }
.qr-toast i.success { color: var(--green); }
.qr-toast i.error   { color: var(--red); }

@keyframes qr-toast-in  { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }
@keyframes qr-toast-out { from { opacity:1; } to { opacity:0; } }

/* ─── LANDING PAGE SPECIFIC ──────────────────────────────────────────────── */
.qr-landing-body { background: var(--black); }

.qr-hero {
  padding: clamp(60px, 10vw, 100px) clamp(20px, 5vw, 60px);
  text-align: center; max-width: 800px; margin: 0 auto;
}
.qr-hero-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 7vw, 64px); color: var(--white);
  line-height: 1.1; margin-bottom: 20px;
}
.qr-hero-title span { color: var(--lav); }
.qr-hero-sub {
  font-size: clamp(15px, 2.5vw, 18px); color: var(--white-55);
  line-height: 1.7; margin-bottom: 36px;
  max-width: 560px; margin-left: auto; margin-right: auto;
}
.qr-hero-btns {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}
.qr-hero-btn-primary {
  background: var(--lav); color: var(--black); border: none;
  border-radius: 10px; padding: 14px 28px; font-size: 15px; font-weight: 500;
  min-height: 50px; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); cursor: pointer;
}
.qr-hero-btn-secondary {
  background: transparent; color: var(--lav); border: 0.5px solid var(--lav);
  border-radius: 10px; padding: 13px 28px; font-size: 15px;
  min-height: 50px; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); cursor: pointer;
}
.qr-get-app-links {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 14px;
}
.qr-store-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--khaki); border: 0.5px solid var(--stone);
  border-radius: var(--radius-sm); padding: 8px 16px;
  font-size: 12px; color: var(--white-55);
  cursor: pointer; font-family: var(--font-sans);
}
.qr-store-btn:hover { border-color: var(--lav); color: var(--lav); }
.qr-store-btn i { font-size: 16px; }

/* Pricing */
.qr-pricing-section {
  background: rgba(54, 49, 31, 0.25);
  border-top: 0.5px solid var(--stone);
  border-bottom: 0.5px solid var(--stone);
  padding: clamp(60px, 8vw, 90px) clamp(20px, 5vw, 60px);
}
.qr-pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-top: 40px;
}
.qr-plan {
  background: var(--khaki); border: 0.5px solid var(--stone);
  border-radius: 14px; padding: 28px; position: relative;
  display: flex; flex-direction: column;
}
.qr-plan.featured { border-color: var(--lav); }
.qr-plan-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--lav); color: var(--black);
  font-size: 11px; font-weight: 500; padding: 3px 14px;
  border-radius: var(--radius-pill); white-space: nowrap;
}
.qr-plan-name {
  font-size: 12px; font-weight: 600; color: var(--lav);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 10px;
}
.qr-plan-price {
  font-family: var(--font-serif); font-size: 38px; color: var(--white);
  margin-bottom: 4px; line-height: 1;
}
.qr-plan-price sup { font-size: 18px; font-family: var(--font-sans); }
.qr-plan-price sub { font-size: 15px; color: var(--white-55); font-family: var(--font-sans); }
.qr-plan-credits { font-size: 13px; color: var(--lav); font-weight: 500; margin-bottom: 4px; }
.qr-plan-sub { font-size: 12px; color: var(--white-55); margin-bottom: 14px; line-height: 1.5; }
.qr-plan-divider { height: 0.5px; background: var(--stone); margin-bottom: 14px; }
.qr-plan-signup-offer {
  background: var(--lav-15); border: 0.5px solid var(--lav-35);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 12px; color: var(--white-55); line-height: 1.5; margin-bottom: 14px;
}
.qr-plan-signup-offer strong { color: var(--lav); }
.qr-plan-features { display: flex; flex-direction: column; gap: 9px; flex: 1; margin-bottom: 20px; }
.qr-plan-feature {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: var(--white-55); line-height: 1.4;
}
.qr-plan-feature i { font-size: 13px; color: var(--lav); flex-shrink: 0; margin-top: 1px; }
.qr-plan-feature.dim { color: rgba(244,242,238,0.3); }
.qr-plan-feature.dim i { color: var(--stone); }
.qr-plan-btn-wrap { margin-top: auto; }

/* ─── PROFILE PAGE ───────────────────────────────────────────────────────── */
.qr-profile-avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--lav-15); border: 0.5px solid var(--lav-35);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 20px; color: var(--lav);
  flex-shrink: 0;
}

/* ─── LOGIN PAGE ─────────────────────────────────────────────────────────── */
.qr-login-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
}
.qr-login-logo {
  width: 54px; height: 54px; border-radius: 12px; overflow: hidden;
  margin: 0 auto 16px;
}
.qr-login-logo img { width: 100%; height: 100%; object-fit: cover; }
.qr-login-title {
  font-family: var(--font-serif); font-size: 22px; color: var(--white);
  text-align: center; margin-bottom: 5px;
}
.qr-login-sub {
  font-size: 13px; color: var(--white-55); text-align: center; margin-bottom: 24px;
}
.qr-login-card {
  background: var(--khaki); border: 0.5px solid var(--stone);
  border-radius: var(--radius); padding: 22px;
  width: 100%; max-width: 320px;
}

/* ─── 2FA CODE INPUTS ────────────────────────────────────────────────────── */
.qr-code-inputs {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 16px;
}
.qr-code-input {
  width: 40px; height: 48px; border-radius: var(--radius-sm);
  border: 0.5px solid var(--stone); background: rgba(255,255,255,.06);
  font-size: 20px; font-weight: 500; color: var(--white);
  text-align: center; font-family: var(--font-sans);
}
.qr-code-input:focus { border-color: var(--lav); outline: none; }
.qr-code-input.filled { border-color: var(--lav); background: var(--lav-15); }

/* ─── UTILITY ────────────────────────────────────────────────────────────── */
.qr-divider {
  height: 0.5px; background: var(--white-12); margin: 14px 0;
}

.qr-text-center { text-align: center; }
.qr-text-muted  { color: var(--white-55); font-size: 12px; }
.qr-text-lav    { color: var(--lav); }
.qr-text-green  { color: var(--green); }
.qr-text-red    { color: var(--red); }

.qr-flex-between {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.qr-flex-center {
  display: flex; align-items: center; justify-content: center; gap: 8px;
}

.qr-mb-8  { margin-bottom: 8px; }
.qr-mb-12 { margin-bottom: 12px; }
.qr-mb-16 { margin-bottom: 16px; }
.qr-mt-8  { margin-top: 8px; }
.qr-mt-12 { margin-top: 12px; }
.qr-mt-16 { margin-top: 16px; }

/* ─── PRINT STYLES ───────────────────────────────────────────────────────── */
@media print {
  .qr-nav, .qr-action-bar, .qr-btn, .qr-chat-input-row { display: none !important; }
  body { background: white; color: black; }
  .qr-card, .qr-price-block, .qr-repair-list { border-color: #ccc; background: white; }
  .qr-white { color: black; }
}

/* ─── REDUCED MOTION ─────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ─── BACK BUTTON ────────────────────────────────────────────────────────── */
.qr-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none;
  color: var(--white-55); font-size: 13px;
  font-family: var(--font-sans); cursor: pointer;
  padding: 10px 0; min-height: 44px;
  margin-bottom: 4px;
}
.qr-back-btn:hover { color: var(--lav); }

/* ─── BOTTOM NAV BAR (mobile) ────────────────────────────────────────────── */
.qr-bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: rgba(2,3,0,0.97);
  border-top: 0.5px solid var(--white-12);
  display: flex; align-items: center; justify-content: space-around;
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
  backdrop-filter: blur(8px);
}
.qr-bottom-nav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 16px; min-width: 60px; min-height: 44px;
  background: transparent; border: none; cursor: pointer;
  color: var(--stone); font-size: 10px; font-family: var(--font-sans);
  justify-content: center;
}
.qr-bottom-nav-item i { font-size: 20px; }
.qr-bottom-nav-item.active { color: var(--lav); }
.qr-bottom-nav-item:hover { color: var(--lav); }

/* ─── RESPONSIVE: BOTTOM NAV — TABLET & SMALLER ONLY ────────────────────── */

/* Hide bottom nav on desktop (1025px+) */
@media (min-width: 1025px) {
  .qr-bottom-nav { display: none !important; }
  /* Remove bottom padding reserved for bottom nav on desktop */
  .qr-page { padding-bottom: 40px !important; }
  body { padding-bottom: 0 !important; }
}

/* Show bottom nav on tablet and smaller */
@media (max-width: 1024px) {
  .qr-bottom-nav { display: flex; }
  .qr-page { padding-bottom: 100px; }
}

/* ─── DESKTOP LAYOUT ENHANCEMENTS ────────────────────────────────────────── */

@media (min-width: 1025px) {
  /* Wider content on desktop */
  .qr-page {
    max-width: 680px;
    padding: 32px clamp(24px, 4vw, 48px) 40px;
  }

  /* Larger card padding on desktop */
  .qr-card {
    padding: 22px 24px;
  }

  /* Larger headings */
  .qr-heading {
    font-size: 32px;
  }

  /* Two-column layout for wizard steps on desktop */
  .qr-chips {
    gap: 8px;
  }
  .qr-chip {
    padding: 9px 18px;
    font-size: 13px;
  }

  /* Desktop nav enhancements */
  .qr-nav {
    height: 68px;
    padding: 0 clamp(24px, 5vw, 64px);
  }
  .qr-nav-logo-name {
    font-size: 20px;
  }
  .qr-nav-link {
    font-size: 14px;
  }
  .qr-nav-cta {
    padding: 10px 22px;
    font-size: 14px;
  }

  /* Desktop: show hamburger never */
  .qr-hamburger { display: none !important; }
  .qr-nav-links { display: flex !important; }

  /* Dashboard gets more space on desktop */
  .qr-dash-sidebar {
    width: 64px;
  }
  .qr-dash-main {
    padding: 24px 32px;
    max-width: 900px;
  }
  .qr-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .qr-dash-title {
    font-size: 24px;
    margin-bottom: 20px;
  }

  /* Landing page desktop improvements */
  .qr-hero {
    padding: 100px 60px 80px;
  }
  .qr-hero-title {
    font-size: 68px;
  }
  .qr-hero-btn-primary,
  .qr-hero-btn-secondary {
    padding: 16px 36px;
    font-size: 16px;
    min-height: 56px;
  }

  /* Pricing grid: 3 columns on desktop */
  .qr-pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  /* Quote result page wider on desktop */
  #quote-main {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 32px 60px;
  }

  /* Buttons larger on desktop */
  .qr-btn {
    min-height: 48px;
    font-size: 14px;
  }
  .qr-btn-sm {
    min-height: 38px;
    font-size: 13px;
  }

  /* Modals/sheets wider on desktop */
  .qr-bottom-sheet {
    max-width: 560px;
    margin: 0 auto;
    border-radius: var(--radius);
  }
  .qr-overlay {
    align-items: center;
    padding: 24px;
  }
  .qr-overlay .qr-bottom-sheet {
    border-radius: var(--radius);
  }

  /* Login pages centered with max width */
  .qr-login-wrap {
    max-width: 420px;
    margin: 0 auto;
  }
  .qr-login-card {
    max-width: 100%;
  }
}

/* ─── TABLET (641px–1024px) ──────────────────────────────────────────────── */

@media (min-width: 641px) and (max-width: 1024px) {
  .qr-page {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 24px 100px;
  }
  .qr-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .qr-chips {
    gap: 8px;
  }
  .qr-pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .qr-hero-title {
    font-size: 48px;
  }
}

/* ─── SMALL MOBILE (up to 380px) ─────────────────────────────────────────── */

@media (max-width: 380px) {
  .qr-heading { font-size: 20px; }
  .qr-chip { padding: 6px 10px; font-size: 11px; }
  .qr-nav-logo-name { font-size: 14px; }
  .qr-code-input { width: 34px; height: 44px; font-size: 16px; }
  .qr-bottom-nav-item { padding: 6px 10px; font-size: 9px; }
  .qr-bottom-nav-item i { font-size: 18px; }
}
