/* Fonts are bundled in vendor/fonts (Inter and JetBrains Mono, SIL Open Font
   License — see the LICENSE files there), so the app needs no internet and
   sends nothing to Google. Latin characters; other scripts use system fonts. */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("vendor/fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("vendor/fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("vendor/fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url("vendor/fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url("vendor/fonts/inter-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("vendor/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("vendor/fonts/jetbrains-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  color-scheme: light;
  --bg-color: #f8fafc;
  --bg-gradient-start: #f8fafc;
  --bg-gradient-end: #e2e8f0;

  --panel: #ffffff;
  --surface: #f1f5f9;
  --surface-hover: #e2e8f0;
  --surface-active: #cbd5e1;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent: #f97316;
  --accent-hover: #ea580c;
  --accent-soft: rgba(249, 115, 22, 0.15);
  --accent-glow: rgba(249, 115, 22, 0.2);

  --border: rgba(0, 0, 0, 0.1);
  --border-light: rgba(0, 0, 0, 0.05);

  --success: #059669;
  --danger: #dc2626;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px var(--accent-glow);

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg-color: #030712;
  --bg-gradient-start: #030712;
  --bg-gradient-end: #0f172a;

  --panel: #0f172a;
  --surface: #1e293b;
  --surface-hover: #334155;
  --surface-active: #475569;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.15);

  --success: #10b981;
  --danger: #ef4444;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 13.5px;
}

html, body {
  min-height: 100vh;
  background-color: var(--bg-color);
  background-image:
    radial-gradient(circle at 15% 0%, rgba(249, 115, 22, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 100%, rgba(14, 165, 233, 0.08) 0%, transparent 40%),
    linear-gradient(180deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  padding: clamp(10px, 1.5vw, 18px);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 2px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 3px;
}

/* Utilities */
.hidden { display: none !important; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-12 { margin-top: 12px; }
.mt-8 { margin-top: 8px; }
.mt-4 { margin-top: 4px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.pt-16 { padding-top: 16px; }
.border-top { border-top: 1px solid var(--border); }
.full-width { width: 100%; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.form-group-vertical { display: flex; flex-direction: column; gap: 16px; }
.form-actions { display: flex; gap: 12px; }

/* Layout */
/* Fluid: uses the whole window (capped only on ultra-wide screens). */
.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  width: 100%;
  max-width: 2560px;
  margin: 0 auto;
  min-height: calc(100vh - 36px);
}

/* Topbar */
.topbar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  box-shadow: var(--shadow-sm);
}

.brand-panel {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), #fb923c);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.brand-title {
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.15;
}

/* Navigation */
.action-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  flex-wrap: wrap;
  gap: 2px;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 3px 4px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 9999px;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
  border-color: transparent;
}

.nav-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.icon-btn.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.theme-toggle {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  padding: 5px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--transition-fast);
}

.theme-toggle:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
  border-color: transparent;
}

/* Status Panel */
.status-panel {
  text-align: left;
  width: clamp(130px, 14vw, 220px);
  min-width: 0;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}

.status-panel p:first-child {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 1px;
}

.status-panel #statusPanel {
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Main Content Area */
.main-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tab-panel {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Headers */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  padding: 0 8px;
}

.quote-header {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.05), var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

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

/* Cards */
.card,
.section-card,
.result-card,
.history-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  margin-bottom: 24px;
}

.card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.card-header-simple h3 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.card-header-simple h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.result-header h3 {
  font-size: 1.25rem;
  margin: 0;
}

/* Grids */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

.financial-params-card .inventory-table-wrap td:nth-child(2) input {
  width: 100%;
  max-width: 100%;
}

/* Inline "estimate weight" helper inside drawer forms */
.form-group-vertical details {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.form-group-vertical details summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
}
.form-group-vertical details[open] summary {
  margin-bottom: 4px;
}

/* Financial Parameters: search bar */
.fin-search-wrap {
  position: relative;
  margin-bottom: 20px;
}
.fin-search-input {
  width: 100%;
  padding-left: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}

/* Financial Parameters: sectioned layout */
.fin-sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.fin-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px 20px;
  transition: border-color 0.15s ease;
}
.fin-section:hover {
  border-color: var(--accent);
}
.fin-section-wide {
  grid-column: 1 / -1;
}
.fin-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.fin-section-header h4 {
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.fin-section-header h4::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}
.fin-section-icon {
  font-size: 1rem;
  line-height: 1;
}
.fin-section-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  background: var(--surface-hover);
  padding: 2px 10px;
  border-radius: 999px;
}
/* Financial Parameters field tables use the same plain, clean table as
   Extra Fee Line Items (.inventory-table-wrap default styling below) —
   no per-section override needed. Just keep the search-filter hook. */
