/* ============================================================
   Unilac Prijsbeheer — Application CSS
   Version: 3.0
   Aesthetic: Unilac brand — blue #284075 + orange #f28d49
   ============================================================ */

/* ── TOKENS ─────────────────────────────────────────────────*/
:root {
  /* Unilac brand palette */
  --navy:        #284075;
  --navy-mid:    #1e3564;
  --navy-light:  #3a5a9a;
  --navy-deep:   #152852;
  --gold:        #f28d49;
  --gold-light:  #f5a26e;
  --gold-pale:   #fdf0e5;
  --cream:       #f8f9fb;
  --cream-dark:  #e2e6ee;
  --white:       #FFFFFF;
  --slate:       #4a5266;
  --slate-light: #6b7489;
  --border:      #e2e6ee;
  --border-dark: #c8cdd8;
  --green:       #1a8a52;
  --green-light: #e6f7ee;
  --red:         #c93030;
  --red-light:   #fde8e8;
  --orange:      #f28d49;
  --orange-light:#fdf0e5;
  --blue:        #284075;
  --blue-light:  #e8edf5;
  --amber:       #c27a0a;
  --amber-light: #fef6e5;

  --font-display: 'Afacad', 'Segoe UI', sans-serif;
  --font-body:    'Poppins', 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', 'Consolas', monospace;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 4px rgba(21,40,82,.07), 0 1px 2px rgba(21,40,82,.04);
  --shadow:    0 4px 16px rgba(21,40,82,.08), 0 1px 3px rgba(21,40,82,.05);
  --shadow-lg: 0 8px 32px rgba(21,40,82,.12), 0 2px 8px rgba(21,40,82,.06);

  --header-h: 60px;
}

/* ── RESET ──────────────────────────────────────────────────*/
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { font-family: var(--font-body); background: var(--cream); color: var(--slate); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ── HEADER ─────────────────────────────────────────────────*/
.site-header {
  background: var(--navy-deep);
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--gold);
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 28px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 36px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
}
.brand-logo {
  width: 34px;
  height: 34px;
  background: var(--gold);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--white);
  letter-spacing: -0.5px;
}
.brand-main {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .3px;
}
.brand-sub {
  font-size: 10px;
  font-weight: 400;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-top: 2px;
}
.main-nav {
  display: flex;
  gap: 1px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255,255,255,.50);
  border-radius: var(--radius-sm);
  transition: all .2s ease;
  position: relative;
}
.nav-item:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.07); }
.nav-item.active { color: #fff; background: rgba(242,141,73,.12); }
.nav-item.active::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--gold);
  border-radius: 3px 3px 0 0;
}
.nav-icon { width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; opacity: .7; }
.nav-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(255,255,255,.55);
}
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--navy);
  border: 2px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,.8);
}
.heartbeat-dot { display: inline-block; width: 15px; height: 10px; border-radius: 50%; margin-right: 4px; cursor: help; vertical-align: middle; box-shadow: 0 0 0 2px rgba(255,255,255,.2); }

/* ── PAGE WRAPPER ───────────────────────────────────────────*/
.page-wrapper { flex: 1; max-width: 1440px; margin: 0 auto; width: 100%; padding: 28px 28px 60px; }

/* ── FOOTER ─────────────────────────────────────────────────*/
.site-footer { background: var(--navy-deep); border-top: 1px solid rgba(255,255,255,.06); padding: 16px 28px; }
.footer-inner { max-width: 1440px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; }
.footer-brand, .footer-copy { font-size: 11.5px; color: rgba(255,255,255,.25); }

/* ── FLASH MESSAGES ─────────────────────────────────────────*/
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  animation: slideDown .3s ease;
  border-left: 4px solid;
}
.flash-success { background: var(--green-light); border-left-color: var(--green); color: var(--green); }
.flash-error   { background: var(--red-light);   border-left-color: var(--red);   color: var(--red); }
.flash-info    { background: var(--blue-light);   border-left-color: var(--blue);  color: var(--blue); }
.flash-warning { background: var(--amber-light);  border-left-color: var(--amber); color: var(--amber); }
.flash-close   { background: none; border: none; font-size: 14px; opacity: .5; padding: 0 4px; }
.flash-close:hover { opacity: 1; }
@keyframes slideDown { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── PAGE HEADER ────────────────────────────────────────────*/
.page-header { margin-bottom: 28px; }
.page-header h1 { font-family: var(--font-display); font-size: 28px; font-weight: 700; color: var(--navy); margin-bottom: 4px; letter-spacing: -.3px; }
.page-header p { color: var(--slate-light); font-size: 13.5px; }
.page-header-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ── STAT CARDS ─────────────────────────────────────────────*/
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: all .25s ease;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--navy);
  opacity: 0;
  transition: opacity .25s;
}
.stat-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
  border-color: var(--blue-light);
}
.stat-card:hover::before { opacity: 1; }
.stat-card a { display: block; color: inherit; }
.stat-card .num { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--navy-deep); line-height: 1; }
.stat-card .lbl { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .6px; color: var(--slate-light); margin-top: 5px; }
.stat-card.warn .num { color: var(--amber); }
.stat-card.warn::before { background: var(--amber); }
.stat-card.alert .num { color: var(--red); }
.stat-card.alert::before { background: var(--red); }

