/* =====================================================
   LANTA LLC WMS — Global Stylesheet
   Colors: Burgundy #6B1E2E | Gold #C9A84C
   ===================================================== */

:root {
  --burgundy: #6B1E2E;
  --burgundy-dark: #4A1220;
  --burgundy-light: #8B3040;
  --gold: #C9A84C;
  --gold-light: #E2C070;
  --gold-dark: #A88530;
  --dark-bg: #1A1A1A;
  --dark-surface: #242424;
  --dark-border: #333333;
  --dark-hover: #2E2E2E;
  --text-primary: #F0EDE8;
  --text-secondary: #A09890;
  --text-muted: #706860;
  --success: #4CAF73;
  --success-bg: rgba(76, 175, 115, 0.15);
  --danger: #E05252;
  --danger-bg: rgba(224, 82, 82, 0.15);
  --warning: #E0A832;
  --warning-bg: rgba(224, 168, 50, 0.15);
  --info: #5BA4CF;
  --info-bg: rgba(91, 164, 207, 0.15);
  --sidebar-width: 240px;
  --sidebar-collapsed: 60px;
  --header-height: 56px;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.5);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
  --transition: 0.18s ease;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--dark-bg);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--dark-bg); }
::-webkit-scrollbar-thumb { background: var(--dark-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--burgundy-light); }

/* ── LOGIN PAGE ── */
/* ── LOGIN PAGE ── */
.login-page {
  min-height: 100vh;
  display: flex;
  background: #0a0a0a;
}

/* Brand panel */
.login-brand-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #0f0f0f 0%, #1a0f08 60%, #0f0a05 100%);
  border-right: 1px solid rgba(201,168,76,0.2);
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(201,168,76,0.06) 0%, transparent 65%);
  pointer-events: none;
}

.login-brand-content {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 380px;
}

.login-brand-logo {
  width: 110px;
  height: 110px;
  margin-bottom: 24px;
  filter: drop-shadow(0 0 24px rgba(201,168,76,0.3));
}

.login-brand-name {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: #fff;
  margin-bottom: 16px;
  line-height: 1;
}

.login-brand-tagline {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 24px;
}

.login-brand-tagline span {
  font-size: 1.05rem;
  font-weight: 700;
  color: #C9A84C;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.5;
}

.login-brand-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #C9A84C, transparent);
  margin: 0 auto 20px;
}

.login-brand-tier {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 28px;
}

.login-brand-services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-bottom: 40px;
  padding: 0;
}

.login-brand-services li {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
}

.login-brand-services li:not(:last-child)::after {
  content: '•';
  position: absolute;
  right: -10px;
  color: rgba(201,168,76,0.4);
}

.login-brand-url {
  font-size: 0.72rem;
  color: rgba(201,168,76,0.5);
  text-decoration: none;
  letter-spacing: 0.1em;
  transition: color 0.2s;
}
.login-brand-url:hover { color: #C9A84C; }

/* Form panel */
.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background: #0f0f0f;
  min-width: 420px;
}

.login-card {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
}

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

.login-logo-img {
  width: 60px;
  height: 60px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 12px rgba(201,168,76,0.25));
}

.login-logo h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.login-logo p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

/* Mobile: stack vertically, hide brand panel */
@media (max-width: 860px) {
  .login-page { flex-direction: column; background: #0f0f0f; }
  .login-brand-panel { display: none; }
  .login-form-panel { min-width: unset; width: 100%; padding: 40px 16px; }
}

/* ── APP LAYOUT ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--dark-surface);
  border-right: 1px solid var(--dark-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  transition: width var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: var(--sidebar-collapsed); }

.sidebar-brand {
  padding: 16px;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--header-height);
  background: var(--burgundy-dark);
  flex-shrink: 0;
}

.sidebar-brand .brand-icon {
  width: 32px;
  height: 32px;
  background: var(--burgundy);
  border: 1px solid var(--gold);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--gold);
  letter-spacing: -0.5px;
}

.sidebar-brand .brand-icon-img {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(201,168,76,0.35));
}

.sidebar-brand .brand-text {
  overflow: hidden;
  white-space: nowrap;
}

.sidebar-brand .brand-text .company { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.sidebar-brand .brand-text .subtitle { font-size: 0.7rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.1em; }

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

.nav-section-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 12px 16px 4px;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition);
  cursor: pointer;
  border-left: 3px solid transparent;
  white-space: nowrap;
  overflow: hidden;
}

.nav-item:hover {
  background: var(--dark-hover);
  color: var(--text-primary);
  border-left-color: var(--burgundy-light);
}

.nav-item.active {
  background: rgba(107, 30, 46, 0.25);
  color: var(--gold);
  border-left-color: var(--gold);
}

.nav-item .nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item .nav-label { font-size: 0.875rem; font-weight: 500; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--dark-border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius);
  overflow: hidden;
}

.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--burgundy);
  border: 1px solid var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--gold);
  flex-shrink: 0;
}

.user-info { overflow: hidden; }
.user-info .user-name { font-size: 0.8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .user-role { font-size: 0.7rem; color: var(--gold); text-transform: uppercase; }

.sidebar-toggle {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: all var(--transition);
  margin-top: 4px;
}

.sidebar-toggle:hover { background: var(--dark-hover); color: var(--text-primary); }

/* ── MAIN CONTENT ── */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  transition: margin-left var(--transition);
  display: flex;
  flex-direction: column;
}

