:root {
  color-scheme: light;
  --dur: 0.18s;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}
* { box-sizing: border-box; }

body {
  margin: 0; font-size: 16px; line-height: 1.55;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
}

body.brand-ffd {
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  --ink: #12242e; --ink-2: #4d6470; --ink-3: #7d929c;
  --line: #dfe7ea; --line-2: #c4d2d8;
  --bg: #eef3f5; --card: #ffffff; --card-2: #f6fafb;
  --topbar: #0e1a2b; --topbar-ink: #ffffff; --topbar-line: transparent;
  --brand: #0d9488; --brand-2: #0b7c72; --brand-soft: #e0f2f0; --brand-border: #b6dfdb;
  --accent: #38bdf8;
  --ok: #2c7a4b; --ok-soft: #e5f3ea;
  --warn-soft: #fdf3d7; --warn-line: #d9b23f;
  --danger: #9a1f1f;
  --radius: 12px; --radius-s: 10px;
  --shadow: 0 1px 2px rgba(14, 26, 43, 0.05), 0 4px 16px rgba(14, 26, 43, 0.06);
  --shadow-lift: 0 2px 4px rgba(14, 26, 43, 0.08), 0 10px 28px rgba(14, 26, 43, 0.12);
}

body.brand-dealbeter {
  --font: "Century Gothic", Futura, "Segoe UI", system-ui, sans-serif;
  --ink: #111111; --ink-2: #555555; --ink-3: #999999;
  --line: #e8e8e8; --line-2: #d4d4d4;
  --bg: #fafafa; --card: #ffffff; --card-2: #f5f5f5;
  --topbar: #ffffff; --topbar-ink: #111111; --topbar-line: #e8e8e8;
  --brand: #111111; --brand-2: #333333; --brand-soft: #f0f0f0; --brand-border: #dddddd;
  --accent: #111111;
  --ok: #1f6b40; --ok-soft: #edf5f0;
  --warn-soft: #faf5e4; --warn-line: #c9b168;
  --danger: #9a1f1f;
  --radius: 8px; --radius-s: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 3px 12px rgba(0, 0, 0, 0.05);
  --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.07), 0 10px 24px rgba(0, 0, 0, 0.1);
}

h1 { font-size: 1.4rem; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 0 0 8px; letter-spacing: -0.005em; }
p { margin: 0 0 10px; }

