/* =====================================================================
   Vastram by Neel Creative — admin UI
   Palette is drawn from the name: neel (indigo dye) for structure,
   haldi (turmeric) as the single warm accent. No CSS framework, so the
   POS and admin keep working from cache when the shop's internet drops.
   ===================================================================== */

:root {
  --neel-950: #121735;
  --neel-900: #1a2150;
  --neel-700: #2b367e;
  --neel-600: #3542a0;
  --neel-100: #dfe3f6;
  --neel-50:  #eef0fa;
  --haldi:    #e0a526;
  --haldi-600:#c48a10;
  --haldi-50: #fdf5e3;

  --ink:   #191c2b;
  --ink-2: #4f5568;
  --ink-3: #7c8297;
  --line:  #e2e4ee;
  --line-2:#eceef5;
  --paper: #f4f5f9;
  --surface: #ffffff;

  --success: #1f7a55; --success-50: #e7f4ee;
  --danger:  #b3323e; --danger-50:  #fbecee;
  --warning: #9a620a; --warning-50: #fdf3e0;
  --info:    #2c63b8; --info-50:    #eaf1fb;

  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --r-sm: 6px; --r: 8px; --r-lg: 12px;
  --shadow-pop: 0 12px 32px rgba(18, 23, 53, .16);
  --sidebar-w: 248px;
  --topbar-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--neel-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.3rem; } h3 { font-size: 1.08rem; } h4 { font-size: .98rem; }
p { margin: 0 0 .75rem; }
small, .text-small { font-size: .82rem; }
.muted { color: var(--ink-3); }
.num, td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
code, .mono { font-family: var(--mono); font-size: .85em; }
:focus-visible { outline: 2px solid var(--haldi); outline-offset: 2px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: var(--r); }
.skip-link:focus { left: 8px; }
.icon { flex: none; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------------------------------------------------------------- layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.app-main { min-width: 0; display: flex; flex-direction: column; }
.content { padding: 24px 28px 48px; max-width: 1440px; width: 100%; outline: none; }

/* ---------------------------------------------------------------- sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  color: #c9cdea;
  background-color: var(--neel-900);
  /* Block-print (dabu) dot motif — the one decorative flourish in the UI */
  background-image:
    radial-gradient(circle at 50% 50%, rgba(224,165,38,.10) 1.4px, transparent 1.6px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.035) 3px, transparent 3.4px);
  background-size: 22px 22px, 22px 22px;
  background-position: 0 0, 11px 11px;
}
.brand { display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 14px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand-link { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none !important; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--haldi); color: var(--neel-950); font-weight: 700; font-size: 18px;
}
.brand-name { font-weight: 650; font-size: 15px; line-height: 1.2; color: #fff; }
.brand-logo { max-height: 40px; width: auto; }
.nav { padding: 8px 10px 16px; flex: 1; }
.nav-group { margin-top: 14px; }
.nav-heading { font-size: 12px; color: #8b91bd; padding: 0 10px 6px; font-weight: 500; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0;
  border-radius: var(--r); color: #d5d8f0; font-size: 14.5px; position: relative;
}
.nav-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 600; }
.nav-link.active::before { content: ""; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--haldi); }
.nav-link .icon { opacity: .85; }
.sidebar-foot { padding: 12px 20px; font-size: 12px; color: #6c72a3; }
.sidebar-close, .sidebar-toggle { display: none; }
.sidebar-scrim { display: none; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar-title { font-size: 18px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 6px; border-radius: var(--r); }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--paper); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--neel-50); color: var(--neel-700); font-weight: 650; font-size: 13px; }
.user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.user-meta small { color: var(--ink-3); font-size: 12px; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 6px; z-index: 30;
}
.menu-pop a, .menu-pop button {
  display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border-radius: var(--r-sm);
  font: inherit; font-size: 14px; color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--paper); text-decoration: none; }

