/* ═══════════════════════════════════════════════════════════
   Catappa Village — Design System
   Premium, mobile-first restaurant inventory UI
   ═══════════════════════════════════════════════════════════ */

/* ── Google Fonts ─────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Cinzel:wght@600;700;800;900&family=Poppins:wght@600;700;800&display=swap');

/* ── Design Tokens ────────────────────────────────────────── */
:root {
  /* Brand Colors */
  --gold: #E6B325;
  --gold-light: #F0D060;
  --gold-dark: #C89A1E;
  --gold-glow: rgba(230, 179, 37, 0.25);
  --brown: #5D4037;
  --brown-light: #795548;
  --brown-dark: #3E2723;
  --brown-deep: #2C1810;
  --neutral: #F8F9FA;
  --neutral-dark: #E9ECEF;
  --neutral-200: #DEE2E6;
  --red: #B22222;
  --red-light: #D32F2F;
  --red-glow: rgba(178, 34, 34, 0.15);

  /* Semantic Colors */
  --success: #2E7D32;
  --success-light: #E8F5E9;
  --success-bg: rgba(46, 125, 50, 0.08);
  --danger-light: #FFEBEE;
  --danger-bg: rgba(178, 34, 34, 0.08);
  --warning: #F57F17;
  --warning-light: #FFF8E1;
  --info: #1565C0;

  /* Neutrals */
  --white: #FFFFFF;
  --text-primary: #1A1A2E;
  --text-secondary: #6C757D;
  --text-muted: #ADB5BD;
  --border: #E0E0E0;
  --border-light: #F0F0F0;

  /* Elevations */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
  --shadow-gold: 0 4px 20px rgba(230, 179, 37, 0.3);

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 68px;
  --mobile-nav-h: 64px;

  /* Transitions */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 400ms;
}

/* ── Reset & Base ─────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--neutral);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-200);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ── Keyframes ────────────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes pulseRing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }

  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }

  100% {
    background-position: 200% 0;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }

  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateX(100%) scale(0.9);
  }
}

/* ── Utility Classes ──────────────────────────────────────── */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.text-gold {
  color: var(--gold);
}

.text-red {
  color: var(--red);
}

.text-green {
  color: var(--success);
}

.text-muted {
  color: var(--text-secondary);
}

.text-center {
  text-align: center;
}

.fw-600 {
  font-weight: 600;
}

.fw-700 {
  font-weight: 700;
}

.animate-in {
  animation: fadeIn var(--dur-normal) var(--ease-out) forwards;
}

/* ── Screen Management ────────────────────────────────────── */
.screen {
  display: none;
}

.screen.active {
  display: flex;
}

.page {
  display: none;
  width: 100%;
}

.page.active {
  display: block;
  animation: fadeIn 0.3s var(--ease-out);
}

/* ═══════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════ */
#login-screen {
  width: 100vw;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brown-deep) 0%, var(--brown-dark) 40%, var(--brown) 100%);
  position: relative;
  overflow: hidden;
}

#login-screen::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80vw;
  height: 80vw;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow) 0%, transparent 70%);
  pointer-events: none;
}

#login-screen::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(93, 64, 55, 0.3) 0%, transparent 70%);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  padding: 48px 40px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-xl), 0 0 80px rgba(0, 0, 0, 0.2);
  animation: scaleIn 0.6s var(--ease-out);
  color: #FFF;
}

.login-brand {
  text-align: center;
  margin-bottom: 36px;
}

.brand-icon {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(230, 179, 37, 0.35));
}

.login-brand h1 {
  font-family: 'Cinzel', 'Poppins', serif;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--gold);
  text-transform: uppercase;
}

.login-brand p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
  letter-spacing: 1px;
}

.login-card .form-group {
  margin-bottom: 20px;
}

.login-card label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.login-card input[type="password"],
.login-card input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.06);
  color: #FFF;
  font-size: 0.95rem;
  transition: all var(--dur-normal) var(--ease-out);
  outline: none;
}

