/* ==========================================================================
   SoonTech Transfert — Design System
   Tokens (color / type / shadow) lifted from the real soontech.ma brand kit
   (Inter + Space Grotesk, green/ink/paper palette). Light-only, no dark mode.
   Fonts are self-hosted (2 woff2 files, ~70KB total) so branding still loads
   fully offline on low-end PDA hardware — no CDN dependency.
   ========================================================================== */

@font-face{
  font-family:'Inter';
  font-style:normal;
  font-weight:400 700;
  font-display:swap;
  src:url('../assets/fonts/inter-var.woff2') format('woff2');
}
@font-face{
  font-family:'Space Grotesk';
  font-style:normal;
  font-weight:500 700;
  font-display:swap;
  src:url('../assets/fonts/space-grotesk-var.woff2') format('woff2');
}

:root{
  --brand-green:      #22C55E;
  --brand-green-dark: #16A34A;
  --brand-green-light:#E8F9EE;
  --brand-green-soft: #DCFCE7;
  --brand-dark:        #141416;

  --bg:            #F7F7F4;
  --surface:       #FFFFFF;
  --surface-alt:   #F1F1EE;
  --border:        rgba(20,20,22,.08);
  --border-strong: rgba(20,20,22,.16);

  --text:          #141416;
  --text-muted:    #6B7280;
  --text-faint:    #9A9CA2;
  --on-brand:      #FFFFFF;

  --danger:      #E23D3D;
  --danger-bg:   #FDECEC;
  --warning:     #E08A00;
  --warning-bg:  #FEF3DD;
  --info:        #3B82F6;
  --info-bg:     #EAF2FE;
  --violet:      #8B5CF6;
  --violet-bg:   #F1EBFE;
  --success:     var(--brand-green);
  --success-bg:  var(--brand-green-light);
  --neutral:     #6B7280;
  --neutral-bg:  #EEF0F2;

  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --shadow-1: 0 1px 2px rgba(20,20,22,.04), 0 4px 12px rgba(20,20,22,.04);
  --shadow-2: 0 1px 2px rgba(20,20,22,.05), 0 8px 24px rgba(20,20,22,.08);

  --nav-h: 64px;
  --topbar-h: 56px;
  --sidebar-w: 244px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: 'Space Grotesk', var(--font);
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  color-scheme: light;
}

*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:var(--font);
  background:var(--bg);
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
h1,h2,h3,h4,p{ margin:0; }
ul{ list-style:none; margin:0; padding:0; }
a{ color:inherit; text-decoration:none; }
button{ font-family:inherit; }
input,select,textarea{ font-family:inherit; }
img{ max-width:100%; display:block; }
/* Every icon gets a sane default size — without this, any <svg> not covered
   by a more specific rule below falls back to the browser's replaced-element
   default (300×150) and renders huge/broken. Specific rules further down
   (.btn svg, .badge svg, etc.) override this via normal CSS specificity. */
svg{ display:block; flex-shrink:0; width:20px; height:20px; }

.mono-label{
  font-family:var(--font-mono);
  letter-spacing:.06em;
  text-transform:uppercase;
}

