/* ══════════════════════════════════════════════════════
   STOCKLENS — app.css  Clean rebuild
══════════════════════════════════════════════════════ */

:root {
  /* ── Collabryte brand — pink / blue / green only ── */
  --pink:  #EE2A7B;
  --blue:  #00AEEF;
  --green: #00E584;

  --brand:        #00AEEF;
  --brand-dark:   #0090c7;
  --brand-light:  rgba(0,174,239,0.10);
  --brand-glow:   rgba(0,174,239,0.20);
  --bg:           #161922;
  --surface:      rgba(255,255,255,0.055);
  --surface-2:    rgba(255,255,255,0.065);
  --surface-3:    rgba(255,255,255,0.09);
  --surface-4:    rgba(255,255,255,0.13);
  --surface-card: rgba(255,255,255,0.06);
  --surface-card-hover: rgba(255,255,255,0.09);
  --border:       rgba(255,255,255,0.11);
  --border-2:     rgba(255,255,255,0.17);
  --border-3:     rgba(255,255,255,0.24);
  --text:         #ffffff;
  --text-muted:   rgba(255,255,255,0.58);
  --text-light:   rgba(255,255,255,0.28);
  --success:      #00E584;
  --success-bg:   rgba(0,229,132,0.10);
  --warning:      #EE2A7B;
  --warning-bg:   rgba(238,42,123,0.10);
  --danger:       #EE2A7B;
  --danger-bg:    rgba(238,42,123,0.10);
  --info:         #00AEEF;
  --info-bg:      rgba(0,174,239,0.10);
  --topbar-bg:    rgba(22,25,34,0.82);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.35);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.4);
  --shadow-lg: 0 14px 40px rgba(0,0,0,0.5);
  --radius:    10px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --topbar-h:  46px;
  --sidebar-w: 200px;
  --transition: 0.16s ease;
  --font: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ══ LIGHT THEME OVERRIDES ════════════════════════════
   Activated via [data-theme="light"] on <html>. ══ */
