/* ============================================================
   JD DUHOK POS — Design System
   ============================================================ */

:root {
  /* ── Brand & Semantic Palette ── */
  --primary:        #0e94a8;
  --primary-dark:   #0b7484;
  --primary-light:  #22b8cc;
  --primary-50:     #eafbfc;
  --primary-100:    #cdf3f6;

  --accent:  #f59e0b;
  --success: #10b981;
  --success-dark: #059669;
  --danger:  #ef4444;
  --danger-dark: #dc2626;
  --warning: #f59e0b;
  --info:    #0ea5e9;

  /* ── Neutrals ── */
  --gray-50:  #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e6e9f0;
  --gray-300: #d8dce6;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --bg:        #f5f6fb;
  --card-bg:   #ffffff;
  --text:      #1a2233;
  --text-muted:#64748b;
  --border:    #e6e9f2;

  /* ── Sidebar ── */
  --sidebar-w: 240px;
  --sidebar-bg: linear-gradient(190deg, #131a2e 0%, #0c1120 100%);
  --sidebar-text: #94a1c2;
  --sidebar-active: #22b8cc;
  --sidebar-hover: rgba(255,255,255,.06);
  --topbar-h: 64px;

  /* ── Scale ── */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;

  --shadow-xs: 0 1px 2px rgba(15,23,42,.05);
  --shadow-sm: 0 1px 3px rgba(15,23,42,.06), 0 1px 2px rgba(15,23,42,.05);
  --shadow:    0 6px 16px rgba(15,23,42,.06), 0 2px 6px rgba(15,23,42,.05);
  --shadow-md: 0 12px 28px rgba(15,23,42,.10), 0 3px 8px rgba(15,23,42,.05);
  --shadow-lg: 0 24px 48px rgba(15,23,42,.16);
}

/* ============================================================
   Reskin Bootstrap's own color system so every existing
   .btn-*, .text-*, .bg-*-subtle, .border-*-subtle utility
   picks up the new palette automatically — no markup changes.
   ============================================================ */
:root {
  --bs-primary: #0e94a8;
  --bs-primary-rgb: 14, 148, 168;
  --bs-primary-text-emphasis: #0b7484;
  --bs-primary-bg-subtle: #eafbfc;
  --bs-primary-border-subtle: #9de6ec;

  --bs-success: #10b981;
  --bs-success-rgb: 16, 185, 129;
  --bs-success-text-emphasis: #065f46;
  --bs-success-bg-subtle: #ecfdf5;
  --bs-success-border-subtle: #a7f3d0;

  --bs-danger: #ef4444;
  --bs-danger-rgb: 239, 68, 68;
  --bs-danger-text-emphasis: #991b1b;
  --bs-danger-bg-subtle: #fef2f2;
  --bs-danger-border-subtle: #fecaca;

  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245, 158, 11;
  --bs-warning-text-emphasis: #92400e;
  --bs-warning-bg-subtle: #fffbeb;
  --bs-warning-border-subtle: #fde68a;

  --bs-info: #0ea5e9;
  --bs-info-rgb: 14, 165, 233;
  --bs-info-text-emphasis: #075985;
  --bs-info-bg-subtle: #f0f9ff;
  --bs-info-border-subtle: #bae6fd;

  --bs-secondary: #64748b;
  --bs-secondary-rgb: 100, 116, 139;
  --bs-secondary-text-emphasis: #334155;
  --bs-secondary-bg-subtle: #f1f5f9;
  --bs-secondary-border-subtle: #e2e8f0;

  --bs-body-font-family: 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: .9rem;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); }
::selection { background: var(--primary-100); color: var(--primary-dark); }

/* ── Brand wordmark ── */
.brand-font {
  font-family: 'Poppins', 'Inter', sans-serif;
  font-weight: 700;
  letter-spacing: -.01em;
}

/* ── Custom scrollbar ── */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); background-clip: padding-box; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); }

:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }

/* ── SIDEBAR ── */
.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex; flex-direction: column;
  overflow-y: auto; z-index: 1040;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
  box-shadow: 4px 0 24px rgba(0,0,0,.12);
}
.sidebar-brand {
  display: flex; flex-direction: column; gap: 2px;
  padding: 20px 20px 10px;
  color: #fff; font-size: 1.1rem; font-weight: 700;
  letter-spacing: -.01em;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.sidebar-brand-row { display: flex; align-items: center; gap: 12px; }
.sidebar-slogan {
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic; font-weight: 400;
  font-size: .74rem; letter-spacing: .02em;
  color: rgba(255,255,255,.55);
}
.sidebar-brand i {
  font-size: 1.15rem; color: #fff;
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 4px 14px rgba(34,184,204,.4);
}
.sidebar-nav { list-style: none; padding: 6px 12px; flex: 1; margin: 0; }
.sidebar-nav .nav-label {
  color: #576089; font-size: .66rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase;
  padding: 16px 10px 8px;
}
.sidebar-nav .nav-label:first-child { padding-top: 6px; }
.sidebar-nav li { margin-bottom: 2px; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; color: var(--sidebar-text);
  text-decoration: none; border-radius: 10px;
  transition: background .15s ease, color .15s ease;
  font-size: .855rem; font-weight: 500;
  position: relative;
}
.sidebar-nav a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav a.active {
  background: linear-gradient(90deg, rgba(34,184,204,.18), rgba(34,184,204,.05));
  color: #fff;
  font-weight: 600;
}
.sidebar-nav a.active::before {
  content: ''; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 0 4px 4px 0;
  background: var(--sidebar-active);
}
.sidebar-nav a i { font-size: 1.02rem; width: 18px; text-align: center; }

/* ── SIDEBAR EXPANDABLE GROUP ── */
.nav-group-toggle { cursor: pointer; }
.nav-group-toggle .submenu-caret { font-size: .75rem; transition: transform .2s ease; margin-left: auto; }
.nav-group-toggle[aria-expanded="true"] .submenu-caret { transform: rotate(180deg); }
.sidebar-submenu { list-style: none; margin: 2px 0 4px; padding: 0 0 0 30px; }
.sidebar-submenu li { margin-bottom: 2px; }
.sidebar-submenu a {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; color: var(--sidebar-text);
  text-decoration: none; border-radius: 8px;
  font-size: .82rem; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.sidebar-submenu a:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-submenu a.active {
  background: linear-gradient(90deg, rgba(34,184,204,.18), rgba(34,184,204,.05));
  color: #fff; font-weight: 600;
}

/* ── MAIN ── */
.main-content {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .3s cubic-bezier(.4,0,.2,1);
}
.main-content.sidebar-collapsed { margin-left: 0; }

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 100;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
#sidebarToggle {
  border-radius: 9px; border-color: var(--border); color: var(--gray-600);
}
#sidebarToggle:hover { background: var(--gray-100); }

/* ── PAGE BODY ── */
.page-body { padding: 26px; flex: 1; max-width: 1440px; width: 100%; margin: 0 auto; }
.page-header { margin-bottom: 24px; }
.page-header h1 { font-size: 1.45rem; font-weight: 700; color: var(--text); letter-spacing: -.02em; }
.page-header p { color: var(--text-muted); font-size: .85rem; margin-top: 3px; }

/* ── CARDS ── */
.card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 15px 20px; border-bottom: 1px solid var(--border);
  font-weight: 600; background: transparent; font-size: .9rem;
}
.card-footer { background: transparent; border-top: 1px solid var(--border); }

/* Interactive cards get a lift on hover */
.customer-card:hover, .product-card:hover, .stat-card:hover {
  transform: translateY(-2px);
}

/* ── STAT CARDS ── */
.stat-card {
  background: var(--card-bg); border-radius: var(--radius);
  padding: 20px 22px; display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 50px; height: 50px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem; flex-shrink: 0;
}
.stat-info .value { font-size: 1.55rem; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; }
.stat-info .label { color: var(--text-muted); font-size: .78rem; margin-top: 4px; font-weight: 500; }

/* ── BUTTONS ── */
.btn {
  border-radius: 10px; font-weight: 500; font-size: .85rem;
  padding: .5rem 1rem; transition: all .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-sm { border-radius: 8px; }

.btn-primary {
  background: var(--primary); border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(14,148,168,.25);
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary-dark); border-color: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(14,148,168,.35);
}
.btn-success { background: var(--success); border-color: var(--success); }
.btn-success:hover { background: var(--success-dark); border-color: var(--success-dark); }
.btn-danger { background: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-dark); border-color: var(--danger-dark); }

