/* =========================================================================
   GhallaPro ERP — Executive UI/UX Design System (Bilingual LTR/RTL, Light/Dark)
   ========================================================================= */
:root {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface2: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --text-muted: #64748b;

  --primary: #0b6b43;
  --primary-h: #095736;
  --primary-soft: #e6f5ee;
  --primary-ring: rgba(11, 107, 67, 0.18);

  --accent: #d97706;
  --accent-soft: #fef3c7;
  --info: #0284c7;
  --info-soft: #e0f2fe;
  --success: #059669;
  --danger: #dc2626;
  --danger-h: #b91c1c;

  --ok-bg: #ecfdf5;
  --ok-tx: #065f46;
  --ok-bd: #a7f3d0;
  --warn-bg: #fffbeb;
  --warn-tx: #92400e;
  --warn-bd: #fde68a;
  --err-bg: #fef2f2;
  --err-tx: #991b1b;
  --err-bd: #fecaca;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 6px 18px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.14);
  --transition: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  --bg: #090f1d;
  --surface: #111a2e;
  --surface2: #0d1526;
  --card-bg: #111a2e;
  --border: #1e2d45;
  --border-strong: #2d405e;
  --text: #eef2f9;
  --muted: #8ca0be;
  --text-muted: #8ca0be;

  --primary: #10b981;
  --primary-h: #059669;
  --primary-soft: rgba(16, 185, 129, 0.14);
  --primary-ring: rgba(16, 185, 129, 0.25);

  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.15);
  --info: #38bdf8;
  --info-soft: rgba(56, 189, 248, 0.14);

  --ok-bg: rgba(16, 185, 129, 0.14);
  --ok-tx: #6ee7b7;
  --ok-bd: rgba(16, 185, 129, 0.3);
  --warn-bg: rgba(245, 158, 11, 0.14);
  --warn-tx: #fcd34d;
  --warn-bd: rgba(245, 158, 11, 0.3);
  --err-bg: rgba(239, 68, 68, 0.14);
  --err-tx: #fca5a5;
  --err-bd: rgba(239, 68, 68, 0.3);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.28), 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

html[lang="ur"] body, html[lang="ur"] .sidebar, html[lang="ur"] table,
html[lang="ur"] .btn, html[lang="ur"] input, html[lang="ur"] select, html[lang="ur"] textarea,
html[lang="ur"] .kpi-label, html[lang="ur"] .card-title, html[lang="ur"] .topbar-title {
  font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', 'Inter', sans-serif;
  font-size: 13px;
  line-height: 2.1;
}

/* Scrollbar polish */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.app { display: flex; min-height: 100vh; }

/* ========================== SIDEBAR ========================== */
.sidebar {
  width: 256px;
  background: var(--surface);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  z-index: 40;
  transition: transform var(--transition);
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(2px);
  z-index: 35;
}
.sidebar-backdrop.open { display: block; }

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 16px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-soft) 0%, transparent 100%);
}
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--primary) 0%, #059669 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  flex-shrink: 0;
  box-shadow: 0 4px 12px var(--primary-ring);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.brand-text strong {
  font-size: 14.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.brand-text span { font-size: 11px; color: var(--muted); font-weight: 500; }

.sidebar nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8.5px 12px;
  border-radius: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
  transition: background var(--transition), color var(--transition);
  position: relative;
}
.sidebar nav a svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  color: var(--muted);
  transition: color var(--transition);
}
.sidebar nav a:hover { background: var(--surface2); }
.sidebar nav a:hover svg { color: var(--primary); }
.sidebar nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}
.sidebar nav a.active svg { color: var(--primary); }
.sidebar nav a.active::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 99px;
  background: var(--primary);
}
.nav-group {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  padding: 14px 12px 4px;
  font-weight: 700;
}
.sidebar-foot {
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
}
.sidebar-foot a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 7px;
  transition: background var(--transition), color var(--transition);
}
.sidebar-foot a:hover { background: var(--surface); color: var(--text); }
.lang-toggle { color: var(--primary) !important; background: var(--primary-soft); }
.lang-toggle:hover { filter: brightness(0.95); }

