/* ============================================================================
   ORA POS â€” FastCart Edition Â· main.css
   ----------------------------------------------------------------------------
   ORGANIZATION:
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   PART A â€” FOUNDATION      (Sections  1â€“3)
   PART B â€” LOGIN SCREEN    (Sections  4â€“6)
   PART C â€” APP SHELL       (Sections  7â€“9)
   PART D â€” CONTENT LAYOUT  (Sections 10â€“15)
   PART E â€” TABLES & POS    (Sections 16â€“22)
   PART F â€” DOCUMENTS       (Sections 23â€“27)
   PART G â€” OVERLAYS        (Sections 28â€“34)  
   PART H â€” FEATURE PANELS  (Sections 35â€“45)  
   PART I â€” UTILITIES       (Sections 46â€“54)   
   PART J â€” RESPONSIVE LOCKS (Sections 55â€“60)  
   â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€
   ============================================================================ */


/* ============================================================================
   PART A â€” FOUNDATION
   ============================================================================ */

/* ============================================================================
   1. CSS VARIABLES
   ============================================================================ */
:root {
  /* Primary palette */
  --cc-primary: #0ea5e9;
  --cc-primary-dark: #0284c7;
  --cc-primary-light: #7dd3fc;
  --cc-primary-bg: #e0f2fe;
  --cc-primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);

  /* Secondary / accent */
  --cc-secondary: #2563eb;
  --cc-secondary-light: #60a5fa;
  --cc-accent: #f59e0b;
  --cc-accent-light: #fbbf24;

  /* Navy */
  --cc-navy: #0f172a;
  --cc-navy-light: #1e293b;
  --cc-navy-lighter: #334155;

  /* Surfaces */
  --cc-surface: #f7f8fa;
  --cc-surface-dark: #edf0f4;

  /* Text */
  --cc-text-primary: #5b6472;
  --cc-text-secondary: #8b95a5;
  --cc-text-muted: #b9c2ce;

  /* Semantic */
  --cc-success: #22c55e;
  --cc-success-bg: #dcfce7;
  --cc-danger: #ef4444;
  --cc-danger-bg: #fee2e2;
  --cc-warning: #f59e0b;
  --cc-warning-bg: #fef3c7;
  --cc-info: #3b82f6;
  --cc-info-bg: #dbeafe;

  /* Borders */
  --cc-border: #e2e6ec;
  --cc-border-dark: #334155;

  /* Shadows */
  --cc-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --cc-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --cc-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.07);
  --cc-shadow-lg: 0 7px 29px rgba(0, 0, 0, 0.1);
  --cc-shadow-xl: 0 14px 43px rgba(0, 0, 0, 0.12);

  /* Radii */
  --cc-radius: 0px;
  --cc-radius-sm: 0px;
  --cc-radius-lg: 0px;
  --cc-radius-full: 0px;

  /* Transition */
  --cc-transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

  /* Layout */
  --cc-header-height: 59px;
  --cc-sidebar-width: 212px;
  --cc-sidebar-collapsed: 56px;
  --cc-font: "Poppins", -apple-system, system-ui, "Roboto", "Segoe UI", sans-serif;
  --cc-touch: 36px;
  --btn-h: 32px;
  --btn-h-tab: 32px;
  --btn-h-mob: 44px;
  --input-h: 32px;
  --input-h-mob: 44px;
  --theme-accent: #0ea5e9;
  --pos-cart-w: 625px;

  /* Android touch-friendly minimums */
  --android-touch-min: 44px;
  --android-tap-highlight: rgba(14, 165, 233, 0.15);
}

/* Dark theme */
[data-theme="dark"] {
  --cc-surface: #1e293b;
  --cc-surface-dark: #0f172a;
  --cc-text-primary: #cbd5e1;
  --cc-text-secondary: #a8b3c1;
  --cc-text-muted: #8a96a5;
  --cc-border: #334155;
  --cc-border-dark: #1e293b;
  --cc-primary-bg: #0c4a6e;
  --cc-success-bg: #064e3b;
  --cc-danger-bg: #7f1d1d;
  --cc-warning-bg: #78350f;
  --cc-info-bg: #1e3a5f;
  --cc-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  --cc-shadow-md: 0 4px 14px rgba(0, 0, 0, 0.4);
  --cc-shadow-lg: 0 7px 29px rgba(0, 0, 0, 0.5);
  --cc-shadow-xl: 0 14px 43px rgba(0, 0, 0, 0.6);
}

/* Accent color themes */
[data-theme-accent="blue"] {
  --cc-primary: #0ea5e9;
  --cc-primary-dark: #0284c7;
  --cc-primary-light: #7dd3fc;
  --cc-primary-bg: #e0f2fe;
  --cc-primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  --theme-accent: #0ea5e9;
}
[data-theme-accent="green"] {
  --cc-primary: #22c55e;
  --cc-primary-dark: #16a34a;
  --cc-primary-light: #86efac;
  --cc-primary-bg: #dcfce7;
  --cc-primary-gradient: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  --theme-accent: #22c55e;
}
[data-theme-accent="purple"] {
  --cc-primary: #8b5cf6;
  --cc-primary-dark: #7c3aed;
  --cc-primary-light: #c4b5fd;
  --cc-primary-bg: #ede9fe;
  --cc-primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  --theme-accent: #8b5cf6;
}
[data-theme-accent="rose"] {
  --cc-primary: #f43f5e;
  --cc-primary-dark: #e11d48;
  --cc-primary-light: #fda4af;
  --cc-primary-bg: #ffe4e6;
  --cc-primary-gradient: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%);
  --theme-accent: #f43f5e;
}
[data-theme-accent="amber"] {
  --cc-primary: #f59e0b;
  --cc-primary-dark: #d97706;
  --cc-primary-light: #fcd34d;
  --cc-primary-bg: #fef3c7;
  --cc-primary-gradient: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --theme-accent: #f59e0b;
}
[data-theme-accent="indigo"] {
  --cc-primary: #6366f1;
  --cc-primary-dark: #4f46e5;
  --cc-primary-light: #a5b4fc;
  --cc-primary-bg: #e0e7ff;
  --cc-primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --theme-accent: #6366f1;
}
[data-theme-accent="gradient-ocean"] {
  --cc-primary: #0ea5e9;
  --cc-primary-dark: #0284c7;
  --cc-primary-light: #7dd3fc;
  --cc-primary-bg: #e0f2fe;
  --cc-primary-gradient: linear-gradient(135deg, #0ea5e9 0%, #2563eb 50%, #7c3aed 100%);
  --theme-accent: #0ea5e9;
}
[data-theme-accent="gradient-sunset"] {
  --cc-primary: #f59e0b;
  --cc-primary-dark: #d97706;
  --cc-primary-light: #fcd34d;
  --cc-primary-bg: #fef3c7;
  --cc-primary-gradient: linear-gradient(135deg, #f59e0b 0%, #ef4444 50%, #ec4899 100%);
  --theme-accent: #f59e0b;
}
[data-theme-accent="gradient-forest"] {
  --cc-primary: #22c55e;
  --cc-primary-dark: #16a34a;
  --cc-primary-light: #86efac;
  --cc-primary-bg: #dcfce7;
  --cc-primary-gradient: linear-gradient(135deg, #22c55e 0%, #14b8a6 50%, #3b82f6 100%);
  --theme-accent: #22c55e;
}
[data-theme-accent="gradient-aurora"] {
  --cc-primary: #8b5cf6;
  --cc-primary-dark: #7c3aed;
  --cc-primary-light: #c4b5fd;
  --cc-primary-bg: #ede9fe;
  --cc-primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 40%, #f59e0b 80%);
  --theme-accent: #8b5cf6;
}
[data-theme-accent="gradient-midnight"] {
  --cc-primary: #6366f1;
  --cc-primary-dark: #4f46e5;
  --cc-primary-light: #a5b4fc;
  --cc-primary-bg: #e0e7ff;
  --cc-primary-gradient: linear-gradient(135deg, #1e293b 0%, #6366f1 50%, #0ea5e9 100%);
  --theme-accent: #6366f1;
}


/* ============================================================================
   2. RESET & BASE
   ============================================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}

body {
  font-family: var(--cc-font) !important;
  background: var(--cc-surface-dark);
  color: var(--cc-text-primary);
  min-height: 100vh;
  overflow: hidden;
  font-size: 12px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: manipulation;
  font-weight: 400;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: touch;
}

body * {
  font-family: var(--cc-font) !important;
}

/* Android: remove default tap highlight */
* { -webkit-tap-highlight-color: var(--android-tap-highlight); }
button, a, input, select, textarea { -webkit-tap-highlight-color: var(--android-tap-highlight); }

/* FontAwesome family overrides */
i.fa, i.fas, i.far, i.fab, i.fal, i.fad,
i[class^="fa-"], i[class*=" fa-"],
span[class^="fa-"], span[class*=" fa-"] {
  font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free", "Font Awesome 5 Brands" !important;
  font-style: normal;
}
i.fab, .fab { font-family: "Font Awesome 5 Brands" !important; font-weight: 400; }
i.far, .far { font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free" !important; font-weight: 400; }
i.fas, .fas { font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free" !important; font-weight: 900; }
i.fal, .fal { font-family: "Font Awesome 5 Pro" !important; font-weight: 300; }
i.fad, .fad { font-family: "Font Awesome 5 Duotone" !important; font-weight: 900; }

/* Barcode font family */
.barcode-font,
.barcode-font-sample,
.barcode-font-sample-small,
.template-barcode-sample,
.receipt-barcode,
.shelf-barcode,
.receipt-content .receipt-barcode,
.barcode-print-modal .barcode-preview .barcode-font,
.shelf-card-print-modal .shelf-preview .shelf-barcode,
.designer-canvas .design-el span[style*="Libre Barcode"] {
  font-family: "Libre Barcode 39", "Libre Barcode 39 Extended", monospace !important;
  font-weight: 400 !important;
  font-display: block !important;
}

/* Scrollbars */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cc-text-muted); }
::-webkit-scrollbar-thumb:hover { background: var(--cc-primary); }

/* Remove native form styling */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]),
select,
textarea {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  -webkit-border-radius: 0 !important;
  border-radius: 0 !important;
  -webkit-box-shadow: none;
  box-shadow: none;
}


/* ============================================================================
   3. LOGIN INPUT FINAL LOCK (Referenced by Sections 4â€“6)
   ============================================================================ */
@media (min-width: 821px) {
  .auth-box .form-group input {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 13px !important;
    font-size: 11px !important;
    line-height: 38px !important;
    box-sizing: border-box !important;
  }
  .auth-box .form-group input::placeholder {
    font-size: 10px !important;
    font-weight: 400 !important;
    color: var(--cc-text-muted) !important;
  }
}
@media (max-width: 820px) {
  .auth-box .form-group input {
    height: 48px !important;
    min-height: 48px !important;
    padding: 0 14px !important;
    font-size: 16px !important;
    line-height: 48px !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
  }
  .auth-box .form-group input::placeholder {
    font-size: 10px !important;
    font-weight: 400 !important;
    color: var(--cc-text-muted) !important;
  }
}


/* ============================================================================
   PART B â€” LOGIN SCREEN
   ============================================================================ */

/* ============================================================================
   4. LOGIN â€” DESKTOP BASE
   ============================================================================ */
.auth-container {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  min-height: -webkit-fill-available;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background-color: #0f172a;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Animated gradient backdrop */
.auth-container::before {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  pointer-events: none;
  background-image: var(--cc-primary-gradient);
  background-size: 200% 200%;
  opacity: 0.22;
  animation: gradientShift 10s ease-in-out infinite;
  will-change: background-position;
}
.auth-container::after {
  content: "";
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 255, 255, 0.04) 0%, transparent 60%);
}
.auth-container > * { position: relative; z-index: 1; }

/* Left panel (desktop hero) */
.auth-left {
  flex: 1 1 55%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 36px 43px;
  color: #e2e8f0;
  min-height: 100vh;
}

.auth-left .brand-logo-placeholder {
  width: 162px;
  height: 162px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.35);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.03);
  line-height: 1;
  padding: 13px;
  transition: border-color 0.2s;
}
.auth-left .brand-logo-placeholder:hover { border-color: rgba(255, 255, 255, 0.3); }

.auth-left .brand-logo-placeholder i {
  font-size: 65px;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  color: var(--cc-primary);
  -webkit-font-smoothing: antialiased;
  transition: filter 0.25s ease;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.18));
}

@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .auth-left .brand-logo-placeholder i {
    background: var(--cc-primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}

.auth-left p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  max-width: 378px;
  text-align: center;
  line-height: 1.75;
  margin-bottom: 16px;
  font-weight: 400;
}

.auth-left .feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  max-width: 396px;
  width: 100%;
}
.auth-left .feature-item {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 13px 14px;
  text-align: center;
  min-height: 65px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
}
.auth-left .feature-item:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}
.auth-left .feature-item i {
  font-size: 18px;
  margin-bottom: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  width: 1.5em;
  height: 1.5em;
  color: var(--cc-primary);
  -webkit-font-smoothing: antialiased;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.15));
}
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .auth-left .feature-item i {
    background: var(--cc-primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
  }
}
.auth-left .feature-item span { font-size: 10px; font-weight: 400; color: rgba(255, 255, 255, 0.85); display: block; }
.auth-left .feature-item .sub { font-size: 8px; color: rgba(255, 255, 255, 0.4); font-weight: 400; }

.auth-left .auth-copyright {
  margin-top: 18px;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.28);
  text-align: center;
  letter-spacing: 0.4px;
}

/* Right panel (login form) */
.auth-right {
  flex: 1 1 45%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 36px;
  min-height: 100vh;
}

.auth-box {
  background: rgba(30, 41, 59, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 32px 29px 25px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 4px 22px rgba(0, 0, 0, 0.3);
  position: relative;
}
.auth-box::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cc-primary-gradient);
}

.auth-box .logo-small { text-align: center; margin-bottom: 7px; }
.auth-box .logo-small .logo-img-placeholder {
  width: 86px;
  height: 86px;
  margin: 0 auto 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.3);
  font-size: 9px;
  background: rgba(255, 255, 255, 0.02);
}
.auth-box .logo-small .logo-img-placeholder i {
  font-size: 40px;
  opacity: 1;
  line-height: 1;
  display: inline-block;
  background: var(--cc-primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.18));
}

.auth-box .subtitle {
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  text-align: center;
  margin-bottom: 18px;
  font-weight: 400;
}

.auth-box .form-group { margin-bottom: 11px; text-align: left; }
.auth-box .form-group label {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.auth-box .form-group label i {
  margin-right: 5px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  line-height: 1;
  vertical-align: -3px;
  color: var(--cc-primary);
  -webkit-text-fill-color: var(--cc-primary);
  background: none;
  filter: drop-shadow(0 1px 2px rgba(14, 165, 233, 0.35));
}
.auth-box .form-group input {
  width: 100%;
  padding: 0 13px;
  background: rgba(15, 23, 42, 0.6);
  border: 1.5px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  font-family: var(--cc-font);
  font-size: 11px;
  outline: none;
  height: 38px;
  min-height: 38px;
  border-radius: 0;
  font-weight: 400;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-box .form-group input:focus {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc-primary) 25%, transparent);
  background: rgba(15, 23, 42, 0.85);
}
.auth-box .form-group input::placeholder {
  color: var(--cc-text-muted);
  font-size: 10px;
  font-weight: 400;
  opacity: 1;
}

.auth-btn {
  width: 100%;
  padding: 0 14px;
  background: var(--cc-primary-gradient);
  border: none;
  color: #fff;
  font-family: var(--cc-font);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 14px color-mix(in srgb, var(--cc-primary) 30%, transparent);
  height: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 0;
  transition: box-shadow 0.2s, transform 0.15s;
  touch-action: manipulation;
}
.auth-btn:hover { box-shadow: 0 5px 25px color-mix(in srgb, var(--cc-primary) 40%, transparent); }
.auth-btn:active { transform: scale(0.98); }

