/* ===================================================
   CUTLIST OPTIMIZER — Professional Joinery Software
   Design: Dark industrial, amber/gold accents
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── CSS Variables ── */
:root {
  --bg-deep: #0a0d14;
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1a2030;
  --bg-hover: #1f2a3c;
  --bg-input: #131923;
  --bg-modal: #111620;

  --accent: #f0a500;
  --accent-dim: rgba(240, 165, 0, 0.15);
  --accent-glow: 0 0 20px rgba(240, 165, 0, 0.25);
  --accent-hover: #ffb930;

  --success: #2ecc71;
  --danger: #e74c3c;
  --info: #3498db;
  --warning: #f39c12;

  --text-primary: #e8eaf0;
  --text-secondary: #8b9ab5;
  --text-muted: #5a6a84;
  --text-accent: #f0a500;

  --border: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(240, 165, 0, 0.35);

  --sidebar-w: 240px;
  --topbar-h: 62px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.6);

  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  overflow: hidden;
}

/* ── Scrollbars ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-dim); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(240, 165, 0, 0.35); }

/* ══════════════════════════════════════
   LAYOUT
══════════════════════════════════════ */

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh;
}

/* ── Topbar ── */
.topbar {
  grid-column: 1 / -1;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: relative;
  z-index: 100;
}

.topbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  width: var(--sidebar-w);
  padding-right: 16px;
  border-right: 1px solid var(--border);
}

.topbar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent), #c8871a);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: var(--accent-glow);
}

.topbar-logo .brand-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.topbar-logo .brand-sub {
  font-size: 9px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-badge {
  font-size: 10px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-accent);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-project-select {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  transition: border-color var(--transition);
}

.topbar-project-select:focus { outline: none; border-color: var(--accent); }

/* ── Sidebar ── */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px 0;
}

.sidebar-section-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 12px 18px 6px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--accent-dim);
  color: var(--accent);
  border-left-color: var(--accent);
}

.sidebar-item .nav-icon {
  width: 18px;
  height: 18px;
  opacity: 0.8;
  flex-shrink: 0;
}

.sidebar-item:hover .nav-icon,
.sidebar-item.active .nav-icon { opacity: 1; }

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 18px;
}

/* ── Main Content ── */
.main-content {
  overflow-y: auto;
  background: var(--bg-primary);
  position: relative;
}

.section-page {
  display: none;
  padding: 28px 28px 40px;
  animation: fadeIn 0.25s ease;
  min-height: 100%;
}

.section-page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════
   PAGE HEADERS
══════════════════════════════════════ */

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-header-left h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.page-header-left p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ══════════════════════════════════════
   CARDS
══════════════════════════════════════ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color var(--transition);
}

.card:hover { border-color: rgba(240, 165, 0, 0.15); }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .dot {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* ══════════════════════════════════════
   DASHBOARD STATS
══════════════════════════════════════ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 100%);
}

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

.stat-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  color: var(--accent);
}

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

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-delta {
  font-size: 11px;
  margin-top: 6px;
  color: var(--success);
}

/* ══════════════════════════════════════
   TABLES
══════════════════════════════════════ */

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

thead th {
  background: var(--bg-secondary);
  color: var(--text-accent);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 11px 14px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

tbody tr:hover td { background: var(--bg-hover); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 10px 14px;
  color: var(--text-primary);
  vertical-align: middle;
}

.td-muted { color: var(--text-muted); font-size: 11px; }
.td-mono { font-family: 'JetBrains Mono', monospace; font-size: 11.5px; color: var(--accent); }

/* Editable cutlist inline */
.editable-cell {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-primary);
  font-size: 12.5px;
  padding: 4px 6px;
  border-radius: 4px;
  width: 100%;
  font-family: inherit;
  transition: all var(--transition);
}

.editable-cell:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-input);
  box-shadow: 0 0 0 2px rgba(240, 165, 0, 0.1);
}

.editable-cell[type="checkbox"] {
  width: 16px; height: 16px;
  cursor: pointer;
  accent-color: var(--accent);
}