/* ========================== MAIN & TOPBAR ========================== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 25;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-right { display: flex; align-items: center; gap: 8px; }

.quick-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition), color var(--transition);
}
.quick-search-btn:hover { border-color: var(--primary); color: var(--text); }
.quick-search-btn kbd {
  font-family: inherit;
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 9px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 15px;
  transition: background var(--transition), border-color var(--transition);
}
.icon-btn:hover { background: var(--surface2); border-color: var(--border-strong); }
.icon-btn svg { width: 17px; height: 17px; }
#sidebarToggle { display: none; }

.userchip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 10px 4px 6px;
  border-radius: 99px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
.userchip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.userchip-info { display: flex; flex-direction: column; line-height: 1.15; }
.userchip-name { font-weight: 600; font-size: 12.5px; }
.userchip-role { font-size: 10.5px; color: var(--muted); }

.content {
  padding: 22px 24px 36px;
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
}

/* ========================== FLASH TOASTS ========================== */
.flash {
  margin: 16px 24px 0;
  padding: 11px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.22s ease-out;
}
.flash-ok { background: var(--ok-bg); color: var(--ok-tx); border-color: var(--ok-bd); }
.flash-err { background: var(--err-bg); color: var(--err-tx); border-color: var(--err-bd); }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ========================== PAGE HEADERS & FILTER BARS ========================== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.page-header h2, .page-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.filter-bar, .filters {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.filter-bar label, .filters label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.filter-bar select, .filter-bar input[type="date"], .filter-bar input[type="text"],
.filters select, .filters input[type="date"], .filters input[type="text"] {
  width: auto;
  min-width: 150px;
}
.filter-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; width: 100%; }

/* ========================== CARDS & KPIs ========================== */
.cards, .summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-strong);
}
.kpi-card { display: flex; flex-direction: column; gap: 6px; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.kpi-icon svg { width: 18px; height: 18px; }
.kpi-icon.green { background: var(--primary-soft); color: var(--primary); }
.kpi-icon.amber { background: var(--accent-soft); color: var(--accent); }
.kpi-icon.blue { background: var(--info-soft); color: var(--info); }
.kpi-icon.red { background: var(--err-bg); color: var(--danger); }

.kpi-label, .card-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}
.kpi-value, .card-value {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.kpi-sub { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.card-title {
  font-size: 14.5px;
  font-weight: 700;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Dashboard split grid */
.dash-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
@media (max-width: 1024px) { .dash-grid { grid-template-columns: 1fr; } }

.quick-actions-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.quick-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}
.quick-action-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
  transform: translateY(-1px);
}
.quick-action-pill.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.quick-action-pill.primary:hover {
  background: var(--primary-h);
  color: #fff;
}

/* Chart container */
.chart-wrap { width: 100%; height: 220px; position: relative; }
.chart-legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); font-weight: 600; }
.chart-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 5px; }

/* ========================== TABLES ========================== */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  box-shadow: var(--shadow);
}
table, .table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td {
  padding: 11px 14px;
  text-align: start;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  background: var(--surface2);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 700;
}
tbody tr { transition: background 0.12s ease; }
tbody tr:hover { background: var(--surface2); }
tbody tr:last-child td { border-bottom: none; }
td.num, th.num, .text-right { text-align: end; font-variant-numeric: tabular-nums; }
.table-empty, .empty-state {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
tr.total-row td, tr.subtotal-row td {
  background: var(--surface2);
  font-weight: 700;
  border-top: 2px solid var(--border-strong);
}

/* ========================== BADGES ========================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
}
.badge-draft { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.badge-posted, .badge-ok { background: var(--ok-bg); color: var(--ok-tx); border: 1px solid var(--ok-bd); }
.badge-reversed { background: var(--err-bg); color: var(--err-tx); border: 1px solid var(--err-bd); }
.badge-hold, .badge-warn { background: var(--warn-bg); color: var(--warn-tx); border: 1px solid var(--warn-bd); }

/* ========================== BUTTONS ========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8.5px 15px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn:hover { background: var(--primary-h); transform: translateY(-1px); box-shadow: 0 3px 10px var(--primary-ring); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-h); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #047857; }
.btn-info { background: var(--info); color: #fff; }
.btn-info:hover { background: #0369a1; }
.btn-outline {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: none;
}
.btn-outline:hover { background: var(--surface2); border-color: var(--primary); color: var(--primary); box-shadow: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-h); box-shadow: 0 3px 10px rgba(220, 38, 38, 0.25); }
.btn-sm { padding: 5px 11px; font-size: 12px; border-radius: 7px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }
.actions-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* ========================== FORMS & PANELS ========================== */
form.panel, .panel, .form-card, .report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.grid-form, .form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px 16px;
}
.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
input, select, textarea {
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  width: 100%;
  transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
input[readonly] { background: var(--surface2); color: var(--muted); }
input[type="checkbox"] { width: auto; accent-color: var(--primary); }

.form-foot, .form-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}
.span-2, .full-width { grid-column: span 2; }