/* ── CARDS ───────────────────────────────────────────────────*/
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}
.card-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--cream);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--navy); }
.card-body { padding: 22px; }
.card + .card { margin-top: 16px; }

/* ── SECTION LABEL ───────────────────────────────────────────*/
.section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--slate-light);
  margin-bottom: 10px;
  margin-top: 24px;
}

/* ── BUTTONS ─────────────────────────────────────────────────*/
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
  line-height: 1;
  white-space: nowrap;
}
.btn:active { transform: scale(.98); }
.btn-primary   { background: var(--gold); color: #fff; border-color: var(--gold); box-shadow: 0 1px 2px rgba(21,40,82,.05); }
.btn-primary:hover { background: #e07830; border-color: #e07830; box-shadow: 0 4px 16px rgba(242,141,73,.25); transform: translateY(-1px); }
.btn-gold      { background: var(--gold); color: #fff; border-color: var(--gold); }
.btn-gold:hover{ background: #e07830; border-color: #e07830; box-shadow: 0 4px 16px rgba(242,141,73,.25); transform: translateY(-1px); }
.btn-secondary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-secondary:hover { background: var(--navy-mid); border-color: var(--navy-mid); }
.btn-outline   { background: var(--white); border: 1px solid var(--border); color: var(--slate); box-shadow: 0 1px 2px rgba(21,40,82,.05); }
.btn-outline:hover { border-color: var(--navy-light); color: var(--navy); background: var(--blue-light); }
.btn-danger    { background: var(--white); color: var(--red); border: 1px solid var(--border); }
.btn-danger:hover { background: var(--red-light); border-color: var(--red); }
.btn-ghost     { background: transparent; color: var(--slate-light); }
.btn-ghost:hover { color: var(--navy); background: var(--blue-light); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 24px; font-size: 14px; }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── FORMS ───────────────────────────────────────────────────*/
.form-grid { display: grid; gap: 16px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid-4 { grid-template-columns: repeat(4, 1fr); }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--slate-light);
}
.field input, .field select, .field textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 14px;
  font-size: 13.5px;
  background: var(--white);
  color: var(--slate);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
  width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px var(--blue-light);
}
.field textarea { resize: vertical; min-height: 70px; }
.field .hint { font-size: 11px; color: var(--slate-light); }
.field.error input, .field.error select { border-color: var(--red); }

/* Autocomplete dropdown */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 400px;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: var(--shadow);
  display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
  padding: 9px 12px;
  cursor: pointer;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.selected { background: var(--blue-light); }
.autocomplete-item .art-nr { font-family: var(--font-mono); color: var(--navy); font-size: 11px; }
.autocomplete-item .art-desc { color: var(--slate); }

.checkbox-group { display: flex; flex-wrap: wrap; gap: 16px; }
.checkbox-item { display: flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; }
.checkbox-item input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--navy); cursor: pointer; }

/* Form section card */
.form-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
}
.form-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--slate-light);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

/* ── TABLES ──────────────────────────────────────────────────*/
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--white);
}
thead th {
  font-family: var(--font-display);
  background: var(--cream);
  color: var(--slate-light);
  padding: 12px 14px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--cream);
  vertical-align: middle;
  transition: background .15s;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f3f5fa; }
tfoot td { padding: 11px 14px; border-top: 2px solid var(--border); font-weight: 600; }

.mono { font-family: var(--font-mono); font-size: 11px; }
.dim  { color: var(--slate-light); opacity: .65; }
.art-link { font-family: var(--font-mono); font-size: 11px; font-weight: 600; color: var(--navy); }
.art-link:hover { color: var(--gold); text-decoration: underline; }