.fin-row-hidden {
  display: none;
}

/* Type: a plain, non-interactive label — most fields only ever have one
   valid unit, so a dropdown with a single option was misleading. Colored
   by kind so the Value column is easy to scan at a glance. */
.fin-type-badge {
  display: inline-block;
  min-width: 64px;
  text-align: center;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.fin-type-badge.fin-type-kes {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success, #059669);
}
.fin-type-badge.fin-type-pct {
  background: var(--accent-soft, rgba(249, 115, 22, 0.12));
  color: var(--accent-hover, var(--accent));
}
.fin-type-badge.fin-type-weight {
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}
.fin-type-badge.fin-type-number {
  background: rgba(100, 116, 139, 0.15);
  color: var(--text-secondary);
}

/* Financial Parameters / flat name lists ("Component Categories", "Printer
   Accessory Categories", "Category Component Kits") render as a compact
   2-column grid of full-length label/value rows — each field is its own
   div (not a table row), with a thin bottom border instead of a full box,
   so a section fills its available width without feeling like separate
   tiled cards. */
.fin-list-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 28px;
}
.fin-list-grid.fin-list-single-col {
  grid-template-columns: 1fr;
}
.fin-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.fin-list-grid > .fin-list-row:last-child,
.fin-list-grid > .fin-list-row:nth-last-child(2):nth-child(odd) {
  border-bottom: none;
}
.fin-list-label {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.88rem;
  flex-shrink: 0;
}
.fin-list-label .help-text {
  font-weight: 400;
  margin-top: 2px;
}
.fin-list-value {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  justify-content: flex-end;
}
.fin-list-value input {
  width: 100%;
}
.fin-list-value .fin-type-badge {
  flex-shrink: 0;
}
@media (max-width: 640px) {
  .fin-list-grid {
    grid-template-columns: 1fr;
  }
}

/* Slide-in drawer used for Add/Edit Part and Add/Edit Accessory — a real
   overlay + panel (not a full page navigation) so linking a part or
   accessory to a printer doesn't lose your place. */
.app-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-fast);
}
.app-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.app-drawer-panel {
  width: min(460px, 100%);
  height: 100%;
  background: var(--surface);
  box-shadow: -12px 0 32px rgba(15, 23, 42, 0.18);
  transform: translateX(24px);
  transition: transform var(--transition-fast);
  overflow-y: auto;
  padding: 24px;
}
.app-drawer-overlay.open .app-drawer-panel {
  transform: translateX(0);
}
.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.drawer-header h2 {
  margin: 0;
}
.drawer-close-btn {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.drawer-close-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
@media (max-width: 640px) {
  .app-drawer-panel {
    width: 100%;
  }
}

.quote-layout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}

/* Quote tab. Narrow: one column. Medium: inputs | result (the result stays in
   view while you scroll the inputs). Wide (≥1700px): the inputs split into two
   columns so a big screen is actually used — Job Details + Parts | Components,
   fees + discounts | result. */
.quote-input-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  min-width: 0;
}

.quote-input-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.quote-result-col { min-width: 0; }

@media (min-width: 1024px) {
  .quote-layout-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  .quote-result-col {
    position: sticky;
    top: 16px;
    align-self: start;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
  }
}

@media (min-width: 1700px) {
  .quote-layout-grid {
    grid-template-columns: minmax(0, 2fr) minmax(420px, 1fr);
  }
  .quote-input-col {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

.settings-grid,
.inventory-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 1024px) {
  .settings-grid {
    grid-template-columns: 1.2fr 1fr;
  }
  .inventory-grid {
    grid-template-columns: 1.5fr 1fr;
  }
}

/* Forms & Inputs */
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

input,
select,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition-fast);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--text-muted);
  background: var(--surface-hover);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}

textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.4;
}

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
  padding-right: 40px;
}

select option {
  background: var(--panel);
  color: var(--text-primary);
}

input[type="number"] {
  font-family: "JetBrains Mono", monospace;
}

/* Buttons */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  font-size: 0.95rem;
}

button:active { transform: scale(0.98); }
button:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

button.primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 6px 16px rgba(249, 115, 22, 0.3);
  transform: translateY(-1px);
}