/* Conversion strip & totals */
.conv-strip {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--ok-bd);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
}
.totals-box { display: flex; flex-direction: column; gap: 7px; min-width: 260px; }
.totals-box .row { display: flex; justify-content: space-between; gap: 20px; font-size: 13.5px; }
.totals-box .row.grand {
  border-top: 2px solid var(--border);
  padding-top: 8px;
  font-weight: 800;
  font-size: 16px;
  color: var(--primary);
}
.summary {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.totals-by-category { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }

/* Toolbar */
.toolbar {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}
.toolbar .field { min-width: 145px; }
.spacer { flex: 1; }
.muted, .text-muted { color: var(--muted); }
.small { font-size: 12px; }

/* Reports */
.report-card { max-width: 760px; }
.report-card h3 { margin: 0 0 16px; font-size: 14px; color: var(--muted); font-weight: 600; }
.report-table { width: 100%; border-collapse: collapse; }
.report-table td { padding: 10px 6px; border-bottom: 1px solid var(--border); }
.report-table .subtotal-row td { border-top: 2px solid var(--border-strong); border-bottom: 2px solid var(--border-strong); }
.report-table .total-row td { border-top: 3px double var(--border-strong); font-size: 16px; }

/* ========================== LOGIN ========================== */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 15% 20%, rgba(11, 107, 67, 0.14), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(217, 119, 6, 0.12), transparent 45%),
    var(--bg);
}
.login-card {
  width: 410px;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 34px 32px;
}
.login-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  text-align: center;
}
.login-brand .brand-mark { width: 58px; height: 58px; font-size: 28px; border-radius: 16px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; padding: 11px; font-size: 14.5px; }
.login-flash { margin-bottom: 16px; padding: 10px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.login-foot {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

/* ========================== POS ========================== */
.pos-grid {
  display: grid;
  grid-template-columns: 270px 1fr 355px;
  gap: 16px;
  align-items: start;
}
.pos-com-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 66vh;
  overflow-y: auto;
  padding-inline-end: 2px;
}
.pos-com-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  transition: all var(--transition);
}
.pos-com-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: translateX(2px);
}
html[dir="rtl"] .pos-com-btn:hover { transform: translateX(-2px); }
.pos-com-name { font-weight: 600; font-size: 13px; }
.pos-com-stock {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--ok-bg);
  color: var(--ok-tx);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pos-com-stock.low { background: var(--warn-bg); color: var(--warn-tx); }
.pos-com-stock.empty { background: var(--err-bg); color: var(--err-tx); }
.pos-center table input, .pos-center table select { padding: 6px 8px; font-size: 12.5px; }
@media (max-width: 1180px) { .pos-grid { grid-template-columns: 1fr; } }

/* ========================== MODALS (COMMAND PALETTE & CONFIRM) ========================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 100;
  place-items: center;
  padding: 20px;
}
.modal-overlay.open { display: grid; }
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 480px;
  max-width: 100%;
  overflow: hidden;
  animation: popIn 0.16s ease-out;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
}
.modal-body { padding: 16px 18px; }
.modal-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface2);
}
.cmd-input {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 14px 18px;
  font-size: 15px;
  background: var(--surface);
  color: var(--text);
}
.cmd-input:focus { box-shadow: none; border-bottom-color: var(--primary); }
.cmd-list { max-height: 320px; overflow-y: auto; padding: 8px; }
.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 13.5px;
}
.cmd-item:hover, .cmd-item.selected { background: var(--primary-soft); color: var(--primary); }

/* ========================== PRINT ========================== */
.print-sheet {
  background: #fff;
  color: #111;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px;
  font-family: 'Inter', sans-serif;
}
html[lang="ur"] .print-sheet { font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', sans-serif; }
.print-head {
  display: flex;
  justify-content: space-between;
  border-bottom: 2px solid #111;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.print-table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.print-table th, .print-table td { border: 1px solid #333; padding: 7px 10px; text-align: start; }
@media print {
  .sidebar, .topbar, .flash, .no-print, .filter-bar, .toolbar, .quick-actions-bar, .modal-overlay { display: none !important; }
  .app { display: block; }
  .main, .content { padding: 0; margin: 0; max-width: 100%; }
  .panel, .table-wrap, .report-card { box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; color: #000; }
}

/* ========================== RESPONSIVE ========================== */
@media (max-width: 960px) {
  #sidebarToggle { display: inline-grid; }
  .sidebar {
    position: fixed;
    z-index: 50;
    transform: translateX(-100%);
  }
  html[dir="rtl"] .sidebar { transform: translateX(100%); }
  .sidebar.open { transform: translateX(0) !important; }
  .span-2, .full-width { grid-column: span 1; }
  .content { padding: 16px; }
  .topbar { padding: 10px 14px; }
  .quick-search-btn span, .quick-search-btn kbd { display: none; }
}


/* ========================== PRO ERP UPGRADE COMPONENTS ========================== */
.pro-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 1024px) { .pro-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .pro-kpi-grid { grid-template-columns: 1fr; } }

.pro-kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.pro-kpi::before {
  content: '';
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 3.5px;
  background: var(--primary);
}
.pro-kpi.accent::before { background: var(--accent); }
.pro-kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}
.pro-kpi-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.pro-kpi-sub { font-size: 12px; font-weight: 500; color: var(--muted); }

.pro-split-2 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  align-items: start;
}
@media (max-width: 960px) { .pro-split-2 { grid-template-columns: 1fr; } }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.pill-info {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
.chip-btn {
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}
.chip-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}

