/* ============================================================
   SEN POS — Premium UI Design System v2
   Inspired by Linear, Vercel, Stripe
   ============================================================ */

/* ─── Google Fonts ─── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&display=swap');

/* ─── Design Tokens ─── */
:root {
  /* ── Primary: Violet-Blue (Linear-style) ── */
  --color-primary: #5b5ef4;
  --color-primary-h: #4547d4;
  --color-primary-s: #7b7df8;
  --color-primary-light: #c7c8fd;
  --color-primary-ghost: rgba(91, 94, 244, 0.07);
  --shadow-primary: 0 4px 16px rgba(91, 94, 244, 0.38);

  /* ── Semantic ── */
  --color-success: #12b886;
  --color-success-bg: rgba(18, 184, 134, 0.10);
  --color-warning: #f59f00;
  --color-warning-bg: rgba(245, 159, 0, 0.10);
  --color-danger: #f03e3e;
  --color-danger-bg: rgba(240, 62, 62, 0.10);
  --color-info: #4dabf7;
  --color-info-bg: rgba(77, 171, 247, 0.10);

  /* ── Neutrals (warm-cool balance) ── */
  --color-bg: #f4f6fb;
  --color-surface: #ffffff;
  --color-surface2: #f0f2f8;
  --color-surface3: #e8ebf4;
  --color-border: #dde1ee;
  --color-border-s: #c8cde0;

  /* ── Typography ── */
  --color-text: #111827;
  --color-text-2: #4b5563;
  --color-text-3: #9ca3af;
  --color-text-4: #d1d5db;

  /* ── Sidebar ── */
  --sidebar-w: 252px;
  --sidebar-bg: #16163a;
  --sidebar-text: rgba(255, 255, 255, 0.75);
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active-bg: rgba(91, 94, 244, 0.25);

  /* ── Spacing ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* ── Radii ── */
  --r-xs: 4px;
  --r-sm: 7px;
  --r-md: 11px;
  --r-lg: 15px;
  --r-xl: 22px;
  --r-full: 9999px;

  /* ── Shadows ── */
  --shadow-xs: 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-sm: 0 1px 4px rgba(17, 24, 39, 0.06), 0 1px 2px rgba(17, 24, 39, 0.04);
  --shadow-md: 0 4px 12px rgba(17, 24, 39, 0.07), 0 2px 4px rgba(17, 24, 39, 0.04);
  --shadow-lg: 0 12px 28px rgba(17, 24, 39, 0.09), 0 4px 8px rgba(17, 24, 39, 0.05);
  --shadow-xl: 0 24px 52px rgba(17, 24, 39, 0.12), 0 8px 16px rgba(17, 24, 39, 0.06);

  /* ── Motion ── */
  --ease: cubic-bezier(.25, .1, .25, 1);
  --duration: 160ms;
  --transition: all var(--duration) var(--ease);
}

/* (Dark Mode removed to prioritize Light Mode clarity as requested) */


/* ─── Base Reset ─── */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-text);
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 0;
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--color-primary-h);
}

/* ─── Form Controls ─── */
.form-label {
  font-weight: 600;
  color: var(--color-text-2);
  font-size: 0.85rem;
  margin-bottom: 6px;
}

.form-control,
.form-select {
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
  background: var(--color-surface);
  color: var(--color-text);
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

.form-control::placeholder {
  color: var(--color-text-3);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
  outline: none;
}

.form-control-lg,
.form-select-lg {
  font-size: 1rem;
  padding: 0.8rem 1.1rem;
}

.input-group .form-control {
  border-right: none;
}

.input-group .btn {
  border-radius: 0 var(--r-md) var(--r-md) 0 !important;
  border: 1.5px solid var(--color-border);
  border-left: none;
}

/* ─── Buttons ─── */
.btn {
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--r-md);
  padding: 0.6rem 1.2rem;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
}

.btn:active {
  transform: scale(0.97);
}

.btn:focus {
  outline: none;
}

.btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-primary-h);
  border-color: var(--color-primary-h);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.42);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline-secondary {
  background: transparent;
  border: 1.5px solid var(--color-border);
  color: var(--color-text-2);
}