button.secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-primary);
}

button.secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--text-muted);
}

button.tertiary {
  background: transparent;
  color: var(--text-secondary);
}

button.tertiary:hover:not(:disabled) {
  background: var(--surface);
  color: var(--text-primary);
}

/* Results & Breakdowns */
.result-area {
  min-height: 200px;
}

.result-summary {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), var(--surface));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  text-align: center;
}

.result-summary h3 {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.summary-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.2;
  margin-bottom: 8px;
  font-family: "JetBrains Mono", monospace;
  text-shadow: 0 2px 10px rgba(249, 115, 22, 0.1);
}

.result-summary p:last-child {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

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

.result-grid div {
  background: var(--surface);
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  text-align: center;
}

.result-grid strong {
  display: block;
  color: var(--text-secondary);
  margin-bottom: 4px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.breakdown {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.breakdown table,
.history-table-wrap table,
.inventory-table-wrap table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.breakdown th,
.breakdown td,
.history-table-wrap th,
.history-table-wrap td,
.inventory-table-wrap th,
.inventory-table-wrap td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.breakdown th,
.history-table-wrap th,
.inventory-table-wrap th {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface);
}

.breakdown th:first-child,
.history-table-wrap th:first-child,
.inventory-table-wrap th:first-child { border-top-left-radius: var(--radius-md); }
.breakdown th:last-child,
.history-table-wrap th:last-child,
.inventory-table-wrap th:last-child { border-top-right-radius: var(--radius-md); }

.breakdown td,
.history-table-wrap td,
.inventory-table-wrap td {
  font-size: 0.95rem;
  color: var(--text-primary);
  background: var(--surface);
}

.breakdown tr:hover td,
.history-table-wrap tr:hover td,
.inventory-table-wrap tr:hover td {
  background: var(--surface-hover);
}

.history-table-wrap th.sortable-th:hover {
  color: var(--accent);
}

.history-filter-bar select,
.history-filter-bar input[type="date"] {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.breakdown td:last-child {
  text-align: right;
  font-weight: 500;
  font-family: "JetBrains Mono", monospace;
}

/* Financial Summary's closing total row (Job Details) — visually closes
   out the Subtotal → VAT → Fees reading with a distinct, bolder row
   rather than just trailing off after the last fee line. */
.financial-summary-table .financial-summary-total-row td {
  border-top: 2px solid var(--border-light);
  border-bottom: none;
  background: var(--accent-soft);
  font-weight: 700;
  color: var(--text-primary);
  padding-top: 12px;
  padding-bottom: 12px;
}
.financial-summary-table .financial-summary-total-row td:last-child {
  color: var(--accent);
  font-size: 1.02rem;
}
.financial-summary-table .financial-summary-total-row:hover td {
  background: var(--accent-soft);
}

/* History */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.history-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.history-summary-grid div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
}

.history-summary-grid span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.history-summary-grid strong {
  display: block;
  font-size: 1.25rem;
  color: var(--text-primary);
  font-family: "JetBrains Mono", monospace;
}

/* Helpers */
.help-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
  display: block;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  background: var(--surface);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-light);
  font-style: italic;
}

/* Add/Edit form pages (materials, printers, customers, etc.) — these were
   previously slide-out drawers; they're now full pages using the same
   tab-panel mechanism as Job Details, so the fields get a comfortable
   reading width instead of stretching across the whole screen. */
.tab-panel .form-group-vertical {
  max-width: 640px;
}
/* Opt-out for forms living inside a .fin-section card (or any other
   already-constrained container) — the 640px cap above is meant for
   long single-column reading forms; inside a narrower card it just
   leaves dead space on the right, so cards that already bound their
   own width (see .fin-sections) mark their inner form as "wide" to
   let fields use the card's full width instead of a second, smaller
   cap on top of it. */
.tab-panel .form-group-vertical.form-wide {
  max-width: none;
}

.page-back-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Responsive */
/* Header: brand | nav | status on one row while it fits; below that the
   nav takes the full second row. */
@media (max-width: 1320px) {
  .topbar { grid-template-columns: auto minmax(0, 1fr); }
  .action-nav { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; }
  .status-panel { width: auto; max-width: 340px; justify-self: end; }
}
@media (max-width: 720px) {
  .topbar { grid-template-columns: 1fr; }
  .status-panel { justify-self: stretch; max-width: none; }
  .brand-panel { justify-content: flex-start; }
}