/* ── BADGES ──────────────────────────────────────────────────*/
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2px;
  white-space: nowrap;
}
.badge-navy    { background: var(--navy);       color: #fff; }
.badge-gold    { background: var(--gold-pale);  color: var(--gold); }
.badge-green   { background: var(--green-light);color: var(--green); }
.badge-red     { background: var(--red-light);  color: var(--red); }
.badge-orange  { background: var(--orange-light);color: var(--orange); }
.badge-blue    { background: var(--blue-light); color: var(--blue); }
.badge-gray    { background: var(--cream-dark); color: var(--slate); }
.badge-purple  { background: #EDE9FE; color: #6D28D9; }
.badge-cif     { background: #DBEAFE; color: #1D4ED8; }
.badge-dap     { background: #D1FAE5; color: #065F46; }
.badge-fca     { background: #FEF3C7; color: #92400E; }
.badge-fob     { background: #FCE7F3; color: #9D174D; }

/* ── TABS ────────────────────────────────────────────────────*/
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
  gap: 0;
}
.tab-item {
  padding: 10px 20px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  color: var(--slate-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: all .2s;
}
.tab-item:hover { color: var(--navy); }
.tab-item.active { color: var(--navy); border-bottom-color: var(--gold); font-weight: 600; }

/* ── SEARCH BAR ──────────────────────────────────────────────*/
.search-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.search-input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  width: 280px;
  transition: all .2s;
}
.search-input:focus { border-color: var(--navy-light); box-shadow: 0 0 0 3px var(--blue-light); }

/* ── SIDEBAR LAYOUT ──────────────────────────────────────────*/
.sidebar-layout { display: flex; gap: 0; min-height: calc(100vh - var(--header-h)); }
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.sidebar-search {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.sidebar-search input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 10px;
  font-size: 12px;
  font-family: inherit;
  outline: none;
}
.sidebar-search input:focus { border-color: var(--navy-light); box-shadow: 0 0 0 3px var(--blue-light); }
.sidebar-list { overflow-y: auto; flex: 1; }
.sidebar-item {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .1s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-item:hover { background: var(--cream); }
.sidebar-item.active { background: var(--blue-light); border-left: 3px solid var(--navy); }
.sidebar-item .item-name { font-size: 13px; font-weight: 500; }
.sidebar-item .item-meta { font-size: 11px; color: var(--slate-light); margin-top: 1px; }
.sidebar-item .item-count {
  margin-left: auto;
  background: var(--cream-dark);
  color: var(--slate);
  border-radius: 99px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-item .item-count.has { background: var(--blue-light); color: var(--blue); }
.content-area { flex: 1; padding: 24px 28px; overflow-y: auto; }

/* ── IMPORT / PROGRESS ───────────────────────────────────────*/
.import-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: border-color .2s, background .2s;
}
.import-zone:hover, .import-zone.dragover { border-color: var(--navy-light); background: var(--blue-light); }
.import-zone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.import-zone-icon { font-size: 32px; margin-bottom: 8px; }
.import-zone-text { font-size: 13px; color: var(--slate-light); }

.progress-panel { display: none; margin-top: 16px; }
.progress-panel.visible { display: block; }
.progress-item { margin-bottom: 16px; }
.progress-row { display: flex; justify-content: space-between; font-size: 12px; font-weight: 500; margin-bottom: 5px; }
.progress-bar-bg { background: var(--cream-dark); border-radius: 99px; height: 8px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 99px; background: var(--navy); transition: width .3s; width: 0%; }
.progress-bar.complete { background: var(--green); }
.progress-status { font-size: 11px; color: var(--slate-light); margin-top: 3px; }
.progress-status.error { color: var(--red); font-weight: 600; }

/* ── CALC TOOLTIP ────────────────────────────────────────────*/
.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
}
.calc-tooltip {
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  width: 280px;
  font-size: 11px;
  line-height: 1.6;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
.info-icon:hover .calc-tooltip { opacity: 1; }
.calc-row { display: flex; justify-content: space-between; gap: 8px; }
.calc-row.total { border-top: 1px solid rgba(255,255,255,.2); margin-top: 4px; padding-top: 4px; font-weight: 700; }
.calc-row.divider { border-top: 1px solid rgba(255,255,255,.1); margin: 4px 0; }

/* ── PRICE CHANGE INDICATORS ─────────────────────────────────*/
.price-up   { color: var(--red); font-weight: 700; }
.price-down { color: var(--green); font-weight: 700; }
.price-same { color: var(--slate-light); }

/* ── PAGINATION ──────────────────────────────────────────────*/
.pagination {
  display: flex;
  gap: 4px;
  margin-top: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.page-link {
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--white);
  font-size: 12px;
  color: var(--navy);
  cursor: pointer;
}
.page-link:hover { border-color: var(--navy-light); color: var(--navy); }
.page-link.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-info { font-size: 11px; color: var(--slate-light); margin-left: 8px; }

/* ── EMPTY STATE ─────────────────────────────────────────────*/
.empty-state { text-align: center; padding: 60px 24px; color: var(--slate-light); }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .4; }
.empty-state p { font-size: 14px; }

/* ── UTILS ───────────────────────────────────────────────────*/
.flex     { display: flex; }
.flex-center { display: flex; align-items: center; }
.gap-8    { gap: 8px; }
.gap-12   { gap: 12px; }
.gap-16   { gap: 16px; }
.ml-auto  { margin-left: auto; }
.mt-8     { margin-top: 8px; }
.mt-16    { margin-top: 16px; }
.mt-24    { margin-top: 24px; }
.mb-16    { margin-bottom: 16px; }
.mb-24    { margin-bottom: 24px; }
.w-full   { width: 100%; }
.text-sm  { font-size: 12px; }
.text-xs  { font-size: 11px; }
.text-muted { color: var(--slate-light); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── RESPONSIVE ──────────────────────────────────────────────*/
@media (max-width: 900px) {
  .form-grid-3 { grid-template-columns: 1fr 1fr; }
  .form-grid-4 { grid-template-columns: 1fr 1fr; }
  .sidebar-layout { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
}
@media (max-width: 900px) {
  .page-header-row { flex-direction: column; gap: 12px; }
}
@media (max-width: 600px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .page-wrapper { padding: 16px 12px 40px; }
}

/* ── Import skip reasons ─────────────────────────────────── */
.skip-reasons-box {
  margin-top: 12px;
  background: var(--amber-50, #fffbeb);
  border: 1px solid var(--amber-200, #fde68a);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 12px;
  color: var(--slate, #334155);
  max-height: 220px;
  overflow-y: auto;
}
.skip-reasons-box strong { display: block; margin-bottom: 6px; color: #92400e; }
.skip-reasons-box ul { margin: 0; padding-left: 16px; }
.skip-reasons-box li { margin-bottom: 2px; font-family: 'JetBrains Mono', monospace; font-size: 11px; }

/* ── Pricelist additions ──────────────────────────── */
.badge-amber   { background: #fef3c7; color: #92400e; }
.row-warning td { background: #fff7ed; }
.stat-card .stat-value { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--navy-deep); line-height: 1; }
.stat-card .stat-label { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .8px; color: var(--slate-light); margin-top: 4px; }

/* ── Price tooltip ───────────────────────────────────────── */
.price-tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--navy, #0f172a);
  color: #000000;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  min-width: 220px;
  max-width: 300px;
  box-shadow: 0 8px 32px rgba(0,0,0,.35);
  pointer-events: none;
}
.price-tooltip .tt-header { font-size: 13px; color: #ffffff; margin-bottom: 8px; }
.price-tooltip .tt-sep { border-top: 1px solid rgba(255,255,255,.15); margin: 8px 0; }
.price-tooltip .tt-table { width: 100%; border-collapse: collapse; }
.price-tooltip .tt-table td { padding: 1px 0; }
.price-tooltip .tt-table td:first-child { color: #94a3b8; padding-right: 12px; white-space: nowrap; }
.price-tooltip .tt-table td:last-child { text-align: right; font-family: 'JetBrains Mono', monospace; }

/* Future price indicator */
.future-price { color: var(--amber, #c27a0a); }
.future-badge {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  font-size: 9px;
  font-weight: 700;
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 4px;
  vertical-align: middle;
}

/* Inkoop hover cursor */
.inkoop-hover { cursor: help; border-bottom: 1px dashed currentColor; }

/* btn-xs */
.btn-xs { padding: 2px 8px; font-size: 11px; }

/* ── Form hints (kleine tooltip-achtige labels) ─────────── */
.form-hint {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: var(--slate-light, #94a3b8);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 1px;
}

/* ── Onboarding overview ───────────────────────────────────*/
.onb-tracker {
  display: flex; align-items: center; gap: 0;
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 20px 28px; margin-bottom: 24px; box-shadow: var(--shadow-sm);
}
.onb-tracker-phase {
  flex: 1; display: flex; align-items: center; gap: 12px; position: relative;
}
.onb-tracker-dot {
  width: 36px; height: 36px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; font-size: 16px; font-weight: 700;
  flex-shrink: 0; border: 2px solid var(--border); background: var(--cream);
  color: var(--slate-light); transition: all .2s;
}
.onb-tracker-phase.done .onb-tracker-dot {
  background: var(--green); border-color: var(--green); color: #fff;
}
.onb-tracker-phase.active .onb-tracker-dot {
  background: var(--navy); border-color: var(--navy); color: #fff;
}
.onb-tracker-info { min-width: 0; }
.onb-tracker-title { font-size: 13px; font-weight: 700; color: var(--navy); }
.onb-tracker-sub { font-size: 11px; color: var(--slate-light); margin-top: 1px; }
.onb-tracker-phase.done .onb-tracker-sub { color: var(--green); }
.onb-tracker-line {
  flex: 0 0 40px; height: 2px; background: var(--border); margin: 0 8px;
}
.onb-tracker-phase.done + .onb-tracker-line { background: var(--green); }

.onb-phase-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; margin: 32px 0 16px; border-bottom: 2px solid var(--border);
}
.onb-phase-header:first-of-type { margin-top: 0; }
.onb-phase-num {
  width: 28px; height: 28px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; background: var(--navy); color: #fff;
}
.onb-phase-label { font-family: var(--font-display); font-size: 18px; color: var(--navy); }
.onb-phase-badge { margin-left: auto; }

.form-section.customer-data {
  border-left: 3px solid var(--blue, #1D4ED8);
}
.customer-data-label {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px;
  color: var(--blue, #1D4ED8); margin-left: 8px;
}

.onb-agreements-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.onb-agreement-item {
  padding: 14px 16px; border-radius: 8px;
  background: var(--cream, #F8F5EF); border: 1px solid var(--border);
}
.onb-agreement-item .label { font-size: 12px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.onb-agreement-item .status { font-size: 12px; }
.onb-agreement-item .date { font-size: 11px; color: var(--slate-light); margin-top: 2px; }

@media (max-width: 700px) {
  .onb-tracker { flex-direction: column; gap: 12px; padding: 16px; }
  .onb-tracker-line { width: 2px; height: 20px; flex: 0 0 20px; margin: 0; }
  .onb-agreements-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-body {
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 50%, var(--navy-mid) 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-container {
  width: 100%;
  padding: 24px;
  display: flex;
  justify-content: center;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
}
.auth-card-wide { max-width: 520px; }
.auth-logo {
  text-align: center;
  margin-bottom: 24px;
}
.auth-logo img { margin: 0 auto; }
.auth-brand {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--navy);
  font-weight: 700;
}
.auth-brand-sub {
  display: block;
  font-size: 13px;
  color: var(--orange);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.auth-title {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--navy);
  text-align: center;
  margin-bottom: 8px;
}
.auth-subtitle {
  text-align: center;
  color: var(--slate);
  font-size: 14px;
  margin-bottom: 20px;
}
.auth-card .form-group {
  margin-bottom: 16px;
}
.auth-card label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 4px;
}
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  transition: border-color .15s;
}
.auth-card input:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 3px var(--blue-light);
}
.auth-card .form-check { margin-bottom: 20px; }
.check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--slate);
  cursor: pointer;
}
.check-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--navy); }
.btn-full { width: 100%; }
.auth-card .flash {
  margin-bottom: 16px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.auth-card .flash-error {
  background: var(--red-light);
  color: var(--red);
  border: 1px solid #fca5a5;
}
.auth-card .flash-success {
  background: var(--green-light);
  color: var(--green);
  border: 1px solid #86efac;
}

/* Password strength indicator */
.pw-strength {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pw-check {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
}
.pw-ok {
  background: var(--green-light);
  color: var(--green);
}
.pw-fail {
  background: var(--red-light);
  color: var(--red);
}

/* ============================================================
   LOGOUT BUTTON + USER ROLE IN HEADER
   ============================================================ */
.btn-logout {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font-size: 12px;
  color: rgba(255,255,255,.4);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all .2s;
}
.btn-logout:hover {
  color: var(--white);
  background: rgba(255,255,255,.08);
}
.logout-icon { width: 14px; height: 14px; vertical-align: -2px; flex-shrink: 0; }
.user-role {
  font-size: 10px;
  opacity: .6;
  margin-left: 2px;
}

/* ============================================================
   ROLE BADGES (user management)
   ============================================================ */
.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 3px;
  letter-spacing: .3px;
}
.role-superadmin { background: #fef3c7; color: #92400e; }
.role-admin      { background: var(--blue-light); color: var(--blue); }
.role-delete     { background: var(--red-light); color: var(--red); }
.role-edit       { background: var(--green-light); color: var(--green); }
.role-view       { background: var(--cream-dark); color: var(--slate); }

/* ============================================================
   GENERAL UTILITY — text colors, required marker
   ============================================================ */
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-center { text-align: center; }
.required    { color: var(--red); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.filter-bar input,
.filter-bar select {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
}

/* ============================================================
   PAGE HEADER ACTIONS (for history supplier detail etc.)
   ============================================================ */
.page-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================================
   ONBOARDING — public form + internal views
   ============================================================ */
.onb-section {
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.onb-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.onb-section h3 {
  font-family: var(--font-display);
  font-size: 16px;
  color: var(--navy);
  margin: 0 0 12px;
}
.onb-readonly {
  background: var(--cream-dark, #f1ede4);
  border-color: transparent;
  cursor: default;
}
.onb-url-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  word-break: break-all;
  margin-bottom: 16px;
}
.onb-url-box code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   HELP / HANDLEIDING
   ============================================================ */

.help-layout {
  display: flex;
  gap: 0;
  min-height: calc(100vh - 64px);
}

.help-sidebar {
  width: 250px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

.help-sidebar-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.help-sidebar-header h2 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 2px;
}
.help-sidebar-header p {
  font-size: 11px;
  color: var(--slate-light);
  margin: 0;
}

.help-nav { padding: 8px 0; }
.help-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background .1s, color .1s, border-color .1s;
}
.help-nav-item:hover {
  background: var(--cream);
  color: var(--navy);
}
.help-nav-item.active {
  background: var(--blue-light);
  border-left-color: var(--navy);
  color: var(--navy);
  font-weight: 600;
}
.help-nav-icon {
  font-size: 12px;
  opacity: .6;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.help-content {
  flex: 1;
  padding: 32px 36px 60px;
  max-width: 820px;
}

.help-section {
  padding-bottom: 40px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.help-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.help-section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.help-section-icon { font-size: 14px; opacity: .5; }

.help-intro {
  font-size: 14px;
  line-height: 1.7;
  color: var(--slate);
  margin-bottom: 20px;
}

.help-content h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
  margin: 24px 0 8px;
}

.help-content p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--navy);
  margin-bottom: 10px;
}

.help-list {
  margin: 0 0 14px 20px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--navy);
}
.help-list li { margin-bottom: 4px; }

.help-steps {
  list-style: none;
  counter-reset: step;
  margin: 0 0 14px 0;
  padding: 0;
}
.help-steps li {
  counter-increment: step;
  padding: 6px 0 6px 32px;
  position: relative;
  font-size: 13px;
  line-height: 1.7;
}
.help-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--navy);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--navy-light);
}

.help-screenshot {
  margin: 16px 0 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  background: var(--cream);
}
.help-screenshot img {
  width: 100%;
  display: block;
}
.help-screenshot img[src$=".png"]:not([src=""]) {
  min-height: 120px;
  background: linear-gradient(135deg, var(--cream) 25%, #f0ece4 50%, var(--cream) 75%);
}
.help-screenshot img.img-error {
  display: none;
}
.help-screenshot .img-placeholder {
  display: none;
  padding: 40px 20px;
  text-align: center;
  color: var(--slate-light);
  font-size: 13px;
  background: linear-gradient(135deg, #faf8f4 0%, #f0ece4 100%);
}
.help-screenshot .img-placeholder::before {
  content: '📷';
  display: block;
  font-size: 32px;
  margin-bottom: 8px;
  opacity: .5;
}
.help-screenshot img.img-error + .img-placeholder {
  display: block;
}
.help-screenshot-caption {
  display: block;
  padding: 8px 14px;
  font-size: 11px;
  color: var(--slate-light);
  background: var(--white);
  border-top: 1px solid var(--border);
  font-style: italic;
}

.help-tip {
  margin: 14px 0;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.6;
}
.help-tip-info {
  background: var(--blue-light);
  border: 1px solid #93C5FD;
  color: var(--blue);
}
.help-tip-warning {
  background: var(--orange-light);
  border: 1px solid #FDE68A;
  color: var(--orange);
}

/* ── CONTEXTUAL HELP BUTTON (?) ──────────────────────────── */
.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #93C5FD;
  cursor: pointer;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
  line-height: 1;
  text-decoration: none;
}
.help-btn:hover {
  background: #BFDBFE;
  transform: scale(1.1);
}

/* ── CONTEXTUAL HELP MODAL ───────────────────────────────── */
.help-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,31,58,.45);
  z-index: 500;
  display: none;
  align-items: center;
  justify-content: center;
}
.help-modal-overlay.open { display: flex; }
.help-modal {
  background: var(--white);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  margin: 24px;
}
.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.help-modal-header h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.help-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--slate-light);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.help-modal-close:hover {
  background: var(--cream-dark);
  color: var(--navy);
}
.help-modal-body {
  padding: 20px;
}
.help-modal-body p {
  font-size: 13px;
  line-height: 1.7;
  color: var(--navy);
  margin: 0 0 16px;
}
.help-modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ── CHANGELOG MODAL ─────────────────────────────────────── */
.changelog-modal { max-width: 640px; }
.changelog-body { overflow-y: auto; max-height: calc(80vh - 120px); }
.changelog-body h1 { font-size: 18px; font-weight: 700; margin: 0 0 8px; color: var(--navy); }
.changelog-body h2 { font-size: 15px; font-weight: 700; margin: 20px 0 4px; color: var(--navy); }
.changelog-body h3 { font-size: 13px; font-weight: 600; margin: 8px 0 4px; color: var(--text-muted); }
.changelog-body hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.changelog-body ul { margin: 4px 0 12px 18px; padding: 0; }
.changelog-body li { font-size: 13px; line-height: 1.7; color: var(--navy); margin-bottom: 2px; }
.changelog-body code { background: var(--cream-dark); padding: 1px 5px; border-radius: 3px; font-size: 12px; font-family: var(--font-mono); }

/* ── Responsive help ────────────────────────────────────── */
@media (max-width: 900px) {
  .help-layout { flex-direction: column; }
  .help-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .help-nav {
    display: flex;
    overflow-x: auto;
    padding: 0 8px;
  }
  .help-nav-item {
    border-left: none;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    padding: 10px 14px;
  }
  .help-nav-item.active {
    border-bottom-color: var(--navy);
    border-left-color: transparent;
  }
  .help-content { padding: 24px 16px 40px; }
}

/* ── AI CHAT PANEL ────────────────────────────────────────── */
.ai-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  background: var(--white);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 100;
  display: flex;
  flex-direction: column;
}
.ai-panel-header {
  background: var(--navy-deep);
  color: var(--white);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.ai-panel-title { font-weight: 600; font-size: 14px; }
.ai-panel-subtitle { font-size: 12px; opacity: .7; }
.ai-panel-btn {
  background: none;
  border: none;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  padding: 0 4px;
  opacity: .8;
  line-height: 1;
}
.ai-panel-btn:hover { opacity: 1; }
.ai-panel-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-msg {
  max-width: 92%;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.6;
  word-wrap: break-word;
}
.ai-msg-user {
  align-self: flex-end;
  background: var(--navy);
  color: var(--white);
}
.ai-msg-assistant {
  align-self: flex-start;
  background: var(--cream);
  border: 1px solid var(--border);
}
.ai-msg-loading {
  align-self: flex-start;
  color: var(--slate-light);
  font-style: italic;
  font-size: 13px;
}
.ai-panel-input {
  border-top: 1px solid var(--border);
  padding: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.ai-panel-input textarea {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  resize: none;
  font-family: var(--font-body);
  line-height: 1.5;
}
.ai-panel-input textarea:focus {
  outline: none;
  border-color: var(--navy-light);
  box-shadow: 0 0 0 2px var(--blue-light);
}
.ai-action-card {
  margin: 2px 0;
  padding: 12px;
  background: var(--orange-light);
  border: 1px solid var(--gold);
  border-radius: 8px;
  font-size: 13px;
  align-self: flex-start;
  max-width: 96%;
}
.ai-action-card table td {
  padding: 2px 8px 2px 0;
  vertical-align: top;
}
.ai-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.ai-quick-actions .btn { font-size: 11px; padding: 4px 10px; }
@media (max-width: 640px) {
  .ai-panel { width: 100%; }
}

/* ── NOTIFICATION BELL ────────────────────────────────────── */
.notification-bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 8px;
}
.btn-bell {
  background: none;
  border: none;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  position: relative;
  transition: color .15s, background .15s;
}
.btn-bell:hover { color: #fff; background: rgba(255,255,255,.1); }
.notif-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  border-radius: 8px;
  padding: 0 4px;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 340px;
  max-height: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.notif-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--navy);
}
.notif-list {
  overflow-y: auto;
  max-height: 360px;
}
.notif-item {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--cream-dark);
  cursor: pointer;
  transition: background .1s;
  align-items: flex-start;
}
.notif-item:hover { background: var(--cream); }
.notif-item.unread { background: var(--blue-light); }
.notif-item.unread:hover { background: #dce3f0; }
.notif-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--blue);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-dot.read { background: transparent; }
.notif-content { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 500; color: var(--navy); line-height: 1.3; }
.notif-time { font-size: 11px; color: var(--slate-light); margin-top: 2px; }
.notif-empty { padding: 24px; text-align: center; font-size: 13px; color: var(--slate-light); }

/* ── PAGE LOAD ANIMATION ────────────────────────────────────*/
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-header, .stat-grid, .card, .filter-bar, .tabs, .form-section, .flash {
  animation: fadeUp .35s ease both;
}
.stat-card:nth-child(1) { animation-delay: .05s; }
.stat-card:nth-child(2) { animation-delay: .1s; }
.stat-card:nth-child(3) { animation-delay: .15s; }
.stat-card:nth-child(4) { animation-delay: .2s; }
.stat-card:nth-child(5) { animation-delay: .25s; }
.stat-card:nth-child(6) { animation-delay: .3s; }

/* ── LOADING SPINNER ───────────────────────────────────────*/
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border-dark);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin .6s linear infinite;
  vertical-align: middle;
}
.spinner-sm { width: 12px; height: 12px; border-width: 1.5px; }
.btn.is-loading { pointer-events: none; opacity: .7; }
.btn.is-loading .spinner { margin-right: 6px; }

/* ── FLOATING ACTION BAR (pricelist) ───────────────────────*/
.floating-actions {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 90;
  box-shadow: 0 -2px 12px rgba(21,40,82,.08);
  transform: translateY(100%);
  transition: transform .25s ease;
}
.floating-actions.visible { transform: translateY(0); }

/* ── MY CUSTOMERS WIDGET ───────────────────────────────────*/
.my-customers-table { width: 100%; border-collapse: collapse; }
.my-customers-table th {
  font-size: 10px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--slate-light); padding: 6px 10px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.my-customers-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--cream);
  font-size: 13px; color: var(--navy);
}
.my-customers-table tr:hover td { background: var(--cream); }

/* ── MOBILE HAMBURGER ──────────────────────────────────────*/
.hamburger-btn {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 6px; color: #fff;
}
.hamburger-btn svg { display: block; }

@media (max-width: 900px) {
  .hamburger-btn { display: flex; align-items: center; }
  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--navy-deep);
    flex-direction: column;
    padding: 8px 0;
    box-shadow: var(--shadow-lg);
    z-index: 200;
  }
  .main-nav.open { display: flex; }
  .main-nav .nav-item {
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,.06);
  }
  .header-actions { gap: 8px; }
  .header-user .user-role { display: none; }
  .logout-text { display: none; }
}

