/* ── RESET & TOKENS ─────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Brand colours from logo ── */
  --red:      #D01C1C;
  --red-h:    #B01818;   /* hover / darker */
  --red-l:    #FDF0F0;   /* light tint bg  */
  --red-dim:  rgba(208,28,28,0.12);
  --red-glow: rgba(208,28,28,0.22);
  --grey:     #7F7F7F;   /* brand grey     */
  --grey-l:   #F4F4F4;   /* light grey bg  */

  /* ── Light mode neutrals ── */
  --bg:       #F7F7F7;
  --surface:  #FFFFFF;
  --surface-2:#F0F0F0;
  --border:   #E2E2E2;
  --border-2: #CACACA;
  --text:     #1A1A1A;
  --text-2:   #555555;
  --text-3:   #999999;

  /* ── Semantic ── */
  --green:    #16A34A;
  --green-l:  #F0FDF4;
  --danger:   #DC2626;
  --danger-l: #FEF2F2;
  --orange:   #EA580C;
  --purple:   #7C3AED;

  /* ── Layout ── */
  --sidebar-w: 248px;
  --topbar-h:  52px;
  --radius:    8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,.07);
  --shadow:    0 4px 14px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.13);
  --font:      'Inter', system-ui, -apple-system, sans-serif;
  --tr:        .15s ease;
}

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── UTILS ──────────────────────────────────────── */
.hidden  { display: none !important; }
.block   { display: block; }
.tc      { text-align: center; }
.tr      { text-align: right; }
.mono    { font-family: 'Menlo','Courier New',monospace; letter-spacing:.01em; }
.mt1 { margin-top: 4px; }  .mt2 { margin-top: 8px; }
.mt3 { margin-top:12px; }  .mb2 { margin-bottom:8px; }
.mb3 { margin-bottom:12px; }.mb4 { margin-bottom:16px; }
.full    { width: 100%; }
.grow    { flex: 1; min-width: 100px; }
.rel     { position: relative; }
.p0      { padding: 0 !important; overflow: hidden; }
.self-end{ align-self: flex-end; }
.red-txt { color: var(--danger) !important; }
.opt     { color: var(--text-3); font-weight: 400; }