.auth-error { color: #fca5a5; font-size: 10px; min-height: 16px; margin-top: 2px; text-align: center; }

.auth-box .auth-copyright {
  text-align: center;
  font-size: 9px;
  color: rgba(255, 255, 255, 0.28);
  margin-top: 9px;
  letter-spacing: 0.4px;
  padding: 5px 0;
}

/* Light theme login */
[data-theme="light"] .auth-container { background-color: #eef1f6; }
[data-theme="light"] .auth-container::before { opacity: 0.14; }
[data-theme="light"] .auth-container::after {
  background:
    radial-gradient(ellipse at 20% 30%, rgba(255, 255, 255, 0.7) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 70%, rgba(255, 255, 255, 0.5) 0%, transparent 60%);
}
[data-theme="light"] .auth-left { color: #1e293b; }
[data-theme="light"] .auth-left .brand-logo-placeholder {
  border-color: color-mix(in srgb, var(--cc-primary) 30%, transparent);
  color: color-mix(in srgb, var(--cc-primary) 65%, transparent);
  background: rgba(255, 255, 255, 0.7);
}
[data-theme="light"] .auth-left .brand-logo-placeholder:hover {
  border-color: color-mix(in srgb, var(--cc-primary) 50%, transparent);
}
[data-theme="light"] .auth-left p { color: #475569; }
[data-theme="light"] .auth-left .feature-item {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .auth-left .feature-item:hover {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 11px color-mix(in srgb, var(--cc-primary) 18%, transparent);
}
[data-theme="light"] .auth-left .feature-item span { color: #334155; }
[data-theme="light"] .auth-left .feature-item .sub { color: #94a3b8; }
[data-theme="light"] .auth-left .auth-copyright { color: rgba(71, 85, 105, 0.55); }
[data-theme="light"] .auth-box {
  background: rgba(247, 248, 250, 0.96);
  border-color: color-mix(in srgb, var(--cc-primary) 18%, transparent);
  box-shadow: 0 7px 29px color-mix(in srgb, var(--cc-primary) 15%, transparent);
}
[data-theme="light"] .auth-box .logo-small .logo-img-placeholder {
  border-color: color-mix(in srgb, var(--cc-primary) 25%, transparent);
  background: rgba(224, 242, 254, 0.5);
}
[data-theme="light"] .auth-box .subtitle { color: #64748b; }
[data-theme="light"] .auth-box .form-group label { color: #64748b; }
[data-theme="light"] .auth-box .form-group input { background: #ffffff; border-color: #cbd5e1; color: #1e293b; }
[data-theme="light"] .auth-box .form-group input:focus {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc-primary) 18%, transparent);
  background: #ffffff;
}
[data-theme="light"] .auth-box .form-group input::placeholder { color: #94a3b8; }
[data-theme="light"] .auth-error { color: #dc2626; }
[data-theme="light"] .auth-box .auth-copyright { color: rgba(71, 85, 105, 0.55); }


/* ============================================================================
   5. LOGIN â€” TABLET & ANDROID MOBILE (â‰¤900px)
   ============================================================================ */
@media (max-width: 900px) {
  .auth-container {
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
    min-height: -webkit-fill-available;
    height: auto !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-padding-bottom: 40vh;
    padding-top: env(safe-area-inset-top, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
  }

  .auth-left {
    flex: 0 0 auto !important;
    min-height: auto !important;
    height: auto !important;
    padding: 23px 18px 13px;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
  }
  .auth-left .brand-logo-placeholder {
    width: 83px;
    height: 83px;
    margin-bottom: 11px;
    gap: 5px;
    padding: 7px;
    border-radius: 0;
    font-size: 9px;
  }
  .auth-left .brand-logo-placeholder i { font-size: 36px; }
  .auth-left p {
    font-size: 11px;
    line-height: 1.55;
    max-width: 100%;
    margin-bottom: 13px;
    padding: 0 5px;
  }
  .auth-left .feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    max-width: 432px;
    width: 100%;
    margin-bottom: 4px;
  }
  .auth-left .feature-item {
    padding: 9px 9px 11px;
    min-height: auto;
    gap: 3px;
    border-radius: 0;
  }
  .auth-left .feature-item i { font-size: 14px; margin-bottom: 2px; }
  .auth-left .feature-item span { font-size: 10px; line-height: 1.2; }
  .auth-left .feature-item .sub { font-size: 8px; line-height: 1.2; }
  .auth-left .auth-copyright { display: none; }

  .auth-right {
    flex: 1 1 auto !important;
    min-height: auto !important;
    height: auto !important;
    padding: 5px 16px calc(22px + env(safe-area-inset-bottom, 0px));
    align-items: stretch;
    justify-content: center;
  }
  .auth-box {
    width: 100%;
    max-width: 440px;
    margin: 0 auto !important;
    padding: 22px 20px 20px;
    border-radius: 0;
    box-shadow: 0 7px 29px rgba(0, 0, 0, 0.28);
  }

  /* ---------- Login logo (mobile) â€” was hidden, now visible ---------- */
  .auth-box .logo-small {
    display: block;
    text-align: center;
    margin-bottom: 12px;
  }
  .auth-box .logo-small .logo-img-placeholder {
    width: 72px;
    height: 72px;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed color-mix(in srgb, var(--cc-primary) 25%, transparent);
    border-radius: 0;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.35);
    font-size: 9px;
  }
  .auth-box .logo-small .logo-img-placeholder i {
    font-size: 34px;
    line-height: 1;
    display: inline-block;
    background: var(--cc-primary-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.18));
  }
  [data-theme="light"] .auth-box .logo-small .logo-img-placeholder {
    background: rgba(224, 242, 254, 0.5);
    border-color: color-mix(in srgb, var(--cc-primary) 30%, transparent);
  }

  .auth-box .subtitle {
    font-size: 12px;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.6);
  }
  .auth-box .form-group { margin-bottom: 14px; }
  .auth-box .form-group label {
    font-size: 10px;
    margin-bottom: 5px;
    letter-spacing: 0.5px;
  }
  .auth-box .form-group label i { font-size: 11px; margin-right: 5px; }
  .auth-box .form-group input {
    height: 48px !important;
    min-height: 48px !important;
    font-size: 16px !important;
    padding: 0 14px;
    border-radius: 0;
    border-width: 1.5px;
    scroll-margin-top: 20vh;
    scroll-margin-bottom: 45vh;
  }
  .auth-box .form-group input::placeholder { font-size: 10px; }
  .auth-btn {
    height: 50px !important;
    min-height: 50px !important;
    font-size: 15px;
    font-weight: 600;
    border-radius: 0;
    margin-top: 7px;
    gap: 9px;
    min-width: 48px;
  }
  .auth-btn i { font-size: 15px; }
  .auth-error {
    font-size: 12px;
    min-height: 18px;
    margin-top: 0;
    margin-bottom: 4px;
  }
  .auth-box .auth-copyright {
    font-size: 9px;
    margin-top: 14px;
    padding: 7px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.32);
  }
  [data-theme="light"] .auth-box .auth-copyright {
    border-top-color: rgba(0, 0, 0, 0.06);
    color: rgba(71, 85, 105, 0.55);
  }
}


/* ============================================================================
   6. LOGIN â€” SMALL PHONES & LANDSCAPE VARIANTS
   ============================================================================ */

/* Small phones (â‰¤480px) */
@media (max-width: 480px) {
  .auth-left { padding: 18px 14px 9px; }
  .auth-left .brand-logo-placeholder {
    width: 70px;
    height: 70px;
    margin-bottom: 9px;
    gap: 4px;
    padding: 5px;
    font-size: 8px;
  }
  .auth-left .brand-logo-placeholder i { font-size: 31px; }
  .auth-left p { font-size: 10px; line-height: 1.5; margin-bottom: 11px; }
  .auth-left .feature-grid { gap: 5px; }
  .auth-left .feature-item { padding: 7px 7px 9px; border-radius: 0; }
  .auth-left .feature-item i { font-size: 13px; }
  .auth-left .feature-item span { font-size: 9px; }
  .auth-left .feature-item .sub { font-size: 7px; }

  .auth-right { padding: 4px 13px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .auth-box { padding: 18px 16px 16px; border-radius: 0; }

  /* Login logo (small phones) */
  .auth-box .logo-small { margin-bottom: 10px; }
  .auth-box .logo-small .logo-img-placeholder {
    width: 64px;
    height: 64px;
  }
  .auth-box .logo-small .logo-img-placeholder i { font-size: 30px; }

  .auth-box .subtitle { font-size: 11px; margin-bottom: 16px; }
  .auth-box .form-group { margin-bottom: 13px; }
  .auth-box .form-group input {
    height: 46px !important;
    min-height: 46px !important;
    font-size: 16px !important;
    border-radius: 0;
  }
  .auth-box .form-group input::placeholder { font-size: 10px; }
  .auth-btn {
    height: 48px !important;
    min-height: 48px !important;
    font-size: 14px;
    border-radius: 0;
  }
  .auth-box .auth-copyright { font-size: 9px; margin-top: 13px; }
}

/* Very narrow Android (â‰¤380px) */
@media (max-width: 380px) {
  .auth-left { padding: 14px 12px 8px !important; }
  .auth-left .brand-logo-placeholder {
    width: 66px !important;
    height: 66px !important;
    margin-bottom: 8px !important;
    padding: 5px !important;
  }
  .auth-left .brand-logo-placeholder i { font-size: 28px !important; }
  .auth-left p { font-size: 10px !important; line-height: 1.45 !important; margin-bottom: 10px !important; }
  .auth-left .feature-grid { gap: 5px !important; }
  .auth-left .feature-item { padding: 6px 6px 8px !important; }
  .auth-left .feature-item i { font-size: 13px !important; margin-bottom: 2px !important; }
  .auth-left .feature-item span { font-size: 9px !important; }
  .auth-left .feature-item .sub { font-size: 7px !important; }

  .auth-right { padding: 4px 10px calc(14px + env(safe-area-inset-bottom, 0px)) !important; }
  .auth-box { padding: 16px 14px 14px !important; }

  /* Login logo (very narrow) */
  .auth-box .logo-small { margin-bottom: 8px; }
  .auth-box .logo-small .logo-img-placeholder {
    width: 56px;
    height: 56px;
  }
  .auth-box .logo-small .logo-img-placeholder i { font-size: 26px; }

  .auth-box .subtitle { font-size: 11px !important; margin-bottom: 14px !important; }
  .auth-box .form-group { margin-bottom: 11px !important; }
  .auth-box .form-group label { font-size: 10px !important; }
  .auth-box .form-group input {
    height: 44px !important;
    min-height: 44px !important;
    font-size: 16px !important;
    padding: 0 12px !important;
  }
  .auth-btn {
    height: 46px !important;
    min-height: 46px !important;
    font-size: 14px !important;
  }
}

/* Short screens (landscape phones, â‰¤560px height) */
@media (max-height: 560px) and (max-width: 900px) {
  .auth-left { padding: 13px 14px 5px; }
  .auth-left .brand-logo-placeholder { width: 58px; height: 58px; margin-bottom: 7px; padding: 4px; }
  .auth-left .brand-logo-placeholder i { font-size: 25px; }
  .auth-left p { font-size: 10px; margin-bottom: 7px; line-height: 1.4; }
  .auth-left .feature-grid { display: none; }
  .auth-right { padding: 4px 13px 11px; }
  .auth-box { padding: 14px 16px 14px; }

  /* Login logo (short screens) */
  .auth-box .logo-small { display: none; }

  .auth-box .subtitle { margin-bottom: 13px; }
  .auth-box .form-group { margin-bottom: 11px; }
  .auth-box .form-group input { height: 42px; min-height: 42px; font-size: 16px; }
  .auth-btn { height: 44px; min-height: 44px; font-size: 14px; margin-top: 4px; }
  .auth-box .auth-copyright { margin-top: 9px; }
}

/* Very short landscape (â‰¤500px height) */
@media (max-width: 900px) and (max-height: 500px) {
  .auth-container { flex-direction: row !important; align-items: stretch; }
  .auth-left { flex: 0 0 42% !important; padding: 12px 14px !important; justify-content: center !important; }
  .auth-left .brand-logo-placeholder { width: 60px !important; height: 60px !important; margin-bottom: 8px !important; }
  .auth-left .brand-logo-placeholder i { font-size: 26px !important; }
  .auth-left p { font-size: 10px !important; margin-bottom: 8px !important; }
  .auth-left .feature-grid { display: none !important; }
  .auth-right { flex: 1 1 58% !important; padding: 12px 16px !important; }
  .auth-box { padding: 14px 16px 14px !important; max-width: 100% !important; }

  /* Login logo (very short) */
  .auth-box .logo-small { display: none; }

  .auth-box .subtitle { margin-bottom: 12px !important; font-size: 11px !important; }
  .auth-box .form-group { margin-bottom: 10px !important; }
  .auth-box .form-group input { height: 42px !important; min-height: 42px !important; font-size: 16px !important; }
  .auth-btn { height: 44px !important; min-height: 44px !important; font-size: 14px !important; }
}

/* ============================================================================
   PART C â€” APP SHELL
   ============================================================================ */

/* ============================================================================
   7. APP LAYOUT
   ============================================================================ */
.app {
  display: none;
  height: 100vh;
  height: 100dvh;
  height: -webkit-fill-available;
  width: 100vw;
  width: 100dvw;
  overflow: hidden;
  flex-direction: row;
  background: var(--cc-surface-dark);
}
.app.active { display: flex; }


/* ============================================================================
   8. SIDEBAR
   ============================================================================ */
.sidebar {
  width: var(--cc-sidebar-width);
  background: var(--cc-surface);
  border-right: 1px solid var(--cc-border);
  height: 100vh;
  height: 100dvh;
  height: -webkit-fill-available;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s, border 0.3s;
  overflow: hidden;
  z-index: 100;
  position: relative;
  box-shadow: 2px 0 22px rgba(0, 0, 0, 0.03);
}
.sidebar.collapsed { width: var(--cc-sidebar-collapsed); }

/* Brand block */
.sidebar-brand-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--cc-header-height);
  border-bottom: 1px solid var(--cc-border);
  flex-shrink: 0;
  background: var(--cc-primary-gradient);
  background-size: 200% 200%;
  animation: gradientShift 8s ease-in-out infinite;
  padding: 0 7px;
}
.sidebar-brand-wrap .brand-logo {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  width: 100%;
  justify-content: flex-start;
  padding-left: 5px;
}
.sidebar.collapsed .sidebar-nav .nav-label {
  display: none !important;
  height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  opacity: 0 !important;
  overflow: hidden !important;
}
.sidebar.collapsed .sidebar-brand-wrap .brand-logo .brand-text { display: none; }
.sidebar.collapsed .sidebar-brand-wrap .brand-logo { justify-content: center; padding: 0; }

.sidebar-brand-wrap .brand-logo .brand-icon {
  width: 31px;
  height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 17px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 0;
  overflow: hidden;
}
.sidebar-brand-wrap .brand-logo .brand-icon img { width: 100%; height: 100%; object-fit: contain; }
.sidebar.collapsed .sidebar-brand-wrap .brand-logo .brand-icon { width: 34px; height: 34px; font-size: 19px; }

.sidebar-brand-wrap .brand-logo .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  overflow: hidden;
  min-width: 0;
}
.sidebar-brand-wrap .brand-logo .brand-text .name {
  font-weight: 500;
  font-size: 13px;
  color: #fff;
  white-space: nowrap;
  letter-spacing: -0.1px;
}
.sidebar-brand-wrap .brand-logo .brand-text .sub {
  font-weight: 300;
  font-size: 7px;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Nav */
.sidebar-nav {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 5px 7px 4px;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.sidebar-nav .nav-label {
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--cc-text-muted);
  padding: 7px 11px 3px;
  font-weight: 400;
  opacity: 0.7;
}
@media (max-width: 820px) {
  .sidebar-nav .nav-label {
    display: none !important;
    height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0 !important;
    overflow: hidden !important;
  }
}

.sidebar-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 11px;
  border: none;
  background: transparent;
  color: var(--cc-text-secondary);
  font-size: 10px;
  font-weight: 400;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--cc-font);
  white-space: nowrap;
  min-height: 34px;
  position: relative;
  margin: 1px 0;
  border-radius: 0;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.sidebar.collapsed .sidebar-nav button {
  justify-content: center;
  padding: 5px 4px;
  gap: 0;
  min-height: 36px;
  flex-direction: column;
  align-items: center;
}
.sidebar-nav button i {
  font-size: 14px;
  text-align: center;
  width: 23px;
  min-width: 23px;
  color: var(--cc-text-muted);
  flex-shrink: 0;
}
.sidebar.collapsed .sidebar-nav button i {
  font-size: 16px;
  width: 27px;
  min-width: 27px;
  margin: 0;
}
.sidebar-nav button span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  font-weight: 400;
}
.sidebar.collapsed .sidebar-nav button span { display: none; }

.sidebar-nav button .badge {
  position: absolute;
  top: 4px;
  right: 7px;
  background: var(--cc-danger);
  color: #fff;
  font-size: 6px;
  font-weight: 400;
  padding: 0 5px;
  min-width: 13px;
  text-align: center;
  flex-shrink: 0;
  line-height: 13px;
}
.sidebar.collapsed .sidebar-nav button .badge {
  top: 2px;
  right: 2px;
  font-size: 5px;
  min-width: 11px;
  line-height: 11px;
  padding: 0 3px;
}

.sidebar-nav button:hover { background: var(--cc-primary-bg); color: var(--cc-text-primary); }
.sidebar-nav button:hover i { color: var(--cc-primary); }
.sidebar-nav button.active {
  background: var(--cc-primary-bg);
  color: var(--cc-primary);
  font-weight: 400;
  border-left: 3px solid var(--cc-primary);
}
.sidebar-nav button.active i { color: var(--cc-primary); }

/* Sidebar footer */
.sidebar-footer {
  border-top: 1px solid var(--cc-border);
  padding: 4px 7px 7px;
  flex-shrink: 0;
  padding-bottom: calc(7px + env(safe-area-inset-bottom, 0px));
}
.sidebar-footer button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 11px;
  border: none;
  background: transparent;
  color: var(--cc-text-secondary);
  font-size: 10px;
  font-weight: 400;
  cursor: pointer;
  width: 100%;
  text-align: left;
  font-family: var(--cc-font);
  white-space: nowrap;
  min-height: 34px;
  margin: 1px 0;
  border-radius: 0;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.sidebar-footer button i {
  font-size: 14px;
  width: 23px;
  min-width: 23px;
  color: var(--cc-text-muted);
  flex-shrink: 0;
  text-align: center;
}
.sidebar-footer button span { font-size: 10px; font-weight: 400; }
.sidebar-footer button:hover { background: var(--cc-primary-bg); color: var(--cc-text-primary); }
.sidebar-footer button:hover i { color: var(--cc-primary); }
.sidebar.collapsed .sidebar-footer button {
  justify-content: center;
  padding: 5px 4px;
  gap: 0;
  min-height: 36px;
  flex-direction: column;
  align-items: center;
}
.sidebar.collapsed .sidebar-footer button i { font-size: 16px; width: 27px; min-width: 27px; margin: 0; }
.sidebar.collapsed .sidebar-footer button span { display: none; }

/* Mobile close + backdrop */
.sidebar-mobile-close { display: none; }
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 450;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.sidebar-backdrop.open { opacity: 1; pointer-events: auto; }


/* ============================================================================
   9. TOPBAR â€” DESKTOP + MOBILE
   ============================================================================ */
.main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  height: -webkit-fill-available;
  background: var(--cc-surface-dark);
}

.topbar {
  min-height: var(--cc-header-height);
  background: var(--cc-surface);
  border-bottom: 1px solid var(--cc-border);
  padding: 7px 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  gap: 9px;
  flex-wrap: nowrap;
  min-width: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.topbar-left { display: flex; align-items: center; gap: 7px; flex-shrink: 1; min-width: 0; max-width: 40%; }
.topbar-left .menu-toggle {
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  font-size: 14px;
  color: var(--cc-text-secondary);
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  min-width: 34px;
  border-radius: 0;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.topbar-left .menu-toggle:hover {
  background: var(--cc-primary-bg);
  color: var(--cc-primary);
  border-color: var(--cc-primary);
}
.topbar-left .page-title {
  font-size: 14px;
  font-weight: 400;
  color: var(--cc-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex-shrink: 1;
  display: block;
}

.topbar-center {
  display: flex;
  align-items: center;
  gap: 9px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 540px;
  justify-content: center;
  margin: 0 5px;
}
.topbar-center .search-box {
  display: flex;
  align-items: center;
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  padding: 0 11px 0 13px;
  gap: 7px;
  flex: 1 1 100%;
  min-width: 126px;
  height: 34px;
  max-width: 306px;
  border-radius: 0;
}
.topbar-center .search-box:focus-within {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px var(--cc-primary-bg);
  background: var(--cc-surface);
}
.topbar-center .search-box i { color: var(--cc-text-muted); font-size: 12px; flex-shrink: 0; }
.topbar-center .search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 11px;
  color: var(--cc-text-primary);
  width: 100%;
  font-family: var(--cc-font);
  padding: 4px 0;
  min-width: 36px;
  min-height: 23px;
  font-weight: 400;
}
.topbar-center .search-box input::placeholder { color: var(--cc-text-muted); font-size: 10px; font-weight: 400; }

.topbar-datetime {
  font-size: 9px;
  color: var(--cc-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 5px;
  height: 34px;
}
.topbar-datetime .time { color: var(--cc-text-secondary); font-weight: 400; font-size: 10px; }

.topbar-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.topbar-btn {
  padding: 4px 11px;
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface-dark);
  color: var(--cc-text-secondary);
  font-size: 9px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 32px;
  min-width: 32px;
  justify-content: center;
  border-radius: 0;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.topbar-btn:hover { background: var(--cc-primary-bg); border-color: var(--cc-primary); color: var(--cc-primary); }
.topbar-btn.primary { background: var(--cc-primary-gradient); border-color: var(--cc-primary); color: #fff; }
.topbar-btn .avatar {
  width: 22px;
  height: 22px;
  background: var(--cc-primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 400;
  font-size: 9px;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 0;
}
.topbar-btn .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.topbar-btn span { font-size: 9px; font-weight: 400; }

#themeToggleTop {
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  min-width: 32px;
  padding: 4px 7px;
  font-size: 13px;
  min-height: 32px;
  border-radius: 0;
}
#themeToggleTop:hover { background: var(--cc-primary-bg); border-color: var(--cc-primary); color: var(--cc-primary); }

/* Tablet topbar (â‰¤1024px) */
@media (max-width: 1024px) {
  .topbar { min-height: 54px; padding: 5px 9px; gap: 5px; }
  .topbar-datetime { font-size: 8.5px; }
  .topbar-datetime .time { font-size: 9px; }
  .topbar-left .menu-toggle { width: 38px; height: 38px; min-width: 38px; min-height: 38px; font-size: 13px; }
  .topbar-left .page-title { font-size: 13px; }
  .topbar-center { max-width: none; margin: 0 4px; }
  .topbar-center .search-box { height: 36px; max-width: 252px; }
  .topbar-btn { min-height: 38px; min-width: 38px; padding: 4px 9px; font-size: 9px; }
}

/* Mobile topbar (â‰¤820px) â€” grid layout */
@media (max-width: 820px) {
  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "topbar-menu     topbar-title"
      "topbar-right    topbar-right"
      "topbar-center   topbar-center"
      "topbar-datetime topbar-datetime";
    align-items: center;
    gap: 8px 8px;
    padding: 10px 10px 12px;
    min-height: auto;
    flex-wrap: nowrap;
  }
  .topbar-left { display: contents; }
  .topbar-left .menu-toggle {
    grid-area: topbar-menu;
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    font-size: 16px;
    padding: 2px;
    border-radius: 0;
    flex-shrink: 0;
    justify-self: start;
    align-self: center;
  }
  .topbar-left .page-title {
    grid-area: topbar-title;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 500;
    color: var(--cc-text-primary);
    white-space: normal;
    overflow: visible;
    word-break: break-word;
    min-width: 0;
    align-self: center;
    padding: 0;
  }
  .topbar-right {
    grid-area: topbar-right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    flex-wrap: nowrap;
    width: 100%;
    padding-top: 6px;
    border-top: 1px dashed var(--cc-border);
  }
  .topbar-btn {
    min-height: 46px;
    min-width: 46px;
    padding: 4px 8px;
    font-size: 10px;
    gap: 4px;
    border-radius: 0;
    flex-shrink: 0;
  }
  .topbar-btn .avatar { width: 26px; height: 26px; font-size: 10px; border-radius: 0; }
  .topbar-btn span { display: none; }
  .topbar-btn i { font-size: 16px; }
  #themeToggleTop {
    min-height: 46px;
    min-width: 46px;
    padding: 4px 8px;
    font-size: 15px;
    border-radius: 0;
    flex-shrink: 0;
  }
  .topbar-center {
    grid-area: topbar-center;
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: stretch;
    justify-content: center;
    max-width: 100%;
    margin: 0;
  }
  .topbar-center .search-box {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 0;
  }
  .topbar-center .search-box input { font-size: 16px; min-height: 28px; }
  .topbar-center .search-box input::placeholder { font-size: 10px; }
  .topbar-center .search-box i { font-size: 14px; }
  .topbar-datetime {
    grid-area: topbar-datetime;
    display: flex !important;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 6px 0 0;
    height: auto;
    font-size: 10px;
    gap: 5px;
    border-top: 1px dashed var(--cc-border);
    margin-top: 2px;
  }
  .topbar-datetime .time { font-size: 11px; }
}

/* Small phones topbar (â‰¤480px) */
@media (max-width: 480px) {
  .topbar { gap: 7px 6px; padding: 8px 8px 10px; }
  .topbar-left .menu-toggle { width: 44px; height: 44px; min-width: 44px; min-height: 44px; font-size: 15px; border-radius: 0; }
  .topbar-left .page-title { font-size: 16px; line-height: 1.25; }
  .topbar-right { gap: 5px; }
  .topbar-center { gap: 5px; }
  .topbar-center .search-box { height: 44px; padding: 0 12px; border-radius: 0; }
  .topbar-center .search-box input { font-size: 16px; }
  .topbar-center .search-box input::placeholder { font-size: 10px; }
  .topbar-center .search-box i { font-size: 13px; }
  .topbar-datetime { font-size: 10px; padding-top: 5px; }
  .topbar-datetime .time { font-size: 11px; }
  .topbar-btn { min-height: 44px; min-width: 44px; padding: 4px 6px; font-size: 9.5px; border-radius: 0; }
  .topbar-btn .avatar { width: 24px; height: 24px; font-size: 9px; border-radius: 0; }
  .topbar-btn i { font-size: 15px; }
  #themeToggleTop { min-height: 44px; min-width: 44px; padding: 4px 6px; font-size: 14px; border-radius: 0; }
}


/* ============================================================================
   PART D â€” CONTENT LAYOUT
   ============================================================================ */

/* ============================================================================
   10. PAGE CONTENT
   ============================================================================ */
.page-content {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 11px 14px 18px;
  padding-bottom: calc(25px + env(safe-area-inset-bottom, 0px));
  background: var(--cc-surface-dark);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}
.page { display: none; animation: fadeUp 0.25s ease; }
.page.active { display: block; padding-bottom: 9px; min-height: 0; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}


/* ============================================================================
   11. CARDS
   ============================================================================ */
.card {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  padding: 11px 14px;
  box-shadow: var(--cc-shadow);
  position: relative;
}
.card:hover { box-shadow: var(--cc-shadow-md); }

.card-title {
  font-weight: 500;
  font-size: 11px;
  color: var(--cc-text-primary);
  padding-bottom: 5px;
  border-bottom: 2px solid var(--cc-border);
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.card-title i { color: var(--cc-primary); font-size: 13px; width: 16px; text-align: center; }


/* ============================================================================
   12. CHARTS
   ============================================================================ */
.chart-container {
  position: relative;
  height: 198px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  display: block;
}
.chart-container-sm { height: 144px; }
.chart-container-md { height: 198px; }
.chart-container-lg { height: 243px; }
.chart-container .chart-box {
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  display: block;
}
.chart-container .chart-box canvas { max-width: 100% !important; max-height: 100% !important; }

.dash-charts-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 11px;
  margin-bottom: 11px;
}
.dash-charts-grid .card {
  min-height: 270px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.dash-charts-grid .card .chart-container {
  flex: 1 1 auto;
  height: auto;
  min-height: 180px;
  min-width: 0;
  overflow: hidden;
  position: relative;
}

.dashboard-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 11px;
  margin-top: 7px;
}
.dashboard-two-col .card .table-scroll { max-height: 252px; overflow-y: auto; }

.report-charts-grid { display: grid; gap: 11px; margin-bottom: 11px; }
.report-charts-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.report-charts-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.report-charts-grid .card {
  min-width: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 261px;
}
.report-charts-grid .card .chart-container {
  flex: 1 1 auto;
  height: auto;
  min-height: 207px;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  position: relative;
}
.report-charts-grid .card .chart-box { width: 100%; height: 100%; min-width: 0; overflow: hidden; }
.report-charts-grid .card .chart-box canvas { max-width: 100% !important; max-height: 100% !important; }

@media (max-width: 1024px) {
  .report-charts-grid-2, .report-charts-grid-3 { grid-template-columns: minmax(0, 1fr) !important; gap: 11px !important; }
  .report-charts-grid .card { min-height: 234px !important; }
  .report-charts-grid .card .chart-container { min-height: 198px !important; }
}
@media (max-width: 820px) {
  .report-charts-grid { gap: 9px !important; margin-bottom: 9px !important; }
  .report-charts-grid .card { padding: 11px 13px !important; min-height: 216px !important; }
  .report-charts-grid .card .chart-container { height: 198px !important; min-height: 198px !important; }
  .dash-charts-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 9px !important; }
  .dash-charts-grid .card { min-height: 234px !important; }
  .dash-charts-grid .card .chart-container { min-height: 180px !important; }
  .dashboard-two-col { grid-template-columns: minmax(0, 1fr) !important; gap: 9px !important; }
  #page-reports .card { margin-bottom: 9px; }
  #page-reports .card:last-child { margin-bottom: 0; }
  #page-reports .stats-grid { margin-bottom: 9px !important; }
}
@media (max-width: 480px) {
  .report-charts-grid .card { min-height: 198px !important; padding: 9px !important; }
  .report-charts-grid .card .chart-container { height: 180px !important; min-height: 180px !important; }
}

#page-reports > .card { margin-bottom: 11px; }
#page-reports > .report-charts-grid { margin-bottom: 11px; }
#page-reports > .stats-grid { margin-bottom: 11px; }

@media (max-width: 820px) {
  #page-stockworth .report-charts-grid-2 { grid-template-columns: minmax(0, 1fr) !important; }
}


/* ============================================================================
   13. STATS GRID
   ============================================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 11px;
}
.stat-item {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  padding: 9px 13px;
  box-shadow: var(--cc-shadow);
  position: relative;
  overflow: hidden;
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.stat-item::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--cc-primary-gradient);
  opacity: 0.5;
}
.stat-item:hover { box-shadow: var(--cc-shadow-md); transform: translateY(-2px); }
.stat-item .label {
  font-size: 7.5px;
  color: var(--cc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 400;
}
.stat-item .value {
  font-size: 18px;
  font-weight: 500;
  color: var(--cc-text-primary);
  margin-top: 1px;
  line-height: 1.2;
}
.stat-item .sub { font-size: 7px; color: var(--cc-text-muted); margin-top: 0; }
.stat-item .stat-icon {
  position: absolute;
  right: 11px;
  bottom: 11px;
  font-size: 29px;
  opacity: 1;
  background: var(--cc-primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  pointer-events: none;
  line-height: 1;
}

@media (max-width: 820px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .stat-item { min-height: 59px; padding: 7px 9px; }
  .stat-item .value { font-size: 15px; }
  .stat-item .stat-icon { font-size: 23px; right: 9px; bottom: 9px; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px; }
  .stat-item { min-height: 54px; padding: 5px 7px; }
  .stat-item .value { font-size: 14px; }
  .stat-item .label { font-size: 6px; }
  .stat-item .stat-icon { font-size: 20px; right: 5px; bottom: 5px; }
}


/* ============================================================================
   14. FORMS â€” Android-optimized (16px on mobile prevents auto-zoom)
   ============================================================================ */
input, select, textarea {
  font-family: var(--cc-font) !important;
  font-size: 11px;
  padding: 4px 11px;
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface-dark);
  color: var(--cc-text-primary);
  outline: none;
  width: 100%;
  min-height: var(--input-h);
  height: var(--input-h);
  min-width: 0;
  max-width: 100%;
  border-radius: 0;
  font-weight: 400;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px var(--cc-primary-bg);
}
input::placeholder, textarea::placeholder {
  color: var(--cc-text-muted);
  font-size: 10px;
  font-weight: 400;
  opacity: 1;
}
select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23cbd5e1' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 25px;
  cursor: pointer;
  font-size: 10px;
}
select option { background: var(--cc-surface); color: var(--cc-text-primary); font-size: 10px; }

.form-group { margin-bottom: 7px; min-width: 0; }
.form-group label {
  display: block;
  font-size: 8px;
  font-weight: 400;
  color: var(--cc-text-secondary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
.form-row-3 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
.form-row-4 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }

input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  overflow: hidden;
  text-overflow: ellipsis;
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  margin-left: 0;
  padding-left: 2px;
}

/* Android: 16px min font to prevent auto-zoom, bigger height for touch */
@media (max-width: 820px) {
  input, select, textarea {
    font-size: 16px !important;
    min-height: var(--input-h-mob);
    height: var(--input-h-mob);
    padding: 6px 12px;
  }
  input::placeholder, textarea::placeholder { font-size: 10px; }
  select { font-size: 16px !important; padding-right: 28px; }
  select option { font-size: 12px; }
  .form-group label { font-size: 9px; margin-bottom: 5px; }
  .form-row, .form-row-3, .form-row-4 { gap: 6px; }
}


/* ============================================================================
   15. BUTTONS â€” BASE
   ============================================================================ */
.btn {
  padding: 4px 13px;
  border: 1.5px solid var(--cc-border);
  background: transparent;
  color: var(--cc-text-secondary);
  font-size: 10px;
  font-weight: 400;
  cursor: pointer;
  font-family: var(--cc-font);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: var(--btn-h);
  min-height: var(--btn-h);
  min-width: 86px;
  justify-content: center;
  text-align: center;
  line-height: 1.15;
  white-space: nowrap;
  user-select: none;
  border-radius: 0;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}

.btn-primary { background: var(--cc-primary-gradient); border-color: var(--cc-primary); color: #fff; }
.btn-primary:hover { box-shadow: 0 4px 13px rgba(14, 165, 233, 0.3); color: #fff; }

.btn-success { background: var(--cc-success); border-color: var(--cc-success); color: #fff; }
.btn-success:hover { background: #16a34a; border-color: #16a34a; color: #fff; }

.btn-danger { background: var(--cc-danger); border-color: var(--cc-danger); color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

.btn-accent { background: var(--cc-accent); border-color: var(--cc-accent); color: #fff; }
.btn-accent:hover { background: #d97706; border-color: #d97706; color: #fff; }

.btn-secondary { background: transparent; border-color: var(--cc-border); color: var(--cc-text-secondary); }
.btn-secondary:hover { background: var(--cc-surface-dark); border-color: var(--cc-text-muted); }

.btn-info { background: #6366f1; border-color: #6366f1; color: #fff; }
.btn-info:hover { background: #4f46e5; border-color: #4f46e5; color: #fff; }

/* Small square action buttons (tables etc.) */
.tpi-btn,
.tpi-actions .tpi-btn,
.operator-item .op-actions .tpi-btn,
.category-header .cat-actions .tpi-btn,
.tpi-list .tpi-item .tpi-actions .tpi-btn,
table td .actions .tpi-btn {
  min-width: 23px !important;
  min-height: 23px !important;
  width: 23px !important;
  height: 23px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  color: var(--cc-text-muted) !important;
  font-size: 11px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  outline: none !important;
  line-height: 1 !important;
  position: relative;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.tpi-btn:hover,
table td .actions .tpi-btn:hover {
  color: var(--cc-primary) !important;
  background: var(--cc-primary-bg) !important;
}
.tpi-btn.delete:hover {
  color: var(--cc-danger) !important;
  background: var(--cc-danger-bg) !important;
}
table td .actions {
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  min-height: 23px;
  padding: 0 2px;
}

@media (max-width: 820px) {
  .btn { height: var(--btn-h-mob); min-height: var(--btn-h-mob); font-size: 13px; padding: 6px 14px; }
  .tpi-btn,
  .tpi-actions .tpi-btn,
  table td .actions .tpi-btn {
    min-width: 28px !important;
    min-height: 28px !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 12px !important;
  }
}


/* ============================================================================
   PART E â€” TABLES & POS
   ============================================================================ */

/* ============================================================================
   16. TABLES â€” DESKTOP BASE
   ============================================================================ */
.table-wrap {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  box-shadow: var(--cc-shadow);
}
.table-wrap:hover { box-shadow: var(--cc-shadow-md); }

.table-wrap .table-toolbar {
  padding: 7px 11px;
  border-bottom: 1px solid var(--cc-border);
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  background: var(--cc-surface-dark);
  min-height: 41px;
}
.table-wrap .table-toolbar .search-icon-wrap {
  flex: 0 0 306px;
  width: 306px;
  max-width: 306px;
  min-width: 0;
  height: var(--input-h);
  margin-right: auto;
  position: relative;
  display: flex;
  align-items: center;
}
.table-wrap .table-toolbar .search-icon-wrap i {
  position: absolute;
  left: 7px;
  color: var(--cc-text-muted);
  font-size: 10px;
  pointer-events: none;
  z-index: 1;
}
.table-wrap .table-toolbar .search-icon-wrap input {
  height: var(--input-h);
  min-height: var(--input-h);
  font-size: 11px;
  width: 100%;
  min-width: 0;
  padding-left: 23px !important;
}
@media (max-width: 1200px) {
  .table-wrap .table-toolbar .search-icon-wrap { flex: 0 0 252px; width: 252px; max-width: 252px; }
}
@media (max-width: 820px) {
  .table-wrap .table-toolbar .search-icon-wrap {
    flex: 1 1 100%;
    min-width: 100%;
    max-width: 100%;
    width: 100%;
    margin-right: 0;
  }
}

.table-wrap .table-toolbar input,
.table-wrap .table-toolbar select {
  width: auto;
  min-width: 54px;
  padding: 4px 9px;
  font-size: 10px;
  height: var(--input-h);
  min-height: var(--input-h);
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface);
}
.table-wrap .table-toolbar input:focus,
.table-wrap .table-toolbar select:focus {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px var(--cc-primary-bg);
}
.table-wrap .table-toolbar .search-icon-wrap input { padding-left: 23px !important; }

.table-scroll {
  overflow-x: auto;
  overflow-y: auto;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
  background: var(--cc-surface);
}
table thead { position: sticky; top: 0; z-index: 10; }
table thead th {
  text-align: left;
  padding: 7px 11px;
  font-weight: 400;
  color: var(--cc-text-secondary);
  background: var(--cc-surface-dark);
  border-bottom: 2px solid var(--cc-border);
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  height: 34px;
  min-height: 34px;
  position: sticky;
  top: 0;
  z-index: 10;
}
table thead th:first-child { padding-left: 13px; }
table thead th:last-child { padding-right: 13px; }
table thead th i { margin-right: 3px; font-size: 8px; color: var(--cc-primary); opacity: 0.6; }
table thead th:hover { background: var(--cc-primary-bg); }

table tbody tr {
  transition: background 0.2s ease;
  border-bottom: 1px solid var(--cc-border);
  height: 38px;
  min-height: 38px;
  max-height: 38px;
}
table tbody tr:last-child { border-bottom: none; }
table tbody tr:hover { background: var(--cc-primary-bg); }

table td {
  padding: 5px 11px;
  color: var(--cc-text-secondary);
  vertical-align: middle;
  font-size: 10px;
  height: 38px;
  min-height: 38px;
  max-height: 38px;
  border-bottom: 1px solid var(--cc-border);
  position: relative;
  overflow: hidden;
  font-weight: 400;
}
table td:first-child { padding-left: 13px; }
table td:last-child { padding-right: 13px; }
table td .product-img,
table td .employee-img {
  width: 23px;
  height: 23px;
  object-fit: cover;
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  flex-shrink: 0;
}
table td .product-img-placeholder,
table td .employee-img-placeholder {
  width: 23px;
  height: 23px;
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--cc-text-muted);
  flex-shrink: 0;
}
table tbody tr:nth-child(even) { background: var(--cc-surface-dark); }
table tbody tr:nth-child(even):hover { background: var(--cc-primary-bg); }

[data-theme="dark"] table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }


/* ============================================================================
   17. TABLES â€” MOBILE (HARD-HEIGHT LOCK)
   Rows never expand due to action buttons or long content.
   ============================================================================ */
@media (max-width: 820px) {
  table tbody tr,
  table tbody tr:hover {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    line-height: 1 !important;
    overflow: hidden !important;
  }
  table tbody td {
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    padding: 4px 8px !important;
    font-size: 10px !important;
    line-height: 1.15 !important;
    vertical-align: middle !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    text-overflow: ellipsis !important;
  }
  table thead th {
    height: 40px !important;
    min-height: 40px !important;
    max-height: 40px !important;
    padding: 4px 8px !important;
    font-size: 8px !important;
    line-height: 1.1 !important;
    overflow: hidden !important;
    white-space: nowrap !important;
  }
  table td.actions,
  table td .actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 3px !important;
    padding: 0 4px !important;
    height: 48px !important;
    min-height: 48px !important;
    max-height: 48px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
    scrollbar-width: none;
  }
  table td.actions::-webkit-scrollbar,
  table td .actions::-webkit-scrollbar { display: none; }

  table td.actions button,
  table td.actions .tpi-btn,
  table td .actions .tpi-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 12px !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 auto !important;
    box-sizing: border-box !important;
  }

  table td img,
  table td .product-img,
  table td .employee-img {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    flex-shrink: 0 !important;
    object-fit: cover !important;
    display: block !important;
  }
  table td .product-img-placeholder,
  table td .employee-img-placeholder {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    flex-shrink: 0 !important;
    font-size: 11px !important;
  }

  table td strong,
  table td b,
  table td span:not(.status-badge):not(.cart-badge) {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100% !important;
    line-height: 1.15 !important;
  }
  table td .status-badge {
    white-space: nowrap !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .table-scroll {
    overflow-x: auto !important;
    overflow-y: auto !important;
    max-height: 60vh !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }
}

/* Small phones (â‰¤480px) â€” tighter rows, still locked */
@media (max-width: 480px) {
  table { min-width: 520px; }
  table tbody tr,
  table tbody tr:hover {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }
  table tbody td {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    padding: 3px 6px !important;
    font-size: 9px !important;
  }
  table thead th {
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    font-size: 7px !important;
    padding: 3px 6px !important;
  }
  table td.actions,
  table td .actions {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    gap: 2px !important;
  }
  table td.actions button,
  table td.actions .tpi-btn,
  table td .actions .tpi-btn {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;
    font-size: 11px !important;
  }
  table td img,
  table td .product-img,
  table td .employee-img {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
  }
  table td .product-img-placeholder,
  table td .employee-img-placeholder {
    width: 24px !important;
    height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    font-size: 10px !important;
  }
}


/* ============================================================================
   18. STATUS BADGES
   ============================================================================ */
table td .status-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 8px 1px 6px;
  font-size: 6px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border: 1px solid transparent;
  white-space: nowrap;
  min-height: 16px;
}
table td .status-badge.success { background: var(--cc-success-bg); color: #15803d; border-color: var(--cc-success); }
table td .status-badge.warning { background: var(--cc-warning-bg); color: #92400e; border-color: var(--cc-warning); }
table td .status-badge.danger  { background: var(--cc-danger-bg);  color: #991b1b; border-color: var(--cc-danger); }
table td .status-badge.info    { background: var(--cc-primary-bg); color: var(--cc-primary); border-color: var(--cc-primary-light); }
table td .status-badge.secondary { background: var(--cc-surface-dark); color: var(--cc-text-secondary); border-color: var(--cc-border); }
table td .status-badge.expiry  { background: var(--cc-danger-bg);  color: #991b1b; border-color: var(--cc-danger); }

[data-theme="dark"] table td .status-badge.success { background: rgba(34, 197, 94, 0.15); color: #86efac; border-color: var(--cc-success); }
[data-theme="dark"] table td .status-badge.warning { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border-color: var(--cc-warning); }
[data-theme="dark"] table td .status-badge.danger  { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border-color: var(--cc-danger); }
[data-theme="dark"] table td .status-badge.info    { background: rgba(14, 165, 233, 0.15); color: #7dd3fc; border-color: var(--cc-primary-light); }
[data-theme="dark"] table td .status-badge.secondary { background: rgba(255, 255, 255, 0.06); color: var(--cc-text-secondary); border-color: var(--cc-border); }


/* ============================================================================
   19. POS LAYOUT & TOOLBAR
   ============================================================================ */
.pos-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--pos-cart-w);
  gap: 11px;
  height: calc(100vh - 72px);
  height: calc(100dvh - 72px);
  min-height: 540px;
}

.pos-products {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--cc-shadow);
}

.pos-toolbar {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 7px;
  flex-shrink: 0;
  align-items: stretch;
}
.pos-toolbar .pos-toolbar-row { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; width: 100%; }
.pos-toolbar .pos-toolbar-row-search .search-icon-wrap { flex: 1 1 100%; min-width: 0; width: 100%; }
.pos-toolbar .pos-toolbar-row-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
.pos-toolbar .pos-toolbar-row-filters select { width: 100%; min-width: 0; }
.pos-toolbar .pos-toolbar-row-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr);
  gap: 7px;
  align-items: stretch;
}
.pos-toolbar .pos-toolbar-row-actions .scan-btn,
.pos-toolbar .pos-toolbar-row-actions .camera-scan-btn {
  width: 100%;
  min-width: 0;
  padding: 4px 7px;
  font-size: 10px;
  height: var(--input-h);
  min-height: var(--input-h);
}

.pos-toolbar .search-icon-wrap {
  flex: 2 1 234px;
  min-width: 180px;
  position: relative;
  display: flex;
  align-items: center;
}
.pos-toolbar .search-icon-wrap i {
  position: absolute;
  left: 7px;
  color: var(--cc-text-muted);
  font-size: 10px;
  pointer-events: none;
  z-index: 1;
}
.pos-toolbar .search-icon-wrap input {
  padding-left: 23px !important;
  width: 100%;
  font-size: 11px;
  height: var(--input-h);
  min-height: var(--input-h);
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface-dark);
  color: var(--cc-text-primary);
}
.pos-toolbar select {
  width: auto;
  flex: 1 1 72px;
  min-width: 54px;
  padding: 4px 7px;
  font-size: 10px;
  height: var(--input-h);
  min-height: var(--input-h);
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface-dark);
  color: var(--cc-text-primary);
}
.pos-toolbar .scan-btn {
  padding: 4px 13px;
  background: var(--cc-primary-gradient);
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: var(--cc-font);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.pos-toolbar .camera-scan-btn {
  padding: 4px 11px;
  background: var(--cc-secondary);
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: var(--cc-font);
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.pos-toolbar .recall-id-wrap { display: flex; gap: 4px; align-items: center; }
.pos-toolbar .recall-id-wrap input {
  flex: 1;
  min-width: 54px;
  padding: 4px 9px;
  font-size: 10px;
  height: var(--input-h);
  min-height: var(--input-h);
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface-dark);
  color: var(--cc-text-primary);
  font-family: var(--cc-font);
}
.pos-toolbar .recall-btn {
  padding: 4px 13px;
  background: var(--cc-accent);
  border: none;
  color: #fff;
  font-family: var(--cc-font);
  font-size: 10px;
  cursor: pointer;
  height: var(--input-h);
  min-height: var(--input-h);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}

/* Customer area */
.pos-customer-area {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  flex-shrink: 0;
  margin-bottom: 7px;
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  padding: 7px 9px;
  min-height: 41px;
  position: relative;
}
.pos-customer-area > i.fa-user { color: var(--cc-text-muted); font-size: 13px; flex-shrink: 0; }
.pos-customer-area .cust-search-wrap {
  flex: 2 1 180px;
  min-width: 126px;
  position: relative;
  display: flex;
  align-items: center;
  background: var(--cc-surface);
  border: 1.5px solid var(--cc-border);
  padding: 0 9px 0 11px;
  height: var(--input-h);
}
.pos-customer-area .cust-search-wrap::before {
  content: "\f002";
  font-family: "Font Awesome 5 Pro", "Font Awesome 5 Free";
  font-weight: 900;
  color: var(--cc-text-muted);
  font-size: 10px;
  margin-right: 5px;
  flex-shrink: 0;
}
.pos-customer-area .cust-search-wrap input {
  border: none !important;
  background: transparent !important;
  outline: none;
  font-size: 11px;
  color: var(--cc-text-primary);
  width: 100%;
  padding: 0 !important;
  min-height: 29px;
  box-shadow: none !important;
}
.pos-customer-area .cust-search-wrap input::placeholder { color: var(--cc-text-muted); font-size: 10px; }

.pos-customer-area .cust-contact { display: flex; gap: 5px; flex: 1 1 180px; min-width: 126px; flex-wrap: wrap; align-items: center; }
.pos-customer-area .cust-contact input {
  flex: 1 1 81px;
  min-width: 72px;
  padding: 0 9px;
  font-size: 10px;
  height: var(--input-h);
  min-height: var(--input-h);
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface);
  color: var(--cc-text-primary);
}
.pos-customer-area .cust-contact input::placeholder { color: var(--cc-text-muted); font-size: 10px; }

.pos-customer-area .cust-actions { display: flex; gap: 4px; flex-shrink: 0; flex-wrap: wrap; }
.pos-customer-area .cust-actions .btn-sm,
.pos-customer-area .cust-actions .btn {
  height: var(--input-h) !important;
  min-height: var(--input-h) !important;
  min-width: 72px !important;
  padding: 4px 11px !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  white-space: nowrap;
}

.pos-customer-area .cust-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  max-height: 126px;
  overflow-y: auto;
  z-index: 50;
  display: none;
  box-shadow: var(--cc-shadow-lg);
  margin-top: 1px;
}
.pos-customer-area .cust-suggestions .sug-item {
  padding: 4px 9px;
  cursor: pointer;
  font-size: 9px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--cc-border);
  transition: background 0.15s;
  min-height: 29px;
}
.pos-customer-area .cust-suggestions .sug-item:hover { background: var(--cc-primary-bg); }
.pos-customer-area .cust-suggestions .sug-item .name { font-weight: 500; color: var(--cc-text-primary); }
.pos-customer-area .cust-suggestions .sug-item .detail { font-size: 7px; color: var(--cc-text-muted); }
.pos-customer-area .cust-suggestions .sug-item .add-btn {
  background: var(--cc-primary);
  color: #fff;
  border: none;
  padding: 1px 7px;
  font-size: 7px;
  cursor: pointer;
  min-height: 20px;
  touch-action: manipulation;
}
.pos-customer-area .cust-suggestions .sug-item .add-btn:hover { background: var(--cc-primary-dark); }
.pos-customer-area .cust-suggestions .sug-create {
  padding: 4px 9px;
  cursor: pointer;
  font-size: 9px;
  color: var(--cc-primary);
  font-weight: 500;
  border-top: 1px solid var(--cc-border);
  text-align: center;
  transition: background 0.15s;
  min-height: 29px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pos-customer-area .cust-suggestions .sug-create:hover { background: var(--cc-primary-bg); }

/* Staff row */
.pos-staff-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 7px;
  flex-shrink: 0;
  align-items: center;
}
.pos-staff-row select {
  flex: 1 1 126px;
  min-width: 108px;
  padding: 4px 25px 4px 9px;
  font-size: 10px;
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface-dark);
  color: var(--cc-text-primary);
  font-family: var(--cc-font);
  height: var(--input-h);
  min-height: var(--input-h);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23cbd5e1' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 9px center;
}
.pos-staff-row .staff-label {
  display: flex;
  align-items: center;
  font-size: 9px;
  font-weight: 400;
  color: var(--cc-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  gap: 4px;
  height: var(--input-h);
}


/* ============================================================================
   20. POS GRID & ITEMS
   ============================================================================ */
.pos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 5px;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  align-content: start;
  padding: 2px 0 4px 0;
  -webkit-overflow-scrolling: touch;
  max-height: 100%;
}

.pos-item {
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  padding: 5px 3px 5px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  box-shadow: var(--cc-shadow-sm);
  touch-action: manipulation;
  user-select: none;
  min-height: 152px;
  justify-content: flex-start;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.pos-item:hover {
  border-color: var(--cc-primary);
  background: var(--cc-primary-bg);
  transform: translateY(-2px);
  box-shadow: var(--cc-shadow-md);
}
.pos-item:active { transform: scale(0.96); }
.pos-item .product-img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  flex-shrink: 0;
}
.pos-item .name {
  font-size: 7.5px;
  font-weight: 500;
  color: var(--cc-text-primary);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 1px;
}
.pos-item .brand {
  font-size: 7px;
  color: var(--cc-text-muted);
  font-weight: 500;
  line-height: 1.15;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 0;
  letter-spacing: 0.1px;
}
.pos-item .price { font-size: 11px; font-weight: 700; color: var(--cc-primary); }
.pos-item .stock { font-size: 6.5px; color: var(--cc-text-muted); }
.pos-item .stock.low { color: var(--cc-danger); }
.pos-item .discount-badge {
  font-size: 5.5px;
  background: var(--cc-accent);
  color: #fff;
  padding: 0 5px;
  font-weight: 700;
  text-transform: uppercase;
}
.pos-item .expiry-warning {
  font-size: 5px;
  background: var(--cc-danger);
  color: #fff;
  padding: 0 4px;
  font-weight: 600;
}
.pos-item .price i,
.pos-item .price i.fa-fire,
.pos-item .price i[class*="fa-fire"],
.pos-item .price i[class*="fa-star"] {
  color: var(--cc-accent) !important;
  -webkit-text-fill-color: var(--cc-accent) !important;
  background: none !important;
  font-size: 9px !important;
  vertical-align: middle;
  line-height: 1;
  flex-shrink: 0;
}

/* Responsive cart width ladder */
@media (max-width: 1600px) { :root { --pos-cart-w: 563px; } }
@media (max-width: 1400px) { :root { --pos-cart-w: 540px; } }
@media (max-width: 1280px) { :root { --pos-cart-w: 520px; } }
@media (max-width: 1200px) { :root { --pos-cart-w: 490px; } }
@media (max-width: 1100px) { :root { --pos-cart-w: 450px; } }
@media (max-width: 1024px) {
  :root { --pos-cart-w: 405px; }
  .pos-layout { gap: 7px; height: calc(100vh - 72px); height: calc(100dvh - 72px); min-height: 468px; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(81px, 1fr)); }
  .pos-item .product-img { width: 58px; height: 58px; }
  .pos-item { min-height: 108px; }
  .pos-item .name { font-size: 7px; }
  .pos-item .price { font-size: 10px; }
}

/* Mobile POS (â‰¤820px) */
@media (max-width: 820px) {
  .pos-layout { grid-template-columns: minmax(0, 1fr); gap: 7px; height: auto; min-height: auto; }
  .pos-products { max-height: none; min-height: auto; flex: 0 0 auto; overflow: visible; padding: 9px 11px; }
  .pos-cart { max-height: none; min-height: auto; flex: 0 0 auto; padding: 9px 11px; }
  .pos-grid {
    flex: 0 0 auto;
    max-height: none;
    min-height: 0;
    overflow-y: visible;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
  }
  .cart-items { min-height: 126px; max-height: none; overflow-y: visible; }

  .pos-item { min-height: 150px; padding: 6px 4px 8px; flex-direction: column; align-items: center; justify-content: flex-start; gap: 3px; }
  .pos-item .product-img { width: 64px; height: 64px; order: 1; }
  .pos-item .name { font-size: 9px; order: 2; margin-top: 2px; font-weight: 500; }
  .pos-item .brand { font-size: 7.5px; order: 3; }
  .pos-item .price { font-size: 12px; order: 4; font-weight: 700; }
  .pos-item .stock { font-size: 7.5px; order: 5; }
  .pos-item .discount-badge { order: 6; font-size: 6px; }
  .pos-item .expiry-warning { font-size: 5.5px; }

  .pos-toolbar { gap: 6px; }
  .pos-toolbar .pos-toolbar-row { gap: 6px; }
  .pos-toolbar .pos-toolbar-row-search .search-icon-wrap { flex: 1 1 100%; width: 100%; min-width: 0; }
  .pos-toolbar .search-icon-wrap { flex: 1 1 100%; width: 100%; min-width: 0; }
  .pos-toolbar .search-icon-wrap input { font-size: 16px !important; min-height: var(--input-h-mob); height: var(--input-h-mob); padding-left: 28px !important; }

  .pos-toolbar .pos-toolbar-row-filters { grid-template-columns: minmax(0, 1fr) !important; gap: 6px !important; }
  .pos-toolbar .pos-toolbar-row-filters select {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 16px !important;
    min-height: var(--input-h-mob);
    height: var(--input-h-mob);
    padding: 6px 28px 6px 12px;
  }

  .pos-toolbar .pos-toolbar-row-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 6px !important;
    align-items: stretch;
  }
  .pos-toolbar .pos-toolbar-row-actions .scan-btn,
  .pos-toolbar .pos-toolbar-row-actions .camera-scan-btn {
    width: 100% !important;
    min-width: 0 !important;
    font-size: 14px !important;
    min-height: var(--btn-h-mob) !important;
    height: var(--btn-h-mob) !important;
    padding: 6px 12px !important;
    justify-content: center !important;
    gap: 8px !important;
  }
  .pos-toolbar .pos-toolbar-row-actions .recall-id-wrap {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    display: flex;
    gap: 6px;
  }
  .pos-toolbar .pos-toolbar-row-actions .recall-id-wrap input {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 16px;
    min-height: var(--input-h-mob);
    height: var(--input-h-mob);
    padding: 6px 12px;
  }
  .pos-toolbar .pos-toolbar-row-actions .recall-btn {
    min-height: var(--input-h-mob);
    height: var(--input-h-mob);
    font-size: 14px;
    padding: 6px 14px;
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .pos-customer-area {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    padding: 10px 12px !important;
    min-height: auto;
  }
  .pos-customer-area > i.fa-user { display: none !important; }
  .pos-customer-area .cust-search-wrap {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: 100% !important;
    height: var(--input-h-mob) !important;
    padding: 0 12px 0 14px !important;
  }
  .pos-customer-area .cust-search-wrap input { font-size: 16px !important; min-height: 28px !important; }
  .pos-customer-area .cust-contact {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  .pos-customer-area .cust-contact input {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    height: var(--input-h-mob) !important;
    min-height: var(--input-h-mob) !important;
    font-size: 16px !important;
    padding: 6px 12px !important;
  }
  .pos-customer-area .cust-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    width: 100% !important;
  }
  .pos-customer-area .cust-actions .btn,
  .pos-customer-area .cust-actions .btn-sm {
    width: 100% !important;
    min-width: 0 !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
    font-size: 14px !important;
    padding: 0 14px !important;
    justify-content: center !important;
  }

  .pos-staff-row {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) !important;
    gap: 8px 10px !important;
    align-items: center !important;
    margin-bottom: 10px !important;
  }
  .pos-staff-row .staff-label {
    height: auto !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--cc-text-secondary) !important;
    letter-spacing: 0.3px !important;
  }
  .pos-staff-row .staff-label i { font-size: 13px !important; }
  .pos-staff-row select {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    height: var(--input-h-mob) !important;
    min-height: var(--input-h-mob) !important;
    font-size: 16px !important;
    padding: 6px 28px 6px 12px !important;
  }

  .pos-action-row {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 6px !important;
    margin-top: 10px !important;
    padding: 10px 0 0 0 !important;
    border-top: 1.5px solid var(--cc-border) !important;
    flex-shrink: 0 !important;
    position: static !important;
    width: 100% !important;
  }
  .pos-action-row .btn {
    flex-direction: column !important;
    height: 64px !important;
    min-height: 64px !important;
    max-height: 64px !important;
    font-size: 10px !important;
    padding: 6px 3px !important;
    gap: 4px !important;
  }
  .pos-action-row .btn i { font-size: 20px !important; }
  .pos-action-row .btn span { font-size: 9px !important; }
}