.btn-outline-secondary:hover {
  background: var(--color-surface2);
  border-color: var(--color-text-3);
  color: var(--color-text);
}

.btn-outline-primary {
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--color-primary-ghost);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-outline-danger {
  border: 1.5px solid #fca5a5;
  color: var(--color-danger);
  background: transparent;
}

.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

.btn-success {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.btn-success:hover {
  filter: brightness(1.08);
  color: #fff;
}

.btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
  color: #fff;
}

.btn-danger:hover {
  filter: brightness(1.08);
  color: #fff;
}

.btn-info {
  background: var(--color-info);
  border-color: var(--color-info);
  color: #fff;
}

.btn-info:hover {
  filter: brightness(1.08);
  color: #fff;
}

.btn-secondary {
  background: var(--color-surface2);
  border-color: var(--color-border);
  color: var(--color-text-2);
}

.btn-secondary:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  border-radius: var(--r-sm);
}

.btn-lg {
  padding: 0.85rem 1.5rem;
  font-size: 1.05rem;
}

.btn:disabled {
  opacity: 0.55;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

/* ─── Badges ─── */
.badge {
  font-weight: 600;
  border-radius: var(--r-sm);
  padding: 0.3em 0.65em;
  font-size: 0.78rem;
}

.bg-primary {
  background: var(--color-primary) !important;
}

.bg-secondary {
  background: var(--color-text-3) !important;
}

.bg-success {
  background: var(--color-success) !important;
}

.bg-warning {
  background: var(--color-warning) !important;
}

.bg-danger {
  background: var(--color-danger) !important;
}

/* ─── Status Badges ─── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.28rem 0.75rem;
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.status-pending {
  background: #fef3c7;
  color: #92400e;
}

.status-confirmed {
  background: #dbeafe;
  color: #1e40af;
}

.status-preparing {
  background: #ede9fe;
  color: #5b21b6;
}

.status-ready {
  background: #d1fae5;
  color: #065f46;
}

.status-assigned {
  background: #e0f2fe;
  color: #075985;
}

.status-in_transit {
  background: #fef3c7;
  color: #78350f;
}

.status-delivered {
  background: #d1fae5;
  color: #065f46;
}

.status-cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.status-picked_up {
  background: #e0f2fe;
  color: #075985;
}

.status-failed {
  background: #fecaca;
  color: #7f1d1d;
}


/* ═══════════════════════════════════════════════
   LOGIN PAGE
═══════════════════════════════════════════════ */
.login-page {
  min-height: 100vh;
  background: var(--color-bg);
  display: grid;
  place-items: center;
  padding: 1rem;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  top: -30%;
  left: -10%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -5%;
  width: 50%;
  height: 60%;
  background: radial-gradient(ellipse, rgba(168, 85, 247, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-xl);
}

.login-logo {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--color-primary), #a855f7);
  border-radius: var(--r-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.login-title {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--color-text) 50%, var(--color-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.35rem;
}

.login-subtitle {
  color: var(--color-text-3);
  font-size: 0.95rem;
  text-align: center;
  margin-bottom: 2rem;
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-text-3);
  font-size: 0.8rem;
  margin: 1.5rem 0;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ═══════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR (dark, premium) ── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 200;
  transition: transform 0.28s var(--ease);
  will-change: transform;
  /* subtle inner glow */
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.25);
}

/* decorative gradient orb */
.sidebar::before {
  content: '';
  position: absolute;
  top: -80px;
  left: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(91, 94, 244, 0.2) 0%, transparent 65%);
  pointer-events: none;
  border-radius: 50%;
}

.sidebar-brand {
  padding: 1.35rem 1.25rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #7476fa, #a78bfa);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  box-shadow: 0 4px 14px rgba(116, 118, 250, 0.45);
  flex-shrink: 0;
}

.sidebar-brand-text {
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: -0.03em;
}

.sidebar-brand-sub {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
}

.sidebar-nav::-webkit-scrollbar {
  width: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 99px;
}

.nav-section {
  margin-bottom: 1.6rem;
}

.nav-item-header {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.3);
  padding: 0 0.75rem;
  margin-bottom: 0.4rem;
}