.editable-cell > option {
  background: var(--bg-card);
}

select.editable-cell {
  cursor: pointer;
  appearance: none;
}

.cell-eb { display: flex; gap: 4px; align-items: center; }
.eb-checkbox-label {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}

.eb-checkbox-label input {
  accent-color: var(--accent);
  width: 12px; height: 12px;
}

/* ══════════════════════════════════════
   BUTTONS
══════════════════════════════════════ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #c8871a);
  color: #000;
  box-shadow: 0 2px 12px rgba(240, 165, 0, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-hover), #d9951f);
  box-shadow: 0 4px 16px rgba(240, 165, 0, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: rgba(255,255,255,0.15);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-accent);
}

.btn-outline:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

.btn-danger {
  background: rgba(231, 76, 60, 0.15);
  color: var(--danger);
  border: 1px solid rgba(231, 76, 60, 0.3);
}

.btn-danger:hover { background: rgba(231, 76, 60, 0.25); }

.btn-success {
  background: rgba(46, 204, 113, 0.15);
  color: var(--success);
  border: 1px solid rgba(46, 204, 113, 0.3);
}

.btn-success:hover { background: rgba(46, 204, 113, 0.25); }

.btn-sm { padding: 5px 10px; font-size: 11px; }
.btn-lg { padding: 11px 22px; font-size: 14px; }
.btn-icon { padding: 7px; width: 32px; height: 32px; justify-content: center; }

.btn-icon-del {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all var(--transition);
  font-size: 14px;
  line-height: 1;
}

.btn-icon-del:hover { color: var(--danger); background: rgba(231,76,60,0.1); }

/* ══════════════════════════════════════
   FORMS & INPUTS
══════════════════════════════════════ */

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  transition: all var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 165, 0, 0.08);
}

.form-control::placeholder { color: var(--text-muted); }

.form-row {
  display: grid;
  gap: 12px;
}

.form-row.cols-2 { grid-template-columns: 1fr 1fr; }
.form-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-secondary);
}

.form-check input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* ── Kerf / Settings Row ── */
.settings-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.settings-inline label {
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 4px;
}

.settings-inline input[type="number"],
.settings-inline select {
  width: 80px;
  padding: 5px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
}

.settings-inline input:focus,
.settings-inline select:focus {
  outline: none;
  border-color: var(--accent);
}

/* ══════════════════════════════════════
   BADGES & TAGS
══════════════════════════════════════ */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.badge-amber { background: var(--accent-dim); color: var(--accent); border: 1px solid var(--border-accent); }
.badge-green { background: rgba(46,204,113,0.12); color: var(--success); border: 1px solid rgba(46,204,113,0.25); }
.badge-red   { background: rgba(231,76,60,0.12); color: var(--danger); border: 1px solid rgba(231,76,60,0.25); }
.badge-blue  { background: rgba(52,152,219,0.12); color: var(--info); border: 1px solid rgba(52,152,219,0.25); }