/* Small phones POS (â‰¤480px) */
@media (max-width: 480px) {
  .pos-products { max-height: none; min-height: auto; }
  .pos-cart { max-height: none; min-height: auto; }
  .cart-items { min-height: 108px; max-height: none; overflow-y: visible; }
  .pos-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 5px; min-height: 0; max-height: none; overflow-y: visible; }
  .pos-item { min-height: 140px; padding: 5px 3px 7px; }
  .pos-item .product-img { width: 58px; height: 58px; }
  .pos-item .name { font-size: 8.5px; }
  .pos-item .brand { font-size: 7px; }
  .pos-item .price { font-size: 11px; }
  .pos-item .stock { font-size: 7px; }

  .pos-toolbar .pos-toolbar-row-filters select { font-size: 16px; min-height: 44px; height: 44px; }
  .pos-toolbar .pos-toolbar-row-actions .scan-btn,
  .pos-toolbar .pos-toolbar-row-actions .camera-scan-btn { font-size: 14px !important; min-height: 44px !important; height: 44px !important; }
  .pos-toolbar .pos-toolbar-row-actions .recall-id-wrap input { font-size: 16px; min-height: 44px; height: 44px; }
  .pos-toolbar .pos-toolbar-row-actions .recall-btn { font-size: 14px; min-height: 44px; height: 44px; padding: 6px 12px; }

  .pos-customer-area .cust-search-wrap { height: 44px !important; }
  .pos-customer-area .cust-search-wrap input { font-size: 16px !important; }
  .pos-customer-area .cust-contact input { font-size: 16px !important; height: 44px !important; min-height: 44px !important; }
  .pos-customer-area .cust-actions .btn,
  .pos-customer-area .cust-actions .btn-sm { font-size: 14px !important; height: 44px !important; min-height: 44px !important; }

  .pos-staff-row { grid-template-columns: auto minmax(0, 1fr) !important; gap: 6px 8px !important; }
  .pos-staff-row .staff-label { font-size: 11px !important; }
  .pos-staff-row select { font-size: 16px !important; height: 44px !important; min-height: 44px !important; }

  .pos-action-row .btn { height: 60px !important; min-height: 60px !important; max-height: 60px !important; font-size: 9px !important; }
  .pos-action-row .btn i { font-size: 18px !important; }
  .pos-action-row .btn span { font-size: 8px !important; }
}