.nav-link-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  color: var(--sidebar-text);
  border-radius: var(--r-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-link-item .bi {
  font-size: 1rem;
  width: 1.2rem;
  text-align: center;
  flex-shrink: 0;
}

.nav-link-item:hover {
  background: var(--sidebar-hover);
  color: rgba(255, 255, 255, 0.95);
}

.nav-link-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text-active);
  font-weight: 600;
}

.nav-link-item.active .bi {
  color: #a5a8fd;
}

.nav-link-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--color-primary-s);
  border-radius: 0 3px 3px 0;
}

.nav-link-item .badge {
  margin-left: auto;
  font-size: 0.65rem;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.9rem 0.75rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--r-md);
  cursor: pointer;
  transition: var(--transition);
}

.sidebar-user:hover {
  background: var(--sidebar-hover);
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.2;
}

.sidebar-user-role {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ── TOPBAR ── */
.topbar {
  height: 58px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 1.75rem 0 1.5rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--color-border), 0 2px 8px rgba(17, 24, 39, 0.04);
}

.topbar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  flex: 1;
}

.topbar-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--color-success);
  font-weight: 600;
}

.topbar-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 0 3px var(--color-success-bg);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    box-shadow: 0 0 0 3px var(--color-success-bg);
  }

  50% {
    box-shadow: 0 0 0 5px var(--color-success-bg);
  }
}

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-width: 0;
}

.page-content {
  flex: 1;
  padding: 1.75rem 1.75rem;
  max-width: 1400px;
  width: 100%;
}



/* ── Logout & Mobile ── */
#logout-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.4);
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
  cursor: pointer;
  margin-left: auto;
}

#logout-btn:hover {
  background: rgba(240, 62, 62, 0.15);
  color: #ff6b6b;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.sidebar-user-name {
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.7rem;
  text-transform: capitalize;
}

#menu-toggle {
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  color: var(--color-text-2);
  border-radius: var(--r-sm);
  width: 36px;
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

#menu-toggle:hover {
  background: var(--color-surface3);
  color: var(--color-text);
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 150;
  backdrop-filter: blur(4px);
}

.conn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-success);
  display: inline-block;
}

/* ═══════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.03em;
}

.page-header-sub {
  font-size: 0.85rem;
  color: var(--color-text-3);
  margin-top: 2px;
  font-weight: 400;
}

/* ═══════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════ */
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: 1.4rem 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: flex-start;
  gap: 1.1rem;
  transition: box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  opacity: 0;
  transition: opacity 0.2s;
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card:hover::after {
  opacity: 1;
}

.stat-card.primary::after {
  background: var(--color-primary);
}

.stat-card.success::after {
  background: var(--color-success);
}

.stat-card.warning::after {
  background: var(--color-warning);
}

.stat-card.danger::after {
  background: var(--color-danger);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.stat-icon.purple {
  background: var(--color-primary-ghost);
  color: var(--color-primary);
}

.stat-icon.green {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.stat-icon.orange {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.stat-icon.red {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.stat-icon.blue {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.stat-info {
  min-width: 0;
  flex: 1;
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--color-text-3);
  font-weight: 500;
  margin-top: 4px;
}

.stat-delta {
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.stat-delta.up {
  color: var(--color-success);
}

.stat-delta.down {
  color: var(--color-danger);
}

/* ═══════════════════════════════════════════════
   TABLE CARDS
═══════════════════════════════════════════════ */
.table-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--color-surface);
}

.table-card-title {
  font-weight: 700;
  color: var(--color-text);
  font-size: 0.9rem;
}

.table {
  margin: 0;
  width: 100%;
}

.table thead th {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-text-3);
  background: var(--color-surface2);
  padding: 0.7rem 1.25rem;
  border: none;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table td {
  padding: 0.85rem 1.25rem;
  vertical-align: middle;
  color: var(--color-text);
  font-size: 0.875rem;
  border: none;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.4;
}

.table tr:last-child td {
  border-bottom: none;
}

.table-hover>tbody>tr {
  transition: background var(--duration) var(--ease);
}

.table-hover>tbody>tr:hover>* {
  background: var(--color-surface2) !important;
}



/* ═══════════════════════════════════════════════
   POS NEW ORDER TERMINAL
═══════════════════════════════════════════════ */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 1.5rem;
  height: calc(100vh - 115px);
}

.pos-products {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-products-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.pos-search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.pos-search input {
  padding-left: 2.5rem;
  height: 36px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface2);
  font-size: 0.875rem;
  width: 100%;
}

.pos-search input:focus {
  background: var(--color-surface);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
  outline: none;
}

.pos-search .bi {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-3);
  pointer-events: none;
  font-size: 0.85rem;
}

.pos-category-tabs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  scrollbar-width: none;
}