.login-card input::placeholder {
  color: rgba(255, 255, 255, 0.25);
}

.login-card input:focus {
  border-color: var(--gold);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

.login-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.login-footer a {
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 500;
  transition: opacity var(--dur-fast);
}

.login-footer a:hover {
  opacity: 0.8;
}

.login-error {
  background: rgba(178, 34, 34, 0.2);
  border: 1px solid rgba(178, 34, 34, 0.4);
  color: #ff9999;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  margin-bottom: 16px;
  display: none;
}

.login-error.show {
  display: block;
  animation: fadeIn var(--dur-fast) var(--ease-out);
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  transition: all var(--dur-normal) var(--ease-out);
  white-space: nowrap;
  min-height: 44px;
  min-width: 44px;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--brown-dark);
  box-shadow: var(--shadow-sm), 0 2px 12px rgba(230, 179, 37, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), 0 4px 20px rgba(230, 179, 37, 0.35);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--brown);
  color: var(--white);
}

.btn-secondary:hover {
  background: var(--brown-light);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
}

.btn-danger:hover {
  background: var(--red-light);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(230, 179, 37, 0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
}

.btn-ghost:hover {
  background: var(--neutral-dark);
  color: var(--text-primary);
}

.btn-full {
  width: 100%;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.8rem;
  min-height: 36px;
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
}

.btn-icon.btn-adjust {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  font-size: 1.3rem;
  font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   APP SHELL
   ═══════════════════════════════════════════════════════════ */
#app-shell {
  display: none;
  min-height: 100vh;
}

#app-shell.active {
  display: flex;
}

/* ── Sidebar ──────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: linear-gradient(180deg, var(--brown-dark) 0%, var(--brown-deep) 100%);
  color: #FFF;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--dur-slow) var(--ease-out);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
}

.sidebar-brand {
  padding: 28px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-brand .brand-icon {
  width: 42px;
  height: 42px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(230, 179, 37, 0.3));
  flex-shrink: 0;
  margin: 0;
}

.sidebar-brand .brand-text {
  font-family: 'Cinzel', 'Poppins', serif;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: var(--gold);
}

.nav-links {
  list-style: none;
  padding: 16px 12px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--dur-normal) var(--ease-out);
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
  font-size: 0.9rem;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(230, 179, 37, 0.15), rgba(230, 179, 37, 0.05));
  color: var(--gold);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 28px;
  border-radius: 0 3px 3px 0;
  background: var(--gold);
}

.nav-item {
  position: relative;
}

.nav-icon {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.user-info {
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
}

.user-info span {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.sidebar-footer .btn-outline {
  color: rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.12);
  width: 100%;
  font-size: 0.8rem;
}

.sidebar-footer .btn-outline:hover {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(230, 179, 37, 0.08);
}

/* ── Main Content ─────────────────────────────────────────── */
#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  /* Without this, min-width:auto lets wide children (e.g. the low-stock chip
     row) blow the column past the viewport and push the header off-screen. */
  min-width: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── App Header ───────────────────────────────────────────── */
#app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: var(--header-height);
  background: rgba(248, 249, 250, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
}

.header-left h2 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.operating-hours {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--success-bg);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--success);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  position: relative;
}

.status-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--success);
  animation: pulseRing 2s var(--ease-out) infinite;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px 6px 6px;
  background: var(--white);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-light);
}

.user-badge .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brown-dark);
}

.user-badge span {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Mobile Header ────────────────────────────────────────── */
#mobile-header {
  display: none;
  position: sticky;
  top: 0;
  z-index: 90;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 56px;
  background: var(--brown-dark);
  color: #FFF;
}

#mobile-header .brand-text {
  font-family: 'Cinzel', 'Poppins', serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold);
}

#menu-toggle {
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: #FFF;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

#mobile-header .operating-hours {
  font-size: 0.7rem;
  padding: 4px 10px;
}

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
  padding: 28px 32px;
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════
   FORM ELEMENTS
   ═══════════════════════════════════════════════════════════ */