[data-theme="light"] {
  --brand:        #3f74cf;
  --brand-dark:   #345fb0;
  --brand-light:  rgba(63,116,207,0.09);
  --brand-glow:   rgba(63,116,207,0.16);
  --bg:           #f0f1f4;
  --surface:      #f8f9fb;
  --surface-2:    #f0f1f4;
  --surface-3:    #e6e8ec;
  --surface-4:    #d9dce2;
  --surface-card: #ffffff;
  --border:       rgba(30,35,45,0.1);
  --border-2:     rgba(30,35,45,0.16);
  --border-3:     rgba(30,35,45,0.24);
  --text:         #2a2f3a;
  --text-muted:   rgba(42,47,58,0.62);
  --text-light:   rgba(42,47,58,0.4);
  --success:      #3f9377;
  --success-bg:   rgba(63,147,119,0.1);
  --warning:      #b3823c;
  --warning-bg:   rgba(179,130,60,0.1);
  --danger:       #c25a53;
  --danger-bg:    rgba(194,90,83,0.09);
  --info:         #3f74cf;
  --topbar-bg:    rgba(248,249,251,0.9);
  --shadow-sm: 0 1px 3px rgba(20,25,35,0.06);
  --shadow-md: 0 3px 12px rgba(20,25,35,0.08);
  --shadow-lg: 0 12px 34px rgba(20,25,35,0.12);
}
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(30,35,45,0.16); }
[data-theme="light"] .sidebar { background: #e9ebef; border-right-color: rgba(30,35,45,0.08); }
[data-theme="light"] .nav-item:hover { background: rgba(30,35,45,0.05); }
[data-theme="light"] .modal-backdrop { background: rgba(20,30,55,0.45); }
[data-theme="light"] .modal { box-shadow: 0 -8px 30px rgba(40,35,20,0.16), var(--shadow-lg); }

/* ══ LOGIN SCREEN — light theme variant ════════════════ */
[data-theme="light"] .screen-login { background: #eef0f3; }
[data-theme="light"] .login-orb-1 { background: radial-gradient(circle, rgba(59,111,214,0.13) 0%, transparent 65%); }
[data-theme="light"] .login-orb-2 { background: radial-gradient(circle, rgba(99,57,235,0.09) 0%, transparent 65%); }
[data-theme="light"] .login-orb-3 { background: radial-gradient(circle, rgba(16,185,129,0.07) 0%, transparent 65%); }
[data-theme="light"] .login-left { background: linear-gradient(155deg, #eef0f3 0%, #e4e8f0 100%); }
[data-theme="light"] .login-brand-name,
[data-theme="light"] .login-hero-title { color: #1c2336; }
[data-theme="light"] .login-hero-sub,
[data-theme="light"] .login-feature { color: rgba(28,35,54,0.65); }
[data-theme="light"] .lf-powered { color: rgba(28,35,54,0.35); }
[data-theme="light"] .lf-company { color: rgba(28,35,54,0.55); }
[data-theme="light"] .lf-credit { color: rgba(28,35,54,0.28); }
[data-theme="light"] .login-right { background: transparent; }
[data-theme="light"] .login-mobile-hero {
  background: linear-gradient(175deg, rgba(238,240,243,0.98) 0%, rgba(228,232,240,0.92) 60%, rgba(218,224,236,0.75) 100%);
  border-bottom-color: rgba(30,35,45,0.08);
}
[data-theme="light"] .login-mobile-hero::after { background: linear-gradient(to bottom, transparent, #eef0f3); }
[data-theme="light"] .lmh-headline { color: #2b2618; }
[data-theme="light"] .lmh-company,
[data-theme="light"] .lmh-sub { color: rgba(28,35,54,0.55); }
[data-theme="light"] .lmh-chip { background: rgba(37,99,235,0.08); border-color: rgba(37,99,235,0.18); color: rgba(28,35,54,0.75); }
[data-theme="light"] .login-card-appname,
[data-theme="light"] .login-card-title { color: #2b2618; }
[data-theme="light"] .login-card-company,
[data-theme="light"] .login-card-sub { color: rgba(28,35,54,0.55); }
[data-theme="light"] .lf-label-top { color: rgba(28,35,54,0.55); }
[data-theme="light"] .login-field { background: rgba(30,35,45,0.05); border-color: rgba(30,35,45,0.14); }
[data-theme="light"] .login-field:focus-within { background: rgba(37,99,235,0.06); border-color: rgba(37,99,235,0.5); }
[data-theme="light"] .lf-icon { color: rgba(28,35,54,0.38); }
[data-theme="light"] .login-field:focus-within .lf-icon { color: #2563eb; }
[data-theme="light"] .lf-input { color: #2b2618; }
[data-theme="light"] .lf-input::placeholder { color: rgba(28,35,54,0.3); }
[data-theme="light"] .lf-eye { color: rgba(28,35,54,0.35); }
[data-theme="light"] .lf-eye:hover { color: #2563eb; }
[data-theme="light"] .login-error { color: var(--danger); }
[data-theme="light"] .login-credit-line,
[data-theme="light"] .login-version-line { color: rgba(28,35,54,0.38); }
[data-theme="light"] .login-card {
  background: rgba(250,248,242,0.9) !important;
  border-color: rgba(40,35,20,0.1) !important;
}
@media (min-width: 900px) {
  [data-theme="light"] .login-card {
    box-shadow: 0 0 0 1px rgba(255,255,255,0.5) inset, 0 32px 80px rgba(40,35,20,0.16);
  }
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font);
  font-size: 13px; line-height: 1.5;
  color: var(--text); background: var(--bg);
  height: 100%; -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  position: relative;
}
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); font-size: 13px; }

/* ══ ANIMATED BACKGROUND — single shared canvas ═══════════════════
   One <canvas id="bg"> behind the whole SPA (login screen and app
   shell both sit above it). It paints the solid #07090f ground, the
   3 drifting orbs, and the dot grid itself every frame — see
   drawBg()/initBgCanvas() in app.js. Fixed, z-index 0, pointer-events
   none so it never intercepts clicks. ══ */
canvas#bg {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  width: 100%; height: 100%; display: block;
}
#app, .screen-login { position: relative; z-index: 1; }

/* ══ NOVEX BRAND MARK ════════════════════════════════════════════ */
.novex-mark {
  width: 24px; height: 24px; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(135deg, #EE2A7B, #00AEEF 55%, #00E584);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10px; font-weight: 800; letter-spacing: 0;
  cursor: pointer;
}
.novex-mark-lg { width: 32px; height: 32px; border-radius: 9px; font-size: 13px; cursor: default; }

/* ══ STATUS CHIPS — unified pink / blue / green / gray system ═══ */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 20px;
  font-size: 7.5px; font-weight: 700; letter-spacing: 0.02em;
  border: 0.5px solid transparent; white-space: nowrap;
}
.chip-pink  { background: rgba(238,42,123,0.10); color: #EE2A7B; border-color: rgba(238,42,123,0.20); }
.chip-blue  { background: rgba(0,174,239,0.10);  color: #00AEEF; border-color: rgba(0,174,239,0.20); }
.chip-green { background: rgba(0,229,132,0.10);  color: #00E584; border-color: rgba(0,229,132,0.20); }
.chip-gray  { background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.3); border-color: rgba(255,255,255,0.08); }

/* ══ REFERENCE / CODE TOKENS ══════════════════════════════════════ */
.ref-code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 10px; font-weight: 700; color: var(--blue); }

/* ══ SCROLLBARS ════════════════════════════════════════ */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 4px; }

/* ══ BUTTONS ════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 18px; height: auto; min-height: 36px;
  border: none; border-radius: 8px;
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: all var(--transition); white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 0.01em;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: #00AEEF;
  color: #fff; box-shadow: none; border: none;
}
.btn-primary:hover:not(:disabled) { background: var(--brand-dark); }
.btn-ghost {
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.5);
  border: 0.5px solid rgba(255,255,255,0.1);
}
.btn-ghost:hover:not(:disabled) { background: var(--surface-4); border-color: var(--border-3); color: var(--text); }
.btn-danger {
  background: rgba(238,42,123,0.12); color: #EE2A7B;
  border: 0.5px solid rgba(238,42,123,0.3);
  box-shadow: none;
}
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }
.btn-success {
  background: rgba(0,229,132,0.12); color: #00E584;
  border: 0.5px solid rgba(0,229,132,0.3);
  box-shadow: none;
}
.btn-success:hover:not(:disabled) { background: var(--success); color: #07090f; }
.btn-sm  { height: 36px; padding: 0 14px; font-size: 13px; }
.btn-xs  { height: 30px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-xs); }
.btn-lg  { height: 52px; padding: 0 32px; font-size: 16px; border-radius: var(--radius); }
.btn-full { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 1.5px solid var(--border);
  border-radius: var(--radius-xs); cursor: pointer; color: var(--text-muted);
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--surface-4); color: var(--danger); border-color: rgba(248,113,113,0.3); }

/* ══ FORM CONTROLS ═══════════════════════════════════════ */
.input {
  width: 100%; padding: 9px 12px;
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 13px; color: #fff;
  background: rgba(255,255,255,0.05);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none; appearance: none;
  -webkit-appearance: none;
}
.input::placeholder { color: rgba(255,255,255,0.2); }
.input:focus {
  border-color: rgba(0,174,239,0.6);
  box-shadow: 0 0 0 3px rgba(0,174,239,0.15);
  background: rgba(255,255,255,0.07);
  outline: none;
}
textarea.input { resize: vertical; min-height: 72px; line-height: 1.6; }
select.input, .select-sm, select {
  background-color: var(--surface-2) !important;
  color: var(--text) !important;
  border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 14px; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(220,220,225,0.5)' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px !important;
  outline: none;
}
select.input:focus, .select-sm:focus, select:focus {
  border-color: rgba(96,165,250,0.65);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.22);
  background-color: var(--surface-3) !important;
}
select option, select optgroup {
  background-color: var(--surface-2) !important;
  color: var(--text) !important;
}
.select-sm { width: auto; padding: 9px 36px 9px 12px; font-size: 13px; height: 38px; }
.input-color { height: 44px; padding: 5px 8px; border-radius: var(--radius-sm); cursor: pointer; background: var(--surface-2); border: 1.5px solid var(--border-2); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 11px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 540px) { .field-row { grid-template-columns: 1fr; gap: 10px; } }

/* ══ LOGIN SCREEN ════════════════════════════════════════
   Desktop: split left hero + right form card
   Mobile: full-screen with hero header on top
══════════════════════════════════════════════════════ */
.screen-login {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; overflow: hidden;
  background: var(--bg);
}
.login-canvas { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

/* ── Orbs ─────────────────────────────────────────── */
.login-orb { position: absolute; border-radius: 50%; filter: blur(110px); pointer-events: none; z-index: 0; }
.login-orb-1 {
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(63,116,207,0.07) 0%, transparent 65%);
  top: -260px; left: -220px;
}
.login-orb-2 {
  width: 700px; height: 700px;
  background: radial-gradient(circle, rgba(63,116,207,0.05) 0%, transparent 65%);
  bottom: -200px; right: -180px;
}
.login-orb-3 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(63,116,207,0.04) 0%, transparent 65%);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
@keyframes orbFloat1 { 0%{transform:translate(0,0) scale(1)} 100%{transform:translate(70px,50px) scale(1.06)} }
@keyframes orbFloat2 { 0%{transform:translate(0,0) scale(1)} 100%{transform:translate(-60px,-70px) scale(1.1)} }
@keyframes orbFloat3 { 0%{transform:translate(-50%,-50%) scale(1)} 100%{transform:translate(-47%,-53%) scale(1.12)} }

/* ── Grid texture ──────────────────────────────────── */
.login-grid-lines {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 85% 85% at 50% 50%, black 30%, transparent 100%);
}

/* ── Desktop left panel ─────────────────────────────── */
.login-left { display: none; }
/* Show left panel on tablets landscape and desktop */
@media (min-width: 700px) {
  .login-left {
    display: flex; flex: 1; position: relative; z-index: 1;
    align-items: center; justify-content: center;
    padding: 40px 40px; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}
@media (min-width: 900px) {
  .login-left { padding: 60px 60px; }
}
.login-left-content {
  position: relative; z-index: 1; max-width: 460px;
  width: 100%; margin: auto 0;
  display: flex; flex-direction: column;
  animation: loginLeftIn 0.9s cubic-bezier(0.22,1,0.36,1) both;
}
@keyframes loginLeftIn { from{opacity:0;transform:translateX(-50px)} to{opacity:1;transform:none} }

.login-brand-row { display: flex; align-items: center; gap: 16px; margin-bottom: 44px; }
.login-brand-icon {
  width: 52px; height: 52px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: none;
}
@keyframes iconPulse { 0%,100% { transform: scale(1); } }
.login-brand-name { font-size: 1.6rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; }

.login-hero-title {
  font-size: 2.6rem; font-weight: 800; color: var(--text);
  letter-spacing: -0.04em; line-height: 1.12; margin-bottom: 20px;
  min-height: 3.5em;
}
.login-hero-accent {
  display: inline-block;
  color: var(--brand);
}
@keyframes gradientShift { 0%{background-position:0% 50%} 100%{background-position:300% 50%} }

.login-hero-sub {
  font-size: 0.95rem; color: rgba(225,225,230,0.48);
  line-height: 1.75; margin-bottom: 28px; max-width: 380px;
}

/* ── Feature bullets ────────────────────────────── */
.login-features { display: flex; flex-direction: column; gap: 14px; margin-bottom: 40px; }
.login-feature {
  display: flex; align-items: center; gap: 14px;
  font-size: 13.5px; color: rgba(225,225,230,0.68); font-weight: 500;
  animation: featureIn 0.6s cubic-bezier(0.22,1,0.36,1) both;
}
.login-feature:nth-child(1) { animation-delay: 0.2s; }
.login-feature:nth-child(2) { animation-delay: 0.3s; }
.login-feature:nth-child(3) { animation-delay: 0.4s; }
.login-feature:nth-child(4) { animation-delay: 0.5s; }
@keyframes featureIn { from{opacity:0;transform:translateX(-18px)} to{opacity:1;transform:none} }
.lf-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(74,222,128,0.15), 0 0 10px rgba(74,222,128,0.55);
  animation: dotPulse 2.5s ease-in-out infinite;
}
.login-feature:nth-child(2) .lf-dot { animation-delay: 0.5s; }
.login-feature:nth-child(3) .lf-dot { animation-delay: 1.0s; }
.login-feature:nth-child(4) .lf-dot { animation-delay: 1.5s; }
@keyframes dotPulse {
  0%,100% { box-shadow: 0 0 0 3px rgba(74,222,128,0.15), 0 0 10px rgba(74,222,128,0.55); }
  50%      { box-shadow: 0 0 0 6px rgba(74,222,128,0.05), 0 0 18px rgba(74,222,128,0.35); }
}

.login-left-brand { display: flex; align-items: center; gap: 6px; }
.lf-powered { font-size:11px; color:rgba(255,255,255,0.22); text-transform:uppercase; letter-spacing:.1em; }
.lf-company { font-size:13px; font-weight:800; color:rgba(255,255,255,0.38); }
.lf-credit { font-size:11px; color:rgba(255,255,255,0.18); font-weight:400; margin-left:4px; }
.lf-credit:not(:empty)::before { content:'·'; margin-right:6px; color:rgba(255,255,255,0.16); }

/* ── Divider — hidden, no border between panels ──── */
.login-divider { display: none; }

/* ── Right panel ─────────────────────────────────── */
.login-right {
  flex: 0 0 100%;
  display: flex; align-items: flex-start; justify-content: center;
  min-height: 100%; position: relative; z-index: 1;
  overflow-y: auto; padding: 0;
  background: transparent;
}
@media (min-width: 700px) {
  .login-right {
    flex: 0 0 440px;
    min-height: 100vh;
    align-items: center;
    justify-content: center;
    padding: 40px 36px;
    overflow-y: auto;
    background: transparent; /* no box — canvas shows through */
    border: none;
  }
}
@media (min-width: 1100px) {
  .login-right { flex: 0 0 500px; padding: 48px 48px; }
}

/* ── Login card ───────────────────────────────────── */
.login-card {
  width: 100%; max-width: 100%;
  min-height: 100%;
  display: flex; flex-direction: column;
  background: transparent; border: none; border-radius: 0; padding: 0; box-shadow: none;
  animation: loginCardBounce 0.75s cubic-bezier(0.22,1,0.36,1) 0.1s both;
}
@keyframes loginCardIn { from{opacity:0;transform:translateY(28px)} to{opacity:1;transform:none} }
@media (min-width: 700px) {
  .login-card { min-height: auto; max-width: 380px; width: 100%; }
}

/* ── Mobile hero ─────────────────────────────────── */
.login-mobile-hero {
  position: relative; padding: 40px 28px 36px;
  background: var(--surface);
  border-bottom: 1px solid var(--border); overflow: hidden;
  flex-shrink: 0;
}
.login-mobile-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 75% 75% at 30% 40%, black, transparent);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 30% 40%, black, transparent);
}
.login-mobile-hero::after {
  content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 72px;
  background: linear-gradient(to bottom, transparent, var(--bg)); pointer-events: none;
}
@media (min-width: 700px) { .login-mobile-hero { display: none; } }
.lmh-top { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; position: relative; z-index: 1; }
.lmh-icon {
  width: 60px; height: 60px; border-radius: var(--radius-sm); flex-shrink: 0;
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: none;
}
.lmh-icon img { width: 40px; height: 40px; border-radius: 10px; object-fit: contain; }
.lmh-name { font-size: 1.9rem; font-weight: 800; color: var(--text); letter-spacing: -0.035em; line-height: 1; }
.lmh-company { font-size: 12.5px; color: var(--text-light); font-weight: 500; margin-top: 6px; }
.lmh-headline { font-size: 1.5rem; font-weight: 800; color: var(--text); letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 8px; position: relative; z-index: 1; }
.lmh-sub { font-size: 13px; color: var(--text-muted); line-height: 1.6; margin-bottom: 16px; position: relative; z-index: 1; }
/* On very short screens (keyboard open) hide tagline and chips */
@media (max-height: 680px) and (max-width: 899px) {
  .lmh-sub   { display: none; }
  .lmh-chips { display: none; }
  .lmh-top   { margin-bottom: 10px; }
  .login-mobile-hero { padding: 24px 28px 20px; }
}
.lmh-chips { display: flex; flex-wrap: wrap; gap: 8px; position: relative; z-index: 1; }
.lmh-chip {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 20px;
  background: var(--brand-light); border: 1px solid var(--border-2);
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  animation: featureIn 0.5s cubic-bezier(0.22,1,0.36,1) both;
}
.lmh-chip:nth-child(1){animation-delay:.1s} .lmh-chip:nth-child(2){animation-delay:.18s}
.lmh-chip:nth-child(3){animation-delay:.26s} .lmh-chip:nth-child(4){animation-delay:.34s}
.lmh-chip:nth-child(5){animation-delay:.42s}
.lmh-chip-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 8px rgba(74,222,128,0.7); flex-shrink: 0; }

/* ── Form section ────────────────────────────────── */
.login-form-section { flex: 1; padding: 28px 28px 32px; display: flex; flex-direction: column; gap: 0; }
@media (min-width: 700px) { .login-form-section { padding: 0; flex: unset; } }
.login-card-brand { display: none; }
@media (min-width: 700px) {
  .login-card-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
}
.login-card-logo {
  width: 54px; height: 54px; border-radius: 18px; flex-shrink: 0;
  background: linear-gradient(145deg, rgba(37,99,235,0.75), rgba(99,57,235,0.5));
  border: 1px solid rgba(96,165,250,0.3);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 5px rgba(37,99,235,0.08), 0 12px 32px rgba(37,99,235,0.3);
  animation: iconPulse 3s ease-in-out infinite;
}
.login-card-appname { font-size:1.4rem; font-weight:900; color:#fff; letter-spacing:-0.03em; }
.login-card-company { font-size:12px; color:rgba(225,225,230,0.38); margin-top:3px; font-weight:500; }
.login-card-heading { margin-bottom: 30px; }
.login-card-title { font-size: 1.65rem; font-weight: 900; color: #fff; letter-spacing: -0.03em; margin-bottom: 6px; }
.login-card-sub { font-size: 14px; color: rgba(225,225,230,0.42); line-height: 1.5; }
.lf-group { display: flex; flex-direction: column; gap: 8px; }
.lf-label-top { font-size: 11px; font-weight: 800; color: rgba(200,215,255,0.5); letter-spacing: 0.06em; padding-left: 2px; text-transform: uppercase; }
.login-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

.login-field {
  display: flex; align-items: center;
  background: rgba(255,255,255,0.055);
  border: 1.5px solid rgba(255,255,255,0.09);
  border-radius: 14px; overflow: hidden;
  transition: border-color .22s, background .22s, box-shadow .22s, transform .14s;
}
.login-field:focus-within {
  border-color: rgba(96,165,250,0.7);
  background: rgba(37,99,235,0.07);
  box-shadow: 0 0 0 4px rgba(37,99,235,0.16), 0 6px 28px rgba(37,99,235,0.12);
  transform: translateY(-2px);
}
.lf-icon { width: 52px; display: flex; align-items: center; justify-content: center; color: rgba(200,200,215,0.3); flex-shrink: 0; transition: color .22s; }
.login-field:focus-within .lf-icon { color: #93c5fd; }
.lf-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #fff; font-size: 16px; font-weight: 500;
  padding: 18px 14px 18px 0; caret-color: #60a5fa;
}
.lf-input::placeholder { color: rgba(190,190,205,0.25); }
.lf-label { display: none; }
.lf-eye { background: none; border: none; cursor: pointer; color: rgba(190,190,205,0.28); padding: 0 18px; display: flex; align-items: center; transition: color .18s; }
.lf-eye:hover { color: #93c5fd; }

/* Error with shake */
.login-error {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; margin-bottom: 0;
  background: rgba(220,38,38,0.09); border: 1px solid rgba(248,113,113,0.22);
  border-radius: 12px; font-size: 13px; font-weight: 500; color: #fca5a5;
  animation: shakeError 0.4s cubic-bezier(.36,.07,.19,.97) both;
}
@keyframes shakeError {
  10%,90%  { transform: translateX(-2px); }
  20%,80%  { transform: translateX(3px); }
  30%,50%,70% { transform: translateX(-4px); }
  40%,60%  { transform: translateX(4px); }
}

/* ── Sign In button ──────────────────────────────── */
.btn-login {
  width: 100%; height: 52px; border: none; border-radius: var(--radius-sm);
  cursor: pointer; position: relative; overflow: hidden;
  background: var(--brand);
  color: #fff; font-size: 15px; font-weight: 700; letter-spacing: 0.02em;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: none;
  transition: background .15s ease, transform .08s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn-login::before { content: none; }
.btn-login::after { content: none; }
.btn-login > * { position: relative; z-index: 2; }
.btn-login:hover { background: var(--brand-dark); }
.btn-login:active { transform: scale(0.99); }
.btn-login:disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* Loading state — pulse glow */
.btn-login.loading {
  background: linear-gradient(135deg, #1a45d0, #2563eb, #4285f4, #2563eb, #1a45d0);
  background-size: 200% 100%;
  animation: btnLoadingPulse 1.5s ease-in-out infinite;
}
@keyframes btnLoadingPulse {
  0%,100% { background-position: 0% 0%; box-shadow: 0 8px 30px rgba(37,99,235,0.6); }
  50%      { background-position: 100% 0%; box-shadow: 0 8px 44px rgba(37,99,235,0.85); }
}

.login-footer { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 22px; font-size: 12px; color: rgba(255,255,255,0.18); flex-direction: column; }
.login-credit-line { font-size: 12px; color: rgba(225,225,230,0.35); font-weight: 500; }
.login-version-line { font-size: 10.5px; color: rgba(225,225,230,0.18); letter-spacing: 0.04em; }
.mobile-only-credit { display: inline; }
@media (min-width: 900px) { .mobile-only-credit { display: none; } }

/* ══ TOPBAR ════════════════════════════════════════════ */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h); background: var(--topbar-bg);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  display: flex; align-items: center; padding: 0 12px; gap: 8px;
}
/* flex: 1 0 auto — still grows to push the center pills over, but (unlike
   plain flex:1) never shrinks below its own content width, so the brand
   name can't get squeezed into an ellipsis on narrow screens. */
.topbar-left { display: flex; align-items: center; gap: 10px; flex: 1 0 auto; min-width: 0; }
.topbar-menu-btn {
  display: none; /* hidden on desktop — desktop uses the top bar pills directly */
  width: 32px; height: 32px; align-items: center; justify-content: center;
  background: var(--surface-3); border: 0.5px solid var(--border); border-radius: var(--radius-xs);
  cursor: pointer; color: var(--text-muted); transition: all var(--transition); flex-shrink: 0;
}
@media (max-width: 768px) { .topbar-menu-btn { display: flex; } }
.topbar-menu-btn:hover { background: var(--surface-4); color: var(--text); }
.topbar-logo { width: 26px; height: 26px; object-fit: contain; border-radius: 7px; }
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex-shrink: 0; }
.topbar-brand-icon { flex-shrink: 0; opacity: 0.85; }
.topbar-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--text);
  white-space: nowrap; overflow: visible; text-overflow: unset; flex-shrink: 0;
}
@media (max-width: 380px) { .topbar-title { font-size: 13px; } }
.topbar-divider { width: 1px; height: 18px; background: rgba(255,255,255,0.1); flex-shrink: 0; }
.topbar-company { font-size: 11px; font-weight: 500; color: rgba(255,255,255,0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 768px) { .topbar-company, .topbar-divider { display: none !important; } }
.topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* ══ CENTER TOGGLE PILLS — Dashboard / Apps ══════════════════════
   Visible at every width now (not just desktop) — see FIX 2: they shrink
   to icon-only and re-center absolutely at <=480px so they never crowd
   the brand name out. ══ */
.topbar-center {
  display: flex; align-items: center; flex-shrink: 0;
  background: rgba(255,255,255,0.05); border-radius: 8px; padding: 3px; gap: 2px;
}
.topbar-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 6px; border: none; background: transparent;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.35);
  cursor: pointer; transition: all var(--transition); white-space: nowrap;
}
.topbar-pill:hover { color: rgba(255,255,255,0.6); }
.topbar-pill.pill-active-dashboard { background: rgba(0,174,239,0.15); color: #00AEEF; }
.topbar-pill.pill-active-apps { background: rgba(238,42,123,0.15); color: #EE2A7B; }
@media (max-width: 480px) {
  .topbar-center { position: absolute; left: 50%; transform: translateX(-50%); }
  .topbar-pill { font-size: 9px; padding: 4px 8px; gap: 0; }
  .topbar-pill span { display: none; }
  .topbar-pill i { font-size: 14px; margin: 0; }
}
.topbar-icon-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: var(--radius-xs);
  cursor: pointer; color: rgba(255,255,255,0.4); transition: all var(--transition); flex-shrink: 0; position: relative;
}
.topbar-icon-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
/* Very small screens: right side keeps only bell + hamburger */
@media (max-width: 380px) {
  .topbar-search-btn, .topbar-settings-btn { display: none !important; }
}
.topbar-bell-dot {
  position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%;
  background: #EE2A7B; box-shadow: 0 0 6px rgba(238,42,123,0.7); border: 1.5px solid #161922;
  overflow: hidden; font-size: 0; line-height: 0; color: transparent;
}
.topbar-user-pill {
  display: none; align-items: center; gap: 8px;
  background: var(--surface-3); border: 1.5px solid var(--border);
  border-radius: 20px; padding: 4px 12px 4px 4px;
}
@media (min-width: 600px) { .topbar-user-pill { display: flex; } }
.topbar-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(145deg, #2563eb, #60a5fa);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0;
  cursor: pointer;
}
.topbar-avatar-mobile {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(145deg, #2563eb, #60a5fa);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff; flex-shrink: 0;
  cursor: pointer;
}
@media (min-width: 600px) { .topbar-avatar-mobile { display: none; } }
.topbar-user { font-size: 13px; font-weight: 600; color: var(--text-muted); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 8px rgba(52,211,153,0.7);
}
.conn-dot.offline { background: var(--danger); box-shadow: 0 0 8px rgba(248,113,113,0.7); }
.btn-signout {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface-3); border: 1.5px solid var(--border);
  border-radius: var(--radius-xs); padding: 0 12px; height: 36px;
  color: var(--text-muted); cursor: pointer; font-size: 13px; font-weight: 600;
  transition: all var(--transition); white-space: nowrap;
}
.btn-signout:hover { color: var(--danger); border-color: rgba(248,113,113,0.4); background: var(--danger-bg); }
.signout-label { display: none; }
@media (min-width: 600px) { .signout-label { display: inline; } }

/* ══ LAYOUT ════════════════════════════════════════════ */
.app { display: flex; flex-direction: column; height: 100%; }
.layout {
  display: flex;
  position: absolute;
  top: var(--topbar-h); left: 0; right: 0; bottom: 0;
  overflow: hidden;
}

/* ══ SIDEBAR ════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  position: fixed; left: 0; top: var(--topbar-h);
  height: calc(100dvh - var(--topbar-h));
  height: calc(100vh - var(--topbar-h));
  z-index: 80;
  transform: translateX(-100%) translateZ(0);
  -webkit-transform: translateX(-100%) translateZ(0);
  will-change: transform;
}
@media (min-width: 900px) { .sidebar { position: relative; top: auto; transform: none !important; z-index: auto; } }
.sidebar.open { transform: translateX(0) translateZ(0) !important; -webkit-transform: translateX(0) translateZ(0) !important; }
.sidebar-overlay {
  display: none; position: fixed; inset: 0; z-index: 79;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(2px);
}
.sidebar.open ~ .sidebar-overlay { display: block; }
@media (min-width: 900px) { .sidebar-overlay { display: none !important; } }
.sidebar-scroll {
  flex: 1 1 auto; min-height: 0;
  overflow-y: scroll; overflow-x: hidden;
  padding: 14px 10px;
  padding-bottom: max(90px, calc(env(safe-area-inset-bottom) + 70px));
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; touch-action: pan-y; position: relative;
}
.nav-section { margin-bottom: 8px; }
.nav-label { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-light); padding: 10px 12px 5px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-xs);
  cursor: pointer; color: var(--text-muted);
  font-size: 14px; font-weight: 600;
  transition: all var(--transition); position: relative;
  text-decoration: none; margin-bottom: 1px;
  -webkit-tap-highlight-color: transparent;
}
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active {
  background: var(--brand-light); color: var(--brand);
  border-left: 3px solid var(--brand); padding-left: 9px;
}
.nav-icon { display: flex; align-items: center; flex-shrink: 0; opacity: 0.65; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-badge {
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 2px 6px; border-radius: 10px; margin-left: auto;
}
.sidebar-footer {
  padding: 12px 16px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); flex-shrink: 0;
}
.sidebar-version-text { font-size: 11px; color: var(--text-light); }

/* ══ MAIN CONTENT ════════════════════════════════════════ */
.main,
.main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 16px 14px 100px; min-width: 0;
  -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
}
/* The ERP shell (#erp-main.main-content) manages its own inner padding per view,
   so only give it the bottom breathing room and let it scroll. */