@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4, .result-grid, .history-summary-grid { grid-template-columns: 1fr; }
  .fin-sections { grid-template-columns: 1fr; }
  .header-actions { width: 100%; justify-content: stretch; }
  .header-actions button { flex: 1; }
  .action-nav { flex-wrap: wrap; justify-content: center; }
}

/* Print styles */
/* Job Details page */
.job-overview-card {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.06), var(--panel));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.job-overview-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.job-overview-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
}

.job-overview-customer {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.status-pill.status-draft {
  background: var(--surface-hover);
  color: var(--text-secondary);
  border-color: var(--border);
}
.status-pill.status-quote_sent {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.25);
}
[data-theme="dark"] .status-pill.status-quote_sent { color: #60a5fa; }
.status-pill.status-printing {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(249, 115, 22, 0.3);
}
.status-pill.status-completed {
  background: rgba(5, 150, 105, 0.12);
  color: var(--success);
  border-color: rgba(5, 150, 105, 0.25);
}
.status-pill.status-invoiced {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
  border-color: rgba(147, 51, 234, 0.25);
}
[data-theme="dark"] .status-pill.status-invoiced { color: #c084fc; }

.job-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.job-stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.job-stat-tile .stat-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.job-stat-tile .stat-value {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: "JetBrains Mono", monospace;
}

.job-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.job-section-title h3 {
  margin: 0;
}

.job-count-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
}

.job-part-card {
  margin-bottom: 12px;
  list-style-type: none;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
}
.job-part-card:hover { border-color: var(--border-light); }

.job-part-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.job-part-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  flex-shrink: 0;
}

.job-total-highlight {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.08), var(--surface));
  border: 1px solid rgba(249, 115, 22, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.job-total-highlight .label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
}

.job-total-highlight .value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--accent);
  font-family: "JetBrains Mono", monospace;
}

.payment-preview-box {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
}

.payment-preview-box .payment-preview-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 600;
}

.payment-preview-box p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-secondary);
  white-space: pre-line;
  line-height: 1.5;
}

.job-detail-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 24px;
}

.job-detail-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.job-detail-col {
  min-width: 0;
}

@media (min-width: 1024px) {
  .job-detail-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 32px;
  }
}

.print-only {
  display: none;
}

@media print {
  body {
    background: #fff;
    color: #1a1a1a;
  }
  .app-shell {
    display: none !important;
  }
  .print-only {
    display: block !important;
  }

  #printInvoice {
    padding: 0;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1a1a1a;
    max-width: 820px;
    margin: 0 auto;
  }

  /* Header band: logo/company block left, quote badge right */
  .print-header-band {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 24px;
    padding: 28px 0 20px;
    border-bottom: 3px solid var(--accent, #f97316);
    margin-bottom: 24px;
  }
  .print-brand {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .print-brand-logo {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: contain;
    flex-shrink: 0;
  }
  .print-brand-logo-fallback {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: var(--accent, #f97316);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
  }
  .print-brand-text h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.2px;
  }
  .print-brand-text p {
    margin: 2px 0 0;
    font-size: 12.5px;
    color: #666;
  }
  .print-quote-badge {
    text-align: right;
    flex-shrink: 0;
  }
  .print-quote-badge .print-invoice-title {
    display: inline-block;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #fff;
    background: var(--accent, #f97316);
    padding: 5px 14px;
    border-radius: 4px;
    margin: 0 0 8px;
  }
  .print-quote-badge p {
    margin: 2px 0;
    font-size: 12px;
    color: #555;
  }
  .print-quote-badge .print-quote-ref {
    font-weight: 700;
    color: #1a1a1a;
  }
  .print-quote-badge .print-quote-validity {
    color: var(--accent, #f97316);
    font-weight: 700;
    font-size: 11.5px;
  }

  /* Company contact strip */
  .print-contact-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    font-size: 11.5px;
    color: #666;
    margin-bottom: 28px;
  }
  .print-contact-strip span {
    white-space: nowrap;
  }

  .print-section {
    margin-bottom: 26px;
    page-break-inside: avoid;
  }
  .print-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #444;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 6px;
    margin: 0 0 12px;
  }

  /* Stat cards for project specs */
  .print-stat-cards {
    display: flex;
    gap: 12px;
  }
  .print-stat-card {
    flex: 1;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 14px;
    text-align: center;
  }
  .print-stat-card .stat-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #888;
    margin: 0 0 4px;
  }
  .print-stat-card .stat-value {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
  }

  .print-invoice-details table,
  .print-section table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
  }
  .print-invoice-details th, .print-invoice-details td,
  .print-section th, .print-section td {
    padding: 9px 10px;
    border-bottom: 1px solid #eee;
    text-align: left;
  }
  .print-invoice-details th, .print-section th {
    background: #fafafa;
    font-weight: 700;
    color: #555;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
  }
  .print-section tbody tr:last-child td {
    border-bottom: none;
  }

  .print-total-section {
    width: 300px;
    margin-left: auto;
    margin-top: 8px;
    page-break-inside: avoid;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px 18px;
  }
  .print-total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 12.5px;
    color: #444;
  }
  .print-total-row.grand-total {
    font-size: 18px;
    font-weight: 800;
    color: #1a1a1a;
    border-top: 2px solid var(--accent, #f97316);
    margin-top: 6px;
    padding-top: 12px;
  }

  .print-footer {
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #888;
    font-size: 11.5px;
  }
  .print-footer p {
    margin: 3px 0;
  }

  .print-notes-section {
    display: flex;
    gap: 20px;
    margin-top: 20px;
  }
  .print-notes-block {
    flex: 1;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px 16px;
  }
  .print-notes-text {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.6;
    color: #555;
    white-space: pre-line;
  }
}