.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.var-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 99px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid var(--ok-bd);
  cursor: pointer;
  transition: opacity var(--transition);
}
.var-tag.off {
  background: var(--surface2);
  color: var(--muted);
  border-color: var(--border);
  text-decoration: line-through;
  opacity: 0.7;
}

/* Pro Purchase Workbench */
.pro-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
@media (max-width: 1100px) { .pro-workbench { grid-template-columns: 1fr; } }
.pro-main { display: flex; flex-direction: column; gap: 16px; }
.pro-sticky { position: sticky; top: 76px; }

.pro-conv {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
}
.pro-conv > div { display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 720px) { .pro-conv { grid-template-columns: repeat(2, 1fr); } }

.seg-group {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 9px;
  border: 1px solid var(--border);
}
.seg-btn {
  padding: 7px 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.seg-btn.active {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.settle-balance-box {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.settle-balance-box .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.pro-actions-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.btn-accent {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-accent:hover { filter: brightness(0.92); }

/* Pro POS Topbar & Enhancements */
.pos-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px !important;
  margin-bottom: 14px;
}
.pos-topbar-group { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.field-inline { display: flex; align-items: center; gap: 8px; }
.field-inline label { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.field-inline select, .field-inline input { width: auto; padding: 6px 10px; font-size: 13px; }

.pos-shortcuts-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 5px 10px;
  border-radius: 99px;
}
@media (max-width: 900px) { .pos-shortcuts-pill { display: none; } }

.held-dropdown { position: relative; }
.held-menu {
  display: none;
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 60;
  max-height: 300px;
  overflow-y: auto;
  padding: 6px;
}
.held-menu.open { display: block; }
.held-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
}
.held-item:hover { background: var(--surface2); }

.toggle-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.toggle-mini input { width: auto; margin: 0; accent-color: var(--primary); }

.pos-metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
}
.pos-metrics-strip > div { display: flex; flex-direction: column; }

.pos-warn-banner {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--err-bg);
  color: var(--err-tx);
  border: 1px solid var(--err-bd);
  font-size: 12.5px;
  font-weight: 600;
}

.pos-cust-bal-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.pos-details {
  margin-top: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface2);
  border: 1px solid var(--border);
}
.pos-details summary {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}


/* ========================== FULL-SCREEN PRO POS TERMINAL ========================== */
body.pos-shell-body {
  overflow: hidden;
  height: 100vh;
  background: var(--bg);
}
.pos-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* POS Top Header */
.pos-hdr {
  height: 54px;
  flex-shrink: 0;
  background: linear-gradient(90deg, #064e3b 0%, #0b6b43 55%, #0f172a 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.22);
  z-index: 50;
}
.pos-hdr-left, .pos-hdr-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.pos-back-btn, .pos-hdr-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.pos-back-btn:hover, .pos-hdr-btn:hover { background: rgba(255, 255, 255, 0.22); }
.pos-hdr-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
}
.pos-hdr-icon:hover { background: rgba(255, 255, 255, 0.22); }

.pos-brand { display: flex; align-items: center; gap: 8px; padding-inline: 6px; }
.pos-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.18);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
}
.pos-brand-meta { display: flex; flex-direction: column; line-height: 1.15; }
.pos-brand-meta strong { font-size: 13.5px; font-weight: 700; }
.pos-brand-meta span { font-size: 10.5px; opacity: 0.78; text-transform: uppercase; letter-spacing: 0.06em; }

.pos-hdr-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 2px 8px;
}
.pos-hdr-control select, .pos-hdr-control input {
  background: transparent;
  border: none;
  color: #fff;
  padding: 4px 2px;
  font-size: 12.5px;
  font-weight: 600;
  width: auto;
  box-shadow: none !important;
}
.pos-hdr-control select option { color: #0f172a; background: #fff; }
.pos-hdr-control input::-webkit-calendar-picker-indicator { filter: invert(1); }

.pos-resume-pill {
  background: #f59e0b;
  color: #111;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
}

.pos-today-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.22);
  border: 1px solid rgba(110, 231, 183, 0.35);
  font-size: 12px;
  white-space: nowrap;
}
.pos-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
}
.pos-today-cnt { opacity: 0.8; }
.pos-held-badge {
  background: #f59e0b;
  color: #111;
  font-size: 11px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 99px;
}
.pos-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12.5px;
}

.pos-toast {
  position: fixed;
  top: 64px;
  inset-inline-end: 18px;
  z-index: 90;
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 2-Pane Split Workspace: Main Sale Register (Left) + Compact Commodity Sidebar (Right) */
.pos-workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  overflow: hidden;
}

/* RIGHT: Compact Product Catalog Sidebar */
.pos-catalog-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  border-inline-start: 1px solid var(--border);
}
.pos-catalog-bar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.pos-search-box {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface2);
  border: 1.5px solid var(--border-strong);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--muted);
}
.pos-search-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.pos-search-box input {
  border: none;
  background: transparent;
  padding: 6px 0;
  font-size: 12.5px;
  box-shadow: none !important;
}
.pos-filter-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 2px;
  gap: 2px;
}
.pos-fpill {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 5px;
  cursor: pointer;
}
.pos-fpill.active {
  background: var(--primary);
  color: #fff;
}