.main-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }

/* ── TOP BAR ── */
.topbar {
  height: var(--header-height);
  background: var(--dark-surface);
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.page-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }
.page-subtitle { font-size: 0.8rem; color: var(--text-secondary); }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ── PAGE CONTENT ── */
.page-content {
  flex: 1;
  padding: 24px;
}

/* ── STAT CARDS ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition);
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gold);
}

.stat-card.danger::before { background: var(--danger); }
.stat-card.success::before { background: var(--success); }
.stat-card.info::before { background: var(--info); }

.stat-card:hover { border-color: var(--gold); }

.stat-card .stat-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 600;
}

.stat-card .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
}

.stat-card .stat-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-card .stat-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.1;
  width: 48px;
  height: 48px;
  stroke: var(--gold);
  fill: none;
}

/* ── CARDS ── */
.card {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--dark-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
}

.card-body { padding: 20px; }

/* ── TABLES ── */
.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead tr {
  background: rgba(107, 30, 46, 0.4);
  border-bottom: 2px solid var(--burgundy-light);
}

thead th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

thead th:hover { color: var(--gold-light); }

thead th.sort-asc::after { content: ' ↑'; color: var(--gold); }
thead th.sort-desc::after { content: ' ↓'; color: var(--gold); }

tbody tr {
  border-bottom: 1px solid rgba(255,255,255,0.04);
  transition: background var(--transition);
}

tbody tr:hover { background: var(--dark-hover); }

tbody td {
  padding: 10px 14px;
  vertical-align: middle;
  color: var(--text-primary);
}

.table-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.table-empty svg {
  width: 48px;
  height: 48px;
  stroke: var(--text-muted);
  fill: none;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ── BADGES ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-gold { background: rgba(201, 168, 76, 0.15); color: var(--gold); }
.badge-muted { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.badge-secondary { background: rgba(255,255,255,0.08); color: var(--text-muted); }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

.btn-primary { background: var(--burgundy); color: #fff; }
.btn-primary:hover { background: var(--burgundy-light); }

.btn-gold { background: var(--gold); color: var(--dark-bg); }
.btn-gold:hover { background: var(--gold-light); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--dark-border);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

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

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 6px 10px;
}
.btn-ghost:hover { background: var(--dark-hover); color: var(--text-primary); }

.btn-sm { padding: 5px 10px; font-size: 0.78rem; }
.btn-xs { padding: 3px 8px; font-size: 0.72rem; border-radius: 4px; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── FORMS ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.form-control, .form-select, .form-textarea {
  width: 100%;
  background: var(--dark-bg);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: var(--font);
  transition: border-color var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(201, 168, 76, 0.15);
}

.form-control.error, .form-select.error { border-color: var(--danger); }

.form-select { cursor: pointer; }
.form-select option { background: var(--dark-surface); }

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

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }

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

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(12px);
  transition: transform var(--transition);
}

.modal-overlay.open .modal { transform: translateY(0); }

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

.modal-title { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: all var(--transition);
}

.modal-close:hover { color: var(--text-primary); background: var(--dark-hover); }
.modal-close svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; }

.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--dark-border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── TOASTS ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  min-width: 280px;
  max-width: 400px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  animation: toastIn 0.2s ease;
  border-left: 3px solid var(--info);
}

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