.pos-category-tabs::-webkit-scrollbar {
  display: none;
}

.pos-cat-btn {
  padding: 0.4rem 1rem;
  border-radius: var(--r-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-2);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.pos-cat-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.pos-cat-btn:not(.active):hover {
  background: var(--color-surface2);
  color: var(--color-text);
  border-color: var(--color-text-3);
}

.pos-product-grid {
  overflow-y: auto;
  padding: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: min-content;
  gap: 0.85rem;
  flex: 1;
  background: var(--color-bg);
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

/* Grid column overrides */
.pos-product-grid.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ── Product Card (reference design) ── */
.product-card {
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-lg);
  background: var(--color-surface);
  box-shadow: var(--shadow-xs);
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  overflow: hidden;
}

.product-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light, #a5b4fc);
  transform: translateY(-2px);
}

.product-card.in-cart {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.product-card.out-of-stock {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.8);
}

/* Checkmark badge (shown when item is in cart) */
.product-card-check {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  font-size: 1.25rem;
  color: #10b981;
  filter: drop-shadow(0 1px 3px rgba(16, 185, 129, 0.4));
}

/* Image area */
.product-card-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--color-surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.product-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.6rem;
}

.product-card-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--color-text-3);
}

/* Stock badge over image */
.product-card-stock-badge {
  position: absolute;
  bottom: 0.35rem; /* slightly closer to edge */
  left: 0.35rem;
  font-size: 0.55rem; /* reduced from 0.62rem */
  font-weight: 700;
  padding: 0.08rem 0.35rem; /* reduced padding */
  border-radius: var(--r-full);
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* very subtle shadow */
}

.product-card-stock-badge .stock-icon {
  font-size: 0.5rem; /* even smaller icon */
  margin-right: 1px;
  vertical-align: middle;
}