/* ============================================================================
   21. POS ACTION ROW (desktop base)
   ============================================================================ */
.pos-action-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  margin-top: 5px;
  flex-shrink: 0;
  padding-top: 5px;
  border-top: 1.5px solid var(--cc-border);
}
.pos-action-row .btn {
  font-size: 6px;
  padding: 2px 1px;
  height: 40px;
  min-height: 40px;
  max-height: 40px;
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface-dark);
  color: var(--cc-text-secondary);
  transition: all 0.2s;
  cursor: pointer;
  font-family: var(--cc-font);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  touch-action: manipulation;
  min-width: 0 !important;
  width: 100%;
  box-sizing: border-box;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.pos-action-row .btn i { font-size: 13px; color: var(--cc-text-muted); flex-shrink: 0; }
.pos-action-row .btn span { font-size: 5.5px; line-height: 1.1; display: block; margin-top: 0; }
.pos-action-row .btn:hover {
  background: var(--cc-primary-bg);
  border-color: var(--cc-primary);
  color: var(--cc-primary);
  transform: translateY(-1px);
}
.pos-action-row .btn:hover i { color: var(--cc-primary); }
.pos-action-row .btn:active { transform: scale(0.94); }

.pos-action-row .btn-primary-action {
  background: var(--cc-primary-gradient);
  border-color: var(--cc-primary);
  color: #fff;
}
.pos-action-row .btn-primary-action i { color: #fff; }
.pos-action-row .btn-primary-action:hover { box-shadow: 0 4px 11px rgba(14, 165, 233, 0.25); color: #fff; }

.pos-action-row .btn-success-action {
  background: var(--cc-success);
  border-color: var(--cc-success);
  color: #fff;
}
.pos-action-row .btn-success-action i { color: #fff; }
.pos-action-row .btn-success-action:hover { background: #16a34a; border-color: #16a34a; color: #fff; }

.pos-action-row .btn-danger-action {
  background: var(--cc-danger);
  border-color: var(--cc-danger);
  color: #fff;
}
.pos-action-row .btn-danger-action i { color: #fff; }
.pos-action-row .btn-danger-action:hover { background: #dc2626; border-color: #dc2626; color: #fff; }

.pos-action-row .btn-accent-action {
  background: var(--cc-accent);
  border-color: var(--cc-accent);
  color: #fff;
}
.pos-action-row .btn-accent-action i { color: #fff; }
.pos-action-row .btn-accent-action:hover { background: #d97706; border-color: #d97706; color: #fff; }


/* ============================================================================
   22. POS CART
   ============================================================================ */
.pos-cart {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  box-shadow: var(--cc-shadow);
}

.pos-cart .cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 11px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--cc-border);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 3px;
}
.pos-cart .cart-header button {
  background: none;
  border: none;
  color: var(--cc-danger);
  cursor: pointer;
  font-size: 8px;
  font-weight: 600;
  transition: color 0.2s, background 0.2s;
  padding: 2px 9px;
  touch-action: manipulation;
  min-height: 23px;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.pos-cart .cart-header button:hover { background: var(--cc-danger-bg); }
.pos-cart .cart-header .cart-count { font-weight: 400; font-size: 9px; color: var(--cc-text-muted); }
.pos-cart .cart-header .cart-badge { display: none; color: #fff; font-size: 6px; padding: 0 5px; margin-left: 4px; }
.pos-cart .cart-header .cart-badge.cart-badge-refund { background: var(--cc-danger); }
.pos-cart .cart-header .cart-badge.cart-badge-edit { background: var(--cc-primary); }
.pos-cart .cart-header .cart-badge[style*="inline"] { display: inline-block; }

/* Cart items container */
.cart-items {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  margin: 3px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  -webkit-overflow-scrolling: touch;
  padding-right: 1px;
  overscroll-behavior: contain;
}

/* Cart item */
.cart-item {
  display: grid;
  grid-template-columns: 32px 16px minmax(0, 1fr) auto auto auto 25px;
  grid-template-areas: "img num info qty ctrl total remove";
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  background: var(--cc-surface-dark);
  border: 1px solid var(--cc-border);
  min-height: 52px;
  flex: 0 0 auto;
  transition: background 0.15s, border-color 0.15s;
  min-width: 0;
  overflow: hidden;
}
.cart-item:hover { background: var(--cc-surface); border-color: var(--cc-text-muted); }

.cart-item .cart-img,
.cart-item .cart-img-placeholder {
  grid-area: img;
  width: 32px;
  height: 32px;
  object-fit: cover;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--cc-text-muted);
}
.cart-item .item-number { grid-area: num; font-size: 8px; font-weight: 600; color: var(--cc-text-muted); text-align: center; flex-shrink: 0; }
.cart-item .info { grid-area: info; min-width: 0; overflow: hidden; }
.cart-item .info .name {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--cc-text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.3;
}
.cart-item .info .price-display {
  font-size: 7.5px;
  color: var(--cc-text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item .info-discount {
  font-size: 7px;
  color: var(--cc-success);
  display: block;
  margin-top: 2px;
  font-weight: 600;
}

.cart-item .qty { grid-area: qty; display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.cart-item .qty input {
  width: 27px;
  padding: 0 3px;
  font-size: 9px;
  text-align: center;
  min-height: 25px;
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface);
  color: var(--cc-text-primary);
  outline: none;
  font-family: var(--cc-font);
  -moz-appearance: textfield;
  font-weight: 600;
}
.cart-item .qty input::-webkit-inner-spin-button,
.cart-item .qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item .qty input:focus { border-color: var(--cc-primary); box-shadow: 0 0 0 3px var(--cc-primary-bg); }
.cart-item .qty button {
  width: 25px !important;
  height: 25px !important;
  min-width: 25px;
  min-height: 25px;
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface);
  color: var(--cc-text-secondary);
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  font-weight: 700;
  padding: 0;
  touch-action: manipulation;
  line-height: 1;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.cart-item .qty button:hover { background: var(--cc-primary); border-color: var(--cc-primary); color: #fff; }

.cart-item .item-controls { grid-area: ctrl; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; flex-shrink: 0; }
.cart-item .item-controls .ctrl-row { display: flex; align-items: center; gap: 4px; }
.cart-item .price-label { font-size: 5.5px; color: var(--cc-text-muted); text-transform: uppercase; letter-spacing: 0.3px; white-space: nowrap; }
.cart-item .price-input {
  width: 47px;
  padding: 0 5px;
  font-size: 9px;
  text-align: right;
  min-height: 23px;
  border: 1.5px solid var(--cc-primary);
  background: var(--cc-surface);
  color: var(--cc-text-primary);
  outline: none;
  font-family: var(--cc-font);
  font-weight: 600;
  -moz-appearance: textfield;
}
.cart-item .price-input::-webkit-inner-spin-button,
.cart-item .price-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item .price-input:focus { border-color: var(--cc-primary); box-shadow: 0 0 0 3px var(--cc-primary-bg); }

/* Discount type segmented control */
.cart-item .disc-row .disc-type-group {
  display: inline-flex;
  align-items: stretch;
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface);
  height: 23px;
  min-height: 23px;
  overflow: hidden;
  flex-shrink: 0 !important;
}
.cart-item .disc-row .disc-type-btn {
  width: 18px;
  min-width: 18px;
  height: 100%;
  padding: 0;
  border: none;
  border-right: 1px solid var(--cc-border);
  background: transparent;
  color: var(--cc-text-secondary);
  font-family: var(--cc-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
.cart-item .disc-row .disc-type-btn:last-child { border-right: none; }
.cart-item .disc-row .disc-type-btn:hover { background: var(--cc-surface-dark); color: var(--cc-primary); }
.cart-item .disc-row .disc-type-btn.active { background: var(--cc-primary); color: #fff; }

.cart-item .disc-row .disc-value {
  width: 47px;
  min-height: 23px;
  font-size: 9px;
  padding: 0 5px;
  text-align: right;
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface);
  color: var(--cc-text-primary);
  outline: none;
  font-family: var(--cc-font);
  -moz-appearance: textfield;
}
.cart-item .disc-row .disc-value::-webkit-inner-spin-button,
.cart-item .disc-row .disc-value::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.cart-item .disc-row .disc-value:disabled { opacity: 0.4; background: var(--cc-surface-dark); cursor: not-allowed; }
.cart-item .disc-row .disc-value:not(:disabled):focus { border-color: var(--cc-primary); box-shadow: 0 0 0 2px var(--cc-primary-bg); }

.cart-item .item-total {
  grid-area: total;
  font-weight: 700;
  font-size: 11px;
  min-width: 54px;
  text-align: right;
  color: var(--cc-text-primary);
  flex-shrink: 0;
  white-space: nowrap;
}
.cart-item .remove-btn {
  grid-area: remove;
  background: none;
  border: none;
  color: var(--cc-text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 4px 5px;
  transition: color 0.15s, background 0.15s;
  touch-action: manipulation;
  min-height: 25px;
  min-width: 22px;
  border-radius: 0;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.cart-item .remove-btn:hover { color: var(--cc-danger); background: var(--cc-danger-bg); }

/* Hidden radio inside disc-type-btn */
.cart-item .disc-row .disc-type-btn > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
}
.cart-item .disc-row .disc-type-btn > input[type="radio"] {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

/* Mobile cart item (â‰¤820px) */
@media (max-width: 820px) {
  .cart-item {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "img   info   remove"
      "qty   qty    total"
      "ctrl  ctrl   ctrl";
    column-gap: 10px;
    row-gap: 10px;
    padding: 12px;
    min-height: auto;
    align-items: center;
  }
  .cart-item .cart-img,
  .cart-item .cart-img-placeholder { grid-area: img; width: 44px; height: 44px; font-size: 16px; align-self: start; }
  .cart-item .item-number { display: none; }
  .cart-item .info { grid-area: info; min-width: 0; overflow: hidden; }
  .cart-item .info .name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    white-space: normal;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
  }
  .cart-item .info .price-display { font-size: 10.5px; color: var(--cc-text-muted); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .cart-item .info-discount { font-size: 9.5px; font-weight: 600; margin-top: 3px; }
  .cart-item .remove-btn { grid-area: remove; justify-self: end; align-self: start; font-size: 16px; min-width: 38px; min-height: 38px; padding: 4px; color: var(--cc-danger); }
  .cart-item .qty { grid-area: qty; justify-self: start; gap: 4px; }
  .cart-item .qty input { width: 48px; min-height: 38px; font-size: 16px; padding: 0 4px; font-weight: 600; }
  .cart-item .qty button { width: 38px !important; height: 38px !important; min-width: 38px; min-height: 38px; font-size: 18px; }
  .cart-item .item-total {
    grid-area: total;
    justify-self: end;
    align-self: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--cc-text-primary);
    white-space: nowrap;
    min-width: 0;
  }

  .cart-item .item-controls {
    grid-area: ctrl;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    overflow: visible;
  }
  .cart-item .item-controls .ctrl-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    flex: none;
  }
  .cart-item .price-label { display: none; }
  .cart-item .price-input {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    font-size: 16px;
    padding: 0 10px;
    text-align: right;
    font-weight: 600;
  }
  .cart-item .disc-row .disc-type-group { height: 40px; min-height: 40px; flex-shrink: 0 !important; }
  .cart-item .disc-row .disc-type-btn { width: 44px; min-width: 44px; height: 100%; font-size: 16px; }
  .cart-item .disc-row .disc-value {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    min-height: 40px;
    font-size: 16px;
    padding: 0 10px;
    text-align: right;
    font-weight: 600;
  }
}

/* Small phones cart (â‰¤480px) */
@media (max-width: 480px) {
  .cart-item { grid-template-columns: 40px minmax(0, 1fr) auto; padding: 10px; column-gap: 8px; row-gap: 8px; }
  .cart-item .cart-img,
  .cart-item .cart-img-placeholder { width: 40px; height: 40px; font-size: 15px; }
  .cart-item .info .name { font-size: 11.5px; -webkit-line-clamp: 2; }
  .cart-item .info .price-display { font-size: 10px; }
  .cart-item .info-discount { font-size: 9px; }
  .cart-item .qty input { width: 44px; min-height: 36px; font-size: 16px; }
  .cart-item .qty button { width: 36px !important; height: 36px !important; min-width: 36px; min-height: 36px; font-size: 17px; }
  .cart-item .price-input { min-height: 38px; font-size: 16px; padding: 0 9px; }
  .cart-item .disc-row .disc-type-group { height: 38px; min-height: 38px; flex-shrink: 0 !important; }
  .cart-item .disc-row .disc-type-btn { width: 42px; min-width: 42px; height: 100%; font-size: 15px; }
  .cart-item .disc-row .disc-value {
    width: auto;
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    font-size: 16px;
    padding: 0 9px;
    font-weight: 600;
  }
  .cart-item .item-total { font-size: 15px; }
  .cart-item .remove-btn { font-size: 15px; min-width: 34px; min-height: 34px; }
}

/* Cart summary */
.cart-summary { flex-shrink: 0; border-top: 2px solid var(--cc-border); padding-top: 4px; }
.cart-summary .row { display: flex; justify-content: space-between; font-size: 8px; padding: 1px 0; color: var(--cc-text-secondary); }
.cart-summary .row.total {
  font-size: 12px;
  font-weight: 800;
  color: var(--cc-text-primary);
  border-top: 2px solid var(--cc-border);
  padding-top: 4px;
  margin-top: 2px;
}
.cart-summary .row .savings { color: var(--cc-success); font-weight: 600; }
.cart-summary .row .cart-discount-value { color: var(--cc-success); font-weight: 600; }

.cart-summary .cart-bill-disc {
  display: flex;
  gap: 3px;
  align-items: center;
  margin: 2px 0;
  padding: 3px 0;
  border-top: 1px dashed var(--cc-border);
  border-bottom: 1px dashed var(--cc-border);
}
.cart-summary .cart-bill-disc .cart-bill-disc-label {
  font-size: 6px;
  color: var(--cc-text-muted);
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}
.cart-summary .cart-bill-disc .cart-bill-disc-amount { flex: 1; min-width: 0; min-height: 22px; font-size: 8px; padding: 1px 5px; }
.cart-summary .cart-bill-disc .cart-bill-disc-percent { width: 43px; min-height: 22px; font-size: 8px; padding: 1px 5px; }
.cart-summary .cart-bill-disc .cart-bill-disc-hint { font-size: 5.5px; color: var(--cc-text-muted); white-space: nowrap; }

.cart-summary .tax-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 3px 0;
  padding: 3px 0;
  border-top: 1px dashed var(--cc-border);
  border-bottom: 1px dashed var(--cc-border);
}
.cart-summary .tax-checkboxes label {
  font-size: 7px;
  color: var(--cc-text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  font-weight: 500;
  padding: 2px 0;
  border: none;
  background: transparent;
  transition: color 0.2s;
}
.cart-summary .tax-checkboxes label:hover { color: var(--cc-primary); }
.cart-summary .tax-checkboxes label.tax-active { color: var(--cc-primary); font-weight: 600; }
.cart-summary .tax-checkboxes input[type="checkbox"] {
  width: 11px;
  height: 11px;
  accent-color: var(--cc-primary);
  cursor: pointer;
  min-height: auto;
}
.cart-summary .tax-checkboxes .tax-amount { font-weight: 600; color: var(--cc-primary); font-size: 6px; min-width: 27px; text-align: right; }

.cart-summary .tax-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 7px;
  color: var(--cc-text-muted);
  cursor: pointer;
  font-weight: 500;
  touch-action: manipulation;
}
.cart-summary .tax-toggle input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--cc-primary);
  cursor: pointer;
  min-height: auto;
}
.cart-summary .cart-tax-toggle-row { display: flex; justify-content: space-between; align-items: center; margin: 1px 0; }
.cart-summary .cart-payment-row { display: flex; gap: 2px; flex-wrap: wrap; margin-top: 1px; }
.cart-summary .cart-payment-row .cart-payment-select,
.cart-summary .cart-payment-row .cart-customer-select { flex: 1; min-width: 27px; padding: 1px 5px; font-size: 7px; min-height: 25px; }

/* Bill pay row */
.cart-summary .bill-pay-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  margin-top: 5px;
  width: 100%;
  align-items: stretch;
}
.cart-summary .bill-pay-row .btn {
  flex: 1 1 0;
  min-width: 0 !important;
  width: auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 47px;
  min-height: 47px;
  max-height: 47px;
  padding: 4px 2px;
  font-size: 6.5px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
  text-align: center;
}
.cart-summary .bill-pay-row .btn i { font-size: 14px; line-height: 1; margin: 0; flex-shrink: 0; }
.cart-summary .bill-pay-row .btn span {
  font-size: 6.5px;
  line-height: 1;
  display: block;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-weight: 500;
}

.checkout-btn {
  width: 100%;
  padding: 5px;
  background: var(--cc-success);
  border: none;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  margin-top: 4px;
  font-family: var(--cc-font);
  min-height: 31px;
  height: 31px;
  box-shadow: 0 2px 5px rgba(34, 197, 94, 0.2);
  touch-action: manipulation;
}
.checkout-btn:hover:not(:disabled) { background: #16a34a; box-shadow: 0 4px 11px rgba(34, 197, 94, 0.3); }
.checkout-btn:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

@media (max-width: 820px) {
  .cart-summary .row { font-size: 11px; padding: 3px 0; }
  .cart-summary .row.total { font-size: 16px; padding-top: 6px; margin-top: 5px; }
  .cart-summary .bill-pay-row { gap: 6px; margin-top: 8px; }
  .cart-summary .bill-pay-row .btn { height: 64px; min-height: 64px; max-height: 64px; font-size: 10px; padding: 6px 3px; gap: 4px; }
  .cart-summary .bill-pay-row .btn i { font-size: 20px; }
  .cart-summary .bill-pay-row .btn span { font-size: 10px; margin-top: 2px; }
  .cart-summary .cart-bill-disc .cart-bill-disc-label { font-size: 9px; }
  .cart-summary .cart-bill-disc .cart-bill-disc-amount { min-height: 36px; font-size: 16px; }
  .cart-summary .cart-bill-disc .cart-bill-disc-percent { min-height: 36px; font-size: 16px; width: 60px; }
  .cart-summary .tax-checkboxes label { font-size: 10px; }
  .cart-summary .tax-checkboxes .tax-amount { font-size: 10px; }
  .cart-summary .cart-payment-row .cart-payment-select,
  .cart-summary .cart-payment-row .cart-customer-select { min-height: 40px; font-size: 16px; padding: 6px 8px; }
}

@media (max-width: 480px) {
  .cart-summary .row { font-size: 11px; padding: 3px 0; }
  .cart-summary .row.total { font-size: 15px; }
  .cart-summary .bill-pay-row { gap: 5px; }
  .cart-summary .bill-pay-row .btn { height: 60px; min-height: 60px; max-height: 60px; font-size: 9.5px; padding: 5px 2px; gap: 3px; }
  .cart-summary .bill-pay-row .btn i { font-size: 18px; }
  .cart-summary .bill-pay-row .btn span { font-size: 9.5px; margin-top: 1px; }
}


/* ============================================================================
   PART F â€” DOCUMENTS
   ============================================================================ */

/* ============================================================================
   23. THERMAL RECEIPT â€” PREVIEW & PDF (auto-send)
   ============================================================================ */
.receipt-content {
  font-family: "Courier New", "Courier", monospace;
  font-size: 6px;
  padding: 5px 7px;
  white-space: pre-wrap;
  line-height: 1.35;
  max-height: 396px;
  overflow-y: auto;
  background: #f5f5f0;
  color: #1a1a1a;
  border: 2px solid #888;
  box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.05);
  max-width: 288px;
  margin: 0 auto;
  position: relative;
}
.receipt-content::before {
  content: "";
  position: absolute;
  top: 4px; left: 4px; right: 4px; bottom: 4px;
  border: 1px dashed rgba(0, 0, 0, 0.06);
  pointer-events: none;
}
[data-theme="dark"] .receipt-content {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #555;
  box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.03);
}
[data-theme="dark"] .receipt-content::before { border-color: rgba(255, 255, 255, 0.06); }

.receipt-content .receipt-header {
  text-align: center;
  font-weight: 700;
  font-size: 8px;
  color: var(--cc-primary);
  padding-bottom: 2px;
  border-bottom: 2px dashed #888;
  margin-bottom: 3px;
}
[data-theme="dark"] .receipt-content .receipt-header { border-bottom-color: #555; }
.receipt-content .receipt-header .store-name { font-size: 13px; color: var(--cc-text-primary); font-weight: 800; letter-spacing: 0.5px; }
.receipt-content .receipt-header .receipt-datetime,
.receipt-content .receipt-header .receipt-user,
.receipt-content .receipt-header .receipt-sales-rep { font-size: 5px; color: #888; font-weight: 400; margin-top: 1px; letter-spacing: 0.2px; }
.receipt-content .receipt-header .receipt-store-addr { font-size: 5px; color: #888; font-weight: 400; font-style: italic; }
.receipt-content .receipt-header .receipt-web { font-size: 5px; color: var(--cc-primary-light); font-weight: 400; }
.receipt-content .receipt-header .receipt-logo {
  max-width: 117px;
  max-height: 81px;
  width: auto;
  height: auto;
  margin-bottom: 4px;
  display: block;
  margin-left: auto;
  margin-right: auto;
  object-fit: contain;
}

.receipt-content .receipt-divider {
  border-top: 2px dashed #888;
  margin: 2px 0;
  text-align: center;
  font-size: 4.5px;
  color: #888;
  letter-spacing: 1px;
}
[data-theme="dark"] .receipt-content .receipt-divider { border-top-color: #555; }
.receipt-content .receipt-divider-light { border-top: 1px dashed #ccc; margin: 2px 0; }
[data-theme="dark"] .receipt-content .receipt-divider-light { border-top-color: #444; }

.receipt-content .receipt-item {
  display: grid;
  grid-template-columns: 1fr 20px 49px 52px;
  gap: 4px;
  padding: 1px 0;
  font-size: 6px;
  font-family: "Courier New", monospace;
  align-items: baseline;
}
.receipt-content .receipt-item .item-name { white-space: pre-wrap; word-break: break-word; text-align: left; }
.receipt-content .receipt-item .item-qty { color: #888; text-align: right; }
.receipt-content .receipt-item .item-price { font-weight: 600; text-align: right; }
.receipt-content .receipt-item .item-total-col { font-weight: 700; text-align: right; color: var(--cc-text-primary); }
.receipt-content .receipt-item.discount { color: var(--cc-success); font-size: 5.5px; }

.receipt-content .receipt-item-header {
  display: grid;
  grid-template-columns: 1fr 20px 49px 52px;
  gap: 4px;
  font-weight: 700;
  font-size: 6px;
  color: var(--cc-text-muted);
  padding: 1px 0;
  border-bottom: 1px dotted #ccc;
  margin-bottom: 1px;
}
.receipt-content .receipt-item-header span { text-align: right; }
.receipt-content .receipt-item-header span:first-child { text-align: left; }

.receipt-content .receipt-row {
  display: flex;
  justify-content: space-between;
  gap: 5px;
  padding: 1px 0;
  font-size: 6px;
  align-items: baseline;
}
.receipt-content .receipt-row .row-label { text-align: left; color: #888; font-weight: 400; }
.receipt-content .receipt-row .row-value { text-align: right; font-weight: 600; color: #1a1a1a; }
[data-theme="dark"] .receipt-content .receipt-row .row-label { color: #94a3b8; }
[data-theme="dark"] .receipt-content .receipt-row .row-value { color: #e0e0e0; }

.receipt-content .receipt-total {
  font-weight: 700;
  font-size: 9px;
  padding: 2px 0;
  border-top: 2px solid #888;
  margin-top: 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
[data-theme="dark"] .receipt-content .receipt-total { border-top-color: #555; }
.receipt-content .receipt-total .total-amount { color: var(--cc-primary); font-size: 11px; font-weight: 800; }

.receipt-content .receipt-footer {
  text-align: center;
  font-style: italic;
  color: #888;
  font-size: 5px;
  padding-top: 2px;
  border-top: 1px dashed #ccc;
  margin-top: 2px;
}
[data-theme="dark"] .receipt-content .receipt-footer { border-top-color: #444; }

.receipt-content .receipt-barcode {
  text-align: center;
  font-family: "Libre Barcode 39", "Libre Barcode 39 Extended", "Courier New", monospace !important;
  font-display: block !important;
  letter-spacing: 0;
  font-size: 25px;
  padding: 2px 0;
  color: #000;
  background: transparent;
  margin: 2px 0;
  cursor: pointer;
  user-select: all;
  line-height: 1.1;
  font-weight: 400 !important;
}

.receipt-content .receipt-savings { color: var(--cc-success); font-weight: 600; font-size: 6px; text-align: center; padding: 1px 0; }

.receipt-content .receipt-qr-placeholder {
  text-align: center;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 2px 0;
  color: var(--cc-text-primary);
  background: rgba(0, 0, 0, 0.02);
  margin: 2px 0;
  font-family: "Courier New", monospace;
}
[data-theme="dark"] .receipt-content .receipt-qr-placeholder { background: rgba(255, 255, 255, 0.03); }
.receipt-content .receipt-qr-placeholder img { max-width: 40px !important; max-height: 40px !important; }

.receipt-content .receipt-bill-account { font-size: 5px; color: #888; font-weight: 400; }

.receipt-content .receipt-thankyou {
  text-align: center;
  font-size: 6px;
  font-weight: 700;
  padding: 2px 0;
  letter-spacing: 0.3px;
  color: var(--cc-primary);
}
.receipt-content .receipt-store-phone { font-size: 5px; color: #888; text-align: center; }

.receipt-content .receipt-company-footer {
  text-align: center;
  font-size: 4.5px;
  color: #888;
  padding-top: 2px;
  border-top: 1px solid #ddd;
  margin-top: 2px;
  letter-spacing: 0.2px;
}
.receipt-content .receipt-company-footer .brand { font-weight: 700; color: var(--cc-text-primary); display: block; text-align: center; }
.receipt-content .receipt-company-footer .url { color: var(--cc-primary); font-size: 4px; display: block; text-align: center; }

.receipt-content.receipt-pdf-mode {
  max-height: none !important;
  max-width: 288px !important;
  overflow: visible !important;
  width: 80mm !important;
  box-sizing: border-box !important;
  margin: 0 auto !important;
  padding: 5mm 4mm !important;
  font-size: 8px !important;
  line-height: 1.35 !important;
  white-space: normal !important;
  background: #f5f5f0 !important;
  border: 2px solid #888 !important;
  color: #1a1a1a !important;
}
.receipt-content.receipt-pdf-mode::before { display: none !important; }
.receipt-content.receipt-pdf-mode .receipt-header {
  font-size: 10px;
  padding-bottom: 3px;
  margin-bottom: 4px;
}
.receipt-content.receipt-pdf-mode .receipt-header .store-name { font-size: 15px; }
.receipt-content.receipt-pdf-mode .receipt-header .receipt-datetime,
.receipt-content.receipt-pdf-mode .receipt-header .receipt-user,
.receipt-content.receipt-pdf-mode .receipt-header .receipt-sales-rep { font-size: 8px; }
.receipt-content.receipt-pdf-mode .receipt-header .receipt-store-addr { font-size: 8px; }
.receipt-content.receipt-pdf-mode .receipt-header .receipt-web { font-size: 8px; }
.receipt-content.receipt-pdf-mode .receipt-header .receipt-logo {
  max-width: 117px;
  max-height: 81px;
  margin-bottom: 5px;
}
.receipt-content.receipt-pdf-mode .receipt-divider {
  font-size: 7px;
  padding: 3px 0;
  margin: 4px 0;
}
.receipt-content.receipt-pdf-mode .receipt-item,
.receipt-content.receipt-pdf-mode .receipt-item-header {
  font-size: 8px;
  padding: 2px 0;
}
.receipt-content.receipt-pdf-mode .receipt-item.discount { font-size: 7px; }
.receipt-content.receipt-pdf-mode .receipt-row {
  font-size: 8px;
  padding: 2px 0;
}
.receipt-content.receipt-pdf-mode .receipt-total {
  font-size: 12px;
  padding: 4px 0;
  margin-top: 4px;
}
.receipt-content.receipt-pdf-mode .receipt-total .total-amount { font-size: 14px; }
.receipt-content.receipt-pdf-mode .receipt-savings { font-size: 8px; padding: 2px 0; }
.receipt-content.receipt-pdf-mode .receipt-barcode {
  font-size: 32px;
  padding: 4px 0;
  margin: 4px 0;
}
.receipt-content.receipt-pdf-mode .receipt-qr-placeholder {
  font-size: 12px;
  padding: 3px 0;
  margin: 4px 0;
}
.receipt-content.receipt-pdf-mode .receipt-qr-placeholder img {
  max-width: 45px !important;
  max-height: 45px !important;
}
.receipt-content.receipt-pdf-mode .receipt-thankyou { font-size: 9px; padding: 3px 0; }
.receipt-content.receipt-pdf-mode .receipt-store-phone { font-size: 8px; }
.receipt-content.receipt-pdf-mode .receipt-company-footer {
  font-size: 6px;
  padding-top: 4px;
  margin-top: 4px;
}
.receipt-content.receipt-pdf-mode .receipt-company-footer .url { font-size: 6px; }

/* ============================================================================
   24. BARCODE PRINT PREVIEW (modal)
   ============================================================================ */
.barcode-print-modal .barcode-preview {
  text-align: center;
  padding: 14px;
  background: var(--cc-surface-dark);
  border: 2px solid var(--cc-border);
  margin: 4px 0;
}
.barcode-print-modal .barcode-preview .barcode-font {
  font-family: "Libre Barcode 39", "Libre Barcode 39 Extended", monospace !important;
  font-display: block !important;
  font-weight: 400 !important;
  font-size: 43px;
  letter-spacing: 0;
  color: #000;
  line-height: 1.1;
}


/* ============================================================================
   25. SHELF CARD PRINT PREVIEW (modal)
   ============================================================================ */
.shelf-card-print-modal .shelf-preview {
  text-align: center;
  padding: 18px 11px;
  background: var(--cc-surface-dark);
  border: 3px solid var(--cc-border);
  margin: 4px 0;
  min-height: 144px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.shelf-card-print-modal .shelf-preview .shelf-barcode {
  font-family: "Libre Barcode 39", "Libre Barcode 39 Extended", monospace !important;
  font-display: block !important;
  font-weight: 400 !important;
  font-size: 38px;
  letter-spacing: 0;
  color: #000;
  line-height: 1.1;
}


/* ============================================================================
   26. A4 INVOICE PREVIEW (designer-print)
   ============================================================================ */
.designer-print {
  display: block;
  position: relative;
  background: #fff;
  box-sizing: border-box;
}
.designer-print table {
  width: 100% !important;
  border-collapse: collapse !important;
  table-layout: auto !important;
}
.designer-print table th,
.designer-print table td {
  vertical-align: middle !important;
  box-sizing: border-box !important;
  word-break: break-word !important;
}
.designer-print table th:first-child,
.designer-print table td:first-child {
  text-align: left !important;
}
.designer-print table tr {
  page-break-inside: avoid !important;
  break-inside: avoid !important;
}
.designer-print thead {
  display: table-header-group !important;
}
.designer-print > div > div > div[style*="justify-content:space-between"] {
  align-items: center !important;
}

.designer-print [style*="position:absolute"][style*="flex-direction:column"],
.designer-print [style*="position: absolute"][style*="flex-direction: column"],
.designer-print [style*="position:absolute"][style*="flex-direction: column"],
.designer-print [style*="position: absolute"][style*="flex-direction:column"] {
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%) !important;
  -webkit-transform: translateX(-50%) !important;
  -moz-transform: translateX(-50%) !important;
  -ms-transform: translateX(-50%) !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  box-sizing: border-box !important;
}
.designer-print [style*="position:absolute"][style*="flex-direction:column"] > span,
.designer-print [style*="position: absolute"][style*="flex-direction: column"] > span {
  display: block !important;
  text-align: center !important;
  margin: 0 auto !important;
}

.modal:has(.designer-print) {
  max-width: 972px !important;
  width: 96vw !important;
  max-height: 94vh !important;
  padding: 18px 22px 20px !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.modal:has(.designer-print) .modal-body-scroll {
  padding: 0 !important;
  overflow: hidden !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
}
.modal:has(.designer-print) .modal-body-scroll > div {
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
.modal:has(.designer-print) .designer-print {
  margin: 0 auto !important;
  background: #fff !important;
}

.modal:has(.designer-print) .modal-actions {
  flex-shrink: 0 !important;
  position: static !important;
  margin-top: 12px !important;
}

#invoicePreviewContainer {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 20px !important;
  background: #e6ebf1 !important;
  border: 1px solid var(--cc-border) !important;
  border-radius: 2px !important;
  min-height: 320px !important;
  overflow: hidden !important;
  flex: 1 1 auto !important;
}

#invoicePreviewWrap {
  position: relative;
  overflow: hidden;
  background: #fff;
  flex-shrink: 0;
  margin: 0 auto;
  box-shadow:
    0 6px 28px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(0, 0, 0, 0.06);
}

#invoicePreviewInner {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: top left;
  will-change: transform;
}

[data-theme="dark"] #invoicePreviewContainer {
  background: #1a2233 !important;
  border-color: #2a3446 !important;
}
[data-theme="dark"] #invoicePreviewWrap {
  box-shadow:
    0 6px 28px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

@media (max-width: 820px) {
  .modal:has(.designer-print) {
    width: 100vw !important;
    max-width: 100% !important;
    padding: 12px !important;
    max-height: 92vh !important;
  }
  #invoicePreviewContainer {
    padding: 10px !important;
    min-height: 240px !important;
  }
  #invoicePreviewWrap {
    box-shadow:
      0 3px 14px rgba(0, 0, 0, 0.16),
      0 0 0 1px rgba(0, 0, 0, 0.06);
  }
}
/* ============================================================================
   27. PRINT STYLES
   ============================================================================ */
@media print {
  .sidebar,
  .topbar,
  .topbar-right,
  .btn,
  .modal-actions { display: none !important; }

  .app { display: block !important; height: auto !important; overflow: visible !important; }
  .page-content { overflow: visible !important; padding: 14px !important; }
  .page { display: block !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }

  .designer-print table { width: 100% !important; border-collapse: collapse !important; }
  .designer-print table th,
  .designer-print table td { vertical-align: middle !important; }
}

/* ============================================================================
   PART G â€” OVERLAYS
   ============================================================================ */

/* ============================================================================
   28. MODALS
   ============================================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 13px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  max-width: 522px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 16px 20px 18px;
  box-shadow: var(--cc-shadow-xl);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.modal h3 {
  font-size: 14px;
  font-weight: 500;
  color: var(--cc-text-primary);
  margin-bottom: 1px;
  letter-spacing: 0;
}
.modal .sub { color: var(--cc-text-muted); font-size: 9px; margin-bottom: 11px; }
.modal-body-scroll { max-height: none; overflow-y: visible; padding-right: 0; flex: 0 1 auto; }

.modal-actions {
  display: flex;
  gap: 7px;
  margin-top: 14px;
  padding-top: 11px;
  justify-content: flex-end;
  flex-wrap: wrap;
  position: sticky;
  bottom: -18px;
  background: var(--cc-surface);
  z-index: 5;
  border-top: 1px solid var(--cc-border);
  padding-bottom: 4px;
}
.modal-actions .btn {
  padding: 0 16px;
  font-size: 10px;
  height: var(--btn-h);
  min-height: var(--btn-h);
  min-width: 99px;
  justify-content: center;
}

.modal-adjust-stock .modal-body-scroll { max-height: 60vh !important; min-height: 180px !important; overflow-y: auto !important; }
.modal.modal-cashier { max-width: 648px !important; }
.modal.modal-cashier .modal-body-scroll { max-height: none !important; min-height: auto !important; overflow-y: visible !important; padding-right: 0; }

/* Android: bottom-sheet style modals for easier reach */
@media (max-width: 820px) {
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    border-bottom: none;
    border-top: 2px solid var(--cc-primary);
  }
  .modal-actions {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: stretch;
    padding-top: 12px;
    margin-top: 14px;
    bottom: calc(-1 * env(safe-area-inset-bottom, 0px) - 18px);
    padding-bottom: calc(4px + env(safe-area-inset-bottom, 0px));
  }
  .modal-actions .btn { flex: 1 1 auto; width: 100%; min-width: 0; height: var(--btn-h-mob); min-height: var(--btn-h-mob); font-size: 14px; }
  .modal h3 { font-size: 16px; }
  .modal .sub { font-size: 11px; }
}


/* ============================================================================
   29. TOASTS
   ============================================================================ */
.toast-container {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 99999;
  max-width: 342px;
  width: 92%;
  pointer-events: none;
}
.toast {
  padding: 5px 14px;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  box-shadow: var(--cc-shadow-lg);
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--cc-text-primary);
  font-size: 9px;
  pointer-events: auto;
  border-left: 3px solid var(--cc-primary);
  font-weight: 400;
}
.toast.success { border-left-color: var(--cc-success); }
.toast.error { border-left-color: var(--cc-danger); }
.toast.warning { border-left-color: var(--cc-warning); }

@media (max-width: 820px) {
  .toast-container { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); max-width: 92%; width: 92%; }
  .toast { padding: 10px 16px; font-size: 13px; min-height: 44px; gap: 8px; }
}


/* ============================================================================
   30. SCANNER OVERLAY
   ============================================================================ */
.scanner-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  flex-direction: column;
  gap: 11px;
  padding: 14px;
}
.scanner-overlay.open { display: flex; }
.scanner-overlay .scanner-frame {
  width: 90vw;
  max-width: 360px;
  aspect-ratio: 1 / 1;
  background: #000;
  position: relative;
  overflow: hidden;
  border: 3px solid var(--cc-primary);
}
.scanner-overlay .scanner-text { color: var(--cc-text-secondary); font-size: 11px; text-align: center; }
.scanner-overlay .scanner-input {
  max-width: 198px;
  width: 90%;
  text-align: center;
  font-size: 13px;
  padding: 4px 11px;
  background: var(--cc-surface);
  border: 1.5px solid var(--cc-border);
  color: var(--cc-text-primary);
  outline: none;
  height: var(--input-h);
  min-height: var(--input-h);
}
.scanner-overlay .scanner-close {
  padding: 0 18px;
  background: var(--cc-danger);
  border: none;
  color: #fff;
  font-family: var(--cc-font);
  font-size: 10px;
  font-weight: 400;
  cursor: pointer;
  height: var(--btn-h);
  min-height: var(--btn-h);
}

@media (max-width: 820px) {
  .scanner-overlay .scanner-input { font-size: 16px; height: var(--input-h-mob); min-height: var(--input-h-mob); }
  .scanner-overlay .scanner-close { height: var(--btn-h-mob); min-height: var(--btn-h-mob); font-size: 14px; min-width: 120px; }
  .scanner-overlay .scanner-text { font-size: 14px; }
}


/* ============================================================================
   31. CUSTOMER DISPLAY (floating)
   ----------------------------------------------------------------------------
   - Header info (title, amount, items, savings, counter): CENTERED
   - Form: one input per row
   - Save button: own row, full-width
   ============================================================================ */
.customer-display {
  position: fixed;
  bottom: 14px;
  right: 14px;
  width: 270px;
  max-width: 92vw;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  padding: 13px 16px;
  box-shadow: var(--cc-shadow-xl);
  z-index: 999;
  transform: translateY(calc(100% + 43px));
  opacity: 0;
  border-top: 3px solid var(--cc-primary);
  transition: transform 0.3s ease, opacity 0.3s ease;
  text-align: center;
}
.customer-display.open { transform: translateY(0); opacity: 1; }

.customer-display .cd-title {
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--cc-text-muted);
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  width: 100%;
}
.customer-display .cd-title img,
.customer-display .cd-title .cd-logo {
  max-height: 22px;
  max-width: 70px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
}

.customer-display .cd-amount {
  font-size: 22px;
  font-weight: 500;
  color: var(--cc-text-primary);
  margin: 4px 0 2px;
  text-align: center;
  line-height: 1.1;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  flex-wrap: wrap;
}
.customer-display .cd-amount .currency { font-size: 16px; color: var(--cc-text-secondary); font-weight: 400; }

.customer-display .cd-items { font-size: 9px; color: var(--cc-text-secondary); margin-bottom: 2px; text-align: center; }
.customer-display .cd-savings { font-size: 9px; color: var(--cc-success); font-weight: 400; text-align: center; }
.customer-display .cd-counter { font-size: 8px; color: var(--cc-primary); font-weight: 400; margin-top: 2px; text-align: center; }

.customer-display .cd-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 8px;
  width: 100%;
}
.customer-display .cd-form input {
  width: 100%;
  padding: 6px 10px;
  font-size: 10px;
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  color: var(--cc-text-primary);
  outline: none;
  min-height: 32px;
  height: 32px;
  box-sizing: border-box;
  text-align: left;
}
.customer-display .cd-form input::placeholder { font-size: 10px; color: var(--cc-text-muted); }
.customer-display .cd-form input:focus {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px var(--cc-primary-bg);
}

.customer-display .cd-form .btn,
.customer-display .cd-form .btn-primary,
.customer-display .cd-form #cdSaveCustomer {
  width: 100%;
  min-width: 0;
  height: 36px;
  min-height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  margin: 2px 0 0 0;
}

.customer-display .cd-customer-name {
  font-size: 10px;
  font-weight: 500;
  color: var(--cc-text-primary);
  margin-top: 8px;
  text-align: center;
  padding: 5px 0;
  border-top: 1px dashed var(--cc-border);
  border-bottom: 1px dashed var(--cc-border);
}
.customer-display .cd-send-btn {
  width: 100%;
  padding: 0 5px;
  font-size: 9px;
  margin-top: 6px;
  background: var(--cc-primary-gradient);
  border: none;
  color: #fff;
  cursor: pointer;
  font-family: var(--cc-font);
  height: var(--btn-h);
  min-height: var(--btn-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}
.customer-display .cd-close {
  position: absolute;
  top: 2px;
  right: 5px;
  background: none;
  border: none;
  color: var(--cc-text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 5px;
  min-height: 22px;
  min-width: 22px;
}

@media (max-width: 820px) {
  .customer-display {
    width: calc(100vw - 20px);
    max-width: 400px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    right: 10px;
    left: 10px;
    margin: 0 auto;
    padding: 14px 16px;
  }
  .customer-display .cd-amount { font-size: 26px; }
  .customer-display .cd-amount .currency { font-size: 18px; }
  .customer-display .cd-items { font-size: 11px; }
  .customer-display .cd-savings { font-size: 11px; }
  .customer-display .cd-counter { font-size: 10px; }
  .customer-display .cd-form { gap: 8px; margin-top: 10px; }
  .customer-display .cd-form input {
    font-size: 16px;
    min-height: 46px;
    height: 46px;
    padding: 6px 12px;
  }
  .customer-display .cd-form input::placeholder { font-size: 10px; }
  .customer-display .cd-form .btn,
  .customer-display .cd-form .btn-primary,
  .customer-display .cd-form #cdSaveCustomer { height: 48px; min-height: 48px; font-size: 14px; gap: 8px; }
  .customer-display .cd-send-btn { height: var(--btn-h-mob); min-height: var(--btn-h-mob); font-size: 14px; }
  .customer-display .cd-customer-name { font-size: 12px; margin-top: 10px; }
}


/* ============================================================================
   32. GLOBAL SEARCH OVERLAY
   ============================================================================ */
.global-search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 9997;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 36px 13px;
}
.global-search-overlay.open { display: flex; }

.global-search-overlay .search-container {
  max-width: 468px;
  width: 100%;
  background: var(--cc-surface);
  padding: 16px;
  box-shadow: var(--cc-shadow-xl);
  max-height: 74vh;
  max-height: 74dvh;
  overflow-y: auto;
  border: 1px solid var(--cc-border);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.global-search-overlay .search-container input {
  font-size: 13px;
  padding: 7px 13px;
  min-height: 34px;
  border: 2px solid var(--cc-border);
  background: var(--cc-surface-dark);
  color: var(--cc-text-primary);
  width: 100%;
  outline: none;
  font-family: var(--cc-font);
  font-weight: 500;
}
.global-search-overlay .search-container input:focus {
  border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px var(--cc-primary-bg);
}
.global-search-overlay .search-container .search-results { margin-top: 9px; }
.global-search-overlay .search-container .search-results .result-group { margin-bottom: 7px; }
.global-search-overlay .search-container .search-results .result-group .group-title {
  font-size: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cc-text-muted);
  font-weight: 600;
  padding: 2px 0;
  border-bottom: 1px solid var(--cc-border);
  margin-bottom: 2px;
}
.global-search-overlay .search-container .search-results .result-item {
  padding: 4px 7px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 10px;
  color: var(--cc-text-primary);
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 29px;
  touch-action: manipulation;
}
.global-search-overlay .search-container .search-results .result-item:hover { background: var(--cc-primary-bg); }
.global-search-overlay .search-container .search-results .result-item .result-icon { color: var(--cc-primary); font-size: 11px; width: 18px; text-align: center; }
.global-search-overlay .search-container .search-results .result-item .result-detail { color: var(--cc-text-muted); font-size: 7px; margin-left: auto; }
.global-search-overlay .search-container .search-close {
  margin-top: 9px;
  width: 100%;
  padding: 6px;
  background: var(--cc-danger);
  border: none;
  color: #fff;
  font-family: var(--cc-font);
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  min-height: 31px;
  touch-action: manipulation;
}
.global-search-overlay .search-container .search-close:hover { background: #dc2626; }

@media (max-width: 820px) {
  .global-search-overlay { padding: 16px 12px; }
  .global-search-overlay .search-container { max-height: 88vh; max-height: 88dvh; padding: 14px; }
  .global-search-overlay .search-container input { font-size: 16px; min-height: 46px; padding: 10px 14px; }
  .global-search-overlay .search-container .search-results .result-item { font-size: 13px; min-height: 44px; padding: 8px 10px; gap: 8px; }
  .global-search-overlay .search-container .search-results .result-item .result-icon { font-size: 14px; width: 22px; }
  .global-search-overlay .search-container .search-results .result-item .result-detail { font-size: 9px; }
  .global-search-overlay .search-container .search-results .result-group .group-title { font-size: 9px; padding: 4px 0; }
  .global-search-overlay .search-container .search-close { min-height: var(--btn-h-mob); font-size: 14px; margin-top: 12px; }
}


/* ============================================================================
   33. CHECKOUT POPUP (post-sale)
   ============================================================================ */
.co-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 13px;
}
.co-overlay.open { display: flex; }

.co-modal {
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  max-width: 396px;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh;
  overflow-y: auto;
  padding: 16px 20px 16px;
  box-shadow: var(--cc-shadow-xl);
  position: relative;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.co-modal::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--cc-primary-gradient);
}

.co-icon-box {
  width: 43px;
  height: 43px;
  background: var(--cc-success-bg);
  color: var(--cc-success);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.co-title { font-size: 12px; font-weight: 500; color: var(--cc-text-primary); margin-bottom: 4px; }

.co-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 7px;
  padding: 7px 9px;
  margin: 5px 0 7px;
  background: var(--cc-surface-dark);
  border: 1px solid var(--cc-border);
}
.co-total { font-size: 15px; font-weight: 500; color: var(--cc-primary); }

.co-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  margin: 9px 0 11px;
}
.co-btn {
  width: 100%;
  padding: 0 13px;
  border: 1.5px solid transparent;
  font-family: "Poppins", sans-serif;
  font-size: 10px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 41px;
  min-height: 41px;
  color: #fff;
  text-align: center;
  -webkit-tap-highlight-color: var(--android-tap-highlight);
}
.co-btn-print { background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%); }
.co-btn-invoice { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); }
.co-btn-sms { background: #22c55e; }
.co-btn-email { background: #6366f1; }
.co-btn-both { background: #f59e0b; }

.co-close-row { display: flex; justify-content: flex-end; padding-top: 4px; border-top: 1px solid var(--cc-border); margin-top: 4px; }
.co-close {
  padding: 0 16px;
  background: transparent;
  border: 1.5px solid var(--cc-border);
  color: var(--cc-text-secondary);
  font-family: "Poppins", sans-serif;
  font-size: 10px;
  font-weight: 400;
  cursor: pointer;
  height: var(--btn-h);
  min-height: var(--btn-h);
  margin-top: 7px;
}

@media (max-width: 820px) {
  .co-overlay { padding: 0; align-items: flex-end; }
  .co-modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    padding: 18px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: 3px solid var(--cc-primary);
  }
  .co-btn { height: 52px; min-height: 52px; font-size: 14px; gap: 12px; }
  .co-btn i { font-size: 18px; }
  .co-close { height: var(--btn-h-mob); min-height: var(--btn-h-mob); font-size: 14px; padding: 0 20px; }
  .co-title { font-size: 15px; }
  .co-total { font-size: 20px; }
}


/* ============================================================================
   34. EMPTY STATE
   ============================================================================ */
.empty-state { text-align: center; padding: 14px 7px; color: var(--cc-text-muted); }
.empty-state i { font-size: 22px; opacity: 0.08; margin-bottom: 2px; }
.empty-state p { font-size: 9px; }

@media (max-width: 820px) {
  .empty-state { padding: 24px 12px; }
  .empty-state i { font-size: 36px; }
  .empty-state p { font-size: 13px; }
}


/* ============================================================================
   PART H â€” FEATURE PANELS
   ============================================================================ */

/* ============================================================================
   35. REPORT FILTERS
   ============================================================================ */
.report-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 9px;
}
.report-filters .form-group { margin-bottom: 0; min-width: 0; }
.report-filters .form-group label { font-size: 9px; letter-spacing: 0.3px; }
.report-filters .form-group input,
.report-filters .form-group select {
  font-size: 11px;
  padding: 4px 11px;
  height: var(--input-h);
  min-height: var(--input-h);
  min-width: 0;
  width: 100%;
}
.report-filters .filter-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  padding-top: 9px;
  border-top: 1px dashed var(--cc-border);
}
.report-filters .filter-actions .btn,
.report-filters .filter-actions .btn-sm {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0 !important;
  height: var(--btn-h) !important;
  min-height: var(--btn-h) !important;
  padding: 0 13px !important;
  font-size: 10px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

@media (max-width: 820px) {
  .report-filters { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  .report-filters .form-group label { font-size: 11px; }
  .report-filters .form-group input,
  .report-filters .form-group select { font-size: 16px; height: var(--input-h-mob); min-height: var(--input-h-mob); }
  .report-filters .filter-actions {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 6px !important;
  }
  .report-filters .filter-actions .btn,
  .report-filters .filter-actions .btn-sm {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
    font-size: 14px !important;
    padding: 0 12px !important;
    justify-content: center !important;
  }
}


/* ============================================================================
   36. TRANSACTION HISTORY
   ============================================================================ */
#page-history .card:first-child { margin-bottom: 9px; }

.history-search-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 9px;
  align-items: end;
}
.history-search-row .form-group { margin-bottom: 0; min-width: 0; }
.history-search-row .form-group label { font-size: 9px; letter-spacing: 0.3px; margin-bottom: 3px; }
.history-search-row .form-group input,
.history-search-row .form-group select {
  font-size: 11px;
  padding: 4px 11px;
  height: var(--input-h);
  min-height: var(--input-h);
  min-width: 0;
  width: 100%;
}
.history-search-row .history-search-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: stretch;
  padding-top: 9px;
  border-top: 1px dashed var(--cc-border);
  margin-top: 5px;
}
.history-search-row .history-search-actions .btn,
.history-search-row .history-search-actions .btn-sm {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 5px !important;
  flex: 0 0 auto;
  width: auto !important;
  min-width: 0 !important;
  height: var(--btn-h) !important;
  min-height: var(--btn-h) !important;
  padding: 0 14px !important;
  font-size: 10px !important;
  white-space: nowrap !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.history-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(126px, 1fr));
  gap: 9px;
  margin: 11px 0 13px 0;
}
.history-stats .stat-item { padding: 9px 13px; min-height: 67px; }
.history-stats .stat-item .value { font-size: 16px; }

@media (max-width: 1024px) {
  .history-search-row { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 7px !important; }
  .history-stats { grid-template-columns: repeat(auto-fit, minmax(117px, 1fr)) !important; gap: 7px !important; }
}
@media (max-width: 820px) {
  .history-search-row { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  .history-search-row .form-group input,
  .history-search-row .form-group select { font-size: 16px; height: var(--input-h-mob); min-height: var(--input-h-mob); }
  .history-search-row .history-search-actions {
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    gap: 6px !important;
  }
  .history-search-row .history-search-actions .btn,
  .history-search-row .history-search-actions .btn-sm {
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
    font-size: 14px !important;
    padding: 0 12px !important;
    justify-content: center !important;
  }
  .history-stats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 7px !important; }
  .history-stats .stat-item { padding: 9px 11px !important; min-height: 58px !important; }
}


/* ============================================================================
   37. DEBT MANAGEMENT
   ============================================================================ */
#page-debt .debt-datetime { display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }
#page-debt .debt-datetime .debt-date { font-size: 9px; font-weight: 400; color: var(--cc-text-primary); }
#page-debt .debt-datetime .debt-time { font-size: 8px; color: var(--cc-text-muted); }

#modalBody .debt-ledger-stats,
#modalBody .debt-ledger-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-bottom: 9px;
}
#modalBody .debt-ledger-stats > div,
#modalBody .debt-ledger-summary > div {
  padding: 7px;
  background: var(--cc-surface-dark);
  border: 1px solid var(--cc-border);
}
#modalBody .debt-ledger-stats > div .value,
#modalBody .debt-ledger-summary > div .value { font-size: 14px; font-weight: 400; }

#modalBody .debt-final-balance {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 9px;
  padding: 7px 9px;
  background: var(--cc-primary-bg);
  border: 1px solid var(--cc-primary);
}

#modalBody .debt-pay-hero { text-align: center; padding: 4px 0 9px; }
#modalBody .debt-pay-hero .value {
  font-size: 29px;
  font-weight: 500;
  color: var(--cc-danger);
  line-height: 1.1;
  margin-top: 2px;
}
#modalBody #debtPayAmount {
  font-size: 20px;
  font-weight: 400;
  text-align: center;
  height: 50px;
  min-height: 50px;
}

@media (max-width: 820px) {
  #modalBody .debt-ledger-stats,
  #modalBody .debt-ledger-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #modalBody #debtPayAmount { font-size: 24px; height: 56px; min-height: 56px; }
}


/* ============================================================================
   38. SMART SEARCH
   ============================================================================ */
.smart-search-wrap { position: relative; }
.smart-search-wrap .smart-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--cc-surface);
  border: 1px solid var(--cc-border);
  max-height: 144px;
  overflow-y: auto;
  z-index: 100;
  display: none;
  box-shadow: var(--cc-shadow-lg);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.smart-search-wrap .smart-suggestions .smart-item {
  padding: 4px 9px;
  cursor: pointer;
  font-size: 8px;
  border-bottom: 1px solid var(--cc-border);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.15s;
  min-height: 29px;
}
.smart-search-wrap .smart-suggestions .smart-item:hover { background: var(--cc-primary-bg); }
.smart-search-wrap .smart-suggestions .smart-item .smart-label { font-weight: 500; flex: 1; }
.smart-search-wrap .smart-suggestions .smart-item .smart-detail { font-size: 6px; color: var(--cc-text-muted); }
.smart-search-wrap .smart-suggestions .smart-item .smart-action {
  background: var(--cc-primary);
  color: #fff;
  border: none;
  padding: 0 7px;
  font-size: 6px;
  cursor: pointer;
  min-height: 18px;
  touch-action: manipulation;
  border-radius: 0;
}
.smart-search-wrap .smart-suggestions .smart-item .smart-action:hover { background: var(--cc-primary-dark); }
.smart-search-wrap .smart-suggestions .smart-create {
  padding: 4px 9px;
  cursor: pointer;
  font-size: 8px;
  color: var(--cc-primary);
  font-weight: 500;
  border-top: 1px solid var(--cc-border);
  text-align: center;
  transition: background 0.15s;
  min-height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.smart-search-wrap .smart-suggestions .smart-create:hover { background: var(--cc-primary-bg); }

.search-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 54px;
}
.search-icon-wrap i {
  position: absolute;
  left: 5px;
  color: var(--cc-text-muted);
  font-size: 9px;
  pointer-events: none;
  z-index: 1;
}
.search-icon-wrap input { padding-left: 20px !important; width: 100%; }
.search-icon-wrap input:focus + i { color: var(--cc-primary); }
.search-icon-wrap input:focus { border-color: var(--cc-primary); box-shadow: 0 0 0 3px var(--cc-primary-bg); }

@media (max-width: 820px) {
  .smart-search-wrap .smart-suggestions { max-height: 200px; }
  .smart-search-wrap .smart-suggestions .smart-item { font-size: 13px; min-height: 44px; padding: 8px 12px; gap: 8px; }
  .smart-search-wrap .smart-suggestions .smart-item .smart-detail { font-size: 10px; }
  .smart-search-wrap .smart-suggestions .smart-create { font-size: 13px; min-height: 44px; padding: 8px 12px; }
}


/* ============================================================================
   39. SUPPLIERS
   ============================================================================ */
.supplier-img {
  width: 29px;
  height: 29px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  flex-shrink: 0;
}
.supplier-img-placeholder {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--cc-text-muted);
  flex-shrink: 0;
}
#suppBrandsGrid,
#suppProductsGrid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px;
  border: 1px solid var(--cc-border);
  background: var(--cc-surface);
  overflow-y: auto;
  max-height: 198px;
  -webkit-overflow-scrolling: touch;
}
#suppBrandSearch,
#suppProductSearch {
  width: 100%;
  height: var(--input-h);
  min-height: var(--input-h);
  font-size: 11px;
  padding-left: 23px !important;
}

