:root {
  --bg: #eaeded;
  --surface: #ffffff;
  --surface-alt: #f7f8f8;
  --border: #d5d9d9;
  --border-strong: #babfbf;
  --text: #0f1111;
  --text-muted: #565959;
  --text-soft: #6f7373;

  /* Amazon App Light Palette */
  --amz-header: linear-gradient(90deg, #84d8e3 0%, #a8e8d6 100%);
  --amz-subbar: #c7efe9;
  --amz-teal: #007185;
  --amz-teal-soft: #edfdff;
  --amz-yellow: #ffd814;
  --amz-yellow-hover: #f7ca00;
  --amz-yellow-border: #fcd200;
  --amz-orange: #ffa41c;
  --amz-orange-hover: #fa8900;
  --amz-orange-border: #ff8f00;

  --primary: #007185;
  --primary-hover: #005a6a;
  --primary-soft: #edfdff;
  --emerald: #067d62;
  --emerald-soft: #e6f4f1;
  --amber: #c7511f;
  --amber-soft: #fff4e5;
  --danger: #b12704;
  --danger-soft: #fdf2f0;

  --radius: 10px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(15, 17, 17, 0.06);
  --shadow: 0 4px 14px rgba(15, 17, 17, 0.09);
  --transition: all 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* No focus rings per user preference */
*:focus, *:focus-visible { outline: none !important; box-shadow: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  max-width: 100%;
}

/* Custom subtle scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button svg, a svg { pointer-events: none; }

/* Subtle Canvas Background Particles */
#bg-particles {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.42;
}

.page-shell { position: relative; }
.public-shell { position: relative; z-index: 1; }

/* Global Loading Spinner Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(234, 237, 237, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.loading-overlay.active { opacity: 1; pointer-events: auto; }
.spinner-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  font-weight: 700;
  color: var(--text);
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border);
  border-top-color: var(--amz-teal);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.fade-in { animation: fadeSlideUp 0.24s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.sidebar {
  width: 248px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 50;
  transition: width 0.22s cubic-bezier(0.22, 1, 0.36, 1), transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.sidebar-mobile-close {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(15, 17, 17, 0.14);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.sidebar-mobile-close:hover { background: #ffffff; color: var(--amz-teal); }
.sidebar-brand {
  height: 60px;
  padding: 0 16px;
  background: var(--amz-header);
  border-bottom: 1px solid #b5e0dc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  overflow: hidden;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: #0f1111;
}
.brand-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #0f1111;
  color: var(--amz-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 15px;
  position: relative;
}
.brand-smile {
  width: 14px;
  height: 3px;
  background: var(--amz-orange);
  border-radius: 99px;
  display: inline-block;
  margin-left: 2px;
}
.sidebar-nav { padding: 12px 10px; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 3px; }
.nav-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-soft);
  padding: 12px 12px 4px;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: var(--transition);
}
.nav-link:hover { background: var(--surface-alt); color: var(--amz-teal); }
.nav-link.active {
  background: var(--amz-teal-soft);
  color: var(--amz-teal);
  font-weight: 700;
  border-left-color: var(--amz-teal);
}
.sidebar-footer { padding: 14px 16px; border-top: 1px solid var(--border); background: var(--surface-alt); }

.main-area {
  flex: 1;
  margin-left: 248px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Desktop Collapsed Mini-Rail Sidebar */
@media (min-width: 769px) {
  .app-layout.sidebar-collapsed .sidebar { width: 72px; }
  .app-layout.sidebar-collapsed .main-area { margin-left: 72px; }
  .app-layout.sidebar-collapsed .sidebar-brand { justify-content: center; padding: 0 10px; }
  .app-layout.sidebar-collapsed .brand-logo-img { max-width: 44px !important; height: auto !important; max-height: 36px; }
  .app-layout.sidebar-collapsed .brand-text-wrap,
  .app-layout.sidebar-collapsed .nav-section,
  .app-layout.sidebar-collapsed .nav-link span,
  .app-layout.sidebar-collapsed .sidebar-footer-meta,
  .app-layout.sidebar-collapsed .sidebar-footer-pw,
  .app-layout.sidebar-collapsed .sidebar-logout-label { display: none; }
  .app-layout.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 10px;
    border-left-width: 0;
    border-radius: 10px;
  }
  .app-layout.sidebar-collapsed .nav-link.active { background: var(--amz-teal-soft); }
  .app-layout.sidebar-collapsed .sidebar-footer { padding: 12px 10px; }
}

