/* ==========================================================================
   RateIT RIIOT - Modern Store & Inventory Management System Stylesheet
   Strict Color Palette:
   - Lavender Mist:    #f4effa (Main background, wrappers, soft cards)
   - Dark Amethyst:    #2f184b (Primary text, deep headers, sidebars, accents)
   - Indigo Velvet:    #532b88 (Primary buttons, active states, badges)
   - Lavender Purple:  #9b72cf (Secondary buttons, highlights, hover states)
   - Wisteria:         #c8b1e4 (Borders, inactive tabs, table headers, soft fills)
   ========================================================================== */

:root {
  --lavender-mist: #f4effa;
  --dark-amethyst: #2f184b;
  --indigo-velvet: #532b88;
  --lavender-purple: #9b72cf;
  --wisteria: #c8b1e4;

  /* Surfaces & Functional Tokens */
  --bg-primary: #f4effa;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-muted: rgba(200, 177, 228, 0.25);
  --bg-amethyst-dark: #201034;
  --bg-amethyst-light: rgba(47, 24, 75, 0.05);

  --text-primary: #2f184b;
  --text-secondary: #5a4b6e;
  --text-muted: #7e6f94;
  --text-inverse: #ffffff;

  --border-light: #c8b1e4;
  --border-subtle: rgba(200, 177, 228, 0.45);
  --border-focus: #532b88;

  --status-success: #1b8754;
  --status-success-bg: #e8f5e9;
  --status-warning: #b25e00;
  --status-warning-bg: #fff3e0;
  --status-danger: #c5221f;
  --status-danger-bg: #fde8e8;

  --shadow-sm: 0 2px 6px rgba(47, 24, 75, 0.06);
  --shadow-md: 0 6px 18px rgba(47, 24, 75, 0.08);
  --shadow-lg: 0 14px 34px rgba(47, 24, 75, 0.12);
  --shadow-xl: 0 20px 48px rgba(47, 24, 75, 0.18);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  /* ========================================================================
     Design System: 4px/8px Geometric Spacing Rhythm & Fluid Spacing Scale
     ======================================================================== */
  --space-05: 0.125rem; /* 2px */
  --space-1:  0.25rem;  /* 4px */
  --space-2:  0.5rem;   /* 8px */
  --space-3:  0.75rem;  /* 12px */
  --space-4:  1rem;     /* 16px */
  --space-5:  1.25rem;  /* 20px */
  --space-6:  1.5rem;   /* 24px */
  --space-8:  2rem;     /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */

  /* Fluid Clamped Spacing Tokens (Scale seamlessly across phone -> 4K) */
  --space-fluid-xs: clamp(0.25rem, 0.6vw, 0.5rem);
  --space-fluid-sm: clamp(0.5rem, 1.2vw, 0.75rem);
  --space-fluid-md: clamp(0.75rem, 2vw, 1.25rem);
  --space-fluid-lg: clamp(1rem, 2.5vw, 2rem);
  --space-fluid-xl: clamp(1.5rem, 3.5vw, 3rem);

  /* Fluid Typography Scale */
  --text-fluid-xs:   clamp(0.68rem, 0.64rem + 0.2vw, 0.78rem);
  --text-fluid-sm:   clamp(0.78rem, 0.74rem + 0.25vw, 0.88rem);
  --text-fluid-base: clamp(0.88rem, 0.84rem + 0.3vw, 1rem);
  --text-fluid-md:   clamp(1rem, 0.94rem + 0.4vw, 1.15rem);
  --text-fluid-lg:   clamp(1.15rem, 1.05rem + 0.6vw, 1.35rem);
  --text-fluid-xl:   clamp(1.35rem, 1.2rem + 0.9vw, 1.75rem);
  --text-fluid-2xl:  clamp(1.65rem, 1.45rem + 1.2vw, 2.25rem);

  /* Accessible Touch Target Baselines */
  --touch-target-min: 48px;
  --touch-target-compact: 44px;

  /* Layout Boundaries & Actual Heights */
  --header-height: 68px;
  --footer-height: 44px;
  --cart-width: 420px;
  --header-actual-h: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  --bottom-nav-actual-h: calc(60px + env(safe-area-inset-bottom, 0px));
  --container-max-w: 1560px;
  --pos-max-w: 1920px;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  height: 100%;
  width: 100%;
  font-family: var(--font-main);
  background-color: var(--lavender-mist);
  color: var(--dark-amethyst);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  height: 100%;
  width: 100%;
  overflow: hidden;
  background-color: var(--lavender-mist);
  color: var(--dark-amethyst);
}

button {
  font-family: inherit;
  cursor: pointer !important;
  border: none;
  background: none;
  outline: none;
  touch-action: manipulation;
}

input, select, textarea {
  font-family: inherit;
  color: var(--dark-amethyst);
}

/* ==========================================================================
   Header & Top Navigation
   ========================================================================== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: calc(var(--header-height) + env(safe-area-inset-top, 0px));
  background: var(--dark-amethyst);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(0.5rem, env(safe-area-inset-top, 0px)) max(1.5rem, env(safe-area-inset-right, 0px)) 0.5rem max(1.5rem, env(safe-area-inset-left, 0px));
  box-shadow: 0 4px 20px rgba(47, 24, 75, 0.25);
  transition: all var(--transition-fast);
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--indigo-velvet), var(--lavender-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(83, 43, 136, 0.4);
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  line-height: 1.1;
}

.brand-highlight {
  color: var(--wisteria);
  margin-left: 2px;
}

.register-badge {
  font-size: 0.72rem;
  color: var(--wisteria);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(200, 177, 228, 0.2);
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--wisteria);
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer !important;
  user-select: none;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.nav-tab.active {
  background: var(--indigo-velvet);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(83, 43, 136, 0.5);
}

.stock-alert-pill {
  background: #ff5252;
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  margin-left: 2px;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

/* Cashier Pill & Edit Option */
.cashier-pill {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(200, 177, 228, 0.2);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.cashier-pill:hover {
  background: rgba(255, 255, 255, 0.15);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  flex-shrink: 0;
}

.cashier-info {
  display: flex;
  flex-direction: column;
}

.cashier-name-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.store-badge-row {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(200, 177, 228, 0.25);
  font-size: 0.72rem;
  color: var(--wisteria);
  transition: all var(--transition-fast);
  margin-top: 2px;
}

.store-badge-row:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-color: var(--lavender-purple);
}

.store-name-text {
  font-weight: 700;
  color: #ffffff;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cashier-label {
  font-size: 0.72rem;
  color: var(--wisteria);
  font-weight: 600;
}

.cashier-select-dropdown {
  background: rgba(47, 24, 75, 0.75);
  color: #ffffff;
  border: 1px solid rgba(200, 177, 228, 0.35);
  border-radius: var(--radius-xs);
  padding: 2px 6px;
  font-size: 0.78rem;
  font-weight: 700;
  outline: none;
  cursor: pointer;
  max-width: 125px;
}

.cashier-select-dropdown option {
  background: var(--dark-amethyst);
  color: #ffffff;
}

.cashier-edit-btn {
  color: var(--wisteria);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: 4px;
  transition: all var(--transition-fast);
}

.cashier-edit-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.25);
}

.clock-display {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: var(--wisteria);
}

.icon-action-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wisteria);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(200, 177, 228, 0.2);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.icon-action-btn:hover {
  background: var(--indigo-velvet);
  color: #ffffff;
}

.mobile-cart-btn {
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--indigo-velvet);
  color: #ffffff;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--lavender-purple);
  box-shadow: 0 2px 8px rgba(83, 43, 136, 0.4);
  flex-shrink: 0;
}

.cart-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff5252;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* ==========================================================================
   Main Layout & Panels
   ========================================================================== */
.app-main {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  position: relative;
  background-color: var(--lavender-mist);
  min-height: 0;
  height: calc(100dvh - var(--header-actual-h) - var(--footer-height));
  overflow: hidden;
}

.view-panel {
  display: none !important;
  flex: 1 1 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.view-panel.active {
  display: flex !important;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  animation: fadeIn 0.18s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   VIEW 1: RIIOT Register Two-Column Dashboard Layout (70% / 30%)
   ========================================================================== */
.pos-layout {
  display: flex;
  flex-direction: row;
  flex: 1 1 0;
  width: 100%;
  max-width: var(--pos-max-w);
  margin: 0 auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

/* Catalog Left Column */
.catalog-section {
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--lavender-mist);
  border-right: 1.5px solid var(--border-light);
  position: relative;
}

.catalog-toolbar {
  padding: 1rem 1.5rem 0.65rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--lavender-mist);
  border-bottom: 1px solid var(--border-subtle);
}

.search-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  gap: 0.65rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.search-box:focus-within {
  border-color: var(--indigo-velvet);
  box-shadow: 0 0 0 3px rgba(83, 43, 136, 0.15);
}

.search-box svg {
  color: var(--indigo-velvet);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--dark-amethyst);
  background: transparent;
}

.clear-search-btn {
  font-size: 1.2rem;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background var(--transition-fast);
}

.clear-search-btn:hover {
  background: var(--bg-muted);
  color: var(--dark-amethyst);
}

.catalog-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.category-chips {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.category-chips::-webkit-scrollbar {
  display: none;
}

.category-chip {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  white-space: nowrap;
  background: #ffffff;
  color: var(--dark-amethyst);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(47, 24, 75, 0.04);
}

.category-chip:hover {
  border-color: var(--lavender-purple);
  color: var(--indigo-velvet);
  transform: translateY(-1px);
}

.category-chip.active {
  background: var(--indigo-velvet);
  color: #ffffff;
  border-color: var(--indigo-velvet);
  box-shadow: 0 3px 10px rgba(83, 43, 136, 0.28);
}

.view-mode-toggle {
  display: flex;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 2px;
  flex-shrink: 0;
}

.view-mode-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.view-mode-btn:hover {
  color: var(--dark-amethyst);
  background: var(--bg-muted);
}

.view-mode-btn.active {
  background: var(--indigo-velvet);
  color: #ffffff;
}

/* Products Scroll Area */
.products-scroll-area {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 5rem 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--wisteria) transparent;
  -webkit-overflow-scrolling: touch;
}

.products-scroll-area::-webkit-scrollbar {
  width: 6px;
}

.products-scroll-area::-webkit-scrollbar-thumb {
  background-color: var(--wisteria);
  border-radius: var(--radius-full);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1.15rem;
}

/* Product Card */
.product-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  user-select: none;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--lavender-purple);
}

.product-card:active {
  transform: scale(0.98);
}

.product-card.out-of-stock {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.product-card.out-of-stock:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: var(--border-light);
}

.product-image-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, rgba(244, 239, 250, 0.8), rgba(200, 177, 228, 0.35));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.75rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(200, 177, 228, 0.3);
}

.product-image-box svg {
  width: 58%;
  height: 58%;
  color: var(--indigo-velvet);
  transition: transform var(--transition-fast);
}

.product-card:hover .product-image-box svg {
  transform: scale(1.08);
}

.product-badge-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  z-index: 15;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
  line-height: 1.2;
}

.badge-low-stock {
  background: #fef08a !important;
  color: #713f12 !important;
  border: 1.5px solid #eab308 !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(161, 98, 7, 0.35) !important;
}

.badge-out-stock {
  background: #fee2e2 !important;
  color: #991b1b !important;
  border: 1.5px solid #dc2626 !important;
  font-weight: 800 !important;
  box-shadow: 0 2px 8px rgba(185, 28, 28, 0.35) !important;
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-category {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}

.product-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  line-height: 1.25;
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-bottom-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.4rem;
}

.product-price {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--indigo-velvet);
  font-family: var(--font-mono);
}

.product-stock-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.quick-add-btn {
  width: 34px;
  height: 34px;
  min-width: 34px;
  min-height: 34px;
  border-radius: var(--radius-full);
  background: var(--lavender-mist);
  color: var(--indigo-velvet);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
  position: relative;
  touch-action: manipulation;
}

.quick-add-btn::after {
  content: '';
  position: absolute;
  inset: -6px;
  min-width: var(--touch-target-compact);
  min-height: var(--touch-target-compact);
}