/* Compact 2-Column Commodity Tiles on Right */
.pos-tile-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: max-content;
  gap: 7px;
}
.pos-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 9px;
  border-radius: 9px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  text-align: start;
  cursor: pointer;
  color: var(--text);
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.pos-tile:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(11, 107, 67, 0.12);
}
.pos-tile:active { transform: scale(0.98); }
.pos-tile.in-cart {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.pos-tile.is-empty { opacity: 0.65; }
.pos-tile-qty-badge {
  position: absolute;
  top: -6px;
  inset-inline-end: -6px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--primary);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 6px rgba(11, 107, 67, 0.4);
}
.pos-tile-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}
.pos-tile-code {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.pos-tile .pos-com-stock { font-size: 10px; padding: 1px 6px; }
.pos-tile-name {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-tile-sub {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pos-tile-foot {
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--muted);
}
.pos-tile-rate { color: var(--primary); font-size: 10.5px; font-weight: 700; }
.pos-tile-cost { color: var(--accent); font-weight: 600; }

.pos-catalog-foot {
  padding: 6px 8px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 10.5px;
  color: var(--muted);
}
.pos-catalog-foot strong {
  background: var(--surface2);
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  padding: 0 4px;
  color: var(--text);
  margin-inline-end: 2px;
}

/* 2-Column Checkout Dock inside Wide Left Sale Register */
.pos-checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}
@media (max-width: 1120px) { .pos-checkout-grid { grid-template-columns: 1fr; } }

/* RIGHT: Register / Cart & Checkout Pane */
.pos-register-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
}
.pos-reg-customer {
  padding: 10px 14px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.pos-cust-select-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pos-cust-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.pos-cust-select-row select { flex: 1; padding: 7px 10px; font-weight: 600; }

.pos-reg-cart {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 10px;
}
.pos-cart-table { width: 100%; border-collapse: collapse; }
.pos-cart-table th {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 7px 6px;
  font-size: 11px;
}
.pos-cart-table td {
  padding: 6px 5px;
  vertical-align: middle;
}
.pos-cart-table input, .pos-cart-table select {
  padding: 5px 6px;
  font-size: 12.5px;
  border-radius: 6px;
}
.pos-qty-stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}
.pos-step-btn {
  width: 24px;
  height: 28px;
  border: 1px solid var(--border-strong);
  background: var(--surface2);
  color: var(--text);
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.pos-step-btn:hover { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.pos-rate-combo {
  display: flex;
  gap: 3px;
}
.pos-rate-combo select { width: 58px; flex-shrink: 0; padding: 5px 2px; }
.pos-rate-combo input { flex: 1; min-width: 60px; }

/* Pinned Bottom Checkout Dock */
.pos-reg-dock {
  flex-shrink: 0;
  border-top: 2px solid var(--border);
  background: var(--surface2);
  padding: 10px 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pos-dock-metrics {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--muted);
}
.pos-dock-metrics strong { color: var(--text); }

.pos-extra-bar {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}
.pos-extra-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.pos-extra-toggle:hover { background: var(--surface2); }
.pos-extra-summary { color: var(--primary); font-weight: 700; font-size: 11.5px; }
.pos-extra-drawer {
  display: none;
  padding: 8px 10px 10px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}
.pos-extra-drawer.open { display: block; }
.pos-extra-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.pos-extra-grid input, .pos-extra-grid select { padding: 5px 7px; font-size: 12px; }

.pos-lcd-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #064e3b 0%, #0b6b43 100%);
  color: #fff;
}
.pos-lcd-sub { font-size: 11.5px; opacity: 0.88; }
.pos-lcd-grand {
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.pos-lcd-cur { font-size: 13px; font-weight: 700; opacity: 0.85; }
.pos-lcd-grand strong { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

.pos-pay-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}
.pos-pay-inputs input { padding: 7px 9px; font-weight: 700; }
.pos-change-pill {
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--ok-bg);
  border: 1px solid var(--ok-bd);
  color: var(--ok-tx);
  display: flex;
  flex-direction: column;
  font-size: 11px;
  text-align: end;
}
.pos-change-pill strong { font-size: 14px; }

.pos-quick-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.pos-cta-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}
.pos-cta-main {
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 800;
  border-radius: 10px;
  box-shadow: 0 4px 14px var(--primary-ring);
}
.pos-cta-sec { padding: 10px 14px; font-weight: 700; }

