/* Design tokens + shared components. Evolved from the demo's validated
   green identity — 60 prospects have already seen that look. */

:root {
  --ink: #0c1a14;
  --ink-2: #3d5148;
  --muted: #6f8279;
  --brand: #0f7a4d;
  --brand-2: #12a366;
  --brand-soft: #e8f4ee;
  --amber: #b45309;
  --amber-soft: #fdf3e3;
  --red: #b42318;
  --red-soft: #fdeceb;
  --bg: #f5f7f5;
  --card: #ffffff;
  --line: #e2e8e4;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(12, 26, 20, .05), 0 8px 24px rgba(12, 26, 20, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }
/* Urdu secondary text — readable, not faint. */
.ur { font-weight: 500; color: var(--ink-2); }
.hint-text { font-size: 12px; color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none;
  min-height: 44px;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: #0c6741; }
.btn-ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: #f7faf8; }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; min-height: 38px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > input, .field > select, .field > textarea { width: 100%; }
label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; outline: none; min-width: 0; max-width: 100%;
  font-size: 16px; /* prevents iOS zoom-on-focus */
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ---------- cards / layout ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- auth screens (mobile-first login) ---------- */
.auth-gate {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); flex-direction: column; gap: 16px;
  background:
    radial-gradient(900px 500px at 50% -8%, rgba(18,163,102,.30) 0%, transparent 62%),
    linear-gradient(165deg, #0c1a14 0%, #12352a 55%, #0c1a14 100%);
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--card); border-radius: 22px;
  padding: 30px 26px 26px; box-shadow: 0 24px 60px rgba(0,0,0,.4);
}
/* Centered branded header */
.auth-head { text-align: center; margin-bottom: 22px; }
.auth-logo-badge {
  width: 60px; height: 60px; border-radius: 17px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--brand-2), var(--brand));
  box-shadow: 0 8px 20px rgba(15,122,77,.35);
}
.auth-mark {
  font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand); font-weight: 700;
}
.auth-title { font-size: 22px; margin-top: 4px; line-height: 1.2; }
.auth-sub { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
/* Large, touch-friendly fields */
.auth-card .field label { font-size: 13px; margin-bottom: 2px; }
.auth-card input {
  font-size: 17px; padding: 15px 15px; border-radius: 13px; border-width: 1.5px;
}
.pin-row { position: relative; }
.pin-row input { width: 100%; padding-right: 60px; letter-spacing: .12em; }
.pin-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  border: none; background: none; color: var(--brand); font-weight: 650;
  font-size: 13px; padding: 8px 12px; cursor: pointer; min-height: 40px; border-radius: 9px;
}
.pin-toggle:hover { background: var(--brand-soft); }
.btn.btn-lg { min-height: 54px; font-size: 16.5px; border-radius: 13px; }
.auth-error {
  margin-top: 14px; padding: 11px 14px; border-radius: 11px;
  background: var(--red-soft); color: var(--red); font-size: 13.5px; font-weight: 550;
  text-align: center;
}
.auth-foot { text-align: center; font-size: 12px; color: var(--muted); margin: 22px 0 0; }
/* Legacy brand row kept for any card still using it */
.auth-brand { display: flex; gap: 13px; align-items: flex-start; }
.auth-logo { flex: none; line-height: 0; margin-top: 2px; }