.product-card:hover .quick-add-btn {
  background: var(--indigo-velvet);
  color: #ffffff;
  border-color: var(--indigo-velvet);
}

/* Products List View Mode */
.products-grid.list-mode {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.products-grid.list-mode .product-card {
  flex-direction: row;
  align-items: center;
  padding: 0.65rem 1rem;
  gap: 1rem;
}

.products-grid.list-mode .product-image-box {
  width: 52px;
  height: 52px;
  margin-bottom: 0;
  flex-shrink: 0;
}

.products-grid.list-mode .product-info {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.products-grid.list-mode .product-details-left {
  display: flex;
  flex-direction: column;
}

.products-grid.list-mode .product-bottom-row {
  margin-top: 0;
  padding-top: 0;
  gap: 1.5rem;
}

/* Empty Catalog State */
.catalog-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
}

.empty-icon-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(200, 177, 228, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--lavender-purple);
  margin-bottom: 1.25rem;
}

.catalog-empty h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  margin-bottom: 0.4rem;
}

.catalog-empty p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  max-width: 320px;
  margin-bottom: 1.25rem;
}

/* Floating Mobile Bottom Order Bar (Mobile only) */
.mobile-order-bar {
  display: none;
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, var(--dark-amethyst), #3f2065);
  color: #ffffff;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(47, 24, 75, 0.35);
  align-items: center;
  justify-content: space-between;
  z-index: 25;
  animation: slideUp 0.25s ease-out;
}

@media (min-width: 769px) {
  .mobile-order-bar {
    display: none !important;
  }
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.mobile-order-info {
  display: flex;
  flex-direction: column;
}

.mobile-order-count {
  font-size: 0.75rem;
  color: var(--wisteria);
  font-weight: 600;
}

.mobile-order-total {
  font-size: 1.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
}

.mobile-order-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, var(--indigo-velvet), var(--lavender-purple));
  color: #ffffff;
  padding: 0.6rem 1.15rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(83, 43, 136, 0.4);
  transition: transform var(--transition-fast);
}

.mobile-order-btn:active {
  transform: scale(0.97);
}

/* ==========================================================================
   Active Cart & Right Sidebar (30% Register / Current Order - Full Page)
   ========================================================================== */
.cart-sidebar {
  flex: 0 0 380px;
  width: 380px;
  max-width: 420px;
  min-width: 320px;
  height: 100%;
  min-height: 0;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  border-left: 1.5px solid var(--border-light);
  box-shadow: -4px 0 24px rgba(47, 24, 75, 0.06);
  position: relative;
  z-index: 10;
  overflow-y: auto;
  overflow-x: hidden;
}

.cart-header {
  flex-shrink: 0;
  padding: 0.85rem 1.25rem;
  border-bottom: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.cart-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cart-title-wrap h2 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark-amethyst);
  letter-spacing: -0.01em;
}

.cart-badge {
  background: var(--lavender-mist);
  color: var(--indigo-velvet);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}

.cart-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.clear-cart-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.clear-cart-btn:hover {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.mobile-close-cart-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--lavender-mist);
  color: var(--dark-amethyst);
  transition: all var(--transition-fast);
}

.mobile-close-cart-btn:hover {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.cart-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(47, 24, 75, 0.55);
  backdrop-filter: blur(2px);
  z-index: 55;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.cart-backdrop.active {
  display: block;
  opacity: 1;
}

/* Cart Items List */
.cart-items-wrapper {
  flex: 1 1 auto;
  min-height: 220px;
  overflow-y: auto;
  padding: 0.65rem 1.15rem;
  scrollbar-width: thin;
  scrollbar-color: var(--wisteria) transparent;
  -webkit-overflow-scrolling: touch;
}

.cart-items-wrapper::-webkit-scrollbar {
  width: 5px;
}

.cart-items-wrapper::-webkit-scrollbar-thumb {
  background: var(--wisteria);
  border-radius: var(--radius-full);
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(200, 177, 228, 0.3);
  animation: slideInRight 0.18s ease-out;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.cart-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  padding-right: 0.75rem;
}

.cart-item-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-unit-price {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.qty-counter {
  display: flex;
  align-items: center;
  background: var(--lavender-mist);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 2px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  color: var(--indigo-velvet);
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 1px 2px rgba(47, 24, 75, 0.08);
  transition: all var(--transition-fast);
  position: relative;
  touch-action: manipulation;
}

.qty-btn::after {
  content: '';
  position: absolute;
  inset: -8px;
  min-width: var(--touch-target-compact);
  min-height: var(--touch-target-compact);
}

.qty-btn:hover {
  background: var(--indigo-velvet);
  color: #ffffff;
}

.qty-display {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0 0.5rem;
  min-width: 24px;
  text-align: center;
  color: var(--dark-amethyst);
}

.qty-display.qty-clickable {
  cursor: pointer;
  min-width: 32px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(83, 43, 136, 0.06);
  border: 1px dashed rgba(83, 43, 136, 0.35);
  transition: all var(--transition-fast);
}

.qty-display.qty-clickable:hover {
  background: rgba(83, 43, 136, 0.12);
  border-color: var(--indigo-velvet);
}

.cart-size-pills {
  display: flex;
  gap: 3px;
  margin-top: 3px;
  flex-wrap: wrap;
}

.cart-size-pill {
  padding: 2px 5px;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  border: 1px solid rgba(155, 114, 207, 0.4);
  background: #ffffff;
  color: var(--indigo-velvet);
  cursor: pointer;
  line-height: 1.1;
  transition: all var(--transition-fast);
}

.cart-size-pill.active {
  background: var(--indigo-velvet);
  color: #ffffff;
  border-color: var(--indigo-velvet);
}

.cart-item-total {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  font-family: var(--font-mono);
  min-width: 65px;
  text-align: right;
}

.cart-remove-item {
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-left: 0.25rem;
  transition: all var(--transition-fast);
  position: relative;
  touch-action: manipulation;
}

.cart-remove-item::after {
  content: '';
  position: absolute;
  inset: -8px;
  min-width: var(--touch-target-compact);
  min-height: var(--touch-target-compact);
}

.cart-remove-item:hover {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

/* Empty Cart State */
.cart-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 2rem 1.5rem;
}

.cart-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--lavender-mist);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--wisteria);
  margin-bottom: 1rem;
}

.cart-empty-state h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  margin-bottom: 0.25rem;
}

.cart-empty-state p {
  font-size: 0.825rem;
  color: var(--text-muted);
  max-width: 220px;
}

/* Cart Summary Card & Breakdown */
.cart-summary-card {
  flex-shrink: 0;
  background: #ffffff;
  border-top: 1.5px solid var(--border-light);
  padding: 0.6rem 1.15rem 0.8rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: 0 -4px 18px rgba(47, 24, 75, 0.04);
  margin-top: auto;
}

.modifiers-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--border-light);
  flex-wrap: wrap;
}

.modifier-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.modifier-group label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-select-sm, .form-input-sm {
  padding: 0.35rem 0.5rem;
  font-size: 0.78rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  background: var(--lavender-mist);
  color: var(--dark-amethyst);
  outline: none;
}

.form-select-sm:focus, .form-input-sm:focus {
  border-color: var(--indigo-velvet);
}

.input-prefix-sm {
  display: flex;
  align-items: center;
  background: var(--lavender-mist);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 0 0.35rem;
}

.input-prefix-sm span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.input-prefix-sm input {
  width: 60px;
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.78rem;
  padding: 0.35rem 0.2rem;
}

.form-input-sm {
  width: 50px;
  text-align: center;
}

/* Calculation Breakdown */
.calculation-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.38rem;
}

.calc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.calc-val {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--dark-amethyst);
}

.discount-row .calc-val {
  color: #1b8754;
}

.calc-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0.35rem 0;
}

.total-row {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dark-amethyst);
}

.total-row .grand-total {
  font-size: 1.35rem;
  color: var(--indigo-velvet);
  font-family: var(--font-mono);
}

.primary-checkout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  background: linear-gradient(135deg, var(--indigo-velvet), #401f6d);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(83, 43, 136, 0.35);
  transition: all var(--transition-fast);
}

.primary-checkout-btn:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--lavender-purple), var(--indigo-velvet));
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(83, 43, 136, 0.45);
}

.primary-checkout-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.primary-checkout-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  background: var(--text-muted);
}

/* ==========================================================================
   VIEW 2: DASHBOARD (24h Daily Sales & Profit)
   ========================================================================== */
.dashboard-container {
  flex: 1;
  padding: clamp(1rem, 2.5vw, 2.25rem);
  max-width: var(--container-max-w);
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.dashboard-period-filter {
  display: flex;
  background: var(--lavender-mist);
  padding: 3px;
  border-radius: var(--radius-full);
  gap: 3px;
  border: 1px solid var(--border-light);
  overflow-x: auto;
  scrollbar-width: none;
}

.dashboard-period-filter::-webkit-scrollbar {
  display: none;
}

.period-btn {
  padding: 0.4rem 0.95rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.period-btn:hover {
  color: var(--dark-amethyst);
}

.period-btn.active {
  background: var(--indigo-velvet);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(83, 43, 136, 0.3);
}

/* Profit Hero Card */
.profit-hero-card {
  background: linear-gradient(135deg, #ffffff, #f1e9fb) !important;
  border: 2px solid var(--indigo-velvet) !important;
  box-shadow: 0 6px 20px rgba(83, 43, 136, 0.12) !important;
}

.profit-icon {
  background: rgba(83, 43, 136, 0.15) !important;
  color: var(--indigo-velvet) !important;
}

.profit-text {
  color: var(--indigo-velvet) !important;
  font-size: 1.85rem !important;
}

.profit-subtext {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--status-success);
  margin-top: 3px;
}

.metric-sublabel {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Dashboard Two-Column Grid */
.dashboard-split-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}

.dash-sidebar-col {
  display: flex;
  flex-direction: column;
}

/* Category Progress Bars */
.category-breakdown-list {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.category-progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.category-progress-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
}

.category-progress-bar {
  height: 8px;
  background: var(--lavender-mist);
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.category-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--indigo-velvet), var(--lavender-purple));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.fast-stats-box {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.fast-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
}

.fast-stat-row .val {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--dark-amethyst);
}

/* ==========================================================================
   VIEW 3, 4 & 5: Inventory, Sales & Orders Views
   ========================================================================== */
.orders-container, .inventory-container, .sales-container {
  flex: 1;
  padding: clamp(1rem, 2.5vw, 2.25rem);
  max-width: var(--container-max-w);
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.section-top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(1rem, 2vw, 1.75rem);
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
  flex-wrap: wrap;
}

.section-title {
  font-size: var(--text-fluid-2xl);
  font-weight: 800;
  color: var(--dark-amethyst);
  letter-spacing: -0.02em;
  line-height: 1.18;
}

.section-subtitle {
  font-size: var(--text-fluid-sm);
  color: var(--text-secondary);
  margin-top: 4px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Metrics Cards Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.metric-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow-sm);
}

.metric-card.highlight-card {
  background: linear-gradient(135deg, #ffffff, var(--lavender-mist));
  border-color: var(--lavender-purple);
}

.metric-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--lavender-mist);
  color: var(--indigo-velvet);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.metric-icon-box.warning {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.metric-icon-box.danger {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.metric-icon-box.success {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.metric-content {
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.metric-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark-amethyst);
  font-family: var(--font-mono);
  line-height: 1.2;
}

.metric-value.large {
  font-size: 1.8rem;
  color: var(--indigo-velvet);
}

.metric-value.warning {
  color: var(--status-warning);
}

.metric-value.danger {
  color: var(--status-danger);
}

/* Data Table Card */
.table-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-toolbar {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: #ffffff;
  gap: 1rem;
  flex-wrap: wrap;
}

.table-search input {
  width: 340px;
  max-width: 100%;
  padding: 0.55rem 0.95rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--lavender-mist);
  outline: none;
}

.table-search input:focus {
  border-color: var(--indigo-velvet);
}

.table-filter-tabs {
  display: flex;
  background: var(--lavender-mist);
  padding: 3px;
  border-radius: var(--radius-full);
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.table-filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab-btn {
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-tab-btn.active {
  background: var(--indigo-velvet);
  color: #ffffff;
}

.table-card-header {
  padding: 1.15rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
}

.table-card-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--dark-amethyst);
}

.badge-subtle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--indigo-velvet);
  background: var(--lavender-mist);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: var(--wisteria);
  color: var(--dark-amethyst);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  white-space: nowrap;
}