/* Responsive fallback for smaller tablets/laptops */
@media (max-width: 980px) {
  body.pos-shell-body { overflow: auto; height: auto; }
  .pos-shell { height: auto; overflow: visible; }
  .pos-workspace { grid-template-columns: 1fr; overflow: visible; }
  .pos-today-pill, .pos-brand-meta span { display: none; }
  .pos-extra-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ========================== HAXAN KHATA ROYAL BLUE BILINGUAL THEME ========================== */
:root {
  --primary: #1d4ed8;
  --primary-h: #1e40af;
  --primary-soft: #eff6ff;
  --primary-ring: rgba(29, 78, 216, 0.2);
}
[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-h: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.16);
  --primary-ring: rgba(59, 130, 246, 0.28);
}

.hk-topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: 54px;
  background: linear-gradient(90deg, #1e3a8a 0%, #1d4ed8 55%, #2563eb 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px;
  box-shadow: 0 2px 10px rgba(30, 58, 138, 0.28);
}
.hk-top-left, .hk-top-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.hk-brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: #fff; }
.hk-shield {
  width: 34px; height: 34px; border-radius: 9px;
  background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.28);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: 0.03em;
}
.hk-brand-names { display: flex; flex-direction: column; line-height: 1.15; }
.hk-brand-names strong { font-size: 14.5px; font-weight: 800; }
.hk-brand-names span { font-size: 11px; opacity: 0.88; font-family: 'Noto Nastaliq Urdu', sans-serif; }

.hk-global-search {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 9px; min-width: 240px;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.92); font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.hk-global-search:hover { background: rgba(255,255,255,0.22); }
.hk-global-search kbd {
  margin-inline-start: auto; font-size: 10.5px; padding: 1px 6px; border-radius: 4px;
  background: rgba(0,0,0,0.22); color: #fff; font-family: inherit;
}
@media (max-width: 900px) { .hk-global-search { display: none; } }

.hk-pos-pill {
  padding: 6px 12px; border-radius: 99px; background: #10b981; color: #fff;
  text-decoration: none; font-size: 12.5px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 2px 8px rgba(16,185,129,0.35);
}
.hk-pos-pill:hover { background: #059669; }
.hk-biz-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px;
  background: rgba(255,255,255,0.15); border: 1px solid rgba(255,255,255,0.25);
  color: #fff; text-decoration: none; font-size: 12px; font-weight: 600; max-width: 200px;
}
.hk-biz-pill span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hk-biz-cnt { background: #f59e0b; color: #111; font-size: 10px; font-weight: 800; padding: 0 5px; border-radius: 99px; }
.hk-lang-pill {
  padding: 5px 10px; border-radius: 8px; background: #fff; color: #1e40af;
  text-decoration: none; font-size: 12px; font-weight: 700;
}
.hk-icon-btn {
  width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center;
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.2);
  color: #fff; cursor: pointer;
}
.hk-icon-btn:hover { background: rgba(255,255,255,0.24); }
.hk-user-pill { display: flex; align-items: center; gap: 7px; }
.hk-user-av {
  width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,0.22);
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
}
.hk-user-meta { display: flex; flex-direction: column; line-height: 1.15; }
.hk-user-meta strong { font-size: 12px; }
.hk-user-meta small { font-size: 10px; opacity: 0.8; }
@media (max-width: 720px) { .hk-user-meta, .hk-biz-pill { display: none; } }

/* Shell & Sidebar */
.hk-shell { min-height: calc(100vh - 54px); }
.hk-sidebar { top: 54px; height: calc(100vh - 54px); width: 252px; }
.hk-side-search { padding: 10px 10px 6px; border-bottom: 1px solid var(--border); }
.hk-side-search input { padding: 7px 10px; font-size: 12.5px; border-radius: 8px; background: var(--surface2); }
.ur-lbl { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 500; margin-inline-start: 3px; }
.sidebar nav a.active .ur-lbl { color: var(--primary); }

.hk-nav-grp { margin: 2px 0; }
.hk-nav-grp summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; font-size: 13px;
  color: var(--text); user-select: none;
}
.hk-nav-grp summary::-webkit-details-marker { display: none; }
.hk-nav-grp summary:hover { background: var(--surface2); }
.hk-nav-grp summary svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0; }
.hk-nav-grp[open] > summary { background: var(--primary-soft); color: var(--primary); }
.hk-nav-grp[open] > summary svg { color: var(--primary); }
.hk-nav-sub {
  display: flex; flex-direction: column; gap: 2px;
  padding-inline-start: 24px; padding-top: 3px; padding-bottom: 4px;
}
.hk-nav-sub a { font-size: 12.5px !important; padding: 6px 10px !important; }