/* ---------- app top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink); color: #cfe0d8;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
}
.topbar .logo { line-height: 0; }
.topbar .shopname {
  color: #fff; font-weight: 650; font-size: 15px; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar .role {
  font-size: 11px; font-weight: 600; text-transform: capitalize;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  color: var(--brand-2); padding: 4px 10px; border-radius: 999px;
}
.topbar .btn-bar {
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  color: #cfe0d8; font-size: 12.5px; padding: 8px 12px; border-radius: 9px;
  cursor: pointer; min-height: 38px;
}
.topbar .btn-bar:hover { background: rgba(255,255,255,.13); }

/* ---------- tables (desktop) → cards (mobile) ---------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 600;
  padding: 0 12px 9px; border-bottom: 1px solid var(--line);
}
td { padding: 12px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
.t-right { text-align: right; }
.table-wrap {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 6px 6px; box-shadow: var(--shadow); overflow-x: auto;
}
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge.green { background: var(--brand-soft); color: var(--brand); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.grey { background: #eef1ef; color: var(--ink-2); }
.empty { text-align: center; padding: 42px 20px; color: var(--muted); font-size: 14px; }

#toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 12px;
  font-size: 14px; font-weight: 550; opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; z-index: 90; box-shadow: var(--shadow);
  max-width: calc(100vw - 40px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- app shell: sidebar (desktop) / top bar (mobile) ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex: 0 0 248px; background: var(--ink); color: #cfe0d8;
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { padding: 6px 10px 18px; display: flex; gap: 10px; align-items: center; }
.brand img, .brand svg { border-radius: 8px; flex: none; }
.brand-mark { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--brand-2); font-weight: 700; }
.brand-shop { color: #fff; font-size: 15.5px; font-weight: 650; line-height: 1.2; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px;
  color: #cfe0d8; text-decoration: none; font-size: 14px; font-weight: 500;
  border: none; background: none; width: 100%; text-align: left; cursor: pointer;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--brand); color: #fff; font-weight: 600; }
.nav-item .ur { margin-left: auto; font-size: 12.5px; color: rgba(255,255,255,.72); }
.nav-item.active .ur { color: rgba(255,255,255,.9); }
.nav-sep { height: 1px; background: rgba(255,255,255,.08); margin: 10px 12px; }
.sidebar-foot { margin-top: auto; padding: 12px 10px 0; font-size: 12px; color: #6f877c; }
.who { padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.08); }
.who-name { color: #fff; font-weight: 600; font-size: 13px; }
.who-role { font-size: 11px; color: var(--brand-2); text-transform: capitalize; }
.btn-reset {
  width: 100%; margin-top: 8px; padding: 9px; border-radius: 9px;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1);
  color: #cfe0d8; font-size: 12.5px; cursor: pointer; min-height: 40px;
}
.btn-reset:hover { background: rgba(255,255,255,.13); }
.main { flex: 1; min-width: 0; padding: 26px 30px 60px; max-width: 1180px; }
.lbl-narrow { display: none; }

.page-head { margin-bottom: 20px; }
.page-head h1 { font-size: 24px; }
.page-head p { margin: 5px 0 0; color: var(--muted); font-size: 14px; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; gap: 10px; }
.section-head h2 { font-size: 16.5px; }
.section-head .hint { font-size: 13px; color: var(--muted); }

.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.stat-value { font-size: 25px; font-weight: 680; letter-spacing: -.03em; margin-top: 6px; }
.stat-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.stat-value.pos { color: var(--brand); }
.stat-value.neg { color: var(--red); }

.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.search-bar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.search-bar input { flex: 1; min-width: 200px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); font-size: 13px; cursor: pointer; font-weight: 500; min-height: 40px;
  display: inline-flex; align-items: center;
}
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.callout {
  display: flex; gap: 12px; padding: 14px 16px; border-radius: 12px;
  background: var(--amber-soft); border: 1px solid #f0dfc2; font-size: 13.5px; color: #7a4a10;
}
.callout.info { background: var(--brand-soft); border-color: #c8e4d6; color: #0b5c3a; }

.model { font-weight: 600; }
.imei { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
tbody tr.clickable:hover { background: #fafcfb; cursor: pointer; }
.badge.pta { background: var(--brand-soft); color: var(--brand); }
.badge.nonpta { background: var(--amber-soft); color: var(--amber); }

.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 9px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.tl-item { position: relative; padding-bottom: 20px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-dot {
  position: absolute; left: -26px; top: 3px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand); border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--brand);
}
.tl-dot.grey { background: var(--muted); box-shadow: 0 0 0 2px var(--muted); }
.tl-title { font-weight: 650; font-size: 14.5px; }
.tl-date { font-size: 12.5px; color: var(--muted); }
.tl-body { margin-top: 6px; font-size: 13.5px; color: var(--ink-2); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; font-size: 14px; }
.kv dt { color: var(--muted); font-size: 13px; }
.kv dd { margin: 0; font-weight: 550; }

.dev-list { display: grid; gap: 10px; }
.dev-row {
  display: flex; align-items: center; gap: 14px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer;
}
.dev-row:hover { border-color: var(--brand-2); background: #fafcfb; }
.dev-row.selected { border-color: var(--brand); background: var(--brand-soft); }
.dev-row .grow { flex: 1; min-width: 0; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(12,26,20,.45);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 100;
}
.modal {
  background: #fff; border-radius: 16px; max-width: 420px; width: 100%;
  max-height: 90vh; overflow-y: auto; padding: 26px; box-shadow: 0 24px 60px rgba(0,0,0,.28);
}
.receipt-head { text-align: center; border-bottom: 1px dashed var(--line); padding-bottom: 14px; }
.receipt-head img { border-radius: 10px; margin-bottom: 8px; }
.receipt-head h3 { font-size: 17px; }
.receipt-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.receipt-rows { margin: 16px 0; }
.receipt-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13.5px; gap: 12px; }
.receipt-row.total { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 10px; font-weight: 700; font-size: 16px; }
.receipt-foot { text-align: center; font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 14px; }

.trial-banner {
  margin: 10px 12px 0; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45;
  background: rgba(255,255,255,.1); color: #e8f5ee; border: 1px solid rgba(255,255,255,.18);
}
.trial-banner strong { color: #fff; }
.trial-banner.urgent { background: rgba(180,35,24,.35); border-color: rgba(255,120,110,.5); }
@media (max-width: 900px) {
  .trial-banner { order: 4; width: 100%; margin: 4px 0 0; padding: 7px 10px; font-size: 12px; }
  .trial-banner br { display: none; }
  .trial-banner span:not(.ur) { display: inline; margin-left: 6px; }
}

/* ---------- searchable select ---------- */
.ss { position: relative; }
.ss-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; min-height: 46px; padding: 11px 13px; font: inherit; font-size: 15px;
  text-align: left; color: var(--ink); background: #fff; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; touch-action: manipulation;
}
.ss-btn:hover { border-color: var(--brand-2); }
.ss-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ss-btn svg { flex: none; color: var(--muted); }
.ss-val { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-val.ss-placeholder { color: var(--muted); }
.ss-pop {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 44px rgba(12,26,20,.18); padding: 8px; max-width: 100%;
}
.ss-search {
  width: 100%; min-height: 44px; margin-bottom: 6px; font-size: 16px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
}
.ss-list { max-height: 46vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ss-opt {
  display: block; width: 100%; min-height: 44px; padding: 11px 12px; font: inherit; font-size: 15px;
  text-align: left; background: none; border: 0; border-radius: 9px; cursor: pointer;
  color: var(--ink); touch-action: manipulation;
}
.ss-opt:hover { background: var(--brand-soft); }
.ss-opt.sel { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.ss-empty { padding: 14px 12px; color: var(--muted); font-size: 14px; text-align: center; }

/* ---------- brand breakdown (stock by brand) ---------- */
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.brand-tile {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card);
  cursor: pointer; text-align: left; font: inherit; min-height: 62px; touch-action: manipulation;
}
.brand-tile:hover { border-color: var(--brand-2); background: #fafcfb; }
.brand-tile .bt-name { font-weight: 620; font-size: 14.5px; }
.brand-tile .bt-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.brand-tile .bt-count {
  min-width: 34px; height: 34px; display: grid; place-items: center; flex: none;
  border-radius: 9px; background: var(--brand-soft); color: var(--brand);
  font-weight: 700; font-variant-numeric: tabular-nums;
}

.net-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 80;
  background: var(--red); color: #fff; text-align: center;
  padding: 9px 14px; font-size: 13.5px; font-weight: 600; display: none;
}
.net-banner.show { display: block; }

.fieldset-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
  font-weight: 650; margin: 22px 0 12px; grid-column: 1 / -1;
  border-top: 1px solid var(--line); padding-top: 16px;
}
.fieldset-title:first-child { margin-top: 0; border-top: none; padding-top: 0; }

/* In-page invoice printing: hidden on screen, the ONLY thing on paper. */
#print-invoice { display: none; }

@page { margin: 4mm; }
@media print {
  html, body { width: auto; margin: 0; padding: 0; }
  body.printing-invoice > * { display: none !important; }
  body.printing-invoice > #print-invoice { display: block !important; }
  .sidebar, .quick-actions, .no-print, .search-bar, .chips, .net-banner { display: none !important; }
  .modal-backdrop { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; max-width: 100%; }
  body { background: #fff; }
}

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    width: 100%; flex: none; height: auto; position: sticky; top: 0; z-index: 50;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px;
    padding: 10px 14px 12px; overflow: visible;
  }
  .brand { order: 1; flex: 1; min-width: 0; padding: 0; }
  .brand-shop { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-mark { display: none; }
  .sidebar-foot { display: flex; order: 2; flex: none; align-items: center; gap: 7px; margin: 0; padding: 0; }
  .who { padding: 5px 9px; border-radius: 999px; }
  .who-name { display: none; }
  .btn-reset { width: auto; margin: 0; padding: 9px 12px; font-size: 12.5px; }
  .lbl-wide { display: none; }
  .lbl-narrow { display: inline; }
  .nav-list {
    order: 3; width: 100%; flex-direction: row; gap: 6px; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  .nav-list::-webkit-scrollbar { display: none; }
  .nav-item { width: auto; white-space: nowrap; padding: 11px 15px; min-height: 44px; }
  .nav-item .ur, .nav-sep { display: none; }
  .main { padding: 18px 16px 64px; }
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g3, .g2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 10px; }
  .stat-value { font-size: 22px; }
  .page-head h1 { font-size: 22px; }
  .dev-list { max-height: none; }
}

@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .table-wrap { padding: 10px; overflow-x: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    border: 1px solid var(--line); border-radius: 12px;
    padding: 12px 14px; margin-bottom: 10px; background: var(--card);
  }
  .table-wrap tr:last-child { margin-bottom: 0; }
  .table-wrap td {
    border: none; padding: 5px 0; font-size: 14px;
    display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
    text-align: right;
  }
  .table-wrap td::before {
    content: attr(data-label); color: var(--muted); font-size: 12.5px;
    font-weight: 600; text-align: left; flex: none;
  }
  .table-wrap td:first-child {
    display: block; text-align: left; padding: 0 0 9px; margin-bottom: 7px;
    border-bottom: 1px solid var(--line); font-weight: 600;
  }
  .table-wrap td:first-child::before { display: none; }
  .table-wrap td:empty { display: none; }
}