.data-table td {
  padding: 0.85rem 1.25rem;
  font-size: 0.86rem;
  color: var(--dark-amethyst);
  border-bottom: 1px solid rgba(200, 177, 228, 0.3);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: rgba(244, 239, 250, 0.45);
}

.data-table .text-right {
  text-align: right;
}

.data-table th.text-center,
.data-table td.text-center {
  text-align: center !important;
}

.badge-subtle {
  display: inline-block;
  min-width: 95px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(83, 43, 136, 0.1);
  color: var(--indigo-velvet);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  border: 1px solid rgba(83, 43, 136, 0.2);
}

/* Status Pill in Table */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.status-pill.in-stock {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.status-pill.low-stock {
  background: var(--status-warning-bg);
  color: var(--status-warning);
}

.status-pill.out-of-stock {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

.unit-profit-positive {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--status-success);
}

/* Table Row Actions (Edit, Delete, Restock) */
.table-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.45rem;
}

.btn-table-action {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--lavender-mist);
  color: var(--dark-amethyst);
  border: 1px solid var(--border-light);
  transition: all var(--transition-fast);
}

.btn-table-action:hover {
  background: var(--indigo-velvet);
  color: #ffffff;
  border-color: var(--indigo-velvet);
}

.btn-table-action.danger:hover {
  background: var(--status-danger);
  color: #ffffff;
  border-color: var(--status-danger);
}

/* ==========================================================================
   Buttons & Common Controls
   ========================================================================== */
.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--indigo-velvet);
  color: #ffffff;
  padding: 0.58rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(83, 43, 136, 0.25);
  transition: all var(--transition-fast);
}

.primary-btn:hover {
  background: var(--lavender-purple);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(83, 43, 136, 0.35);
}

.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #ffffff;
  color: var(--indigo-velvet);
  border: 1.5px solid var(--border-light);
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.secondary-btn:hover {
  background: var(--lavender-mist);
  border-color: var(--lavender-purple);
  color: var(--dark-amethyst);
}

.secondary-btn.danger-hover:hover {
  background: var(--status-danger-bg);
  border-color: var(--status-danger);
  color: var(--status-danger);
}

/* ==========================================================================
   Modals
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(47, 24, 75, 0.65);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(0.75rem, env(safe-area-inset-right, 0px)) max(1rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
  animation: fadeIn 0.15s ease-out;
  box-sizing: border-box;
}

.modal-backdrop.open {
  display: flex !important;
}

.modal-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-lg);
  width: min(540px, 94vw);
  max-width: 540px;
  max-height: calc(100dvh - 2.5rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalScale 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-card form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

@keyframes modalScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  padding: clamp(0.75rem, 2vw, 1.15rem) clamp(1rem, 2.5vw, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  background: #ffffff;
  flex-shrink: 0;
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.modal-badge-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--lavender-mist);
  color: var(--indigo-velvet);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-badge-icon.success {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.modal-title-wrap h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark-amethyst);
  line-height: 1.2;
}

.modal-subtext {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.modal-close-btn {
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all var(--transition-fast);
  position: relative;
  touch-action: manipulation;
}

.modal-close-btn::after {
  content: '';
  position: absolute;
  inset: -6px;
  min-width: var(--touch-target-compact);
  min-height: var(--touch-target-compact);
}

.modal-close-btn:hover {
  background: var(--lavender-mist);
  color: var(--dark-amethyst);
}

.modal-body {
  padding: clamp(0.85rem, 2vw, 1.25rem) clamp(1rem, 2.5vw, 1.5rem);
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: clamp(0.75rem, 2vw, 1rem) clamp(1rem, 2.5vw, 1.5rem);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--lavender-mist);
  flex-shrink: 0;
}

/* Form Styles */
.form-group {
  margin-bottom: 0.95rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  margin-bottom: 0.35rem;
}

.form-control {
  width: 100%;
  padding: 0.65rem 0.95rem;
  font-size: 0.9rem;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #ffffff;
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--indigo-velvet);
  box-shadow: 0 0 0 3px rgba(83, 43, 136, 0.12);
}

.form-row {
  display: flex;
  gap: 1rem;
}

.col-half {
  flex: 1;
}

/* ==========================================================================
   Checkout Modal Specifics (Philippine Peso ₱)
   ========================================================================== */
.checkout-modal-card {
  max-width: 540px;
}

.checkout-total-banner {
  background: linear-gradient(135deg, var(--dark-amethyst), #3f2065);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: clamp(0.85rem, 2vw, 1.25rem) clamp(1rem, 2.5vw, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  box-shadow: 0 4px 14px rgba(47, 24, 75, 0.2);
}

.checkout-total-banner .label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--wisteria);
}

.checkout-total-banner .amount {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  font-family: var(--font-mono);
  color: #ffffff;
}

.payment-tabs {
  display: flex;
  background: var(--lavender-mist);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  gap: 4px;
  margin-bottom: 1.25rem;
}

.pay-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  min-height: var(--touch-target-compact);
  touch-action: manipulation;
}

.pay-tab:hover {
  color: var(--dark-amethyst);
}

.pay-tab.active {
  background: #ffffff;
  color: var(--indigo-velvet);
  box-shadow: var(--shadow-sm);
}

.payment-content {
  animation: fadeIn 0.2s ease-out;
}

.input-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  margin-bottom: 0.4rem;
}

.tender-input-wrap {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--transition-fast);
}

.tender-input-wrap:focus-within {
  border-color: var(--indigo-velvet);
  box-shadow: 0 0 0 4px rgba(83, 43, 136, 0.15);
}

.currency-symbol {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--indigo-velvet);
  margin-right: 0.5rem;
  font-family: var(--font-mono);
}

.tender-input-wrap input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--dark-amethyst);
}

.quick-cash-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.85rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.quick-bill-btn {
  flex: 1;
  min-width: 60px;
  min-height: var(--touch-target-compact);
  padding: 0.55rem 0.35rem;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  color: var(--dark-amethyst);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-mono);
  transition: all var(--transition-fast);
  touch-action: manipulation;
}

.quick-bill-btn:hover {
  background: var(--lavender-mist);
  border-color: var(--indigo-velvet);
  color: var(--indigo-velvet);
  transform: translateY(-1px);
}

.quick-bill-btn:active {
  transform: scale(0.97);
}

.change-calc-box {
  background: var(--lavender-mist);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem;
}

.change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.change-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--dark-amethyst);
}

.change-val {
  font-size: 1.5rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--indigo-velvet);
}

.change-status-msg {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.4rem;
}

.change-status-msg.error {
  color: var(--status-danger);
  font-weight: 600;
}

.change-status-msg.ready {
  color: var(--status-success);
  font-weight: 600;
}

.card-terminal-simulation, .wallet-qr-simulation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  background: var(--lavender-mist);
  border-radius: var(--radius-md);
  border: 1.5px dashed var(--border-light);
}

.terminal-graphic {
  color: var(--indigo-velvet);
  margin-bottom: 0.75rem;
}

.card-terminal-simulation h4, .wallet-qr-simulation h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dark-amethyst);
  margin-bottom: 0.25rem;
}

.card-terminal-simulation p, .wallet-qr-simulation p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 280px;
}

.simulated-card-chip {
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--indigo-velvet);
  color: #ffffff;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(83, 43, 136, 0.3);
  transition: all var(--transition-fast);
}

.simulated-card-chip:hover {
  background: var(--lavender-purple);
  transform: translateY(-1px);
}

.pulse-ring {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
}

.qr-mockup {
  margin-bottom: 1rem;
  padding: 8px;
  background: #ffffff;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   Receipt Modal & Thermal Slip
   ========================================================================== */
.receipt-modal-card {
  max-width: 440px;
  background: #ffffff !important;
}

.receipt-modal-card .modal-header {
  background: #ffffff;
  border-bottom: 1px solid rgba(200, 177, 228, 0.4);
}

.receipt-modal-card .modal-footer {
  background: #ffffff;
  border-top: 1px solid rgba(200, 177, 228, 0.4);
}

.receipt-scrollable {
  background: #ffffff !important; /* Pure white background */
  display: flex;
  justify-content: center;
  padding: 1.5rem 1.25rem 2.25rem 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.receipt-paper {
  background: #ffffff !important;
  width: 100%;
  max-width: 375px;
  padding: 2rem 1.6rem 2.2rem 1.6rem;
  box-shadow: 0 4px 20px rgba(47, 24, 75, 0.08);
  border-radius: 8px;
  color: #222222;
  font-size: 0.82rem;
  line-height: 1.45;
  position: relative;
  border: 1px solid rgba(200, 177, 228, 0.5);
  border-top: 5px solid var(--indigo-velvet);
  box-sizing: border-box;
}

.receipt-store-header {
  text-align: center;
  margin-bottom: 0.85rem;
}

.receipt-brand {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark-amethyst);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.receipt-business-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--indigo-velvet);
  margin-top: 2px;
}

.receipt-internal-note {
  font-size: 0.68rem;
  font-weight: 700;
  color: #4a3e5c;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.receipt-bir-note {
  font-size: 0.64rem;
  color: #777777;
  font-style: italic;
  margin-top: 1px;
}

.receipt-sub {
  font-size: 0.72rem;
  font-weight: 600;
  color: #555555;
  margin-top: 1px;
}

.receipt-address {
  font-size: 0.7rem;
  color: #777777;
}

.receipt-dotted-line {
  border-top: 1px dashed #cccccc;
  margin: 0.75rem 0;
}

.receipt-meta {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.76rem;
  color: #444444;
}

.receipt-meta-row {
  display: flex;
  justify-content: space-between;
}

.receipt-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin: 0.4rem 0;
}

.receipt-items-table th {
  text-align: left;
  font-weight: 700;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #444444;
  color: #222222;
}

.receipt-items-table td {
  padding: 0.35rem 0;
  vertical-align: top;
}

.col-qty {
  width: 36px;
  text-align: left;
  font-family: var(--font-mono);
}

.col-item {
  text-align: left;
}

.col-price {
  text-align: right;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.receipt-totals {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.rcpt-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
}

.rcpt-row.grand-total {
  font-size: 1rem;
  font-weight: 800;
  color: var(--dark-amethyst);
  margin-top: 0.2rem;
}

.receipt-payment-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.76rem;
}

.receipt-barcode-wrap {
  text-align: center;
  margin: 1rem 0 0.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.barcode-svg {
  width: 160px;
  height: 40px;
}

.barcode-number {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: #555555;
  margin-top: 3px;
}

.receipt-footer-msg {
  text-align: center;
  margin-top: 0.65rem;
  font-size: 0.72rem;
  color: #666666;
}

.receipt-footer-msg .tagline {
  font-size: 0.68rem;
  color: #888888;
}

/* Prominent Permanent Mandatory Thermal Disclaimer */
.receipt-mandatory-disclaimer {
  margin: 1.25rem 0 0.85rem 0;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  line-height: 1.45;
  color: #111111;
  background: #ffffff !important;
  border: 1.5px dashed var(--indigo-velvet);
  padding: 0.85rem 0.65rem;
  border-radius: 6px;
  box-sizing: border-box;
}

.receipt-mandatory-disclaimer .disclaimer-border {
  font-weight: 700;
  color: #888888;
  letter-spacing: -0.05em;
  overflow: hidden;
  white-space: nowrap;
  font-size: 0.6rem;
}

.receipt-mandatory-disclaimer .disclaimer-title {
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--dark-amethyst);
  margin: 1px 0;
  letter-spacing: 0.04em;
}

.receipt-mandatory-disclaimer .disclaimer-lead {
  font-weight: 800;
  color: #000000;
  font-size: 0.67rem;
  letter-spacing: 0.02em;
}