.btn-outline-primary { color: var(--primary); border-color: var(--primary-100); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-outline-secondary { color: var(--gray-600); border-color: var(--border); }
.btn-outline-secondary:hover { background: var(--gray-100); border-color: var(--gray-300); color: var(--text); }
.btn-outline-danger { color: var(--danger); border-color: #fecaca; }
.btn-outline-danger:hover { background: var(--danger); border-color: var(--danger); }
.btn-outline-success { color: var(--success); border-color: #a7f3d0; }
.btn-outline-success:hover { background: var(--success); border-color: var(--success); }

/* ── TABLES ── */
.table { font-size: .875rem; margin-bottom: 0; }
.table thead th {
  background: var(--gray-50); font-weight: 600; font-size: .72rem;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: var(--primary-50); }
.table td, .table th { vertical-align: middle; padding: 12px 16px; border-color: var(--border); }
.table > :not(caption) > * > * { box-shadow: none; }

/* ── FORMS ── */
.form-control, .form-select {
  border-radius: 10px; border-color: var(--border);
  font-size: .875rem; padding: .55rem .8rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-light); box-shadow: 0 0 0 3.5px rgba(14,148,168,.12);
}
.form-label { font-weight: 600; font-size: .82rem; margin-bottom: 6px; color: var(--gray-700); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 3.5px rgba(14,148,168,.12); }
.form-switch .form-check-input { cursor: pointer; }

/* ── BADGES ── */
.badge { font-weight: 600; font-size: .71rem; border-radius: 20px; padding: .4em .75em; letter-spacing: .01em; }

/* ── ALERTS ── */
.alert { border-radius: var(--radius-sm); border: 1px solid transparent; font-size: .85rem; }

/* ── NAV TABS ── */
.nav-tabs { border-bottom: 1px solid var(--border); }
.nav-tabs .nav-link {
  color: var(--text-muted); font-size: .85rem; font-weight: 500;
  padding: 9px 18px; border: none; border-bottom: 2px solid transparent;
  border-radius: 0; transition: color .15s ease;
}
.nav-tabs .nav-link.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); background: transparent; }
.nav-tabs .nav-link:hover:not(.active) { color: var(--text); border-bottom-color: var(--gray-200); }

/* ── PAGINATION ── */
.pagination .page-link { border-color: var(--border); color: var(--text-muted); border-radius: 8px; margin: 0 2px; font-size: .82rem; }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ── MODALS ── */
.modal-content { border-radius: var(--radius-lg); border: none; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.modal-footer { border-top: 1px solid var(--border); padding: 16px 22px; }
.modal-body { padding: 22px; }
.modal-title { font-weight: 700; font-size: 1.05rem; }

/* ── LOGIN PAGE — split screen: branded panel + form panel ── */
.login-page { min-height: 100vh; display: flex; }

/* Left: brand panel */
.login-brand {
  flex: 1 1 46%; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 64px 60px;
  background: radial-gradient(ellipse 80% 60% at 20% 0%, #0e3a42 0%, transparent 60%),
              radial-gradient(ellipse 70% 60% at 90% 100%, #0a2e35 0%, transparent 55%),
              linear-gradient(160deg, #0b0f1f 0%, #0f142b 55%, #0a0e1c 100%);
  color: #fff;
}
.login-brand-orbs { position: absolute; inset: 0; pointer-events: none; }
.login-brand-orbs::before, .login-brand-orbs::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(70px);
}
.login-brand-orbs::before {
  width: 420px; height: 420px; top: -120px; left: -100px;
  background: radial-gradient(circle, rgba(34,184,204,.35), transparent 70%);
  animation: orbDrift 11s ease-in-out infinite;
}
.login-brand-orbs::after {
  width: 380px; height: 380px; bottom: -140px; right: -80px;
  background: radial-gradient(circle, rgba(245,158,11,.16), transparent 70%);
  animation: orbDrift 13s ease-in-out infinite reverse;
}
.login-brand-content { position: relative; z-index: 1; max-width: 460px; animation: loginFadeUp .5s ease both; }
.login-brand-logo {
  font-size: 2.1rem; color: #fff;
  width: 72px; height: 72px; border-radius: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 10px 28px rgba(34,184,204,.45);
  margin-bottom: 26px;
  animation: logoPulse 3.5s ease-in-out infinite;
}
.login-brand-content h1 { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: 14px; }
.login-brand-content > p { color: rgba(255,255,255,.55); font-size: 1.02rem; line-height: 1.65; margin-bottom: 36px; }
.login-features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.login-features li {
  display: flex; align-items: center; gap: 13px;
  font-size: .93rem; font-weight: 500; color: rgba(255,255,255,.85);
  opacity: 0; animation: loginFadeUp .5s ease both;
}
.login-features li i {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); color: var(--primary-light); font-size: 1rem;
  transition: transform .2s ease, background .2s ease;
}
.login-features li:hover i { transform: scale(1.1) rotate(-4deg); background: rgba(255,255,255,.14); }
.login-brand-footer {
  position: relative; z-index: 1;
  color: rgba(255,255,255,.3); font-size: .78rem;
  margin-top: 52px;
}

/* Right: form panel */
.login-panel {
  flex: 1 1 54%; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 48px 32px;
}
.login-form-wrap { width: 100%; max-width: 460px; }
.login-mobile-logo {
  font-size: 1.6rem; color: #fff;
  width: 58px; height: 58px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 8px 22px rgba(34,184,204,.35);
  margin: 0 auto 24px;
  opacity: 0; animation: loginFadeUp .5s ease both, logoPulse 3.5s ease-in-out 1.2s infinite;
}
.login-form-header { margin-bottom: 32px; opacity: 0; animation: loginFadeUp .5s ease both; }
.login-form-header h2 { font-size: 1.8rem; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.login-form-header p { color: var(--text-muted); font-size: .95rem; margin-top: 6px; }
.login-form-wrap .form-label { font-weight: 600; font-size: .85rem; color: var(--text); }
.login-form-wrap .input-group-text { border-radius: 12px; color: var(--text-muted); font-size: 1.05rem; padding: .75rem .9rem; }
.login-form-wrap .form-control { border-radius: 12px; font-size: 1rem; padding: .75rem .9rem; }
.login-form-wrap .btn-primary {
  border-radius: 12px; font-weight: 600; letter-spacing: .01em;
  font-size: 1.02rem; padding: .85rem !important;
  transition: transform .15s ease, box-shadow .15s ease;
}
.login-form-wrap .btn-primary:hover { transform: translateY(-2px); }
.login-form-wrap .btn-primary:active { transform: translateY(0) scale(.98); }
.login-field { opacity: 0; animation: loginFadeUp .5s ease both; }
.login-footer-note { text-align: center; margin-top: 32px; color: var(--text-muted); font-size: .78rem; }

@keyframes loginFadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes orbDrift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50%      { transform: translate(24px, -18px) scale(1.06); }
}
@keyframes logoPulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(34,184,204,.45); }
  50%      { box-shadow: 0 12px 40px rgba(34,184,204,.7); }
}