.product-card-stock-badge.ok {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.product-card-stock-badge.low {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.product-card-stock-badge.zero {
  background: rgba(239, 68, 68, 0.12);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Body */
.product-card-body {
  padding: 0.55rem 0.65rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.product-card-category {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #f59e0b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
}

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  flex-wrap: nowrap;
}

.product-card-price {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-text);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Quantity controls */
.card-qty-controls {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.card-qty-btn {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface2);
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1;
  padding: 0;
  flex-shrink: 0;
}

.card-qty-btn:hover:not(:disabled) {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.card-qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.card-qty-num {
  font-size: 0.8rem;
  font-weight: 700;
  min-width: 16px;
  text-align: center;
  color: var(--color-text);
}

/* POS Cart */
.pos-cart {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pos-cart-header {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pos-cart-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-count {
  background: var(--color-primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--r-full);
  min-width: 1.25rem;
  text-align: center;
}

.cart-items {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--color-bg);
  scrollbar-width: thin;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: background var(--duration);
}

.cart-item:hover {
  background: var(--color-surface2);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-name {
  flex: 1;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--r-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
}

.qty-btn:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.qty-val {
  font-weight: 700;
  font-size: 0.9rem;
  min-width: 1.5rem;
  text-align: center;
  color: var(--color-text);
}

.cart-item-subtotal {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
  min-width: 80px;
  text-align: right;
}

.cart-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  color: var(--color-text-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: center;
}

.cart-empty .bi {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.cart-empty p {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0;
}

.cart-empty small {
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.pos-cart-footer {
  padding: 1.25rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.cart-totals {
  margin-bottom: 1.25rem;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.2rem 0;
}

.cart-line-label {
  font-size: 0.85rem;
  color: var(--color-text-2);
}

.cart-line-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.cart-total-big {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--color-border);
}

.cart-total-big .label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}

.cart-total-big .amount {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-text);
  letter-spacing: -0.04em;
}

.btn-checkout {
  width: 100%;
  padding: 1rem;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-primary);
}

.btn-checkout:hover {
  background: var(--color-primary-h);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

.btn-checkout:active {
  transform: scale(0.98);
}

.btn-checkout:disabled {
  background: var(--color-border);
  color: var(--color-text-3);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* ═══════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════ */
.modal-dialog {
  max-width: 540px;
}

.modal-dialog.modal-lg {
  max-width: 720px;
}

.modal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.modal-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 1.25rem 1.5rem;
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.modal-body {
  padding: 1.5rem;
  background: var(--color-surface);
  color: var(--color-text);
}

.modal-footer {
  background: var(--color-surface2);
  border-top: 1px solid var(--color-border);
  padding: 1rem 1.5rem;
  gap: 0.5rem;
}

.btn-close {
  opacity: 0.4;
  transition: var(--transition);
}

.btn-close:hover {
  opacity: 1;
}

/* ═══════════════════════════════════════════════
   TOASTS
═══════════════════════════════════════════════ */
.toast-container {
  z-index: 1080;
}

.toast {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-xl);
  min-width: 300px;
  font-family: 'Inter', sans-serif;
  animation: toastIn 0.3s var(--ease);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

.toast-body {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}

.toast-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════
   TOPBAR FIX — prevent double title
═══════════════════════════════════════════════ */
.page-content {
  padding: 1.5rem 1.75rem 1.75rem;
  flex: 1;
}

/* ═══════════════════════════════════════════════
   DASHBOARD WELCOME BAR
═══════════════════════════════════════════════ */
.dash-welcome {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.dash-greeting {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin-bottom: 2px;
}

.dash-date {
  color: var(--color-text-3);
  font-size: 0.88rem;
  font-weight: 500;
  margin: 0;
}

/* ═══════════════════════════════════════════════
   KPI CARDS
═══════════════════════════════════════════════ */
.kpi-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--kpi-accent, var(--color-primary));
  border-radius: var(--r-lg) 0 0 var(--r-lg);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.kpi-card-body {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.kpi-icon.purple {
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
}

.kpi-icon.green {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.kpi-icon.orange {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.kpi-icon.red {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-text);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--color-text-3);
  font-weight: 600;
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-sub {
  font-size: 0.82rem;
  color: var(--color-text-2);
  font-weight: 500;
  padding-left: 0.25rem;
  border-top: 1px solid var(--color-border);
  padding-top: 0.65rem;
  margin-left: -0.25rem;
}

@media (max-width: 480px) {
  .kpi-card {
    padding: 1rem;
  }

  .kpi-value {
    font-size: 1.2rem;
  }

  .kpi-card::before {
    display: none;
  }

  .kpi-card-body {
    gap: 0.75rem;
  }

  .kpi-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
  }
}

/* ═══════════════════════════════════════════════
   PAGE HEADER
═══════════════════════════════════════════════ */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.page-header-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--color-text);
  margin: 0;
}

.page-header-sub {
  color: var(--color-text-3);
  font-size: 0.88rem;
  font-weight: 500;
  margin: 3px 0 0 0;
}

/* ═══════════════════════════════════════════════
   TOOLBAR / FILTER BAR
═══════════════════════════════════════════════ */
.toolbar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

/* Toolbar element sizing */
.toolbar-search {
  flex: 1 1 160px;
  min-width: 0;
}

.toolbar-select {
  flex: 0 1 160px;
  min-width: 120px;
}

.toolbar-select-sm {
  flex: 0 1 110px;
  min-width: 90px;
}

.toolbar-date {
  flex: 0 1 150px;
  min-width: 120px;
}

.toolbar .form-select,
.toolbar .form-control {
  min-height: 36px;
  height: 36px;
  line-height: 1.5;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  font-size: 0.875rem;
  box-sizing: border-box;
}

.toolbar .btn {
  height: 36px;
  flex-shrink: 0;
  padding: 0 0.7rem;
}

@media (max-width: 768px) {
  .toolbar-filters {
    flex-wrap: wrap;
  }

  .toolbar-search {
    flex: 1 1 100%;
  }

  .toolbar-select {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .toolbar-select-sm {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .toolbar-date {
    flex: 1 1 calc(50% - 0.25rem);
  }
}


/* ═══════════════════════════════════════════════
   TABLE FOOTER / PAGINATION
═══════════════════════════════════════════════ */
.table-footer {
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface2);
  font-size: 0.85rem;
  color: var(--color-text-3);
}

.table-footer .btn {
  height: 32px;
  font-size: 0.82rem;
}

/* ═══════════════════════════════════════════════
   EMPTY STATES
═══════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.empty-state-icon {
  font-size: 3rem;
  opacity: 0.3;
  margin-bottom: 1rem;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text-2);
  margin-bottom: 0.35rem;
}

.empty-state-sub {
  font-size: 0.875rem;
  color: var(--color-text-3);
}

/* ═══════════════════════════════════════════════
   STOCK PILL BADGES
═══════════════════════════════════════════════ */
.stock-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.2rem 0.6rem;
  border-radius: var(--r-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.stock-pill.ok {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
}

.stock-pill.low {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
}

.stock-pill.zero {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-danger);
}

@media print {

  .sidebar,
  .topbar,
  .no-print,
  .btn {
    display: none !important;
  }

  .main-content {
    margin-left: 0 !important;
  }

  * {
    color: #000 !important;
    background: #fff !important;
  }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .pos-layout {
    grid-template-columns: 1fr 350px;
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 280px;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-xl);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-overlay.show {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  #menu-toggle {
    display: flex;
  }

  .topbar {
    padding: 0.9rem 1rem;
  }

  .page-content {
    padding: 1rem;
  }

  .pos-layout {
    grid-template-columns: 1fr;
    height: auto;
  }

  .pos-products {
    height: 55vh;
  }

  .pos-cart {
    min-height: 50vh;
    border-top: 2px solid var(--color-primary);
    border-radius: var(--r-lg);
  }

  .pos-product-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
  }

  .stat-card {
    padding: 1.1rem;
    gap: 0.9rem;
  }

  .stat-value {
    font-size: 1.35rem;
  }

  .table td,
  .table th {
    padding: 0.75rem 1rem;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 1.75rem 1.25rem;
    border-radius: var(--r-xl);
  }

  .pos-product-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .modal-dialog {
    margin: 0.5rem;
    max-width: calc(100% - 1rem);
  }

  .table td {
    font-size: 0.82rem;
    padding: 0.65rem 0.85rem;
  }

  .stat-card {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ═══════════════════════════════════════════════
   UTILITY CLASSES
═══════════════════════════════════════════════ */
.text-primary {
  color: var(--color-primary) !important;
}

.text-muted,
.text-secondary {
  color: var(--color-text-3) !important;
}

.bg-light {
  background: var(--color-surface2) !important;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.fw-800 {
  font-weight: 800;
}

.text-xs {
  font-size: 0.78rem;
}

.text-sm {
  font-size: 0.88rem;
}

.cursor-pointer {
  cursor: pointer;
}

.rounded-xl {
  border-radius: var(--r-xl);
}

.border-color {
  border-color: var(--color-border) !important;
}

/* Skeleton loading */
@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

.skeleton {
  background: linear-gradient(90deg, var(--color-surface2) 25%, var(--color-border) 50%, var(--color-surface2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-sm);
  color: transparent !important;
}

.skeleton * {
  visibility: hidden !important;
}

/* Section divider */
.section-header {
  margin-bottom: 1.5rem;
}

.section-header h2 {
  font-size: 1.35rem;
  letter-spacing: -0.025em;
}

.section-header p {
  color: var(--color-text-3);
  font-size: 0.9rem;
  margin: 0;
}

/* ═══════════════════════════════════════════════
   LIVREUR PWA — Mobile-First Delivery Interface
═══════════════════════════════════════════════ */

/* ── Welcome Banner ── */
.dvr-welcome {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #16163a, #1e1e4a);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dvr-welcome-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.dvr-welcome-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(91, 94, 244, 0.3);
}

.dvr-welcome-greeting {
  font-size: 0.95rem;
  line-height: 1.2;
}

.dvr-welcome-greeting strong {
  color: #fff;
  font-weight: 700;
}

.dvr-welcome-role {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 2px;
}

.dvr-welcome-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: right;
}

/* ── Header ── */
.dvr-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin: -1.75rem -1.75rem 0;
  padding: 0;
}

.dvr-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.75rem;
}

.dvr-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
  letter-spacing: -0.03em;
}

.dvr-subtitle {
  font-size: 0.8rem;
  color: var(--color-text-3);
  margin: 2px 0 0;
}

.dvr-refresh-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--color-text-2);
  cursor: pointer;
  transition: var(--transition);
}

.dvr-refresh-btn:hover {
  background: var(--color-primary-ghost);
  color: var(--color-primary);
}

/* ── Filter Tabs ── */
.dvr-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0 1.25rem;
  scrollbar-width: none;
  border-top: 1px solid var(--color-border);
}

.dvr-tabs::-webkit-scrollbar {
  display: none;
}

.dvr-tab {
  padding: 0.6rem 1rem;
  background: none;
  border: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-3);
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  transition: var(--transition);
}

.dvr-tab:hover {
  color: var(--color-text-2);
}

.dvr-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ── Card List ── */
.dvr-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 0;
}

/* ── Delivery Card ── */
.dvr-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: 1rem 1.15rem;
  cursor: pointer;
  transition: box-shadow 0.18s, border-color 0.18s, transform 0.15s;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.dvr-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-primary);
  border-radius: 4px 0 0 4px;
}