.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--dur-normal) var(--ease-out);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

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

.price-input input {
  padding-right: 40px;
}

.price-suffix {
  position: absolute;
  right: 14px;
  font-weight: 700;
  color: var(--gold);
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

/* ═══════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════ */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: all var(--dur-normal) var(--ease-out);
  overflow: hidden;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.card-body {
  padding: 20px;
}

/* ── Inventory Card ───────────────────────────────────────── */
.inventory-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: all var(--dur-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.inventory-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.inventory-card .card-top {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 24px;
}

.inventory-card .item-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-card .item-uom {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.inventory-card .stock-display {
  display: flex;
  align-items: baseline;
  gap: 4px;
  width: 100px;
  flex-shrink: 0;
}

.inventory-card .stock-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.inventory-card .stock-unit {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.inventory-card .threshold-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.inventory-card .threshold-label span {
  font-weight: 600;
}

/* Status Bar */
.status-bar-track {
  height: 4px;
  background: var(--neutral-dark);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}

.status-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s var(--ease-out), background 0.4s;
}

.status-bar-fill.green {
  background: linear-gradient(90deg, var(--success), #4CAF50);
}

.status-bar-fill.red {
  background: linear-gradient(90deg, var(--red), var(--red-light));
  animation: pulse 2s ease-in-out infinite;
}

/* Card Actions */
.inventory-card .card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-left: 1px solid var(--border-light);
  background: var(--neutral);
}

.card-actions .btn-adjust {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}

.card-actions .btn-adjust:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(230, 179, 37, 0.05);
}

.card-actions .stock-quick-value {
  font-weight: 700;
  font-size: 1rem;
  min-width: 50px;
  text-align: center;
}

/* Low stock card highlight */
.inventory-card.low-stock {
  border-color: rgba(178, 34, 34, 0.2);
  background: linear-gradient(180deg, var(--white) 80%, rgba(178, 34, 34, 0.03) 100%);
}

.inventory-card.low-stock .item-name {
  color: var(--red);
}

/* ═══════════════════════════════════════════════════════════
   TABS
   ═══════════════════════════════════════════════════════════ */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow-x: auto;
  margin-bottom: 20px;
}

.tab {
  padding: 10px 20px;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--dur-normal) var(--ease-out);
  white-space: nowrap;
  min-height: 44px;
}

.tab:hover {
  background: var(--neutral);
  color: var(--text-primary);
}

.tab.active {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--brown-dark);
  box-shadow: var(--shadow-sm);
}

/* ═══════════════════════════════════════════════════════════
   SEARCH BAR
   ═══════════════════════════════════════════════════════════ */
.search-bar {
  position: relative;
  margin-bottom: 20px;
}

.search-bar input {
  width: 100%;
  padding: 14px 16px 14px 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 0.9rem;
  transition: all var(--dur-normal) var(--ease-out);
  outline: none;
}

.search-bar input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.search-bar::before {
  content: '🔍';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

/* ═══════════════════════════════════════════════════════════
   CARD GRID
   ═══════════════════════════════════════════════════════════ */
.card-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ═══════════════════════════════════════════════════════════
   PAGINATION BAR
   ═══════════════════════════════════════════════════════════ */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0;
}

.pagination-bar:empty {
  display: none;
}

.pagination-bar .page-nav-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--white);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease-out);
}