.receipt-mandatory-disclaimer .disclaimer-sub {
  color: #555555;
  font-size: 0.64rem;
}

.rcpt-rateit-credit {
  margin-top: 0.65rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   RateIT Facebook Hyperlinks
   ========================================================================== */
.rateit-hyperlink {
  color: var(--wisteria);
  text-decoration: none;
  font-weight: 700;
  transition: all var(--transition-fast);
  border-bottom: 1.5px dotted rgba(200, 177, 228, 0.5);
  display: inline-block;
}

.rateit-hyperlink:hover {
  color: #ffffff;
  border-bottom-color: #ffffff;
  transform: translateY(-1px);
}

.rcpt-rateit-credit .rateit-hyperlink {
  color: var(--indigo-velvet);
  border-bottom: 1.5px dotted var(--indigo-velvet);
}

.rcpt-rateit-credit .rateit-hyperlink:hover {
  color: var(--lavender-purple);
  border-bottom-color: var(--lavender-purple);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 3.5rem;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--dark-amethyst);
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 600;
  border-left: 4px solid var(--lavender-purple);
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1), toastOut 0.3s ease-in 2.7s forwards;
  max-width: 360px;
}

.toast.success {
  border-left-color: #4ade80;
}

.toast.warning {
  border-left-color: #fbbf24;
}

.toast.danger {
  border-left-color: #f87171;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(16px); }
}

/* ==========================================================================
   Footer: Powered by RateIT
   ========================================================================== */
.app-footer {
  flex-shrink: 0;
  height: var(--footer-height);
  background: var(--dark-amethyst);
  border-top: 1px solid rgba(200, 177, 228, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 40;
  width: 100%;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--wisteria);
  letter-spacing: 0.03em;
}

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }

  .no-print,
  .top-header,
  .app-footer,
  .pos-layout,
  #view-dashboard,
  #view-inventory,
  #view-sales,
  .modal-header,
  .modal-footer,
  .toast-container {
    display: none !important;
  }

  .modal-backdrop {
    position: static !important;
    background: none !important;
    padding: 0 !important;
    display: block !important;
  }

  .modal-card {
    border: none !important;
    box-shadow: none !important;
    max-width: 100% !important;
  }

  .receipt-scrollable {
    background: #ffffff !important;
    padding: 0 !important;
  }

  .receipt-paper {
    box-shadow: none !important;
    border: none !important;
    max-width: 100% !important;
    width: 320px !important;
    margin: 0 auto;
    padding: 0 !important;
  }

  .receipt-mandatory-disclaimer {
    border: 1px dashed #000000 !important;
    background: transparent !important;
    color: #000000 !important;
    display: block !important;
    visibility: visible !important;
    margin: 0.8rem 0 0.4rem 0 !important;
    padding: 0.4rem 0.2rem !important;
  }

  .receipt-mandatory-disclaimer .disclaimer-title,
  .receipt-mandatory-disclaimer .disclaimer-lead,
  .receipt-mandatory-disclaimer .disclaimer-sub {
    color: #000000 !important;
  }
}

/* ==========================================================================
   Responsive Adaptations (Smartphones, Tablets & iPads)
   ========================================================================== */

/* Tablets & Small Desktops (<= 1024px) */
@media (max-width: 1024px) {
  :root {
    --cart-width: 360px;
  }

  .dashboard-split-grid {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.65rem;
  }

  .catalog-toolbar {
    padding: 0.65rem 1rem 0.4rem 1rem;
  }

  .products-scroll-area {
    padding: 0.65rem 1rem 4.5rem 1rem;
  }
}

/* Mobile & iPad Portrait (<= 768px) */
@media (max-width: 768px) {
  .register-badge {
    display: none;
  }

  .cashier-info {
    display: none;
  }

  .mobile-cart-btn {
    display: flex;
    width: var(--touch-target-compact);
    height: var(--touch-target-compact);
  }

  .pos-layout {
    height: calc(100dvh - var(--header-actual-h) - var(--bottom-nav-actual-h));
    min-height: 0;
  }

  .catalog-section {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    border-right: none;
  }

  /* Cart Slide-Out Drawer on Mobile */
  .cart-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(92vw, 420px);
    max-width: 420px;
    z-index: 1000;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    box-shadow: -8px 0 32px rgba(47, 24, 75, 0.35);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  .cart-sidebar.mobile-open {
    transform: translateX(0);
  }

  .mobile-close-cart-btn {
    display: flex;
    min-width: var(--touch-target-compact);
    min-height: var(--touch-target-compact);
  }

  /* Floating Order Bar on Mobile */
  .mobile-order-bar {
    display: flex;
  }

  .dashboard-container, .orders-container, .inventory-container, .sales-container {
    padding: clamp(0.75rem, 2vw, 1.25rem) clamp(0.75rem, 2.5vw, 1.25rem) calc(var(--bottom-nav-actual-h) + 1.25rem);
    box-sizing: border-box;
  }

  .section-top-header {
    margin-bottom: 0.75rem;
    gap: 0.5rem;
  }

  .section-title {
    font-size: clamp(1.2rem, 4vw, 1.45rem);
    line-height: 1.2;
  }

  .section-subtitle {
    font-size: 0.78rem;
    line-height: 1.3;
    margin-top: 2px;
    margin-bottom: 0.35rem;
  }

  /* Ergonomic Action Buttons */
  .section-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
    width: 100%;
  }

  .section-actions .primary-btn,
  .section-actions .secondary-btn {
    padding: 0.55rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: normal;
    text-align: center;
    justify-content: center;
    line-height: 1.2;
    min-height: var(--touch-target-compact);
    height: auto;
    border-radius: var(--radius-sm);
    touch-action: manipulation;
  }

  .section-actions svg {
    width: 15px;
    height: 15px;
    margin-right: 4px;
    flex-shrink: 0;
  }

  /* Compact 2x2 Grid for Metric Cards with Fluid Breathing Room */
  .metrics-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
    margin-bottom: 1rem !important;
  }

  .metric-card {
    padding: 0.65rem 0.75rem !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.6rem !important;
    border-radius: var(--radius-sm) !important;
    min-height: 54px;
  }

  .metric-card.profit-hero-card {
    grid-column: span 2;
    padding: 0.75rem 0.95rem !important;
  }

  .metric-icon-box {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: var(--radius-sm) !important;
    margin-bottom: 0 !important;
  }

  .metric-icon-box svg {
    width: 18px !important;
    height: 18px !important;
  }

  .metric-content {
    flex: 1 !important;
    min-width: 0 !important;
  }

  .metric-label {
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
    margin-bottom: 2px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .metric-value {
    font-size: 1.15rem !important;
    line-height: 1.15 !important;
  }

  .metric-value.large {
    font-size: 1.35rem !important;
  }

  .metric-sublabel, .profit-subtext {
    font-size: 0.68rem !important;
    line-height: 1.15 !important;
  }

  /* Dashboard Period Filter: Touch-friendly fluid pills */
  .dashboard-period-filter {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 4px !important;
    padding: 3px !important;
    width: 100% !important;
    border-radius: var(--radius-sm) !important;
  }

  .period-btn {
    padding: 0.45rem 0.25rem !important;
    font-size: 0.74rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border-radius: 6px !important;
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }

  /* Fluid Responsive Product Grid on Mobile / Tablets */
  .products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(clamp(115px, 28vw, 150px), 1fr)) !important;
    gap: 0.5rem !important;
  }

  .catalog-toolbar {
    padding: 0.65rem 0.85rem 0.45rem 0.85rem !important;
  }

  .products-scroll-area {
    padding: 0.5rem 0.85rem calc(var(--bottom-nav-actual-h) + 1rem) 0.85rem !important;
  }

  .product-card {
    padding: 0.55rem !important;
    border-radius: var(--radius-sm) !important;
  }

  .product-image-box {
    aspect-ratio: 1 / 0.88 !important;
    margin-bottom: 0.35rem !important;
    border-radius: 6px !important;
  }

  .product-image-box svg {
    width: 50% !important;
    height: 50% !important;
  }

  .product-badge-corner {
    font-size: 0.58rem !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
  }

  .product-category {
    font-size: 0.65rem !important;
    line-height: 1 !important;
    margin-bottom: 3px !important;
  }

  .product-name {
    font-size: 0.82rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    max-height: 2.5em !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .product-bottom-row {
    margin-top: 0.35rem !important;
  }

  .product-price {
    font-size: 0.92rem !important;
    font-weight: 800 !important;
  }

  .product-stock-tag {
    font-size: 0.64rem !important;
    line-height: 1 !important;
  }

  .quick-add-btn {
    position: relative;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 6px !important;
    touch-action: manipulation;
  }

  .quick-add-btn::after {
    content: '';
    position: absolute;
    inset: -8px;
    min-width: 48px;
    min-height: 48px;
  }

  .quick-add-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  .table-toolbar {
    padding: 0.75rem 0.85rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }

  .table-search input {
    width: 100%;
  }

  .table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .modal-card {
    width: min(94vw, 540px);
    max-width: 540px;
    max-height: calc(100dvh - 2rem - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  }

  .form-control {
    font-size: 16px; /* Prevents auto-zoom on iOS Safari */
  }
}

/* Compact Smartphones (<= 480px) */
@media (max-width: 480px) {
  .brand-name {
    font-size: 1.05rem;
  }

  .nav-tab svg {
    display: none; /* Icon hidden to save space for crisp text */
  }

  .nav-tab {
    padding: 0.35rem 0.2rem;
    font-size: 0.72rem;
  }

  /* Two Generous Columns on Small Phones: Prevents Text Collapsing & Microscopic Sizes */
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  .product-card {
    padding: 0.55rem !important;
  }

  .product-name {
    font-size: 0.82rem !important;
    line-height: 1.25 !important;
  }

  .product-price {
    font-size: 0.95rem !important;
  }

  .metrics-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.45rem !important;
  }

  .form-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .quick-cash-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.45rem;
  }

  .quick-bill-btn {
    min-height: var(--touch-target-compact);
  }

  .tender-input-wrap input {
    font-size: 1.3rem;
  }

  .currency-symbol {
    font-size: 1.2rem;
  }

  .checkout-total-banner .amount {
    font-size: 1.5rem;
  }

  .pay-tab {
    font-size: 0.74rem;
    padding: 0.5rem 0.2rem;
  }

  .pay-tab svg {
    display: none;
  }
}

/* ==========================================================================
   Drink Size Picker Modal Styling
   ========================================================================== */
.size-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
}

.size-option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 0.5rem;
  background: rgba(83, 43, 136, 0.05);
  border: 1.5px solid rgba(155, 114, 207, 0.35);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.size-option-card:hover, .size-option-card:active {
  background: var(--lavender-purple);
  color: #fff;
  border-color: var(--indigo-velvet);
  transform: translateY(-2px);
}

.size-option-label {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.size-option-oz {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.size-option-card:hover .size-option-oz,
.size-option-card:active .size-option-oz {
  color: rgba(255, 255, 255, 0.85);
}

.size-option-price {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--indigo-velvet);
}

.size-option-card:hover .size-option-price,
.size-option-card:active .size-option-price {
  color: #fff;
}

/* ==========================================================================
   Sidebar Buyer Pay & Real-Time Change Calculator (30% Current Order Column)
   ========================================================================== */
.sidebar-pay-section {
  margin-top: 0.45rem;
  padding: 0.55rem 0.75rem;
  background: rgba(83, 43, 136, 0.05);
  border: 1.5px solid rgba(200, 177, 228, 0.65);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sidebar-pay-input-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sidebar-pay-input-row label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  white-space: nowrap;
}

.sidebar-tender-box {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 0.35rem 0.65rem;
  width: 140px;
  transition: all var(--transition-fast);
}

.sidebar-tender-box:focus-within {
  border-color: var(--indigo-velvet);
  box-shadow: 0 0 0 3px rgba(83, 43, 136, 0.15);
}

.sidebar-tender-box .currency-prefix {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--indigo-velvet);
  font-size: 1rem;
  margin-right: 0.35rem;
}