.toast-icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; stroke: currentColor; fill: none; stroke-width: 2; }
.toast.success .toast-icon { color: var(--success); }
.toast.error .toast-icon { color: var(--danger); }
.toast.warning .toast-icon { color: var(--warning); }
.toast.info .toast-icon { color: var(--info); }

.toast-content { flex: 1; }
.toast-title { font-size: 0.85rem; font-weight: 600; margin-bottom: 2px; }
.toast-message { font-size: 0.8rem; color: var(--text-secondary); }

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

@keyframes toastOut {
  to { transform: translateX(20px); opacity: 0; }
}

/* ── FILTERS BAR ── */
.filters-bar {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filters-bar .filter-group { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 140px; }
.filters-bar .filter-group label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); font-weight: 600; }
.filters-bar .filter-actions { display: flex; gap: 8px; align-items: flex-end; padding-bottom: 0; }

/* ── PAGINATION ── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
  padding: 16px 0 4px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--dark-border);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}

.page-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-btn.active { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-info { font-size: 0.8rem; color: var(--text-muted); padding: 0 8px; }

/* ── ACTIVITY FEED ── */
.activity-list { display: flex; flex-direction: column; gap: 0; }

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
}

.activity-dot.inbound, .activity-dot.received { background: var(--success-bg); color: var(--success); }
.activity-dot.outbound, .activity-dot.shipped { background: var(--danger-bg); color: var(--danger); }
.activity-dot.adjustment { background: var(--info-bg); color: var(--info); }

.activity-body { flex: 1; }
.activity-title { font-size: 0.85rem; color: var(--text-primary); }
.activity-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── DASHBOARD GRID ── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.dashboard-grid .full-width { grid-column: 1 / -1; }

/* ── LOW STOCK ALERT ── */
.alert-banner {
  background: var(--warning-bg);
  border: 1px solid rgba(224, 168, 50, 0.3);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--warning);
}

.alert-banner svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }

/* ── SEARCH ── */
.search-input-wrap {
  position: relative;
  flex: 1;
  max-width: 320px;
}

.search-input-wrap svg {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  stroke-width: 2;
  pointer-events: none;
}

.search-input-wrap input {
  padding-left: 34px;
}

/* ── DIVIDER ── */
.divider { border: none; border-top: 1px solid var(--dark-border); margin: 20px 0; }

/* ── LOADING ── */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(201, 168, 76, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  flex-direction: column;
  gap: 12px;
  color: var(--text-muted);
}

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); width: var(--sidebar-width); }
  .main-content { margin-left: 0 !important; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .form-row.three { grid-template-columns: 1fr; }
  .filters-bar { flex-direction: column; }
  .topbar { padding: 0 16px; }
  .page-content { padding: 16px; }
  .mobile-menu-btn { display: flex !important; }
  .topbar-actions { gap: 4px; }
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
  align-items: center;
}

.mobile-menu-btn:hover { background: var(--dark-hover); color: var(--text-primary); }
.mobile-menu-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; }

/* ── REPORTS PAGE ── */
.report-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.report-card {
  background: var(--dark-surface);
  border: 1px solid var(--dark-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: all var(--transition);
  cursor: pointer;
}

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

.report-card-icon {
  width: 48px;
  height: 48px;
  background: rgba(107, 30, 46, 0.3);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid rgba(107, 30, 46, 0.5);
}

.report-card-icon svg { width: 24px; height: 24px; stroke: var(--gold); fill: none; stroke-width: 1.8; }
.report-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.report-card p { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px; }

/* ── MESSAGE LOG ── */
.message-preview {
  font-size: 0.8rem;
  color: var(--text-secondary);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── CUSTOMER CARDS ── */
.customer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* ── NO AUTH PAGE ── */
#login-page { display: block; }
#app-page { display: none; }

.hidden { display: none !important; }

/* ── SKELETON LOADER ── */
.skeleton {
  background: linear-gradient(90deg, var(--dark-border) 25%, var(--dark-hover) 50%, var(--dark-border) 75%);
  background-size: 200% 100%;
  animation: skeleton-wave 1.5s infinite;
  border-radius: 4px;
}

@keyframes skeleton-wave {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

/* ── MOBILE OVERLAY ── */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
}

@media (max-width: 768px) {
  .sidebar-overlay.active { display: block; }
}

/* ── MISC UTILS ── */
.text-gold { color: var(--gold); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.font-mono { font-family: var(--font-mono); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-gap { display: flex; gap: 8px; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.w-full { width: 100%; }