@media (max-width: 820px) {
  #suppBrandsGrid,
  #suppProductsGrid { max-height: 260px; }
}


/* ============================================================================
   40. STOCK WORTH
   ============================================================================ */
.stock-worth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(144px, 1fr));
  gap: 9px;
  margin-bottom: 11px;
}
.stock-worth-grid .stat-item { min-height: 70px; }
.stock-worth-grid .stat-item .value { font-size: 16px; }

.stockworth-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 9px;
  padding: 9px 11px;
  background: var(--cc-surface-dark);
  border: 1px solid var(--cc-border);
  align-items: center;
}

@media (max-width: 820px) {
  .stockworth-actions {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 7px !important;
  }
  .stockworth-actions > span { display: none !important; }
  .stockworth-actions .btn,
  .stockworth-actions .btn-sm {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
    font-size: 14px !important;
    padding: 0 14px !important;
    justify-content: center !important;
    display: inline-flex !important;
  }
}


/* ============================================================================
   41. THEME COLOR SELECTOR
   ============================================================================ */
.theme-color-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  padding: 5px 0;
}
.theme-color-selector .color-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.25s ease;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
  font-size: 0;
  color: transparent;
  text-indent: -9999px;
  line-height: 0;
  -webkit-tap-highlight-color: transparent;
}
.theme-color-selector .color-dot:hover { transform: scale(1.1); }
.theme-color-selector .color-dot.active {
  border-color: var(--cc-text-secondary);
  transform: scale(1.12);
  box-shadow: 0 0 0 3px var(--cc-primary-bg);
}
.theme-color-selector .color-dot.blue { background: #0ea5e9; }
.theme-color-selector .color-dot.green { background: #22c55e; }
.theme-color-selector .color-dot.purple { background: #8b5cf6; }
.theme-color-selector .color-dot.rose { background: #f43f5e; }
.theme-color-selector .color-dot.amber { background: #f59e0b; }
.theme-color-selector .color-dot.indigo { background: #6366f1; }
.theme-color-selector .color-dot.gradient-ocean { background: linear-gradient(135deg, #0ea5e9, #2563eb, #7c3aed); }
.theme-color-selector .color-dot.gradient-sunset { background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899); }
.theme-color-selector .color-dot.gradient-forest { background: linear-gradient(135deg, #22c55e, #14b8a6, #3b82f6); }
.theme-color-selector .color-dot.gradient-aurora { background: linear-gradient(135deg, #8b5cf6, #ec4899, #f59e0b); }
.theme-color-selector .color-dot.gradient-midnight { background: linear-gradient(135deg, #1e293b, #6366f1, #0ea5e9); }
.theme-color-selector .color-dot .dot-label,
.theme-color-selector .color-dot span,
.theme-color-selector .color-dot * {
  display: none !important;
  visibility: hidden !important;
  font-size: 0 !important;
  color: transparent !important;
}

@media (max-width: 820px) {
  .theme-color-selector { gap: 14px; }
  .theme-color-selector .color-dot { width: 52px; height: 52px; border-width: 4px; }
}


/* ============================================================================
   42. CASHIER / TILL MANAGER
   ============================================================================ */
#cashiersTableBody .employee-img {
  width: 23px;
  height: 23px;
  object-fit: cover;
  border-radius: 50%;
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  flex-shrink: 0;
}
.till-manager .till-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  background: var(--cc-surface-dark);
  border: 1px solid var(--cc-border);
  margin-bottom: 2px;
}
@media (max-width: 820px) {
  .till-manager .till-item { padding: 10px 12px; min-height: 56px; gap: 10px; }
}


/* ============================================================================
   43. SETTINGS PAGES â€” FULL-HEIGHT SCROLL FIX
   ============================================================================ */
html, body { height: 100%; overflow: hidden; overscroll-behavior: none; }
.app.active {
  display: flex;
  height: 100vh;
  height: 100dvh;
  height: -webkit-fill-available;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
.sidebar {
  height: 100vh;
  height: 100dvh;
  height: -webkit-fill-available;
  max-height: 100vh;
  max-height: 100dvh;
}
.main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}
.topbar { flex: 0 0 auto; flex-shrink: 0; }
.page-content {
  flex: 1 1 0%;
  min-height: 0;
  height: auto;
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.page, .page.active { min-height: 0; max-height: none; overflow: visible; }

#page-pos.active { height: 100%; min-height: 0; overflow: hidden; padding: 0; }
#page-pos.active .pos-layout { height: 100%; min-height: 0; overflow: hidden; }

/* All settings pages: natural height, no clipping */
#page-settings-company,
#page-settings-region,
#page-settings-uom,
#page-settings-vat,
#page-settings-application,
#page-settings-cashier,
#page-settings-customer-display,
#page-settings-printer,
#page-settings-device,
#page-settings-backup,
#page-settings-till,
#page-settings-api,
#page-settings-theme,
#page-settings-reset,
#page-settings-about {
  min-height: 0 !important;
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

#page-settings-company .card,
#page-settings-region .card,
#page-settings-uom .card,
#page-settings-vat .card,
#page-settings-application .card,
#page-settings-cashier .card,
#page-settings-customer-display .card,
#page-settings-printer .card,
#page-settings-device .card,
#page-settings-backup .card,
#page-settings-till .card,
#page-settings-api .card,
#page-settings-theme .card,
#page-settings-reset .card,
#page-settings-about .card {
  max-height: none !important;
  height: auto !important;
  overflow: visible !important;
}

@media (max-width: 820px) {
  #page-pos.active { height: auto !important; overflow: visible !important; }
  #page-pos.active .pos-layout { height: auto !important; overflow: visible !important; }
}


/* ============================================================================
   44. BACKUP SCHEDULE
   ============================================================================ */
.backup-schedule-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 5px;
  align-items: end;
  margin-top: 4px;
}
.backup-schedule-row .form-group { margin-bottom: 0; min-width: 0; }
.backup-schedule-row .form-group label { font-size: 5.5px; letter-spacing: 0.3px; }
.backup-schedule-row .btn { min-height: 25px; min-width: 72px; padding: 3px 11px; font-size: 8px; justify-content: center; }
.backup-schedule-status {
  font-size: 7px;
  color: var(--cc-text-muted);
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .backup-schedule-row { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }
  .backup-schedule-row .form-group label { font-size: 10px; }
  .backup-schedule-row .btn { width: 100%; min-height: var(--btn-h-mob); font-size: 14px; }
}


/* ============================================================================
   45. FILE UPLOAD
   ============================================================================ */
.file-upload-wrap { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.file-upload-wrap input[type="file"] {
  flex: 1;
  min-width: 54px;
  padding: 2px 5px;
  font-size: 7px;
  min-height: 23px;
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface);
  color: var(--cc-text-primary);
}
.file-upload-wrap .file-name {
  font-size: 6px;
  color: var(--cc-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 90px;
}

@media (max-width: 820px) {
  .file-upload-wrap input[type="file"] { min-height: var(--input-h-mob); font-size: 13px; padding: 8px 10px; }
  .file-upload-wrap .file-name { font-size: 11px; max-width: 180px; }
}


/* ============================================================================
   PART I â€” UTILITIES
   ============================================================================ */

/* ============================================================================
   46. UTILITY CLASSES
   ============================================================================ */
.flex-between { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 2px; }
.gap-8 { gap: 5px; }
.mt-8 { margin-top: 5px; }
.mb-8 { margin-bottom: 5px; }
.text-muted { color: var(--cc-text-muted); }
.text-center { text-align: center; }
.fw-600 { font-weight: 400; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 7px; }
.img-upload-preview {
  width: 43px;
  height: 43px;
  object-fit: cover;
  background: var(--cc-surface-dark);
  border: 1.5px solid var(--cc-border);
  cursor: pointer;
}


/* ============================================================================
   47. TOGGLE SWITCH â€” square with white knob, perfectly centered
   ----------------------------------------------------------------------------
   - Square track (grey off / gradient blue on)
   - White square knob, perfectly centered vertically & horizontally
   - No glow/focus ring
   - Text and track aligned
   ============================================================================ */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  cursor: pointer;
  font-size: 10px;
  color: var(--cc-text-secondary);
  font-weight: 400;
  line-height: 1.2;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  text-transform: none;
  letter-spacing: normal;
  margin: 0;
  padding: 0;
  min-height: 24px;
  vertical-align: middle;
  border-radius: 0;
}

/* Hide native checkbox completely */
.toggle-switch input,
.toggle-switch input[type="checkbox"] {
  position: absolute !important;
  opacity: 0 !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  outline: none !important;
  pointer-events: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  visibility: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  overflow: hidden !important;
}

/* Track: square, fixed size */
.toggle-switch .slider {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  background: var(--cc-text-muted);
  transition: background 0.2s;
  flex-shrink: 0;
  vertical-align: middle;
  border-radius: 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* White square knob â€” perfectly centered vertically */
.toggle-switch .slider::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  transition: left 0.2s;
  box-shadow: none;
  border-radius: 0;
  box-sizing: border-box;
}

/* ON state: gradient blue track */
.toggle-switch input:checked + .slider {
  background: var(--cc-primary);
  background-image: var(--cc-primary-gradient);
  background-size: 100% 100%;
}

/* ON state: knob slides to right, still perfectly centered */
.toggle-switch input:checked + .slider::after {
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 0;
  box-shadow: none;
}

/* No focus glow */
.toggle-switch:focus-within .slider { box-shadow: none !important; outline: none !important; }

/* Text-before-slider variant */
.toggle-switch.switch-first { flex-direction: row-reverse; justify-content: flex-end; }

/* Cancel `.form-group label` styles that break the toggle */
.form-group label.toggle-switch,
.form-group .toggle-switch,
.form-group > label.toggle-switch {
  display: inline-flex !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  color: var(--cc-text-secondary) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  margin-bottom: 0 !important;
  line-height: 1.2 !important;
  min-height: 24px !important;
  vertical-align: middle !important;
}

/* Side-by-side toggles in a form row */
.form-row .form-group > .toggle-switch,
.form-row-3 .form-group > .toggle-switch,
.form-row-4 .form-group > .toggle-switch { margin-top: 0; }
.form-group > label:not(.toggle-switch) + .toggle-switch { margin-top: 0; }
.form-group > .toggle-switch:only-of-type { display: inline-flex !important; align-items: center; min-height: 24px; }

/* MOBILE (Android-friendly, larger tap target) */
@media (max-width: 820px) {
  .toggle-switch { font-size: 12px; gap: 10px; min-height: 32px; }
  .toggle-switch .slider { width: 48px; height: 26px; border-radius: 0; }
  .toggle-switch .slider::after {
    width: 20px;
    height: 20px;
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border-radius: 0;
    box-shadow: none;
  }
  .toggle-switch input:checked + .slider::after {
    left: 25px;
    top: 50%;
    transform: translateY(-50%);
  }
  .form-group label.toggle-switch,
  .form-group .toggle-switch,
  .form-group > label.toggle-switch { font-size: 12px !important; min-height: 32px !important; }
  .form-group > .toggle-switch:only-of-type { min-height: 32px; }
  .permission-group .perm-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px; }
  .permission-group .perm-grid label { font-size: 11px; padding: 4px 2px; }
  .permission-group .perm-grid input[type="checkbox"] { width: 18px; height: 18px; }
}


/* ============================================================================
   48. PERMISSION GROUPS
   ============================================================================ */
.permission-group {
  margin: 2px 0 5px;
  padding: 4px 7px;
  background: var(--cc-surface-dark);
  border: 1px solid var(--cc-border);
}
.permission-group .perm-title {
  font-size: 8px;
  font-weight: 400;
  color: var(--cc-text-secondary);
  margin-bottom: 2px;
}
.permission-group .perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(81px, 1fr));
  gap: 2px;
}
.permission-group .perm-grid label {
  font-size: 7px;
  font-weight: 400;
  color: var(--cc-text-secondary);
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 1px 2px;
}
.permission-group .perm-grid input[type="checkbox"] {
  width: 11px;
  height: 11px;
  accent-color: var(--cc-primary);
  cursor: pointer;
  min-height: auto;
}


/* ============================================================================
   49. SETTINGS GROUP + ABOUT ROWS
   ============================================================================ */
.settings-group { margin-bottom: 11px; }
.settings-group .group-title {
  font-size: 10px;
  font-weight: 400;
  color: var(--cc-text-secondary);
  padding: 2px 0;
  border-bottom: 2px solid var(--cc-border);
  margin-bottom: 7px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.about-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid var(--cc-border);
  font-size: 9px;
}
.about-row .label { color: var(--cc-text-secondary); }
.about-row .value { font-weight: 400; color: var(--cc-text-primary); }
.about-footer {
  text-align: center !important;
  width: 100% !important;
  display: block !important;
  margin: 13px auto 4px !important;
  padding: 9px 0 4px !important;
  border-top: 1px dashed var(--cc-border) !important;
  color: var(--cc-text-muted) !important;
  font-size: 9px !important;
  line-height: 1.5 !important;
  letter-spacing: 0.3px !important;
}


/* ============================================================================
   50. RESET WARNING
   ============================================================================ */
.reset-warning {
  background: var(--cc-danger-bg);
  border: 2px solid var(--cc-danger);
  padding: 9px 13px;
  margin: 5px 0 9px;
  color: #991b1b;
  font-size: 9px;
}
.reset-warning .strong { font-weight: 400 !important; }


/* ============================================================================
   51. SCALE MODAL
   ============================================================================ */
.scale-modal .scale-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 5px;
  margin-top: 2px;
}
.scale-modal .scale-inputs input,
.scale-modal .scale-inputs select {
  font-size: 10px;
  padding: 2px 5px;
  height: var(--input-h);
  min-height: var(--input-h);
}
.scale-modal .scale-result {
  margin-top: 5px;
  padding: 7px 11px;
  background: var(--cc-primary-bg);
  border: 2px solid var(--cc-primary);
  text-align: center;
  font-weight: 400;
  font-size: 14px;
  color: var(--cc-primary);
}

@media (max-width: 820px) {
  .scale-modal .scale-inputs input,
  .scale-modal .scale-inputs select {
    font-size: 16px;
    height: var(--input-h-mob);
    min-height: var(--input-h-mob);
    padding: 6px 12px;
  }
  .scale-modal .scale-result { font-size: 20px; padding: 12px; }
}


/* ============================================================================
   52. EMPTY-STATE HELPERS
   ============================================================================ */
@media (max-width: 820px) {
  .form-row,
  .form-row-3,
  .form-row-4 { grid-template-columns: minmax(0, 1fr); }
  .page-content { padding: 11px 12px 22px; padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  .card { padding: 11px 12px; }
  .modal { padding: 14px 14px 18px; }
  .grid-2 { grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .modal h3 { font-size: 16px; }
  .customer-display { width: calc(100vw - 20px); max-width: 400px; padding: 14px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); right: 10px; left: 10px; margin: 0 auto; }
}
@media (max-width: 480px) {
  .card { padding: 10px 11px; }
  .card-title { font-size: 12px; }
  .modal { padding: 12px 12px 14px; }
  .modal h3 { font-size: 15px; }
}


/* ============================================================================
   53. MOBILE SIDEBAR FOOTER
   ============================================================================ */
@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sidebar-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .sidebar-footer {
    flex-shrink: 0;
    padding: 6px 6px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    background: var(--cc-surface);
    border-top: 1px solid var(--cc-border);
  }
  .sidebar-footer button {
    min-height: 52px;
    padding: 6px 6px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 10px;
  }
  .sidebar-footer button i { font-size: 18px; width: auto; min-width: 0; }
  .sidebar-footer button span { display: block !important; font-size: 10px; line-height: 1.1; text-align: center; }
}


/* ============================================================================
   54. RESPONSIVE LAYOUT
   ============================================================================ */
@media (max-width: 820px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--cc-sidebar-collapsed);
    z-index: 500;
  }
  .sidebar:not(.collapsed) { width: 244px; box-shadow: 4px 0 22px rgba(0, 0, 0, 0.25); }
  .sidebar-mobile-close {
    display: flex;
    position: absolute;
    top: 9px;
    right: 9px;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    border: none;
    font-size: 16px;
    cursor: pointer;
    z-index: 501;
  }
  .sidebar.collapsed .sidebar-mobile-close {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  .sidebar-backdrop.open { display: block; opacity: 1; }
  .main { margin-left: var(--cc-sidebar-collapsed); }
  .form-row,
  .form-row-3,
  .form-row-4 { grid-template-columns: minmax(0, 1fr); }
}


/* ============================================================================
   PART J â€” RESPONSIVE LOCKS
   ============================================================================ */

/* ============================================================================
   55. MOBILE IMPROVEMENTS
   ============================================================================ */
html, body {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
  max-width: 100vw;
}
img { max-width: 100%; height: auto; }
.main, .page-content { max-width: 100vw; overflow-x: hidden; }


/* ============================================================================
   56. DROPDOWN STYLED (Custom)
   ============================================================================ */
.dropdown-styled {
  border: 1.5px solid var(--cc-border);
  background: var(--cc-surface-dark);
  color: var(--cc-text-primary);
  padding: 3px 22px 3px 7px;
  font-size: 10px;
  min-height: 27px;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%2394A3B8' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 7px center;
  cursor: pointer;
  font-family: var(--cc-font);
  transition: border 0.2s, box-shadow 0.2s;
  min-width: 54px;
}
.dropdown-styled:focus { border-color: var(--cc-primary); box-shadow: 0 0 0 3px var(--cc-primary-bg); }
.dropdown-styled option {
  background: var(--cc-surface);
  color: var(--cc-text-primary);
  padding: 2px 5px;
  font-size: 10px;
}

@media (max-width: 820px) {
  .dropdown-styled {
    min-height: var(--input-h-mob);
    height: var(--input-h-mob);
    font-size: 16px;
    padding: 6px 28px 6px 12px;
    background-position: right 10px center;
  }
  .dropdown-styled option { font-size: 14px; }
}


/* ============================================================================
   57. UNIFORM MOBILE BUTTONS
   ============================================================================ */
@media (max-width: 820px) {
  #swExportPdfBtn,
  #swExportExcelBtn,
  #swExportPowerBIBtn,
  #historySearchBtn,
  #historyResetBtn,
  #historyExportBtn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
    padding: 0 14px !important;
    margin: 0 !important;
    font-size: 14px !important;
  }
}


/* ============================================================================
   58. DENOMINATION GRID (mobile)
   ============================================================================ */
@media (max-width: 820px) {
  .denomination-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .denomination-grid input {
    height: var(--input-h-mob);
    min-height: var(--input-h-mob);
    font-size: 16px;
    padding: 6px 12px;
    font-weight: 400;
  }
}


/* ============================================================================
   59. TABLE TOOLBAR â€” DESKTOP SAME-LINE
   ============================================================================ */
@media (min-width: 821px) {
  .table-wrap .table-toolbar { flex-wrap: nowrap !important; overflow-x: auto; gap: 5px; }
  .table-wrap .table-toolbar .btn,
  .table-wrap .table-toolbar .btn-sm,
  .table-wrap .table-toolbar .btn-custom,
  .table-wrap .table-toolbar .btn-reset-size {
    flex: 0 0 auto !important;
    padding: 0 9px !important;
    height: 31px !important;
    min-height: 31px !important;
    min-width: auto !important;
    font-size: 9px !important;
    white-space: nowrap;
    gap: 4px !important;
  }
  #page-products .table-wrap .table-toolbar .search-icon-wrap,
  #page-inventory .table-wrap .table-toolbar .search-icon-wrap {
    flex: 0 0 306px !important;
    max-width: 306px !important;
    min-width: 234px;
  }
}
@media (max-width: 1280px) and (min-width: 821px) {
  .table-wrap .table-toolbar .btn,
  .table-wrap .table-toolbar .btn-sm {
    padding: 0 7px !important;
    height: 29px !important;
    min-height: 29px !important;
    font-size: 8.5px !important;
  }
  .table-wrap .table-toolbar .btn span,
  .table-wrap .table-toolbar .btn-sm span { display: none; }
}


/* ============================================================================
   60. UNIVERSAL HEIGHT LOCKS + GLOBAL SOFT TEXT + FINAL OVERRIDES
   ============================================================================ */

/* --- Universal button height lock (desktop) --- */
@media (min-width: 821px) {
  .btn, .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-accent, .btn-info,
  .btn-save, .btn-cancel, .btn-custom, .btn-reset-size, .btn-sm,
  .filter-actions .btn, .filter-actions .btn-sm,
  .history-search-actions .btn, .history-search-actions .btn-sm,
  .report-filters .filter-actions .btn, .report-filters .filter-actions .btn-sm,
  .stockworth-actions .btn, .stockworth-actions .btn-sm,
  .table-wrap .table-toolbar .btn, .table-wrap .table-toolbar .btn-sm,
  .modal-actions .btn, .modal-actions .btn-sm,
  .invoice-tpl-actions .btn, .template-selector-actions .btn,
  #reportApplyFilters, #reportResetFilters, #reportExportExcel, #reportExportPowerBI,
  #reportExportPdfBtn, #generateCustomerReportBtn,
  #historySearchBtn, #historyResetBtn, #historyExportBtn,
  #swExportPdfBtn, #swExportExcelBtn, #swExportPowerBIBtn, #swSelectProductBtn,
  #debtAddBtn, #debtExportPdfBtn, #debtExportExcelBtn, #debtExportPowerBIBtn,
  #addProductBtn, #manageCategoriesBtn, #manageBrandsBtn, #importProductsBtn, #exportProductsBtn,
  #prodExportPdfBtn, #prodExportExcelBtn, #prodExportPowerBIBtn,
  #invAdjustBtn, #invReorderBtn, #invAutoOrderBtn, #invExportPdfBtn, #invExportExcelBtn, #invExportPowerBIBtn,
  #addCustomerBtn, #addEmployeeBtn, #addSupplierBtn, #addCashierBtn,
  #saveCompanyBtn, #cancelCompanyBtn, #removeCompanyLogoBtn,
  #saveRegionBtn, #cancelRegionBtn, #saveAppBtn, #cancelAppBtn,
  #saveCdBtn, #cancelCdBtn, #savePrinterBtn, #cancelPrinterBtn,
  #saveDeviceBtn, #cancelDeviceBtn, #saveApiBtn, #cancelApiBtn, #testApiBtn,
  #saveThemeBtn, #cancelThemeBtn, #resetDataBtn,
  #backupNowBtn, #restoreBackupBtn, #downloadBackupBtn, #scheduleBackupBtn,
  #saveTillBtn, #cancelTillBtn, #openDrawerTestBtn, #addTillBtn,
  #uomAddBtn, #uomUpdateBtn, #uomCancelBtn, #vatAddBtn, #vatUpdateBtn, #vatCancelBtn,
  #testPrinterBtn, #listPrintersBtn, #savePrinterCounterBtn,
  #modalCancel, #modalConfirm {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: var(--btn-h) !important;
    min-height: var(--btn-h) !important;
    max-height: var(--btn-h) !important;
    box-sizing: border-box !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1 !important;
  }
}

/* --- Universal button height lock (mobile) --- */
@media (max-width: 820px) {
  .btn, .btn-primary, .btn-secondary, .btn-success, .btn-danger, .btn-accent, .btn-info,
  .btn-save, .btn-cancel, .btn-custom, .btn-reset-size, .btn-sm,
  .filter-actions .btn, .filter-actions .btn-sm,
  .history-search-actions .btn, .history-search-actions .btn-sm,
  .report-filters .filter-actions .btn, .report-filters .filter-actions .btn-sm,
  .stockworth-actions .btn, .stockworth-actions .btn-sm,
  .table-wrap .table-toolbar .btn, .table-wrap .table-toolbar .btn-sm,
  .modal-actions .btn, .modal-actions .btn-sm,
  .invoice-tpl-actions .btn, .template-selector-actions .btn,
  #reportApplyFilters, #reportResetFilters, #reportExportExcel, #reportExportPowerBI,
  #reportExportPdfBtn, #generateCustomerReportBtn,
  #historySearchBtn, #historyResetBtn, #historyExportBtn,
  #swExportPdfBtn, #swExportExcelBtn, #swExportPowerBIBtn, #swSelectProductBtn,
  #debtAddBtn, #debtExportPdfBtn, #debtExportExcelBtn, #debtExportPowerBIBtn,
  #addProductBtn, #manageCategoriesBtn, #manageBrandsBtn, #importProductsBtn, #exportProductsBtn,
  #prodExportPdfBtn, #prodExportExcelBtn, #prodExportPowerBIBtn,
  #invAdjustBtn, #invReorderBtn, #invAutoOrderBtn, #invExportPdfBtn, #invExportExcelBtn, #invExportPowerBIBtn,
  #addCustomerBtn, #addEmployeeBtn, #addSupplierBtn, #addCashierBtn,
  #saveCompanyBtn, #cancelCompanyBtn, #removeCompanyLogoBtn,
  #saveRegionBtn, #cancelRegionBtn, #saveAppBtn, #cancelAppBtn,
  #saveCdBtn, #cancelCdBtn, #savePrinterBtn, #cancelPrinterBtn,
  #saveDeviceBtn, #cancelDeviceBtn, #saveApiBtn, #cancelApiBtn, #testApiBtn,
  #saveThemeBtn, #cancelThemeBtn, #resetDataBtn,
  #backupNowBtn, #restoreBackupBtn, #downloadBackupBtn, #scheduleBackupBtn,
  #saveTillBtn, #cancelTillBtn, #openDrawerTestBtn, #addTillBtn,
  #uomAddBtn, #uomUpdateBtn, #uomCancelBtn, #vatAddBtn, #vatUpdateBtn, #vatCancelBtn,
  #testPrinterBtn, #listPrintersBtn, #savePrinterCounterBtn,
  #loginBtn, #coPrintBtn, #coInvoiceBtn, #coSmsBtn, #coEmailBtn, #coBothBtn, #coCloseBtn,
  #modalCancel, #modalConfirm {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
    max-height: var(--btn-h-mob) !important;
    box-sizing: border-box !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    line-height: 1 !important;
    font-size: 14px !important;
  }
}

/* Small action buttons in tables */
.tpi-btn,
table td .actions button,
table td .actions .tpi-btn {
  height: 23px !important;
  min-height: 23px !important;
  max-height: 23px !important;
  width: 23px !important;
  min-width: 23px !important;
  max-width: 23px !important;
}
@media (max-width: 820px) {
  .tpi-btn,
  table td .actions button,
  table td .actions .tpi-btn {
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    font-size: 14px !important;
  }
}

.topbar-btn,
#themeToggleTop,
.topbar-left .menu-toggle {
  height: 32px !important;
  min-height: 32px !important;
  max-height: 32px !important;
}
@media (max-width: 820px) {
  .topbar-btn,
  #themeToggleTop,
  .topbar-left .menu-toggle {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }
}

/* --- Universal input height lock --- */
@media (min-width: 821px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not(.cart-item input):not(.topbar-center .search-box input),
  select:not(.cart-item select),
  textarea:not(.cart-item textarea),
  .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  .form-group select,
  .table-wrap .table-toolbar input,
  .table-wrap .table-toolbar select,
  .report-filters .form-group input,
  .report-filters .form-group select,
  .history-search-row .form-group input,
  .history-search-row .form-group select,
  .pos-toolbar input,
  .pos-toolbar select,
  .pos-customer-area input,
  .pos-customer-area select,
  .pos-staff-row select,
  .cart-summary .cart-bill-disc input,
  .cart-summary .cart-payment-row select,
  .backup-schedule-row .form-group input,
  .backup-schedule-row .form-group select,
  .scanner-overlay .scanner-input,
  .global-search-overlay .search-container input,
  .pos-toolbar .search-icon-wrap input,
  .pos-toolbar .recall-id-wrap input {
    height: var(--input-h) !important;
    min-height: var(--input-h) !important;
    max-height: none !important;
    box-sizing: border-box !important;
  }
  .topbar-center .search-box input { height: auto !important; min-height: 23px !important; }
}

@media (max-width: 820px) {
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="submit"]):not([type="button"]):not(.cart-item input):not(.topbar-center .search-box input),
  select:not(.cart-item select),
  textarea:not(.cart-item textarea),
  .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  .form-group select,
  .table-wrap .table-toolbar input,
  .table-wrap .table-toolbar select,
  .report-filters .form-group input,
  .report-filters .form-group select,
  .history-search-row .form-group input,
  .history-search-row .form-group select,
  .pos-toolbar input,
  .pos-toolbar select,
  .pos-customer-area input,
  .pos-customer-area select,
  .pos-staff-row select,
  .cart-summary .cart-bill-disc input,
  .cart-summary .cart-payment-row select,
  .backup-schedule-row .form-group input,
  .backup-schedule-row .form-group select,
  .scanner-overlay .scanner-input,
  .global-search-overlay .search-container input,
  .pos-toolbar .search-icon-wrap input,
  .pos-toolbar .recall-id-wrap input {
    height: var(--input-h-mob) !important;
    min-height: var(--input-h-mob) !important;
    box-sizing: border-box !important;
    font-size: 16px !important;
  }
  .topbar-center .search-box input { height: auto !important; min-height: 28px !important; }
  .denomination-grid input { height: var(--input-h-mob) !important; min-height: var(--input-h-mob) !important; }
}

