/* ==========================================================================
   StokManager Pro — Premium Dark & Glassmorphism Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap');

:root {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --glass-bg: rgba(17, 24, 39, 0.7);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --accent-cyan: #06b6d4;
  --accent-violet: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #06b6d4 0%, #8b5cf6 100%);
  --accent-gradient-hover: linear-gradient(135deg, #0891b2 0%, #7c3aed 100%);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.15);
  --warning: #f59e0b;
  --warning-glow: rgba(245, 158, 11, 0.15);
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.15);
  --info: #3b82f6;
  --info-glow: rgba(59, 130, 246, 0.15);

  --sidebar-width: 260px;
  --topbar-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base resets & scrollbar */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(6, 182, 212, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(8b, 92, 246, 0.05) 0%, transparent 40%);
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

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

/* App container */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--glass-border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 24px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.nav-item {
  list-style: none;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.925rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.03);
}

.nav-link.active {
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.25);
}

.nav-icon {
  width: 20px;
  height: 20px;
  stroke-width: 2px;
}

.nav-badge {
  margin-left: auto;
  background-color: var(--danger);
  color: #fff;
  font-size: 0.725rem;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 600;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid var(--glass-border);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

/* Main Content */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  padding: calc(var(--topbar-height) + 24px) 24px 24px 24px;
  min-height: 100vh;
  transition: var(--transition);
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background-color: rgba(17, 24, 39, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 90;
  transition: var(--transition);
}

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

.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
}

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

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.2);
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-name {
  font-weight: 600;
  font-size: 0.9rem;
}

.user-role {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Cards & Glassmorphism */
.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 24px;
  overflow: visible;
  transition: var(--transition);
}

.card:hover {
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  overflow: hidden;
}

.card-header h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 24px;
  overflow: visible;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  animation: fadeIn 0.4s ease;
}

.page-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.page-actions {
  display: flex;
  gap: 12px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--glass-border-hover);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.stat-card.primary::after { background: var(--accent-gradient); }
.stat-card.success::after { background: var(--success); }
.stat-card.warning::after { background: var(--warning); }
.stat-card.danger::after { background: var(--danger); }

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-icon--primary { background: rgba(6, 182, 212, 0.12); color: var(--accent-cyan); }
.stat-icon--success { background: rgba(16, 185, 129, 0.12); color: var(--success); }
.stat-icon--warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); }
.stat-icon--danger { background: rgba(239, 68, 68, 0.12); color: var(--danger); }

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

.stat-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Tables */
.table-container {
  overflow-x: auto;
  overflow-y: visible;
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  /* Ensure touch devices can grab and scroll */
  touch-action: pan-x pan-y;
}

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

.data-table th {
  background-color: rgba(255, 255, 255, 0.02);
  padding: 14px 18px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--glass-border);
}

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

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-success { background: rgba(16, 185, 129, 0.12); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.badge-danger { background: rgba(239, 68, 68, 0.12); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }
.badge-info { background: rgba(59, 130, 246, 0.12); color: var(--info); border: 1px solid rgba(59, 130, 246, 0.2); }

.badge-masuk { background: rgba(16, 185, 129, 0.12); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-keluar { background: rgba(239, 68, 68, 0.12); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.25); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px 0 rgba(6, 182, 212, 0.2);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px 0 rgba(6, 182, 212, 0.3);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: #374151;
  border-color: var(--glass-border-hover);
}

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

.btn-warning { background: var(--warning); color: #0b0f19; }
.btn-warning:hover { background: #d97706; }

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

.btn-sm {
  padding: 6px 12px;
  font-size: 0.775rem;
  border-radius: 6px;
}

.btn-icon {
  padding: 6px;
  border-radius: 6px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.form-textarea {
  min-height: 100px;
  resize: vertical;
}

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

/* Toolbar & Filter area */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-input {
  width: 100%;
  padding-left: 38px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 18px;
  height: 18px;
}

.filter-group {
  display: flex;
  gap: 10px;
}

/* Flash Messages & Alerts */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInDown 0.3s ease;
}

.alert-success { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.2); color: var(--success); }
.alert-danger { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.2); color: var(--danger); }
.alert-warning { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.2); color: var(--warning); }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 24px;
}

.page-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 8px;
  border-radius: 6px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.page-link:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
}

.page-link.active {
  background: var(--accent-gradient);
  color: #fff;
  border-color: transparent;
}

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 92%;
  max-width: 500px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

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

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
  background-color: rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Login Page specific styling */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  background-color: var(--bg-primary);
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.5s ease;
}

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

.login-logo {
  font-family: 'Outfit', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 6px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Two Column Layout on Dashboard (Grid) */
.dashboard-grid {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
}

/* Empty states */
.empty-state {
  text-align: center;
  padding: 48px 16px;
}

.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px auto;
  color: var(--text-muted);
}

.empty-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.empty-text {
  font-size: 0.825rem;
  color: var(--text-secondary);
}

/* Low Stock Highlight */
.low-stock-tr {
  background-color: rgba(239, 68, 68, 0.04);
}
.low-stock-tr:hover {
  background-color: rgba(239, 68, 68, 0.07) !important;
}

