/* ==========================================================================
   3 STAR BD - PROFESSIONAL MODULAR ADMIN DASHBOARD STYLESHEET
   Matching Luviore.store Modern Dark Navy & Champagne Gold Theme
   ========================================================================== */

:root {
  --admin-navy: #0A192F;
  --admin-sidebar: #0D2240;
  --admin-sidebar-light: #15325B;
  --admin-gold: #D4AF37;
  --admin-gold-hover: #C5A059;
  --admin-bg: #F8FAFC;
  --admin-card: #FFFFFF;
  --admin-border: #E2E8F0;
  --admin-border-focus: #D4AF37;
  --admin-text: #0F172A;
  --admin-muted: #64748B;
  --admin-success: #10B981;
  --admin-danger: #EF4444;
  --admin-warning: #F59E0B;
  --admin-info: #3B82F6;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html, body.admin-body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--admin-bg);
  color: var(--admin-text);
  max-width: 100vw;
  overflow-x: hidden;
}

body.admin-body {
  display: flex;
  min-height: 100vh;
}

/* ==========================================
   SIDEBAR COMPONENT
   ========================================== */
.admin-sidebar {
  width: 260px;
  background: var(--admin-navy);
  color: #FFFFFF;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  top: 0;
  left: 0;
  z-index: 1000;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-right: 14px;
}
.admin-sidebar-header .admin-brand {
  border-bottom: none;
  flex-grow: 1;
}

.admin-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #CBD5E1;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.admin-sidebar-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
}

.admin-mobile-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--admin-navy);
  border: 1.5px solid var(--admin-gold);
  color: var(--admin-gold);
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(10, 25, 47, 0.15);
}
.admin-mobile-toggle:hover {
  background: #112240;
  color: #FFFFFF;
}

.admin-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 25, 47, 0.65);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.admin-brand {
  padding: 24px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.5px;
}
.admin-brand i {
  color: var(--admin-gold);
  font-size: 1.35rem;
}
.admin-brand span {
  color: var(--admin-gold);
}

.admin-nav {
  list-style: none;
  padding: 16px 0;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.admin-nav li {
  margin-bottom: 4px;
}

.admin-nav li a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 22px;
  color: #94A3B8;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 4px solid transparent;
}
.admin-nav li a i {
  width: 20px;
  font-size: 1.05rem;
  text-align: center;
}
.admin-nav li a:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.06);
}
.admin-nav li a.active {
  color: #FFFFFF;
  background: var(--admin-sidebar-light);
  border-left-color: var(--admin-gold);
}
.admin-nav li a.active i {
  color: var(--admin-gold);
}

.admin-sidebar-footer {
  padding: 18px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.2);
}
.admin-sidebar-footer .logged-label {
  color: #64748B;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 1px;
}
.admin-sidebar-footer .user-name {
  color: #F8FAFC;
  font-weight: 700;
  margin: 3px 0 6px;
}
.admin-sidebar-footer .signout-link {
  color: #EF4444;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.2s;
}
.admin-sidebar-footer .signout-link:hover {
  opacity: 0.8;
}

/* ==========================================
   MAIN CONTENT AREA & TOPBAR
   ========================================== */
.admin-main {
  flex-grow: 1;
  margin-left: 260px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
}

.admin-topbar {
  background: #FFFFFF;
  height: 68px;
  border-bottom: 1px solid var(--admin-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: var(--shadow-sm);
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--admin-navy);
}
.topbar-title i {
  color: var(--admin-gold);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.admin-content {
  padding: 32px;
  flex-grow: 1;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* ==========================================
   METRIC & STATS CARDS
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card {
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #EFF6FF; color: #2563EB; }
.stat-icon.amber  { background: #FEF3C7; color: #D97706; }
.stat-icon.green  { background: #ECFDF5; color: #059669; }
.stat-icon.purple { background: #F3E8FF; color: #7C3AED; }
.stat-icon.red    { background: #FEE2E2; color: #DC2626; }

.stat-details h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: var(--admin-muted);
  margin: 0 0 6px 0;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.stat-details .num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--admin-navy);
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}
.stat-details .sub {
  font-size: 0.78rem;
  color: var(--admin-muted);
  margin-top: 4px;
}

/* ==========================================
   CARDS & SURFACES
   ========================================== */
.admin-card, .form-card, .admin-table-card {
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.card-header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--admin-border);
  flex-wrap: wrap;
  gap: 12px;
}
.card-header-flex h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--admin-navy);
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Header Action Group & Search Form */
.header-actions-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.header-search-form {
  display: flex;
  gap: 8px;
  align-items: center;
}
.header-search-form .form-input {
  width: 220px;
  padding: 8px 12px;
  font-size: 0.88rem;
  height: 38px;
  box-sizing: border-box;
}
.header-search-form .btn {
  height: 38px;
  padding: 0 16px;
  white-space: nowrap;
  box-sizing: border-box;
}

/* Page Intro Header (Breadcrumbs, Page Title, and Primary Action) */
.page-intro-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 14px;
}
.page-intro-header .intro-text h1,
.page-intro-header .intro-text h2,
.page-intro-header h1,
.page-intro-header h2,
.admin-page-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--admin-navy);
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.page-intro-header .intro-text p,
.page-intro-header p {
  color: var(--admin-muted);
  font-size: 0.88rem;
  margin: 0;
  line-height: 1.4;
}

.admin-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--admin-muted);
  margin-bottom: 6px;
}
.admin-breadcrumb a {
  color: var(--admin-muted);
  text-decoration: none;
  font-weight: 500;
}
.admin-breadcrumb a:hover {
  color: var(--admin-navy);
}
.admin-breadcrumb .sep {
  font-size: 0.65rem;
  color: #CBD5E1;
}
.admin-breadcrumb .current {
  color: var(--admin-navy);
  font-weight: 600;
}