.pagination-bar .page-nav-btn:hover:not(:disabled) {
  background: var(--bg-hover, #f5f5f5);
  border-color: var(--accent, #c9a227);
}

.pagination-bar .page-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-bar .page-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   LOW STOCK ALERT WIDGET
   ═══════════════════════════════════════════════════════════ */
.alert-widget {
  background: linear-gradient(135deg, var(--danger-light) 0%, #fff5f5 100%);
  border: 1px solid rgba(178, 34, 34, 0.12);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 24px;
  animation: fadeInUp 0.5s var(--ease-out);
}

.alert-widget.no-alerts {
  background: linear-gradient(135deg, var(--success-light) 0%, #f1fff1 100%);
  border-color: rgba(46, 125, 50, 0.12);
}

.alert-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.alert-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--red);
  flex: 1;
}

.alert-count {
  background: var(--red);
  color: #FFF;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
}

.no-alerts .alert-header h3 {
  color: var(--success);
}

.no-alerts .alert-count {
  background: var(--success);
}

.alert-items {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.alert-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(178, 34, 34, 0.12);
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--red);
  flex-shrink: 0;
}

.alert-chip .chip-stock {
  font-weight: 800;
  color: var(--red);
}

.alert-chip.pinned {
  background: rgba(178, 34, 34, 0.06);
  border-color: rgba(178, 34, 34, 0.25);
}

.alert-chip.pinned::before {
  content: '📌';
  font-size: 0.7rem;
}

/* ═══════════════════════════════════════════════════════════
   SPLIT VIEW (Products Editor)
   ═══════════════════════════════════════════════════════════ */
.split-view {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
}

.panel-left {
  width: 40%;
  flex-shrink: 0;
}

.panel-right {
  width: 60%;
  flex-shrink: 0;
}

.panel-left,
.panel-right {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  padding: 24px;
}

.panel-left h3,
.panel-right h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Cost Summary */
.cost-summary {
  background: var(--neutral);
  border-radius: var(--radius-md);
  padding: 18px;
  margin-top: 20px;
}

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

.cost-row span:last-child {
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.cost-row.total {
  border-top: 2px solid var(--border);
  margin-top: 8px;
  padding-top: 12px;
  font-size: 1rem;
}

.cost-row.total span:last-child {
  color: var(--gold-dark);
  font-size: 1.1rem;
}

.cost-row.margin span:last-child.positive {
  color: var(--success);
}

.cost-row.margin span:last-child.negative {
  color: var(--red);
}

.margin-bar {
  height: 6px;
  background: var(--neutral-dark);
  border-radius: 3px;
  margin-top: 12px;
  overflow: hidden;
}

.margin-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--success), #66BB6A);
  transition: width 0.6s var(--ease-out);
}

.margin-fill.thin {
  background: linear-gradient(90deg, var(--red), var(--red-light));
}

.margin-percent {
  display: block;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 700;
  margin-top: 6px;
  color: var(--success);
}

.margin-percent.negative {
  color: var(--red);
}

/* ── Ingredient Picker ────────────────────────────────────── */
.ingredient-dropdown {
  max-height: 240px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  display: none;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

.ingredient-dropdown.show {
  display: block;
  animation: fadeIn var(--dur-fast) var(--ease-out);
}

.ingredient-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  transition: background var(--dur-fast);
  border-bottom: 1px solid var(--border-light);
  font-size: 0.85rem;
}

.ingredient-option:last-child {
  border-bottom: none;
}

.ingredient-option:hover {
  background: var(--gold-glow);
}

.ingredient-option .opt-name {
  font-weight: 600;
}

.ingredient-option .opt-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Selected Ingredients List */
.selected-ingredients {
  min-height: 100px;
}

.selected-ingredient {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--neutral);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  animation: slideInRight 0.2s var(--ease-out);
  border: 1px solid var(--border-light);
}

.selected-ingredient .ing-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.85rem;
}

.selected-ingredient .ing-uom {
  font-size: 0.75rem;
  color: var(--text-muted);
  min-width: 40px;
}

.selected-ingredient .ing-qty {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 600;
  font-size: 0.85rem;
  outline: none;
  transition: border-color var(--dur-fast);
}

.selected-ingredient .ing-qty:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-glow);
}

.selected-ingredient .ing-cost {
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 65px;
  text-align: right;
  color: var(--brown);
  font-variant-numeric: tabular-nums;
}

.selected-ingredient .remove-ing {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--dur-fast);
}

.selected-ingredient .remove-ing:hover {
  background: var(--danger-light);
  color: var(--red);
}