/* ---------------------------------------------------------------- page head */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 1.45rem; }
.page-head p { margin: 4px 0 0; color: var(--ink-2); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-body { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { margin: 0; font-size: 1rem; }
.card + .card, .card + .grid, .grid + .card, .grid + .grid { margin-top: 18px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-main-side { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* Stat tiles: figures are the content, so they lead; the label sits beneath */
.stat { padding: 16px 18px; }
.stat-value { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; letter-spacing: -.02em; line-height: 1.15; }
.stat-label { color: var(--ink-2); font-size: .9rem; margin-top: 2px; }
.stat-note { color: var(--ink-3); font-size: .8rem; margin-top: 6px; }
.stat.is-warning { border-left: 3px solid var(--haldi); }
.stat.is-danger { border-left: 3px solid var(--danger); }
.stat a { color: inherit; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; font-weight: 600; color: var(--ink-2); font-size: 13px;
  padding: 10px 14px; background: #fafbfd; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tbody tr:hover { background: #fafbff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * + * { margin-left: 4px; }
.table-compact td, .table-compact th { padding: 7px 12px; }
.cell-title { font-weight: 600; }
.cell-sub { color: var(--ink-3); font-size: 12.5px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: var(--r); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap; text-decoration: none !important; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--paper); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--neel-700); border-color: var(--neel-700); color: #fff; }
.btn-primary:hover { background: var(--neel-600); }
.btn-accent { background: var(--haldi); border-color: var(--haldi); color: var(--neel-950); }
.btn-accent:hover { background: var(--haldi-600); border-color: var(--haldi-600); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #9c2833; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--paper); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 8px; font-size: 12.5px; border-radius: var(--r-sm); }
.btn-block { width: 100%; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r); border: 0; background: none; color: inherit; cursor: pointer; }
.icon-btn:hover { background: rgba(127,127,160,.12); }

/* ---------------------------------------------------------------- forms */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.field .help { font-size: 12.5px; color: var(--ink-3); }
.field .error-text { font-size: 12.5px; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; height: 40px; padding: 0 12px; font: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--surface); border: 1px solid #d3d6e3; border-radius: var(--r);
}
.textarea { height: auto; min-height: 90px; padding: 10px 12px; resize: vertical; }
.select { padding-right: 32px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8297' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--neel-600); box-shadow: 0 0 0 3px var(--neel-50); }
.input.is-invalid, .select.is-invalid { border-color: var(--danger); }
.input-sm, .select-sm { height: 34px; font-size: 13.5px; }
.check { display: flex; align-items: flex-start; gap: 9px; font-size: 14.5px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--neel-700); flex: none; }
.input-group { position: relative; }
.input-group .input { padding-right: 44px; }
.input-group .input-addon { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
fieldset { border: 0; padding: 0; margin: 0; }
.section-title { font-size: 1rem; margin: 22px 0 10px; padding-top: 16px; border-top: 1px solid var(--line-2); }
.section-title:first-child { border-top: 0; padding-top: 0; margin-top: 0; }

/* filter bar */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.filters .field { min-width: 150px; }
.filters .field.grow { flex: 1; min-width: 200px; }

/* ---------------------------------------------------------------- badges & alerts */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge-neutral { background: #eef0f5; color: var(--ink-2); }
.badge-primary { background: var(--neel-50); color: var(--neel-700); }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-danger  { background: var(--danger-50); color: var(--danger); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-info    { background: var(--info-50); color: var(--info); }

.alert { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--r); font-size: 14px; margin-bottom: 16px; border: 1px solid transparent; }
.alert-danger  { background: var(--danger-50); color: #7d1f28; border-color: #f2cfd3; }
.alert-success { background: var(--success-50); color: #155a3e; border-color: #c9e7d8; }
.alert-warning { background: var(--warning-50); color: #6e4507; border-color: #f4dfb5; }
.alert-info    { background: var(--info-50); color: #1d4785; border-color: #cfe0f6; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* ---------------------------------------------------------------- lists & misc */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.list-plain { list-style: none; margin: 0; padding: 0; }
.list-plain li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.list-plain li:last-child { border-bottom: 0; }
.checklist li { justify-content: flex-start; align-items: center; }
.checklist .done { color: var(--success); }
.checklist .todo { color: var(--ink-3); }
.empty-state { text-align: center; padding: 48px 20px; color: var(--ink-2); }
.empty-state h2 { font-size: 1.15rem; color: var(--ink); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); vertical-align: -1px; }
pre.json { background: #f7f8fb; border: 1px solid var(--line-2); border-radius: var(--r); padding: 10px; font-size: 12px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 6px 0 0; }
details.inline summary { cursor: pointer; color: var(--neel-700); font-size: 13px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tab { padding: 10px 14px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink-3); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: var(--neel-700); border-bottom-color: var(--neel-700); }
.tab-panel[hidden] { display: none; }

/* side list (roles) */
.side-list { list-style: none; margin: 0; padding: 6px; }
.side-list a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: var(--r); color: var(--ink); font-size: 14px; }
.side-list a:hover { background: var(--paper); text-decoration: none; }
.side-list a.active { background: var(--neel-50); color: var(--neel-700); font-weight: 600; }

.perm-group { padding: 14px 20px; border-bottom: 1px solid var(--line-2); }
.perm-group h4 { text-transform: capitalize; margin-bottom: 10px; }
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 16px; }
.check.is-locked { color: var(--ink-3); cursor: not-allowed; }

/* pagination */
.pagination { display: flex; align-items: center; gap: 4px; padding: 12px 20px; flex-wrap: wrap; border-top: 1px solid var(--line-2); }
.pagination a { min-width: 32px; height: 32px; display: inline-grid; place-items: center; padding: 0 8px; border-radius: var(--r-sm); color: var(--ink-2); font-size: 13.5px; }
.pagination a:hover { background: var(--paper); text-decoration: none; }
.pagination a.current { background: var(--neel-700); color: #fff; }
.pagination .gap { padding: 0 4px; color: var(--ink-3); }
.pagination .range { margin-left: auto; color: var(--ink-3); font-size: 13px; }

/* ---------------------------------------------------------------- modal (native <dialog>) */
.modal { border: 0; padding: 0; border-radius: var(--r-lg); width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); box-shadow: var(--shadow-pop); color: var(--ink); }
.modal-sm { width: min(420px, calc(100vw - 32px)); }
.modal::backdrop { background: rgba(18, 23, 53, .45); }
.modal[open] { animation: modal-in .16s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-box { padding: 20px 22px; }
.modal-title { font-size: 1.12rem; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------------------------------------------------------------- toasts */
.toast-stack { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r);
  background: var(--neel-950); color: #fff; font-size: 14px; box-shadow: var(--shadow-pop);
  animation: toast-in .18s ease-out;
}
.toast::before { content: ""; width: 4px; align-self: stretch; border-radius: 2px; background: var(--haldi); flex: none; }
.toast.toast-success::before { background: #4cc28f; }
.toast.toast-error::before, .toast.toast-danger::before { background: #f06b77; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- auth & installer */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-art {
  background-color: var(--neel-900); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background-image:
    radial-gradient(circle at 50% 50%, rgba(224,165,38,.16) 1.6px, transparent 1.9px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.05) 4px, transparent 4.5px);
  background-size: 28px 28px, 28px 28px; background-position: 0 0, 14px 14px;
}
.auth-art .brand-mark { width: 44px; height: 44px; font-size: 22px; border-radius: 11px; }
.auth-art h1 { font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 650; line-height: 1.08; max-width: 12ch; margin: 0; letter-spacing: -.02em; }
.auth-art p { color: #c9cdea; max-width: 40ch; margin: 14px 0 0; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { font-size: 1.5rem; margin-bottom: 4px; }
.auth-card .lead { color: var(--ink-2); margin-bottom: 22px; }
.auth-card .field + .field { margin-top: 14px; }
.install-wrap { max-width: 860px; margin: 0 auto; padding: 32px 20px 64px; }
.install-wrap .card + .card { margin-top: 18px; }
.req-list li .badge { margin-left: auto; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main-side { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w); z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-scrim { display: block; position: fixed; inset: 0; background: rgba(18,23,53,.4); z-index: 40; }
  .sidebar-toggle, .sidebar-close { display: inline-grid; }
  .sidebar-close { color: #fff; }
  .topbar { padding: 0 14px; }
  .content { padding: 18px 14px 40px; }
  .user-meta { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-art { padding: 28px 24px; min-height: auto; }
  .auth-art h1 { font-size: 1.8rem; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 1.3rem; }
  .topbar .btn-accent { padding: 0 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------------------------------------------------------- print */
@media print {
  .sidebar, .topbar, .page-actions, .filters, .pagination, .toast-stack, .no-print { display: none !important; }
  .app { display: block; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { border: 0; }
}

/* ---------------------------------------------------------------- mini bar chart (dashboard) */
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 230px; }
.bar-col { display: flex; flex-direction: column; align-items: center; height: 100%; min-width: 0; }
.bar-val { font-size: 11.5px; color: var(--ink-3); height: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar-track { flex: 1; width: 100%; max-width: 46px; display: flex; flex-direction: column; justify-content: flex-end; background: var(--line-2); border-radius: 6px 6px 2px 2px; overflow: hidden; }
.bar { width: 100%; }
.bar-offline { background: var(--neel-700); }
.bar-online { background: var(--haldi); }
.bar-label { font-size: 12px; color: var(--ink-2); text-align: center; margin-top: 6px; line-height: 1.2; }

/* ---------------------------------------------------------------- products */
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); flex: none; background: var(--paper); }
.thumb-empty { display: inline-grid; place-items: center; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; cursor: pointer; user-select: none; background: var(--surface); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { border-color: var(--neel-700); background: var(--neel-50); color: var(--neel-700); font-weight: 600; }
.chip:has(input:focus-visible) { outline: 2px solid var(--haldi); outline-offset: 2px; }
.chip-group-label { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.defaults-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; padding-top: 14px; margin-top: 4px; border-top: 1px dashed var(--line); }
.defaults-row .field { min-width: 110px; }
.variant-table td { vertical-align: middle; }
.variant-table .input-sm, .variant-table .select-sm { height: 32px; font-size: 13px; padding: 0 8px; }
.variant-table .select-sm { padding-right: 26px; background-position: right 8px center; }
.text-danger { color: var(--danger); font-weight: 600; }
.text-warning { color: var(--warning); font-weight: 600; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--paper) 30%); padding: 18px 0 8px; margin-top: 0; z-index: 5; }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.photo { margin: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--paper); }
.photo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block; }
.photo figcaption { padding: 6px 8px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 12px; }
.photo-actions { margin-left: auto; display: flex; gap: 4px; }
.photo-actions form { display: inline; }
.upload-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.upload-row .input { flex: 1; min-width: 220px; }
.topbar-search { flex: 0 1 320px; position: relative; }
.topbar-search .input { height: 36px; padding-left: 34px; background: var(--paper); border-color: transparent; }
.topbar-search .input:focus { background: var(--surface); }
.topbar-search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
@media (max-width: 900px) { .topbar-search { display: none; } }

/* ---------------------------------------------------------------- line picker / inventory */
.picker { position: relative; }
.picker-search { position: relative; max-width: 560px; }
.picker-search .input { height: 44px; padding-left: 38px; font-size: 15px; }
.picker-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.picker-results { position: absolute; z-index: 25; left: 0; right: 0; top: 48px; max-height: 340px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); }
.picker-item { display: flex; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 9px 12px; border: 0; border-bottom: 1px solid var(--line-2); background: none; font: inherit; font-size: 14px; cursor: pointer; }
.picker-item:hover, .picker-item:focus { background: var(--neel-50); outline: none; }
.picker-empty { padding: 12px; color: var(--ink-3); font-size: 14px; }
.qty-pos { color: var(--success); font-weight: 600; }
.qty-neg { color: var(--danger); font-weight: 600; }
.totals-row td { font-weight: 650; background: #fafbfd; }
.summary-strip { display: flex; flex-wrap: wrap; gap: 24px; padding: 14px 20px; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.summary-strip strong { display: block; font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.totals-kv { grid-template-columns: 1fr auto; max-width: 320px; margin-left: auto; }
.totals-kv dd { text-align: right; font-variant-numeric: tabular-nums; }