/* --- Mobile: list pages buttons one-per-line --- */
@media (max-width: 820px) {
  #page-products .table-wrap .table-toolbar,
  #page-inventory .table-wrap .table-toolbar,
  #page-customers .table-wrap .table-toolbar,
  #page-debt .table-wrap .table-toolbar,
  #page-employees .table-wrap .table-toolbar,
  #page-suppliers .table-wrap .table-toolbar,
  #page-reports .table-wrap .table-toolbar,
  #page-history .table-wrap .table-toolbar,
  #page-stockworth .table-wrap .table-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    padding: 10px 12px !important;
  }
  #page-products .table-wrap .table-toolbar > *,
  #page-inventory .table-wrap .table-toolbar > *,
  #page-customers .table-wrap .table-toolbar > *,
  #page-debt .table-wrap .table-toolbar > *,
  #page-employees .table-wrap .table-toolbar > *,
  #page-suppliers .table-wrap .table-toolbar > *,
  #page-reports .table-wrap .table-toolbar > *,
  #page-history .table-wrap .table-toolbar > *,
  #page-stockworth .table-wrap .table-toolbar > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  #page-products .table-wrap .table-toolbar .search-icon-wrap,
  #page-inventory .table-wrap .table-toolbar .search-icon-wrap,
  #page-customers .table-wrap .table-toolbar .search-icon-wrap,
  #page-debt .table-wrap .table-toolbar .search-icon-wrap,
  #page-employees .table-wrap .table-toolbar .search-icon-wrap,
  #page-suppliers .table-wrap .table-toolbar .search-icon-wrap {
    height: var(--input-h-mob) !important;
    margin-right: 0 !important;
    position: relative;
    display: flex;
    align-items: center;
  }
  #page-products .table-wrap .table-toolbar .search-icon-wrap input,
  #page-inventory .table-wrap .table-toolbar .search-icon-wrap input,
  #page-customers .table-wrap .table-toolbar .search-icon-wrap input,
  #page-debt .table-wrap .table-toolbar .search-icon-wrap input,
  #page-employees .table-wrap .table-toolbar .search-icon-wrap input,
  #page-suppliers .table-wrap .table-toolbar .search-icon-wrap input {
    height: var(--input-h-mob) !important;
    min-height: var(--input-h-mob) !important;
    font-size: 16px;
    padding-left: 28px !important;
  }
  #page-products .table-wrap .table-toolbar .btn,
  #page-products .table-wrap .table-toolbar .btn-sm,
  #page-products .table-wrap .table-toolbar .btn-custom,
  #page-products .table-wrap .table-toolbar .btn-reset-size,
  #page-inventory .table-wrap .table-toolbar .btn,
  #page-inventory .table-wrap .table-toolbar .btn-sm,
  #page-inventory .table-wrap .table-toolbar .btn-custom,
  #page-inventory .table-wrap .table-toolbar .btn-reset-size,
  #page-customers .table-wrap .table-toolbar .btn,
  #page-customers .table-wrap .table-toolbar .btn-sm,
  #page-debt .table-wrap .table-toolbar .btn,
  #page-debt .table-wrap .table-toolbar .btn-sm,
  #page-employees .table-wrap .table-toolbar .btn,
  #page-employees .table-wrap .table-toolbar .btn-sm,
  #page-suppliers .table-wrap .table-toolbar .btn,
  #page-suppliers .table-wrap .table-toolbar .btn-sm,
  #page-reports .table-wrap .table-toolbar .btn,
  #page-reports .table-wrap .table-toolbar .btn-sm,
  #page-history .table-wrap .table-toolbar .btn,
  #page-history .table-wrap .table-toolbar .btn-sm,
  #page-stockworth .table-wrap .table-toolbar .btn,
  #page-stockworth .table-wrap .table-toolbar .btn-sm {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
    max-height: var(--btn-h-mob) !important;
    padding: 0 14px !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    white-space: nowrap;
  }
  #page-products .table-wrap .table-toolbar select,
  #page-products .table-wrap .table-toolbar input:not([type="file"]),
  #page-inventory .table-wrap .table-toolbar select,
  #page-inventory .table-wrap .table-toolbar input:not([type="file"]),
  #page-customers .table-wrap .table-toolbar select,
  #page-debt .table-wrap .table-toolbar select,
  #page-employees .table-wrap .table-toolbar select,
  #page-suppliers .table-wrap .table-toolbar select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: var(--input-h-mob) !important;
    min-height: var(--input-h-mob) !important;
    font-size: 16px !important;
  }
  #swExportPdfBtn, #swExportExcelBtn, #swExportPowerBIBtn {
    width: 100% !important;
    min-width: 0 !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
  }
}