/* Keyframes */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes cardExpand {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Responsive breakdowns & Android Optimizations */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
  }
  .main-content {
    margin-left: 0;
    padding: calc(var(--topbar-height) + 16px) 16px 16px 16px;
  }
  .topbar {
    left: 0;
  }
  .menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  /* =============================================
     GENERAL MOBILE POLISH
     ============================================= */

  /* Prevent browser auto-zoom on input focus */
  .form-input, .form-select, .form-textarea {
    font-size: 16px !important;
    padding: 12px 14px;
  }
  
  .btn {
    padding: 12px 20px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
  
  .toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  
  .search-wrapper {
    max-width: none;
  }
  
  .filter-group {
    justify-content: space-between;
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-group select, .filter-group button, .filter-group a {
    flex: 1;
    text-align: center;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .page-actions {
    width: 100%;
  }

  .page-actions .btn, .page-actions a {
    width: 100%;
    text-align: center;
  }

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

  .stat-card {
    padding: 16px;
  }

  .stat-card:hover {
    transform: none;
  }
  
  .card-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-header .search-wrapper {
    width: 100%;
  }

  .card {
    overflow: visible;
    border-radius: var(--radius-md);
  }

  .card:hover {
    transform: none;
  }

  .card-body {
    padding: 16px;
    overflow: visible;
  }

  /* =============================================
     RESPONSIVE TABLE → CARD LAYOUT
     All tables automatically become card lists
     ============================================= */

  /* Remove forced min-width */
  .data-table {
    min-width: 0 !important;
    display: block !important;
    width: 100% !important;
  }

  /* Hide table header — labels come from JS data-label */
  .data-table thead {
    display: none !important;
  }

  .data-table tbody {
    display: block !important;
    width: 100%;
  }

  /* Each <tr> becomes a card */
  .data-table tbody tr {
    display: block !important;
    margin-bottom: 12px;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
  }

  .data-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.04);
  }

  /* Each <td> becomes a labeled block row */
  .data-table td {
    display: block !important;
    padding: 7px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
    text-align: left !important;
    font-size: 0.875rem;
    width: 100% !important;
  }

  .data-table td:last-child {
    border-bottom: none !important;
  }

  /* The label above each value */
  .data-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-weight: 600;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 3px;
  }

  /* Hide "No" / row-number column */
  .data-table td.mobile-hide {
    display: none !important;
  }

  /* Action buttons row */
  .data-table td.mobile-actions {
    display: flex !important;
    gap: 8px;
    justify-content: stretch;
    padding-top: 12px !important;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-bottom: none !important;
  }

  .data-table td.mobile-actions::before {
    display: none !important;
  }

  .data-table td.mobile-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 10px 14px;
  }

  .data-table td.mobile-actions .btn-icon {
    padding: 10px;
  }

  /* Empty state rows — no card styling */
  .data-table tbody tr.mobile-empty-row {
    border: none;
    padding: 0;
    background: none;
    margin: 0;
  }

  .data-table tbody tr.mobile-empty-row:hover {
    background: none;
  }

  .data-table tbody tr.mobile-empty-row td {
    border: none !important;
    padding: 0 !important;
  }

  .data-table tbody tr.mobile-empty-row td::before {
    display: none !important;
  }

  /* Low-stock card highlight */
  .data-table tbody tr.low-stock-tr {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.04);
  }

  .data-table tbody tr.low-stock-tr:hover {
    background-color: rgba(239, 68, 68, 0.07) !important;
  }

  /* =============================================
     ACCORDION CARDS — Tap to expand details
     ============================================= */

  /* Make card rows look tappable */
  .data-table tbody tr:not(.mobile-empty-row) {
    cursor: pointer;
  }

  /* Summary td — always visible as card header */
  .data-table td.mobile-summary {
    position: relative;
    padding-right: 30px !important;
    border-bottom: none !important;
  }

  /* Hide the field label on summary (it IS the card header) */
  .data-table td.mobile-summary::before {
    display: none !important;
  }

  /* Expand/collapse chevron indicator */
  .data-table td.mobile-summary::after {
    content: '▾';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    line-height: 1;
  }

  .data-table tbody tr.expanded td.mobile-summary::after {
    transform: translateY(-50%) rotate(180deg);
  }

  /* Add separator under summary when expanded */
  .data-table tbody tr.expanded td.mobile-summary {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
    padding-bottom: 10px !important;
    margin-bottom: 2px;
  }

  /* Detail tds — hidden by default */
  .data-table td.mobile-detail {
    display: none !important;
  }

  /* Show details when tr has .expanded */
  .data-table tbody tr.expanded td.mobile-detail {
    display: block !important;
    animation: cardExpand 0.25s ease;
  }

  /* Action buttons when expanded */
  .data-table tbody tr.expanded td.mobile-detail.mobile-actions {
    display: flex !important;
    animation: cardExpand 0.25s ease;
  }

  /* Status badge inline with summary */
  .mobile-status-badge {
    display: inline-block;
    margin-top: 6px;
  }

  /* Table container — no scroll needed, remove border */
  .table-container {
    overflow: visible !important;
    border: none !important;
    border-radius: 0 !important;
  }

  /* Pagination — larger touch targets */
  .page-link {
    min-width: 40px;
    height: 40px;
    font-size: 0.9rem;
  }

  /* Date filter on mobile */
  .filter-group > div[style*="display:flex"] {
    flex-wrap: wrap;
    width: 100%;
  }

  .filter-group > div[style*="display:flex"] .form-input {
    flex: 1;
    min-width: 0;
  }

  /* Modal on mobile */
  .modal {
    width: 96%;
    max-height: 90vh;
    overflow-y: auto;
  }
}