.ingredient-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  background: var(--brown-dark);
  color: #FFF;
  border-radius: var(--radius-md);
  margin-top: 12px;
  font-weight: 700;
}

.ingredient-total .total-label {
  font-size: 0.85rem;
}

.ingredient-total .total-value {
  font-size: 1.1rem;
  color: var(--gold);
}

.no-ingredients {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.no-ingredients .empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.4;
}

/* ── Product List ─────────────────────────────────────────── */
.product-list-section {
  margin-top: 32px;
}

.product-list-section>h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-table {
  width: 100%;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.product-table table {
  width: 100%;
  border-collapse: collapse;
}

.product-table th {
  text-align: left;
  padding: 14px 18px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: var(--neutral);
  border-bottom: 1px solid var(--border-light);
}

.product-table td {
  padding: 14px 18px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.product-table tr:last-child td {
  border-bottom: none;
}

.product-table tr:hover td {
  background: rgba(230, 179, 37, 0.03);
}

.product-table .prod-name {
  font-weight: 700;
  color: var(--text-primary);
}

.product-table .prod-category {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--gold-glow);
  color: var(--gold-dark);
}

.product-table .prod-margin.positive {
  color: var(--success);
  font-weight: 700;
}

.product-table .prod-margin.negative {
  color: var(--red);
  font-weight: 700;
}

.product-table .action-btns {
  display: flex;
  gap: 6px;
}

/* ═══════════════════════════════════════════════════════════
   ANALYTICS
   ═══════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 22px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: all var(--dur-normal) var(--ease-out);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card .stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  animation: countUp 0.5s var(--ease-out);
}

.stat-card .stat-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-card.gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  border: none;
}

.stat-card.gold .stat-label {
  color: rgba(62, 39, 35, 0.6);
}

.stat-card.gold .stat-value {
  color: var(--brown-dark);
}

.stat-card.gold .stat-sub {
  color: rgba(62, 39, 35, 0.5);
}

/* Chart Container */
.chart-container {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  padding: 24px;
  margin-bottom: 24px;
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.chart-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.chart-toggles {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chart-toggle {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: transparent;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast);
}

.chart-toggle.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--brown-dark);
}

.chart-toggle:hover:not(.active) {
  border-color: var(--gold);
  color: var(--gold);
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 320px;
}

.chart-canvas-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}

/* Top Sellers */
.top-sellers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.top-seller-card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--dur-normal) var(--ease-out);
}

.top-seller-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.top-rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--gold-glow);
  color: var(--gold-dark);
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.top-rank.first {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--brown-dark);
}

.top-seller-info {
  flex: 1;
  min-width: 0;
}

