/* ============================================================================
   Jun Laagan HTML Inventory System — Design System
   New look: deep slate + indigo + teal. (Different from the old charcoal UI.)
   ============================================================================ */

:root {
  --bg: #eef2f7;
  --bg-soft: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --sidebar: #0f172a;
  --sidebar-2: #1e293b;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --primary-soft: #eef2ff;
  --accent: #14b8a6;
  --accent-dark: #0f766e;
  --accent-soft: #ccfbf1;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --danger: #ef4444;
  --danger-soft: #fee2e2;
  --warning: #f59e0b;
  --warning-soft: #fef3c7;
  --success: #10b981;
  --success-soft: #d1fae5;
  --info: #0ea5e9;
  --info-soft: #e0f2fe;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 8px 24px -8px rgba(15, 23, 42, 0.16);
  --shadow-lg: 0 24px 60px -20px rgba(15, 23, 42, 0.35);
  --sidebar-w: 250px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ---------------------------------------------------------------- utilities */
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }
.muted { color: var(--muted); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.w-full { width: 100%; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.15s ease, box-shadow 0.15s ease;
  background: var(--surface-2);
  color: var(--text-soft);
  white-space: nowrap;
}
.btn:hover { background: #e2e8f0; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 16px -6px rgba(79, 70, 229, 0.7); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { padding: 7px 9px; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------------- inputs */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 6px;
}
.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
.textarea { resize: vertical; min-height: 64px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* ------------------------------------------------------------------- badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: var(--surface-2);
  color: var(--text-soft);
  white-space: nowrap;
}
.badge-success { background: var(--success-soft); color: #047857; }
.badge-danger { background: var(--danger-soft); color: #b91c1c; }
.badge-warning { background: var(--warning-soft); color: #b45309; }
.badge-info { background: var(--info-soft); color: #0369a1; }
.badge-primary { background: var(--primary-soft); color: var(--primary-dark); }
.badge-muted { background: #f1f5f9; color: var(--muted); }

/* -------------------------------------------------------------------- cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.card-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.card-body { padding: 20px; }

/* --------------------------------------------------------------------- grid */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.stat {
  position: relative;
  overflow: hidden;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.stat::after {
  content: '';
  position: absolute;
  right: -26px;
  top: -26px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: var(--primary-soft);
  opacity: 0.7;
}
.stat .stat-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stat .stat-value { font-size: 26px; font-weight: 800; margin-top: 8px; letter-spacing: -0.02em; }
.stat .stat-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }
.stat.accent::after { background: var(--accent-soft); }
.stat.warn::after { background: var(--warning-soft); }
.stat.danger::after { background: var(--danger-soft); }

/* -------------------------------------------------------------------- tables */
.table-wrap { width: 100%; overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
  white-space: nowrap;
}
table.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-soft);
}
table.tbl tbody tr:hover { background: #f8fafc; }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.strong { color: var(--text); font-weight: 600; }
table.tbl .actions { display: flex; gap: 6px; justify-content: flex-end; }

.empty {
  padding: 42px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .empty-icon { font-size: 34px; margin-bottom: 8px; }

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

.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(175deg, var(--sidebar) 0%, #111c33 60%, #131a2e 100%);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  padding: 18px 14px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 6px 8px 20px;
}
.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  box-shadow: 0 8px 18px -8px rgba(20, 184, 166, 0.8);
}
.brand-text b { display: block; color: #fff; font-size: 14.5px; letter-spacing: -0.01em; }
.brand-text span { display: block; color: #64748b; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 2px; }

.nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; padding-bottom: 10px; }
.nav-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #475569;
  padding: 14px 10px 6px;
  font-weight: 700;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: #cbd5e1;
  font-weight: 500;
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.13s ease, color 0.13s ease;
}
.nav-item .nav-ico { width: 20px; text-align: center; font-size: 15px; }
.nav-item:hover { background: rgba(148, 163, 184, 0.12); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(79, 70, 229, 0.9), rgba(20, 184, 166, 0.55));
  color: #fff;
  box-shadow: 0 6px 16px -8px rgba(79, 70, 229, 0.9);
}
.sidebar-foot { margin-top: auto; padding: 12px 8px 4px; border-top: 1px solid rgba(148, 163, 184, 0.15); }

.main {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 26px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.topbar .page-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.topbar .page-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 10px 5px 5px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.user-chip .u-name { font-size: 12.5px; font-weight: 700; line-height: 1.1; }
.user-chip .u-role { font-size: 10.5px; color: var(--muted); text-transform: capitalize; }

.content { padding: 24px 26px 48px; flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* --------------------------------------------------------------------- login */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(1100px 600px at 10% -10%, rgba(79, 70, 229, 0.55), transparent 60%),
    radial-gradient(900px 600px at 110% 110%, rgba(20, 184, 166, 0.45), transparent 60%),
    linear-gradient(150deg, #0b1120 0%, #101a31 55%, #0c1a22 100%);
}
.login-card {
  width: 100%;
  max-width: 940px;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #fff;
}
.login-hero {
  position: relative;
  padding: 44px 40px;
  color: #e2e8f0;
  background:
    radial-gradient(600px 400px at 90% 0%, rgba(20, 184, 166, 0.35), transparent 60%),
    linear-gradient(160deg, #1e1b4b 0%, #111c33 70%);
  display: flex;
  flex-direction: column;
}
.login-hero .lh-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.login-hero h1 { font-size: 29px; line-height: 1.18; margin: 0 0 12px; letter-spacing: -0.02em; color: #fff; }
.login-hero p { color: #94a3b8; font-size: 13.5px; line-height: 1.65; margin: 0; max-width: 340px; }
.login-hero .lh-points { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 34px; }
.login-hero .lh-point { display: flex; gap: 10px; align-items: flex-start; font-size: 12.8px; color: #cbd5e1; }
.login-hero .lh-point .dot { width: 22px; height: 22px; border-radius: 7px; background: rgba(20, 184, 166, 0.2); display: grid; place-items: center; color: #5eead4; font-size: 12px; flex: none; }
.login-form { padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -0.02em; }
.login-form .sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-form .input { padding: 11px 13px; }
.login-error {
  background: var(--danger-soft);
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}
.login-note {
  margin-top: 18px;
  background: var(--primary-soft);
  border: 1px solid #e0e7ff;
  color: var(--primary-dark);
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 11.8px;
  line-height: 1.5;
}
.login-foot { text-align: center; color: #64748b; font-size: 11.5px; margin-top: 18px; }

/* ----------------------------------------------------------------------- POS */
.pos-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 18px;
  align-items: start;
}
.pos-products { min-width: 0; }
.pos-searchbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.pos-searchbar .input { flex: 1; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  min-height: 132px;
}
.product-card:hover { border-color: var(--primary); box-shadow: var(--shadow); transform: translateY(-2px); }
.product-card.out { opacity: 0.5; cursor: not-allowed; }
.product-card .pc-sku { font-size: 10.5px; color: var(--muted-2); font-family: 'JetBrains Mono', monospace; }
.product-card .pc-name { font-weight: 600; font-size: 13px; line-height: 1.35; margin: 5px 0 8px; color: var(--text); flex: 1; }
.product-card .pc-foot { display: flex; align-items: center; justify-content: space-between; }
.product-card .pc-price { font-weight: 800; color: var(--primary-dark); font-size: 14.5px; }
.product-card .pc-stock { font-size: 10.5px; color: var(--muted); }
.product-card .pc-stock.low { color: #b45309; }
.product-card .pc-stock.out { color: #b91c1c; }

.cart-panel { position: sticky; top: 84px; display: flex; flex-direction: column; max-height: calc(100vh - 100px); }
.cart-head { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.cart-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.cart-items { overflow-y: auto; padding: 10px 14px; flex: 1; min-height: 120px; }
.cart-line { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px dashed var(--border); }
.cart-line:last-child { border-bottom: none; }
.cart-line .cl-info { flex: 1; min-width: 0; }
.cart-line .cl-name { font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-line .cl-price { font-size: 11px; color: var(--muted); }
.qty-controls { display: flex; align-items: center; gap: 5px; }
.qty-btn {
  width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border-strong);
  background: #fff; cursor: pointer; font-weight: 700; color: var(--text-soft); line-height: 1;
  display: grid; place-items: center; font-size: 13px;
}
.qty-btn:hover { background: var(--surface-2); }
.qty-val { min-width: 24px; text-align: center; font-weight: 700; font-size: 12.5px; }
.cart-line .cl-total { font-weight: 700; font-size: 12.5px; width: 68px; text-align: right; }
.cart-line .cl-remove { border: none; background: transparent; color: var(--muted-2); cursor: pointer; font-size: 15px; padding: 2px; }
.cart-line .cl-remove:hover { color: var(--danger); }
.cart-empty { text-align: center; color: var(--muted); padding: 34px 10px; font-size: 12.5px; }
.cart-foot { border-top: 1px solid var(--border); padding: 14px 16px; background: var(--bg-soft); border-radius: 0 0 var(--radius) var(--radius); }
.totals-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-soft); padding: 4px 0; }
.totals-row.grand { font-size: 18px; font-weight: 800; color: var(--text); padding-top: 8px; margin-top: 6px; border-top: 1px solid var(--border-strong); }
.cart-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.cart-fields .field { margin-bottom: 6px; }
.cart-fields label { font-size: 11px; }
.cart-fields .input, .cart-fields .select { padding: 7px 9px; font-size: 12.5px; }

/* -------------------------------------------------------------------- modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 100;
  animation: fade 0.12s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 18px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: pop 0.14s ease;
}
.modal.modal-lg { max-width: 760px; }
@keyframes pop { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: transparent; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px; border-top: 1px solid var(--border); background: var(--bg-soft); border-radius: 0 0 18px 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .span-2 { grid-column: span 2; }

/* -------------------------------------------------------------------- toasts */
.toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  padding: 11px 15px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow);
  min-width: 240px;
  max-width: 360px;
  animation: slidein 0.18s ease;
}
@keyframes slidein { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--info); }

/* --------------------------------------------------------------------- misc */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab {
  border: none; background: transparent; padding: 10px 15px; font-size: 13px; font-weight: 600;
  color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--text-soft); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.receipt {
  max-width: 420px;
  margin: 0 auto;
  background: #fff;
  padding: 26px 26px 30px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #0f172a;
}
.receipt h2 { text-align: center; font-size: 17px; margin: 0 0 2px; font-family: 'Inter', sans-serif; letter-spacing: -0.01em; }
.receipt .r-sub { text-align: center; font-size: 10.5px; color: #64748b; margin-bottom: 14px; }
.receipt .r-meta { display: flex; justify-content: space-between; font-size: 10.5px; color: #475569; }
.receipt .r-divider { border-top: 1px dashed #cbd5e1; margin: 10px 0; }
.receipt .r-item { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.receipt .r-item .r-i-name { flex: 1; }
.receipt .r-line { display: flex; justify-content: space-between; padding: 2px 0; }
.receipt .r-line.total { font-size: 15px; font-weight: 700; padding-top: 6px; }
.receipt .r-thanks { text-align: center; margin-top: 16px; font-size: 10.5px; color: #64748b; }

.spinner {
  width: 18px; height: 18px; border: 2.5px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; color: var(--muted); }

.alert { border-radius: 10px; padding: 11px 14px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: var(--danger-soft); color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: var(--info-soft); color: #0369a1; border: 1px solid #bae6fd; }
.alert-warning { background: var(--warning-soft); color: #b45309; border: 1px solid #fde68a; }

.pill-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 3px 9px; border-radius: 999px; background: var(--surface-2); font-size: 11.5px;
  font-weight: 600; color: var(--text-soft);
}

.date-range { display: flex; align-items: center; gap: 8px; }
.date-range .input { width: 150px; }
.toolbar .input { width: auto; }
.toolbar .input[type="date"] { width: 160px; }
.pos-searchbar .input { min-width: 140px; }
.pos-searchbar .select { max-width: 170px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pos-grid { grid-template-columns: minmax(0, 1fr) 340px; }
}
@media (max-width: 860px) {
  .login-card { grid-template-columns: 1fr; max-width: 460px; }
  .login-hero { display: none; }
  .pos-grid { grid-template-columns: 1fr; }
  .cart-panel { position: static; max-height: none; }
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .content { padding: 18px 14px 40px; }
  .topbar { padding: 0 14px; }
  .menu-toggle { display: inline-flex !important; }
}
@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: span 1; }
  .user-chip .u-meta { display: none; }
  .login-form { padding: 32px 24px; }
}
.menu-toggle { display: none; }

/* -------------------------------------------------------------------- print */
@media print {
  .sidebar, .topbar, .page-head .toolbar, .no-print, .toast-wrap { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .card { border: none; box-shadow: none; }
  .receipt { padding: 0; max-width: 100%; }
}