/* ---------------------------------- Layout ---------------------------------- */
#app{
  display:flex;
  min-height:100%;
}
.app-sidebar{
  display:none;
}
.app-body{
  flex:1;
  min-width:0;
  display:flex;
  flex-direction:column;
  min-height:100vh;
}
.topbar{
  height:var(--topbar-h);
  padding-top:var(--safe-t);
  display:flex;
  align-items:center;
  gap:10px;
  padding-left:14px;
  padding-right:14px;
  background:var(--surface);
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:30;
}
.topbar-title{
  font-family:var(--font-display);
  font-size:16px;
  font-weight:700;
  flex:1;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.topbar-sub{
  font-size:12px;
  color:var(--text-muted);
  font-weight:500;
}
.topbar-logo{
  height:22px;
  width:auto;
  flex-shrink:0;
}
@media (min-width:900px){
  /* Desktop already shows the brand in the sidebar — no need to repeat it here. */
  .topbar-logo{ display:none; }
}
.topbar-btn{
  min-width:36px;height:36px;
  display:flex;align-items:center;justify-content:center;
  gap:6px; padding:0 8px;
  border-radius:var(--radius-sm);
  background:transparent;
  border:none;
  color:var(--text);
  flex-shrink:0;
}
.topbar-btn svg{ width:19px;height:19px; }
.topbar-btn .tb-label{ font-size:11.5px; font-weight:700; white-space:nowrap; }
.topbar-btn:active{ background:var(--surface-alt); }
.topbar-btn.has-dot{ position:relative; }
.topbar-btn.has-dot::after{
  content:"";
  position:absolute; top:6px; right:6px;
  width:8px;height:8px;border-radius:50%;
  background:var(--danger);
  border:2px solid var(--surface);
}

main#view{
  flex:1;
  padding:14px 14px calc(var(--nav-h) + 24px + var(--safe-b));
  max-width:920px;
  width:100%;
  margin:0 auto;
}

.bottom-nav{
  position:fixed;
  left:0;right:0;bottom:0;
  height:calc(var(--nav-h) + var(--safe-b));
  padding-bottom:var(--safe-b);
  background:var(--surface);
  border-top:1px solid var(--border);
  display:flex;
  z-index:40;
}
.bottom-nav a{
  flex:1;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  color:var(--text-faint);
  font-size:10.5px;
  font-weight:600;
  position:relative;
}
.bottom-nav a svg{ width:22px;height:22px; }
.bottom-nav a.active{ color:var(--brand-green-dark); }
.bottom-nav .fab{
  width:52px;height:52px;
  border-radius:50%;
  background:var(--brand-green);
  color:#fff;
  display:flex;align-items:center;justify-content:center;
  margin-top:-22px;
  box-shadow:0 4px 14px rgba(34,197,94,.4);
  border:4px solid var(--bg);
}
.bottom-nav .fab svg{ width:24px;height:24px; }

@media (min-width: 900px){
  .app-sidebar{
    display:flex;
    flex-direction:column;
    width:var(--sidebar-w);
    flex-shrink:0;
    background:var(--surface);
    border-right:1px solid var(--border);
    color:var(--text);
    min-height:100vh;
    position:sticky;
    top:0;
  }
  .bottom-nav{ display:none; }
  main#view{ padding:22px 28px 32px; max-width:1080px; }
  .topbar{ padding-left:22px; padding-right:22px; }
}

.sidebar-brand{
  display:flex; align-items:center; gap:10px;
  padding:20px 18px 16px;
}
.sidebar-brand img{ height:24px; }
.sidebar-nav{ flex:1; padding:8px 10px; overflow-y:auto; }
.sidebar-nav a{
  display:flex; align-items:center; gap:12px;
  padding:10px 12px;
  border-radius:var(--radius-sm);
  color:var(--text-muted);
  font-size:13.5px;
  font-weight:600;
  margin-bottom:2px;
}
.sidebar-nav a svg{ width:19px;height:19px; opacity:.85; }
.sidebar-nav a.active{ background:var(--brand-green-light); color:var(--brand-green-dark); }
.sidebar-nav a.active svg{ color:var(--brand-green-dark); opacity:1; }
.sidebar-nav a:active{ background:var(--surface-alt); }
.sidebar-section{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.06em;
  color:var(--text-faint); font-weight:700;
  padding:14px 12px 6px;
}
.sidebar-foot{
  padding:12px; border-top:1px solid var(--border);
}
.sidebar-user{ display:flex; align-items:center; gap:10px; padding:8px; border-radius:var(--radius-sm); }
.sidebar-user:active{ background:var(--surface-alt); }
.sidebar-user .name{ font-size:13px; font-weight:700; color:var(--text); }
.sidebar-user .role{ font-size:11px; color:var(--text-faint); }