.sidebar-tender-box input {
  border: none;
  outline: none;
  width: 100%;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--dark-amethyst);
  background: transparent;
}

.sidebar-quick-bills {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.35rem;
}

.quick-bill-pill {
  padding: 0.35rem 0.2rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--dark-amethyst);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.quick-bill-pill:hover {
  background: var(--indigo-velvet);
  color: #ffffff;
  border-color: var(--indigo-velvet);
}

.sidebar-change-box {
  background: #ffffff;
  border: 1px solid rgba(200, 177, 228, 0.65);
  border-radius: var(--radius-xs);
  padding: 0.55rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-change-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-change-row .change-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark-amethyst);
}

.sidebar-change-row .change-amount-display {
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--status-success);
}

.change-helper-text {
  font-size: 0.7rem;
  color: var(--text-muted);
}
.change-helper-text.error {
  color: var(--status-danger);
  font-weight: 600;
}
.change-helper-text.ready {
  color: var(--status-success);
  font-weight: 600;
}

.other-pay-methods-btn {
  width: 100%;
  margin-top: 0.45rem;
  padding: 0.5rem;
  background: transparent;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--indigo-velvet);
  text-align: center;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.other-pay-methods-btn:hover:not(:disabled) {
  background: rgba(83, 43, 136, 0.08);
  border-color: var(--indigo-velvet);
}

/* ==========================================================================
   Cashier Management Modal (Add, Edit, Delete)
   ========================================================================== */
.add-cashier-box {
  background: var(--lavender-mist);
  padding: 0.95rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 1.25rem;
}

.add-cashier-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.cashier-list-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cashier-list-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 240px;
  overflow-y: auto;
}

.cashier-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  transition: background var(--transition-fast);
}

.cashier-item-row:hover {
  background: rgba(244, 239, 250, 0.6);
}

.cashier-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.cashier-avatar-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--indigo-velvet);
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cashier-item-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark-amethyst);
}

.cashier-item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cashier-btn-icon {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  background: var(--lavender-mist);
  color: var(--dark-amethyst);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.cashier-btn-icon:hover {
  background: var(--indigo-velvet);
  color: #ffffff;
  border-color: var(--indigo-velvet);
}

.cashier-btn-icon.danger:hover {
  background: var(--status-danger);
  color: #ffffff;
  border-color: var(--status-danger);
}

/* ==========================================================================
   Internal Operational Software & Non-BIR Mode Stylings
   ========================================================================== */

/* Subtle Internal Inventory Disclaimers */
.sidebar-internal-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding: 0.5rem 0.65rem;
  background: rgba(83, 43, 136, 0.05);
  border: 1px solid rgba(200, 177, 228, 0.6);
  border-radius: 6px;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-muted);
}

.sidebar-internal-notice svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--indigo-velvet);
}

.modal-disclaimer-subtext {
  text-align: center;
  font-size: 0.74rem;
  color: var(--text-muted);
  padding: 0.45rem 1rem 0.75rem 1rem;
  line-height: 1.35;
}

/* First-Launch Internal Operational Software Notice Card */
.internal-software-notice-card {
  background: #fff9ea;
  border: 1.5px solid #ecd896;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  margin-bottom: 0.5rem;
}

.notice-icon-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #8c5d00;
  margin-bottom: 0.4rem;
}

.notice-icon-title svg {
  flex-shrink: 0;
  color: #b27a00;
}

.notice-body-text {
  font-size: 0.81rem;
  line-height: 1.45;
  color: #4a3818;
  margin: 0;
}

/* Mandatory Acknowledgment Checkbox */
.acknowledgment-checkbox-group {
  margin-top: 1.1rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--border-light);
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--text-primary);
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--indigo-velvet);
  cursor: pointer;
  flex-shrink: 0;
}

.checkbox-text strong {
  color: var(--indigo-velvet);
}

/* ==========================================================================
   16. Firebase Cloud Authentication, Multi-Device Sync & Backups Styles
   ========================================================================== */

/* Header Cloud Pill Wrap & CTA */
.cloud-account-pill-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.cloud-auth-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(200, 177, 228, 0.4) !important;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 0.82rem;
  transition: all var(--transition-fast);
}

.cloud-auth-btn:hover {
  background: rgba(255, 255, 255, 0.22) !important;
  border-color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.cloud-auth-btn .cloud-btn-text {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.cloud-icon-pulse {
  display: flex;
  align-items: center;
  color: #e5d8f6 !important;
}
.cloud-icon-pulse svg {
  stroke: #e5d8f6 !important;
}

.cloud-auth-btn.icon-only-btn {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 1px solid rgba(200, 177, 228, 0.4) !important;
  color: #ffffff !important;
}
.cloud-auth-btn.icon-only-btn svg {
  stroke: #ffffff !important;
}

.cloud-status-badge {
  font-size: 0.68rem;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
  font-weight: 800;
}

.cloud-status-badge.offline {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #f4effa !important;
  border: 1px solid rgba(200, 177, 228, 0.4) !important;
}

.cloud-status-badge.synced {
  background: var(--status-success-bg);
  color: var(--status-success);
}

.cloud-status-badge.syncing {
  background: #e3f2fd;
  color: #1976d2;
}

/* Authenticated User Pill */
.cloud-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  border: 1.5px solid rgba(83, 43, 136, 0.2);
  color: var(--dark-amethyst);
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.cloud-user-btn:hover {
  border-color: var(--indigo-velvet);
  box-shadow: 0 4px 14px rgba(83, 43, 136, 0.12);
  transform: translateY(-1px);
}

.cloud-pulse-dot, .live-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #1b8754;
  box-shadow: 0 0 0 0 rgba(27, 135, 84, 0.7);
  animation: pulse-green 2s infinite;
  flex-shrink: 0;
}

.cloud-pulse-dot.syncing, .live-pulse-dot.syncing {
  background-color: #1976d2;
  box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.7);
  animation: pulse-blue 1.2s infinite;
}

.cloud-pulse-dot.offline, .live-pulse-dot.offline {
  background-color: #b25e00;
  animation: none;
}

@keyframes pulse-green {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(27, 135, 84, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(27, 135, 84, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(27, 135, 84, 0); }
}

@keyframes pulse-blue {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(25, 118, 210, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(25, 118, 210, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(25, 118, 210, 0); }
}

.cloud-live-icon {
  color: var(--indigo-velvet);
}

.cloud-user-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}

.cloud-business-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cloud-sync-status-text {
  font-size: 0.68rem;
  color: var(--status-success);
  font-weight: 600;
}

.chevron-icon {
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

/* Cloud Dropdown Menu */
.cloud-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 290px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 0.75rem 0;
  z-index: 1050;
  display: none;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.cloud-dropdown-menu.open {
  display: block;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.cloud-menu-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem 0.75rem;
}

.cloud-avatar {
  font-size: 1.6rem;
  background: var(--lavender-mist);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--wisteria);
}

.cloud-menu-user-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cloud-menu-user-info strong {
  font-size: 0.9rem;
  color: var(--dark-amethyst);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cloud-menu-user-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.business-id-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem !important;
  color: var(--indigo-velvet) !important;
  font-weight: 600;
  margin-top: 2px;
}

.cloud-menu-sync-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 1rem;
  background: rgba(27, 135, 84, 0.08);
  font-size: 0.73rem;
  color: var(--status-success);
  font-weight: 600;
}

.cloud-menu-divider {
  height: 1px;
  background: var(--border-subtle);
  margin: 0.45rem 0;
}

.cloud-menu-items {
  display: flex;
  flex-direction: column;
}

.cloud-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1rem;
  width: 100%;
  text-align: left;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--dark-amethyst);
  transition: all var(--transition-fast);
}

.cloud-menu-item:hover {
  background: var(--lavender-mist);
  color: var(--indigo-velvet);
  padding-left: 1.15rem;
}

.cloud-menu-item svg {
  color: var(--indigo-velvet);
  flex-shrink: 0;
}

.cloud-menu-item.danger-item {
  color: var(--status-danger);
}

.cloud-menu-item.danger-item svg {
  color: var(--status-danger);
}

.cloud-menu-item.danger-item:hover {
  background: var(--status-danger-bg);
  color: var(--status-danger);
}

/* Auth Modal Styling */
.auth-modal-card {
  max-width: 440px;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.auth-tabs-bar {
  display: flex;
  padding: 0 1.25rem;
  background: var(--lavender-mist);
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.5rem;
}

.auth-tab-btn {
  padding: 0.75rem 1rem;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
}

.auth-tab-btn:hover {
  color: var(--dark-amethyst);
}

.auth-tab-btn.active {
  color: var(--indigo-velvet);
  border-bottom-color: var(--indigo-velvet);
}

.auth-modal-body {
  padding: 1.25rem;
}

.auth-alert {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.auth-alert.error {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(197, 34, 31, 0.25);
}

.auth-alert.success {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(27, 135, 84, 0.25);
}

.form-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.auth-text-link {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--indigo-velvet);
  text-decoration: underline;
  cursor: pointer;
}

.auth-text-link:hover {
  color: var(--lavender-purple);
}

.password-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-wrap input {
  padding-right: 2.5rem;
}

.toggle-password-btn {
  position: absolute;
  right: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
}

.auth-submit-btn {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.92rem;
  font-weight: 700;
  margin-top: 0.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 1.1rem 0;
  color: var(--text-muted);
  font-size: 0.78rem;
}

.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-subtle);
}

.auth-divider span {
  padding: 0 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.google-auth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.7rem;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  transition: all var(--transition-fast);
}

.google-auth-btn:hover {
  background: var(--lavender-mist);
  border-color: var(--indigo-velvet);
  box-shadow: 0 4px 12px rgba(83, 43, 136, 0.08);
}

.auth-switch-text {
  text-align: center;
  margin-top: 1.1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.auth-subtext-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 1rem;
}

/* Cloud Backups Modal */
.backups-modal-card {
  max-width: 680px;
}

.backups-modal-body {
  padding: 1.25rem;
  max-height: calc(85vh - 140px);
  overflow-y: auto;
}

.backup-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(83, 43, 136, 0.08), rgba(155, 114, 207, 0.08));
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
}

.status-strip-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.status-strip-left strong {
  display: block;
  font-size: 0.88rem;
  color: var(--dark-amethyst);
}

.status-strip-left .sub {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.create-backup-card {
  background: var(--lavender-mist);
  border: 1px dashed var(--indigo-velvet);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.25rem;
}

.create-backup-inputs {
  display: flex;
  gap: 0.65rem;
}

.auto-backup-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.backups-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.backups-list-header h4 {
  font-size: 0.95rem;
  color: var(--dark-amethyst);
  font-weight: 700;
}

.backups-scroll-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-height: 120px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.backup-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.backup-card-item:hover {
  border-color: var(--indigo-velvet);
  box-shadow: 0 4px 10px rgba(83, 43, 136, 0.06);
}

.backup-card-left {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.backup-date-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.backup-date {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dark-amethyst);
}

.backup-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.backup-stats-chips {
  display: flex;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
}

.backup-card-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-icon-subtle {
  padding: 0.35rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--bg-muted);
  color: var(--dark-amethyst);
  transition: all var(--transition-fast);
}

.btn-icon-subtle:hover {
  background: var(--indigo-velvet);
  color: #fff;
}

.btn-icon-subtle.danger:hover {
  background: var(--status-danger);
  color: #fff;
}

.backups-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.offline-json-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: var(--lavender-mist);
  border-radius: var(--radius-sm);
  margin-top: 1rem;
  border: 1px solid var(--border-subtle);
}

.offline-json-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark-amethyst);
}

.offline-json-actions {
  display: flex;
  gap: 0.5rem;
}

/* Firebase Config Modal */
.fb-config-modal-card {
  max-width: 540px;
}

.fb-config-status {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 145, 0, 0.1);
  border: 1px solid rgba(255, 145, 0, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: #d84315;
  margin-bottom: 1rem;
}

.fb-config-status.active {
  background: var(--status-success-bg);
  border-color: rgba(27, 135, 84, 0.3);
  color: var(--status-success);
}