/* ==========================================
   FORM CONTROLS (FIXES UNSTYLED INPUTS)
   ========================================== */
.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}
.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}

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

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #1E293B;
  margin-bottom: 8px;
}
.form-label .required {
  color: var(--admin-danger);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--admin-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--admin-text);
  background-color: #FFFFFF;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--admin-border-focus);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

.form-textarea {
  resize: vertical;
  line-height: 1.5;
}

.form-hint, .form-text {
  font-size: 0.8rem;
  color: var(--admin-muted);
  margin-top: 6px;
  display: block;
}

/* File Upload Box */
.file-upload-wrapper {
  border: 2px dashed var(--admin-border);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
  background: #F8FAFC;
  cursor: pointer;
  transition: all 0.2s ease;
}
.file-upload-wrapper:hover {
  border-color: var(--admin-gold);
  background: #FEFDF8;
}
.file-upload-icon {
  font-size: 2.2rem;
  color: var(--admin-gold);
  margin-bottom: 8px;
}

/* ==========================================
   BUTTONS
   ========================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  padding: 11px 22px;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  border: none;
  transition: all 0.2s ease;
  line-height: 1.2;
}

.btn-primary {
  background: var(--admin-navy);
  color: #FFFFFF;
}
.btn-primary:hover {
  background: #112240;
  color: #FFFFFF;
}

.btn-gold {
  background: var(--admin-gold);
  color: #0A192F;
  font-weight: 700;
}
.btn-gold:hover {
  background: var(--admin-gold-hover);
  color: #0A192F;
}

.btn-success {
  background: var(--admin-success);
  color: #FFFFFF;
}
.btn-success:hover {
  background: #059669;
  color: #FFFFFF;
}

.btn-danger {
  background: var(--admin-danger);
  color: #FFFFFF;
}
.btn-danger:hover {
  background: #DC2626;
  color: #FFFFFF;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--admin-border);
  color: #334155;
}
.btn-outline:hover {
  background: #F1F5F9;
  border-color: #CBD5E1;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

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

/* ==========================================
   DATA TABLES
   ========================================== */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.admin-table th {
  background: #F8FAFC;
  padding: 14px 18px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--admin-muted);
  border-bottom: 2px solid var(--admin-border);
  white-space: nowrap;
}
.admin-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--admin-border);
  font-size: 0.9rem;
  vertical-align: middle;
  white-space: nowrap;
}
.admin-table td.col-title,
.admin-table th.col-title {
  white-space: normal !important;
  min-width: 250px;
  max-width: 320px;
  line-height: 1.45;
}
.admin-table td.col-wrap,
.admin-table th.col-wrap {
  white-space: normal !important;
  min-width: 160px;
  line-height: 1.45;
}
.admin-table tbody tr:hover {
  background: #F8FAFC;
}
.admin-table td .thumb-img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 6px;
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  padding: 2px;
}

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-badge.pending    { background: #FEF3C7; color: #B45309; }
.status-badge.confirmed  { background: #EFF6FF; color: #1D4ED8; }
.status-badge.processing { background: #F3E8FF; color: #6D28D9; }
.status-badge.shipped    { background: #E0E7FF; color: #4338CA; }
.status-badge.delivered  { background: #ECFDF5; color: #047857; }
.status-badge.cancelled  { background: #FEE2E2; color: #B91C1C; }
.status-badge.instock    { background: #ECFDF5; color: #047857; }
.status-badge.outofstock { background: #FEE2E2; color: #B91C1C; }
.status-badge.lowstock   { background: #FEF3C7; color: #B45309; }

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.filter-tab {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--admin-muted);
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.filter-tab:hover {
  color: var(--admin-navy);
  border-color: #CBD5E1;
}
.filter-tab.active {
  background: var(--admin-navy);
  color: #FFFFFF;
  border-color: var(--admin-navy);
}
.filter-tab .badge-count {
  background: rgba(0, 0, 0, 0.1);
  padding: 2px 7px;
  border-radius: 12px;
  font-size: 0.75rem;
}
.filter-tab.active .badge-count {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* ==========================================
   ALERTS
   ========================================== */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.alert-success {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}
.alert-danger {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}
.alert-info {
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1E40AF;
}

/* ==========================================
   ADMIN TABS (FOR SETTINGS & MODULES)
   ========================================== */
.admin-tabs-nav {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--admin-border);
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.admin-tab-btn {
  background: none;
  border: none;
  padding: 14px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--admin-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.admin-tab-btn:hover {
  color: var(--admin-navy);
}
.admin-tab-btn.active {
  color: var(--admin-navy);
  border-bottom-color: var(--admin-gold);
  background: #FFFFFF;
  border-radius: 8px 8px 0 0;
}
.admin-tab-pane {
  display: none;
}
.admin-tab-pane.active {
  display: block;
}

/* ==========================================
   RESPONSIVE DESIGN & MOBILE DRAWER
   ========================================== */

/* Layout Grid Utilities */
.admin-split-layout {
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.admin-split-layout.reverse {
  grid-template-columns: minmax(0, 1fr) 360px;
}
.admin-split-2-1 {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 28px;
}
.admin-split-equal {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px;
}

.admin-split-layout > *,
.admin-split-layout.reverse > *,
.admin-split-2-1 > *,
.admin-split-equal > * {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Responsive Table Wrapper */
.table-responsive,
.admin-table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  display: block;
}
.admin-table {
  min-width: 820px;
}

/* Tablet & Mobile Drawer Breakpoint (<= 992px) */
@media (max-width: 992px) {
  body.admin-sidebar-open {
    overflow: hidden;
  }

  .admin-mobile-toggle {
    display: inline-flex;
  }

  .admin-sidebar-close {
    display: inline-flex;
  }

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

  /* Transform sidebar into smooth slide-in off-canvas drawer */
  .admin-sidebar {
    width: 280px !important;
    max-width: 85vw;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1200;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 6px 0 28px rgba(0, 0, 0, 0.35);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }

  /* Keep full branding, labels, and footer visible inside drawer */
  .admin-brand span,
  .admin-nav li a span,
  .admin-sidebar-footer {
    display: block !important;
  }
  .admin-nav li a {
    justify-content: flex-start !important;
    padding: 12px 22px !important;
  }
  .admin-nav li a i {
    font-size: 1.05rem !important;
  }

  /* Main content takes full screen width */
  .admin-main {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
    min-width: 0 !important;
  }

  .admin-content {
    padding: 24px 20px;
    max-width: 100vw !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Grid Layouts collapse into vertical stacks on tablet/mobile */
  .admin-split-layout,
  .admin-split-layout.reverse,
  .admin-split-2-1,
  .admin-split-equal,
  [style*="grid-template-columns: 380px 1fr"],
  [style*="grid-template-columns: 1fr 360px"],
  [style*="grid-template-columns: 2fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr 1fr 1fr"] {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    gap: 20px !important;
  }

  .admin-split-layout > *,
  .admin-split-layout.reverse > *,
  .admin-split-2-1 > *,
  .admin-split-equal > *,
  [style*="grid-template-columns: 380px 1fr"] > *,
  [style*="grid-template-columns: 1fr 360px"] > *,
  [style*="grid-template-columns: 2fr 1fr"] > *,
  [style*="grid-template-columns: 1fr 1fr"] > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Sales Filter Form & Action Button Utilities */
.sales-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.filter-presets, .filter-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.panel {
  background: #FFFFFF;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.btn-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #475569;
  border: 1px solid var(--admin-border);
  background: #FFFFFF;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-action:hover {
  color: var(--admin-navy);
  border-color: #CBD5E1;
  background: #F8FAFC;
}
.btn-action.btn-delete:hover {
  color: #DC2626;
  border-color: #FECACA;
  background: #FEF2F2;
}

/* Mobile Bottom Navigation Bar (Hidden by default on desktop) */
.admin-bottom-nav {
  display: none;
}

/* Smartphone & Small Tablet Breakpoint (<= 768px) */
@media (max-width: 768px) {
  .admin-topbar {
    padding: 0 12px;
    height: 60px;
    gap: 8px;
  }
  .topbar-title {
    font-size: 1.05rem;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }
  .topbar-title span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 180px;
  }

  .admin-content {
    padding: 16px 12px;
    padding-bottom: 84px !important; /* Space for bottom nav */
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  /* Page Intro Header Mobile Handling */
  .page-intro-header {
    flex-direction: column;
    align-items: stretch !important;
    gap: 10px;
    margin-bottom: 18px;
  }
  .page-intro-header .intro-text h1,
  .page-intro-header .intro-text h2,
  .page-intro-header h1,
  .page-intro-header h2,
  .admin-page-title {
    font-size: 1.25rem !important;
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
  }
  .page-intro-header .intro-text p,
  .page-intro-header p {
    font-size: 0.82rem !important;
  }
  .page-intro-header .btn,
  .page-intro-header .admin-topbar-actions .btn {
    width: 100% !important;
    justify-content: center;
  }
  .admin-breadcrumb {
    font-size: 0.76rem;
    margin-bottom: 4px;
  }

  .admin-card,
  .form-card,
  .admin-table-card,
  .admin-banner-card {
    padding: 18px 14px !important;
    margin-bottom: 20px;
    border-radius: 8px;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    overflow: hidden;
  }

  /* Sticky Mobile Bottom Navigation Bar */
  .admin-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: #0A192F;
    border-top: 1px solid rgba(212, 175, 55, 0.25);
    z-index: 1100;
    align-items: center;
    justify-content: space-around;
    padding: 0 4px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
  }

  .admin-bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94A3B8;
    text-decoration: none;
    background: none;
    border: none;
    font-size: 0.68rem;
    font-weight: 600;
    gap: 3px;
    padding: 6px 0;
    cursor: pointer;
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .admin-bottom-nav-item i {
    font-size: 1.15rem;
  }

  .admin-bottom-nav-item.active,
  .admin-bottom-nav-item:active {
    color: var(--admin-gold);
  }

  .admin-bottom-nav-item .nav-icon-wrapper {
    position: relative;
    display: inline-flex;
  }

  .admin-bottom-nav-item .bottom-nav-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: var(--admin-gold);
    color: #0A192F;
    font-size: 0.62rem;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 8px;
    line-height: 1.2;
  }

  .admin-bottom-nav-item .bottom-nav-badge.red {
    background: #EF4444;
    color: #FFFFFF;
  }

  /* KPI Stats reflows into 2 neat columns */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
  }
  .stat-card {
    padding: 14px;
    gap: 12px;
  }
  .stat-icon {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
  .stat-details .num {
    font-size: 1.35rem;
  }
  .stat-details h4 {
    font-size: 0.72rem;
  }
  .stat-details .sub {
    font-size: 0.72rem;
  }

  /* Header flex headers and search forms wrap nicely */
  .card-header-flex {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .card-header-flex > form,
  .card-header-flex > div,
  .card-header-flex > a {
    width: 100%;
  }

  .header-actions-wrapper {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .header-search-form {
    width: 100%;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 8px;
  }
  .header-search-form .form-input {
    flex: 1 1 auto;
    width: auto !important;
    min-width: 0;
    height: 40px !important;
    padding: 8px 12px;
  }
  .header-search-form .btn {
    height: 40px !important;
    padding: 0 16px;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .header-actions-wrapper .add-btn,
  .header-actions-wrapper .btn-gold {
    width: 100%;
    height: 40px;
    justify-content: center;
  }

  /* Form columns stack to single column */
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* Horizontal touch scrolling for tab navigation bars */
  .filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    margin-bottom: 16px;
    scrollbar-width: none;
  }
  .filter-tabs::-webkit-scrollbar {
    display: none;
  }
  .filter-tab {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 0.8rem;
  }

  .admin-tabs-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
    margin-bottom: 20px;
    scrollbar-width: none;
  }
  .admin-tabs-nav::-webkit-scrollbar {
    display: none;
  }
  .admin-tab-btn {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 10px 14px;
    font-size: 0.85rem;
  }
}

/* Compact Mobile Screen Breakpoint (<= 480px) */
@media (max-width: 480px) {
  .topbar-title span {
    max-width: 140px;
    font-size: 0.95rem;
  }

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

  .topbar-actions .btn .btn-text {
    display: none;
  }
  .topbar-actions .btn {
    padding: 7px 11px;
    font-size: 0.82rem;
  }

  .admin-card,
  .form-card,
  .admin-table-card,
  .admin-banner-card {
    padding: 14px 10px !important;
  }

  .admin-table th,
  .admin-table td {
    padding: 10px 10px;
    font-size: 0.82rem;
  }

  .btn {
    padding: 10px 16px;
    font-size: 0.86rem;
  }
  .btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
  }
}