/* ── LOADING ────────────────────────────────────── */
.screen-center {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); z-index: 100;
}
.loading-box { text-align: center; }
.app-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--red-l);
  border: 2px solid rgba(208,28,28,0.2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.app-wordmark { font-size: 22px; font-weight: 700; color: var(--text); }
.loading-hint { font-size: 13px; color: var(--text-3); margin-top: 4px; }
.loader-bar   { width: 140px; height: 3px; background: var(--border); border-radius: 2px; margin: 20px auto 0; overflow: hidden; }
.loader-fill  { width: 45%; height: 100%; background: var(--red); border-radius: 2px; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0%{transform:translateX(-100%)} 100%{transform:translateX(320%)} }

/* ── AUTH ───────────────────────────────────────── */
.auth-panel {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow);
}
.auth-brand     { display: flex; align-items: center; gap: 10px; margin-bottom: 24px; }
.auth-wordmark  { font-size: 18px; font-weight: 700; color: var(--text); }
.auth-heading   { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.auth-subtext   { font-size: 13px; color: var(--text-3); margin-bottom: 24px; }
.err-msg        { font-size: 12.5px; color: var(--danger); min-height: 18px; margin-bottom: 8px; }
.mt8            { margin-top: 8px; }

/* ── APP SHELL ──────────────────────────────────── */
.app { display: flex; height: 100vh; overflow: hidden; }
.app.hidden { display: none; }

/* Mobile topbar */
.topbar {
  display: none;
  height: var(--topbar-h);
  background: var(--red);
  align-items: center; justify-content: space-between;
  padding: 0 16px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
}
.topbar-brand { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; color: #fff; }
.topbar-clock { font-size: 12px; color: rgba(255,255,255,0.75); font-variant-numeric: tabular-nums; }
.burger { background: none; border: none; cursor: pointer; padding: 6px; border-radius: var(--radius-sm); color: #fff; }
.burger:hover { background: rgba(255,255,255,0.15); }

/* Overlay */
.overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 49; }
.overlay.show { display: block; }

/* ── SIDEBAR ────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  height: 100%; overflow-y: auto; overflow-x: hidden;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

/* Sidebar top strip — brand red */
.sb-top {
  background: var(--red);
  padding: 18px 14px 16px;
  border-bottom: none;
}
.sb-brand  { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sb-name   { font-size: 15px; font-weight: 700; color: #fff; line-height: 1; }
.sb-sub    { font-size: 11px; color: rgba(255,255,255,0.7); margin-top: 2px; }
.sb-clock  { font-size: 12px; color: rgba(255,255,255,0.7); font-variant-numeric: tabular-nums; margin-bottom: 12px; }
.sb-user   { display: flex; align-items: center; gap: 10px; }
.av        { width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.25); color: #fff; border: 2px solid rgba(255,255,255,0.4); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.u-email   { font-size: 12px; font-weight: 500; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 168px; }
.u-role    { font-size: 11px; color: rgba(255,255,255,0.65); }

/* Nav */
.sb-nav { flex: 1; padding: 10px 10px 0; display: flex; flex-direction: column; gap: 1px; }
.nl     { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing:.07em; color: var(--text-3); padding: 14px 8px 4px; }
.nd     { height: 1px; background: var(--border); margin: 8px 0; }
.ni     {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 8px 10px;
  border: none; background: transparent;
  color: var(--text-2);
  font-family: var(--font); font-size: 13.5px; font-weight: 500;
  border-radius: var(--radius-sm); cursor: pointer; text-align: left;
  transition: background var(--tr), color var(--tr);
}
.ni:hover  { background: var(--red-l); color: var(--red); }
.ni.active { background: var(--red-dim); color: var(--red); font-weight: 600; }
.ni.active .nic { opacity: 1; }
.nic { width: 15px; height: 15px; flex-shrink: 0; opacity: .65; }
.ni:hover .nic, .ni.active .nic { opacity: 1; }

.sb-logout {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 14px 16px;
  padding: 9px 12px;
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-family: var(--font); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all var(--tr);
}
.sb-logout:hover { background: var(--danger-l); border-color: var(--danger); color: var(--danger); }

/* ── MAIN CONTENT ───────────────────────────────── */
.content {
  flex: 1; overflow-y: auto;
  padding: 28px 28px 40px;
  background: var(--bg);
}
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }

.page { animation: fadein .2s ease; }
.page.hidden { display: none; }
@keyframes fadein { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }

.ph       { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.pt       { font-size: 22px; font-weight: 700; color: var(--text); }
.ps       { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.ph-right { display: flex; align-items: center; gap: 8px; }

/* ── CARD ───────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}
.ch    { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.ct    { font-size: 14px; font-weight: 600; color: var(--text); }
.cdesc { font-size: 13px; color: var(--text-2); margin: 6px 0 16px; line-height: 1.6; }
.fcard { max-width: 640px; }

/* ── STATS ──────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 14px; margin-bottom: 18px; }
.sc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  position: relative; overflow: hidden;
}
.sc.green { border-top-color: var(--green); }
.sc-label { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing:.05em; color: var(--text-3); margin-bottom: 6px; }
.sc-val   { font-size: 28px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.sc.green .sc-val { color: var(--green); }
.sc-icon  { position: absolute; right: 16px; bottom: 8px; font-size: 40px; font-weight: 900; opacity: .05; pointer-events: none; }

/* ── TWO COL ────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Quick actions */
.qa-wrap { display: flex; flex-direction: column; gap: 4px; }
.qa {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--grey-l);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font); font-size: 13.5px; font-weight: 500;
  cursor: pointer; text-align: left;
  transition: all var(--tr);
}
.qa:hover { background: var(--red-l); border-color: var(--red); color: var(--red); transform: translateX(2px); }
.qd   { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.qd.b { background: var(--red); }
.qd.o { background: var(--orange); }
.qd.p { background: var(--purple); }
.qc   { margin-left: auto; color: var(--text-3); font-size: 16px; }
.qa:hover .qc { color: var(--red); }

/* Low stock */
.badge   { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 99px; }
.badge.r { background: var(--danger-l); color: var(--danger); }
.low-wrap { display: flex; flex-direction: column; gap: 5px; max-height: 260px; overflow-y: auto; }
.low-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: var(--danger-l); border-radius: var(--radius-sm); }
.low-name { font-size: 13px; color: var(--text); font-weight: 500; }
.low-qty  { font-size: 12px; color: var(--danger); font-weight: 600; }

/* ── FORMS ──────────────────────────────────────── */
.fg { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.fg.sm { margin-bottom: 0; }
.fg:last-child { margin-bottom: 0; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.flabel { font-size: 12px; font-weight: 500; color: var(--text-2); }

.finput {
  width: 100%; padding: 8px 11px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font); font-size: 14px;
  outline: none;
  transition: border-color var(--tr), box-shadow var(--tr), background var(--tr);
}
.finput::placeholder { color: var(--text-3); }
.finput:focus { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-dim); background: var(--surface); }
.finput.sm-inp { font-size: 13px; padding: 7px 10px; }
.password-field { position: relative; }
.password-field .finput { padding-right: 62px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  height: 26px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--red);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.password-toggle:hover { background: var(--red-dim); }
.password-toggle:focus-visible { outline: 2px solid var(--red); outline-offset: 1px; }
.fsel {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}
.finput-lg { font-size: 20px; padding: 10px 14px; font-variant-numeric: tabular-nums; }
.fwb { display: flex; gap: 8px; }
.fwb .finput { flex: 1; }
.fbar {
  display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
  margin-bottom: 18px; padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.ffoot {
  display: flex; align-items: center; justify-content: flex-end; gap: 12px;
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--border);
}

/* Suggestions */
.suggest {
  position: absolute; top: calc(100% + 3px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  z-index: 40; max-height: 180px; overflow-y: auto;
}
.sug-item { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background var(--tr); }
.sug-item:last-child { border-bottom: none; }
.sug-item:hover { background: var(--red-l); }
.sug-name { font-size: 13px; font-weight: 500; color: var(--text); }
.sug-cat  { font-size: 11px; color: var(--text-3); }

/* ── BUTTONS ────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font); font-size: 13.5px; font-weight: 500;
  cursor: pointer; border: 1px solid transparent;
  transition: all var(--tr);
  text-align: center; justify-content: center; white-space: nowrap;
}
.btn.sm   { padding: 6px 12px; font-size: 12.5px; }
.btn.full { width: 100%; }

/* Primary — brand red */
.btn.primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn.primary:hover { background: var(--red-h); border-color: var(--red-h); box-shadow: 0 2px 10px var(--red-glow); }

/* Secondary — light red tint */
.btn.secondary { background: var(--red-l); color: var(--red); border-color: rgba(208,28,28,0.25); }
.btn.secondary:hover { background: #FAD7D7; }

/* Ghost — grey */
.btn.ghost { background: transparent; color: var(--text-2); border-color: var(--border-2); }
.btn.ghost:hover { background: var(--grey-l); color: var(--text); }

/* Outline */
.btn.outline { background: transparent; color: var(--text-2); border-color: var(--border-2); }
.btn.outline:hover { background: var(--grey-l); }

/* Danger */
.btn.danger { background: var(--danger-l); color: var(--danger); border-color: rgba(220,38,38,0.25); }
.btn.danger:hover { background: #FEE2E2; }

/* ── INVENTORY ──────────────────────────────────── */
.inv-head {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr; gap: 12px;
  padding: 11px 16px;
  background: var(--grey-l);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing:.06em; color: var(--grey);
  border-bottom: 1px solid var(--border);
}
.inv-rows { max-height: 65vh; overflow-y: auto; }
.inv-row  {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr 1fr; gap: 12px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center; font-size: 13px;
  transition: background var(--tr);
}
.inv-row:hover { background: var(--red-l); }
.inv-row:last-child { border-bottom: none; }
.c2      { grid-column: span 2; }
.inv-name{ font-weight: 500; color: var(--text); }
.inv-bc  { font-size: 12px; color: var(--text-3); font-family: 'Menlo','Courier New',monospace; }
.cat-pill{ display: inline-block; font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: rgba(127,127,127,0.12); color: var(--grey); }
.inv-cost{ color: var(--text-2); text-align: right; font-variant-numeric: tabular-nums; }
.inv-qty { text-align: center; font-weight: 600; color: var(--text); }
.inv-qty.low { color: var(--danger); }
.inv-acts{ display: flex; gap: 4px; justify-content: center; }
.ab      { padding: 4px 9px; border-radius: 4px; font-size: 11.5px; font-weight: 500; cursor: pointer; border: 1px solid transparent; transition: all var(--tr); }
.ab.edit { background: var(--red-l); color: var(--red); border-color: rgba(208,28,28,0.2); }
.ab.edit:hover { background: #FAD7D7; }
.ab.adj  { background: rgba(127,127,127,0.1); color: var(--grey); border-color: rgba(127,127,127,0.2); }
.ab.adj:hover { background: rgba(127,127,127,0.18); }
.ab.del  { background: var(--danger-l); color: var(--danger); border-color: rgba(220,38,38,0.2); }
.ab.del:hover { background: #FEE2E2; }
.hsm { }

/* ── SALE PAGE ──────────────────────────────────── */
.sale-grid { display: grid; grid-template-columns: 360px 1fr; gap: 16px; align-items: start; }
.scan-hi   { border-color: var(--green) !important; }
.scan-hi:focus { box-shadow: 0 0 0 3px rgba(22,163,74,.15) !important; }
.or-sep    { text-align: center; font-size: 12px; color: var(--text-3); font-weight: 500; letter-spacing:.05em; margin: 12px 0; position: relative; }
.or-sep::before,.or-sep::after { content:''; position:absolute; top:50%; width:calc(50% - 18px); height:1px; background:var(--border); }
.or-sep::before { left:0; } .or-sep::after { right:0; }
.sel-btn   { background: var(--grey-l) !important; cursor: pointer; text-align: left; color: var(--text-3) !important; }
.sel-btn:hover { border-color: var(--border-2) !important; color: var(--text) !important; }
.stag      { font-size: 12px; color: var(--green); font-weight: 500; white-space: nowrap; align-self: center; }

.cart-card { display: flex; flex-direction: column; }
.cart-body { flex: 1; min-height: 160px; max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.empty     { color: var(--text-3); text-align: center; padding: 32px 0; font-size: 13px; }
.ci        { display: grid; grid-template-columns: 1fr auto auto auto; gap: 10px; align-items: center; padding: 9px 12px; background: var(--grey-l); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.ci-name   { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ci-qty    { color: var(--text-3); }
.ci-price  { color: var(--text-2); font-variant-numeric: tabular-nums; }
.ci-del    { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 15px; padding: 0 2px; transition: color var(--tr); }
.ci-del:hover { color: var(--danger); }
.cart-foot { border-top: 1px solid var(--border); padding-top: 14px; }
.ctr       { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; font-size: 13.5px; color: var(--text-2); }
.ctv       { font-size: 22px; font-weight: 700; color: var(--red); font-variant-numeric: tabular-nums; }
.cpv       { font-size: 14px; font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }

/* ── TABLES ─────────────────────────────────────── */
.tscroll { overflow-x: auto; max-height: 55vh; }
.dt      { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt thead{ position: sticky; top: 0; z-index: 2; }
.dt th   { padding: 10px 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing:.06em; color: var(--grey); background: var(--grey-l); border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
.dt td   { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-2); vertical-align: middle; }
.dt tbody tr:last-child td { border-bottom: none; }
.dt tbody tr:hover td { background: var(--red-l); }
.dt td:first-child { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.tn  { font-weight: 500; color: var(--text) !important; }
.tnum{ font-variant-numeric: tabular-nums; }
.tg  { color: var(--green) !important; font-weight: 500; font-variant-numeric: tabular-nums; }
.tfoot { display: flex; justify-content: space-between; align-items: center; padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--border); }
.tfoot.three { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.tfs { font-size: 13px; color: var(--text-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.tfs.g { color: var(--green); }

/* ── SETTINGS ───────────────────────────────────── */
.set-grid  { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.set-btns  { display: flex; gap: 10px; }
.danger-card { border-color: rgba(220,38,38,0.2); }
.danger-card:hover { border-color: rgba(220,38,38,0.4); }

/* ── STATUS ─────────────────────────────────────── */
.smsg { font-size: 12.5px; min-height: 18px; transition: opacity .3s; }
.smsg.ok  { color: var(--green); }
.smsg.err { color: var(--danger); }
.action-toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 400;
  max-width: min(360px, calc(100vw - 32px));
  padding: 11px 14px;
  border: 1px solid rgba(22,163,74,0.24);
  border-radius: 8px;
  background: #F0FDF4;
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.action-toast.show { opacity: 1; transform: translateY(0); }
.action-toast.err {
  border-color: rgba(220,38,38,0.24);
  background: var(--danger-l);
  color: var(--danger);
}

/* ── MODALS ─────────────────────────────────────── */
.mbg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; padding: 16px;
  animation: fadein .15s ease;
}
.modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 460px; box-shadow: var(--shadow-lg); animation: mup .18s ease; }
.modal.narrow { max-width: 340px; }
@keyframes mup { from{transform:translateY(10px);opacity:0} to{transform:none;opacity:1} }
.mh  { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.mtt { font-size: 14px; font-weight: 600; color: var(--text); }
.mx  { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 16px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 4px; transition: all var(--tr); }
.mx:hover { background: var(--grey-l); color: var(--text); }
.mb  { padding: 18px; }
.mf  { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); }
.mf.center { justify-content: center; }
.coni { width: 44px; height: 44px; border-radius: 50%; background: rgba(208,28,28,0.1); color: var(--red); font-size: 22px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 12px; }
.cont { font-size: 14px; color: var(--text-2); line-height: 1.6; }
.aname { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.aqty  { font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.cat-list { display: flex; flex-direction: column; gap: 5px; max-height: 220px; overflow-y: auto; }
.cat-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; background: var(--grey-l); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.cat-del  { background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 14px; transition: color var(--tr); }
.cat-del:hover { color: var(--danger); }
.presults { display: flex; flex-direction: column; gap: 4px; max-height: 240px; overflow-y: auto; }
.pr-btn   { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; background: var(--grey-l); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; text-align: left; width: 100%; transition: all var(--tr); }
.pr-btn:hover { border-color: var(--red); background: var(--red-l); }
.pr-name  { font-size: 13px; font-weight: 500; color: var(--text); }
.pr-stock { font-size: 12px; color: var(--text-3); }

/* ── THEME TOGGLE BUTTON ────────────────────────── */
.theme-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px;
  font-family: var(--font); font-size: 13px; font-weight: 500;
  color: var(--text-2); cursor: pointer;
  transition: all .2s ease; white-space: nowrap; flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--red); color: var(--red); background: var(--red-l); }

/* ── SCROLLBARS ─────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

/* ════════════════════════════════════════════════
   DARK MODE
   Base: deep warm charcoal (from grey of logo)
   Accent: stays brand red #D01C1C
════════════════════════════════════════════════ */
body.dark {
  --bg:       #1C1C1C;
  --surface:  #252525;
  --surface-2:#2E2E2E;
  --border:   #383838;
  --border-2: #484848;
  --text:     #F0F0F0;
  --text-2:   #ABABAB;
  --text-3:   #6A6A6A;
  --grey-l:   #2E2E2E;
  --red-l:    rgba(208,28,28,0.13);
  --red-dim:  rgba(208,28,28,0.18);
  --green-l:  rgba(22,163,74,0.12);
  --danger-l: rgba(220,38,38,0.12);
  background: var(--bg);
  color: var(--text);
}

/* Dark — loading & auth */
body.dark .screen-center { background: var(--bg); }
body.dark .auth-panel    { background: var(--surface); border-color: var(--border); box-shadow: 0 8px 32px rgba(0,0,0,.4); }

/* Dark — app shell */
body.dark .topbar        { background: #1A0808; border-bottom: 1px solid var(--border); }

/* Dark — sidebar: keep red strip on top, darken body */
body.dark .sb-top        { background: #2A0808; }
body.dark .sidebar       { background: var(--surface); border-color: var(--border); }
body.dark .av            { background: rgba(208,28,28,0.3); border-color: rgba(208,28,28,0.5); }

/* Dark — nav items */
body.dark .ni            { color: var(--text-3); }
body.dark .ni:hover      { background: var(--red-l); color: #FF6B6B; }
body.dark .ni.active     { background: var(--red-dim); color: #FF6B6B; }
body.dark .nl            { color: var(--text-3); }
body.dark .nd            { background: var(--border); }
body.dark .sb-logout     { border-color: var(--border); color: var(--text-3); }
body.dark .sb-logout:hover { background: rgba(220,38,38,.15); border-color: var(--danger); color: var(--danger); }

/* Dark — cards */
body.dark .card          { background: var(--surface); border-color: var(--border); }
body.dark .sc            { background: var(--surface); border-color: var(--border); }

/* Dark — forms */
body.dark .finput        { background: var(--surface-2); border-color: var(--border); color: var(--text); }
body.dark .finput:focus  { border-color: var(--red); background: var(--surface); box-shadow: 0 0 0 3px rgba(208,28,28,0.2); }
body.dark .finput::placeholder { color: var(--text-3); }

/* Dark — quick actions */
body.dark .qa            { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
body.dark .qa:hover      { background: var(--red-l); border-color: var(--red); color: #FF6B6B; }
body.dark .qa:hover .qc  { color: #FF6B6B; }

/* Dark — inventory */
body.dark .inv-head      { background: var(--surface-2); border-color: var(--border); }
body.dark .inv-row       { border-color: var(--border); }
body.dark .inv-row:hover { background: var(--red-l); }
body.dark .cat-pill      { background: rgba(127,127,127,0.2); color: #999; }

/* Dark — tables */
body.dark .dt th         { background: var(--surface-2); border-color: var(--border); color: #777; }
body.dark .dt td         { border-color: var(--border); }
body.dark .dt tbody tr:hover td { background: var(--red-l); }

/* Dark — buttons */
body.dark .btn.ghost     { border-color: var(--border); color: var(--text-2); }
body.dark .btn.ghost:hover { background: var(--surface-2); color: var(--text); }
body.dark .btn.outline   { border-color: var(--border); color: var(--text-2); }
body.dark .btn.secondary { background: var(--red-l); color: #FF6B6B; }
body.dark .btn.secondary:hover { background: rgba(208,28,28,0.2); }

/* Dark — cart / sale */
body.dark .ci            { background: var(--surface-2); border-color: var(--border); }
body.dark .sel-btn       { background: var(--surface-2) !important; color: var(--text-3) !important; }

/* Dark — modals */
body.dark .mbg           { background: rgba(0,0,0,.65); }
body.dark .modal         { background: var(--surface); border-color: var(--border); }
body.dark .mh            { border-color: var(--border); }
body.dark .mf            { border-color: var(--border); }
body.dark .cat-item      { background: var(--surface-2); border-color: var(--border); }
body.dark .pr-btn        { background: var(--surface-2); border-color: var(--border); }
body.dark .pr-btn:hover  { border-color: var(--red); background: var(--red-l); }

/* Dark — misc */
body.dark .suggest       { background: var(--surface); border-color: var(--border); }
body.dark .sug-item:hover{ background: var(--red-l); }
body.dark .sug-item      { border-color: var(--border); }
body.dark .low-item      { background: rgba(220,38,38,0.1); }
body.dark .fbar          { border-color: var(--border); }
body.dark .ffoot         { border-color: var(--border); }
body.dark .tfoot         { border-color: var(--border); }
body.dark .cart-foot     { border-color: var(--border); }
body.dark .or-sep::before,
body.dark .or-sep::after { background: var(--border); }
body.dark .loader-bar    { background: var(--border); }
body.dark .overlay       { background: rgba(0,0,0,.6); }
body.dark .danger-card   { border-color: rgba(220,38,38,0.3); }
body.dark .theme-toggle  { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
body.dark .theme-toggle:hover { border-color: var(--red); color: #FF6B6B; background: var(--red-l); }
body.dark .mx:hover      { background: var(--surface-2); }
body.dark .coni          { background: rgba(208,28,28,0.15); }

/* ── RESPONSIVE ─────────────────────────────────── */
@media (max-width: 900px) {
  .two-col   { grid-template-columns: 1fr; }
  .sale-grid { grid-template-columns: 1fr; }
  .stats     { grid-template-columns: repeat(2,1fr); }
  .frow      { grid-template-columns: 1fr 1fr; }
  .inv-head,
  .inv-row   { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .hsm       { display: none; }
}

@media (max-width: 640px) {
  .topbar    { display: flex; }
  .sidebar   { position: fixed; top: 0; left: 0; bottom: 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .25s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: translateX(0); }
  .content   { padding-top: calc(var(--topbar-h) + 20px); padding-left: 16px; padding-right: 16px; }
  .stats     { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sc-val    { font-size: 22px; }
  .inv-head,
  .inv-row   { grid-template-columns: 1fr 1fr 1fr; }
  .inv-acts  { flex-direction: column; gap: 3px; }
  .ab        { width: 100%; text-align: center; }
  .hsm       { display: none; }
  .frow      { grid-template-columns: 1fr; }
  .fbar      { flex-direction: column; align-items: stretch; }
  .fbar .self-end { align-self: flex-start; }
  .auth-panel{ padding: 24px 20px; }
  .sale-grid { grid-template-columns: 1fr; }
  .pt        { font-size: 18px; }
  .fbar .fg.sm { width: 100%; }
  .fbar .btn.self-end { width: 100%; }
  .set-btns  { flex-direction: column; }
  .modal     { max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0; position: fixed; bottom: 0; left: 0; right: 0; }
  .mbg       { align-items: flex-end; padding: 0; }
}

@media (max-width: 380px) {
  .stats     { grid-template-columns: 1fr; }
  .inv-head,
  .inv-row   { grid-template-columns: 1fr 1fr; }
}

/* ── NEW FEATURE STYLES ─────────────────────────── */

/* Sale btn row - Add to Cart + Free button side by side */
.sale-btn-row { display: flex; gap: 8px; margin-top: 4px; }
.btn.free-btn { background: rgba(234,179,8,0.1); color: #B45309; border-color: rgba(234,179,8,0.3); font-weight: 500; }
.btn.free-btn:hover { background: rgba(234,179,8,0.18); border-color: #D97706; }

/* Free item in cart */
.ci-free { border-color: rgba(234,179,8,0.3) !important; background: rgba(234,179,8,0.06) !important; }
.ci-free .ci-price { color: #D97706; font-weight: 600; }

/* Free badge in sales history */
.free-badge { display:inline-block; padding:2px 8px; background:rgba(234,179,8,0.12); color:#B45309; border-radius:99px; font-size:11px; font-weight:600; }

/* Activity log */
.act-list { }
.act-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); transition: background var(--tr); }
.act-item:last-child { border-bottom: none; }
.act-item:hover { background: var(--red-l); }
.act-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--grey-l); display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.act-body { flex: 1; min-width: 0; }
.act-text { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.act-time { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.act-val  { font-size: 13px; font-weight: 600; color: var(--red); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Dark mode for new elements */
body.dark .btn.free-btn { background: rgba(234,179,8,0.08); color: #D97706; border-color: rgba(234,179,8,0.25); }
body.dark .ci-free      { border-color: rgba(234,179,8,0.25) !important; background: rgba(234,179,8,0.05) !important; }
body.dark .act-icon     { background: var(--surface-2); }
body.dark .act-item:hover { background: var(--red-l); }

/* ── BULK ORDER UPGRADES ────────────────────────── */

/* Supplier + date row above the grid */
.bulk-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}

/* GST toggle in page header */
.gst-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 6px 14px;
}
.gst-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-2);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-2);
    border-radius: 20px;
    transition: .2s;
}
.toggle-slider:before {
    content: '';
    position: absolute;
    width: 14px; height: 14px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--red); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(16px); }

/* GST active badge in cart header */
.gst-active-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    background: rgba(208,28,28,0.12);
    color: var(--red);
    border: 1px solid rgba(208,28,28,0.25);
    border-radius: 99px;
    letter-spacing: 0.05em;
}

/* GST-applied cart item */
.ci-gst { border-color: rgba(208,28,28,0.2) !important; }

/* ── BILL MANAGER ───────────────────────────────── */

/* Bill list uses inv-row grid but with different columns */
.bill-head {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.2fr 0.8fr 1fr 0.5fr 0.7fr;
    gap: 10px;
    padding: 11px 16px;
    background: var(--grey-l);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--grey);
    border-bottom: 1px solid var(--border);
}
.bill-row {
    grid-template-columns: 1.5fr 1fr 1.2fr 0.8fr 1fr 0.5fr 0.7fr !important;
}

/* Bill detail meta grid */
.bill-detail-meta { margin-bottom: 14px; }
.bill-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
    padding: 12px;
    background: var(--grey-l);
    border-radius: var(--radius);
    margin-bottom: 14px;
}
.bill-meta-grid > div { display: flex; flex-direction: column; gap: 4px; }
.bill-meta-grid .flabel { font-size: 10px; }
.bill-meta-grid > div > div { font-size: 13px; font-weight: 500; color: var(--text); }
.bill-photo-panel {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.bill-photo-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 13px;
}
.bill-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}
.bill-photo-card {
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.bill-photo-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
.bill-photo-empty {
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    color: var(--text-3);
    font-size: 13px;
    text-align: center;
}

/* Dark mode for new elements */
body.dark .gst-toggle-wrap { background: var(--surface-2); border-color: var(--border); }
body.dark .toggle-slider   { background: var(--border-2); }
body.dark .bill-meta-grid  { background: var(--surface-2); }
body.dark .bill-head       { background: var(--surface-2); }

/* Responsive */
@media (max-width: 640px) {
    .bulk-meta-row { grid-template-columns: 1fr; }
    .bill-head, .bill-row { grid-template-columns: 1fr 1fr 1fr !important; }
    .bill-meta-grid { grid-template-columns: 1fr 1fr; }
}

/* ── ACTIVITY DELETE BUTTON ─────────────────────── */
.act-del-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-3);
    font-size: 15px;
    padding: 4px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all var(--tr);
    margin-left: 8px;
}
.act-del-btn:hover {
    background: var(--danger-l);
    color: var(--danger);
}
body.dark .act-del-btn:hover {
    background: rgba(220,38,38,0.15);
    color: var(--danger);
}

/* ── 3-COLUMN STATS GRID ────────────────────────── */
.stats-three { grid-template-columns: repeat(3, 1fr) !important; }
.sc.grey { border-top-color: var(--grey); }
.sc.grey .sc-val { color: var(--grey); }

@media (max-width: 640px) {
    .stats-three { grid-template-columns: 1fr 1fr !important; }
    .stats-three .sc:last-child { grid-column: span 2; }
}

/* ── PAYMENT METHOD TOGGLE ──────────────────────── */
.payment-toggle {
    display: flex;
    gap: 8px;
}
.pay-btn {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--border-2);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text-2);
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--tr);
    text-align: center;
}
.pay-btn:hover { border-color: var(--red); color: var(--red); }
.pay-btn.active {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--red);
    font-weight: 600;
}

/* Payment badges in tables */
.pay-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 99px;
    white-space: nowrap;
}
.pay-badge.cash {
    background: rgba(22,163,74,0.1);
    color: #16A34A;
    border: 1px solid rgba(22,163,74,0.2);
}
.pay-badge.gpay {
    background: rgba(37,99,235,0.1);
    color: #2563EB;
    border: 1px solid rgba(37,99,235,0.2);
}

/* Dashboard Cash/GPay stat cards */
.sc.cash { border-top-color: #16A34A; }
.sc.cash .sc-val { color: #16A34A; }
.sc.gpay { border-top-color: #2563EB; }
.sc.gpay .sc-val { color: #2563EB; }

/* 5-column stats grid */
.stats-five { grid-template-columns: repeat(5, 1fr) !important; }

@media (max-width: 900px) {
    .stats-five { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 640px) {
    .stats-five { grid-template-columns: repeat(2, 1fr) !important; }
    .stats-five .sc:last-child { grid-column: span 2; }
}

/* Dark mode for payment elements */
body.dark .pay-btn { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }
body.dark .pay-btn.active { background: var(--red-dim); border-color: var(--red); color: #FF6B6B; }
body.dark .pay-btn:hover { border-color: var(--red); color: #FF6B6B; }

/* ── NAVIN A/C / GST TOGGLE ─────────────────────── */

/* Inventory row with 7 columns */
.inv-row-7 {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 0.7fr 1.2fr !important;
}
.inv-head {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr 0.7fr 1.2fr !important;
}

/* GST toggle button - golden */
.ab.gst-off {
    background: rgba(180,130,0,0.08);
    color: #92730a;
    border: 1.5px solid rgba(180,130,0,0.2);
    font-weight: 600;
}
.ab.gst-off:hover {
    background: rgba(212,160,0,0.15);
    border-color: #c8960a;
    color: #7a5f00;
}
.ab.gst-on {
    background: linear-gradient(135deg, #f5c518, #e8a900);
    color: #4a3500;
    border: 1.5px solid #c8960a;
    font-weight: 700;
    box-shadow: 0 1px 6px rgba(212,160,0,0.35);
}
.ab.gst-on:hover {
    background: linear-gradient(135deg, #ffcd1e, #f0b000);
    box-shadow: 0 2px 10px rgba(212,160,0,0.5);
}

/* Navin dot indicator on product name */
.navin-dot {
    color: #c8960a;
    font-size: 10px;
    vertical-align: middle;
    margin-right: 2px;
}

/* Navin A/C badge in sales history */
.navin-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 99px;
    background: rgba(212,160,0,0.12);
    color: #92730a;
    border: 1px solid rgba(212,160,0,0.25);
    white-space: nowrap;
}
.our-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--grey-l);
    color: var(--text-3);
    border: 1px solid var(--border);
    white-space: nowrap;
}

/* Payment summary grid on dashboard */
.payment-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 18px;
}
.pscard {
    border-radius: var(--radius);
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: var(--surface);
}
.pscard.our       { border-left: 3px solid var(--green); }
.pscard.navin     { border-left: 3px solid #c8960a; }
.pscard.total-cash { border-left: 3px solid #16A34A; background: rgba(22,163,74,0.04); }
.pscard.total-gpay { border-left: 3px solid #2563EB; background: rgba(37,99,235,0.04); }
.psc-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-3);
    margin-bottom: 6px;
}
.psc-val {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}
.pscard.navin .psc-val { color: #92730a; }
.pscard.total-cash .psc-val { color: var(--green); }
.pscard.total-gpay .psc-val { color: #2563EB; }

/* Dark mode */
body.dark .ab.gst-off  { background: rgba(212,160,0,0.08); color: #c8960a; border-color: rgba(212,160,0,0.2); }
body.dark .navin-badge  { background: rgba(212,160,0,0.1); color: #c8960a; border-color: rgba(212,160,0,0.2); }
body.dark .pscard       { background: var(--surface); border-color: var(--border); }

/* Responsive */
@media (max-width: 640px) {
    .payment-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .inv-head, .inv-row-7 { grid-template-columns: 1fr 1fr 1fr !important; }
}

/* ── DATE INPUT LIGHT MODE FIX ──────────────────── */
/* Force date picker icon visible in light mode */
input[type="date"] {
    color-scheme: light;
    color: var(--text);
}
input[type="date"]::-webkit-calendar-picker-indicator {
    opacity: 0.7;
    cursor: pointer;
    filter: none;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}
/* Dark mode — keep it dark */
body.dark input[type="date"] {
    color-scheme: dark;
}
body.dark input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.7;
}

/* ── REPAIR PROFILE CARDS ───────────────────────── */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    padding: 4px 0;
}
.rp-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: box-shadow var(--tr);
}
.rp-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.rp-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rp-card-av {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--red); color: white;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.rp-card-info { flex: 1; min-width: 0; }
.rp-card-name { font-weight: 600; font-size: 15px; color: var(--text); }
.rp-card-mobile { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.rp-card-days { font-size: 11px; font-weight: 600; color: var(--red); white-space: nowrap; }
.rp-card-device { font-size: 13px; color: var(--text-2); margin-bottom: 4px; }
.rp-card-problem { font-size: 12px; color: #B45309; background: rgba(234,179,8,0.08); padding: 4px 8px; border-radius: 4px; margin-bottom: 6px; }
.rp-card-date { font-size: 11px; color: var(--text-3); margin-bottom: 12px; }
.rp-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.rp-card-actions .btn {
    width: 100%;
    min-width: 0;
    padding-left: 8px;
    padding-right: 8px;
    white-space: normal;
    line-height: 1.15;
}
.rp-card-actions .btn:first-child { grid-column: 1 / -1; }

/* Complete repair — selected profile display */
.rp-selected-profile {
    background: var(--grey-l);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    border-left: 3px solid var(--red);
}
.rp-name { font-weight: 600; font-size: 14px; color: var(--text); }
.rp-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; }

/* Pending badge on sidebar */
.badge-small {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 18px; height: 18px;
    background: var(--red); color: white;
    border-radius: 99px; font-size: 10px; font-weight: 700;
    padding: 0 5px; margin-left: 4px; vertical-align: middle;
}

/* Dark mode */
body.dark .rp-card { background: var(--surface-2); }
body.dark .rp-selected-profile { background: var(--surface-2); }

/* ── EMPLOYEE HOMEPAGE ──────────────────────────── */
.emp-welcome-card {
    background: linear-gradient(135deg, var(--red) 0%, #B91C1C 100%);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 18px;
    color: white;
    box-shadow: 0 4px 20px rgba(208,28,28,0.25);
}
.emp-welcome-text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.6;
    color: rgba(255,255,255,0.95);
}

/* ── REPAIRMEN ACCOUNT ──────────────────────────── */
.rm-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}
.rm-tab {
    padding: 9px 24px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-3);
    cursor: pointer;
    transition: all var(--tr);
    border-radius: 0;
}
.rm-tab:hover { color: var(--text); }
.rm-tab.active { color: var(--red); border-bottom-color: var(--red); font-weight: 600; }

.rm-balance-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 16px;
}
.rm-balance-card {
    background: linear-gradient(135deg, var(--red), #B91C1C);
    border-radius: var(--radius);
    padding: 22px 20px;
    color: white;
}
.rm-balance-label { font-size: 12px; font-weight: 500; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 8px; }
.rm-balance-val   { font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.rm-balance-sub   { font-size: 12px; opacity: 0.8; }

.rm-actions-card, .rm-receipt-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
}
.rm-actions-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 12px; }
.rm-last-cleared  { font-size: 12px; color: var(--text-3); margin-top: 10px; }

.badge-pending {
    display: inline-block; padding: 2px 10px; border-radius: 99px;
    background: rgba(234,179,8,0.12); color: #B45309;
    border: 1px solid rgba(234,179,8,0.25); font-size: 11px; font-weight: 600;
}
.badge-paid {
    display: inline-block; padding: 2px 10px; border-radius: 99px;
    background: rgba(22,163,74,0.1); color: #16A34A;
    border: 1px solid rgba(22,163,74,0.2); font-size: 11px; font-weight: 600;
}

/* Dark mode */
body.dark .rm-actions-card, body.dark .rm-receipt-card { background: var(--surface-2); }

@media (max-width: 900px) {
    .rm-balance-row { grid-template-columns: 1fr; }
}

/* Capital + supplier accounts */
.capital-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 18px;
}
.capital-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.capital-grid.profit {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.capital-tile {
    min-height: 116px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.capital-tile.total {
    background: linear-gradient(135deg, var(--red), #B91C1C);
    color: #fff;
    border-color: transparent;
}
.capital-tile.chachi {
    border-color: rgba(217,119,6,0.28);
    background: rgba(217,119,6,0.08);
}
.capital-tile.profit {
    border-color: rgba(22,163,74,0.22);
    background: rgba(22,163,74,0.06);
}
.capital-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-3);
}
.capital-tile.total .capital-label,
.capital-tile.total .capital-sub { color: rgba(255,255,255,0.8); }
.capital-val {
    font-size: 24px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text);
    margin: 10px 0 4px;
    overflow-wrap: anywhere;
}
.capital-tile.total .capital-val { color: #fff; }
.capital-tile.profit .capital-val { color: var(--green); }
.capital-tile.chachi .capital-val { color: #B45309; }
.capital-sub {
    font-size: 12px;
    color: var(--text-3);
    line-height: 1.35;
}
.capital-tabs {
    margin-top: 4px;
}
.capital-tab-panel {
    margin-top: 14px;
}
.cap-card-head {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}
body.dark .capital-tile {
    background: var(--surface-2);
}
body.dark .capital-tile.chachi {
    background: rgba(217,119,6,0.12);
}
body.dark .capital-tile.profit {
    background: rgba(22,163,74,0.10);
}

@media (max-width: 1200px) {
    .capital-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .capital-grid.profit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .capital-grid,
    .capital-grid.profit { grid-template-columns: 1fr; }
    .capital-tabs { overflow-x: auto; }
}

/* User management */
.um-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.um-row {
    display: grid;
    grid-template-columns: 40px minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
}
.um-av {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
}
.um-info {
    min-width: 0;
}
.um-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 3px;
}
.um-uid {
    font-size: 11px;
    color: var(--text-3);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.um-role-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 82px;
    padding: 4px 10px;
    border: 1px solid currentColor;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 700;
    background: transparent;
}
.um-row .btn {
    min-width: 62px;
}
.um-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}
.um-you {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 62px;
    padding: 5px 10px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-3);
    font-size: 12px;
    font-weight: 600;
}

body.dark .um-row {
    background: var(--surface-2);
    border-color: var(--border);
}
body.dark .um-you {
    background: var(--surface);
}

@media (max-width: 700px) {
    .um-row {
        grid-template-columns: 40px minmax(0, 1fr);
    }
    .um-role-badge,
    .um-actions,
    .um-you {
        grid-column: 2;
        justify-self: start;
    }
    .um-actions { flex-wrap: wrap; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   TALLY STOCK STYLES
   ══════════════════════════════════════════════════════════════════════════════ */

/* Progress bar */
.tally-progress-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.tally-progress-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--grey-l);
    border-radius: 99px;
    overflow: hidden;
    border: 1px solid var(--border);
}
.tally-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--red);
    border-radius: 99px;
    transition: width 0.3s ease, background 0.3s ease;
}
.tally-progress-label {
    font-size: 12.5px;
    color: var(--text-3);
    white-space: nowrap;
    min-width: 110px;
    text-align: right;
}

/* Tally table head */
.tally-head {
    display: grid;
    grid-template-columns: 2fr 1fr 0.7fr 1fr 1.4fr 1.2fr;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-3);
    border-radius: var(--radius) var(--radius) 0 0;
}

/* Tally rows */
.tally-row {
    display: grid;
    grid-template-columns: 2fr 1fr 0.7fr 1fr 1.4fr 1.2fr;
    gap: 12px;
    padding: 11px 16px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    font-size: 13.5px;
    transition: background 0.15s;
}
.tally-row:last-child { border-bottom: none; }
.tally-row:hover { background: var(--red-l); }

/* Row status tints */
.tally-row-ok      { background: rgba(22, 163, 74, 0.06); }
.tally-row-partial { background: rgba(234, 179, 8, 0.08); }
.tally-row-missing { background: rgba(220, 38, 38, 0.06); }
.tally-row-ok:hover      { background: rgba(22, 163, 74, 0.12); }
.tally-row-partial:hover { background: rgba(234, 179, 8, 0.14); }
.tally-row-missing:hover { background: rgba(220, 38, 38, 0.1); }

/* Status button group */
.tally-status-btns {
    display: flex;
    gap: 5px;
    justify-content: center;
}
.tally-btn {
    background: none;
    border: 1.5px solid var(--border-2);
    border-radius: 6px;
    padding: 4px 7px;
    font-size: 15px;
    cursor: pointer;
    opacity: 0.45;
    transition: opacity 0.15s, border-color 0.15s, background 0.15s, transform 0.1s;
    line-height: 1;
}
.tally-btn:hover { opacity: 0.8; transform: scale(1.1); }
.tally-btn-active-ok      { opacity: 1 !important; border-color: #16A34A; background: rgba(22,163,74,0.12); }
.tally-btn-active-partial { opacity: 1 !important; border-color: #D97706; background: rgba(234,179,8,0.12); }
.tally-btn-active-missing { opacity: 1 !important; border-color: var(--danger); background: rgba(220,38,38,0.1); }

/* Qty input inside tally row */
.tally-qty-input {
    width: 80px;
    text-align: center;
    padding: 5px 8px !important;
    font-size: 13px !important;
}
.tally-sysqty { font-variant-numeric: tabular-nums; }

/* ── Summary Modal ── */
.tally-stat-tile {
    text-align: center;
    padding: 20px 12px;
    border-right: 1px solid var(--border);
}
.tally-stat-tile:last-child { border-right: none; }
.tally-stat-tile.ok      { background: rgba(22,163,74,0.06); }
.tally-stat-tile.partial { background: rgba(234,179,8,0.06); }
.tally-stat-tile.missing { background: rgba(220,38,38,0.05); }
.tally-stat-num {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}
.tally-stat-tile.ok .tally-stat-num      { color: #16A34A; }
.tally-stat-tile.partial .tally-stat-num { color: #D97706; }
.tally-stat-tile.missing .tally-stat-num { color: var(--danger); }
.tally-stat-lbl { font-size: 12px; color: var(--text-3); font-weight: 500; }

.tally-sum-label {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    padding: 6px 10px;
    border-radius: 6px;
}
.tally-sum-label.ok       { background: rgba(22,163,74,0.1);  color: #15803D; }
.tally-sum-label.partial  { background: rgba(234,179,8,0.1);  color: #92400E; }
.tally-sum-label.missing  { background: rgba(220,38,38,0.08); color: var(--danger); }
.tally-sum-label.unchecked{ background: var(--grey-l);        color: var(--text-2); }

.tally-sum-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
}
.tally-sum-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    padding: 6px 10px;
    background: var(--surface-2);
    border-radius: 6px;
    border: 1px solid var(--border);
}
.tally-sum-row span:first-child { flex: 1; font-weight: 500; }
.tally-sum-diff { font-size: 12px; color: var(--text-2); white-space: nowrap; }

/* Dark mode tally overrides */
body.dark .tally-head        { background: var(--surface-2); border-color: var(--border); }
body.dark .tally-row         { border-color: var(--border); }
body.dark .tally-row-ok      { background: rgba(22,163,74,0.08); }
body.dark .tally-row-partial { background: rgba(234,179,8,0.08); }
body.dark .tally-row-missing { background: rgba(220,38,38,0.07); }
body.dark .tally-btn         { border-color: var(--border); }
body.dark .tally-sum-row     { background: var(--surface-2); border-color: var(--border); }
body.dark .tally-stat-tile   { border-color: var(--border); }
body.dark .tally-sum-label.unchecked { background: var(--surface-2); }
body.dark .tally-progress-bar-bg { background: var(--surface-2); border-color: var(--border); }

/* Responsive */
@media (max-width: 700px) {
    .tally-head,
    .tally-row { grid-template-columns: 1fr 1fr 1fr; }
    .tally-head span:nth-child(2),
    .tally-row  div:nth-child(2),
    .tally-head span:nth-child(3),
    .tally-row  div:nth-child(3) { display: none; }
    .tally-qty-input { width: 60px; }
    .tally-stat-num { font-size: 24px; }
}
@media (max-width: 480px) {
    .tally-head,
    .tally-row { grid-template-columns: 1fr 1fr; }
    .tally-head span:nth-child(4),
    .tally-row  div:nth-child(4) { display: none; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   INCENTIVE SYSTEM STYLES
   ══════════════════════════════════════════════════════════════════════════════ */

.sc.gold { background: rgba(217,119,6,0.08); border-color: rgba(217,119,6,0.3); }
.sc.gold .sc-val { color: #D97706; }

.inc-emp-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.inc-emp-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: box-shadow 0.15s;
}
.inc-emp-card:hover { box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.inc-emp-top { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.inc-emp-av {
    width: 40px; height: 40px;
    background: var(--red); color: #fff;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.inc-emp-info { flex: 1; min-width: 120px; }
.inc-emp-name { font-weight: 700; font-size: 14px; }
.inc-emp-meta { font-size: 12px; color: var(--text-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.inc-emp-stat { text-align: right; min-width: 110px; }
.inc-stat-lbl { font-size: 11px; color: var(--text-3); margin-bottom: 2px; }
.inc-stat-val { font-size: 16px; font-weight: 700; }
.inc-stat-val.green { color: var(--green); }
.inc-stat-val.gold  { color: #D97706; }

.inc-tier-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.inc-tier-pill {
    background: var(--surface-2); border: 1px solid var(--border-2);
    border-radius: 99px; padding: 3px 10px;
    font-size: 11.5px; font-weight: 500; color: var(--text-2);
}
.inc-history-panel {
    border-top: 1px solid var(--border);
    padding-top: 14px;
    margin: 4px 0 14px;
}
.inc-history-dropdown {
    border-top: 1px solid var(--border);
    margin: 4px 0 14px;
}
.inc-history-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-2);
    list-style: none;
}
.inc-history-summary::-webkit-details-marker { display: none; }
.inc-history-summary::after {
    content: '+';
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    flex-shrink: 0;
}
.inc-history-dropdown[open] .inc-history-summary::after { content: '-'; }
.inc-history-summary-meta {
    color: #D97706;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    margin-left: auto;
}
.inc-history-dropdown .inc-history-panel {
    border-top: none;
    padding-top: 2px;
}
.inc-history-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.inc-history-head.compact { margin: 14px 0 8px; }
.inc-history-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-2);
}
.inc-history-sub {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 2px;
}
.inc-history-total {
    font-size: 13px;
    font-weight: 700;
    color: #D97706;
    white-space: nowrap;
}
.inc-history-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
}
.inc-history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 420px;
    font-size: 12px;
}
.inc-history-table th,
.inc-history-table td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.inc-history-table th {
    background: var(--surface-2);
    color: var(--text-3);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.inc-history-table tr:last-child td { border-bottom: none; }
.inc-history-table .green { color: var(--green); font-weight: 700; }
.inc-history-table .gold { color: #D97706; font-weight: 700; }
.inc-history-empty {
    border: 1px dashed var(--border);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-3);
    font-size: 12px;
    background: var(--surface-2);
}
.inc-history-date-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 10px;
}
.inc-history-date-input {
    width: 150px;
    flex-shrink: 0;
}
.inc-date-result {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) minmax(90px, .7fr) minmax(90px, .7fr);
    gap: 10px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--surface-2);
    font-size: 13px;
}
.inc-date-result.muted {
    display: block;
    color: var(--text-3);
}
.inc-date-result-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-3);
    margin-bottom: 2px;
}
.inc-date-result-sub { color: var(--text-3); font-size: 11px; }
.inc-date-result .green { color: var(--green); font-weight: 700; }
.inc-date-result .gold { color: #D97706; font-weight: 700; }
.inc-emp-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 2px; }

.inc-badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px; border-radius: 99px;
    font-size: 11px; font-weight: 600; white-space: nowrap;
}
.inc-badge.active   { background: rgba(22,163,74,0.1);  color: #15803D; }
.inc-badge.frozen   { background: rgba(37,99,235,0.1);  color: #1D4ED8; }
.inc-badge.stopped  { background: var(--grey-l); color: var(--text-3); }
.inc-badge.none     { background: var(--grey-l); color: var(--text-3); }

.inc-emp-self { max-width: 560px; }

.inc-tier-row {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px; border-radius: 8px;
    border: 1.5px solid var(--border);
    font-size: 13px; background: var(--surface-2);
    transition: border-color 0.15s, background 0.15s;
}
.inc-tier-row span:first-child { flex: 1; }
.inc-tier-row-active { border-color: #D97706; background: rgba(217,119,6,0.07); }

.inc-tier-head {
    display: grid; grid-template-columns: 1fr 1fr 32px; gap: 8px;
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: .04em; color: var(--text-3); padding: 0 4px 6px;
}
.inc-tier-input-row {
    display: grid; grid-template-columns: 1fr 1fr 32px;
    gap: 8px; align-items: center; margin-bottom: 6px;
}
.inc-tier-input-row .finput { padding: 7px 10px; font-size: 13px; }

body.dark .inc-emp-card  { background: var(--surface); border-color: var(--border); }
body.dark .inc-tier-row  { background: var(--surface-2); border-color: var(--border); }
body.dark .inc-tier-row-active { border-color: #D97706; background: rgba(217,119,6,0.1); }
body.dark .inc-tier-pill { background: var(--surface-2); border-color: var(--border); }
body.dark .inc-history-table th,
body.dark .inc-history-empty,
body.dark .inc-date-result { background: var(--surface-2); }
body.dark .sc.gold       { background: rgba(217,119,6,0.1); }

@media (max-width: 600px) {
    .inc-emp-top { flex-direction: column; }
    .inc-emp-stat { text-align: left; }
    .inc-history-summary { align-items: flex-start; }
    .inc-history-summary-meta { margin-left: 0; }
    .inc-history-head { flex-direction: column; }
    .inc-history-date-row { flex-direction: column; align-items: stretch; }
    .inc-history-date-input { width: 100%; }
    .inc-date-result { grid-template-columns: 1fr; }
    .inc-tier-head, .inc-tier-input-row { grid-template-columns: 1fr 1fr 28px; }
}