/* --- Mobile: settings pages buttons one-per-line --- */
@media (max-width: 820px) {
  #page-settings-company .form-row,
  #page-settings-region .form-row,
  #page-settings-uom .form-row,
  #page-settings-vat .form-row,
  #page-settings-application .form-row,
  #page-settings-cashier .form-row,
  #page-settings-customer-display .form-row,
  #page-settings-printer .form-row,
  #page-settings-device .form-row,
  #page-settings-backup .form-row,
  #page-settings-till .form-row,
  #page-settings-api .form-row,
  #page-settings-theme .form-row,
  #page-settings-reset .form-row,
  #page-settings-about .form-row { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }

  #page-settings-company .btn,
  #page-settings-company .btn-sm,
  #page-settings-company .btn-custom,
  #page-settings-company .btn-reset-size,
  #page-settings-region .btn,
  #page-settings-region .btn-sm,
  #page-settings-region .btn-custom,
  #page-settings-region .btn-reset-size,
  #page-settings-uom .btn,
  #page-settings-uom .btn-sm,
  #page-settings-uom .btn-custom,
  #page-settings-uom .btn-reset-size,
  #page-settings-vat .btn,
  #page-settings-vat .btn-sm,
  #page-settings-vat .btn-custom,
  #page-settings-vat .btn-reset-size,
  #page-settings-application .btn,
  #page-settings-application .btn-sm,
  #page-settings-application .btn-custom,
  #page-settings-application .btn-reset-size,
  #page-settings-cashier .btn,
  #page-settings-cashier .btn-sm,
  #page-settings-cashier .btn-custom,
  #page-settings-cashier .btn-reset-size,
  #page-settings-customer-display .btn,
  #page-settings-customer-display .btn-sm,
  #page-settings-customer-display .btn-custom,
  #page-settings-customer-display .btn-reset-size,
  #page-settings-printer .btn,
  #page-settings-printer .btn-sm,
  #page-settings-printer .btn-custom,
  #page-settings-printer .btn-reset-size,
  #page-settings-device .btn,
  #page-settings-device .btn-sm,
  #page-settings-device .btn-custom,
  #page-settings-device .btn-reset-size,
  #page-settings-backup .btn,
  #page-settings-backup .btn-sm,
  #page-settings-backup .btn-custom,
  #page-settings-backup .btn-reset-size,
  #page-settings-till .btn,
  #page-settings-till .btn-sm,
  #page-settings-till .btn-custom,
  #page-settings-till .btn-reset-size,
  #page-settings-api .btn,
  #page-settings-api .btn-sm,
  #page-settings-api .btn-custom,
  #page-settings-api .btn-reset-size,
  #page-settings-theme .btn,
  #page-settings-theme .btn-sm,
  #page-settings-theme .btn-custom,
  #page-settings-theme .btn-reset-size,
  #page-settings-reset .btn,
  #page-settings-reset .btn-sm,
  #page-settings-reset .btn-custom,
  #page-settings-reset .btn-reset-size {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
    max-height: var(--btn-h-mob) !important;
    padding: 0 14px !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
    white-space: nowrap;
    box-sizing: border-box !important;
  }

  #page-settings-company [style*="display:flex"][style*="gap"],
  #page-settings-region [style*="display:flex"][style*="gap"],
  #page-settings-uom [style*="display:flex"][style*="gap"],
  #page-settings-vat [style*="display:flex"][style*="gap"],
  #page-settings-application [style*="display:flex"][style*="gap"],
  #page-settings-cashier [style*="display:flex"][style*="gap"],
  #page-settings-customer-display [style*="display:flex"][style*="gap"],
  #page-settings-printer [style*="display:flex"][style*="gap"],
  #page-settings-device [style*="display:flex"][style*="gap"],
  #page-settings-backup [style*="display:flex"][style*="gap"],
  #page-settings-till [style*="display:flex"][style*="gap"],
  #page-settings-api [style*="display:flex"][style*="gap"],
  #page-settings-theme [style*="display:flex"][style*="gap"],
  #page-settings-reset [style*="display:flex"][style*="gap"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
  }

  #page-settings-printer .printer-counter-tab {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    margin-bottom: 6px;
    min-height: var(--btn-h-mob);
  }
  #page-settings-backup .backup-schedule-row { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  #page-settings-backup .backup-schedule-row .btn { width: 100% !important; min-width: 0 !important; }
  #page-settings-till .till-manager > div:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    width: 100% !important;
  }
  #page-settings-till .till-manager > div:first-child > * { width: 100% !important; min-width: 0 !important; }
  #page-settings-api .settings-group[style*="border-left"] > .form-row { grid-template-columns: minmax(0, 1fr) !important; gap: 10px !important; }
  #page-settings-reset #resetDataBtn { width: 100% !important; min-width: 0 !important; height: var(--btn-h-mob) !important; min-height: var(--btn-h-mob) !important; }
  #page-settings-printer #testPrinterBtn,
  #page-settings-printer #listPrintersBtn,
  #page-settings-printer #savePrinterCounterBtn {
    width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
  }
}