.hk-page-subbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 22px 0;
}
.hk-page-title { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.hk-page-actions { display: flex; gap: 8px; }

/* Haxan Khata Hero Banner (for Party Khata / Kanda / Stock by Godown) */
.hk-hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #1d4ed8 60%, #2563eb 100%);
  color: #fff; border-radius: var(--radius); padding: 18px 22px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
}
.hk-hero h2 { margin: 0 0 3px; font-size: 20px; font-weight: 800; }
.hk-hero p { margin: 0; font-size: 13px; opacity: 0.88; }
.hk-hero.emerald { background: linear-gradient(135deg, #065f46 0%, #059669 100%); }
.hk-hero.amber { background: linear-gradient(135deg, #b45309 0%, #d97706 100%); }

/* Khata Split Cards (Debit Banaam vs Credit Jama) */
.khata-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .khata-split { grid-template-columns: 1fr; } }
.khata-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.khata-box-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.khata-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 6px; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); border-radius: 6px; }
.khata-row:hover { background: var(--surface2); }
.khata-row:last-child { border-bottom: none; }


/* ========================== VISUAL PRINTING SETTINGS UI ========================== */
.print-tpl-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 760px) { .print-tpl-grid { grid-template-columns: 1fr; } }
.print-tpl-card {
  text-align: start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}
.print-tpl-card:hover { border-color: var(--primary); background: var(--surface2); }
.print-tpl-card.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px var(--primary-ring);
}
.print-tpl-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 14px;
}
.tpl-chk {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: none; place-items: center; font-size: 11px; font-weight: 800;
}
.print-tpl-card.active .tpl-chk { display: grid; }

.print-brand-box {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface2);
  padding: 6px 16px;
}
.print-toggle-row, .print-color-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.print-color-row:last-child { border-bottom: none; }

.swatch-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.color-hex-box {
  width: 34px !important; height: 28px !important; padding: 2px !important;
  border-radius: 6px; cursor: pointer;
}
.swatch-dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid transparent; cursor: pointer;
  transition: transform 0.12s;
}
.swatch-dot:hover { transform: scale(1.15); }
.swatch-dot.active { border-color: #fff; box-shadow: 0 0 0 2px var(--text); transform: scale(1.12); }

/* Toggle Switch */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; cursor: pointer; inset: 0; background: var(--border-strong);
  border-radius: 99px; transition: 0.2s;
}
.switch span::before {
  content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(18px); }