.stock-warning {
  color: var(--danger) !important;
  font-weight: 700;
}
.stock-warning-row {
  background: rgba(220, 38, 38, 0.05) !important;
}

.stock-readout {
  min-width: 64px;
  text-align: right;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 6px 4px;
}

.color-palette {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.color-swatch:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-sm);
}

.color-swatch.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--accent);
  transform: scale(1.1);
}

.color-swatch.out-of-stock {
  cursor: not-allowed;
  opacity: 0.3;
  position: relative;
}

.color-swatch.out-of-stock::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -3px;
  right: -3px;
  height: 2px;
  background: var(--danger, #dc2626);
  transform: rotate(-45deg);
}

.color-swatch.out-of-stock:hover {
  transform: none;
  box-shadow: none;
}

.color-swatch-custom {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
}

.color-swatch-custom::-webkit-color-swatch {
  border-radius: 50%;
  border: 2px solid var(--border);
}

.color-swatch-custom::-moz-color-swatch {
  border-radius: 50%;
  border: 2px solid var(--border);
}

.color-dot {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--border);
  vertical-align: middle;
}

.settings-layout-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  align-items: start;
}

.settings-sidebar {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 4px;
}

.settings-nav-btn {
  text-align: left;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.settings-nav-btn:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.settings-nav-btn.active {
  background: var(--surface-hover);
  color: var(--accent);
  font-weight: 600;
}

.settings-nav-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 16px 4px;
  margin: 0;
}

.settings-nav-group-label:first-child {
  padding-top: 8px;
}

.settings-pane.hidden {
  display: none;
}

/* Compact Part Inputs & Color Selector */
.quote-part-inputs-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.5fr 1fr 1fr 1.2fr auto;
  gap: 12px;
  align-items: flex-end;
}