/* ---------- barcode scanner ---------- */
.scan-wrap { position: relative; border-radius: 12px; overflow: hidden; background: #000; }
.scan-wrap video { width: 100%; max-height: 46vh; display: block; object-fit: cover; }
.scan-frame {
  position: absolute; inset: 18% 8%; border: 2px solid rgba(255,255,255,.9);
  border-radius: 10px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35);
}
.scan-torch {
  position: absolute; right: 10px; bottom: 10px; width: 42px; height: 42px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  font-size: 19px; cursor: pointer; display: grid; place-items: center;
}
.scan-torch.on { background: var(--amber, #b8860b); }
.scan-log { min-height: 22px; margin-top: 10px; text-align: center; font-size: 14px; font-weight: 600; }
.scan-ok { color: var(--brand); }
.scan-bad { color: var(--red); }

.hint-text.ok   { color: var(--brand); font-weight: 600; }
.hint-text.warn { color: var(--amber); font-weight: 600; }
.hint-text.bad  { color: var(--red); font-weight: 600; }

/* ---------- bulk intake ---------- */
.bulk-row { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; background: var(--card); }
.bulk-row-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bulk-n {
  min-width: 26px; height: 26px; display: grid; place-items: center; flex: none;
  border-radius: 7px; background: var(--brand-soft); color: var(--brand);
  font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
}
.bulk-row-head .btn { margin-left: auto; }
.bulk-row-head .btn-icon { margin-left: auto; }
.bulk-row-head .btn + .btn-icon { margin-left: 0; }
.btn-icon {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px; background: #fff;
  color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1;
}
.btn-icon:hover { border-color: var(--red); color: var(--red); }
.bulk-grid { gap: 10px 12px; }
.bulk-grid .field { margin: 0; }
.bulk-grid label { font-size: 12px; }
.bulk-grid input, .bulk-grid select { min-height: 42px; }
.imei-note { display: block; margin-top: 3px; min-height: 15px; font-size: 11.5px; }
.bulk-total {
  display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between;
  padding: 12px 14px; margin-top: 4px; border-radius: 10px;
  background: #fafcfb; border: 1px solid var(--line); font-size: 13.5px;
}

/* ---------- assistant ---------- */
.asst-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: 90;
  width: 54px; height: 54px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(150deg, var(--brand), #0b6b3a);
  box-shadow: 0 10px 26px rgba(12,90,55,.34);
  font-size: 25px; line-height: 1; color: #fff;
  display: grid; place-items: center;
  transition: transform .18s ease, box-shadow .18s ease;
}
.asst-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(12,90,55,.4); }
.asst-fab.is-open { transform: scale(.92); }
.asst-fab:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 3px; }
.asst-panel {
  position: fixed; right: 18px; bottom: 84px; z-index: 91;
  width: min(360px, calc(100vw - 36px)); max-height: min(70vh, 560px);
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 22px 56px rgba(12,26,20,.24); overflow: hidden;
}
.asst-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fafcfb;
}
.asst-title { font-weight: 700; font-size: 14.5px; }
.asst-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.asst-msg { font-size: 13.8px; line-height: 1.5; padding: 10px 12px; border-radius: 12px; max-width: 92%; }
.asst-msg.bot { background: var(--brand-soft); color: var(--ink); align-self: flex-start; border-bottom-left-radius: 4px; }
.asst-msg.me  { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.asst-list { margin: 8px 0 0; padding-left: 18px; }
.asst-list li { margin-bottom: 5px; }
.asst-chips, .asst-act { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.asst-chips .chip, .asst-act .chip { font-size: 12.5px; padding: 7px 11px; min-height: 34px; }
.asst-ask { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.asst-ask input { flex: 1; min-height: 42px; font-size: 16px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.asst-dots { display: inline-flex; gap: 4px; }
.asst-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); opacity: .4; animation: asstb 1s infinite; }
.asst-dots i:nth-child(2) { animation-delay: .15s; }
.asst-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes asstb { 0%,100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) {
  .asst-dots i { animation: none; }
  .asst-fab { transition: none; }
}
@media (max-width: 900px) {
  .asst-fab { right: 14px; bottom: 14px; width: 50px; height: 50px; font-size: 23px; }
  .asst-panel { left: 12px; right: 12px; width: auto; bottom: 74px; max-height: 66vh; }
  .asst-msg { max-width: 95%; }
  .bulk-grid { grid-template-columns: 1fr 1fr; }
  .bulk-total { font-size: 12.5px; gap: 10px; }
}

/* ---------- demo strip (demo build only) ---------- */
.demo-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 8px 14px;
  background: #0c1a14; color: #e8f5ee; font-size: 12.5px;
}
.demo-bar strong { color: #fff; letter-spacing: .06em; }
.demo-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.demo-bar .chip {
  background: rgba(255,255,255,.12); color: #e8f5ee; border-color: rgba(255,255,255,.22);
  font-size: 12px; padding: 6px 10px; min-height: 32px; text-decoration: none;
}
.demo-bar .chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
body.has-demo-bar .main { padding-bottom: 78px; }
body.has-demo-bar .asst-fab { bottom: 62px; }
body.has-demo-bar .asst-panel { bottom: 128px; }
@media (max-width: 900px) {
  .demo-bar { font-size: 11.5px; padding: 7px 10px; }
  body.has-demo-bar .asst-fab { bottom: 74px; }
}