/* ========================== HAXAN KHATA DASHBOARD & LIST UI/UX ========================== */
.hk-greet { margin-bottom: 14px; }
.hk-greet h2 { margin: 0 0 2px; font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
.hk-greet p { margin: 0; }

.hk-action-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
@media (max-width: 980px) { .hk-action-grid { grid-template-columns: repeat(2, 1fr); } }
.hk-act-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; padding: 14px 10px; border-radius: 13px; color: #fff; text-decoration: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.12);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.hk-act-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18); }
.hk-act-ico { font-size: 20px; line-height: 1; margin-bottom: 2px; }
.hk-act-card strong { font-size: 13.5px; font-weight: 800; }
.hk-act-card .ur { font-size: 11.5px; opacity: 0.92; font-family: 'Noto Nastaliq Urdu', sans-serif; }
.hk-act-card.c-green { background: linear-gradient(135deg, #059669, #10b981); }
.hk-act-card.c-blue { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
.hk-act-card.c-pink { background: linear-gradient(135deg, #db2777, #ec4899); }
.hk-act-card.c-purple { background: linear-gradient(135deg, #7c3aed, #9333ea); }
.hk-act-card.c-amber { background: linear-gradient(135deg, #d97706, #f59e0b); }

/* 4 Rounded KPI Cards with Colorful Circular Icon Badges */
.hk-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 1024px) { .hk-kpi-row { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .hk-kpi-row { grid-template-columns: 1fr; } }

.hk-kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 15px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}
.hk-kpi-lbl { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.hk-kpi-val { font-size: 21px; font-weight: 800; color: var(--text); margin: 3px 0 2px; letter-spacing: -0.02em; }
.hk-kpi-sub { font-size: 11.5px; color: var(--muted); }
.hk-kpi-ico {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 17px; color: #fff; font-weight: 800;
}
.hk-kpi-ico.ic-blue { background: #2563eb; }
.hk-kpi-ico.ic-green { background: #16a34a; }
.hk-kpi-ico.ic-emerald { background: #059669; }
.hk-kpi-ico.ic-red { background: #ef4444; }
.hk-kpi-ico.ic-amber { background: #f59e0b; }

/* Royal Blue Table Header (Sales & Purchases Lists) */
.hk-blue-table th {
  background: #1d4ed8 !important;
  color: #fff !important;
  border-bottom: none;
  padding: 12px 14px;
}

/* Kachi / Pakki Parchi Top Bar */
.parchi-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 12px 16px !important; margin-bottom: 14px !important;
}
.parchi-mode-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.parchi-pill {
  padding: 8px 15px; border-radius: 99px; font-size: 12.5px; font-weight: 700;
  border: 1.5px solid var(--border-strong); background: var(--surface2); color: var(--text);
  cursor: pointer; font-family: inherit;
}
.parchi-pill.active-amber { background: #f59e0b; color: #fff; border-color: #f59e0b; box-shadow: 0 3px 10px rgba(245,158,11,.35); }
.parchi-pill.active-green { background: #059669; color: #fff; border-color: #059669; }
.parchi-pill.active-gray { background: #334155; color: #fff; border-color: #334155; }
.chip-btn.active { background: #e11d48; color: #fff; border-color: #e11d48; }


/* ========================== 2-COLUMN TABBED SETTINGS MODULE ========================== */
.hk-settings-wrap {
  display: grid;
  grid-template-columns: 235px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) { .hk-settings-wrap { grid-template-columns: 1fr; } }

.hk-settings-nav {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 70px;
}
.hk-set-grp {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 5px 10px;
  border-radius: 7px;
  margin: 10px 0 6px;
  letter-spacing: 0.05em;
}
.hk-set-tab {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 11px;
  margin-bottom: 3px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  font-size: 13px;
  transition: background 0.14s, color 0.14s;
}
.hk-set-tab:hover { background: var(--surface2); }
.hk-set-tab.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.hk-progress-bar {
  height: 7px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
  margin-top: 12px;
}
.hk-progress-bar > div {
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* Invoice Settings Card Headers & Logo Uploader */
.inv-card-hdr {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.inv-ico-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 16px;
  flex-shrink: 0;
}
.logo-upload-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.logo-upload-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
.logo-upload-btn:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.logo-preview-box {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface2);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.logo-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

/* ========================== INVENTORY & SLIDE-OVER DRAWER ========================== */
.hk-inv-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 14px;
  overflow-x: auto;
}
.hk-inv-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  white-space: nowrap;
}
.hk-inv-tab:hover { color: var(--text); }
.hk-inv-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.inv-thumb {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fef3c7;
  border: 1px solid #fde68a;
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  overflow: hidden;
}
.inv-thumb img { width: 100%; height: 100%; object-fit: cover; }

.hk-val-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}
.hk-val-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  padding: 11px 16px;
}

/* Right-side Slide-Over Drawer (Add Item / Add Party) */
.hk-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 950;
  display: none;
  justify-content: flex-end;
}
.hk-drawer-backdrop.open { display: flex; }
.hk-drawer {
  width: min(520px, 100vw);
  height: 100vh;
  background: var(--surface);
  box-shadow: -10px 0 36px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  animation: hkSlideIn 0.2s ease;
}
@keyframes hkSlideIn { from { transform: translateX(40px); opacity: 0.7; } to { transform: translateX(0); opacity: 1; } }
.hk-drawer-hdr {
  background: #1d4ed8;
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.hk-drawer-close {
  background: rgba(255,255,255,0.16);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.hk-drawer-close:hover { background: rgba(255,255,255,0.28); }
.hk-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
}
.hk-drawer-foot {
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.hk-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 520px) { .hk-type-grid { grid-template-columns: 1fr; } }
.hk-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  font-size: 12.5px;
  transition: border-color 0.14s, background 0.14s;
}
.hk-type-card:hover { border-color: var(--primary); }
.hk-type-card.active {
  border-color: #1d4ed8;
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.14);
}

/* Business Profile 5-Step Wizard */
.hk-wiz-tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  border-bottom: 1.5px solid var(--border);
}
@media (max-width: 720px) { .hk-wiz-tabs { grid-template-columns: repeat(2, 1fr); } }
.hk-wiz-tab {
  background: transparent;
  border: none;
  border-bottom: 2.5px solid transparent;
  padding: 9px 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  text-align: start;
  font-family: inherit;
  margin-bottom: -1.5px;
}
.hk-wiz-tab:hover { color: var(--text); }
.hk-wiz-tab.active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
}
.hk-inline-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 640px) { .hk-inline-row { grid-template-columns: 1fr; gap: 6px; } }

/* ========================== EXPENSE 2-STEP WIZARD ========================== */
.exp-kind-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.exp-kind-card:hover { border-color: #93c5fd; background: var(--surface2); }
.exp-kind-card.active {
  border-color: #2563eb;
  background: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.exp-kind-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface2);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.exp-kind-card.active .exp-kind-ico { background: #dbeafe; }
.exp-kind-title { font-size: 15px; font-weight: 800; color: var(--text); }
.exp-kind-card.active .exp-kind-title { color: #1d4ed8; }
.exp-kind-chk {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #2563eb;
  color: #2563eb;
  display: none;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.exp-kind-card.active .exp-kind-chk { display: grid; }

.exp-adhat-box {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.exp-amt-box {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  padding: 8px 16px;
  margin-top: 5px;
}
.exp-amt-box input {
  border: none !important;
  box-shadow: none !important;
  font-size: 24px;
  font-weight: 800;
  padding: 4px 0 !important;
  width: 100%;
  background: transparent;
}

/* Receive / Pay Drawer Mode Pills */
.pay-mode-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 12.5px;
  transition: background 0.14s, color 0.14s;
}
.pay-mode-pill:hover { background: rgba(255,255,255,0.18); }
.pay-mode-pill.active {
  background: #ffffff;
  color: #0f172a;
  border-color: #ffffff;
}
.pay-mode-pill.active .ur-lbl { color: #334155 !important; }