@media (max-width: 991px) {
  .login-brand { display: none; }
  .login-panel { flex: 1 1 100%; min-height: 100vh; padding: 32px 20px; }
  .login-form-wrap { max-width: 420px; }
}
@media (max-width: 420px) {
  .login-form-wrap { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .login-brand-orbs::before, .login-brand-orbs::after,
  .login-brand-logo, .login-mobile-logo,
  .login-brand-content, .login-features li, .login-form-header, .login-field {
    animation: none !important; opacity: 1 !important;
  }
}

/* ── POS ── */
.pos-layout { display: grid; grid-template-columns: 1fr 380px; gap: 20px; height: calc(100vh - var(--topbar-h) - 52px); }
.pos-products { overflow-y: auto; }
.pos-cart { display: flex; flex-direction: column; overflow: hidden; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.product-card {
  background: var(--card-bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 12px; text-align: center;
  cursor: pointer; transition: all .18s ease; position: relative;
  box-shadow: var(--shadow-xs);
}
.product-card:hover { border-color: var(--primary-light); box-shadow: 0 0 0 4px rgba(14,148,168,.1), var(--shadow-sm); }
.product-card img { width: 70px; height: 70px; object-fit: cover; border-radius: 10px; margin-bottom: 8px; }
.product-card .p-name { font-weight: 600; font-size: .82rem; line-height: 1.3; }
.product-card .p-price { color: var(--primary); font-weight: 700; font-size: .9rem; margin-top: 4px; }
.product-card .p-stock { font-size: .72rem; color: var(--text-muted); }
.product-card.out-of-stock { opacity: .5; pointer-events: none; }

/* ── Expandable multi-level product card (name → category → size) ── */
/* Each click replaces the card's content with the next level, in place. */
.product-card.expanded {
  cursor: default; text-align: left;
  padding: 14px 16px;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 4px rgba(14,148,168,.1), var(--shadow-md);
}
.product-card.expanded .p-card-main { display: none; }
.product-card .variant-panel:empty { display: none; }
.product-card.expanded .variant-panel { animation: variantFadeIn .18s ease; }
@keyframes variantFadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

.variant-panel-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.variant-panel-title {
  font-weight: 700; font-size: .85rem; letter-spacing: -.01em;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.variant-close-btn {
  border: none; background: var(--gray-100); color: var(--text-muted);
  width: 22px; height: 22px; border-radius: 50%; line-height: 1; font-size: .9rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  flex-shrink: 0; transition: all .15s ease;
}
.variant-close-btn:hover { background: var(--danger); color: #fff; transform: rotate(90deg); }

.variant-step-label { font-size: .7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.variant-options { display: flex; flex-wrap: wrap; gap: 9px; }
.variant-options .btn {
  cursor: pointer; border-radius: 10px; font-weight: 600;
  border-width: 1.5px; transition: all .15s ease;
}
.variant-options .btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(14,148,168,.18); }
.variant-back-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.variant-back-row .badge { font-size: .74rem; padding: .45em .8em; }
.variant-back-row a { color: var(--primary); font-weight: 600; text-decoration: none; }
.variant-back-row a:hover { text-decoration: underline; }

/* Size buttons show the size + a stock count stacked */
.variant-size-btn {
  display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: 76px; padding: 10px 14px !important;
}
.variant-size-btn .size-label { font-weight: 700; font-size: .9rem; line-height: 1; }
.variant-size-btn .size-stock { font-size: .65rem; opacity: .7; font-weight: 500; line-height: 1; }
.variant-size-btn:disabled { opacity: .45; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px; }
.cart-item {
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  padding: 10px; border-bottom: 1px solid var(--border);
}
.cart-item-name {
  flex: 1 1 auto; min-width: 0; font-size: .82rem; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cart-item-qty { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.qty-btn { width: 24px; height: 24px; border-radius: 8px; border: 1px solid var(--border); background: var(--gray-50); cursor: pointer; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; transition: all .15s ease; flex-shrink: 0; padding: 0; }
.qty-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.cart-price-input, .cart-qty-input {
  box-sizing: border-box; flex-shrink: 0; padding: 2px 4px; text-align: center;
}
.cart-price-input { width: 58px; font-size: .74rem; }
.cart-qty-input { width: 34px; font-size: .78rem; }
.cart-item .line-total { flex-shrink: 0; font-size: .8rem; min-width: 0; text-align: right; }
.cart-item .btn.text-danger { flex-shrink: 0; }

@media (max-width: 480px) {
  .cart-item { gap: 4px; padding: 8px 6px; }
  .cart-item-name { font-size: .76rem; }
  .cart-price-input { width: 46px; font-size: .7rem; padding: 2px 2px; }
  .cart-qty-input { width: 26px; font-size: .72rem; padding: 2px 1px; }
  .qty-btn { width: 20px; height: 20px; font-size: .72rem; }
  .cart-item .line-total { font-size: .72rem; }
}
.cart-footer { padding: 16px; border-top: 1px solid var(--border); background: var(--card-bg); }
.cart-total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: .875rem; }
.cart-total-row.grand { font-size: 1.15rem; font-weight: 700; color: var(--primary); }

/* ── RECEIPT MODAL ── */
.receipt-body { font-family: 'Courier New', monospace; font-size: .8rem; }
.receipt-divider { border-top: 1px dashed #ccc; margin: 8px 0; }

/* ── LOW STOCK BADGE ── */
.low-stock-badge { position: absolute; top: 6px; right: 6px; background: var(--danger); color: #fff; font-size: .65rem; padding: 2px 6px; border-radius: 20px; font-weight: 600; }

/* ── VARIANT BADGE (grouped same-name products) ── */
.variant-badge {
  position: absolute; top: 6px; left: 6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-50); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem;
}

/* ── PRODUCT IMAGE ── */
.product-img { width: 44px; height: 44px; object-fit: cover; border-radius: 9px; }

/* ── CUSTOMER AVATAR ── */
.customer-avatar { width: 44px; height: 44px; object-fit: cover; border-radius: 50%; flex-shrink: 0; }

/* ── SIDEBAR COLLAPSED ── */
.sidebar.collapsed { transform: translateX(-100%); }

/* ── RESPONSIVE ── */
@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .pos-layout { grid-template-columns: 1fr; height: auto; }
  /* Let the cart grow with its content instead of clipping it —
     a fixed max-height here was hiding the checkout button once the
     footer (rate/discount/paid/change rows) grew taller than the box. */
  .pos-products { overflow-y: visible; }
  .pos-cart { max-height: none; overflow: visible; }
  .cart-items { overflow-y: visible; max-height: none; }
}
@media (max-width: 576px) {
  .page-body { padding: 14px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .login-brand, .login-panel { padding-left: 20px; padding-right: 20px; }
}

/* ── OVERLAY ── */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(10,14,28,.5);
  backdrop-filter: blur(2px); z-index: 1030;
}
.sidebar-overlay.show { display: block; }

/* ── PRINT ── */
@media print {
  .sidebar, .topbar, .btn, .no-print { display: none !important; }
  .main-content { margin-left: 0; }
}