.top-seller-info .seller-name {
  font-weight: 700;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-seller-info .seller-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.seller-price {
  font-weight: 800;
  color: var(--gold-dark);
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════════
   SALES ENTRY
   ═══════════════════════════════════════════════════════════ */
.sales-layout {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

@media (min-width: 1025px) {
  .sales-layout {
    display: grid;
    grid-template-columns: minmax(360px, 440px) 1fr;
    align-items: start;
  }
}

.sales-form-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  padding: 28px;
  max-width: 600px;
}

.sales-form-wrap h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sale-total-display {
  background: linear-gradient(135deg, var(--brown-dark), var(--brown-deep));
  border-radius: var(--radius-md);
  padding: 18px;
  color: #FFF;
  margin-top: 16px;
  margin-bottom: 20px;
}

.sale-total-display .sale-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.sale-total-display .sale-row span:last-child {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.sale-total-display .sale-row.total {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  margin-top: 6px;
  padding-top: 10px;
  font-size: 1rem;
}

.sale-total-display .sale-row.total span:last-child {
  font-weight: 800;
  color: var(--gold);
  font-size: 1.15rem;
}

/* Recent Sales Table */
.recent-sales h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.sales-table-wrap {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}

.sales-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}

.sales-table-wrap th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  background: var(--neutral);
  border-bottom: 1px solid var(--border-light);
}

.sales-table-wrap td {
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.sales-table-wrap tr:last-child td {
  border-bottom: none;
}

.sales-table-wrap td.sales-action-cell {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.sales-table-wrap .action-btns {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.recent-sales .pagination-bar {
  padding-top: 14px;
}

/* ═══════════════════════════════════════════════════════════
   TOAST NOTIFICATIONS
   ═══════════════════════════════════════════════════════════ */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  border-left: 4px solid var(--success);
  min-width: 300px;
  max-width: 420px;
  animation: toastIn 0.3s var(--ease-out);
  font-size: 0.85rem;
  font-weight: 500;
}

.toast.leaving {
  animation: toastOut 0.3s var(--ease-out) forwards;
}

.toast.error {
  border-left-color: var(--red);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.info {
  border-left-color: var(--info);
}

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.toast-msg {
  flex: 1;
}

/* ═══════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s var(--ease-out);
}

.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  animation: scaleIn 0.3s var(--ease-spring);
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  width: 36px;
  height: 36px;
  border: none;
  background: var(--neutral);
  border-radius: 50%;
  font-size: 1.1rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--dur-fast);
}

.modal-close:hover {
  background: var(--neutral-dark);
  color: var(--text-primary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 0 24px 24px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ═══════════════════════════════════════════════════════════
   LOADING SKELETON
   ═══════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, var(--neutral-dark) 25%, var(--neutral) 50%, var(--neutral-dark) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

.skeleton-card {
  height: 180px;
  border-radius: var(--radius-lg);
}

/* ═══════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════ */
.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.85rem;
  max-width: 300px;
  margin: 0 auto;
}

/* ═══════════════════════════════════════════════════════════
   INVENTORY EDIT MODAL
   ═══════════════════════════════════════════════════════════ */
.edit-stock-input {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.edit-stock-input input {
  flex: 1;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  outline: none;
}

.edit-stock-input input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — TABLET
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .split-view {
    flex-direction: column;
  }

  .panel-left,
  .panel-right {
    width: 100%;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  #app-shell.active {
    flex-direction: column;
  }

  #sidebar {
    transform: translateX(-100%);
    width: 280px;
  }

  #sidebar.open {
    transform: translateX(0);
    animation: slideInLeft var(--dur-slow) var(--ease-out);
  }

  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    display: none;
  }

  .sidebar-overlay.show {
    display: block;
  }

  #mobile-header {
    display: flex;
  }

  #main-content {
    margin-left: 0;
  }

  #app-header {
    display: none;
  }

  .page-content {
    padding: 16px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }

  .inventory-card {
    flex-direction: column;
    align-items: stretch;
  }

  .inventory-card .card-top {
    flex-wrap: wrap;
    row-gap: 6px;
    gap: 8px 16px;
  }

  .inventory-card .item-name {
    flex-basis: 100%;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .inventory-card .card-actions {
    border-left: none;
    border-top: 1px solid var(--border-light);
    justify-content: center;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .login-card {
    margin: 16px;
    padding: 32px 24px;
  }

  .tab-bar {
    gap: 2px;
  }

  .tab {
    padding: 8px 14px;
    font-size: 0.78rem;
  }

  #toast-container {
    top: auto;
    bottom: 80px;
    right: 12px;
    left: 12px;
  }

  .toast {
    min-width: auto;
    max-width: 100%;
  }

  .top-sellers {
    grid-template-columns: 1fr;
  }

  .chart-canvas-wrap {
    height: 240px;
  }

  .product-table {
    overflow-x: auto;
  }
}

/* ═══════════════════════════════════════════════════════════
   PRINT STYLES
   ═══════════════════════════════════════════════════════════ */
@media print {

  #sidebar,
  #mobile-header,
  .btn,
  .card-actions,
  #toast-container {
    display: none !important;
  }

  #main-content {
    margin-left: 0;
  }

  .page-content {
    padding: 0;
  }
}