@media (max-width: 768px) {
  .quote-part-inputs-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.compact-palette {
  display: flex;
  gap: 6px !important;
  flex-wrap: wrap;
  margin-top: 4px;
}

.compact-palette .color-swatch {
  width: 20px !important;
  height: 20px !important;
  border-width: 1.5px !important;
}

.compact-palette .color-swatch-custom {
  width: 20px !important;
  height: 20px !important;
}

.compact-palette .color-swatch-custom::-webkit-color-swatch {
  border-width: 1.5px !important;
}

.compact-palette .color-swatch-custom::-moz-color-swatch {
  border-width: 1.5px !important;
}


/* ---------- Consolidated sync (Database / Sheet / Files / Images / Products) ---------- */

.sync-all-bar {
  padding: 12px 16px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.sync-all-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.sync-progress-track {
  margin-top: 10px;
  height: 6px;
  border-radius: 4px;
  background: var(--border);
  overflow: hidden;
}

.sync-progress-track.hidden {
  display: none;
}

.sync-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.25s ease;
}

.job-sync-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.job-sync-status .sync-ok {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.job-sync-status .sync-pending {
  font-size: 0.75rem;
  color: #b45309;
  font-weight: 600;
}

/* Job Details page — WhatsApp/PDF/Sync actions bar, right under the
   overview card. Stacks on narrow screens, sits on one row on wider ones. */
.job-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.job-actions-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.job-actions-bar .job-actions-sync.job-sync-status {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.job-actions-bar .job-actions-sync .sync-ok,
.job-actions-bar .job-actions-sync .sync-pending {
  font-size: 0.78rem;
}

/* ==========================================================================
   Settings — sidebar polish, sub-navigation, backup actions, printer forms
   ========================================================================== */

.settings-sidebar {
  position: sticky;
  top: 16px;
}

.settings-nav-btn {
  position: relative;
  padding-left: 22px;
}

.settings-nav-btn.active::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 16px;
  border-radius: 2px;
  background: var(--accent);
}

/* Reuse the app's existing "accent bar before the heading" pattern
   (see .card-header-simple h3) on every Settings pane header, so the
   redesign reads as one consistent visual language rather than a mix. */
.settings-pane .card-header h3,
.subtab-panel .card-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-pane .card-header h3::before,
.subtab-panel .card-header h3::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 16px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Generic sub-tab bar — used inside a tab (e.g. Printers) to switch
   between grouped views without leaving the page. Visually lighter
   than the top-level .nav-btn bar so it reads as "inside" the page. */
.subtab-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.subtab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 8px;
}

.subtab-btn:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.subtab-btn.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.subtab-count {
  background: var(--border-light);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.subtab-btn.active .subtab-count {
  background: var(--accent-soft);
  color: var(--accent);
}

.subtab-panel.hidden {
  display: none;
}

/* Data & Backup */
.backup-actions-card {
  border: 1px dashed var(--border);
}

.backup-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.danger-zone {
  border: 1px solid rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.04);
}

/* Printer photo upload (mirrors the company-logo pattern) */
.photo-upload-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--surface);
  position: relative;
}

.photo-upload-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.photo-upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-align: center;
  padding: 12px;
}

.photo-upload-placeholder svg {
  opacity: 0.6;
}

/* Printer edit/add layout */
.printer-form-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  align-items: start;
}

.printer-form-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 16px;
}

.printer-quickstats {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.printer-quickstat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.printer-quickstat-row span:first-child {
  color: var(--text-muted);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

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

.status-badge.status-active { background: rgba(5, 150, 105, 0.12); color: var(--success); }
.status-badge.status-maintenance { background: rgba(180, 83, 9, 0.12); color: #b45309; }
.status-badge.status-retired { background: rgba(220, 38, 38, 0.12); color: var(--danger); }

.progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
}

.form-section-card {
  margin-bottom: 20px;
}

.form-section-card:last-child {
  margin-bottom: 0;
}

.form-section-title {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.form-section-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .printer-form-grid { grid-template-columns: 1fr; }
  .printer-form-side { position: static; }
}

/* Parts/Accessories mini-tabs inside Add/Edit Printer — reuses the
   .subtab-bar/.subtab-btn look from the Printers page at a tighter
   scale since it's nested inside a card, not a full page. */
.pd-subtab-bar {
  margin-bottom: 12px;
}
.pd-subtab-panel.hidden {
  display: none;
}

/* Accessory/part Type badge — Part vs Accessory, same visual language
   as the Field-type badges in Financial Parameters. */
.type-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.type-badge.type-part { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.type-badge.type-accessory { background: rgba(147, 51, 234, 0.12); color: #9333ea; }

/* ===== First-run Setup Wizard ===== */
.setup-wizard-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}
.setup-wizard-panel {
  background: var(--panel);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
}
.setup-wizard-panel h2 {
  margin: 0 0 4px 0;
  color: var(--text-primary);
}
.setup-wizard-panel .setup-sub {
  color: var(--text-muted);
  margin: 0 0 24px 0;
  font-size: 14px;
}
.setup-wizard-panel label {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}
.setup-wizard-panel input,
.setup-wizard-panel select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-primary);
  background: var(--surface);
}
.setup-wizard-panel .setup-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.setup-wizard-panel .setup-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}
.setup-wizard-panel .setup-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: -10px;
  margin-bottom: 16px;
}

/* ===== App footer credit ===== */
.app-footer {
  text-align: center;
  padding: 16px 12px 24px 12px;
  font-size: 12px;
  color: var(--text-muted);
}
@media print {
  .app-footer { display: none; }
}

