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

:root {
  --brand:          #79b526;
  --brand-dark:     #6a9c1e;
  --brand-tint:     #f0f7e2;
  --sidebar:        #ffffff;
  --sidebar-hover:  #f4f6f2;
  --sidebar-active-bg: #eef5e0;
  --green:          #79b526;
  --green-hover:    #6a9c1e;
  --green-dark:     #5a8818;
  --green-tint:     #f0f7e2;
  --border:         #e4e7e1;
  --bg:             #f3f4f1;
  --white:          #ffffff;
  --text:           #1a1f16;
  --text-muted:     #6b7280;
  --danger:         #dc2626;
  --radius:         8px;
  --shadow:         0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: var(--bg); color: var(--text); font-size: 14px; height: 100vh; overflow: hidden; }

.app { display: flex; flex-direction: column; height: 100vh; }

/* ── Global topbar ───────────────────────── */
.topbar { background: var(--brand); display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 56px; flex-shrink: 0; }
.topbar-logo { height: 36px; width: auto; display: block; }
.topbar-user { font-size: 13px; color: rgba(255,255,255,0.85); font-weight: 500; }

/* ── App body (sidebar + main) ───────────── */
.app-body { display: flex; flex: 1; overflow: hidden; }

/* ── Sidebar ─────────────────────────────── */
.sidebar { display: none; }

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

.top-nav { padding: 10px 8px 4px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; cursor: pointer; transition: background 0.12s, color 0.12s; color: var(--text-muted); font-size: 13.5px; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--text); }
.nav-item.active { background: var(--sidebar-active-bg); color: var(--brand); font-weight: 600; }
.nav-item svg { flex-shrink: 0; }

.sidebar-section-label { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: #9ca3af; padding: 14px 18px 6px; text-transform: uppercase; }

/* ── Steps strip (horizontal, inside editor) ── */
.steps-strip { display: flex; gap: 2px; padding: 8px 20px; background: var(--white); border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }

.step-item { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 6px; cursor: pointer; transition: background 0.12s, color 0.12s; color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.step-item:hover { background: var(--sidebar-hover); color: var(--text); }
.step-item.active { background: var(--sidebar-active-bg); color: var(--brand); font-weight: 600; }
.step-item.done { color: var(--text-muted); }
.step-item.done .step-num { background: var(--brand); color: white; }
.step-item.hidden { display: none; }

.step-num { width: 20px; height: 20px; border-radius: 50%; background: #e5e7e3; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; color: var(--text-muted); }
.step-item.active .step-num { background: var(--brand); color: white; }
.form-area.op-mode .spec-only-field { display: none !important; }
.step-label-op.hidden { display: none; }
.step-label-spec.hidden { display: none; }

.sidebar-bottom { padding: 12px; border-top: 1px solid var(--border); }
.btn-new-spec { width: 100%; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--brand); color: white; border: none; border-radius: 7px; padding: 9px 14px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.12s; }
.btn-new-spec:hover { background: var(--brand-dark); }

/* ── Main ────────────────────────────────── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* ── Dashboard ───────────────────────────── */
#dashboardView { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }

.dash-topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 28px 0; }
.dash-topbar h1 { font-size: 20px; font-weight: 700; color: var(--text); }
.dash-topbar p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.dash-topbar-right { display: flex; gap: 10px; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 20px 28px; }
.stat-card { background: var(--white); border-radius: 10px; padding: 18px 20px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--text); line-height: 1; }
.stat-card .stat-value.green { color: var(--green-dark); }
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }
.stat-card .stat-sub { font-size: 11px; color: var(--green-dark); margin-top: 4px; font-weight: 600; }

.dash-section { padding: 0 28px 28px; }
.dash-section-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px; margin-bottom: 12px; }

