/* ==========================================================================
   Shine Crackers Sivakasi — Official Admin Management Portal Stylesheet
   Theme: Royal Sivakasi Fireworks Dark Glassmorphism & Gold Accents
   ========================================================================== */

:root {
  /* ==========================================================================
     Shine Crackers Luxury Sivakasi Factory Direct Theme (Emerald, Gold & Ivory)
     Strictly synchronized with storefront style.css & shop.css
     ========================================================================== */
  --bg-base: #F0F7F4;
  --bg-page: #F0F7F4;
  --bg-surface: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F4F9F6;
  --bg-card-alt: #F4F9F6;
  --bg-input: #FFFFFF;
  --bg-sidebar: #042418;
  --bg-topbar: rgba(255, 255, 255, 0.94);
  --bg-table-head: #F4F9F6;

  /* Festive Royal Gold & Warm Amber */
  --gold-primary: #D97706;
  --gold-hover: #B45309;
  --gold-glow: rgba(217, 119, 6, 0.25);
  --gold-muted: rgba(217, 119, 6, 0.12);
  --gold-light: #F59E0B;
  --gold-bright: #F59E0B;

  /* Forest Emerald & Deep Jade */
  --emerald: #047857;
  --emerald-hover: #065F46;
  --emerald-bg: rgba(4, 120, 87, 0.1);
  --emerald-border: rgba(4, 120, 87, 0.25);
  --blue: #2563EB;
  --blue-bg: rgba(37, 99, 235, 0.1);
  --purple: #7C3AED;
  --purple-bg: rgba(124, 58, 237, 0.1);
  --cyan: #0D9488;
  --cyan-bg: rgba(13, 148, 136, 0.1);
  --crimson: #DC2626;
  --crimson-bg: rgba(220, 38, 38, 0.1);

  /* Deep Evergreen Slate Typography */
  --text-primary: #0A2619;
  --text-secondary: #244234;
  --text-muted: #527565;
  --border-color: rgba(6, 78, 59, 0.12);
  --border-light: rgba(6, 78, 59, 0.18);
  --border-gold: rgba(217, 119, 6, 0.35);

  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-brand: 'Cinzel', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(6, 78, 59, 0.06), 0 1px 2px rgba(6, 78, 59, 0.04);
  --shadow-md: 0 4px 14px -2px rgba(6, 78, 59, 0.08), 0 2px 6px -1px rgba(6, 78, 59, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(6, 78, 59, 0.12), 0 6px 12px -2px rgba(6, 78, 59, 0.06);
  --shadow-gold: 0 4px 18px rgba(217, 119, 6, 0.25);

  --sidebar-width: 260px;
  --topbar-height: 72px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.admin-body {
  font-family: var(--font-body);
  background-color: #F0F7F4;
  background-image: radial-gradient(ellipse at 50% -10%, #F9FCFB 0%, #F0F7F4 45%, #DFEFE7 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Utilities */
.hidden { display: none !important; }
.full-width { width: 100%; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 420px;
  width: calc(100% - 48px);
  pointer-events: none;
}

.toast-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(6, 78, 59, 0.15);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  pointer-events: auto;
  animation: slideInRight 0.3s ease-out;
  backdrop-filter: blur(8px);
}

.toast-item.success { border-left: 4px solid var(--emerald); }
.toast-item.error { border-left: 4px solid var(--crimson); }
.toast-item.info { border-left: 4px solid var(--gold-primary); }

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

/* Global Loading Overlay */
.global-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 36, 24, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #FFFFFF;
}

.spinner-brand {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(245, 158, 11, 0.15);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ==========================================================================
   1. LOGIN VIEW
   ========================================================================== */
.login-section {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: radial-gradient(ellipse at 50% -10%, #F9FCFB 0%, #F0F7F4 45%, #DFEFE7 100%);
}

.login-container {
  width: 100%;
  max-width: 460px;
}

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

.login-logo-wrap {
  display: inline-flex;
  padding: 10px;
  background: #FFFFFF;
  border: 1.5px solid var(--border-gold);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  box-shadow: 0 4px 16px rgba(6, 78, 59, 0.08);
}

.login-logo {
  height: 52px;
  width: auto;
  display: block;
}

.login-title {
  font-family: var(--font-brand);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  color: #042418;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.login-badge-diwali {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #B45309;
  background: #FEF3C7;
  border: 1px solid rgba(217, 119, 6, 0.35);
  padding: 4px 14px;
  border-radius: var(--radius-full);
  margin-top: 10px;
}

.login-card {
  background: #FFFFFF;
  border: 1px solid rgba(6, 78, 59, 0.16);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: 0 16px 40px -8px rgba(6, 78, 59, 0.12);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label.required::after {
  content: " *";
  color: var(--crimson);
}

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

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 15px;
  color: var(--text-muted);
  pointer-events: none;
}

.form-control {
  width: 100%;
  height: 44px;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  transition: all 0.2s ease;
}

.input-wrap .form-control {
  padding-left: 42px;
  padding-right: 42px;
}

.form-control:focus {
  outline: none;
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

textarea.form-control {
  height: auto;
  resize: vertical;
}

.btn-toggle-pwd {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--text-muted);
  padding: 4px;
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  font-size: 13px;
}

.remember-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}

.remember-label input[type="checkbox"] {
  accent-color: var(--gold-primary);
  width: 15px;
  height: 15px;
}

.portal-security-tag {
  font-size: 11px;
  color: var(--emerald);
  font-weight: 600;
}

.btn-primary-gold {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #080C14;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.btn-primary-gold:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.4);
}

.btn-primary-gold.secondary {
  background: linear-gradient(135deg, #2563EB 0%, #1D4ED8 100%);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.login-help-box {
  background: #F4F9F6;
  border: 1px dashed rgba(6, 78, 59, 0.2);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 20px;
  font-size: 12px;
}

.login-help-box .help-title {
  color: var(--gold-primary);
  font-weight: 700;
  margin-bottom: 4px;
}

.login-help-box code {
  background: rgba(6, 78, 59, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: #065F46;
  font-weight: 700;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
}

.link-storefront {
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.2s;
}

.link-storefront:hover {
  color: var(--gold-primary);
}

/* ==========================================================================
   2. ADMIN MAIN LAYOUT
   ========================================================================== */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #042418 0%, #064E3B 100%);
  border-right: 1px solid rgba(217, 119, 6, 0.2);
  box-shadow: 4px 0 20px rgba(4, 36, 24, 0.12);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
}

.sidebar-header {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-logo {
  height: 38px;
  width: auto;
}

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

.brand-name {
  font-family: var(--font-brand);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #F59E0B;
}

.brand-sub {
  font-size: 10.5px;
  color: #A7F3D0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 20px 12px;
}

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #6EE7B7;
  padding: 0 12px 8px;
  text-transform: uppercase;
}

.nav-list {
  list-style: none;
  margin-bottom: 24px;
}

.nav-item {
  margin-bottom: 4px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  color: #D1FAE5;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.nav-link:hover {
  background: rgba(245, 158, 11, 0.12);
  color: #FDE68A;
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.22) 0%, rgba(245, 158, 11, 0.05) 100%);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-left: 3.5px solid #F59E0B;
}

.nav-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  color: #D1FAE5;
}

.nav-badge.order-badge {
  background: rgba(245, 158, 11, 0.25);
  color: #FDE68A;
}

.storefront-link {
  color: var(--gold-light);
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.nav-ext-icon {
  margin-left: auto;
  font-size: 12px;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
}

.admin-profile-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--gold-muted);
  border: 1px solid var(--border-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.admin-name {
  font-size: 13px;
  font-weight: 700;
  color: #FFFFFF;
}

.admin-role {
  font-size: 11px;
  color: #FDE68A;
  text-transform: capitalize;
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 34px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: #F87171;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-logout:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #EF4444;
}

/* Main Content Area */
.admin-main-wrapper {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Topbar */
.admin-topbar {
  height: var(--topbar-height);
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  box-shadow: 0 2px 10px rgba(6, 78, 59, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-mobile-menu {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-bar {
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
}

.page-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.page-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.db-live-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #047857;
  background: #ECFDF5;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

.topbar-quick-actions {
  display: flex;
  gap: 8px;
}

.btn-topbar-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  background: var(--gold-primary);
  color: #080C14;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-topbar-action:hover {
  background: var(--gold-hover);
}

.btn-topbar-action.secondary {
  background: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}

.btn-topbar-action.secondary:hover {
  background: #F4F9F6;
  border-color: var(--emerald);
}

.diwali-season-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #92400E;
  background: #FEF3C7;
  border: 1px solid rgba(217, 119, 6, 0.35);
  padding: 6px 12px;
  border-radius: var(--radius-full);
}

/* Admin Content View */
.admin-content-view {
  padding: 28px;
  flex: 1;
}

/* ==========================================================================
   DASHBOARD VIEW COMPONENTS
   ========================================================================== */
.dashboard-hero-card {
  background: linear-gradient(135deg, #042418 0%, #064E3B 65%, #065F46 100%);
  border: 1.5px solid rgba(217, 119, 6, 0.35);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 8px 24px -4px rgba(4, 36, 24, 0.18);
  color: #FFFFFF;
}

.hero-badge {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #FDE68A;
  display: inline-block;
  margin-bottom: 6px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 800;
  color: #FFFFFF;
}

.hero-desc {
  font-size: 13px;
  color: #D1FAE5;
  max-width: 620px;
  margin-top: 4px;
}

.hero-right {
  text-align: right;
}

.hero-clock {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: #F59E0B;
  letter-spacing: 1px;
}

.hero-date {
  font-size: 12px;
  color: #A7F3D0;
}

/* KPI Cards Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  gap: 16px;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.kpi-card.gold { border-left: 4px solid var(--gold-primary); }
.kpi-card.blue { border-left: 4px solid var(--blue); }
.kpi-card.purple { border-left: 4px solid var(--purple); }
.kpi-card.cyan { border-left: 4px solid var(--cyan); }

.kpi-icon-wrap {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-md);
  background: #F0F7F4;
  border: 1px solid rgba(6, 78, 59, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.kpi-body {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin: 4px 0;
}

.kpi-subtext {
  font-size: 12px;
  color: var(--text-muted);
}

/* Orders Status Strip */
.status-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 24px;
}

.status-pill-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.status-pill-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-2px);
}

.status-pill-item.pending .status-num { color: #F59E0B; }
.status-pill-item.confirmed .status-num { color: #3B82F6; }
.status-pill-item.packed .status-num { color: #8B5CF6; }
.status-pill-item.shipped .status-num { color: #06B6D4; }
.status-pill-item.delivered .status-num { color: #10B981; }
.status-pill-item.cancelled .status-num { color: #EF4444; }
.status-pill-item.oos .status-num { color: #F87171; }

.status-num {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
}

.status-lbl {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-top: 2px;
}

/* 2-Column Dashboard Layout */
.dashboard-columns-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr;
  gap: 24px;
}

@media (max-width: 1200px) {
  .dashboard-columns-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin Card Generic */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.admin-card.no-padding {
  padding: 0;
  overflow: hidden;
}

.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.card-heading {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.card-subheading {
  font-size: 12px;
  color: var(--text-muted);
}

.card-action-link {
  font-size: 13px;
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 600;
}

.card-action-link:hover {
  text-decoration: underline;
}

.btn-card-small {
  height: 28px;
  padding: 0 10px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-card-small:hover {
  background: var(--gold-primary);
  color: #080C14;
}

/* Orders Status Chart Horizontal Bars */
.orders-chart-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-bar-lbl {
  width: 90px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.chart-bar-track {
  flex: 1;
  height: 12px;
  background: #E3EFE9;
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.chart-bar-val {
  width: 50px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

/* Best Sellers & Recent Products Lists */
.best-sellers-list, .recent-prods-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.best-seller-item, .recent-prod-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: #F4F9F6;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.bs-thumb, .rp-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
}

.bs-meta, .rp-meta {
  flex: 1;
  min-width: 0;
}

.bs-name, .rp-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bs-sub, .rp-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.bs-stats, .rp-price {
  text-align: right;
}

.bs-sold {
  font-size: 12px;
  font-weight: 700;
  color: var(--emerald);
}

.bs-revenue, .rp-mrp {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   TABLES STYLING
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.admin-table thead {
  background: var(--bg-table-head, #F4F9F6);
  border-bottom: 2px solid rgba(6, 78, 59, 0.15);
}

.admin-table th {
  padding: 12px 16px;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: #064E3B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(6, 78, 59, 0.08);
  color: var(--text-primary);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background 0.15s ease;
}

.admin-table tbody tr:hover {
  background: #F0F7F4;
}

.td-loading, .td-empty {
  text-align: center;
  padding: 36px !important;
  color: var(--text-muted);
}

.table-summary-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-color);
}

.count-badge {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-primary);
  background: var(--gold-muted);
  border: 1px solid var(--border-gold);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.summary-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 10px;
}

.live-sync-tag {
  font-size: 11px;
  color: var(--emerald);
  font-weight: 700;
}

.btn-table-refresh {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.btn-table-refresh:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

/* Product Specific Table Rows */
.prod-thumb-cell {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: #111;
  border: 1px solid var(--border-color);
  cursor: pointer;
}

.prod-code-pill {
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  color: #B45309;
  background: #FEF3C7;
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid rgba(217, 119, 6, 0.25);
}

.prod-name-meta {
  display: flex;
  flex-direction: column;
}

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

.prod-tamil-main {
  font-size: 11px;
  color: var(--text-muted);
}

.discount-pill {
  font-size: 11px;
  font-weight: 700;
  color: #047857;
  background: #ECFDF5;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: var(--radius-full);
  text-transform: capitalize;
}

.status-badge.Pending { background: #FEF3C7; color: #B45309; border: 1px solid rgba(217, 119, 6, 0.3); }
.status-badge.Confirmed { background: #DBEAFE; color: #1D4ED8; border: 1px solid rgba(59, 130, 246, 0.3); }
.status-badge.Packed { background: #EDE9FE; color: #6D28D9; border: 1px solid rgba(139, 92, 246, 0.3); }
.status-badge.Shipped { background: #CCFBF1; color: #0F766E; border: 1px solid rgba(6, 182, 212, 0.3); }
.status-badge.Delivered { background: #D1FAE5; color: #047857; border: 1px solid rgba(16, 185, 129, 0.3); }
.status-badge.Cancelled { background: #FEE2E2; color: #B91C1C; border: 1px solid rgba(239, 68, 68, 0.3); }

.status-badge.Paid { background: rgba(16, 185, 129, 0.15); color: #34D399; }
.status-badge.Refunded { background: rgba(239, 68, 68, 0.15); color: #F87171; }

.status-badge.active { background: rgba(16, 185, 129, 0.15); color: #34D399; }
.status-badge.inactive { background: rgba(148, 163, 184, 0.15); color: #94A3B8; }

.stock-tag-in { color: var(--emerald); font-weight: 600; font-size: 12px; }
.stock-tag-out { color: var(--crimson); font-weight: 600; font-size: 12px; }

/* Table Action Buttons */
.table-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.btn-action-icon {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-action-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.btn-action-icon.edit:hover {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-primary);
  border-color: var(--border-gold);
}

.btn-action-icon.delete:hover {
  background: #FEE2E2;
  color: var(--crimson);
  border-color: var(--crimson);
}

/* ==========================================================================
   TOOLBAR & FILTERS
   ========================================================================== */
.toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
}

.toolbar-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.search-box-wrap {
  position: relative;
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
}

.search-box-wrap .search-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  font-size: 14px;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 8px 36px 8px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
}

.search-input:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.btn-clear-search {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
}

.toolbar-filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.filter-select, .filter-input-date {
  height: 34px;
  padding: 4px 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
}

.filter-select:focus, .filter-input-date:focus {
  outline: none;
  border-color: var(--gold-primary);
}

.btn-filter-reset {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

.btn-filter-reset:hover {
  color: var(--gold-primary);
}

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: #F4F9F6;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
}

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

.pagination-ctrls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-page {
  height: 32px;
  padding: 0 12px;
  background: #FFFFFF;
  border: 1px solid rgba(6, 78, 59, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 12px;
  cursor: pointer;
}

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

.btn-page:not(:disabled):hover {
  background: var(--gold-primary);
  color: #080C14;
}

.page-pills-wrap {
  display: flex;
  gap: 4px;
}

.page-pill {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
}

.page-pill.active {
  background: var(--gold-primary);
  color: #080C14;
  font-weight: 700;
  border-color: var(--gold-primary);
}

/* ==========================================================================
   MODAL DIALOGS
   ========================================================================== */
.admin-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 20, 0.88);
  backdrop-filter: blur(8px);
  z-index: 5000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 20px;
  overflow-y: auto;
}

.admin-modal-box {
  background: #FFFFFF;
  border: 1.5px solid rgba(217, 119, 6, 0.35);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 580px;
  box-shadow: 0 20px 50px rgba(4, 36, 24, 0.25);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  overflow: hidden;
  margin: auto;
  animation: modalScale 0.25s ease-out;
}

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

.admin-modal-box.modal-lg { max-width: 820px; }
.admin-modal-box.modal-sm { max-width: 420px; }

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

.modal-header {
  padding: 20px 24px;
  background: #F4F9F6;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-badge-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--gold-primary);
  display: inline-block;
  margin-bottom: 4px;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-title.delete-title {
  color: #F87171;
}

.btn-modal-close {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.btn-modal-close:hover {
  color: var(--text-primary);
}

.modal-body-scroll {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  background: #F4F9F6;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.btn-translucent {
  height: 40px;
  padding: 0 16px;
  background: #FFFFFF;
  border: 1px solid rgba(6, 78, 59, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.btn-translucent:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.btn-danger {
  height: 40px;
  padding: 0 18px;
  background: var(--crimson);
  border: none;
  border-radius: var(--radius-md);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-danger:hover {
  background: #DC2626;
}

/* Form Grid Helpers */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }
}

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

.field-pill-green {
  position: absolute;
  right: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--emerald);
  background: var(--emerald-bg);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* Image Upload Widget */
.image-upload-row {
  display: flex;
  gap: 18px;
  align-items: center;
}

.image-preview-box {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-md);
  border: 2px dashed var(--border-gold);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #F4F9F6;
  flex-shrink: 0;
}

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

.image-upload-inputs {
  flex: 1;
}

.file-input-hidden { display: none; }

.btn-upload-file {
  height: 36px;
  padding: 0 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  color: var(--gold-light);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-upload-file:hover {
  background: var(--gold-primary);
  color: #080C14;
}

.upload-hint {
  font-size: 11px;
  color: var(--text-muted);
  display: block;
  margin-top: 4px;
}

.or-divider {
  display: flex;
  align-items: center;
  margin: 8px 0;
}

.or-divider span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* Switches Grid */
.switches-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
  padding: 14px;
  background: #F4F9F6;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.switch-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.switch-label input[type="checkbox"] {
  accent-color: var(--gold-primary);
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

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

.switch-text strong {
  font-size: 13px;
  color: var(--text-primary);
}

.switch-text small {
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   ORDER DETAILS & STEPPER TIMELINE MODAL
   ========================================================================== */
.order-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.order-box-info {
  background: #F4F9F6;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
}

.order-box-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--gold-primary);
  margin-bottom: 8px;
}

.order-info-line {
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.order-info-line strong {
  color: var(--text-primary);
}

/* Timeline Stepper */
.order-stepper-wrap {
  margin-bottom: 24px;
  padding: 18px;
  background: #FDF9F0;
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: var(--radius-md);
}

.stepper-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #92400E;
  margin-bottom: 16px;
}

.order-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  z-index: 2;
  flex: 1;
}

.stepper-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid rgba(6, 78, 59, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 700;
  transition: all 0.3s ease;
}

.stepper-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

.stepper-step.completed .stepper-circle {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #FFFFFF;
}

.stepper-step.completed .stepper-lbl {
  color: var(--emerald);
}

.stepper-step.current .stepper-circle {
  background: var(--gold-primary);
  border-color: var(--gold-light);
  color: #080C14;
  box-shadow: 0 0 12px var(--gold-glow);
}

.stepper-step.current .stepper-lbl {
  color: var(--gold-primary);
  font-weight: 700;
}

.stepper-step.cancelled .stepper-circle {
  background: var(--crimson);
  border-color: #F87171;
  color: #FFFFFF;
}

.stepper-step.cancelled .stepper-lbl {
  color: #F87171;
}

.order-detail-footer {
  justify-content: space-between;
}

.order-status-update-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-change-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.status-select {
  height: 38px;
  font-size: 13px;
  width: 140px;
}

.order-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-invoice-print {
  height: 40px;
  padding: 0 16px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  color: var(--gold-light);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-invoice-print:hover {
  background: var(--gold-primary);
  color: #080C14;
}

/* ==========================================================================
   PRINT INVOICE STYLING
   ========================================================================== */
.print-area-hidden { display: none; }

@media print {
  body * {
    visibility: hidden;
  }
  #admin-print-area, #admin-print-area * {
    visibility: visible;
  }
  #admin-print-area {
    display: block !important;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    padding: 24px;
    background: #FFFFFF !important;
    color: #000000 !important;
  }
}

/* ============================================================
   COMPREHENSIVE MOBILE RESPONSIVE OVERHAUL
   Breakpoints: 900px (tablet), 768px (tablet-sm), 480px (phone)
   ============================================================ */

/* ── 900px: Sidebar collapses ── */
@media (max-width: 900px) {
  :root {
    --sidebar-width: 270px;
    --topbar-height: 60px;
  }

  /* Sidebar: slide-in drawer */
  .admin-sidebar {
    transform: translateX(-100%);
    z-index: 1100;
  }
  .admin-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 40px rgba(0,0,0,0.35);
  }

  /* Backdrop */
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(2px);
    z-index: 1099;
    display: none;
  }
  .sidebar-backdrop.open {
    display: block;
  }

  /* Main wrapper fills full width */
  .admin-main-wrapper {
    margin-left: 0;
    width: 100%;
  }

  /* Show hamburger, show close button */
  .btn-mobile-menu {
    display: flex;
  }
  .btn-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
  }

  /* ── Topbar: reorganise for small screens ── */
  .admin-topbar {
    padding: 0 14px;
    height: var(--topbar-height);
    flex-wrap: nowrap;
    position: sticky;
    top: 0;
    z-index: 900;
  }
  .topbar-left {
    flex: 1;
    min-width: 0;
    gap: 10px;
  }
  .topbar-title-wrap {
    min-width: 0;
  }
  .page-title {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .page-breadcrumb {
    display: none;
  }
  .topbar-right {
    gap: 6px;
    flex-shrink: 0;
  }
  /* Hide verbose labels on topbar, keep only essential action icons */
  .db-live-indicator .db-text {
    display: none;
  }
  .db-live-indicator {
    padding: 4px 6px;
    gap: 0;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
  }
  .diwali-season-tag {
    display: none;
  }
  .topbar-quick-actions {
    gap: 5px;
  }
  .btn-topbar-action .action-label {
    display: none;
  }
  .btn-topbar-action {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 16px;
  }
  .btn-topbar-action .action-icon {
    font-size: 18px;
    font-weight: 800;
  }

  /* ── Content padding ── */
  .admin-content-view {
    padding: 14px;
  }

  /* ── Dashboard Hero Card ── */
  .dashboard-hero-card {
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    text-align: center;
  }
  .hero-right {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 12px;
    width: 100%;
  }
  .hero-title {
    font-size: 18px;
  }
  .hero-clock {
    font-size: 20px;
  }

  /* ── KPI grid: 2 columns ── */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .kpi-card {
    padding: 14px;
    gap: 10px;
  }
  .kpi-value {
    font-size: 20px;
  }
  .kpi-icon-wrap {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  /* ── Status KPI strip: 3 columns ── */
  .status-kpi-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .status-num { font-size: 16px; }
  .status-lbl { font-size: 10px; }
  .status-pill-item { padding: 10px 6px; }

  /* ── Dashboard 2-column layout: single column ── */
  .dashboard-columns-grid {
    grid-template-columns: 1fr;
  }

  /* ── Toolbar ── */
  .toolbar-card {
    padding: 12px;
  }
  .toolbar-row-top {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .search-box-wrap {
    max-width: 100%;
  }
  .toolbar-actions-right {
    display: flex;
    justify-content: flex-end;
  }
  .toolbar-filters-row {
    gap: 8px;
  }
  .filter-group {
    flex-wrap: wrap;
  }
  .filter-select, .filter-input-date {
    max-width: 130px;
  }

  /* ── Tables: horizontal scroll wrapper ── */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .admin-table {
    min-width: 600px;
  }
  .admin-table th,
  .admin-table td {
    padding: 10px 10px;
    font-size: 12px;
  }
  .table-summary-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }

  /* ── Pagination ── */
  .pagination-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }
  .page-pills-wrap {
    flex-wrap: wrap;
    gap: 3px;
  }

  /* ── Modals: full screen on mobile ── */
  .admin-modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .admin-modal-box {
    max-width: 100%;
    width: 100%;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 92vh;
    margin: 0;
    animation: modalSlideUp 0.3s ease-out;
  }
  .admin-modal-box.modal-lg,
  .admin-modal-box.modal-sm {
    max-width: 100%;
  }
  @keyframes modalSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
  }
  .modal-body-scroll {
    padding: 16px;
  }
  .modal-footer {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .modal-footer .btn-translucent,
  .modal-footer .btn-primary-gold,
  .modal-footer .btn-danger {
    flex: 1;
    justify-content: center;
  }

  /* ── Order detail modal footer ── */
  .order-detail-footer {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .order-status-update-wrap {
    flex-wrap: wrap;
    gap: 6px;
  }
  .status-select {
    flex: 1;
    width: auto;
  }
  .order-footer-actions {
    justify-content: flex-end;
  }

  /* ── Settings grid ── */
  .settings-grid {
    grid-template-columns: 1fr !important;
    display: flex;
    flex-direction: column;
  }

  /* ── Banners grid ── */
  .admin-banners-grid {
    grid-template-columns: 1fr;
  }

  /* ── View header ── */
  .view-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
  .view-header-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    justify-content: flex-end;
  }

  /* Banner card header flex */
  .card-header-flex {
    flex-direction: column;
    gap: 10px;
  }

  /* Switches grid: single column */
  .switches-grid {
    grid-template-columns: 1fr;
  }

  /* Order detail grid: single column */
  .order-detail-grid {
    grid-template-columns: 1fr;
  }

  /* Stepper: compact */
  .order-stepper {
    gap: 4px;
  }
  .stepper-circle {
    width: 26px;
    height: 26px;
    font-size: 11px;
  }
  .stepper-lbl {
    font-size: 9px;
  }

  /* Category toolbar row */
  .toolbar-row-top > div:first-child {
    flex: 1;
    min-width: 0;
  }
  .toolbar-row-top > div:first-child .card-heading {
    font-size: 14px;
  }

  /* Admin card padding */
  .admin-card {
    padding: 16px;
  }

  /* Image upload row on smaller screens */
  .image-upload-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .image-preview-box {
    width: 70px;
    height: 70px;
  }
}

/* ── 600px: Phones in landscape, larger phones ── */
@media (max-width: 600px) {
  /* KPI: still 2 columns but tighter */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .kpi-label {
    font-size: 10px;
  }
  .kpi-value {
    font-size: 17px;
  }

  /* Status strip: 3 cols */
  .status-kpi-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Form row 2/3 → 1 column */
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }

  /* Login card padding */
  .login-card {
    padding: 20px 16px;
  }

  /* Toolbar quick actions → icon only */
  .btn-topbar-action .action-label {
    display: none;
  }

  /* Table rows: tighter */
  .admin-table th,
  .admin-table td {
    padding: 8px 8px;
    font-size: 11px;
  }
}

/* ── 480px: Small phones ── */
@media (max-width: 480px) {
  :root {
    --topbar-height: 56px;
  }

  /* KPI: 1 column on very small */
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .kpi-card {
    flex-direction: row;
    align-items: center;
  }

  /* Status strip: 2+2+remaining */
  .status-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Topbar: smaller padding */
  .admin-topbar {
    padding: 0 10px;
  }

  /* Page title smaller */
  .page-title {
    font-size: 13px;
  }

  /* Toast: full width at bottom */
  .toast-container {
    top: auto;
    bottom: 16px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  /* Banner item thumb height */
  .banner-item-thumb {
    height: 130px;
  }

  /* Announcement box: stack */
  .announcement-live-box {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }

  /* Categories table min-width smaller */
  .categories-table {
    min-width: 480px;
  }
  .orders-table {
    min-width: 640px;
  }
  .customers-table {
    min-width: 580px;
  }
  .products-table {
    min-width: 700px;
  }

  /* Dashboard hero card compact */
  .hero-title {
    font-size: 16px;
  }
  .hero-badge {
    font-size: 9px;
  }
  .hero-desc {
    font-size: 12px;
  }

  /* Admin card compact */
  .admin-card {
    padding: 12px;
    margin-bottom: 16px;
  }
  .admin-content-view {
    padding: 10px;
  }

  /* Pagination compact */
  .pagination-bar {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .pagination-info {
    font-size: 11px;
  }

  /* Toolbar compact */
  .toolbar-card {
    padding: 10px;
  }

  /* Modal header compact */
  .modal-header {
    padding: 14px 16px;
  }
  .modal-title {
    font-size: 15px;
  }

  /* btn-primary-gold full width in certain contexts */
  .form-actions-bar .btn-primary-gold,
  .form-actions-right .btn-primary-gold {
    width: 100%;
    justify-content: center;
  }

  /* Sidebar footer compact */
  .sidebar-footer {
    padding: 12px;
  }
  .admin-profile-box {
    margin-bottom: 8px;
  }
}

/* ==========================================================================
   BANNERS & STOREFRONT DESIGN MANAGEMENT
   ========================================================================== */
.admin-banners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.banner-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.banner-item-card:hover {
  border-color: var(--border-gold);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.banner-item-thumb {
  position: relative;
  width: 100%;
  height: 170px;
  background: #000;
  overflow: hidden;
}

.banner-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.banner-item-card:hover .banner-item-thumb img {
  transform: scale(1.04);
}

.banner-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 12, 20, 0.2) 0%, rgba(8, 12, 20, 0.85) 100%);
}

.banner-thumb-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.banner-order-chip {
  background: rgba(8, 12, 20, 0.85);
  border: 1px solid var(--border-light);
  color: var(--gold-light);
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
}

.banner-active-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 12px;
}

.banner-active-pill.active {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #10B981;
}

.banner-active-pill.inactive {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #EF4444;
}

.banner-item-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.banner-badge-preview {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-primary);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.banner-title-preview {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.banner-subtitle-preview {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
  flex: 1;
}

.banner-links-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.banner-link-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: #CBD5E1;
  border: 1px solid var(--border-color);
}

.banner-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  gap: 8px;
}

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

/* Announcement Visual Preview in Admin */
.announcement-preview-wrapper {
  background: #F4F9F6;
  border: 1px dashed rgba(6, 78, 59, 0.2);
  border-radius: var(--radius-md);
  padding: 14px;
}

.preview-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.announcement-live-box {
  background: #042418;
  border: 1px solid rgba(217, 119, 6, 0.4);
  box-shadow: 0 4px 14px rgba(4, 36, 24, 0.2);
  border-radius: 8px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  transition: all 0.3s ease;
}

.announcement-live-box.disabled-preview {
  opacity: 0.4;
  filter: grayscale(1);
  border-color: rgba(255, 255, 255, 0.1);
}

.prev-badge {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #080C14;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.prev-text {
  font-size: 12px;
  font-weight: 600;
  color: #F8FAFC;
  flex: 1;
  letter-spacing: 0.3px;
}

.prev-link {
  color: #FDE68A;
  font-size: 11px;
  font-weight: 700;
  text-decoration: underline;
  white-space: nowrap;
}

/* Preset Images Selector */
.preset-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.preset-img-btn {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.preset-img-btn:hover {
  border-color: var(--gold-primary);
  background: #F0F7F4;
  transform: translateY(-2px);
}

.preset-img-btn img {
  width: 100%;
  height: 52px;
  object-fit: cover;
  border-radius: 4px;
}

.preset-img-btn span {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.btn-upload-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: var(--gold-primary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-upload-file:hover {
  background: var(--gold-primary);
  color: #080C14;
}

.upload-status-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 12px;
}

.banner-preview-container {
  width: 100%;
  height: 200px;
  border: 1px solid rgba(6, 78, 59, 0.2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #F4F9F6;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

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


/* ==========================================================================
   MISSING BASE CLASS DEFINITIONS
   ========================================================================== */

/* Settings page two-column grid */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

/* View header (Banners page) */
.view-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 14px;
}
.view-header-title-block {
  flex: 1;
  min-width: 0;
}
.view-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}
.view-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}
.view-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Card header flex (banners sections) */
.card-header-flex {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.card-header-flex .card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.card-header-flex .card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 3px;
  margin-bottom: 0;
}

/* Form action bars */
.form-actions-bar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--border-color);
}
.form-actions-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 12px;
  margin-top: 8px;
}

/* Small button variant */
.btn-sm {
  height: 32px !important;
  padding: 0 12px !important;
  font-size: 12px !important;
}

/* Spacing utilities */
.mb-24 { margin-bottom: 24px; }
.mb-20 { margin-bottom: 20px; }
.mb-16 { margin-bottom: 16px; }
.mb-12 { margin-bottom: 12px; }
.mb-8  { margin-bottom: 8px; }

/* Input helper texts */
.input-help {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 5px;
}
.form-hint {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Toggle switch (announcement bar) */
.form-check-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(6, 78, 59, 0.2);
  border-radius: 24px;
  transition: 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #FFFFFF;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--emerald);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
}
.toggle-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Loading spinner for banners grid */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
  flex-direction: column;
}
.spinner-gold {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(217, 119, 6, 0.15);
  border-top-color: var(--gold-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Delete warning text */
.delete-warning-text {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Topbar title wrap */
.topbar-title-wrap {
  display: flex;
  flex-direction: column;
}

/* Toolbar actions right (Products page top-right) */
.toolbar-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.summary-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.summary-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* nav-badge inner */
.nav-badge.standby {
  background: rgba(245, 158, 11, 0.15);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Btn-icon in action buttons */
.btn-icon {
  font-size: 16px;
  line-height: 1;
}