/* --- Mobile: stock worth select button one-per-line --- */
@media (max-width: 820px) {
  #page-stockworth .card > div[style*="display:flex"][style*="flex-wrap"] {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    width: 100% !important;
  }
  #page-stockworth .card > div[style*="display:flex"][style*="flex-wrap"] > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
  }
  #page-stockworth .card > div[style*="display:flex"][style*="flex-wrap"] > i.fa-search,
  #page-stockworth .card > div[style*="display:flex"][style*="flex-wrap"] > i.fal.fa-search { display: none !important; }
  #swSelectProductBtn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: 1 1 100% !important;
    height: var(--btn-h-mob) !important;
    min-height: var(--btn-h-mob) !important;
    max-height: var(--btn-h-mob) !important;
    padding: 0 14px !important;
    margin: 0 !important;
    font-size: 14px !important;
    line-height: 1 !important;
  }
  #page-stockworth .smart-search-wrap { width: 100% !important; min-width: 0 !important; flex: 1 1 100% !important; }
  #swProductSearch {
    width: 100% !important;
    height: var(--input-h-mob) !important;
    min-height: var(--input-h-mob) !important;
    font-size: 16px !important;
  }
}

/* --- Number input spinners removed globally --- */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  display: none !important;
}
input[type="number"] {
  -moz-appearance: textfield !important;
  appearance: textfield !important;
}

/* --- Global soft text --- */
h1, h2, h3, h4, h5, h6, strong, b,
.card-title, .section-title, .co-title, .group-title,
.about-row .value, label, td strong, td b { font-weight: 400 !important; }

.modal h3, .card-title, .co-title, .stat-item .value,
.receipt-content .receipt-total .total-amount,
.checkout-btn, .auth-btn, .co-btn, .pos-item .price, .co-total,
#modalBody .debt-pay-hero .value,
.sidebar-brand-wrap .brand-logo .brand-text .name { font-weight: 500 !important; }

.backup-schedule-status,
#lastBackupTime,
.card-title span,
.about-row .label,
.receipt-content .receipt-header .receipt-datetime,
.receipt-content .receipt-header .receipt-user,
.receipt-content .receipt-header .receipt-sales-rep,
.receipt-content .receipt-header .receipt-store-addr {
  color: var(--cc-text-muted) !important;
  font-weight: 400 !important;
  font-size: 9px !important;
}
.form-group label { font-weight: 400 !important; color: var(--cc-text-secondary) !important; }
table thead th { font-weight: 400 !important; color: var(--cc-text-secondary) !important; }
table td, table td strong, table td b { font-weight: 400 !important; }
.sidebar-nav button.active { font-weight: 400 !important; }
kbd, code { font-weight: 400 !important; }
table td .status-badge { font-weight: 400 !important; }
.stat-item .value,
#modalBody .debt-ledger-stats > div .value,
#modalBody .debt-ledger-summary > div .value,
#modalBody .debt-final-balance .value { font-weight: 500 !important; }
.cart-summary .row.total, .co-total { font-weight: 500 !important; }
.nav-label { font-weight: 400 !important; }

*[style*="font-weight:bold"],
*[style*="font-weight: bold"],
*[style*="font-weight:700"],
*[style*="font-weight: 700"],
*[style*="font-weight:600"],
*[style*="font-weight: 600"] { font-weight: 400 !important; }

#backupScheduleStatus,
#lastBackupTime {
  font-size: 9px !important;
  color: var(--cc-text-muted) !important;
  font-weight: 400 !important;
}
input::placeholder, textarea::placeholder, select::placeholder {
  color: var(--cc-text-muted) !important;
  font-weight: 400 !important;
  font-size: 10px !important;
}
.card .sub, .modal .sub, .settings-group .group-title, .card-title span {
  color: var(--cc-text-muted) !important;
  font-weight: 400 !important;
}

/* --- Final override: all placeholders + all dropdowns = 10px --- */
input::placeholder,
textarea::placeholder,
select::placeholder,
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder,
select::-webkit-input-placeholder,
input::-moz-placeholder,
textarea::-moz-placeholder,
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  font-size: 10px !important;
  font-weight: 400 !important;
  color: var(--cc-text-muted) !important;
  opacity: 1 !important;
  font-family: var(--cc-font) !important;
  letter-spacing: normal !important;
}

select, select option, optgroup { font-size: 10px !important; font-family: var(--cc-font) !important; }
.dropdown-styled, .dropdown-styled option, .dropdown-styled optgroup { font-size: 10px !important; }

.pos-toolbar select,
.pos-toolbar select option,
.pos-staff-row select,
.pos-staff-row select option,
.pos-customer-area select,
.pos-customer-area select option,
.cart-summary .cart-payment-row .cart-payment-select,
.cart-summary .cart-payment-row .cart-payment-select option,
.cart-summary .cart-payment-row .cart-customer-select,
.cart-summary .cart-payment-row .cart-customer-select option,
.report-filters .form-group select,
.report-filters .form-group select option,
.history-search-row .form-group select,
.history-search-row .form-group select option,
.table-wrap .table-toolbar select,
.table-wrap .table-toolbar select option,
.table-wrap .table-toolbar .dropdown-styled option,
#page-settings-region select,
#page-settings-region select option,
#page-settings-vat select,
#page-settings-vat select option,
#page-settings-uom select,
#page-settings-uom select option,
#page-settings-application select,
#page-settings-application select option,
#page-settings-printer select,
#page-settings-printer select option,
#page-settings-device select,
#page-settings-device select option,
#page-settings-backup select,
#page-settings-backup select option,
#page-settings-cashier select,
#page-settings-cashier select option,
#page-settings-api select,
#page-settings-api select option,
#page-settings-till select,
#page-settings-till select option,
#page-settings-customer-display select,
#page-settings-customer-display select option {
  font-size: 10px !important;
}

@media (max-width: 820px) {
  input::placeholder,
  textarea::placeholder,
  select::placeholder,
  input::-webkit-input-placeholder,
  textarea::-webkit-input-placeholder,
  select::-webkit-input-placeholder,
  input::-moz-placeholder,
  textarea::-moz-placeholder,
  input:-ms-input-placeholder,
  textarea:-ms-input-placeholder {
    font-size: 10px !important;
  }
  select,
  select option,
  optgroup,
  .dropdown-styled,
  .dropdown-styled option,
  .pos-toolbar select,
  .pos-toolbar select option,
  .pos-staff-row select,
  .pos-staff-row select option,
  .pos-customer-area select,
  .pos-customer-area select option,
  .cart-summary .cart-payment-row .cart-payment-select,
  .cart-summary .cart-payment-row .cart-payment-select option,
  .cart-summary .cart-payment-row .cart-customer-select,
  .cart-summary .cart-payment-row .cart-customer-select option,
  .report-filters .form-group select,
  .report-filters .form-group select option,
  .history-search-row .form-group select,
  .history-search-row .form-group select option,
  .table-wrap .table-toolbar select,
  .table-wrap .table-toolbar select option {
    font-size: 10px !important;
  }
}


/* ============================================================================
   @font-face â€” Libre Barcode 39 for receipts / labels
   ============================================================================ */
@font-face {
  font-family: 'Libre Barcode 39';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('../fonts/LibreBarcode39-Regular.woff2') format('woff2');
}
@font-face {
  font-family: 'Libre Barcode 39 Extended';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('../fonts/LibreBarcode39Extended-Regular.woff2') format('woff2');
}