.dvr-card.dvr-card-done::before {
  background: var(--color-success);
}

.dvr-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
  transform: translateY(-1px);
}

.dvr-card.dvr-card-done {
  opacity: 0.72;
}

.dvr-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.dvr-card-number {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-primary);
  display: block;
}

.dvr-card-type {
  font-size: 0.72rem;
  color: var(--color-text-3);
  margin-top: 1px;
  display: block;
}

.dvr-card-customer,
.dvr-card-phone,
.dvr-card-address {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.855rem;
  color: var(--color-text-2);
  margin-bottom: 0.3rem;
  line-height: 1.4;
}

.dvr-card-customer .bi,
.dvr-card-phone .bi,
.dvr-card-address .bi {
  font-size: 0.8rem;
  color: var(--color-text-3);
  margin-top: 3px;
  flex-shrink: 0;
}

.dvr-card-phone a {
  color: var(--color-info);
  font-weight: 600;
}

.dvr-card-customer {
  font-weight: 600;
  color: var(--color-text);
}

.dvr-card-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--color-border);
  flex-wrap: wrap;
}

.dvr-card-total {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--color-text);
}

.dvr-card-date {
  font-size: 0.75rem;
  color: var(--color-text-3);
  flex: 1;
}

.dvr-card-cta {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ── Empty state ── */
.dvr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3rem 1rem;
  text-align: center;
  color: var(--color-text-3);
}