.fb-code-area {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: #faf8fc;
  border: 1.5px solid var(--border-light);
  line-height: 1.4;
}

.fb-details-accordion {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  background: var(--lavender-mist);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  font-size: 0.82rem;
}

.fb-details-accordion summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--indigo-velvet);
}

.fb-guide-box {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.45;
}

.fb-guide-box h5 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--dark-amethyst);
  margin-bottom: 0.45rem;
}

.fb-guide-box ol {
  padding-left: 1.25rem;
  color: var(--text-secondary);
}

.fb-guide-box a {
  color: var(--indigo-velvet);
  font-weight: 700;
  text-decoration: underline;
}

/* ==========================================================================
   Mobile Bottom Navigation & Non-Overlapping Mobile Header System
   ========================================================================== */

/* Logo Vector Specific Styling */
.logo-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--indigo-velvet), #7e43c5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(83, 43, 136, 0.45);
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.logo-icon:hover {
  transform: scale(1.05);
}

.riiot-brand-svg {
  width: 26px;
  height: 26px;
  stroke: #ffffff;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.25));
}

/* Mobile Menu & Bottom Nav Defaults (Desktop: Hidden) */
.mobile-menu-wrap {
  position: relative;
  display: none;
}

.mobile-bottom-nav {
  display: none;
}

/* Mobile Menu Backdrop (Hidden by default everywhere) */
.mobile-menu-backdrop {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 6, 28, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9998 !important;
}

.mobile-menu-backdrop.open {
  display: block !important;
}

/* Mobile Dropdown Sheet (Hidden by default everywhere) */
.mobile-dropdown-sheet {
  display: none;
  position: fixed;
  top: calc(56px + env(safe-area-inset-top, 0px) + 8px);
  right: max(12px, env(safe-area-inset-right, 0px));
  width: 320px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 75px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #231238;
  border: 1.5px solid rgba(200, 177, 228, 0.45);
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75);
  z-index: 9999 !important;
  padding: 1.1rem;
}

.mobile-dropdown-sheet.open {
  display: block !important;
  animation: dropdown-fade-in 0.18s ease-out;
}

.mobile-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(200, 177, 228, 0.25);
  margin-bottom: 0.75rem;
}

.mobile-sheet-user {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffffff;
}

.mobile-sheet-close {
  font-size: 1.5rem;
  color: #d8c7ee;
  line-height: 1;
  padding: 0 4px;
  background: none;
  border: none;
  cursor: pointer;
}

.mobile-sheet-section {
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sheet-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #d8c7ee !important;
  font-weight: 800 !important;
  margin-bottom: 4px;
}

.mobile-sheet-btn,
a.mobile-sheet-btn,
a.mobile-sheet-btn:link,
a.mobile-sheet-btn:visited,
a.mobile-sheet-btn:hover,
a.mobile-sheet-btn:active {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0.6rem 0.85rem !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border: 1px solid rgba(200, 177, 228, 0.3) !important;
  border-radius: 10px !important;
  color: #ffffff !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: all var(--transition-fast) !important;
  text-align: left !important;
  width: 100% !important;
  text-decoration: none !important;
  box-sizing: border-box !important;
}

.mobile-sheet-btn:hover,
a.mobile-sheet-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  border-color: var(--wisteria) !important;
}

.mobile-sheet-btn span,
.mobile-sheet-btn svg,
a.mobile-sheet-btn span,
a.mobile-sheet-btn svg {
  color: #ffffff !important;
  stroke: #ffffff !important;
}

.mobile-sheet-btn .badge-subtle,
#mobileCloudBadge {
  background: rgba(155, 114, 207, 0.35) !important;
  color: #ffffff !important;
  border: 1px solid rgba(200, 177, 228, 0.5) !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  padding: 2px 8px !important;
  border-radius: var(--radius-full) !important;
  min-width: auto !important;
}

.mobile-clock-row {
  color: #d8c7ee !important;
}
.mobile-clock-row span {
  color: #d8c7ee !important;
}
#mobileLiveClock {
  color: #ffffff !important;
}

/* Responsive Breakpoint for Mobile & APK Devices */
@media (max-width: 900px) {
  /* Prevent Header Horizontal Overflow & Overlapping */
  .top-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    padding-top: max(0.55rem, env(safe-area-inset-top, 0px)) !important;
    padding-bottom: 0.55rem !important;
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px)) !important;
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px)) !important;
    min-height: calc(56px + env(safe-area-inset-top, 0px)) !important;
    height: auto !important;
    gap: 0.5rem !important;
    box-sizing: border-box !important;
  }

  .header-left {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .brand-logo {
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    min-width: 0 !important;
    cursor: pointer !important;
  }

  .logo-icon {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    flex-shrink: 0 !important;
  }

  .brand-text {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    min-width: 0 !important;
    line-height: 1.15 !important;
  }

  /* Move primary tabs out of header on mobile to completely prevent overlapping */
  .header-left .nav-tabs {
    display: none !important;
  }

  .brand-name {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .store-badge-row {
    padding: 1px 6px !important;
    font-size: 0.65rem !important;
    max-width: 100px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  .store-name-text {
    max-width: 75px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .header-right {
    position: static !important;
    display: flex !important;
    align-items: center !important;
    gap: 0.45rem !important;
    flex-shrink: 0 !important;
  }

  /* Hide bulky trial status pill from header on mobile - it is already in the mobile drawer menu */
  .trial-pill-wrap {
    display: none !important;
  }

  /* Move Cashier & Sound buttons into mobile menu */
  .cashier-pill {
    display: none !important;
  }

  #soundToggleBtn {
    display: none !important;
  }

  /* Compact Cloud Pill on mobile */
  .cloud-account-pill-wrap {
    margin: 0 !important;
  }

  .cloud-auth-btn {
    padding: 0.32rem 0.6rem !important;
    font-size: 0.72rem !important;
    border-radius: var(--radius-full) !important;
  }

  .cloud-auth-btn .cloud-btn-text {
    display: none !important; /* Hide long text on small phones */
  }

  .cloud-auth-btn.icon-only-btn {
    display: none !important; /* Managed in mobile menu */
  }

  .cloud-user-btn {
    padding: 0.32rem 0.6rem !important;
  }

  .cloud-user-meta .cloud-sync-status-text {
    display: none !important;
  }

  .cloud-user-meta .cloud-business-name {
    max-width: 80px !important;
  }

  .chevron-icon {
    display: none !important;
  }

  /* Mobile Cart Button */
  .mobile-cart-btn {
    display: flex !important;
    width: 38px !important;
    height: 38px !important;
  }

  /* Mobile Menu Toggle Button */
  .mobile-menu-wrap {
    display: block !important;
  }

  .mobile-menu-btn {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(200, 177, 228, 0.25);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: all var(--transition-fast);
  }

  .mobile-menu-btn:hover,
  .mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.22);
  }

  /* Thumb-Friendly Fixed Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-nav-actual-h) !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    background: #25123d;
    border-top: 1px solid rgba(200, 177, 228, 0.22);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    z-index: 999;
    align-items: center;
    justify-content: space-around;
    padding-left: max(8px, env(safe-area-inset-left, 0px));
    padding-right: max(8px, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
  }

  .bottom-nav-tab {
    flex: 1;
    height: 100%;
    min-height: var(--touch-target-min);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--wisteria);
    font-size: 0.72rem;
    font-weight: 600;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
    touch-action: manipulation;
  }

  .bottom-nav-tab svg {
    transition: transform var(--transition-fast);
  }

  .bottom-nav-tab.active {
    color: #ffffff;
  }

  .bottom-nav-tab.active svg {
    color: #ffffff;
    transform: translateY(-2px);
    filter: drop-shadow(0 2px 8px rgba(155, 114, 207, 0.8));
  }

  .bottom-nav-tab.active span {
    color: #ffffff;
    font-weight: 700;
  }

  /* Coordinate Layout Box: App-main ends exactly at the top of bottom nav */
  body {
    padding-bottom: 0 !important;
  }

  .app-main {
    height: calc(100dvh - var(--header-actual-h) - var(--bottom-nav-actual-h)) !important;
    padding-bottom: 0 !important;
  }

  .app-footer {
    display: none !important;
  }

  /* Toasts appear safely above the mobile navigation bar */
  .toast-container {
    bottom: calc(var(--bottom-nav-actual-h) + 0.75rem) !important;
    right: max(1rem, env(safe-area-inset-right, 0px)) !important;
    left: max(1rem, env(safe-area-inset-left, 0px)) !important;
    align-items: center !important;
  }
}

/* ==========================================================================
   PRODUCT IMAGE UPLOAD & VISUAL IDENTIFICATION SYSTEM
   ========================================================================== */

.product-image-box img,
.product-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  transition: transform var(--transition-fast);
  display: block;
}

.product-card:hover .product-image-box img,
.product-card:hover .product-thumb-img {
  transform: scale(1.06);
}

.product-image-upload-wrap {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  background: var(--lavender-mist);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.product-img-preview-box {
  width: 82px;
  height: 82px;
  min-width: 82px;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 2px dashed rgba(155, 114, 207, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.product-img-preview-box:hover,
.product-img-preview-box.dragover {
  border-color: var(--indigo-velvet);
  background: rgba(244, 239, 250, 0.95);
  box-shadow: 0 4px 12px rgba(83, 43, 136, 0.12);
}

.product-img-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.img-preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.5rem;
  text-align: center;
  color: var(--text-muted);
}

.img-preview-placeholder svg {
  color: var(--lavender-purple);
}

.img-preview-placeholder span {
  font-size: 0.68rem;
  line-height: 1.2;
  font-weight: 600;
}

.btn-remove-preview-img {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.92);
  color: #ffffff;
  border: 1px solid #ffffff;
  font-size: 14px;
  line-height: 1;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: transform var(--transition-fast);
  z-index: 5;
}

.btn-remove-preview-img:hover {
  transform: scale(1.15);
  background: #dc3545;
}

.product-img-upload-actions {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Inventory Table Visual Product Cells */
.inv-product-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.inv-thumb-box {
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: var(--radius-xs);
  background: linear-gradient(135deg, rgba(244, 239, 250, 0.9), rgba(200, 177, 228, 0.4));
  border: 1px solid rgba(200, 177, 228, 0.45);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(83, 43, 136, 0.08);
}

.inv-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.inv-thumb-box svg {
  width: 22px;
  height: 22px;
  color: var(--indigo-velvet);
}

.inv-name-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.inv-product-name {
  color: var(--dark-amethyst);
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
}

.inv-product-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.category-tag-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(155, 114, 207, 0.12);
  color: var(--indigo-velvet);
  border: 1px solid rgba(155, 114, 207, 0.25);
  white-space: nowrap;
}

/* Cart Item Image Visuals */
.cart-item-with-thumb {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
}

.cart-item-thumb {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: var(--radius-xs);
  background: var(--lavender-mist);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200, 177, 228, 0.35);
}

.cart-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cart-item-thumb svg {
  width: 18px;
  height: 18px;
  color: var(--indigo-velvet);
}

/* Category Management Item Counts */
.category-count-pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(155, 114, 207, 0.15);
  color: var(--indigo-velvet);
  margin-left: 6px;
}

/* Global Infallible Open Overrides for Mobile Menu Dropdown & Backdrop */
.mobile-menu-backdrop.open {
  display: block !important;
  z-index: 9998 !important;
}

.mobile-dropdown-sheet.open {
  display: block !important;
  z-index: 9999 !important;
}

/* ==========================================================================
   CUSTOMER BAR & ORDER TRACKING SYSTEM
   ========================================================================== */

.cart-customer-bar {
  padding: 0.65rem 1rem;
  background: rgba(155, 114, 207, 0.08);
  border-bottom: 1px solid rgba(155, 114, 207, 0.15);
}

.customer-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid rgba(155, 114, 207, 0.3);
  border-radius: var(--radius-md);
  padding: 0 0.75rem;
  transition: all var(--transition-fast);
}

.customer-input-wrap:focus-within {
  border-color: var(--primary-purple);
  box-shadow: 0 0 0 3px rgba(112, 44, 153, 0.12);
}