/* ── ACTIVITY TIMELINE ─────────────────────────────────────*/
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item {
  display: flex; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--cream);
  font-size: 13px;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; margin-top: 6px;
}
.timeline-dot.blue { background: var(--blue); }
.timeline-dot.green { background: var(--green); }
.timeline-dot.gold { background: var(--gold); }
.timeline-dot.red { background: var(--red); }
.timeline-content { flex: 1; min-width: 0; }
.timeline-title { font-weight: 500; color: var(--navy); }
.timeline-meta { font-size: 11px; color: var(--slate-light); margin-top: 2px; }

/* ── SPARKLINE CONTAINER ───────────────────────────────────*/
.sparkline-wrap {
  display: inline-block; width: 60px; height: 20px;
  vertical-align: middle; margin-left: 6px;
}
.sparkline-wrap canvas { width: 100%; height: 100%; }

/* ── MARGIN ANALYSIS ───────────────────────────────────────*/
.margin-bar {
  display: flex; height: 20px; border-radius: 4px; overflow: hidden;
  background: var(--cream);
}
.margin-bar-seg { transition: width .3s ease; }

/* ── DRAG REORDER ──────────────────────────────────────────*/
.drag-handle {
  cursor: grab; opacity: .3; font-size: 16px;
  user-select: none; padding: 0 6px;
  transition: opacity .15s;
}
.drag-handle:hover { opacity: .7; }
.card.dragging { opacity: .5; outline: 2px dashed var(--gold); }
.card.drag-over { outline: 2px solid var(--gold); }

/* ── ESTIMATED PRICE INDICATOR ─────────────────────────────*/
.est-price {
  font-size: 11px; color: var(--slate-light);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.est-price.has-price { color: var(--green); }
.est-price.no-price { color: var(--red); font-style: italic; }