.dvr-empty-icon {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

/* ── Skeleton ── */
.skeleton-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: 1rem 1.15rem;
}

/* ── Action Modal ── */
.dvr-modal {
  border-radius: var(--r-xl);
  overflow: hidden;
  border: none;
  box-shadow: var(--shadow-xl);
}

.dvr-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.dvr-modal-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text);
  margin: 0;
}

.dvr-modal-order {
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 700;
  margin-top: 2px;
}

.dvr-modal-close {
  background: var(--color-surface2);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-2);
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: var(--transition);
}

.dvr-modal-close:hover {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.dvr-modal-body {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* Order info inside modal */
.dvr-order-info {
  background: var(--color-surface2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  padding: 0.85rem 1rem;
  margin-bottom: 1.25rem;
}

.dvr-info-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.85rem;
  color: var(--color-text-2);
  margin-bottom: 0.35rem;
}

.dvr-info-row:last-child {
  margin-bottom: 0;
}

.dvr-info-row .bi {
  font-size: 0.8rem;
  color: var(--color-text-3);
  margin-top: 3px;
  flex-shrink: 0;
}

.dvr-info-row a {
  color: var(--color-info);
  font-weight: 600;
}

.dvr-modal-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-text-2);
  margin-bottom: 0.6rem;
}