.main-content { padding: 0 0 100px; }
@media (min-width: 600px) { .main { padding: 22px 22px 80px; } }
@media (min-width: 900px) { .main { padding: 28px 32px 60px; } }
.view { animation: viewIn 0.22s ease both; }
@keyframes viewIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.view-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.view-title { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; color: var(--text); }
.view-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.view-header-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }

/* ══ SESSION BANNER ══════════════════════════════════════ */
.session-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(135deg, rgba(37,99,235,0.18), rgba(59,130,246,0.1));
  border: 1px solid rgba(96,165,250,0.3); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.session-banner-info { display: flex; align-items: center; gap: 10px; }
.session-status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px rgba(52,211,153,0.7); flex-shrink: 0; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }
.session-banner-name { font-weight: 700; font-size: 14px; color: var(--text); }
.session-banner-meta { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ══ STATS ROW ════════════════════════════════════════════ */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 10px; margin-bottom: 18px; }
.stat-pill {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 12px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  transition: all var(--transition);
}
.stat-pill:hover { background: var(--surface-3); border-color: var(--border-2); }
.stat-icon { opacity: 0.5; }
.stat-val { font-size: 1.3rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; text-align: center; }
.value-pill .stat-val { color: var(--success); font-size: 1rem; }
.last-pill .stat-val { font-size: 0.85rem; color: var(--info); }

/* ══ POINTS BANNER ════════════════════════════════════════ */
.points-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(135deg, rgba(251,191,36,0.12), rgba(245,158,11,0.07));
  border: 1px solid rgba(251,191,36,0.3); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 16px; flex-wrap: wrap;
}
.points-banner-left { display: flex; align-items: center; gap: 12px; }
.points-flame { font-size: 1.6rem; }
.points-title { font-weight: 700; font-size: 14px; color: var(--warning); }
.points-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.points-right { text-align: right; }
.points-score-wrap { display: flex; align-items: baseline; gap: 4px; }
.points-score { font-size: 1.8rem; font-weight: 900; color: var(--warning); }
.points-label { font-size: 14px; font-weight: 700; color: var(--warning); opacity: 0.7; }
.points-ghc-value { font-size: 12px; color: var(--success); font-weight: 600; }
.points-items-counted { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ══ TOOLBAR ══════════════════════════════════════════════ */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon { position: absolute; left: 12px; color: var(--text-light); pointer-events: none; flex-shrink: 0; }
.search-input {
  padding: 9px 12px 9px 38px; height: 38px;
  background: var(--surface-2); border: 1.5px solid var(--border-2);
  border-radius: var(--radius-xs); color: var(--text); font-size: 14px;
  outline: none; width: 200px; transition: all var(--transition);
}
.search-input:focus { border-color: rgba(96,165,250,0.5); width: 240px; background: var(--surface-3); }
.search-input::placeholder { color: var(--text-light); }

/* ══ ENTRY LIST ════════════════════════════════════════════ */
.entries-container { display: flex; flex-direction: column; gap: 8px; padding-bottom: 80px; }
.entry-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  transition: all var(--transition); position: relative; cursor: pointer;
}
.entry-card:hover { border-color: var(--border-2); background: var(--surface-3); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.entry-card:active { transform: scale(0.99); }
.entry-thumb-wrap { flex-shrink: 0; }
.entry-thumb { width: 48px; height: 48px; border-radius: var(--radius-xs); object-fit: cover; border: 1px solid var(--border); }
.entry-no-photo {
  width: 48px; height: 48px; border-radius: var(--radius-xs);
  background: var(--surface-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-light);
}
.entry-info { flex: 1; min-width: 0; }
.entry-item-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-bottom: 3px; }
.entry-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.entry-zone-badge { background: var(--surface-3); border: 1px solid var(--border-2); padding: 1px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; color: var(--info); }
.entry-qty { flex-shrink: 0; text-align: right; }
.entry-qty-val { font-size: 1.3rem; font-weight: 900; color: var(--text); line-height: 1; }
.entry-qty-unit { font-size: 11px; color: var(--text-muted); font-weight: 600; }
.entry-actions { display: none; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); flex-direction: column; gap: 4px; }
.entry-card:hover .entry-actions { display: flex; }
.entry-value-badge { font-size: 11px; color: var(--success); font-weight: 700; }

/* ══ EMPTY STATE ══════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 20px; text-align: center; color: var(--text-muted); gap: 10px;
}
.empty-icon-wrap { opacity: 0.3; margin-bottom: 6px; }
.empty-state p { font-size: 15px; font-weight: 600; color: var(--text-muted); }
.empty-sub { font-size: 13px; color: var(--text-light) !important; }

/* ══ MODALS ════════════════════════════════════════════════ */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  z-index: 200;
  background: rgba(0,5,15,0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: backdropIn 0.2s ease;
  /* Use overflow hidden so modal slides up from bottom */
  overflow: hidden;
}
@keyframes backdropIn { from{opacity:0} to{opacity:1} }
.modal {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: rgba(30,34,45,0.96);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 20px 20px 0 0;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.6);
  animation: modalSlideUp 0.28s cubic-bezier(0.22,1,0.36,1);
  overflow: hidden;
  /* Prevent content overflow on mobile */
  box-sizing: border-box;
}
@keyframes modalSlideUp { from{transform:translateY(60px);opacity:0} to{transform:none;opacity:1} }

/* Tablet and desktop — centred popup */
@media (min-width: 600px) {
  .modal-backdrop {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: auto;
  }
  .modal {
    position: relative;
    left: auto; right: auto; bottom: auto;
    border-radius: 14px;
    max-width: 540px;
    width: 100%;
    max-height: 90vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.7);
    animation: modalPop 0.22s cubic-bezier(0.22,1,0.36,1);
  }
  .modal-lg  { max-width: 680px; }
  .modal-xl  { max-width: 840px; }
  @keyframes modalPop { from{transform:scale(0.96);opacity:0} to{transform:none;opacity:1} }
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px 14px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; gap: 12px; position: sticky; top: 0; z-index: 10;
  background: var(--surface-card);
}
.modal-head h3 { font-size: 1rem; font-weight: 800; color: var(--text); line-height: 1.2; }
.modal-close {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-3); border: 1.5px solid var(--border); border-radius: 8px;
  cursor: pointer; color: var(--text-muted); transition: all var(--transition); flex-shrink: 0;
}
.modal-close:hover { background: var(--danger-bg); color: var(--danger); border-color: rgba(248,113,113,0.4); }
.modal-body {
  flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 16px 18px 8px;
  display: flex; flex-direction: column; gap: 12px;
}
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 12px 18px; border-top: 1px solid var(--border); flex-shrink: 0;
}

/* ══ ENTRY SECTIONS (in modals) ══════════════════════════ */
.entry-section {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
}
.entry-section-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 2px; }

/* ══ ITEM SEARCH SUGGESTIONS ══════════════════════════════ */
.item-search-wrap { position: relative; }
.item-suggestions {
  position: fixed;
  z-index: 99999;
  background: var(--surface-card); border: 1.5px solid var(--border-2);
  border-radius: var(--radius-sm); overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.7), 0 2px 8px rgba(0,0,0,0.4);
  max-height: 240px; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: none; max-width: calc(100vw - 32px);
}
.item-suggestions.open { display: block; }
.suggestion-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; cursor: pointer;
  transition: background var(--transition); border-bottom: 1px solid var(--border);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: var(--surface-3); }
.sug-thumb { width: 36px; height: 36px; border-radius: var(--radius-xs); object-fit: cover; flex-shrink: 0; }
.sug-no-thumb { width: 36px; height: 36px; border-radius: var(--radius-xs); background: var(--surface-3); display: flex; align-items: center; justify-content: center; color: var(--text-light); flex-shrink: 0; }
.sug-info { min-width: 0; }
.sug-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }

/* ══ QUANTITY CONTROLS ════════════════════════════════════ */
.qty-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.qty-btn {
  width: 46px; height: 46px; border-radius: var(--radius-xs);
  background: var(--surface-3); border: 1.5px solid var(--border-2);
  color: var(--text); font-size: 1.3rem; font-weight: 300; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all var(--transition); flex-shrink: 0;
}
.qty-btn:hover { background: var(--brand-light); border-color: rgba(96,165,250,0.4); color: var(--brand); }
.qty-btn:active { transform: scale(0.9); }
.qty-input {
  width: 110px; text-align: center; font-size: 1.6rem; font-weight: 800;
  padding: 10px; background: var(--surface-3); border: 2px solid var(--border-2);
  border-radius: var(--radius-sm); color: var(--text); outline: none;
  transition: border-color var(--transition);
}
.qty-input:focus { border-color: rgba(96,165,250,0.6); }
.qty-unit { font-size: 14px; font-weight: 700; color: var(--text-muted); }

/* ══ PHOTO UPLOAD ZONES ════════════════════════════════════ */
.photo-btn-zone { display: flex; gap: 8px; flex-wrap: wrap; }
.photo-zone-btn { flex: 1; min-width: 120px; }
.photo-drop {
  border: 2px dashed var(--border-2); border-radius: var(--radius-sm);
  padding: 24px 16px; text-align: center; cursor: pointer;
  color: var(--text-muted); font-size: 13px; font-weight: 600;
  transition: all var(--transition); display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.photo-drop:hover { border-color: rgba(96,165,250,0.45); background: var(--brand-light); color: var(--text); }
.photo-drop.drag-over { border-color: var(--brand); background: var(--brand-light); }
.photo-previews { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.photo-preview-item { position: relative; }
.photo-preview-img { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-xs); border: 1.5px solid var(--border-2); image-orientation: from-image; }
.photo-remove-btn {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  background: var(--danger); border: 2px solid var(--bg); border-radius: 50%;
  color: #fff; font-size: 11px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.so-slip-preview { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.so-slip-img { max-height: 140px; max-width: 100%; border-radius: var(--radius-sm); border: 1px solid var(--border-2); object-fit: contain; image-orientation: from-image; }

/* ══ CATALOGUE GRID ════════════════════════════════════════ */
.catalogue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; padding-bottom: 80px; }
@media (min-width: 600px) { .catalogue-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.catalogue-card {
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: all var(--transition); cursor: pointer; display: flex; flex-direction: column;
}
.catalogue-card:hover { border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cc-photo-wrap { aspect-ratio: 1; background: var(--surface-2); display: flex; align-items: center; justify-content: center; overflow: hidden; font-size: 2.5rem; }
.cc-photo { width: 100%; height: 100%; object-fit: cover; }
.cc-no-photo { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: linear-gradient(145deg, var(--surface-2), var(--surface-3)); color: var(--text-light); }
.cc-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cc-name { font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-meta { font-size: 11px; color: var(--text-muted); }
.cc-cost { font-size: 12px; color: var(--success); font-weight: 700; margin-top: 2px; }
.cc-no-cost { font-size: 11px; color: var(--text-light); font-style: italic; }
.cc-actions { display: flex; gap: 6px; padding: 0 12px 12px; }
.cc-actions .btn { flex: 1; height: 34px; font-size: 12px; }

/* ══ SELECTED ITEM CARD ════════════════════════════════════ */
.selected-item-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--success-bg); border: 1.5px solid rgba(52,211,153,0.3);
  border-radius: var(--radius-sm); padding: 10px 14px; animation: slideIn 0.2s ease;
}
@keyframes slideIn { from{opacity:0;transform:translateY(-6px)} to{opacity:1;transform:none} }
.selected-item-thumb-wrap { flex-shrink: 0; }
.selected-item-thumb { width: 44px; height: 44px; border-radius: var(--radius-xs); object-fit: cover; }
.selected-item-no-photo { width: 44px; height: 44px; border-radius: var(--radius-xs); background: var(--surface-3); display: flex; align-items: center; justify-content: center; }
.selected-item-info { flex: 1; min-width: 0; }
.selected-item-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-item-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dup-warning { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--warning-bg); border: 1.5px solid rgba(251,191,36,0.3); border-radius: var(--radius-xs); font-size: 13px; color: var(--warning); }
.dup-icon { flex-shrink: 0; }

/* ══ INLINE ITEM CREATE ════════════════════════════════════ */
.inline-create { background: var(--surface-3); border: 1.5px dashed rgba(96,165,250,0.35); border-radius: var(--radius-sm); padding: 16px; margin-top: 10px; display: flex; flex-direction: column; gap: 12px; }
.inline-create-title { font-size: 12px; font-weight: 800; color: var(--info); text-transform: uppercase; letter-spacing: .07em; }
.cost-input-wrap { display: flex; gap: 8px; align-items: center; }
.cost-curr-select { width: auto; flex-shrink: 0; font-size: 13px; padding: 10px 28px 10px 10px; }
.cost-input { flex: 1; }

/* ══ SESSIONS / CARDS GRID ════════════════════════════════ */
.cards-grid { display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
.session-card {
  background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color var(--transition), background var(--transition);
}
.session-card:hover { border-color: var(--border-2); }
.session-card.current-session { border-color: rgba(37,99,235,0.5); background: rgba(37,99,235,0.05); box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.sc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sc-top-left { min-width: 0; flex: 1; }
.sc-name { font-size: 15px; font-weight: 800; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; display: flex; align-items: center; gap: 8px; }
.sc-active-pill { font-size: 10px; font-weight: 800; padding: 1px 7px; background: var(--brand-light); color: var(--brand); border: 1px solid var(--brand-light); border-radius: 10px; letter-spacing: .04em; flex-shrink: 0; }
.sc-location { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.sc-stats { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-xs); overflow: hidden; }
.sc-stat { flex: 1; padding: 10px 12px; background: var(--surface-2); text-align: center; border-right: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; gap: 3px; }
.sc-stat:last-child { border-right: none; }
.sc-stat-val { display: block; font-size: 1.1rem; font-weight: 800; color: var(--text); line-height: 1; }
.sc-stat-lbl { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; line-height: 1; }
.sc-badge { padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.badge-active { background: var(--success-bg); color: var(--success); border: 1px solid rgba(52,211,153,0.3); }
.badge-completed { background: var(--surface-3); color: var(--text-light); border: 1px solid var(--border); }
.sc-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-btn { height: 36px; padding: 0 14px; font-size: 13px; border-radius: var(--radius-xs); border: 1.5px solid transparent; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; transition: all var(--transition); }
.sc-btn-primary { background: var(--brand-light); color: var(--brand); border-color: var(--brand-light); }
.sc-btn-primary:hover { background: var(--brand-light); filter: brightness(1.1); border-color: var(--brand); }
.sc-btn-success { background: var(--success-bg); color: var(--success); border-color: var(--success-bg); }
.sc-btn-success:hover { filter: brightness(0.95); }
.sc-btn-ghost { background: var(--surface-3); color: var(--text-muted); border-color: var(--border-2); }
.sc-btn-ghost:hover { background: var(--surface-4); color: var(--text); }
.sc-btn-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bg); }
.sc-btn-danger:hover { filter: brightness(0.95); }

/* ══ SETTINGS CARDS ════════════════════════════════════════ */
.settings-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.settings-card h3 { font-size: 14px; font-weight: 800; color: var(--text); }
.logo-upload-row { display: flex; align-items: center; gap: 12px; }
.logo-preview { width: 52px; height: 52px; border-radius: var(--radius-xs); object-fit: contain; border: 1px solid var(--border-2); }

/* ══ TABLES ════════════════════════════════════════════════ */
.summary-table-wrap { overflow-x: auto; border-radius: 9px; border: 0.5px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.03); }
.detail-table-wrap { overflow-x: auto; border-radius: 9px; border: 0.5px solid rgba(255,255,255,0.07); background: rgba(255,255,255,0.03); }
table { width: 100%; border-collapse: collapse; font-size: 11px; background: rgba(255,255,255,0.03); border-radius: 9px; overflow: hidden; }
thead { background: rgba(0,0,0,0.2); }
th { padding: 9px 14px; text-align: left; font-size: 7.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: rgba(255,255,255,0.15); white-space: nowrap; border-bottom: 0.5px solid rgba(255,255,255,0.05); }
td { padding: 9px 14px; border-bottom: rgba(255,255,255,0.04) solid 0.5px; color: rgba(255,255,255,0.7); font-size: 10px; font-weight: 600; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,0.03); }
tfoot td { background: rgba(0,0,0,0.2); font-weight: 700; }
td.col-ref, .ref-col { color: #00AEEF !important; font-weight: 700 !important; }
.bal-ok   { color: var(--success); }
.bal-low  { color: var(--warning); }
.bal-zero { color: var(--danger); }

/* ══ SO / OPERATIONS CARDS ════════════════════════════════ */
.so-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 80px; }
.so-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; transition: all var(--transition);
}
.so-card:hover { border-color: var(--border-2); background: var(--surface-2); }
.so-card-left { flex-shrink: 0; }
.so-slip-thumb { width: 52px; height: 52px; border-radius: var(--radius-xs); object-fit: cover; cursor: zoom-in; border: 1px solid var(--border-2); image-orientation: from-image; }
.so-no-slip { width: 52px; height: 52px; border-radius: var(--radius-xs); background: var(--surface-3); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; }
.so-card-body { flex: 1; min-width: 0; }
.so-item-name { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-meta { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.so-qty-badge { padding: 2px 9px; border-radius: 20px; font-weight: 700; font-size: 12px; background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(248,113,113,0.3); }
.so-location { color: var(--text-muted); font-size: 12px; }
.so-footer-meta { font-size: 11px; color: var(--text-light); margin-top: 4px; }
.so-delete { align-self: flex-start; flex-shrink: 0; }
.xfer-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.so-balance-info { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 14px; margin-top: 10px; font-size: 13px; }
.so-balance-row { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--text-muted); align-items: center; }
.so-balance-item { display: flex; align-items: baseline; gap: 5px; font-size: 13px; }
.so-balance-item span { color: var(--text-muted); font-size: 12px; }
.so-balance-item strong { color: var(--text); font-size: 15px; font-weight: 800; }

/* ══ LEADERBOARD ═══════════════════════════════════════════ */
.my-score-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: linear-gradient(135deg, rgba(37,99,235,0.18), rgba(96,165,250,0.1));
  border: 1px solid rgba(96,165,250,0.3); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 18px;
}
.msc-left { display: flex; align-items: center; gap: 12px; }
.msc-avatar { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(145deg, #2563eb, #60a5fa); display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: #fff; flex-shrink: 0; }
.msc-name { font-weight: 800; font-size: 16px; }
.msc-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.msc-right { text-align: right; }
.msc-pts { font-size: 1.5rem; font-weight: 900; color: var(--info); }
.msc-items { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.lb-settings-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; padding: 12px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.lb-settings-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.lb-settings-input { width: 80px; padding: 6px 10px; background: var(--surface-3); border: 1.5px solid var(--border-2); border-radius: var(--radius-xs); color: var(--text); font-size: 13px; outline: none; text-align: center; }
.lb-list { display: flex; flex-direction: column; gap: 8px; }
.lb-row { display: flex; align-items: center; gap: 10px; background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; transition: all var(--transition); flex-wrap: wrap; }
.lb-top3 { background: rgba(37,99,235,0.08); }
.lb-rank { width: 28px; font-size: 1.1rem; text-align: center; flex-shrink: 0; }
.lb-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-3); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 800; flex-shrink: 0; }
.lb-info { flex: 1; min-width: 120px; overflow: hidden; }
.lb-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.lb-score-col { text-align: right; flex-shrink: 0; min-width: 70px; }
.lb-pts { font-size: 1rem; font-weight: 800; color: var(--info); white-space: nowrap; }
.lb-value { font-size: 11px; color: var(--success); margin-top: 1px; font-weight: 600; white-space: nowrap; }
.lb-actions { display: flex; gap: 6px; flex-shrink: 0; margin-left: auto; }
/* On small screens stack score+actions on second line */
@media (max-width: 420px) {
  .lb-score-col { order: 3; }
  .lb-actions { order: 4; }
  .lb-info { flex: 1 1 100%; order: 2; }
  .lb-rank { order: 0; }
  .lb-avatar { order: 1; }
}
.lb-pay-btn { background: var(--success-bg); color: var(--success); border-color: var(--success-bg); }
.lb-pay-btn:hover { filter: brightness(0.95); }
.lb-del-btn { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bg); }
.lb-del-btn:hover { filter: brightness(0.95); }

/* ══ TRANSFER SHEET ════════════════════════════════════════ */
.ts-header { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px; gap: 10px; }
.ts-doc-title { font-size: 1rem; font-weight: 900; color: var(--text); letter-spacing: 0.04em; }
.ts-ref { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.ts-status-badge { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 700; flex-shrink: 0; }
.ts-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-bottom: 14px; }
.ts-meta-item { display: flex; flex-direction: column; gap: 2px; }
.ts-meta-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.ts-items-table { background: rgba(255,255,255,0.02); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.ts-table-head { display: grid; grid-template-columns: 1fr 80px 80px 65px; background: var(--surface-3); padding: 8px 12px; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); gap: 6px; }
.ts-table-row { display: grid; grid-template-columns: 1fr 80px 80px 65px; padding: 10px 12px; border-top: 1px solid var(--border); align-items: center; gap: 6px; font-size: 13px; }
.ts-table-row:hover { background: rgba(255,255,255,0.02); }
.ts-item-cell { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; }
.ts-item-thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.ts-item-thumb-placeholder { width: 30px; height: 30px; border-radius: 6px; background: var(--surface-3); flex-shrink: 0; }
.ts-receive-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px 12px; background: rgba(37,99,235,0.09); border-top: 1px solid rgba(37,99,235,0.2); }
.ts-recv-input { width: 90px; padding: 7px 10px; background: var(--surface-3); border: 2px solid rgba(96,165,250,0.6); border-radius: var(--radius-xs); color: var(--text); font-size: 16px; font-weight: 800; text-align: center; outline: none; transition: border-color var(--transition), box-shadow var(--transition); }
.ts-recv-input:focus { border-color: var(--info); box-shadow: 0 0 0 3px rgba(37,99,235,0.25); }
@media (max-width: 520px) {
  .ts-table-head, .ts-table-row { grid-template-columns: 1fr 70px 70px; }
  .ts-table-head > *:last-child, .ts-table-row > *:last-child { display: none; }
}