.customer-input-wrap svg {
  color: var(--indigo-velvet);
  flex-shrink: 0;
  margin-right: 0.5rem;
}

.customer-input-wrap input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  padding: 0.55rem 0;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--dark-amethyst);
  font-family: inherit;
}

.customer-input-wrap input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

/* Orders Badges on Nav */
.orders-badge {
  background: #f59e0b !important;
  color: #ffffff !important;
  font-weight: 800;
}

.orders-badge-header {
  position: static !important;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 4px 12px;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-full);
}

/* Orders Top Header Search */
.orders-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 0.75rem;
  box-shadow: var(--shadow-sm);
}

.orders-search-wrap svg {
  color: var(--text-muted);
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.orders-search-input {
  border: none;
  outline: none;
  background: transparent;
  padding: 0.5rem 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  width: 220px;
}

/* Active Orders Grid */
.orders-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* Order Card */
.order-card {
  background: #ffffff;
  border: 1px solid rgba(155, 114, 207, 0.22);
  border-left: 5px solid var(--primary-purple);
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(37, 18, 61, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.order-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(37, 18, 61, 0.1);
  border-color: rgba(155, 114, 207, 0.4);
}

.order-card.urgent {
  border-left-color: #ef4444;
}

.order-card.warming {
  border-left-color: #f59e0b;
}

/* Card Header */
.order-card-header {
  padding: 1rem 1.15rem 0.75rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(155, 114, 207, 0.1);
  background: rgba(155, 114, 207, 0.03);
}

.order-header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.order-header-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.order-num-pill {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.8rem;
  color: #ffffff;
  background: var(--dark-amethyst);
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
}

.order-pay-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.order-customer-title {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--dark-amethyst);
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-customer-title svg {
  color: var(--primary-purple);
  flex-shrink: 0;
}

/* Live Timer Pill */
.order-timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.order-timer-badge svg {
  flex-shrink: 0;
}

.order-timer-badge.timer-green {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.order-timer-badge.timer-amber {
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.order-timer-badge.timer-red {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
  border: 1px solid rgba(239, 68, 68, 0.45);
  animation: pulseTimer 1.8s infinite ease-in-out;
}

@keyframes pulseTimer {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    transform: scale(1.03);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0);
  }
}

/* Card Meta (Time & Cashier) */
.order-card-meta {
  padding: 0.45rem 1.15rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #faf9fc;
  border-bottom: 1px dashed rgba(155, 114, 207, 0.18);
}

/* Card Items List */
.order-card-items {
  padding: 0.85rem 1.15rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 220px;
  overflow-y: auto;
}

.order-item-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.86rem;
}

.order-item-left {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.order-item-qty {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--primary-purple);
  background: rgba(112, 44, 153, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.order-item-name {
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-item-price {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--dark-amethyst);
  font-size: 0.84rem;
  flex-shrink: 0;
}

/* Card Footer */
.order-card-footer {
  padding: 0.85rem 1.15rem;
  background: #ffffff;
  border-top: 1px solid rgba(155, 114, 207, 0.15);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-total-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.order-total-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.order-total-val {
  font-size: 1.18rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--dark-amethyst);
}

.order-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-complete-order {
  flex: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.86rem;
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: all var(--transition-fast);
}

.btn-complete-order:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.btn-order-slip {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: rgba(155, 114, 207, 0.1);
  color: var(--indigo-velvet);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.65rem 0.5rem;
  border: 1px solid rgba(155, 114, 207, 0.25);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-order-slip:hover {
  background: rgba(155, 114, 207, 0.18);
  color: var(--primary-purple);
}

.btn-cancel-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.6rem;
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-cancel-order:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.25);
}

/* Orders Empty State */
.orders-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: #ffffff;
  border-radius: 16px;
  border: 2px dashed rgba(155, 114, 207, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.orders-empty-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(155, 114, 207, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-purple);
}

.orders-empty-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dark-amethyst);
}

.orders-empty-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  max-width: 440px;
  line-height: 1.5;
  margin: 0;
}

@media (max-width: 768px) {
  .orders-grid-container {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    margin-top: 1rem;
  }
  .orders-search-input {
    width: 140px;
  }
}

/* ==========================================================================
   Daily Service Closeout & Spreadsheet Export Feature
   ========================================================================== */

/* Daily Service Banner in Sales View */
.daily-service-card {
  background: linear-gradient(135deg, #ffffff 0%, var(--lavender-mist) 100%);
  border: 1.5px solid var(--border-light);
  border-left: 5px solid var(--indigo-velvet);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.daily-service-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--lavender-purple);
}

.daily-service-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.daily-service-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(83, 43, 136, 0.1);
  color: var(--indigo-velvet);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.daily-service-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.daily-service-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.daily-service-heading {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--dark-amethyst);
}

.daily-export-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.daily-export-status-badge.pending {
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.daily-export-status-badge.closed {
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.daily-service-desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.daily-service-desc strong {
  color: var(--dark-amethyst);
}

.daily-service-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

/* Modal Specifics */
#dailyExportModal {
  z-index: 100005;
}

.daily-export-modal-card {
  max-width: 680px;
  width: 100%;
}

.daily-export-body {
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-height: calc(85vh - 130px);
  overflow-y: auto;
}

.daily-export-toolbar {
  background: rgba(83, 43, 136, 0.04);
  border: 1px solid rgba(200, 177, 228, 0.5);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.daily-date-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.daily-date-pills {
  display: flex;
  gap: 0.35rem;
}

.daily-date-pill {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-light);
  background: #ffffff;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.daily-date-pill:hover {
  border-color: var(--lavender-purple);
  color: var(--indigo-velvet);
}

.daily-date-pill.active {
  background: var(--indigo-velvet);
  color: #ffffff;
  border-color: var(--indigo-velvet);
}

.daily-date-input-wrap {
  flex: 1;
  min-width: 160px;
}

.daily-date-input-wrap input[type="date"] {
  padding: 0.38rem 0.75rem;
  font-size: 0.84rem;
  border-radius: var(--radius-sm);
}

/* Hero card inside modal */
.daily-summary-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, var(--dark-amethyst) 0%, #462272 100%);
  color: #ffffff;
  border-radius: var(--radius-sm);
}

.daily-hero-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--wisteria);
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.daily-hero-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.daily-status-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* 4-Box Grid inside Modal */
.daily-metrics-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.65rem;
}

.daily-metric-box {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
}

.daily-metric-box.highlight {
  border-color: var(--indigo-velvet);
  background: rgba(83, 43, 136, 0.03);
}

.daily-metric-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.daily-metric-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--dark-amethyst);
}

.daily-metric-val.success {
  color: var(--status-success);
}

.daily-metric-sub {
  font-size: 0.7rem;
  color: var(--status-success);
  font-weight: 600;
}

/* Reconciliation Panel */
.daily-reconcile-panel {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}

.daily-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
}

.daily-panel-header h5 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--dark-amethyst);
  display: flex;
  align-items: center;
  gap: 6px;
}

.daily-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.daily-mini-table th {
  background: rgba(200, 177, 228, 0.35);
  padding: 6px 10px;
  font-weight: 700;
  color: var(--dark-amethyst);
  font-size: 0.75rem;
  border-bottom: 1.5px solid var(--border-light);
}

.daily-mini-table td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(200, 177, 228, 0.3);
  color: var(--dark-amethyst);
}

.daily-mini-table tr.total-row {
  font-weight: 800;
  background: rgba(83, 43, 136, 0.05);
}

/* Accordion */
.daily-details-accordion {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 0.5rem 0.85rem;
}

.daily-details-accordion summary {
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--indigo-velvet);
  user-select: none;
}

.daily-accordion-table-wrap {
  margin-top: 0.5rem;
  max-height: 180px;
  overflow-y: auto;
}

/* Export Format Cards */
.daily-export-options-box {
  background: rgba(83, 43, 136, 0.03);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
}

.daily-format-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.daily-format-card {
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.daily-format-card:hover {
  border-color: var(--lavender-purple);
  background: rgba(244, 239, 250, 0.5);
}

.daily-format-card.active {
  border-color: var(--indigo-velvet);
  background: rgba(83, 43, 136, 0.05);
  box-shadow: 0 0 0 1px var(--indigo-velvet);
}

.format-card-radio {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  margin-top: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.daily-format-card.active .format-card-radio {
  border-color: var(--indigo-velvet);
  background: var(--indigo-velvet);
}

.daily-format-card.active .format-card-radio::after {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}

.format-card-content strong {
  display: block;
  font-size: 0.84rem;
  color: var(--dark-amethyst);
  margin-bottom: 2px;
}

.format-card-content p {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.format-pill {
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(83, 43, 136, 0.12);
  color: var(--indigo-velvet);
  padding: 2px 6px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
}

/* Chat summary */
.daily-chat-copy-box {
  background: #ffffff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}

.chat-copy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.8rem;
}

.btn-xs {
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
}

.daily-chat-copy-box textarea {
  font-family: var(--font-mono, monospace);
  font-size: 0.75rem;
  line-height: 1.4;
  background: #faf8fd;
}

/* Modal Footer */
.daily-export-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.35rem;
  gap: 0.75rem;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
}

.daily-footer-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
  .daily-service-card {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.85rem;
  }
  .daily-service-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .daily-service-actions .primary-btn,
  .daily-service-actions .secondary-btn {
    width: 100%;
  }
  .daily-metrics-mini-grid {
    grid-template-columns: 1fr 1fr;
  }
  .daily-format-grid {
    grid-template-columns: 1fr;
  }
  .daily-export-footer {
    flex-direction: column-reverse;
  }
  .daily-footer-left,
  .daily-footer-right {
    width: 100%;
    display: flex;
    justify-content: stretch;
  }
  .daily-footer-right button,
  .daily-footer-left button {
    flex: 1;
  }
}

/* ==========================================================================
   RateIT 15-Day Free Trial Authorization & Cloud Licensing Styles
   ========================================================================== */

/* Header Trial Status Pill */
.trial-pill-wrap {
  display: inline-flex;
  align-items: center;
}

.trial-status-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.8rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  cursor: pointer;
  border: 1.5px solid transparent;
  line-height: 1;
}

.trial-status-btn .trial-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.trial-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

/* Status variants */
/* Active Trial */
.trial-status-btn.trial {
  background: rgba(155, 114, 207, 0.15);
  border-color: rgba(155, 114, 207, 0.4);
  color: var(--indigo-velvet);
}
.trial-status-btn.trial .trial-status-dot {
  background: var(--lavender-purple);
  box-shadow: 0 0 6px rgba(155, 114, 207, 0.6);
}
.trial-status-btn.trial:hover {
  background: rgba(155, 114, 207, 0.25);
  border-color: var(--indigo-velvet);
  transform: translateY(-1px);
}

/* Warning (<3 days left) */
.trial-status-btn.warning {
  background: var(--status-warning-bg);
  border-color: rgba(178, 94, 0, 0.4);
  color: var(--status-warning);
}
.trial-status-btn.warning .trial-status-dot {
  background: var(--status-warning);
  animation: pulseWarning 1.5s infinite;
}
@keyframes pulseWarning {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}
.trial-status-btn.warning:hover {
  background: #ffe8cc;
  border-color: var(--status-warning);
  transform: translateY(-1px);
}

/* Expired */
.trial-status-btn.expired {
  background: var(--status-danger-bg);
  border-color: rgba(197, 34, 31, 0.4);
  color: var(--status-danger);
  animation: pulseDanger 1.8s infinite;
}
.trial-status-btn.expired .trial-status-dot {
  background: var(--status-danger);
}
@keyframes pulseDanger {
  0%, 100% { box-shadow: 0 0 0 0 rgba(197, 34, 31, 0.4); }
  70% { box-shadow: 0 0 0 6px rgba(197, 34, 31, 0); }
}

/* Licensed / Active */
.trial-status-btn.licensed {
  background: var(--status-success-bg);
  border-color: rgba(27, 135, 84, 0.35);
  color: var(--status-success);
}
.trial-status-btn.licensed .trial-status-dot {
  background: var(--status-success);
}
.trial-status-btn.licensed:hover {
  background: #d4edda;
  border-color: var(--status-success);
  transform: translateY(-1px);
}