.dvr-notes-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-2);
  display: flex;
  align-items: center;
}

/* ── 3 Action Buttons ── */
.dvr-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.dvr-action-btn {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: var(--r-md);
  border: 1.5px solid;
  background: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.12s, box-shadow 0.15s;
  text-align: left;
}

.dvr-action-btn:hover {
  transform: translateX(3px);
}

.dvr-action-btn:active {
  transform: scale(0.98);
}

.dvr-action-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.dvr-action-btn.delivered {
  border-color: rgba(18, 184, 134, 0.35);
  background: rgba(18, 184, 134, 0.05);
}

.dvr-action-btn.delivered:hover:not(:disabled) {
  background: rgba(18, 184, 134, 0.12);
  box-shadow: 0 4px 14px rgba(18, 184, 134, 0.18);
}

.dvr-action-btn.delivered .dvr-action-icon {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.dvr-action-btn.return {
  border-color: rgba(77, 171, 247, 0.35);
  background: rgba(77, 171, 247, 0.05);
}

.dvr-action-btn.return:hover:not(:disabled) {
  background: rgba(77, 171, 247, 0.12);
  box-shadow: 0 4px 14px rgba(77, 171, 247, 0.18);
}

.dvr-action-btn.return .dvr-action-icon {
  background: var(--color-info-bg);
  color: var(--color-info);
}

.dvr-action-btn.failed {
  border-color: rgba(240, 62, 62, 0.3);
  background: rgba(240, 62, 62, 0.04);
}

.dvr-action-btn.failed:hover:not(:disabled) {
  background: rgba(240, 62, 62, 0.1);
  box-shadow: 0 4px 14px rgba(240, 62, 62, 0.15);
}

.dvr-action-btn.failed .dvr-action-icon {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.dvr-action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.dvr-action-text {
  flex: 1;
}

.dvr-action-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-text);
}

.dvr-action-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--color-text-3);
  margin-top: 1px;
}

.dvr-action-arrow {
  font-size: 0.75rem;
  color: var(--color-text-3);
  flex-shrink: 0;
}

/* ── Responsive: tablet/desktop ── */
@media (min-width: 640px) {
  .dvr-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .dvr-header {
    margin: -1.75rem -1.75rem 0;
  }
}

@media (min-width: 1024px) {
  .dvr-list {
    grid-template-columns: repeat(3, 1fr);
  }

  .dvr-actions {
    flex-direction: row;
  }

  .dvr-action-btn {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }

  .dvr-action-arrow {
    display: none;
  }
}

/* ─── Notification Bell ─── */
.notif-bell-wrap {
  position: relative;
}

.notif-bell-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--color-text-2);
  position: relative;
  transition: background 0.15s, color 0.15s;
}

.notif-bell-btn:hover {
  background: var(--color-surface2);
  color: var(--color-primary);
}

.notif-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  background: var(--color-danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  z-index: 1050;
  overflow: hidden;
}

.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: 0.88rem;
}

.notif-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--color-primary);
  padding: 0;
}

.notif-clear-btn:hover { text-decoration: underline; }

.notif-list {
  max-height: 360px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  transition: background 0.1s;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover { background: var(--color-surface2); }

.notif-unread { background: var(--color-primary-ghost); }

.notif-icon {
  font-size: 1rem;
  color: var(--color-primary);
  margin-top: 2px;
  flex-shrink: 0;
}

.notif-body { flex: 1; min-width: 0; }

.notif-msg {
  font-size: 0.83rem;
  color: var(--color-text-1);
  line-height: 1.4;
}

.notif-time {
  font-size: 0.72rem;
  color: var(--color-text-3);
  margin-top: 2px;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2rem 1rem;
  color: var(--color-text-3);
  font-size: 0.85rem;
}

.notif-empty i { font-size: 1.5rem; }

/* Responsive — mobile full-width dropdown */
@media (max-width: 575.98px) {
  .notif-dropdown {
    position: fixed;
    top: 58px;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    border-top: none;
    border-left: none;
    border-right: none;
  }
  .notif-list {
    max-height: calc(100svh - 180px);
  }
}

/* Push permission modal icon */
.push-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-primary-ghost, rgba(99,102,241,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