.material-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.tag-mdf { background: rgba(155, 89, 182, 0.15); color: #b07fd4; }
.tag-chipboard { background: rgba(41, 128, 185, 0.15); color: #7fb3d4; }
.tag-plywood { background: rgba(39, 174, 96, 0.15); color: #7fcc9d; }
.tag-custom { background: rgba(240, 165, 0, 0.15); color: #f0a500; }

/* ══════════════════════════════════════
   MODALS
══════════════════════════════════════ */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-lg { max-width: 760px; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-title .modal-icon {
  width: 28px; height: 28px;
  background: var(--accent-dim);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.modal-close {
  width: 28px; height: 28px;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition);
}

.modal-close:hover { background: var(--bg-hover); color: var(--text-primary); }

.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 14px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ══════════════════════════════════════
   PROJECT CARDS
══════════════════════════════════════ */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, transparent 80%);
}

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

.project-card.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
  box-shadow: var(--accent-glow);
}

.project-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.project-card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.project-card-client {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.project-meta {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.project-meta-item {
  font-size: 10px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.project-meta-item strong {
  color: var(--text-secondary);
  font-size: 11px;
}

/* ══════════════════════════════════════
   CUTLIST & OPTIMIZER SECTION
══════════════════════════════════════ */

.cutlist-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.optimize-panel {
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(240,165,0,0.04) 100%);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}

.optimize-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.opt-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.opt-field label {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.opt-field input[type="number"],
.opt-field select {
  width: 90px;
  padding: 6px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  transition: border-color var(--transition);
}

.opt-field input:focus, .opt-field select:focus {
  outline: none;
  border-color: var(--accent);
}

.opt-field .form-check { margin: 0; }

/* ══════════════════════════════════════
   VISUAL LAYOUT (CANVAS AREA)
══════════════════════════════════════ */

.layout-area {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 300px;
}

.layout-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  color: var(--text-muted);
  text-align: center;
  gap: 10px;
}

.layout-empty-icon {
  font-size: 48px;
  opacity: 0.3;
}

.sheets-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-start;
}

.sheet-canvas-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: border-color var(--transition);
}

.sheet-canvas-wrapper:hover { border-color: var(--border-accent); }

.sheet-canvas {
  border-radius: var(--radius-sm);
  display: block;
  max-width: 100%;
}

/* ══════════════════════════════════════
   REPORTS
══════════════════════════════════════ */

.report-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

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

.waste-bar-container {
  margin-top: 8px;
}

.waste-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.waste-bar {
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.waste-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}

.waste-bar-fill.low { background: var(--success); }
.waste-bar-fill.mid { background: var(--warning); }
.waste-bar-fill.high { background: var(--danger); }

/* ══════════════════════════════════════
   EXPORT BUTTONS
══════════════════════════════════════ */

.export-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  align-items: center;
  margin-bottom: 20px;
}

.export-bar-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-right: 4px;
}

/* ══════════════════════════════════════
   TOAST NOTIFICATIONS
══════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 12.5px;
  color: var(--text-primary);
  box-shadow: var(--shadow-md);
  animation: slideUp 0.25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
}

.toast.toast-success { border-left: 3px solid var(--success); }
.toast.toast-error   { border-left: 3px solid var(--danger); }
.toast.toast-info    { border-left: 3px solid var(--accent); }

.toast-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  margin-left: auto;
}

/* ══════════════════════════════════════
   UTILITY
══════════════════════════════════════ */

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.fw-600 { font-weight: 600; }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-sm { font-size: 11px; }
.mono { font-family: 'JetBrains Mono', monospace; }

.sep { width: 1px; height: 20px; background: var(--border); flex-shrink: 0; }
.tag-grain { font-size: 10px; background: rgba(155,89,182,0.15); color: #b07fd4; padding: 2px 6px; border-radius: 4px; }
.tag-nograin { font-size: 10px; background: var(--bg-secondary); color: var(--text-muted); padding: 2px 6px; border-radius: 4px; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state-icon { font-size: 52px; margin-bottom: 12px; opacity: 0.25; }
.empty-state h3 { font-size: 15px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-state p  { font-size: 12px; }

/* ── Dropdown row actions ── */
.row-actions { display: flex; gap: 4px; }

/* ── Material icons in table ── */
.material-circle {
  width: 10px; height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.circle-mdf      { background: #b07fd4; }
.circle-chipboard { background: #7fb3d4; }
.circle-plywood  { background: #7fcc9d; }
.circle-custom   { background: var(--accent); }

/* ══════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════ */

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 0 1fr;
  }

  .sidebar {
    position: fixed;
    left: -240px;
    top: 0;
    height: 100vh;
    z-index: 200;
    transition: left var(--transition);
    width: var(--sidebar-w);
  }

  .sidebar.open { left: 0; }

  .topbar-logo { display: none; }
}

/* ══════════════════════════════════════
   PRINT STYLES
══════════════════════════════════════ */

@media print {
  .sidebar, .topbar, .page-actions, .cutlist-toolbar, .export-bar { display: none !important; }
  body { overflow: visible !important; }
  .main-content { overflow: visible !important; }
  .section-page { display: block !important; }
}