/* ---------------------------------- Avatar ---------------------------------- */
.avatar{
  width:36px;height:36px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  font-weight:700; font-size:13px; color:#fff; flex-shrink:0;
  background:var(--brand-green);
}
.avatar.sm{ width:28px;height:28px;font-size:11px; }
.avatar.lg{ width:56px;height:56px;font-size:19px; }

/* ---------------------------------- Cards ---------------------------------- */
.card{
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:16px;
  box-shadow:var(--shadow-1);
}
.card + .card{ margin-top:12px; }
.section-title{
  font-family:var(--font-mono);
  font-size:11.5px; font-weight:600; color:var(--text-faint);
  text-transform:uppercase; letter-spacing:.07em;
  margin:22px 2px 10px;
}
.section-title:first-child{ margin-top:0; }
.row-between{ display:flex; align-items:center; justify-content:space-between; gap:10px; }
.stack{ display:flex; flex-direction:column; gap:10px; }
.grid-2{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.grid-3{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
@media (max-width:480px){ .grid-3{ grid-template-columns:repeat(3,1fr); gap:8px; } }

/* KPI */
.kpi{
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:14px; box-shadow:var(--shadow-1);
}
.kpi .kpi-icon{
  width:34px;height:34px;border-radius:10px;
  display:flex;align-items:center;justify-content:center;
  margin-bottom:10px;
}
.kpi .kpi-icon svg{ width:18px;height:18px; }
.kpi .kpi-val{ font-family:var(--font-display); font-size:23px; font-weight:700; letter-spacing:-.01em; }
.kpi .kpi-label{ font-size:11.5px; color:var(--text-muted); font-weight:600; margin-top:2px; }
.kpi .kpi-delta{ font-size:11px; font-weight:700; margin-top:6px; display:inline-flex; align-items:center; gap:3px; }

/* ---------------------------------- Buttons ---------------------------------- */
.btn{
  appearance:none; border:none; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  font-weight:700; font-size:14px;
  border-radius:var(--radius);
  padding:12px 18px;
  min-height:46px;
  transition:transform .1s ease, opacity .15s ease;
  white-space:nowrap;
}
.btn:active{ transform:scale(.97); }
.btn svg{ width:18px;height:18px; }
.btn-block{ width:100%; }
.btn-primary{ background:var(--brand-green); color:#fff; }
.btn-primary:active{ background:var(--brand-green-dark); }
.btn-dark{ background:var(--brand-dark); color:#fff; }
.btn-outline{ background:transparent; border:1.5px solid var(--border-strong); color:var(--text); }
.btn-ghost{ background:var(--surface-alt); color:var(--text); }
.btn-danger{ background:var(--danger); color:#fff; }
.btn-danger-outline{ background:var(--danger-bg); color:var(--danger); }
.btn-sm{ min-height:36px; padding:8px 12px; font-size:12.5px; border-radius:var(--radius-sm); }
.btn-lg{ min-height:56px; font-size:15.5px; }
.btn-icon{ min-height:auto; width:40px; height:40px; padding:0; border-radius:var(--radius-sm); }
.btn:disabled{ opacity:.4; pointer-events:none; }
.btn-block-row{ display:flex; gap:10px; }
.btn-block-row .btn{ flex:1; }

/* Small +/- stepper, used for admin quantity corrections */
.stepper{ display:flex; align-items:center; gap:6px; }
.stepper button{
  width:30px;height:30px; border-radius:8px; border:1.5px solid var(--border-strong);
  background:var(--surface); color:var(--text); display:flex; align-items:center; justify-content:center;
  cursor:pointer; flex-shrink:0;
}
.stepper button:active{ background:var(--surface-alt); }
.stepper button svg{ width:15px;height:15px; }
.stepper .stepper-val{ min-width:26px; text-align:center; font-weight:800; font-size:14px; }

/* ---------------------------------- Forms ---------------------------------- */
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:12.5px; font-weight:700; color:var(--text-muted); }
.input, .select, textarea.input{
  width:100%;
  background:var(--surface);
  border:1.5px solid var(--border-strong);
  border-radius:var(--radius);
  padding:12px 13px;
  font-size:14.5px;
  color:var(--text);
  min-height:46px;
}
.input:focus, .select:focus, textarea.input:focus{ outline:none; border-color:var(--brand-green); box-shadow:0 0 0 3px var(--brand-green-soft); }
textarea.input{ min-height:80px; resize:vertical; }
.input-search{ position:relative; }
.input-search svg{ position:absolute; left:13px; top:50%; transform:translateY(-50%); color:var(--text-faint); width:18px;height:18px; }
.input-search input{ padding-left:38px; }
.field-hint{ font-size:11.5px; color:var(--text-faint); }
.field-error{ font-size:11.5px; color:var(--danger); font-weight:600; }
.switch{ position:relative; width:44px; height:26px; flex-shrink:0; }
.switch input{ opacity:0; width:100%; height:100%; position:absolute; margin:0; cursor:pointer; z-index:1; }
.switch .track{ position:absolute; inset:0; background:var(--border-strong); border-radius:999px; transition:background .15s; }
.switch .thumb{ position:absolute; top:3px; left:3px; width:20px; height:20px; border-radius:50%; background:#fff; transition:transform .15s; box-shadow:0 1px 3px rgba(0,0,0,.3); }
.switch input:checked + .track{ background:var(--brand-green); }
.switch input:checked ~ .thumb{ transform:translateX(18px); }

/* Persistent inline scan bar — the PDA-first scanning input (no camera, no modal) */
.scan-bar{
  display:flex; align-items:center; gap:10px;
  background:var(--brand-dark); border-radius:var(--radius);
  padding:12px 14px;
}
.scan-bar svg{ color:var(--brand-green); width:20px;height:20px; flex-shrink:0; }
.scan-bar input{
  flex:1; background:transparent; border:none; outline:none;
  color:#fff; font-size:15px; font-weight:600; min-width:0;
  font-family:var(--font-mono);
}
.scan-bar input::placeholder{ color:rgba(255,255,255,.4); font-family:var(--font); font-weight:500; }
.scan-bar button{
  background:var(--brand-green); border:none; color:#fff;
  width:34px;height:34px;border-radius:9px; display:flex;align-items:center;justify-content:center; flex-shrink:0;
}
.scan-bar button svg{ color:#fff; width:17px;height:17px; }

/* ---------------------------------- Badges / Pills ---------------------------------- */
.badge{
  display:inline-flex; align-items:center; gap:5px;
  font-size:11px; font-weight:700;
  padding:4px 9px; border-radius:999px;
  white-space:nowrap;
}
.badge svg{ width:12px;height:12px; }
.badge-neutral{ background:var(--neutral-bg); color:var(--neutral); }
.badge-info{ background:var(--info-bg); color:var(--info); }
.badge-warning{ background:var(--warning-bg); color:#8A5A00; }
.badge-violet{ background:var(--violet-bg); color:var(--violet); }
.badge-success{ background:var(--success-bg); color:var(--brand-green-dark); }
.badge-danger{ background:var(--danger-bg); color:var(--danger); }
.badge-dot{ width:7px;height:7px;border-radius:50%; background:currentColor; }

/* ---------------------------------- Lists ---------------------------------- */
.list-item{
  display:flex; align-items:center; gap:12px;
  background:var(--surface);
  border:1px solid var(--border);
  border-radius:var(--radius-lg);
  padding:13px 14px;
  box-shadow:var(--shadow-1);
}
.list-item + .list-item{ margin-top:8px; }
.list-item .li-icon{
  width:40px;height:40px;border-radius:11px;
  display:flex;align-items:center;justify-content:center; flex-shrink:0;
}
.list-item .li-icon svg{ width:19px;height:19px; }
.list-item .li-body{ flex:1; min-width:0; }
.list-item .li-title{ font-size:14px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.list-item .li-sub{ font-size:12px; color:var(--text-muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.list-item .li-chev{ color:var(--text-faint); flex-shrink:0; }
.list-item:active{ background:var(--surface-alt); }

/* Scan line row inside a transfer */
.scan-row{
  display:flex; align-items:center; gap:11px;
  padding:11px 4px;
  border-bottom:1px solid var(--border);
}
.scan-row:last-child{ border-bottom:none; }
.scan-row .thumb{
  width:38px;height:38px;border-radius:9px;
  background:var(--surface-alt); border:1px solid var(--border);
  display:flex;align-items:center;justify-content:center;
  font-size:15px; flex-shrink:0;
}
.scan-row .sr-body{ flex:1; min-width:0; }
.scan-row .sr-title{ font-size:13.5px; font-weight:700; }
.scan-row .sr-sub{ font-size:11.5px; color:var(--text-muted); }
.scan-row .sr-qty{ font-size:16px; font-weight:800; min-width:34px; text-align:right; }

/* Four-stat quantity row (Transfert / Scanné / Reste / Écart) used in prepare & receive */
.qty-stats{ display:flex; align-items:center; gap:14px; flex-wrap:wrap; padding-left:48px; }
.qty-stat{ text-align:center; min-width:38px; }
.qty-stat .qs-val{ font-family:var(--font-display); font-size:16px; font-weight:700; line-height:1.1; }
.qty-stat .qs-label{ font-size:9.5px; color:var(--text-faint); font-weight:600; text-transform:uppercase; letter-spacing:.03em; margin-top:1px; }
.qty-stat.warn .qs-val{ color:var(--warning); }
.qty-stat.danger .qs-val{ color:var(--danger); }
.qty-stat.ok .qs-val{ color:var(--brand-green-dark); }

.line-row{
  padding:13px 4px; border-bottom:1px solid var(--border);
  display:flex; flex-direction:column; gap:9px;
}
.line-row:last-child{ border-bottom:none; }
.line-row-head{ display:flex; align-items:center; gap:10px; }
.line-row-foot{ display:flex; align-items:center; justify-content:space-between; gap:10px; padding-left:48px; }
.correct-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:7px 8px 7px 48px; margin:0 -4px;
  background:var(--surface-alt); border-radius:8px;
}
.correct-label{ font-size:11px; color:var(--text-muted); font-weight:600; }

/* ---------------------------------- Banners ---------------------------------- */
.banner{
  border-radius:var(--radius-lg); padding:14px 16px; display:flex; gap:11px; align-items:flex-start;
}
.banner svg{ flex-shrink:0; width:20px;height:20px; margin-top:1px; }
.banner .b-title{ font-weight:800; font-size:13.5px; }
.banner .b-text{ font-size:12.5px; margin-top:3px; line-height:1.4; }
.banner-danger{ background:var(--danger-bg); color:var(--danger); }
.banner-danger .b-text{ color:#7A2323; }
.banner-warning{ background:var(--warning-bg); color:#8A5A00; }
.banner-info{ background:var(--info-bg); color:var(--info); }
.banner-info .b-text{ color:#1E3A6E; }
.banner-success{ background:var(--success-bg); color:var(--brand-green-dark); }

/* ---------------------------------- Tabs ---------------------------------- */
.tabs{ display:flex; gap:6px; overflow-x:auto; padding-bottom:2px; scrollbar-width:none; }
.tabs::-webkit-scrollbar{ display:none; }
.tab{
  flex-shrink:0;
  padding:8px 14px;
  border-radius:999px;
  font-size:12.5px; font-weight:700;
  background:var(--surface-alt);
  color:var(--text-muted);
  border:1px solid var(--border);
}
.tab.active{ background:var(--brand-dark); color:#fff; border-color:var(--brand-dark); }

/* ---------------------------------- Progress / stat bar ---------------------------------- */
.bar-track{ height:8px; border-radius:999px; background:var(--border); overflow:hidden; }
.bar-fill{ height:100%; border-radius:999px; background:var(--brand-green); }
.hbar-row{ display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.hbar-label{ font-size:12px; color:var(--text-muted); width:96px; flex-shrink:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.hbar-track{ flex:1; height:10px; border-radius:999px; background:var(--surface-alt); overflow:hidden; }
.hbar-fill{ height:100%; border-radius:999px; }
.hbar-val{ font-size:12px; font-weight:700; width:34px; text-align:right; flex-shrink:0; }

/* ---------------------------------- Empty state ---------------------------------- */
.empty{
  text-align:center; padding:44px 20px; color:var(--text-muted);
}
.empty svg{ width:44px;height:44px; margin:0 auto 12px; color:var(--text-faint); }
.empty .e-title{ font-weight:700; color:var(--text); font-size:14.5px; margin-bottom:4px; }
.empty .e-sub{ font-size:12.5px; }

/* ---------------------------------- Modal / sheet ---------------------------------- */
.overlay{
  position:fixed; inset:0; background:rgba(20,20,22,.45);
  display:flex; align-items:flex-end; justify-content:center;
  z-index:100; padding:0;
}
.overlay.center{ align-items:center; padding:16px; }
.sheet{
  background:var(--surface);
  width:100%; max-width:520px;
  border-radius:20px 20px 0 0;
  max-height:88vh; overflow-y:auto;
  padding:8px 18px calc(18px + var(--safe-b));
}
.overlay.center .sheet{ border-radius:var(--radius-xl); max-height:82vh; }
.sheet-handle{ width:36px;height:4px;border-radius:999px; background:var(--border-strong); margin:8px auto 14px; }
.sheet-title{ font-family:var(--font-display); font-size:17px; font-weight:700; margin-bottom:4px; }
.sheet-sub{ font-size:12.5px; color:var(--text-muted); margin-bottom:14px; }

/* ---------------------------------- Toast ---------------------------------- */
.toast-wrap{
  position:fixed; left:0; right:0; top:calc(var(--safe-t) + 10px);
  display:flex; flex-direction:column; align-items:center; gap:8px;
  z-index:200; pointer-events:none; padding:0 14px;
}
.toast{
  background:var(--brand-dark); color:#fff;
  padding:11px 16px; border-radius:var(--radius);
  font-size:13px; font-weight:600;
  display:flex; align-items:center; gap:9px;
  box-shadow:var(--shadow-2);
  max-width:420px;
  animation: toast-in .18s ease;
}
.toast svg{ width:17px;height:17px; flex-shrink:0; }
.toast.success{ background:#0F3B23; }
.toast.error{ background:#4A1417; }
.toast.warning{ background:#4A3512; }
@keyframes toast-in{ from{ opacity:0; transform:translateY(-8px);} to{opacity:1; transform:translateY(0);} }

/* ---------------------------------- Offline banner ---------------------------------- */
.offline-bar{
  background:var(--brand-dark); color:#fff;
  font-size:12px; font-weight:700;
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:8px 10px;
}
.offline-bar svg{ width:15px;height:15px; }

/* ---------------------------------- Login ---------------------------------- */
.login-wrap{
  min-height:100vh; min-height:100dvh;
  background:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px),
    var(--bg);
  background-size:40px 40px, 40px 40px, auto;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  padding:32px 20px;
}
.login-logo{ height:34px; margin-bottom:28px; }
.login-card{
  background:var(--surface); border-radius:var(--radius-xl);
  border:1px solid var(--border);
  width:100%; max-width:400px; padding:22px 20px;
  box-shadow:var(--shadow-2);
}
.login-title{ font-family:var(--font-display); font-size:19px; font-weight:700; margin-bottom:3px; }
.login-sub{ font-size:12.5px; color:var(--text-muted); margin-bottom:18px; }
.login-foot{ text-align:center; margin-top:18px; color:var(--text-faint); font-size:11px; }

/* ---------------------------------- Misc ---------------------------------- */
.hr{ height:1px; background:var(--border); margin:14px 0; border:none; }
.muted{ color:var(--text-muted); }
.faint{ color:var(--text-faint); }
.mono{ font-variant-numeric:tabular-nums; font-feature-settings:"tnum"; }
.text-center{ text-align:center; }
.flex-center{ display:flex; align-items:center; justify-content:center; }
.gap-6{gap:6px;} .gap-8{gap:8px;} .gap-10{gap:10px;} .gap-12{gap:12px;}
.mt-0{margin-top:0 !important;}
.skeleton{
  background:linear-gradient(90deg, var(--surface-alt) 25%, var(--border) 37%, var(--surface-alt) 63%);
  background-size:400% 100%;
  animation:skeleton-loading 1.4s ease infinite;
  border-radius:var(--radius-sm);
}
@keyframes skeleton-loading{ 0%{background-position:100% 50%;} 100%{background-position:0 50%;} }

.print-label{
  width:100mm; height:100mm; background:#fff; color:#000;
  border:1px dashed #999; padding:6mm;
  display:flex; flex-direction:column; gap:3mm;
  font-family:var(--font);
}
.print-label .pl-brand{ display:flex; align-items:center; gap:2mm; font-weight:800; font-size:11pt; }
.print-label .pl-barcode-txt{ font-size:9pt; letter-spacing:.08em; text-align:center; font-weight:700; }
.print-label table{ width:100%; border-collapse:collapse; font-size:8.5pt; }
.print-label td{ padding:1.2mm 0; }
.print-label .pl-label{ color:#555; }
.print-label .pl-val{ font-weight:700; text-align:right; }

@media print{
  body *{ visibility:hidden; }
  #print-area, #print-area *{ visibility:visible; }
  #print-area{ position:absolute; left:0; top:0; }
}

/* ---- v0.2: real barcode, availability, pivot, voyage sheet ---- */
.barcode-svg{ display:block; width:100%; height:auto; max-height:26mm; }
.bon-barcode{ margin-top:12px; padding:8px; background:#fff; border:1px solid var(--border); border-radius:10px; }
.print-label .barcode-svg{ height:18mm; max-height:none; }

.line-row.line-unavailable{ background:var(--danger-bg); border-radius:10px; padding-left:8px; padding-right:8px; }
.scan-bar-lock{ display:flex; align-items:center; opacity:.6; }
.scan-bar-lock svg{ width:17px; height:17px; }

.pivot-scroll{ overflow-x:auto; }
.pivot{ width:100%; border-collapse:collapse; font-size:12px; }
.pivot th, .pivot td{ padding:6px 8px; border-bottom:1px solid var(--border); text-align:right; white-space:nowrap; }
.pivot thead th{ font-weight:700; color:var(--text-muted); }
.pivot tbody th{ text-align:left; font-weight:600; }
.pivot-total{ font-weight:800; }

.print-signatures{ display:none; }

@media print{
  @page label{ size:100mm 100mm; margin:0; }
  #print-area.print-label-page{ page:label; }
  .print-label{ border:none; width:100mm; height:100mm; }
  .print-signatures{
    display:flex; justify-content:space-between; gap:20mm; margin-top:18mm; font-size:10pt;
  }
  .print-signatures > div{ flex:1; border-top:1px solid #000; padding-top:2mm; }
}

/* ---- v0.3: Odoo sign-in ---- */
.login-server{ margin-top:16px; border-top:1px solid var(--border); padding-top:12px; }
.login-server summary{ cursor:pointer; font-size:12.5px; font-weight:600; color:var(--text-muted); list-style:none; }
.login-server summary::-webkit-details-marker{ display:none; }
.login-server summary::before{ content:'›'; display:inline-block; margin-right:6px; transition:transform .15s; }
.login-server[open] summary::before{ transform:rotate(90deg); }
