/* Direction: MARKEETO corporate — deep navy, signal yellow, white paper, Poppins throughout */
/* Completed by the platform from the short form: both modes, every
   palette token, each text-on-ground pair at its floor. To restyle, write the
   short form again (the decisions in one :root) and it is completed again. */

:root {
  --canvas: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #e7eaee;
  --border: #dde2ea;
  --border-strong: #aab0b9;
  --ink: #001026;
  --muted: #5b6472;
  --accent: #fecf67;
  --accent-hover: #d8b058;
  --accent-ink: #001026;
  --accent-text: #8a5a00;
  --accent-strong: #836a35;
  --accent-soft: #fff3d6;
  --accent-border: #f8e4b7;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #d8e7e2;
  --success-strong: #116d34;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #ebe2db;
  --warning-strong: #994607;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #ecdbde;
  --danger-strong: #b91c1c;
  --chart-1: #ad841c;
  --chart-2: #4e9a52;
  --chart-3: #0a838d;
  --chart-4: #648adb;
  --chart-5: #95539a;
  --chart-6: #d67069;

  --font-display: "Poppins", system-ui, sans-serif;
  --font-body: "Poppins", system-ui, sans-serif;
  --display-weight: 600;
  --radius-card: 14px;
  --radius-btn: 10px;
  --radius-input: 10px;
  --x-navy: #001026;
  --x-yellow: #fecf67;
  --x-on-photo: #ffffff;
  --x-paper: #ffffff;
  --x-soft: #f5f7fa;
  --x-line: #e3e7ee;
  --x-grey: #4a5463;
  --font-mono: "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: "Poppins", system-ui, sans-serif;
  --display-tracking: -0.02em;
  --eyebrow-tracking: 0.08em;
}

html[data-theme="dark"] {
  --canvas: #00070e;
  --surface: #1a2026;
  --surface-2: #0d131a;
  --border: #242a30;
  --border-strong: #4d5156;
  --ink: #f3f5f8;
  --muted: #92969a;
  --accent: #fecf67;
  --accent-hover: #fed67e;
  --accent-ink: #001026;
  --accent-text: #fecf67;
  --accent-strong: #fecf67;
  --accent-soft: #383322;
  --accent-border: #726136;
  --success: #15803d;
  --success-ink: #ffffff;
  --success-soft: #052218;
  --success-strong: #499c68;
  --warning: #b45309;
  --warning-ink: #ffffff;
  --warning-soft: #28180d;
  --warning-strong: #c57a40;
  --danger: #b91c1c;
  --danger-ink: #ffffff;
  --danger-soft: #290c11;
  --danger-strong: #cd5c5c;
  --chart-1: #fecf67;
  --chart-2: #84d487;
  --chart-3: #1bd4e5;
  --chart-4: #b4b5ff;
  --chart-5: #f496cf;
  --chart-6: #f08d64;
}

/* MARKEETO quotation app — responsive tables and the quotation document */

/* ---------- Stacked tables (builder items, history, clients) ---------- */
.stack-table { width: 100%; border-collapse: collapse; }
.stack-table th { @apply text-left text-xs font-medium uppercase tracking-wider text-muted px-2 py-2; }
.stack-table td { @apply px-2 py-2 align-top border-b border-border; }
.stack-table .num { text-align: right; }
@media (max-width: 767px) {
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table thead { display: none; }
  .stack-table tr { @apply py-3 border-b border-border; }
  .stack-table td { @apply border-b-0 px-0 py-1; }
  .stack-table td[data-label]::before { @apply text-xs text-muted block mb-1; content: attr(data-label); }
  .stack-table .num { text-align: left; }
}

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