/* Amazon App Light Gradient Topbar + Location/Store Sub-bar */
.topbar {
  min-height: 60px;
  background: var(--amz-header);
  border-bottom: 1px solid #b5e0dc;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 30;
  box-shadow: 0 2px 8px rgba(15, 17, 17, 0.05);
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar-title { font-size: 16px; font-weight: 800; margin: 0; color: #0f1111; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -0.01em; }
.topbar-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid #9ecbd0;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 17, 17, 0.08);
}
.topbar-search input {
  border: none;
  padding: 8px 14px;
  width: 100%;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: transparent;
}
.topbar-search button {
  background: var(--amz-yellow);
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  color: #0f1111;
  display: flex;
  align-items: center;
}
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid #a6d6d2;
  border-radius: 999px;
  padding: 4px 12px 4px 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: #0f1111;
}
.user-chip-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #0f1111;
  color: var(--amz-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.amz-substrip {
  background: var(--amz-subbar);
  border-bottom: 1px solid #b8e2dc;
  padding: 7px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: #0f1111;
  flex-wrap: wrap;
}
.substrip-pill {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #aadad4;
  border-radius: 999px;
  padding: 2px 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.page-content { padding: 18px 20px 32px; flex: 1; max-width: 1440px; width: 100%; margin: 0 auto; }

.sidebar-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #a6d6d2;
  border-radius: 9px;
  cursor: pointer;
  color: #0f1111;
  flex-shrink: 0;
  transition: var(--transition);
}
.sidebar-toggle-btn:hover { background: #ffffff; border-color: var(--amz-teal); color: var(--amz-teal); }
.sidebar-toggle-btn:active { transform: scale(0.95); }

.public-nav-link {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #0f1111;
  transition: var(--transition);
}
.public-nav-link:hover { background: rgba(255, 255, 255, 0.55); color: var(--amz-teal); }
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.22); z-index: 45; }

/* Mobile Amazon-Style Bottom Navigation */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 58px;
  background: #ffffff;
  border-top: 1px solid var(--border);
  z-index: 38;
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(15, 17, 17, 0.06);
}
.mobile-bottom-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 4px 10px;
}
.mobile-bottom-link.active { color: var(--amz-teal); }

/* Cards & Grids */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  min-width: 0;
  overflow: hidden;
}
.card-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.card-title { font-size: 16px; font-weight: 700; margin: 0; color: var(--text); }
.card-body { padding: 18px; }