/* ===== Live profit preview (Quote page) ===== */
.live-profit-preview {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
}
.live-profit-preview .lpp-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 90px;
}
.live-profit-preview .lpp-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.live-profit-preview .lpp-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.live-profit-preview .lpp-value.profit-positive { color: var(--success, #16a34a); }
.live-profit-preview .lpp-value.profit-negative { color: var(--danger, #dc2626); }

/* ---- Jobs page stats ---- */
.job-stats-panel { margin-bottom: 24px; }
.stats-section-title {
  font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-secondary); margin: 18px 0 8px;
}
.stats-section-title:first-child { margin-top: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; }
.stat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 14px; text-align: left; color: var(--text-primary); font: inherit;
}
.stat-tile-label {
  display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-secondary); margin-bottom: 6px;
}
.stat-tile-value { display: block; font-size: 1.15rem; font-family: "JetBrains Mono", monospace; color: var(--text-primary); }
.stat-tile-sub { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
button.stat-tile-btn {
  /* the app's global button style centres content in a row — these are stacked tiles */
  display: block; width: 100%; text-align: left; font-weight: normal; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
button.stat-tile-btn:hover { border-color: var(--accent); }
button.stat-tile-btn.active { border-color: var(--accent); background: var(--accent-soft); }
.stat-tile-quote { border-left: 3px solid #94a3b8; }
.stat-tile-printed { border-left: 3px solid var(--accent); }
.stat-tile.stat-warn .stat-tile-value { color: #dc2626; }
.stat-tile.stat-good .stat-tile-value { color: #16a34a; }
.stats-legend { font-size: 0.78rem; color: var(--text-muted); margin-top: 10px; }
@media (max-width: 640px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---- Reports tab ---- */
.report-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 8px; }
.report-controls label { font-size: 0.75rem; color: var(--text-secondary); display: flex; flex-direction: column; gap: 4px; }
.report-controls select, .report-controls input { padding: 6px 8px; }
.report-block { margin-top: 28px; }
.report-block-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.report-block-head h3 { margin: 0; }
.report-scroll { overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.report-table th {
  text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-secondary); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.report-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.report-table th.num, .report-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table tfoot td { font-weight: 700; border-top: 2px solid var(--border); border-bottom: none; }
.report-bar-cell { width: 140px; min-width: 100px; }
.report-bar { display: block; height: 8px; border-radius: 4px; background: var(--accent); min-width: 2px; }
.report-neg { color: #dc2626; }

/* ---- Job drawer: compact money rows + collapsible payment form ---- */
.compact-list { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.compact-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; background: var(--surface-hover); border-radius: 8px;
}
.payment-form { margin-top: 12px; }
.payment-form > summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  padding: 6px 12px; font-size: 0.85rem; font-weight: 600; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--surface); color: var(--text-primary);
}
.payment-form > summary::-webkit-details-marker { display: none; }
.payment-form > summary:hover { border-color: var(--accent); }
.payment-form[open] > summary { margin-bottom: 12px; }
.payment-form-fields { display: flex; flex-direction: column; gap: 8px; }
.payment-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.payment-form-row label { font-size: 0.75rem; color: var(--text-secondary); flex: 1; min-width: 110px; }
.payment-form-row label input, .payment-form-row label select { padding: 6px; margin-top: 4px; width: 100%; }
.payment-form-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* Cards stacked in the Quote tab columns are spaced by the column gap only
   (some carry a leftover bottom margin that made the gaps uneven). */
.quote-input-stack > .card { margin-bottom: 0; }

/* The Estimate Result toolbar has four buttons — let it wrap on narrow screens. */
.result-header { flex-wrap: wrap; row-gap: 12px; }
.result-header .header-actions { flex-wrap: wrap; }

/* ==========================================================================
   Modern Auth & Initial Setup Overlay (Streamlined Single Card)
   ========================================================================== */
.auth-overlay-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
}

.auth-modal-card {
  width: 100%;
  max-width: 480px;
  background: var(--panel, #ffffff);
  border-radius: 20px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 34px 36px;
  box-sizing: border-box;
  animation: authModalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes authModalFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 540px) {
  .auth-modal-card {
    padding: 24px 20px;
    max-height: 92vh;
    overflow-y: auto;
  }
}

.auth-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(249, 115, 22, 0.1);
  border: 1px solid rgba(249, 115, 22, 0.2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent, #f97316);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.auth-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 5px;
}

.auth-input-wrapper input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.15));
  background: var(--surface, #f8fafc);
  color: var(--text-primary, #0f172a);
  font-size: 0.92rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.auth-input-wrapper input:focus {
  outline: none;
  border-color: var(--accent, #f97316);
  background: var(--panel, #ffffff);
  box-shadow: 0 0 0 3px var(--accent-glow, rgba(249, 115, 22, 0.2));
}

.auth-pwd-toggle {
  position: absolute;
  right: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #64748b);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
}

.auth-pwd-toggle:hover {
  color: var(--text-primary, #0f172a);
}

.pwd-strength-meter {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pwd-strength-bars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  height: 4px;
}

.pwd-strength-bar {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 2px;
  transition: background 0.3s ease;
}

.pwd-strength-text {
  font-size: 0.72rem;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

/* ─────────────────────────────────────────────────────────────
   Printcova Cloud — Account & Plan Pane Styles
   ───────────────────────────────────────────────────────────── */
.qf-account-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.qf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  transition: border-color var(--transition-fast);
}

.qf-card:hover {
  border-color: var(--border-light);
}

.qf-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.qf-profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.qf-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent, #f97316), #f43f5e);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--accent-glow, rgba(249, 115, 22, 0.2));
}

.qf-profile-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.qf-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  width: fit-content;
}

.qf-badge-admin {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.qf-badge-member {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.qf-badge-active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.qf-badge-canceled {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.qf-copy-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: "JetBrains Mono", monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.qf-copy-chip:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.qf-usage-bar {
  margin: 12px 0 16px;
}

.qf-usage-track {
  width: 100%;
  height: 8px;
  background: var(--panel);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 6px;
  border: 1px solid var(--border);
}

.qf-usage-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent, #f97316), #38bdf8);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.qf-tiers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.qf-tier-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all var(--transition-fast);
}

.qf-tier-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.qf-tier-card.current {
  border: 2px solid var(--accent);
  background: rgba(249, 115, 22, 0.04);
}

.qf-tier-card.featured {
  border: 2px solid #38bdf8;
  background: rgba(56, 189, 248, 0.04);
}

.qf-tier-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

.qf-tier-badge.blue {
  background: #0284c7;
}

.qf-tier-header {
  margin-bottom: 12px;
}

.qf-tier-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.qf-tier-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.qf-tier-specs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 10px 0;
}

.qf-spec-pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-secondary);
}

.qf-tier-features {
  list-style: none;
  padding: 0;
  margin: 14px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.qf-tier-features li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qf-tier-features li span.chk {
  color: var(--success);
  font-weight: 700;
}

.qf-manage-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.qf-action-notice {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  display: none;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.qf-action-notice.visible {
  display: flex;
}

/* ==========================================
   Jobs Kanban Board
   ========================================== */
.history-view-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
  margin-left: auto;
}

.history-view-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.history-view-btn:hover {
  color: var(--text-primary);
}

.history-view-btn.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 4px var(--accent-glow);
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(220px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}

.kanban-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  min-height: 340px;
  max-height: 72vh;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.kanban-col.kanban-col-drop-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.kanban-col-header {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--panel);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.kanban-col-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-primary);
}

.kanban-stage-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.kanban-stage-draft .kanban-stage-dot { background: #64748b; }
.kanban-stage-quote_sent .kanban-stage-dot { background: #3b82f6; }
.kanban-stage-printing .kanban-stage-dot { background: #f97316; box-shadow: 0 0 8px rgba(249, 115, 22, 0.5); }
.kanban-stage-invoiced .kanban-stage-dot { background: #8b5cf6; }
.kanban-stage-completed .kanban-stage-dot { background: #10b981; }

.kanban-col-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 9999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.kanban-col-total {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-weight: 600;
}

.kanban-cards {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  overflow-y: auto;
  flex: 1;
}

.kanban-empty {
  text-align: center;
  padding: 24px 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.kanban-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  box-shadow: var(--shadow-sm);
  cursor: grab;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.kanban-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kanban-card.kanban-card-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.kanban-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.kanban-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.25;
  cursor: pointer;
}

.kanban-card-title:hover {
  color: var(--accent);
}

.kanban-card-customer {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.kanban-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.kanban-card-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.kanban-card-thumb-row {
  display: flex;
  gap: 4px;
  align-items: center;
}

.kanban-card-thumb {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid var(--border);
}

.kanban-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-light);
}

.kanban-card-price {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
}

.kanban-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 1200px) {
  .kanban-board {
    grid-template-columns: repeat(5, minmax(235px, 1fr));
  }
}