/* Mobile Badge in Dropdown */
.badge-subtle.badge-trial {
  background: rgba(155, 114, 207, 0.2);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-subtle.badge-trial.warning {
  background: #fff3e0;
  color: var(--status-warning);
}
.badge-subtle.badge-trial.expired {
  background: #fde8e8;
  color: var(--status-danger);
}
.badge-subtle.badge-trial.licensed {
  background: #e8f5e9;
  color: var(--status-success);
}

/* Trial Modal Card */
.trial-modal-card {
  max-width: 540px;
}
.trial-badge-icon {
  background: linear-gradient(135deg, rgba(83, 43, 136, 0.15), rgba(155, 114, 207, 0.25));
  color: var(--indigo-velvet);
}
.trial-modal-body {
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Hero Banner */
.trial-hero-banner {
  background: linear-gradient(135deg, rgba(83, 43, 136, 0.08), rgba(155, 114, 207, 0.14));
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.trial-hero-banner.licensed-mode {
  background: linear-gradient(135deg, rgba(27, 135, 84, 0.08), rgba(27, 135, 84, 0.16));
  border-color: rgba(27, 135, 84, 0.35);
}
.trial-hero-banner.expired-mode {
  background: linear-gradient(135deg, rgba(197, 34, 31, 0.08), rgba(197, 34, 31, 0.16));
  border-color: rgba(197, 34, 31, 0.35);
}
.trial-hero-info {
  flex: 1;
}
.trial-hero-badge {
  display: inline-block;
  background: var(--indigo-velvet);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-bottom: 0.35rem;
}
.trial-hero-banner.licensed-mode .trial-hero-badge {
  background: var(--status-success);
}
.trial-hero-banner.expired-mode .trial-hero-badge {
  background: var(--status-danger);
}
.trial-hero-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--dark-amethyst);
}
.trial-hero-subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.trial-hero-days {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.95rem;
  min-width: 76px;
  box-shadow: var(--shadow-sm);
}
.trial-days-number {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--indigo-velvet);
  line-height: 1;
  font-family: var(--font-mono, monospace);
}
.trial-days-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-top: 3px;
}

/* Meta rows */
.trial-meta-section {
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.5rem 0.85rem;
  display: flex;
  flex-direction: column;
}
.trial-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.35rem;
  border-bottom: 1px solid rgba(200, 177, 228, 0.25);
  font-size: 0.82rem;
}
.trial-meta-row:last-child {
  border-bottom: none;
}
.trial-meta-label {
  color: var(--text-secondary);
  font-weight: 500;
}
.trial-meta-val {
  font-weight: 600;
  color: var(--dark-amethyst);
}
.trial-meta-val-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.trial-meta-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--lavender-mist);
  color: var(--indigo-velvet);
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid rgba(155, 114, 207, 0.3);
  letter-spacing: 0.5px;
}
.btn-xs-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(83, 43, 136, 0.1);
  border: 1px solid rgba(83, 43, 136, 0.2);
  color: var(--indigo-velvet);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.btn-xs-copy:hover {
  background: var(--indigo-velvet);
  color: #fff;
}

/* Action Box */
.trial-action-box {
  background: var(--lavender-mist);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.trial-action-text strong {
  display: block;
  font-size: 0.85rem;
  color: var(--dark-amethyst);
  margin-bottom: 2px;
}
.trial-action-text p {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.35;
}
.trial-action-box .secondary-btn {
  white-space: nowrap;
  font-size: 0.8rem;
  padding: 0.45rem 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Accordion */
.trial-accordion {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #ffffff;
  overflow: hidden;
}
.trial-accordion-summary {
  padding: 0.65rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--indigo-velvet);
  cursor: pointer;
  background: rgba(244, 239, 250, 0.5);
  user-select: none;
}
.trial-accordion-summary:hover {
  background: rgba(244, 239, 250, 0.9);
}
.trial-accordion-content {
  padding: 0.85rem 0.95rem;
  border-top: 1px solid var(--border-subtle);
}
.trial-subnote {
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin: 0 0 0.55rem;
}
.license-input-group {
  display: flex;
  gap: 0.5rem;
}
.license-key-input {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.trial-key-feedback {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  padding: 6px 10px;
  border-radius: 4px;
}
.trial-key-feedback.success {
  background: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid rgba(27, 135, 84, 0.3);
}
.trial-key-feedback.error {
  background: var(--status-danger-bg);
  color: var(--status-danger);
  border: 1px solid rgba(197, 34, 31, 0.3);
}

/* Support card */
.trial-support-card {
  background: #ffffff;
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}
.trial-support-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(24, 119, 242, 0.1);
  color: #1877f2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.trial-support-content {
  flex: 1;
}
.trial-support-title {
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--dark-amethyst);
  display: block;
}
.trial-support-content p {
  margin: 0.2rem 0 0.4rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
}
.trial-support-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1877f2;
  text-decoration: none;
}
.trial-support-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Full-Screen Trial / Terminal Lockout Overlay (Centered & Mobile-Optimized)
   ========================================================================== */
.trial-lockout-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 10, 40, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: flex-start; /* CRITICAL: Must be flex-start so content never cuts off at the top on small screens! */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 1rem 1rem calc(4rem + env(safe-area-inset-bottom, 24px));
  box-sizing: border-box;
}

.trial-lockout-card {
  background: #ffffff;
  border: 1.5px solid rgba(155, 114, 207, 0.35);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  margin: auto; /* Centers card vertically & horizontally when there is space, but allows 100% scrolling when tall! */
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  animation: modalScale 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.trial-lockout-header {
  background: linear-gradient(135deg, #201034 0%, #3e1763 100%);
  color: #ffffff;
  padding: 1.5rem 1.5rem 1.25rem;
  text-align: center;
  border-bottom: 3px solid var(--status-danger);
  position: relative;
}

.lockout-badge-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}

.lockout-shield-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(197, 34, 31, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #ff6b6b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(197, 34, 31, 0.35);
}

.lockout-chip {
  background: rgba(197, 34, 31, 0.9);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.75px;
  padding: 3px 11px;
  border-radius: var(--radius-full);
}

.trial-lockout-title {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.3px;
  color: #ffffff;
  line-height: 1.25;
}

.trial-lockout-desc {
  margin: 0.45rem auto 0;
  font-size: 0.84rem;
  color: var(--wisteria);
  max-width: 440px;
  line-height: 1.45;
}

.trial-lockout-body {
  padding: 1.25rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #ffffff;
}

/* Terminal ID Box */
.lockout-id-box {
  background: var(--lavender-mist);
  border: 1.5px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.lockout-id-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.lockout-id-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.lockout-id-code {
  font-family: var(--font-mono, monospace);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--dark-amethyst);
  letter-spacing: 0.6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#btnLockoutCopyId {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0.5rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 6px;
  background: var(--indigo-velvet);
  color: #ffffff;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}
#btnLockoutCopyId:hover {
  background: #401b63;
}

/* Key Activation Card */
.lockout-key-card {
  background: #ffffff;
  border: 1.5px solid rgba(83, 43, 136, 0.25);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 4px 12px rgba(47, 24, 75, 0.04);
}

.lockout-key-header strong {
  display: block;
  font-size: 0.88rem;
  color: var(--dark-amethyst);
  font-weight: 800;
}

.lockout-key-header span {
  display: block;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.35;
}

.lockout-key-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.lockout-key-input-row .license-key-input {
  flex: 1;
  font-family: var(--font-mono, monospace);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--border-light);
  border-radius: 8px;
  outline: none;
}
.lockout-key-input-row .license-key-input:focus {
  border-color: var(--indigo-velvet);
  box-shadow: 0 0 0 3px rgba(83, 43, 136, 0.12);
}

#btnLockoutActivate {
  background: var(--indigo-velvet);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.15rem;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#btnLockoutActivate:hover {
  background: #401b63;
  transform: translateY(-1px);
}

/* Secondary Actions */
.lockout-actions-row {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lockout-main-btn {
  width: 100%;
  padding: 0.72rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: rgba(83, 43, 136, 0.08);
  border: 1.5px solid rgba(83, 43, 136, 0.25);
  color: var(--indigo-velvet);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.lockout-main-btn:hover {
  background: rgba(83, 43, 136, 0.15);
  border-color: var(--indigo-velvet);
}

.facebook-contact-btn {
  background: #1877f2;
  color: #ffffff !important;
  border: none;
  border-radius: 8px;
  padding: 0.72rem 1rem;
  font-size: 0.88rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: 0 3px 10px rgba(24, 119, 242, 0.25);
}
.facebook-contact-btn:hover {
  background: #166fe5;
  transform: translateY(-1px);
}

/* Safe Data Box */
.lockout-safe-data-box {
  background: var(--lavender-mist);
  border: 1px solid rgba(83, 43, 136, 0.18);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.safe-data-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(83, 43, 136, 0.12);
  color: var(--indigo-velvet);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.safe-data-text {
  flex: 1;
  min-width: 0;
}

.safe-data-text strong {
  display: block;
  font-size: 0.8rem;
  color: var(--dark-amethyst);
}

.safe-data-text span {
  display: block;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.3;
}

#btnLockoutExportSpreadsheet {
  flex-shrink: 0;
}

.trial-lockout-footer {
  background: var(--lavender-mist);
  border-top: 1px solid var(--border-light);
  padding: 0.65rem 1rem;
  text-align: center;
}

.lockout-brand-text {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Mobile & Small Screen Optimizations */
@media (max-width: 640px) {
  .trial-lockout-overlay {
    padding: 0.75rem 0.75rem calc(5rem + env(safe-area-inset-bottom, 30px));
    align-items: flex-start !important;
  }

  .trial-lockout-card {
    border-radius: var(--radius-md);
    margin: 1rem auto calc(4rem + env(safe-area-inset-bottom, 24px)) !important;
    max-width: 100%;
    width: 100%;
  }

  .trial-lockout-header {
    padding: 1.15rem 1rem 0.95rem;
  }

  .lockout-shield-icon {
    width: 44px;
    height: 44px;
  }
  .lockout-shield-icon svg {
    width: 24px;
    height: 24px;
  }

  .trial-lockout-title {
    font-size: 1.15rem;
  }

  .trial-lockout-desc {
    font-size: 0.78rem;
    line-height: 1.35;
  }

  .trial-lockout-body {
    padding: 1rem 0.85rem;
    gap: 0.85rem;
  }

  .lockout-id-box {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 0.75rem 0.85rem;
    gap: 0.55rem;
  }

  .lockout-id-info {
    align-items: center;
  }

  .lockout-id-code {
    font-size: 1.05rem;
    display: inline-block;
    padding: 4px 8px;
    background: rgba(83, 43, 136, 0.08);
    border-radius: 6px;
    width: 100%;
    text-align: center;
  }

  #btnLockoutCopyId {
    width: 100%;
    justify-content: center;
    padding: 0.6rem;
  }

  .lockout-key-input-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .lockout-key-input-row .license-key-input {
    width: 100%;
    text-align: center;
    font-size: 1.05rem;
    letter-spacing: 2px;
    padding: 0.75rem;
  }

  #btnLockoutActivate {
    width: 100%;
    padding: 0.75rem;
    font-size: 0.92rem;
  }

  .lockout-safe-data-box {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    padding: 0.75rem;
  }

  .lockout-safe-data-box .safe-data-icon {
    margin: 0 auto;
  }

  #btnLockoutExportSpreadsheet {
    width: 100%;
    justify-content: center;
    padding: 0.5rem;
  }
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .trial-status-btn {
    padding: 0.32rem 0.6rem !important;
    font-size: 0.72rem !important;
  }
  .trial-hero-banner {
    flex-direction: column;
    align-items: flex-start;
  }
  .trial-hero-days {
    width: 100%;
    flex-direction: row;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.45rem;
  }
  .trial-hero-days .trial-days-label {
    margin-top: 0;
  }
  .trial-pill-text {
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}