/* ---------- The quotation document (screen + PDF) ---------- */
#quote-stage { max-width: 210mm; margin-left: auto; margin-right: auto; }
.qdoc {
  background: var(--x-paper);
  color: var(--x-navy);
  font-family: "Poppins", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.55;
  border-radius: 8px;
  box-shadow: 0 12px 44px rgba(0, 0, 0, 0.14);
}
.qdoc * { box-sizing: border-box; }
.qd-head {
  background: var(--x-navy);
  color: var(--x-on-photo);
  padding: 30px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 4px solid var(--x-yellow);
  border-radius: 8px 8px 0 0;
  break-inside: avoid;
}
.qd-title { min-width: 0; }
.qd-bar { display: block; width: 44px; height: 4px; background: var(--x-yellow); border-radius: 2px; margin-bottom: 14px; }
.qd-eyebrow { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--x-yellow); font-weight: 500; margin: 0 0 6px; }
.qdoc .qd-h1 { font-size: clamp(1.7rem, 5vw, 2.7rem); font-weight: 600; line-height: 1.1; margin: 0; letter-spacing: -0.01em; color: var(--x-on-photo); overflow-wrap: anywhere; }
.qd-no { margin: 10px 0 0; font-size: 12px; opacity: 0.85; }
.qd-no strong { color: var(--x-yellow); font-weight: 600; }
.qd-logo { width: clamp(110px, 26%, 210px); height: auto; flex: none; margin: -18px -18px -18px 0; }
.qd-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px 24px;
  padding: 16px 36px;
  background: var(--x-soft);
  border-bottom: 1px solid var(--x-line);
  break-inside: avoid;
}
.qd-meta span { display: block; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--x-grey); }
.qd-meta strong { font-weight: 600; font-size: 13px; }
.qd-body { padding: 30px 36px 34px; }
.qd-sec { margin-top: 26px; }
.qd-sec:first-child { margin-top: 0; }
.qdoc .qd-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: var(--x-navy);
  margin: 0 0 10px; padding-left: 10px; border-left: 3px solid var(--x-yellow); line-height: 1.2;
  break-after: avoid; page-break-after: avoid;
}
.qd-client-name { font-size: 18px; font-weight: 600; margin: 0 0 2px; }
.qd-p { margin: 2px 0; color: var(--x-grey); white-space: pre-line; overflow-wrap: anywhere; }
.qd-table-wrap { overflow-x: auto; }
.qd-table { width: 100%; border-collapse: collapse; }
.qd-table thead { display: table-header-group; }
.qd-table th { background: var(--x-navy); color: var(--x-on-photo); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; padding: 10px 12px; text-align: left; }
.qd-table td { padding: 11px 12px; border-bottom: 1px solid var(--x-line); vertical-align: top; }
.qd-table tr { break-inside: avoid; page-break-inside: avoid; }
.qd-table tbody tr:nth-child(even) td { background: var(--x-soft); }
.qd-table .r { text-align: right; white-space: nowrap; }
.qd-table .idx { width: 34px; color: var(--x-grey); }
.qd-table td.desc { white-space: pre-line; overflow-wrap: anywhere; min-width: 160px; }
.qd-table td.amt { font-weight: 600; }
.qd-totals { margin: 18px 0 0 auto; width: min(100%, 350px); break-inside: avoid; page-break-inside: avoid; }
.qd-totals .row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 12px; border-bottom: 1px solid var(--x-line); }
.qd-totals .row span { color: var(--x-grey); }
.qd-grand {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--x-navy); color: var(--x-on-photo); padding: 14px 16px; margin-top: 10px;
  border-radius: 6px; border-left: 5px solid var(--x-yellow);
}
.qd-grand span { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; }
.qd-grand strong { color: var(--x-yellow); font-size: 22px; font-weight: 700; line-height: 1.1; text-align: right; }
.qd-text p { margin: 0 0 6px; overflow-wrap: anywhere; break-inside: avoid; page-break-inside: avoid; }
.qd-foot {
  margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--x-line);
  display: flex; justify-content: space-between; gap: 12px; color: var(--x-grey); font-size: 11px;
  break-inside: avoid; page-break-inside: avoid;
}
.qd-foot strong { color: var(--x-navy); font-weight: 600; }

/* ---------- Print: the preview itself is the PDF source ---------- */
@media print {
  .no-print, #toasts, .toast-region { display: none !important; }
  html, body { background: none !important; min-height: 0 !important; }
  #quote-stage, main { max-width: none !important; margin: 0 !important; padding: 0 !important; }
  .qdoc { box-shadow: none; border-radius: 0; font-size: 12px; }
  .qd-head { border-radius: 0; }
  .qd-body { padding: 24px 0 0; }
  .qd-meta { padding-left: 36px; padding-right: 36px; }
  .qd-table-wrap { overflow: visible; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