/* ══ BASKET LINE ITEMS ════════════════════════════════════ */
.xfer-line-items { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.xfer-empty-items { text-align: center; padding: 18px; color: var(--text-light); font-size: 13px; border: 2px dashed var(--border); border-radius: var(--radius-sm); margin-top: 8px; }
.xfer-line-row {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: 8px 10px; align-items: center;
}
.xfer-line-row.xfer-line-warning { border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.05); }
.xfer-line-left { display: flex; align-items: center; gap: 10px; min-width: 0; grid-column: 1; grid-row: 1; }
.xfer-line-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: var(--radius-xs); flex-shrink: 0; }
.xfer-line-no-thumb { width: 36px; height: 36px; border-radius: var(--radius-xs); background: var(--surface-3); flex-shrink: 0; }
.xfer-line-info { min-width: 0; flex: 1; }
.xfer-line-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.xfer-line-bal { font-size: 11px; margin-top: 2px; color: var(--text-muted); }
.xfer-line-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; grid-column: 2; grid-row: 1; min-width: 0; }
.xfer-qty-inline { display: flex; align-items: center; gap: 4px; }
.xfer-qty-inline .qty-btn { width: 34px; height: 34px; font-size: 1.1rem; border-radius: 8px; flex-shrink: 0; }
.xfer-qty-inline .qty-input { width: 60px; min-width: 0; font-size: 1rem; padding: 6px 4px; text-align: center; height: 34px; }
.xfer-qty-inline .qty-unit { font-size: 12px; color: var(--text-muted); min-width: 28px; }
.xfer-bal-warn { grid-column: 1 / -1; grid-row: 2; font-size: 12px; color: var(--warning); display: flex; align-items: center; gap: 5px; }

/* ══ MOVEMENT FILTERS ══════════════════════════════════════ */
.mv-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mv-date-input { width: auto; min-width: 140px; flex: 1; padding: 9px 12px; height: 38px; font-size: 13px; }

/* ══ IMPORT ════════════════════════════════════════════════ */
.import-step-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--info); margin-bottom: 4px; }
.import-instructions { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 16px; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.import-instructions code { background: var(--surface-3); padding: 2px 6px; border-radius: 4px; font-size: 12px; color: var(--info); }
.import-preview-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13px; font-weight: 600; }
.import-table-wrap { overflow-x: auto; max-height: 300px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.import-result-box { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13px; }
.import-result-box.success { background: var(--success-bg); border: 1px solid rgba(52,211,153,0.3); color: var(--success); }

/* ══ CURR BADGES ═══════════════════════════════════════════ */
.curr-badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 800; }
.curr-USD { background: var(--brand-light); color: var(--info); }
.curr-GHC { background: var(--success-bg); color: var(--success); }

/* ══ TOAST NOTIFICATIONS ═══════════════════════════════════ */
.toast-stack { position: fixed; bottom: 20px; right: 16px; z-index: 9000; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; max-width: 360px;
  box-shadow: var(--shadow-lg); animation: toastIn 0.28s cubic-bezier(0.22,1,0.36,1);
  backdrop-filter: blur(12px); border: 1px solid transparent;
}
@keyframes toastIn { from{opacity:0;transform:translateY(20px) scale(0.95)} to{opacity:1;transform:none} }
.toast.success { background: rgba(5,100,60,0.95); border-color: rgba(52,211,153,0.4); color: #d1fae5; }
.toast.error   { background: rgba(120,15,15,0.95); border-color: rgba(248,113,113,0.4); color: #fee2e2; }
.toast.warning { background: rgba(100,70,0,0.95);  border-color: rgba(251,191,36,0.4); color: #fef3c7; }
.toast.info    { background: rgba(10,40,100,0.95); border-color: rgba(96,165,250,0.4); color: #dbeafe; }

/* ══ LIGHTBOX ══════════════════════════════════════════════ */
.lightbox-backdrop { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.9); display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox-img { max-width: 100%; max-height: 90vh; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); object-fit: contain; image-orientation: from-image; }
.lightbox-close { position: absolute; top: 16px; right: 16px; width: 40px; height: 40px; background: rgba(255,255,255,0.1); border: 1.5px solid rgba(255,255,255,0.2); border-radius: 50%; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 16px; }

/* ══ LOCATION / USER CARDS ════════════════════════════════ */
.loc-card, .user-card {
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: all var(--transition);
}
.loc-card:hover, .user-card:hover { border-color: var(--border-2); background: var(--surface-2); }
.lc-left, .uc-left { flex: 1; min-width: 0; }
.lc-name, .uc-name { font-weight: 700; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-actions, .uc-actions {
  display: flex; flex-direction: row; gap: 8px;
  flex-shrink: 0; align-items: center;
}
/* On very narrow screens, keep buttons side by side but smaller */
@media (max-width: 400px) {
  .lc-actions .btn, .uc-actions .btn { padding: 6px 10px; font-size: 12px; }
  .lc-actions .btn svg, .uc-actions .btn svg { display: none; }
}

/* ══ REPORT BUTTONS ════════════════════════════════════════ */
.report-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.report-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 20px;
  background: var(--surface-3); border: 1.5px solid var(--border-2);
  font-size: 13px; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all var(--transition);
}
.report-chip:hover { background: var(--brand-light); border-color: rgba(96,165,250,0.4); color: var(--info); }
.report-chip.active { background: var(--brand-light); border-color: rgba(96,165,250,0.5); color: var(--brand); }

/* ══ MOBILE TWEAKS ═════════════════════════════════════════ */
@media (max-width: 600px) {
  .modal .field-row { grid-template-columns: 1fr; gap: 10px; }
  .entry-section { padding: 12px; }
  .view-header { flex-direction: column; gap: 12px; align-items: stretch; }
  .view-header-actions { width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  .view-header-actions select.select-sm { flex: 1; min-width: 120px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-left { flex-direction: column; }
  .search-input { width: 100%; }
  .search-input:focus { width: 100%; }
  .catalogue-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  /* modal-foot stays horizontal on mobile — never stack */
  .modal-foot { flex-direction: row; flex-wrap: nowrap; }
  .modal-foot .btn { justify-content: center; }
}

/* ══ MISC UTILITY ══════════════════════════════════════════ */
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
code { font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: 0.9em; }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info    { color: var(--info); }

/* ══ RAPID COUNT MODE ══════════════════════════════════════ */
.rapid-mode-toggle { display: flex; align-items: center; gap: 6px; background: var(--surface-3); border: 1.5px solid var(--border-2); border-radius: 20px; padding: 4px 12px 4px 8px; cursor: pointer; }
.rapid-mode-toggle input[type="checkbox"] { display: none; }
.rapid-mode-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: var(--text-muted); cursor: pointer; user-select: none; }
.rapid-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-4); flex-shrink: 0; transition: background var(--transition); }
.rapid-mode-toggle.active .rapid-dot { background: var(--success); box-shadow: 0 0 8px rgba(52,211,153,0.6); }
.rapid-mode-toggle.active .rapid-mode-label { color: var(--text); }
.rapid-counter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: nowrap;
  padding: 9px 18px;
  background: linear-gradient(135deg, rgba(20,40,120,0.95), rgba(14,28,90,0.95));
  border-bottom: 1px solid rgba(37,99,235,0.25);
  font-size: 13px; font-weight: 600; flex-shrink: 0;
  position: sticky; top: 0; z-index: 9;
}
.rcb-zone-label { color: rgba(200,215,255,0.6); font-size: 11px; text-transform: uppercase; letter-spacing: .07em; }
.rcb-zone-input {
  width: 80px; padding: 6px 10px; background: rgba(255,255,255,0.08);
  border: 2px solid rgba(96,165,250,0.45); border-radius: var(--radius-xs);
  color: #fff; font-size: 13px; outline: none; text-align: center; font-weight: 700;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.rcb-zone-input:focus { border-color: var(--info); box-shadow: 0 0 0 3px rgba(37,99,235,0.3); }
.rcb-total { margin-left: auto; color: rgba(200,215,255,0.7); font-size: 12px; }
.rcb-total strong { color: #fff; font-size: 14px; }

/* ══ SYNC BUTTON & TOAST ═══════════════════════════════════ */
.btn-sync { background: var(--surface-3); border: 1.5px solid var(--border-2); border-radius: var(--radius-xs); width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text-muted); transition: all var(--transition); }
.btn-sync:hover { background: var(--brand-light); color: var(--info); border-color: rgba(96,165,250,0.4); }
.sync-badge { position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%); background: rgba(15,25,60,0.95); border: 1px solid rgba(96,165,250,0.35); border-radius: 20px; padding: 6px 16px; font-size: 12px; font-weight: 700; color: rgba(180,210,255,0.85); font-size: 12px; font-weight: 600; z-index: 8999; pointer-events: none; animation: syncBadgeIn 0.3s ease; }
@keyframes syncBadgeIn { from{opacity:0;transform:translateX(-50%) translateY(10px)} to{opacity:1;transform:translateX(-50%) translateY(0)} }

/* ══ BASKET ITEM ROW — clean 2-row card ════════════════════ */
.bir-list { display: flex; flex-direction: column; gap: 8px; }
.bir-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.bir-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.bir-thumb { width: 36px; height: 36px; border-radius: var(--radius-xs); object-fit: cover; flex-shrink: 0; }
.bir-no-thumb { width: 36px; height: 36px; border-radius: var(--radius-xs); background: var(--surface-3); flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.bir-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.bir-remove { margin-left: auto; flex-shrink: 0; }
.bir-bottom { display: flex; align-items: center; gap: 8px; padding: 8px 12px 10px; border-top: 1px solid var(--border); background: rgba(255,255,255,0.02); }
.bir-bal { font-size: 11px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }
.bir-btn { height: 34px; padding: 0 10px; font-size: 12px; border-radius: var(--radius-xs); border: 1.5px solid var(--border-2); background: var(--surface-3); color: var(--text-muted); cursor: pointer; transition: all var(--transition); }
.bir-btn:hover { background: var(--brand-light); color: var(--info); border-color: rgba(96,165,250,0.4); }

/* ══ DETAIL TABLE ══════════════════════════════════════════ */
.detail-section-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 6px; }
.detail-meta-row { display: flex; flex-wrap: wrap; gap: 6px 24px; margin-bottom: 16px; }
.detail-meta-item { display: flex; flex-direction: column; gap: 2px; }
.detail-meta-label { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-muted); font-weight: 700; }
.detail-meta-val { font-size: 14px; font-weight: 700; color: var(--text); }

/* ══ WAYBILL SHEET MODAL — proper scroll layout ═══════════ */
#wbSheetModal .modal { max-height: 92vh; }
#wbSheetModal .modal-body { padding: 0; gap: 0; }
.wb-sheet-photos { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.wb-sheet-photo-item { position: relative; }
.wb-photo-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.wb-sheet-thumb { width: 80px; height: 80px; border-radius: var(--radius-xs); object-fit: cover; cursor: zoom-in; border: 1px solid var(--border-2); image-orientation: from-image; }

/* ══ TOGGLE SWITCH ═════════════════════════════════════════ */
.toggle-wrap { display: flex; align-items: center; gap: 10px; }
.toggle-switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: var(--surface-4); border-radius: 24px; transition: .2s; }
.toggle-slider:before { content: ""; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: var(--text-muted); border-radius: 50%; transition: .2s; }
input:checked + .toggle-slider { background: var(--brand); }
input:checked + .toggle-slider:before { transform: translateX(20px); background: #fff; }
.toggle-label { font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* ══ STOCK BALANCE — clickable rows ═══════════════════════ */
.balance-row-clickable { cursor: pointer; transition: background var(--transition); }
.balance-row-clickable:hover td { background: rgba(96,165,250,0.06); }
.movement-row-clickable { cursor: pointer; transition: background var(--transition); }
.movement-row-clickable:hover td { background: rgba(96,165,250,0.06); }

/* ══ DATE RANGE FILTER ROW ════════════════════════════════ */
.date-range-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 14px; padding: 12px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.date-range-field { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 130px; }
.date-range-row label { font-size: 10px; font-weight: 800; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; flex-shrink: 0; }
.date-range-input { width: 100%; min-width: 0; padding: 8px 10px; height: 38px; font-size: 13px; }
@media (max-width: 480px) {
  .date-range-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .date-range-field { width: 100%; }
  .date-range-row > .btn { width: 100%; margin-top: 2px; }
}
.date-filter-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 6px 2px; margin-bottom: 10px; -webkit-tap-highlight-color: transparent; transition: color var(--transition); }
.date-filter-toggle:hover, .date-filter-toggle.date-filter-toggle-active { color: var(--brand); }

/* ══ LEADERBOARD ROW ACTIONS ══════════════════════════════ */
.lb-row-actions { display: flex; gap: 6px; margin-left: auto; }
.lb-action-btn { height: 30px; padding: 0 10px; border-radius: 7px; font-size: 12px; font-weight: 700; cursor: pointer; border: 1.5px solid transparent; transition: all var(--transition); }

/* ══ STOCK ADJUSTMENT ══════════════════════════════════════ */
.adj-dir-toggle { display: flex; gap: 8px; }
.adj-dir-btn { flex: 1; height: 44px; border-radius: var(--radius-xs); border: 1.5px solid var(--border-2); background: var(--surface-3); color: var(--text-muted); cursor: pointer; font-size: 14px; font-weight: 700; transition: all var(--transition); display: flex; align-items: center; justify-content: center; gap: 6px; }
.adj-dir-btn.active.increase { background: var(--success-bg); color: var(--success); border-color: rgba(52,211,153,0.4); }
.adj-dir-btn.active.decrease { background: var(--danger-bg); color: var(--danger); border-color: rgba(248,113,113,0.4); }

/* ══ MOVEMENT — clickable rows ════════════════════════════ */
.movement-row-clickable { cursor: pointer; }
.movement-row-clickable:hover td { background: rgba(96,165,250,0.06); }

/* ══ REPORT CARDS — fixed layout, no overflow ═══════════ */
.report-card { margin-bottom: 0 !important; cursor: pointer; display: flex; flex-direction: column; gap: 12px; }
.report-card-head { display: flex; align-items: center; gap: 12px; }
.report-card-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; border: 1.5px solid; display: flex; align-items: center; justify-content: center; }
.report-card-title { font-weight: 800; font-size: 14px; color: var(--text); }
.report-card-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.report-card-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.report-card-row .btn { width: 100%; min-width: 0; padding: 0 8px; }
.btn-full { width: 100%; }