@keyframes rijIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { 0% { opacity: 0; transform: translateY(-14px) scale(0.97); } 60% { opacity: 1; transform: translateY(2px) scale(1.005); } 100% { opacity: 1; transform: none; } }
@keyframes toastUit { to { opacity: 0; transform: translateY(-10px); } }
@keyframes chevronIn { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes meterIn { from { width: 0; } }
@keyframes balkOp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes pulse { 0% { transform: scale(0.94); } 55% { transform: scale(1.02); } 100% { transform: scale(1); } }

.topbar {
  display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  padding: 10px 18px; background: var(--topbar); color: var(--topbar-ink);
  border-bottom: 1px solid var(--topbar-line);
  position: sticky; top: 0; z-index: 30;
}
.topbar a, .topbar button { color: var(--topbar-ink); }
.brand { display: inline-flex; align-items: center; text-decoration: none; color: var(--topbar-ink); }
.brand svg { display: block; }
nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
nav a {
  text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: 0.93rem;
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
body.brand-ffd nav a:hover { background: rgba(255, 255, 255, 0.12); }
body.brand-ffd nav a.active { background: rgba(255, 255, 255, 0.2); font-weight: 600; }
body.brand-dealbeter nav a:hover { background: #f0f0f0; }
body.brand-dealbeter nav a.active { background: #111; color: #fff; font-weight: 600; }
nav a:active { transform: scale(0.96); }
.topbar form button {
  background: transparent; border: 1px solid currentColor; opacity: 0.75;
  min-height: 34px; padding: 4px 14px; border-radius: 999px; font-size: 0.88rem;
}
.topbar form button:hover { opacity: 1; background: transparent; color: var(--topbar-ink); transform: none; }
.mainnav a { display: inline-flex; align-items: center; gap: 7px; }
.mainnav .ic { opacity: 0.8; }
.ic { flex-shrink: 0; vertical-align: -3px; }
button .ic, .button .ic { vertical-align: -2px; }

.page-kop { margin: 6px 2px 18px; animation: rijIn 0.4s var(--ease) backwards; }
.oogbrauw { margin: 0 0 2px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-3); }
.page-kop h1 { font-size: 1.75rem; letter-spacing: -0.02em; }
.page-kop .hint { margin-top: 2px; }

.toast {
  position: sticky; top: 64px; z-index: 40;
  display: flex; align-items: center; gap: 10px; width: fit-content; max-width: 100%;
  margin: 0 auto 14px; padding: 11px 18px;
  background: var(--ink); color: #fff; border-radius: 999px; box-shadow: var(--shadow-lift);
  font-weight: 600; font-size: 0.93rem;
  animation: toastIn 0.4s var(--ease), toastUit 0.4s ease 3.6s forwards;
}
.toast .ic { color: #4ade80; }

.sneltegels { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 14px; }
.sneltegel {
  display: grid; gap: 6px; justify-items: start; padding: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  color: inherit; text-decoration: none; box-shadow: var(--shadow);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.sneltegel:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); border-color: var(--brand); }
.sneltegel:active { transform: scale(0.98); }
.sneltegel .ic { color: var(--brand); }
.sneltegel strong { font-size: 1rem; letter-spacing: -0.01em; }
.sneltegel span { font-size: 0.82rem; color: var(--ink-2); line-height: 1.35; }
.sneltegel.accent { background: var(--brand); border-color: var(--brand); }
.sneltegel.accent .ic, .sneltegel.accent strong { color: #fff; }
.sneltegel.accent span { color: rgba(255, 255, 255, 0.75); }

.statrij { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { display: grid; gap: 2px; padding: 14px 16px; background: var(--card-2); border-radius: var(--radius); border: 1px solid var(--line); }
.stat-label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.stat-waarde { font-size: 1.45rem; font-weight: 700; letter-spacing: -0.02em; }
.stat-sub { font-size: 0.8rem; color: var(--ink-2); }

.voortgang { display: block; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; margin: 2px 0; }
.voortgang i { display: block; height: 100%; border-radius: 999px; background: var(--brand); animation: meterIn 0.7s var(--ease); }

.rack-kop { align-items: center; }
.vulmeter { flex: 1; min-width: 90px; max-width: 220px; height: 7px; border-radius: 999px; background: var(--line); overflow: hidden; }
.vulmeter i { display: block; height: 100%; border-radius: 999px; background: var(--brand); animation: meterIn 0.8s var(--ease); }

.tabbar { display: none; }
.meer-menu {
  display: grid; gap: 6px;
  position: fixed; left: 10px; right: 10px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 60;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; box-shadow: var(--shadow-lift);
  animation: balkOp 0.22s var(--ease);
}
.meer-menu[hidden] { display: none; }
.meer-menu a, .meer-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; border-radius: 10px; text-decoration: none; color: var(--ink);
  background: transparent; border: 0; font: inherit; font-weight: 600; text-align: left; min-height: 0;
}
.meer-menu a:active, .meer-menu button:active { background: var(--brand-soft); }
.meer-menu form { margin: 4px 0 0; border-top: 1px solid var(--line); padding-top: 8px; }
.meer-menu .ic { color: var(--brand); }
.slot.met-foto strong { text-shadow: 0 1px 3px rgba(255, 255, 255, 0.9); }
.slot.met-foto span { color: var(--ink-2); text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9); }

.auth-logo svg polygon:nth-child(1) { animation: chevronIn 0.5s var(--ease) 0.1s backwards; }
.auth-logo svg polygon:nth-child(2) { animation: chevronIn 0.5s var(--ease) 0.25s backwards; }
.auth-logo svg text, .auth-logo svg rect { animation: rijIn 0.5s var(--ease) 0.4s backwards; }

.container { max-width: 1140px; margin: 0 auto; padding: 18px 16px 40px; }
.container > * { animation: rijIn 0.35s var(--ease) backwards; }
.container > *:nth-child(2) { animation-delay: 0.05s; }
.container > *:nth-child(3) { animation-delay: 0.1s; }
.container > *:nth-child(4) { animation-delay: 0.15s; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 14px; box-shadow: var(--shadow); }
.narrow { max-width: 440px; margin: 16px auto; }
.auth-logo { display: flex; justify-content: center; padding: 40px 0 8px; animation: rijIn 0.45s var(--ease) backwards; }
.grid { display: grid; gap: 14px; }
.two { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stack { display: grid; gap: 12px; }
.small { max-width: 460px; }

label { display: grid; gap: 5px; font-weight: 600; font-size: 0.93rem; }
.hint { font-weight: 400; font-size: 0.85rem; color: var(--ink-2); margin: 0; }
.hint-block { background: var(--brand-soft); border: 1px solid var(--brand-border); border-radius: var(--radius-s); padding: 11px 13px; font-size: 0.9rem; color: var(--ink); margin-bottom: 12px; }
input, textarea, select, button, .button {
  min-height: 44px; border: 1px solid var(--line-2); border-radius: var(--radius-s);
  padding: 10px 13px; font: inherit; background: var(--card); color: var(--ink);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background var(--dur) var(--ease), transform var(--dur) var(--ease);
}
input:hover, textarea:hover, select:hover { border-color: var(--ink-3); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
textarea { min-height: 90px; }
button, .button {
  background: var(--brand); border-color: var(--brand); color: #fff; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; font-weight: 600; letter-spacing: 0.01em;
}
button:hover, .button:hover { background: var(--brand-2); border-color: var(--brand-2); box-shadow: var(--shadow); }
button:active, .button:active { transform: scale(0.97); }
.secondary { background: var(--card); border-color: var(--line-2); color: var(--ink); font-weight: 500; }
.secondary:hover { background: var(--card-2); border-color: var(--ink-3); }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { min-height: auto; }

.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.toolbar input { flex: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.card {
  display: grid; gap: 4px; padding: 13px 15px; border: 1px solid var(--line);
  border-radius: var(--radius); color: inherit; text-decoration: none; background: var(--card);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.split { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: baseline; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }
.metric { font-size: 1.6rem; font-weight: 700; margin: 6px 0; letter-spacing: -0.02em; }
.muted { color: var(--ink-2); font-size: 0.9rem; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--brand-soft); color: var(--ink); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }

.photos { display: grid; grid-template-columns: repeat(auto-fill, 104px); gap: 8px; justify-content: start; }
.photos img { width: 104px; height: 104px; object-fit: cover; border-radius: var(--radius-s); border: 1px solid var(--line); cursor: zoom-in; transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.photos img:hover { transform: scale(1.04); box-shadow: var(--shadow-lift); }

.lichtbak { position: fixed; inset: 0; z-index: 100; background: rgba(10, 14, 18, 0.92); display: grid; animation: rijIn 0.18s var(--ease); }
.lichtbak .lb-scroller { overflow: auto; display: grid; place-items: center; width: 100%; height: 100%; }
.lichtbak img { max-width: 94vw; max-height: 90vh; border-radius: 6px; cursor: zoom-in; display: block; margin: auto; }
.lichtbak.zoom-1 img { max-width: 170vw; max-height: none; width: 170vw; cursor: zoom-in; }
.lichtbak.zoom-2 img { max-width: 280vw; max-height: none; width: 280vw; cursor: zoom-out; }
.lichtbak .lb-sluit { position: fixed; top: 12px; right: 12px; z-index: 101; background: rgba(255, 255, 255, 0.14); border: 0; color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; line-height: 1; }
.lichtbak .lb-pijl { position: fixed; top: 50%; transform: translateY(-50%); z-index: 101; background: rgba(255, 255, 255, 0.14); border: 0; color: #fff; width: 44px; height: 60px; border-radius: 10px; font-size: 26px; }
.lichtbak .lb-vorige { left: 8px; }
.lichtbak .lb-volgende { right: 8px; }
.lichtbak .lb-teller { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.8); font-size: 0.85rem; z-index: 101; }
.warning { background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--radius-s); padding: 12px; margin-bottom: 14px; }
.error { color: var(--danger); }
.empty { text-align: center; padding: 36px 16px; color: var(--ink-2); }
.empty strong { display: block; font-size: 1.05rem; color: var(--ink); margin-bottom: 4px; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; }

.print-qr { text-align: center; background: white; padding: 24px; }
.print-qr h1 { font-size: 48px; }
.print-qr img { width: min(70vw, 420px); }
.qr-sheet { background: white; padding: 16px; }
.qr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.qr-label { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px; display: grid; justify-items: center; gap: 4px; break-inside: avoid; }
.qr-label img { width: 120px; height: 120px; }

.warehouse { display: grid; gap: 14px; }
.rack { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.rack h2 { margin: 0; }
.rack-row { display: grid; grid-template-columns: 82px 1fr; gap: 10px; align-items: stretch; margin: 10px 0; }
.level { display: grid; align-content: center; justify-items: start; font-size: 0.78rem; font-weight: 700; color: var(--ink-2); border-right: 2px solid var(--line); padding-right: 8px; }
.level small { font-weight: 400; color: var(--ink-3); }
.slots { display: flex; flex-wrap: wrap; gap: 8px; min-height: 84px; border-radius: var(--radius-s); padding: 2px; transition: background var(--dur) var(--ease); }
.slots.drop-hover { outline: 3px dashed var(--brand); outline-offset: 2px; background: var(--brand-soft); }
.move-mode .warehouse .slots { outline: 2px dashed var(--brand); outline-offset: 2px; cursor: pointer; }
.move-mode .warehouse .slots:active { background: var(--brand-soft); }
.slot {
  width: 118px; min-height: 78px; border: 2px dashed var(--line-2); border-radius: var(--radius-s);
  padding: 8px 10px; text-decoration: none; color: inherit; display: grid; align-content: space-between;
  position: relative; background: var(--card);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease), background var(--dur) var(--ease);
  animation: rijIn 0.3s var(--ease) backwards;
}
.slot span { font-size: 0.7rem; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }
.slot strong { font-size: 0.86rem; overflow-wrap: anywhere; }
.slot em { color: var(--ink-3); font-style: normal; font-size: 0.85rem; line-height: 1.3; }
.slot em small { font-size: 0.72rem; }
.slot:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.slot.free:hover { border-color: var(--brand); background: var(--brand-soft); }
.slot.free span { font-size: 1.15rem; color: var(--brand); }
.slot.full { border-style: solid; border-color: var(--line); background: var(--card-2); align-content: center; justify-items: center; }
.slot.full:hover { transform: none; box-shadow: none; }
.slot.occupied { border-style: solid; cursor: grab; }
.slot.occupied.dragging { opacity: 0.4; cursor: grabbing; }
.slot.occupied::after {
  content: ""; position: absolute; top: 7px; right: 7px; width: 18px; height: 18px;
  border-radius: 50%; border: 2px solid rgba(0, 0, 0, 0.22); background: var(--card);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.slot.selected { outline: 3px solid var(--brand); outline-offset: 2px; animation: pulse 0.25s var(--ease); }
.slot.selected::after { content: "✓"; display: grid; place-content: center; background: var(--brand); border-color: var(--brand); color: #fff; font-size: 12px; font-weight: 700; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.85rem; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; vertical-align: -2px; margin-right: 5px; }

.selectbar {
  position: sticky; bottom: 10px; z-index: 20; background: var(--topbar); color: #fff;
  border-radius: var(--radius); padding: 13px 16px; margin-top: 14px; display: none;
  box-shadow: var(--shadow-lift);
}
body.brand-dealbeter .selectbar { background: #111111; }
.selectbar.visible { display: block; animation: balkOp 0.28s var(--ease); }
.selectbar .split { align-items: center; }
.selectbar .actions button { min-height: 40px; font-size: 0.9rem; }
body.brand-dealbeter .selectbar .actions button:not(.secondary) { background: #ffffff; border-color: #ffffff; color: #111111; }
body.brand-dealbeter .selectbar .actions button:not(.secondary):hover { background: #e8e8e8; }
.selectbar .secondary { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.selectbar .secondary:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.selectbar .muted { color: rgba(255, 255, 255, 0.7) !important; }
.map-form { display: none; margin-top: 12px; }
.map-form.visible { display: block; animation: rijIn 0.25s var(--ease); }

.rack-admin { display: grid; grid-template-columns: 1.5fr repeat(3, minmax(90px, 0.6fr)) auto auto; gap: 8px; align-items: end; padding: 10px 0; border-bottom: 1px solid var(--line); }

.help h2 { margin-top: 20px; }
.help ol { padding-left: 20px; }
.help li { margin-bottom: 6px; }

@media (max-width: 640px) {
  .container { padding: 10px 10px 120px; }
  .topbar { position: static; }
  .topbar .mainnav, .topbar .nav-tekst { display: none; }
  .topbar { justify-content: space-between; }
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: var(--card); border-top: 1px solid var(--line);
    padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
    justify-content: space-around; align-items: center;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.07);
  }
  .tabbar a, .tabbar > button { display: grid; justify-items: center; gap: 2px; text-decoration: none; color: var(--ink-3); font-size: 0.68rem; font-weight: 600; padding: 4px 8px; border-radius: 10px; background: transparent; border: 0; min-height: 0; transition: color var(--dur) var(--ease), transform var(--dur) var(--ease); }
  .tabbar > button.open { color: var(--brand); }
  .tabbar a.active { color: var(--brand); }
  .tabbar a:active { transform: scale(0.92); }
  .tabbar .tab-plus { background: var(--brand); color: #fff; border-radius: 50%; width: 52px; height: 52px; display: grid; place-content: center; margin-top: -22px; box-shadow: var(--shadow-lift); }
  .tabbar .tab-plus.active { color: #fff; }
  .selectbar { position: fixed; left: 8px; right: 8px; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .page-kop h1 { font-size: 1.45rem; }
  .toast { top: 8px; }
  .row { align-items: flex-start; flex-direction: column; }
  .toolbar { flex-direction: column; }
  .rack-row { grid-template-columns: 58px 1fr; }
  .slot { width: calc(33.33% - 6px); }
  .rack-admin { grid-template-columns: 1fr; }
}
@media print {
  .topbar, .selectbar, .tabbar, .toast { display: none !important; }
  .container { max-width: none; }
  .panel { border: 0; box-shadow: none; }
  .qr-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