.recent-table-wrap { background: var(--white); border-radius: 10px; border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; }
.recent-table { width: 100%; border-collapse: collapse; }
.recent-table thead th { background: var(--brand); color: white; padding: 11px 16px; text-align: left; font-size: 11.5px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; }
.recent-table tbody td { padding: 11px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.recent-table tbody tr:last-child td { border-bottom: none; }
.recent-table tbody tr:hover td { background: #f8faf7; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 99px; font-size: 11px; font-weight: 700; }
.badge-active { background: var(--green-tint); color: var(--green-dark); }
.badge-draft  { background: #fef9c3; color: #854d0e; }

.table-action { background: none; border: 1px solid var(--border); border-radius: 5px; padding: 4px 10px; font-size: 11.5px; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: all 0.12s; margin-left: 4px; font-family: inherit; }
.table-action:hover { border-color: var(--green-dark); color: var(--green-dark); background: var(--green-tint); }
.table-action.danger:hover { border-color: var(--danger); color: var(--danger); background: #fee2e2; }

.dash-empty { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.dash-empty p { margin-bottom: 16px; font-size: 15px; }

/* ── Editor topbar ───────────────────────── */
.editor-topbar { display: flex; align-items: center; justify-content: space-between; padding: 13px 28px; background: var(--white); border-bottom: 1px solid var(--border); gap: 16px; flex-shrink: 0; }
.back-btn { display: flex; align-items: center; gap: 6px; background: none; border: none; color: var(--text-muted); font-size: 13px; cursor: pointer; padding: 4px 0; font-family: inherit; }
.back-btn:hover { color: var(--text); }
.product-name-input { font-size: 17px; font-weight: 700; border: none; outline: none; color: var(--text); background: transparent; flex: 1; min-width: 160px; }
.product-name-input::placeholder { color: #bbb; font-weight: 400; }
.editor-topbar-actions { display: flex; gap: 10px; flex-shrink: 0; align-items: center; }

/* ── Form area ───────────────────────────── */
.form-area { flex: 1; overflow-y: auto; padding: 28px; }
.step-panel { display: none; max-width: 760px; }
.step-panel.active { display: block; }
.step-title { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 22px; padding-bottom: 12px; border-bottom: 2px solid var(--border); }
.hint-inline { font-size: 12px; font-weight: 400; color: var(--text-muted); margin-left: 8px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

input[type="text"], input[type="number"], select, textarea {
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green-dark); box-shadow: 0 0 0 3px rgba(34,197,94,0.1); }
textarea { resize: vertical; line-height: 1.5; }
.hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 7px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; padding: 7px 10px; border: 1.5px solid var(--border); border-radius: 6px; transition: all 0.12s; }
.checkbox-label:hover { border-color: var(--green-dark); background: var(--green-tint); }
.checkbox-label input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--green-dark); flex-shrink: 0; }

.serving-size-row { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.serving-size-row label { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; }
.serving-size-row input { width: 90px; }
.serving-size-row .unit-label { font-size: 13px; color: var(--text-muted); }
.serving-size-row .hint { font-size: 12px; color: var(--text-muted); }

.nutrition-table-editor { max-width: 580px; }
.nutrition-row { display: grid; grid-template-columns: 200px 1fr 60px 110px; gap: 10px; align-items: center; padding: 4px 0; }
.nutrition-row.header { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--text-muted); letter-spacing: 0.5px; border-bottom: 2px solid var(--border); padding-bottom: 8px; margin-bottom: 4px; }
.nutrition-row label { font-size: 13px; color: var(--text); }
.nutrition-row span { font-size: 13px; color: var(--text-muted); }
.ps-val { font-size: 12.5px; color: var(--green-dark); font-weight: 500; }
.ps-sub { color: var(--text-muted); font-size: 11px; }
.calc-hint { font-size: 12px; color: var(--text-muted); margin-top: 12px; font-style: italic; }

.upload-area { border: 2px dashed var(--border); border-radius: 12px; background: var(--white); min-height: 280px; display: flex; align-items: center; justify-content: center; transition: border-color 0.2s; cursor: pointer; }
.upload-area.drag-over { border-color: var(--green-dark); background: var(--green-tint); }
#uploadPrompt { display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--text-muted); text-align: center; }
#uploadPrompt p { font-size: 15px; color: var(--text); font-weight: 500; }
.upload-preview { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px; }
.upload-preview img { max-height: 240px; max-width: 320px; object-fit: contain; border-radius: 8px; border: 1px solid var(--border); }
.preview-actions { display: flex; align-items: center; gap: 12px; }
.filename { font-size: 13px; color: var(--text-muted); }

/* ── Step nav bar ────────────────────────── */
.step-nav-bar { display: flex; align-items: center; justify-content: space-between; padding: 13px 28px; background: var(--white); border-top: 1px solid var(--border); flex-shrink: 0; }
#stepIndicator { font-size: 13px; color: var(--text-muted); }

/* ── Buttons ─────────────────────────────── */
.btn-primary, .btn-secondary, .btn-danger-sm { border: none; border-radius: 7px; cursor: pointer; font-family: inherit; font-weight: 600; transition: all 0.12s; }
.btn-primary { background: var(--brand); color: white; padding: 9px 18px; font-size: 14px; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: var(--white); color: var(--text); padding: 9px 16px; font-size: 14px; border: 1.5px solid var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: #aaa; }
.btn-danger-sm { background: #fee2e2; color: var(--danger); padding: 6px 12px; font-size: 12px; }
.btn-danger-sm:hover { background: #fecaca; }

/* ── Modal ───────────────────────────────── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-box { background: var(--white); border-radius: 12px; width: 480px; max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; }
.modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.product-list { overflow-y: auto; padding: 8px; }
.product-list-item { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-radius: 8px; cursor: pointer; transition: background 0.12s; }
.product-list-item:hover { background: var(--bg); }
.product-list-item .name { font-weight: 600; font-size: 14px; }
.product-list-item .date { font-size: 12px; color: var(--text-muted); }
.empty-state { text-align: center; color: var(--text-muted); padding: 32px; font-size: 13px; }

/* ── AI Import button in topbar ─────────── */
.btn-ai-import { display: flex; align-items: center; gap: 6px; color: var(--green-dark); border-color: var(--green-dark) !important; }
.btn-ai-import:hover { background: var(--green-tint) !important; }

/* ── Topbar right ────────────────────────── */
.topbar-right { display: flex; align-items: center; gap: 10px; }
.topbar-settings-btn { display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.3); border-radius: 6px; color: #fff; cursor: pointer; transition: background 0.15s; }
.topbar-settings-btn:hover { background: rgba(255,255,255,0.32); }

/* ── Form subsection title ───────────────── */
.form-subsection-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.6px; color: var(--brand-dark); margin: 20px 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--green-tint); }

/* ── Maak-nieuw kaarten ──────────────────── */
.create-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 20px 28px 0;
}

.create-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 22px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.create-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.09); transform: translateY(-1px); }

.create-card-spec { border-left: 4px solid #14233b; }
.create-card-spec:hover { border-color: #14233b; }
.create-card-spec .create-card-icon { color: #14233b; background: #eef1f6; }
.create-card-spec .create-card-title { color: #14233b; }

.create-card-op { border-left: 4px solid var(--brand); }
.create-card-op:hover { border-color: var(--brand); }
.create-card-op .create-card-icon { color: var(--brand-dark); background: var(--green-tint); }
.create-card-op .create-card-title { color: var(--brand-dark); }

.create-card-drawer { border-left: 4px solid #b45309; }
.create-card-drawer:hover { border-color: #b45309; }
.create-card-drawer .create-card-icon { color: #b45309; background: #fef3c7; }
.create-card-drawer .create-card-title { color: #b45309; }

.create-card-sensory { border-left: 4px solid #7c3aed; }
.create-card-sensory:hover { border-color: #7c3aed; }
.create-card-sensory .create-card-icon { color: #7c3aed; background: #ede9fe; }
.create-card-sensory .create-card-title { color: #7c3aed; }

.create-card-icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.create-card-body { flex: 1; }
.create-card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.create-card-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }

.create-card-arrow { font-size: 20px; color: var(--text-muted); flex-shrink: 0; font-weight: 300; }
.create-card:hover .create-card-arrow { color: var(--text); }

/* ── One-Pager knop (sidebar) ────────────── */
.btn-new-one-pager { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 14px; background: var(--green-tint); border: 1.5px solid var(--brand); border-radius: var(--radius); font-size: 13px; font-weight: 600; color: var(--brand-dark); cursor: pointer; font-family: inherit; margin-top: 8px; transition: background 0.13s; }
.btn-new-one-pager:hover { background: #d9edbb; }

/* ── Editor mode badge ───────────────────── */
.editor-mode-badge { display: inline-flex; align-items: center; padding: 4px 12px; background: var(--green-tint); border: 1.5px solid var(--brand); border-radius: 99px; font-size: 12px; font-weight: 700; color: var(--brand-dark); white-space: nowrap; }

/* ── AI Import Modal ─────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; z-index: 500; }
.modal-card { background: var(--white); border-radius: 14px; width: 580px; max-width: calc(100vw - 48px); max-height: calc(100vh - 80px); display: flex; flex-direction: column; box-shadow: 0 24px 64px rgba(0,0,0,0.28); }
.modal-header { padding: 24px 24px 16px; border-bottom: 1px solid var(--border); }
.modal-title { font-size: 17px; font-weight: 800; color: var(--text); display: flex; align-items: center; gap: 8px; }
.modal-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }
.modal-tabs { display: flex; gap: 0; padding: 12px 24px 0; border-bottom: 1px solid var(--border); }
.modal-tab { display: flex; align-items: center; gap: 6px; background: none; border: none; border-bottom: 2px solid transparent; padding: 8px 14px; font-size: 13px; font-weight: 600; color: var(--text-muted); cursor: pointer; font-family: inherit; margin-bottom: -1px; transition: color 0.12s; }
.modal-tab:hover { color: var(--text); }
.modal-tab.active { color: var(--green-dark); border-bottom-color: var(--green-dark); }
.modal-body { padding: 20px 24px; flex: 1; overflow: auto; }
.modal-body textarea { width: 100%; height: 220px; border: 1.5px solid var(--border); border-radius: 8px; padding: 12px; font-size: 13px; font-family: inherit; resize: vertical; color: var(--text); line-height: 1.55; }
.modal-body textarea:focus { outline: none; border-color: var(--green-dark); box-shadow: 0 0 0 3px rgba(34,197,94,0.1); }
.modal-footer { padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; }
.btn-ai { display: flex; align-items: center; gap: 6px; background: var(--brand); color: white; border: none; border-radius: 7px; padding: 9px 18px; font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit; transition: background 0.12s; }
.btn-ai:hover { background: var(--brand-dark); }
.btn-ai:disabled { opacity: 0.55; cursor: not-allowed; }
.spin { animation: spinner 0.8s linear infinite; }
@keyframes spinner { to { transform: rotate(360deg); } }
.pdf-drop-zone { border: 2px dashed var(--border); border-radius: 10px; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--text-muted); text-align: center; transition: all 0.15s; }
.pdf-drop-zone p { font-size: 14px; color: var(--text); font-weight: 500; }
.pdf-drop-zone.drag-over { border-color: var(--green-dark); background: var(--green-tint); }
.pdf-selected { display: flex; align-items: center; gap: 12px; background: var(--green-tint); border: 1.5px solid #86efac; border-radius: 8px; padding: 14px 16px; min-height: 220px; justify-content: center; flex-direction: column; }
.pdf-selected span { font-size: 14px; font-weight: 600; color: var(--green-dark); word-break: break-all; text-align: center; }

/* ── Dashboard toolbar ───────────────────── */
.dash-toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 28px 0; flex-wrap: wrap; }
.dash-toolbar-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.dash-search-wrap { display: flex; align-items: center; gap: 8px; background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 7px 12px; flex: 1; max-width: 300px; }
.dash-search-wrap svg { flex-shrink: 0; color: var(--text-muted); }
.dash-search-wrap input { border: none; outline: none; font-size: 13.5px; background: transparent; color: var(--text); width: 100%; font-family: inherit; }
.dash-filter-select { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 7px 10px; font-size: 13px; color: var(--text); background: var(--white); font-family: inherit; cursor: pointer; }
.dash-filter-select:focus { outline: none; border-color: var(--brand); }

/* ── Version badge ───────────────────────── */
.version-badge { display: inline-block; background: var(--brand-tint); color: var(--brand-dark); font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 99px; margin-left: 6px; vertical-align: middle; }

/* ── History modal rows ──────────────────── */
.history-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.history-row:last-child { border-bottom: none; }

/* ── Output files section ────────────────── */
.output-files-wrap { display: flex; flex-direction: column; gap: 6px; }
.output-folder { border: 1px solid var(--border); border-radius: 8px; background: var(--white); overflow: hidden; }
.output-folder-header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; transition: background 0.12s; }
.output-folder-header:hover { background: var(--green-tint); }
.output-folder-name { font-size: 14px; font-weight: 600; color: var(--text); flex: 1; text-transform: capitalize; }
.output-folder-meta { font-size: 12px; color: var(--text-muted); }
.folder-chevron { transition: transform 0.2s; color: var(--text-muted); flex-shrink: 0; }
.output-folder.open .folder-chevron { transform: rotate(180deg); }
.output-folder-files { display: none; padding: 0 12px 8px; }
.output-folder.open .output-folder-files { display: flex; flex-direction: column; gap: 2px; }
.output-file-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; background: var(--bg); }
.output-file-row:hover { background: var(--green-tint); }
.output-file-name { font-size: 12.5px; font-weight: 500; color: var(--brand-dark); text-decoration: none; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.output-file-name:hover { text-decoration: underline; }
.output-file-meta { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }
.output-file-del { padding: 2px 8px !important; font-size: 14px; font-weight: 700; line-height: 1; }
.output-file-cb { width: 16px; height: 16px; cursor: pointer; flex-shrink: 0; accent-color: var(--brand); }
.output-bulk-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: #fff3e0; border: 1px solid #f0c040; border-radius: 8px; margin-bottom: 8px; }
.output-bulk-bar.hidden { display: none; }
#outputSelectedCount { font-size: 13px; font-weight: 600; color: var(--text); }

/* ── User cards ──────────────────────────── */
.user-card { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid var(--border); border-radius: 7px; background: var(--white); transition: border-color 0.12s; }
.user-card.active { border-color: var(--brand); background: var(--green-tint); }
.user-card-info { flex: 1; min-width: 0; }
.user-card-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.user-card-detail { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-card-actions { display: flex; gap: 4px; flex-shrink: 0; }
.user-card-btn { border: none; background: none; cursor: pointer; font-size: 12px; padding: 4px 8px; border-radius: 4px; font-family: inherit; }
.user-card-btn.select { color: var(--brand-dark); font-weight: 600; }
.user-card-btn.select:hover { background: var(--green-tint); }
.user-card-btn.edit { color: var(--text-muted); }
.user-card-btn.edit:hover { background: #eee; }
.user-card-btn.delete { color: var(--danger); font-weight: 700; }
.user-card-btn.delete:hover { background: #fef2f2; }

/* ── Help button ─────────────────────────── */
/* ── Drawer secondary button ─────────────── */
.create-section-secondary { display: flex; align-items: center; gap: 10px; padding: 10px 28px 0; }
.create-secondary-label { font-size: 11.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.btn-drawer-small { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: var(--white); border: 1px solid var(--border); border-radius: 20px; font-size: 13px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 0.12s; }
.btn-drawer-small:hover { border-color: #617286; color: #617286; background: #f4f5f7; }
.drawer-count-badge { display: inline-flex; align-items: center; justify-content: center; background: #617286; color: white; font-size: 10px; font-weight: 700; border-radius: 99px; min-width: 17px; height: 17px; padding: 0 4px; }
.drawer-variant-card { border: 1.5px solid var(--border); border-radius: 8px; padding: 14px 18px; background: var(--white); }
.drawer-variant-header { display: flex; align-items: center; justify-content: space-between; }

/* ── Pending approval section ────────────── */
#pendingSection .pending-list { display: none; }
#pendingSection.open .pending-list { display: flex; flex-direction: column; gap: 6px; }
.pending-chevron { transition: transform 0.2s; }
#pendingSection.open .pending-chevron { transform: rotate(180deg); }
.pending-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border: 1px solid #fecaca; border-radius: 8px; background: #fef2f2; }
.pending-info { display: flex; flex-direction: column; gap: 2px; }
.pending-actions { display: flex; gap: 6px; }

/* ── Pallet stacking section ──────────────── */
.pallet-stacking-section { display: none; }
:has(#palletStackingEnabled:checked) .pallet-stacking-section { display: block; }

/* ── Cooking method cards ─────────────────── */
.cooking-methods { display: flex; flex-direction: column; gap: 10px; }
.cooking-method-card { border: 1.5px solid var(--border); border-radius: 8px; padding: 12px 16px; transition: border-color 0.15s; }
.cooking-method-card:has(.cooking-cb:checked) { border-color: var(--brand); background: var(--green-tint); }
.cooking-method-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); }
.cooking-method-toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.cooking-icon { width: 28px; height: 28px; flex-shrink: 0; }
.cooking-method-fields { display: none; margin-top: 12px; }
.cooking-method-card:has(.cooking-cb:checked) .cooking-method-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cooking-method-fields .field.full { grid-column: 1 / -1; }

.btn-help { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border); background: var(--white); font-size: 16px; font-weight: 700; color: var(--brand); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.12s, border-color 0.12s; }
.btn-help:hover { background: var(--green-tint); border-color: var(--brand); }

/* ── Tour overlay ────────────────────────── */
.tour-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.55); z-index: 9000; }
.tour-overlay.hidden { display: none; }
.tour-highlight { position: fixed; border: 3px solid var(--brand); border-radius: 10px; background: rgba(255,255,255,0.15); z-index: 9001; pointer-events: none; transition: all 0.3s ease; box-shadow: 0 0 0 9999px rgba(0,0,0,0.5); }
.tour-tooltip { position: fixed; z-index: 9002; background: #fff; border-radius: 10px; padding: 18px 20px; max-width: 360px; box-shadow: 0 8px 32px rgba(0,0,0,0.18); transition: top 0.3s ease, left 0.3s ease; }
.tour-text { font-size: 14px; line-height: 1.6; color: var(--text); margin-bottom: 14px; }
.tour-nav { display: flex; align-items: center; justify-content: space-between; }
.tour-counter { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.tour-btns { display: flex; gap: 8px; }
.tour-skip { font-size: 12.5px !important; padding: 5px 12px !important; }
.tour-next { font-size: 12.5px !important; padding: 5px 14px !important; }

/* ── Dashboard two-column layout ─────────── */
.dash-main-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; padding: 0 28px 28px; align-items: start; }

.dash-groups-col { display: flex; flex-direction: column; gap: 12px; }
.dash-col-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.dash-col-title { font-size: 13px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px; }

.btn-sm { font-size: 12px !important; padding: 5px 10px !important; }

/* Collapsible sections */
.dash-collapsible { background: var(--white); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.dash-collapsible-header { display: flex; align-items: center; justify-content: space-between; padding: 11px 16px; cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; transition: background 0.12s; user-select: none; }
.dash-collapsible-header:hover { background: var(--green-tint); }
.dash-collapsible.open .dash-collapsible-header .folder-chevron { transform: rotate(180deg); }
.dash-collapsible-body { display: none; padding: 12px 16px 16px; }
.dash-collapsible.open .dash-collapsible-body { display: block; }
.dash-collapsible .recent-table-wrap { border-radius: 6px; }

/* Group cards */
.groups-empty { font-size: 13px; color: var(--text-muted); font-style: italic; padding: 18px; text-align: center; background: var(--white); border: 1.5px dashed var(--border); border-radius: 10px; }
.group-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.group-card-header { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; transition: background 0.12s; user-select: none; }
.group-card-header:hover { background: var(--green-tint); }
.group-name { font-weight: 600; font-size: 14px; color: var(--text); flex: 1; }
.group-count { font-size: 12px; color: var(--text-muted); margin-right: 4px; }
.group-card.open .group-card-header .folder-chevron { transform: rotate(180deg); }
.group-card-body { display: none; padding: 4px 14px 12px; border-top: 1px solid var(--border); }
.group-card.open .group-card-body { display: block; }
.group-product-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.group-product-row:last-of-type { border-bottom: none; }
.group-product-name { flex: 1; font-size: 13.5px; font-weight: 500; color: var(--text); }
.group-product-date { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; margin-right: 4px; }
.group-product-actions { display: flex; gap: 4px; }
.group-empty-state { font-size: 13px; color: var(--text-muted); font-style: italic; padding: 10px 0 6px; }
.group-add-row { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.group-product-select { flex: 1; padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; color: var(--text); background: var(--white); }
.group-add-checklist { flex: 1; max-height: 150px; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); }
.group-add-check-item { display: flex; align-items: center; gap: 8px; padding: 5px 10px; cursor: pointer; font-size: 13px; color: var(--text); }
.group-add-check-item:hover { background: var(--green-tint); }
.group-add-check-item input[type="checkbox"] { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; flex-shrink: 0; }

/* Recent panel */
.dash-recent-col { position: sticky; top: 20px; }
.recent-panel-card { background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); overflow: hidden; }
.recent-panel-header { padding: 11px 14px 9px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.7px; border-bottom: 1px solid var(--border); }
.recent-panel-item { padding: 9px 14px; border-bottom: 1px solid var(--border); }
.recent-panel-item:last-child { border-bottom: none; }
.recent-panel-name-row { display: flex; align-items: center; gap: 4px; }
.recent-panel-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.pencil-btn { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--white); color: var(--text-muted); font-size: 11px; font-weight: 600; cursor: pointer; transition: all 0.12s; white-space: nowrap; flex-shrink: 0; }
.pencil-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--green-tint); }
.recent-panel-date { font-size: 11px; color: var(--text-muted); margin: 2px 0 6px; }
.recent-panel-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.recent-panel-empty { font-size: 13px; color: var(--text-muted); font-style: italic; padding: 14px; text-align: center; }

/* Status badges (Draft / Final) */
.status-badge { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; white-space: nowrap; }
.status-badge.draft { background: #fee2e2; color: #b91c1c; }
.status-badge.final { background: #dcfce7; color: #15803d; }
.status-badge-sm { padding: 1px 6px; font-size: 10px; flex-shrink: 0; }

/* Gear/dots dropdown */
.gear-menu-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.gear-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0; border: 1px solid var(--border); border-radius: 5px; background: var(--white); color: var(--text-muted); cursor: pointer; transition: background 0.12s, color 0.12s; }
.gear-btn:hover { background: var(--bg); color: var(--text); }
.gear-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: var(--white); border: 1px solid var(--border); border-radius: 7px; box-shadow: 0 4px 14px rgba(0,0,0,0.12); z-index: 120; min-width: 145px; overflow: hidden; }
.gear-menu-wrap.open .gear-dropdown { display: block; }
.gear-item { display: block; width: 100%; padding: 8px 13px; text-align: left; background: none; border: none; cursor: pointer; font-size: 13px; color: var(--text); white-space: nowrap; }
.gear-item:hover { background: var(--green-tint); color: var(--brand); }

/* ── Utilities ───────────────────────────── */
.hidden { display: none !important; }
.toast { position: fixed; bottom: 24px; right: 24px; background: #1a1a1a; color: white; padding: 12px 20px; border-radius: 8px; font-size: 13px; font-weight: 500; z-index: 200; animation: fadeIn 0.2s ease; }
.toast.success { background: var(--green-dark); }
.toast.error   { background: var(--danger); }
@keyframes fadeIn { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: translateY(0); } }