/* ══ DASHBOARD ════════════════════════════════════════════ */
.dash-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.dash-stat-card { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.dash-stat-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.dash-stat-val { font-size: 1.5rem; font-weight: 900; color: var(--text); line-height: 1; }
.dash-stat-lbl { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.dash-panel { background: var(--surface-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.dash-panel-head { display: flex; align-items: center; gap: 8px; }
.dash-panel-head h3 { font-size: 14px; font-weight: 800; color: var(--text); }
.dash-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.dash-list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-xs); cursor: pointer; transition: all var(--transition); font-size: 13px; }
.dash-list-row:hover { background: var(--surface-3); border-color: var(--border-2); }
.dash-list-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.dash-list-time { font-size: 11px; color: var(--text-light); white-space: nowrap; flex-shrink: 0; }
.dash-list-badge { font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 20px; flex-shrink: 0; }
.dash-badge-warning { background: var(--warning-bg); color: var(--warning); }
.dash-badge-danger  { background: var(--danger-bg); color: var(--danger); }
.dash-empty { font-size: 13px; color: var(--text-light); padding: 16px 0; text-align: center; }
@media (max-width: 600px) {
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
}

/* ══ DASHBOARD — clickable currency toggle card ════════════ */
.dash-stat-clickable { cursor: pointer; transition: all var(--transition); user-select: none; -webkit-tap-highlight-color: transparent; }
.dash-stat-clickable:hover { border-color: rgba(52,211,153,0.4); background: rgba(52,211,153,0.04); }
.dash-stat-clickable:active { transform: scale(0.97); }
@keyframes dashStatFlash { 0%{background:rgba(52,211,153,0.18)} 100%{background:transparent} }
.dash-stat-flash { animation: dashStatFlash 0.3s ease; }

/* ══ THEME TOGGLE — Settings appearance card ════════════════ */
.theme-toggle-row { display: flex; gap: 14px; flex-wrap: wrap; }
.theme-option-btn { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px; background: var(--surface-2); border: 2px solid var(--border); border-radius: var(--radius); cursor: pointer; transition: all var(--transition); width: 140px; }
.theme-option-btn:hover { border-color: var(--border-2); }
.theme-option-btn.theme-active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.theme-preview { width: 100%; height: 76px; border-radius: 10px; border: 1px solid rgba(0,0,0,0.15); overflow: hidden; position: relative; }
.theme-preview-dark { background: #15161a; }
.theme-preview-light { background: #eef0f3; }
.theme-preview-bar { position: absolute; top: 0; left: 0; right: 0; height: 16px; }
.theme-preview-dark .theme-preview-bar { background: #0c0d10; border-bottom: 1px solid rgba(255,255,255,0.08); }
.theme-preview-light .theme-preview-bar { background: #e9ebef; border-bottom: 1px solid rgba(40,35,20,0.08); }
.theme-preview-card { position: absolute; top: 26px; left: 10px; right: 10px; bottom: 10px; border-radius: 6px; }
.theme-preview-dark .theme-preview-card { background: #17181c; border: 1px solid rgba(255,255,255,0.08); }
.theme-preview-light .theme-preview-card { background: #faf8f2; border: 1px solid rgba(40,35,20,0.1); }
.theme-option-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text); }
.theme-option-btn.theme-active .theme-option-label { color: var(--info); }

/* ══ DATE FILTER TOGGLE — collapsed by default ══════════════ */
.date-filter-toggle { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; cursor: pointer; font-size: 12px; font-weight: 700; color: var(--text-muted); padding: 6px 2px; margin-bottom: 10px; -webkit-tap-highlight-color: transparent; transition: color var(--transition); }
.date-filter-toggle:hover, .date-filter-toggle.date-filter-toggle-active { color: var(--brand); }

/* ══ AI FIELD LOCK HINT ═════════════════════════════════════ */
#aiFieldLockHint { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--brand-light); border: 1px solid rgba(96,165,250,0.3); border-radius: var(--radius-sm); }

/* ══ GRN DETAIL MODAL ═══════════════════════════════════════ */
#grnDetailModal .modal-body { padding: 0; gap: 0; }
.grn-detail-section { padding: 14px 18px; border-bottom: 1px solid var(--border); }
.grn-detail-section:last-child { border-bottom: none; }

/* ══ STOCK CARD / STOCK CARD MODAL ══════════════════════════ */
.stock-card-running-balance { font-size: 12px; color: var(--text-muted); text-align: right; font-weight: 700; white-space: nowrap; }
.stock-card-row { cursor: default; }
.stock-card-row.sc-adj { background: rgba(251,191,36,0.04); }
.stock-card-row.sc-count { background: rgba(52,211,153,0.04); }

/* ══ REQUEST CENTRE ═══════════════════════════════════════════════ */

/* Modal overrides — needs own scroll containment */
.req-modal {
  overflow: hidden !important;
  height: 85vh; height: 85dvh; /* concrete height so children can flex properly */
  display: flex; flex-direction: column;
}
.req-modal-body {
  display: flex; flex-direction: row;
  flex: 1; min-height: 0;
  overflow: hidden;
  /* No height:100% — use flex:1 + min-height:0 instead */
}

/* LEFT catalogue panel */
.req-cat-panel {
  flex: 1; min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.req-cat-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.req-cat-grid-scroll {
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  min-height: 0;
  padding: 14px;
  -webkit-overflow-scrolling: touch;
}
.req-cat-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

/* Catalogue item cards */
.req-cat-card {
  display: flex; flex-direction: column;
  background: var(--surface-card); border: 2px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: all var(--transition);
  position: relative; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.req-cat-card:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.req-cat-card:active { transform: scale(0.97); }
.req-cat-card-active { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-light); }
.req-cat-card-active .req-cat-info { background: var(--brand-light); }
.req-cat-thumb {
  width: 100%;
  padding-top: 100%; /* Creates a square regardless of width */
  background: var(--surface-2);
  position: relative; overflow: hidden;
}
.req-cat-thumb > * {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.req-cat-nothumb {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.2rem; background: var(--surface-3);
  color: var(--text-light);
}
.req-cat-qty-badge {
  position: absolute; top: 5px; right: 5px;
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 800;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(37,99,235,0.55);
  animation: badgePop .2s cubic-bezier(0.22,1,0.36,1);
}
@keyframes badgePop { from{transform:scale(0)} to{transform:scale(1)} }
.req-cat-info { padding: 8px 8px 10px; transition: background var(--transition); background: var(--surface-card); }
.req-cat-name {
  font-weight: 700; font-size: 12px; color: var(--text) !important;
  line-height: 1.4; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  margin-bottom: 3px; word-break: break-word;
}
.req-cat-meta { font-size: 10.5px; color: var(--text-muted); font-weight: 500; }

/* RIGHT cart/crate panel */
.req-cart-panel {
  width: 300px; flex-shrink: 0; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--surface-2);
}
.req-cart-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px; flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 800; color: var(--text);
}
.req-cart-badge {
  background: var(--brand); color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 2px 8px; border-radius: 12px; margin-left: auto;
  min-width: 20px; text-align: center;
}
.req-cart-items {
  flex: 1; min-height: 0;
  overflow-y: auto; padding: 8px 10px;
  display: flex; flex-direction: column; gap: 6px;
  -webkit-overflow-scrolling: touch;
}
.req-cart-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 16px; text-align: center; color: var(--text-muted);
  flex: 1;
}
.req-cart-item {
  background: var(--surface-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  display: flex; flex-direction: column; gap: 8px;
}
.req-cart-item-top {
  display: flex; align-items: center; gap: 8px;
}
.req-cart-item-thumb {
  width: 34px; height: 34px; border-radius: 6px;
  object-fit: cover; flex-shrink: 0;
}
.req-cart-item-nothumb {
  width: 34px; height: 34px; border-radius: 6px;
  background: var(--surface-3); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.req-cart-item-name {
  flex: 1; min-width: 0;
  font-weight: 700; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.req-cart-item-unit { font-size: 11px; color: var(--text-muted); }
.req-cart-item-remove {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; line-height: 1;
  padding: 0 2px; transition: color var(--transition);
  flex-shrink: 0;
}
.req-cart-item-remove:hover { color: var(--danger); }
.req-cart-item-qty {
  display: flex; align-items: center; gap: 6px;
}
.req-cart-item-qty .qty-btn {
  width: 30px; height: 30px; font-size: 1rem; flex-shrink: 0;
}
.req-cart-item-qty input {
  flex: 1; min-width: 0; text-align: center;
  font-size: 14px; font-weight: 800;
  background: var(--surface-3); border: 1.5px solid var(--border-2);
  border-radius: 8px; height: 30px; color: var(--text);
  outline: none; padding: 0 4px;
}
.req-cart-item-qty .qty-unit {
  font-size: 11px; color: var(--text-muted); min-width: 24px; text-align: left;
}

/* Mobile: stack vertically */
@media (max-width: 700px) {
  .req-modal-body { flex-direction: column; }
  .req-cat-panel { border-right: none; border-bottom: 1px solid var(--border); flex: 1; min-height: 0; max-height: 44vh; }
  .req-cart-panel { width: 100%; max-height: 40vh; }
}

/* ══ EXIF ORIENTATION FIX ═══════════════════════════════════════════
   Forces browser to respect the EXIF rotation flag in JPEGs taken
   on phones/tablets so delivery slip photos display correctly.    */
img { image-orientation: from-image; }

/* ══ QUICK COUNT BUTTONS on entry cards ═══════════════════════════ */
.entry-qty-col {
  display: flex; align-items: center; gap: 4px;
  flex-direction: row;
}
.entry-qty-wrap {
  display: flex; flex-direction: column; align-items: center;
  cursor: pointer; min-width: 44px; text-align: center;
}
.quick-minus, .quick-plus {
  width: 32px; height: 32px; border-radius: 8px; border: none;
  font-size: 1.2rem; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}
.quick-minus {
  background: var(--danger-bg); color: var(--danger);
}
.quick-minus:active { background: var(--danger); color: #fff; transform: scale(0.9); }
.quick-plus {
  background: var(--success-bg); color: var(--success);
}
.quick-plus:active { background: var(--success); color: #fff; transform: scale(0.9); }
/* Bigger tap targets on mobile */
@media (max-width: 640px) {
  .quick-minus, .quick-plus { width: 38px; height: 38px; font-size: 1.4rem; }
}

/* ══ ENHANCED LOGIN ANIMATIONS ════════════════════════════════════ */

/* Floating particle dots on left panel */
.login-particle {
  position: absolute; border-radius: 50%;
  background: rgba(96,165,250,0.6);
  animation: particleFloat linear infinite;
  pointer-events: none; z-index: 0;
}
@keyframes particleFloat {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 0.6; }
  100% { transform: translateY(-120vh) translateX(40px) scale(0.4); opacity: 0; }
}

/* Hero title reveal animation */
@keyframes heroReveal {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.login-hero-title {
  animation: heroReveal 0.8s cubic-bezier(0.22,1,0.36,1) 0.15s both;
}
.login-hero-sub {
  animation: heroReveal 0.7s cubic-bezier(0.22,1,0.36,1) 0.3s both;
}

/* Input field focus glow pulse */
@keyframes inputGlowPulse {
  0%,100% { box-shadow: 0 0 0 4px rgba(37,99,235,0.16), 0 6px 28px rgba(37,99,235,0.12); }
  50%     { box-shadow: 0 0 0 6px rgba(37,99,235,0.22), 0 8px 32px rgba(37,99,235,0.2); }
}
.login-field:focus-within {
  animation: inputGlowPulse 2s ease-in-out infinite;
}

/* Sign In button — ripple effect on click */
.btn-login::after {
  content: ''; position: absolute;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0);
  border-radius: inherit;
  top: 0; left: 0;
  pointer-events: none;
  transition: background 0.4s ease;
}
.btn-login:active::after { background: rgba(255,255,255,0.15); }

/* Card entrance with bounce */
@keyframes loginCardBounce {
  0%   { opacity: 0; transform: translateY(40px) scale(0.96); }
  60%  { transform: translateY(-4px) scale(1.01); }
  100% { opacity: 1; transform: none; }
}
.login-card {
  animation: loginCardBounce 0.75s cubic-bezier(0.22,1,0.36,1) 0.1s both !important;
}

/* Shimmer sweep on the Sign In button on hover */
@keyframes btnShimmer {
  0%   { left: -110%; }
  100% { left: 160%; }
}
.btn-login:hover::before {
  animation: btnShimmer 0.6s ease forwards;
}

/* Feature bullets — faster stagger */
.login-feature:nth-child(1) { animation-delay: 0.35s; }
.login-feature:nth-child(2) { animation-delay: 0.45s; }
.login-feature:nth-child(3) { animation-delay: 0.55s; }
.login-feature:nth-child(4) { animation-delay: 0.65s; }

/* Brand icon — calm */
@keyframes iconPulseStrong {
  0%,100% { transform: scale(1); }
}
.login-brand-icon, .login-card-logo, .lmh-icon {
  animation: none !important;
}
.login-hero-accent { animation: none !important; }

/* ── AI Assistant ──────────────────────────────────────── */
.ai-prompt-btn {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.ai-prompt-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }

.ai-msg { display: flex; gap: 10px; align-items: flex-start; }
.ai-msg.user { flex-direction: row-reverse; }
.ai-msg-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
}
.ai-msg.user .ai-msg-bubble {
  background: var(--brand);
  color: #fff;
  border-radius: 14px 14px 4px 14px;
}
.ai-msg.ai .ai-msg-bubble {
  background: var(--surface-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 14px 14px 14px 4px;
}
.ai-msg-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
  background: var(--surface-3);
}
.ai-typing { display: flex; gap: 4px; padding: 4px 0; }
.ai-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted);
  animation: aiTyping 1.2s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes aiTyping { 0%,60%,100%{transform:translateY(0)} 30%{transform:translateY(-6px)} }
@media (max-width: 800px) { #logisticsGrid { grid-template-columns: 1fr !important; } }

/* ── Settings Tabs ─────────────────────────────────── */
.settings-tab {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text-muted);
  background: transparent; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.settings-tab:hover { color: var(--text); }
.settings-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.settings-tab-pane { display: none; }
.settings-tab-pane.active { display: block; }

/* ERP sub-tabs (financial reports, depreciation, POS) */
.erp-rtab.active, .erp-dtab.active, .erp-ptab.active {
  background: var(--brand); color: #fff;
}

/* ══ POINT OF SALE TERMINAL ═══════════════════════════════ */
/* The terminal owns the full ERP pane — kill the shell's bottom padding for it. */
.main-content:has(#view-erp-pos:not(.hidden)) { padding-bottom: 0 !important; }
#view-erp-pos { display: flex; flex-direction: column; }
#view-erp-pos:not(.hidden) { height: calc(100dvh - var(--topbar-h)); }
#posRoot { height: 100%; }
#posRoot .pos-body { min-height: 0; flex: 1; }
@media (max-width: 760px) {
  #posRoot .pos-body { flex-direction: column; }
  #posRoot .pos-body > div { max-width: none !important; border-right: none !important; }
  #posRoot .pos-body > div:first-child { border-bottom: 1px solid var(--border); }
  #posGrid { max-height: 42vh; }
}

/* ══════════════════════════════════════════════════════════
   MOBILE FIXES — Comprehensive overhaul
   ══════════════════════════════════════════════════════════ */

/* ── Catalogue list view — horizontal scroll on mobile ── */
.cat-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%; }
.cat-scroll-wrap table { min-width: 640px; }

/* ── Catalogue grid — 1 column on very small screens ── */
@media (max-width: 380px) {
  .catalogue-grid { grid-template-columns: 1fr !important; }
}

/* ── Catalogue card — full mobile layout ── */
.catalogue-card { display: flex; flex-direction: column; }
.cc-actions { display: flex; gap: 4px; padding: 0 10px 10px; flex-wrap: wrap; }
.cc-actions .btn { flex: 1; min-width: 70px; height: 32px; font-size: 11px; padding: 0 6px; }

/* ── Tool Loans — mobile card layout ── */
.tool-loan-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tool-loan-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.tool-loan-card-name { font-weight: 800; font-size: 14px; }
.tool-loan-card-badge { font-size: 10px; font-weight: 800; padding: 3px 9px; border-radius: 20px; white-space: nowrap; flex-shrink: 0; }
.tool-loan-card-meta { font-size: 12px; color: var(--text-muted); display: flex; flex-direction: column; gap: 3px; }
.tool-loan-card-actions { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.tool-loan-card-actions .btn { flex: 1; min-width: 80px; }

/* ── Notification bell panel ── */
.notif-panel {
  position: fixed; top: var(--topbar-h); right: 8px; width: min(320px, calc(100vw - 16px));
  background: rgba(30,34,45,0.96); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255,255,255,0.1);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  z-index: 200; display: flex; flex-direction: column; max-height: 400px;
  overflow: hidden;
}
.notif-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 800; flex-shrink: 0;
}
.notif-panel-body { overflow-y: auto; flex: 1; }
.notif-panel-foot { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-shrink: 0; }
.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
}
.notif-item:hover { background: var(--surface-2); }
.notif-item.notif-unread { background: rgba(96,165,250,0.06); }
.notif-item.notif-unread .notif-dot { opacity: 1; }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); flex-shrink: 0; margin-top: 5px; opacity: 0; transition: opacity var(--transition); }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 13px; font-weight: 700; }
.notif-item-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.notif-item-actions { display: flex; gap: 4px; margin-top: 6px; }

/* ── View headers — stack on mobile ── */
@media (max-width: 600px) {
  .view-header { flex-direction: column; gap: 10px; align-items: stretch; }
  /* Stack one button per row — pairing two via flex-wrap let long labels
     (e.g. "Manage Categories" / "Bulk Category Check") overflow their own
     button and visually collide with the neighbour. */
  .view-header-actions { flex-direction: column; gap: 6px; }
  .view-header-actions .btn, .view-header-actions select { width: 100%; }
}

/* ── Cards grid — 1 column on mobile ── */
@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr !important; }
  .loc-card, .user-card { padding: 12px; }
  .lc-actions { flex-wrap: wrap; gap: 4px; }
  .lc-actions .btn { flex: 1; min-width: 70px; font-size: 11px; }
}

/* ── Waybill / GRN list rows — mobile ── */
@media (max-width: 600px) {
  .waybill-row, .grn-row { flex-direction: column; gap: 8px; }
  .waybill-row-actions { flex-wrap: wrap; gap: 4px; }
  .waybill-row-actions .btn { flex: 1; }
}

/* ── Modal — full screen on mobile ── */
@media (max-width: 480px) {
  .modal { width: 100% !important; max-width: 100% !important; margin: 0; border-radius: 16px 16px 0 0; max-height: 92vh; position: fixed; bottom: 0; left: 0; right: 0; }
  .modal-backdrop { align-items: flex-end; }
}

/* ── Tab buttons — scrollable on mobile ── */
.tab-scroll { display: flex; gap: 4px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
.tab-scroll::-webkit-scrollbar { display: none; }

/* ── Foreman tabs — scrollable ── */
#view-foreman .view-header-actions { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap !important; padding-bottom: 4px; scrollbar-width: none; }
#view-foreman .view-header-actions::-webkit-scrollbar { display: none; }
#view-foreman .view-header-actions .btn { white-space: nowrap; flex-shrink: 0; }

/* ── Dash stats — 2 col on mobile ── */
@media (max-width: 480px) {
  .dash-stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .dash-stat-val { font-size: 1.2rem; }
}

/* ── Settings tabs — scrollable on mobile ── */
.settings-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap !important; }
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab-btn { white-space: nowrap; flex-shrink: 0; }

/* ── Logistics booking tabs ── */
@media (max-width: 480px) {
  .tabs { gap: 1px; }
  .tab { font-size: 12px; padding: 7px 6px; }
}

/* ── Stock count — mobile buttons ── */
@media (max-width: 480px) {
  .count-session-actions { flex-direction: column; }
  .count-session-actions .btn { width: 100%; }
}

/* ── Topbar on mobile ── */
@media (max-width: 480px) {
  .topbar { padding: 0 10px; }
  .topbar-title { font-size: 13px; }
}

/* ══════════════════════════════════════════════════════════
   APPS GRID SCREEN — full-page module launcher
   ══════════════════════════════════════════════════════════ */
#appsGridScreen {
  padding: 10px 14px 8px;
  overflow-y: auto;
}
.apps-grid-heading {
  font-size: 8px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em;
  color: rgba(255,255,255,0.3); text-align: center; margin-bottom: 12px;
}
.apps-grid {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px;
  align-content: start;
}
.apps-row-sep { grid-column: 1 / -1; height: 0.5px; background: rgba(255,255,255,0.05); margin: 4px 0; }
.app-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 7px 2px; border-radius: 9px; cursor: pointer;
  transition: all var(--transition); -webkit-tap-highlight-color: transparent;
}
.app-tile:hover { background: rgba(255,255,255,0.06); transform: translateY(-1px); }
.app-tile:active { transform: scale(0.95); }
.app-tile-icon {
  width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  border: 0.5px solid rgba(255,255,255,0.08);
  position: relative; overflow: hidden; flex-shrink: 0;
}
.app-tile-icon::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 60%);
}
.app-tile-icon i, .app-tile-icon svg { position: relative; z-index: 1; font-size: 19px; }
.tile-p1 { background: linear-gradient(135deg,#2a0514,#4a0a22); color: #EE2A7B; }
.tile-p2 { background: linear-gradient(135deg,#3a0820,#5a1030); color: #f472b6; }
.tile-p3 { background: linear-gradient(135deg,#1a030c,#3a0818); color: #EE2A7B; }
.tile-b1 { background: linear-gradient(135deg,#021828,#053a58); color: #00AEEF; }
.tile-b2 { background: linear-gradient(135deg,#031e34,#064868); color: #38bdf8; }
.tile-b3 { background: linear-gradient(135deg,#011018,#032840); color: #00AEEF; }
.tile-g1 { background: linear-gradient(135deg,#01200e,#024a20); color: #00E584; }
.tile-g2 { background: linear-gradient(135deg,#021a0c,#043c18); color: #34d399; }
.tile-g3 { background: linear-gradient(135deg,#011408,#023010); color: #00E584; }
.tile-pb { background: linear-gradient(135deg,#2a0514,#032840); color: #818cf8; }
.tile-bg { background: linear-gradient(135deg,#031e34,#021a0c); color: #00AEEF; }
.tile-pg { background: linear-gradient(135deg,#2a0514,#011408); color: #00E584; }
.app-tile-label {
  font-size: 7.5px; font-weight: 500; color: rgba(255,255,255,0.3);
  text-align: center; max-width: 50px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; transition: color var(--transition);
}
.app-tile:hover .app-tile-label { color: rgba(255,255,255,0.75); }
.app-tile-empty { visibility: hidden; }
.apps-empty { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: rgba(255,255,255,0.25); font-size: 12px; }
@media (max-width: 900px) { .apps-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 560px) { .apps-grid { grid-template-columns: repeat(3, 1fr); } }

/* ══════════════════════════════════════════════════════════
   LOGIN — simple centered card (redesign)
   Overrides the older split-hero .login-card rules earlier in
   this file — same class name, later in the cascade wins.
   ══════════════════════════════════════════════════════════ */
.screen-login {
  flex-direction: column !important;
}
.login-center-wrap {
  position: relative; z-index: 1;
  flex: 1; width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.login-tenant-heading {
  font-size: 20px; font-weight: 700; color: #fff; text-align: center;
  margin-bottom: 18px; max-width: 420px;
}
.login-card {
  width: 380px; max-width: 100%;
  min-height: 0;
  background: rgba(28,32,42,0.85) !important;
  border: 0.5px solid rgba(255,255,255,0.1) !important;
  border-radius: 16px !important;
  padding: 28px 24px !important;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  display: flex; flex-direction: column;
  box-shadow: none;
  position: relative; z-index: 10;
  animation: loginCardBounce 0.6s cubic-bezier(0.22,1,0.36,1) both;
}
.login-card-appname {
  text-align: center; font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 22px;
}
.login-card-heading { text-align: center; margin-bottom: 20px; }
.login-card-title { font-size: 17px; font-weight: 700; color: #fff; margin-bottom: 4px; letter-spacing: -0.01em; }
.login-card-sub { font-size: 10px; color: rgba(255,255,255,0.4); }
.login-card .login-form { gap: 14px; margin-bottom: 0; }
.login-card .lf-icon { width: 40px; }
.login-card .lf-input { font-size: 13px; padding: 13px 12px 13px 0; }
.login-card .login-field { border-radius: 10px; }
.login-card .btn-login { height: 42px; font-size: 13px; margin-top: 2px; }
.login-card .login-error { font-size: 11px; padding: 10px 14px; }
.login-card .login-footer { margin-top: 18px; }
.login-copyright {
  position: relative; z-index: 1;
  text-align: center; font-size: 10px; color: rgba(255,255,255,0.12);
  padding: 0 16px 24px; flex-shrink: 0;
}

/* ══ DASHBOARD — greeting + activity table (redesign) ═══════════ */
.kc { cursor: pointer; transition: all .15s; }
.kc:hover { background: rgba(255,255,255,0.07); transform: translateY(-1px); border-color: rgba(255,255,255,0.15); }
.dash-greeting { margin-bottom: 14px; }
.dash-greeting-title { font-size: 15px; font-weight: 700; color: #fff; }
.dash-greeting-sub { font-size: 9.5px; color: rgba(255,255,255,0.4); margin-top: 2px; }
.dash-section-head { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 10px; }
.dash-section-head h3 { font-size: 12px; font-weight: 700; color: #fff; }
.dash-view-all { font-size: 10px; font-weight: 600; color: #00AEEF; cursor: pointer; }
.dash-view-all:hover { text-decoration: underline; }
.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
@media (max-width: 760px) { .dash-two-col { grid-template-columns: 1fr; } }
.dash-col-panel {
  background: rgba(255,255,255,0.03); border: 0.5px solid rgba(255,255,255,0.07);
  border-radius: 10px; padding: 12px 14px;
}
.dash-col-panel h4 { font-size: 11px; font-weight: 700; color: #fff; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.dash-low-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 0.5px solid rgba(255,255,255,0.04); font-size: 10.5px; }
.dash-low-row:last-child { border-bottom: none; }
.dash-low-name { color: rgba(255,255,255,0.7); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-low-loc { color: rgba(255,255,255,0.3); font-size: 9.5px; }
.dash-low-qty { color: #EE2A7B; font-weight: 700; white-space: nowrap; }
.dash-empty-note { color: rgba(255,255,255,0.25); font-size: 10.5px; text-align: center; padding: 14px 0; }
.dash-error-note { color: rgba(255,255,255,0.3); font-size: 10.5px; text-align: center; padding: 14px 0; }

/* Skeleton loaders — shown while a dashboard section's own fetch is in flight */
@keyframes skeletonPulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.skel { background: rgba(255,255,255,0.06); border-radius: 6px; animation: skeletonPulse 1.3s ease-in-out infinite; }
.skel-card { height: 62px; border-radius: 10px; }
.skel-row { height: 14px; margin-bottom: 8px; }
.skel-row:last-child { margin-bottom: 0; }

/* ══════════════════════════════════════════════════════════
   MOBILE DRAWER — hamburger, <=768px. Full-height, slides in from
   the left, holds the Dashboard/Apps toggle plus (when inside a
   module) that module's sub-page list.
   ══════════════════════════════════════════════════════════ */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  display: none;
}
.drawer-overlay.show { display: block; }

.mobile-drawer {
  position: fixed;
  top: 0; left: -280px;
  width: 280px; height: 100vh; height: 100dvh;
  background: rgba(24,27,37,0.97);
  border-right: 0.5px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  transition: left .25s ease;
  display: flex;
  flex-direction: column;
  padding-top: 12px;
  overflow-y: auto;
}
.mobile-drawer.open { left: 0; }

.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 12px;
  border-bottom: 0.5px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
}
.drawer-close {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; background: rgba(255,255,255,0.06);
}
.drawer-close i { font-size: 16px; color: rgba(255,255,255,0.5); }
.drawer-close:hover { background: rgba(255,255,255,0.1); }

.mobile-nav-toggle {
  display: flex; gap: 8px;
  padding: 12px 16px;
  border-bottom: 0.5px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
}
.mnav-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border-radius: 9px;
  background: rgba(255,255,255,0.05);
  border: 0.5px solid rgba(255,255,255,0.08);
  cursor: pointer;
  font-size: 12px; font-weight: 500; color: rgba(255,255,255,0.4);
  transition: all .15s;
}
.mnav-btn i { font-size: 16px; }
.mnav-btn.active {
  background: rgba(0,174,239,0.15);
  border-color: rgba(0,174,239,0.3);
  color: #00AEEF;
  font-weight: 700;
}
.mnav-btn:last-child.active {
  background: rgba(238,42,123,0.15);
  border-color: rgba(238,42,123,0.3);
  color: #EE2A7B;
}
#mobileDrawerModuleItems { padding: 0 8px; }
#mobileDrawerModuleItems .mod-title {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: rgba(255,255,255,0.25); padding: 6px 8px;
}
#mobileDrawerModuleItems .nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 8px; border-radius: 7px; cursor: pointer;
  font-size: 12px; color: rgba(255,255,255,0.5);
}
#mobileDrawerModuleItems .nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
#mobileDrawerModuleItems .nav-item.active { background: rgba(0,174,239,0.1); color: #00AEEF; font-weight: 600; }
#mobileDrawerModuleItems .nav-item i { font-size: 15px; }

/* Drawer — user info (top) + settings/logout (bottom) */
.drawer-user-info {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 16px;
}
.drawer-user-name { font-size: 13px; font-weight: 700; color: #fff; }
.drawer-user-role { font-size: 10.5px; color: rgba(255,255,255,0.4); text-transform: capitalize; margin-top: 1px; }
.drawer-footer {
  margin-top: auto;
  padding: 8px;
  border-top: 0.5px solid rgba(255,255,255,0.07);
}
.drawer-footer .nav-item {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 8px; border-radius: 7px; cursor: pointer;
  font-size: 12px; color: rgba(255,255,255,0.5);
}
.drawer-footer .nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.drawer-footer .nav-item i { font-size: 15px; }
.drawer-footer .drawer-logout:hover { background: rgba(238,42,123,0.1); color: #EE2A7B; }

/* ══ MOBILE TOP BAR — hamburger | mark+name | bell only ═════════
   Issue 11: everything else (company name, pills, search, settings,
   avatar/sync/signout) moves into the drawer above. ══ */
@media (max-width: 768px) {
  .topbar { height: 50px; }
  .topbar-center,
  .topbar-avatar-mobile,
  .topbar-user-pill,
  .btn-sync,
  .btn-signout,
  .conn-dot { display: none !important; }
}

/* ══ MODULE SIDEBAR HEADER — back arrow + module name ═══════════ */
.sidebar-module-head {
  display: none; align-items: center; gap: 8px;
  padding: 12px 12px 10px; margin-bottom: 4px;
  border-bottom: 0.5px solid rgba(255,255,255,0.06);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.sidebar-module-head.visible { display: flex; }
.sidebar-module-back {
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.4); flex-shrink: 0; border-radius: 6px; transition: all var(--transition);
}
.sidebar-module-head:hover .sidebar-module-back { color: #00AEEF; background: rgba(0,174,239,0.1); }
.sidebar-module-name { font-size: 12px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item.active {
  background: rgba(0,174,239,0.1); color: #00AEEF;
  border-left: 2px solid #00AEEF; padding-left: 10px;
}

/* The old always-on left nav is retired in favor of the category-card Apps
   screen (openModule) + the dynamic .module-sidebar below. It stays in the
   DOM — RBAC/feature-gating code still runs against its nav-item classes —
   but is never shown. */
.sidebar { display: none !important; }
.sidebar-overlay.open { display: none !important; }

/* ══════════════════════════════════════════════════════════
   CATEGORY CARDS — Apps screen (8 cards, 4x2, fills viewport)
   ══════════════════════════════════════════════════════════ */
.apps-screen {
  position: absolute;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
}

.apps-title {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.18);
  text-transform: uppercase;
  letter-spacing: .8px;
  text-align: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.cat-card {
  background: rgba(255,255,255,0.04);
  border: 0.5px solid rgba(255,255,255,0.09);
  border-radius: 14px;
  padding: 20px 12px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all .15s;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.cat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: linear-gradient(145deg,rgba(255,255,255,0.05) 0%,transparent 60%);
  pointer-events: none;
}

.cat-card:hover {
  background: rgba(255,255,255,0.07);
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.cat-card:active { transform: scale(.97); }

.cat-tile {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  transition: transform .18s ease, filter .18s ease;
  image-rendering: crisp-edges;
  -webkit-font-smoothing: antialiased;
  flex-shrink: 0;
}

/* top gloss sheen */
.cat-tile::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 52%;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.22) 0%,
    rgba(255,255,255,0.06) 60%,
    transparent 100%);
  z-index: 2;
  border-radius: 22px 22px 0 0;
  pointer-events: none;
}

/* inner border */
.cat-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.18);
  z-index: 3;
  pointer-events: none;
}

/* SVG icon inside tile */
.cat-tile svg {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  fill: none;
  stroke: #fff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  shape-rendering: geometricPrecision;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
}

/* hover on the whole card */
.cat-card:hover .cat-tile {
  transform: scale(1.06);
  filter: brightness(1.1);
}

/* Gradient per module — Collabryte 3 colors, different angle each */
.t-warehouse {
  background: linear-gradient(135deg,
    #EE2A7B 0%, #9b35a5 50%, #00AEEF 100%);
  box-shadow: 0 8px 28px rgba(238,42,123,0.45),
    0 2px 8px rgba(0,0,0,0.4);
}
.t-sales {
  background: linear-gradient(160deg,
    #00AEEF 0%, #00c9a7 50%, #00E584 100%);
  box-shadow: 0 8px 28px rgba(0,174,239,0.45),
    0 2px 8px rgba(0,0,0,0.4);
}
.t-procurement {
  background: linear-gradient(200deg,
    #00E584 0%, #00c49a 50%, #00AEEF 100%);
  box-shadow: 0 8px 28px rgba(0,229,132,0.4),
    0 2px 8px rgba(0,0,0,0.4);
}
.t-accounting {
  background: linear-gradient(135deg,
    #00E584 0%, #0db897 50%, #EE2A7B 100%);
  box-shadow: 0 8px 28px rgba(0,229,132,0.4),
    0 2px 8px rgba(0,0,0,0.4);
}
.t-hr {
  background: linear-gradient(160deg,
    #EE2A7B 0%, #c0326a 50%, #00E584 100%);
  box-shadow: 0 8px 28px rgba(238,42,123,0.4),
    0 2px 8px rgba(0,0,0,0.4);
}
.t-manufacturing {
  background: linear-gradient(200deg,
    #00AEEF 0%, #7b6ef6 50%, #EE2A7B 100%);
  box-shadow: 0 8px 28px rgba(0,174,239,0.4),
    0 2px 8px rgba(0,0,0,0.4);
}
.t-logistics {
  background: linear-gradient(135deg,
    #EE2A7B 0%, #00AEEF 50%, #00E584 100%);
  box-shadow: 0 8px 28px rgba(0,174,239,0.4),
    0 2px 8px rgba(0,0,0,0.4);
}
.t-projects {
  background: linear-gradient(160deg,
    #00E584 0%, #00AEEF 50%, #EE2A7B 100%);
  box-shadow: 0 8px 28px rgba(0,229,132,0.4),
    0 2px 8px rgba(0,0,0,0.4);
}

.cat-name {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  letter-spacing: -.2px;
}

.cat-desc {
  font-size: 8.5px;
  color: rgba(255,255,255,0.28);
  text-align: center;
  line-height: 1.4;
}

.cat-card:hover .cat-desc {
  color: rgba(255,255,255,0.55);
}

.cat-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}
.cat-badge.pk { background: #EE2A7B; }
.cat-badge.bl { background: #00AEEF; }
.cat-badge.gn { background: #00E584; }

/* Large desktop */
@media (min-width: 1400px) {
  .cat-grid { gap: 16px; }
  .apps-screen { padding: 24px; }
}

/* Standard desktop — 4 columns */
@media (min-width: 769px) and (max-width: 1399px) {
  .cat-grid {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, 1fr);
  }
}

/* Tablet — 2 columns, scroll allowed */
@media (max-width: 768px) {
  .apps-screen {
    overflow-y: auto;
    padding: 16px;
  }
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 10px;
  }
  .cat-card {
    padding: 20px 12px;
    min-height: 140px;
  }
  .apps-title { margin-bottom: 12px; }
  .cat-tile {
    width: 60px;
    height: 60px;
    border-radius: 16px;
  }
  .cat-tile svg {
    width: 30px;
    height: 30px;
  }
  .cat-tile::before {
    border-radius: 16px 16px 0 0;
  }
  .cat-tile::after {
    border-radius: 16px;
  }
}

/* Mobile — 2 columns smaller */
@media (max-width: 480px) {
  .apps-screen { padding: 12px; }
  .cat-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .cat-card {
    padding: 16px 8px;
    min-height: 120px;
    border-radius: 12px;
  }
  .cat-desc { display: none; }
  .cat-tile {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }
  .cat-tile svg {
    width: 26px;
    height: 26px;
  }
  .cat-name { font-size: 10px; }
}

/* ══════════════════════════════════════════════════════════
   MODULE SIDEBAR — 200px fixed, shown once a category is opened
   ══════════════════════════════════════════════════════════ */
.module-sidebar {
  width: 200px;
  position: fixed;
  left: 0;
  top: 46px;
  bottom: 0;
  background: rgba(24,27,37,0.85);
  border-right: 0.5px solid rgba(255,255,255,0.07);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  z-index: 50;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.module-sidebar.hidden { display: none; }
.module-sidebar .back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
  margin-bottom: 8px;
  color: rgba(255,255,255,0.4);
  font-size: 11px;
}
.module-sidebar .back-btn:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
}
.module-sidebar .mod-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  padding: 0 8px 8px;
  border-bottom: 0.5px solid rgba(255,255,255,0.07);
  margin-bottom: 6px;
}
.module-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 7px;
  cursor: pointer;
  margin-bottom: 1px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  transition: all .1s;
}
.module-sidebar .nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: rgba(255,255,255,0.7);
}
.module-sidebar .nav-item.active {
  background: rgba(0,174,239,0.1);
  color: #00AEEF;
  font-weight: 600;
  border-left: 2px solid #00AEEF;
}
.module-sidebar .nav-item i {
  font-size: 14px;
}
/* When the module sidebar is visible, shift whichever content area is
   currently shown (warehouse-side #main or ERP #erp-main) right by its
   width — it's a fixed overlay, not a flex sibling, so it needs an
   explicit margin rather than relying on flex layout. */
.module-sidebar-open .main,
.module-sidebar-open .main-content {
  margin-left: 200px;
}
@media (max-width: 768px) {
  .module-sidebar {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%;
    max-height: 60vh;
    border-right: none;
    border-top: 0.5px solid rgba(255,255,255,0.07);
    border-radius: 16px 16px 0 0;
    transform: translateY(100%);
    transition: transform .25s ease;
  }
  .module-sidebar:not(.hidden) { transform: translateY(0); }
  .module-sidebar.sheet-collapsed { transform: translateY(100%); }
  .module-sidebar-open .main,
  .module-sidebar-open .main-content {
    margin-left: 0;
  }
}
#moduleSidebarOverlay.open { display: block; }