.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col-span-2 { grid-column: span 2; }

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--amz-teal);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: var(--transition);
  min-width: 0;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.kpi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--amz-teal-soft);
  color: var(--amz-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-icon.is-amber { background: var(--amber-soft); color: var(--amber); }
.kpi-icon.is-green { background: var(--emerald-soft); color: var(--emerald); }
.kpi-icon.is-yellow { background: #fff9db; color: #8a6d00; }
.kpi-label { font-size: 11.5px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.kpi-value { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; color: var(--text); }
.kpi-sub { font-size: 12px; color: var(--amz-teal); font-weight: 600; }

.welcome-banner {
  background: linear-gradient(135deg, #ffffff 0%, #f1fbfa 100%);
  border: 1px solid #cce6e3;
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.feature-icon-box {
  width: 42px;
  height: 42px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.tile-add-pill {
  font-size: 11px;
  font-weight: 800;
  background: var(--amz-yellow);
  color: #0f1111;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--amz-yellow-border);
}

/* Forms & Inputs */
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 13px; }
.form-label { font-size: 12.5px; font-weight: 700; color: var(--text); }
.form-control, select.form-control, textarea.form-control {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #888c8c;
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.form-control:focus { border-color: var(--amz-teal); background: #fff; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* Amazon-Style Buttons & Native Tap Feedback */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.btn:active, .product-tile:active, .quick-action-tile:active, .mobile-bottom-link:active, .cat-pill:active {
  transform: scale(0.97);
}
.btn-sm { min-height: 34px; padding: 6px 13px; font-size: 12.5px; }
.btn-lg { min-height: 46px; padding: 11px 22px; font-size: 14.5px; }

/* Signature Amazon Yellow CTA */
.btn-primary {
  background: var(--amz-yellow);
  border-color: var(--amz-yellow-border);
  color: #0f1111;
  box-shadow: 0 1px 2px rgba(15, 17, 17, 0.08);
}
.btn-primary:hover { background: var(--amz-yellow-hover); }

/* Signature Amazon Orange Checkout / Emerald Action */
.btn-emerald {
  background: var(--amz-orange);
  border-color: var(--amz-orange-border);
  color: #0f1111;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(15, 17, 17, 0.1);
}
.btn-emerald:hover { background: var(--amz-orange-hover); }

.btn-outline {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text);
  border-radius: 8px;
}
.btn-outline:hover { background: var(--surface-alt); border-color: var(--amz-teal); color: var(--amz-teal); }

.btn-dark {
  background: #131921;
  border-color: #131921;
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(15, 17, 17, 0.16);
}
.btn-dark:hover { background: #232f3e; border-color: #232f3e; color: #ffffff; }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); border-color: #f3c4ba; border-radius: 8px; }

/* Badges & Alerts */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
}
.badge-paid, .badge-success { background: var(--emerald-soft); color: var(--emerald); }
.badge-partial, .badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-unpaid, .badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-neutral { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }
.badge-primary { background: var(--amz-teal-soft); color: var(--amz-teal); }

.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid;
  border-left-width: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: var(--emerald-soft); color: #055240; border-color: #a6dbd0; border-left-color: var(--emerald); }
.alert-error { background: var(--danger-soft); color: #8c1e03; border-color: #f5c6bc; border-left-color: var(--danger); }
.alert-info { background: var(--amz-teal-soft); color: var(--amz-teal); border-color: #b5e0dc; border-left-color: var(--amz-teal); }

/* Tables */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; text-align: left; }
table.table th {
  padding: 10px 14px;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  vertical-align: middle;
}
table.table tbody tr:hover { background: #f7fafa; }

/* POS Terminal Split Layout (Amazon App Product Card Grid) */
.pos-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(350px, 1fr); gap: 16px; align-items: start; }
@media (min-width: 1025px) {
  .pos-grid > *:last-child { position: sticky; top: 76px; }
}
.pos-products-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 12px; }
.product-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  min-width: 0;
  overflow: hidden;
}
.product-tile:hover { border-color: var(--amz-teal); box-shadow: var(--shadow); transform: translateY(-2px); }
.product-tile-name { font-weight: 700; font-size: 13.5px; color: var(--text); line-height: 1.3; word-break: break-word; }
.product-tile-price { font-weight: 800; font-size: 16px; color: #0f1111; }
.pos-cart-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.pos-cart-info { min-width: 140px; flex: 1 1 160px; }
.pos-cart-controls { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.pos-cart-total { min-width: 72px; text-align: right; font-weight: 800; flex-shrink: 0; }
.cat-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.cat-pill {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.cat-pill.active, .cat-pill:hover { background: var(--amz-teal-soft); color: var(--amz-teal); border-color: var(--amz-teal); }

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 17, 17, 0.48);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}
.modal-backdrop.open { display: flex; animation: fadeSlideUp 0.2s ease; }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 45px rgba(15, 17, 17, 0.2);
}

/* Public Header & Hero (Amazon App Inspired) */
.public-header {
  background: var(--amz-header);
  border-bottom: 1px solid #b5e0dc;
  position: sticky;
  top: 0;
  z-index: 30;
}
.container { max-width: 1240px; width: 100%; margin: 0 auto; padding: 0 18px; }
.public-nav { min-height: 62px; padding: 8px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.hero-section { padding: 28px 0 24px; }
.upi-logo-strip { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.upi-logo-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 14px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.upi-logo-chip:hover { border-color: var(--amz-teal); transform: translateY(-1px); }
.upi-logo-chip img { height: 22px; width: auto; max-width: 72px; object-fit: contain; }
.upi-logo-dark-bg { background: #131921; color: #fff; border-color: #131921; }

/* Toast */
.toast-container { position: fixed; bottom: 72px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #0f1111;
  color: #fff;
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow);
  animation: fadeSlideUp 0.2s ease;
}
.toast.toast-error { background: var(--danger); }
.toast.toast-success { background: var(--emerald); }

/* Utilities */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.text-right { text-align: right; }
.text-right-desktop { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-soft { color: var(--text-soft); }
.text-sm { font-size: 12.5px; }
.text-xs { font-size: 11.5px; }
.font-bold { font-weight: 700; }
.w-full { width: 100%; }
.w-4 { width: 16px; height: 16px; }
.w-5 { width: 20px; height: 20px; }
.w-6 { width: 24px; height: 24px; }

/* Mobile App Quick-Action Shortcuts & Horizontal Snap Rail */
.quick-action-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
}
.quick-action-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.quick-action-tile:hover { border-color: var(--amz-teal); color: var(--amz-teal); transform: translateY(-1px); }
.quick-action-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--amz-teal-soft);
  color: var(--amz-teal);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quick-action-tile.is-primary .quick-action-icon {
  background: var(--amz-yellow);
  color: #0f1111;
}

.h-scroll-rail {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.h-scroll-rail::-webkit-scrollbar { display: none; }
.h-scroll-rail > * { scroll-snap-align: start; flex-shrink: 0; }

/* Password Input with Eye Toggle */
.input-pw-wrap { position: relative; display: flex; align-items: center; }
.input-pw-wrap .form-control { padding-right: 42px; }
.pw-toggle-btn {
  position: absolute;
  right: 8px;
  background: transparent;
  border: none;
  color: var(--text-soft);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
}

/* Mobile POS Segment Tabs & Floating Cart Bar */
.pos-mobile-tabs {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 12px;
  gap: 4px;
}
.pos-tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}
.pos-tab-btn.active { background: var(--amz-teal); color: #ffffff; }

.pos-floating-bar {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(66px + env(safe-area-inset-bottom));
  background: #131921;
  color: #ffffff;
  border-radius: 14px;
  padding: 10px 14px;
  z-index: 36;
  box-shadow: 0 10px 26px rgba(15, 17, 17, 0.28);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* Responsive Mobile Optimization */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pos-grid { grid-template-columns: 1fr; }
  .topbar-search, .user-chip { display: none; }
  .pos-mobile-tabs { display: flex; }
  .pos-pane-hidden { display: none !important; }
  .pos-floating-bar.visible { display: flex; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mobile-close { display: inline-flex; }
  .sidebar-backdrop.open { display: block; }
  .main-area { margin-left: 0; padding-bottom: calc(138px + env(safe-area-inset-bottom)); }
  .nav-hide-mobile { display: none !important; }
  .text-right-desktop { text-align: left; }
  .mobile-bottom-nav {
    display: flex;
    height: calc(58px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
  }
  .page-content { padding: 12px; }
  .topbar { padding: 8px 12px; gap: 8px; }
  .topbar-title { font-size: 14.5px; }
  .amz-substrip { padding: 6px 12px; font-size: 11.5px; gap: 6px; }
  .substrip-pill { font-size: 11px; padding: 2px 8px; }
  .card-header { padding: 12px 14px; }
  .card-body { padding: 14px; }
  .hero-section { padding: 16px 0 18px; }
  .container { padding: 0 12px; }

  /* Compact 2x2 KPI grid on mobile (Amazon Seller App style) */
  .grid-2, .grid-3, .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi-card { padding: 12px 13px; }
  .kpi-value { font-size: 19px; }
  .kpi-label { font-size: 11px; }
  .col-span-2 { grid-column: span 1; }

  /* Prevent iOS Safari zoom on input tap */
  .form-control, select.form-control, textarea.form-control { font-size: 16px; min-height: 42px; }
  .mobile-btn-stack { flex-direction: column; align-items: stretch; }
  .mobile-btn-stack > .btn, .mobile-btn-stack > a.btn { width: 100%; }

  /* Responsive Card-Mode Tables on Mobile (zero horizontal scroll!) */
  table.mobile-stack-table thead { display: none; }
  table.mobile-stack-table,
  table.mobile-stack-table tbody,
  table.mobile-stack-table tr,
  table.mobile-stack-table td { display: block; width: 100%; }
  table.mobile-stack-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
    background: var(--surface);
  }
  table.mobile-stack-table tbody tr:last-child { margin-bottom: 0; }
  table.mobile-stack-table td {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    border-bottom: 1px dashed var(--border);
    text-align: right !important;
  }
  table.mobile-stack-table td:last-child { border-bottom: none; padding-top: 8px; }
  table.mobile-stack-table td::before {
    content: attr(data-label);
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text-soft);
    text-transform: uppercase;
    text-align: left;
    flex-shrink: 0;
  }
  table.mobile-stack-table td.mobile-no-label { display: block; text-align: center !important; }
  table.mobile-stack-table td.mobile-no-label::before { display: none; }

  .pos-products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .cat-pills {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
  }
  .cat-pills::-webkit-scrollbar { display: none; }
  .cat-pill { flex-shrink: 0; }
  .upi-logo-strip.h-scroll-rail { flex-wrap: nowrap; }

  /* Native Mobile Bottom Sheet Modals */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal-card {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 88vh;
    padding-bottom: env(safe-area-inset-bottom);
    animation: slideSheetUp 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .modal-card::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--border-strong);
    border-radius: 99px;
    margin: 10px auto 2px;
  }
}

@keyframes slideSheetUp {
  from { transform: translateY(28px); opacity: 0.6; }
  to { transform: translateY(0); opacity: 1; }
}

@media print {
  .public-header, .amz-substrip, footer, .no-print, #bg-particles, .loading-overlay, .toast-container, .mobile-bottom-nav { display: none !important; }
  body { background: #fff !important; }
}
