/* ============================================================
   GHALA MANDI ERP — Premium Dark Theme
   ============================================================ */
:root {
  --primary: #16a34a;
  --primary-light: #22c55e;
  --primary-dark: #15803d;
  --primary-glow: rgba(34,197,94,0.18);
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --danger: #ef4444;
  --danger-light: #fca5a5;
  --info: #3b82f6;
  --info-light: #93c5fd;
  --purple: #8b5cf6;
  --bg-base: #0a0f1e;
  --bg-card: #111827;
  --bg-card2: #1a2235;
  --bg-input: #1e2a3a;
  --bg-sidebar: #0d1424;
  --border: rgba(255,255,255,0.07);
  --border-active: rgba(34,197,94,0.4);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 24px rgba(34,197,94,0.15);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --sidebar-w: 260px;
  --topbar-h: 68px;
  --transition: 0.22s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Login ─────────────────────────────────────── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 20% 50%, #0d2218 0%, var(--bg-base) 60%);
}

.login-bg-anim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 10% 20%, rgba(34,197,94,0.08) 0%, transparent 50%),
    radial-gradient(circle at 90% 80%, rgba(245,158,11,0.06) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(16,163,74,0.05) 0%, transparent 70%);
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  from { opacity: 0.7; }
  to   { opacity: 1; }
}

.login-card {
  width: 420px;
  max-width: 95vw;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(34,197,94,0.1);
  position: relative;
  z-index: 10;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 36px;
}

.logo-icon {
  font-size: 54px;
  margin-bottom: 10px;
  display: block;
  filter: drop-shadow(0 0 20px rgba(34,197,94,0.5));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.login-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-top: 4px;
}

.login-form .form-group { margin-bottom: 20px; }

.login-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.input-icon-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  font-size: 1rem;
  z-index: 1;
  pointer-events: none;
}

.input-icon-wrap input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.input-icon-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-login {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all var(--transition);
  letter-spacing: 0.02em;
  margin-top: 10px;
  box-shadow: 0 4px 20px rgba(22,163,74,0.35);
}

.btn-login:hover {
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 6px 28px rgba(22,163,74,0.5);
  transform: translateY(-1px);
}

.login-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 14px;
}

/* ── Main App Layout ───────────────────────────── */
.main-app { display: flex; min-height: 100vh; }
.hidden { display: none !important; }

/* ── Sidebar ───────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
}

.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .nav-label,
.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .sidebar-logo div,
.sidebar.collapsed .btn-logout span:last-child { display: none; }
.sidebar.collapsed .sidebar-logo { justify-content: center; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 12px 0; }
.sidebar.collapsed .nav-icon { margin: 0; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.sidebar-logo span { font-size: 1.5rem; flex-shrink: 0; }
.sidebar-logo strong { display: block; font-size: 0.94rem; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.sidebar-logo small  { font-size: 0.72rem; color: var(--primary-light); font-weight: 500; }

.sidebar-toggle {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 6px;
  font-size: 1rem;
  flex-shrink: 0;
  transition: all var(--transition);
}
.sidebar-toggle:hover { background: var(--primary-glow); color: var(--primary-light); border-color: var(--border-active); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.nav-section { margin-bottom: 4px; }

.nav-section-title {
  display: block;
  padding: 8px 18px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  white-space: nowrap;
}

.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary-glow);
  color: var(--primary-light);
  border-left-color: var(--primary-light);
  font-weight: 600;
}

.nav-icon { font-size: 1.05rem; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border);
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(239,68,68,0.1);
  color: var(--danger-light);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
}
.btn-logout:hover { background: rgba(239,68,68,0.2); border-color: var(--danger); }
.btn-logout span:first-child { flex-shrink: 0; }

/* ── Main Content ──────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition);
}
.sidebar.collapsed ~ .main-content { margin-left: 64px; }

/* ── Top Bar ───────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
}

.topbar-left h2 { font-size: 1.25rem; font-weight: 700; }
.breadcrumb { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.unit-display { display: flex; gap: 8px; }

.unit-badge {
  background: var(--primary-glow);
  border: 1px solid var(--border-active);
  color: var(--primary-light);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
}

.topbar-time {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
}

.user-avatar { font-size: 1rem; }

/* ── Page Area ─────────────────────────────────── */
.page-area {
  flex: 1;
  padding: 28px;
  overflow-y: auto;
}

/* ── Cards / Stats ─────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition);
  cursor: default;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-color, var(--primary));
  border-radius: var(--radius) var(--radius) 0 0;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
  border-color: rgba(255,255,255,0.12);
}

.stat-icon {
  font-size: 2rem;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.stat-change {
  font-size: 0.75rem;
  color: var(--primary-light);
  font-weight: 600;
}

/* ── Section Cards ─────────────────────────────── */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title span { font-size: 1.2rem; }

/* ── Buttons ───────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  font-family: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary  { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; box-shadow: 0 2px 10px rgba(22,163,74,0.3); }
.btn-primary:hover  { background: linear-gradient(135deg, var(--primary-light), var(--primary)); box-shadow: 0 4px 16px rgba(22,163,74,0.45); transform: translateY(-1px); }
.btn-accent   { background: linear-gradient(135deg, var(--accent), #d97706); color: #fff; box-shadow: 0 2px 10px rgba(245,158,11,0.3); }
.btn-accent:hover   { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(245,158,11,0.45); }
.btn-danger   { background: linear-gradient(135deg, var(--danger), #b91c1c); color: #fff; }
.btn-danger:hover   { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(239,68,68,0.4); }
.btn-info     { background: linear-gradient(135deg, var(--info), #1d4ed8); color: #fff; }
.btn-info:hover     { transform: translateY(-1px); }
.btn-purple   { background: linear-gradient(135deg, var(--purple), #6d28d9); color: #fff; }
.btn-purple:hover   { transform: translateY(-1px); }
.btn-outline  { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover  { border-color: var(--primary); color: var(--primary-light); background: var(--primary-glow); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }

/* ── Tables ────────────────────────────────────── */
.table-wrap { overflow-x: auto; border-radius: var(--radius-sm); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

thead th {
  background: var(--bg-card2);
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
tbody tr:hover { background: rgba(255,255,255,0.025); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 12px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-green  { background: rgba(34,197,94,0.15);  color: var(--primary-light); border: 1px solid rgba(34,197,94,0.25); }
.badge-red    { background: rgba(239,68,68,0.15);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.25); }
.badge-yellow { background: rgba(245,158,11,0.15); color: var(--accent-light); border: 1px solid rgba(245,158,11,0.25); }
.badge-blue   { background: rgba(59,130,246,0.15); color: var(--info-light); border: 1px solid rgba(59,130,246,0.25); }
.badge-purple { background: rgba(139,92,246,0.15); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.25); }

/* ── Forms ─────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.form-grid-2 { grid-template-columns: repeat(2, 1fr); }
.form-grid-3 { grid-template-columns: repeat(3, 1fr); }

.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group select option { background: var(--bg-card2); }

.form-group textarea { resize: vertical; min-height: 80px; }

.form-group input[readonly] {
  color: var(--primary-light);
  font-weight: 600;
  cursor: default;
}

.input-unit {
  display: flex;
  gap: 0;
}
.input-unit input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-unit select { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; width: auto; min-width: 80px; border-left: none; }

/* ── Unit Converter Widget ─────────────────────── */
.unit-converter-box {
  background: var(--bg-card2);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.uc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.uc-val { font-size: 1.1rem; font-weight: 800; color: var(--primary-light); }
.uc-lbl { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.uc-sep { font-size: 1.2rem; color: var(--text-muted); }

/* ── Dashboard Grid ────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 22px;
}
@media(max-width:900px){ .dash-grid { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

.chart-card h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-placeholder { height: 220px; position: relative; }

/* ── Alert Box ─────────────────────────────────── */
.alert-list { display: flex; flex-direction: column; gap: 10px; }

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.2);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
}
.alert-item span:first-child { font-size: 1.2rem; }

/* ── Modal ─────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  animation: modalSlide 0.25s ease;
}
.modal.modal-lg { max-width: 900px; }
.modal.modal-sm { max-width: 440px; }

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.94) translateY(-20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 { font-size: 1rem; font-weight: 700; }

.modal-close {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  width: 30px; height: 30px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all var(--transition);
}
.modal-close:hover { background: rgba(239,68,68,0.15); color: var(--danger-light); border-color: var(--danger); }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Toast ─────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  max-width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease;
  border-left: 3px solid var(--primary);
}

.toast.toast-success { border-left-color: var(--primary); }
.toast.toast-error   { border-left-color: var(--danger); }
.toast.toast-warning { border-left-color: var(--accent); }
.toast.toast-info    { border-left-color: var(--info); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Search & Filter Bar ───────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 9px 14px 9px 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }

/* ── Pagination ────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
}

.pg-btn {
  width: 34px; height: 34px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.pg-btn:hover { border-color: var(--primary); color: var(--primary-light); }
.pg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ── Thermal Print Preview ─────────────────────── */
.thermal-preview {
  font-family: 'Courier New', monospace;
  background: #fff;
  color: #000;
  width: 300px;
  margin: 0 auto;
  padding: 16px 12px;
  font-size: 12px;
  line-height: 1.5;
  border-radius: 4px;
}
.thermal-header { text-align: center; margin-bottom: 8px; }
.thermal-header .co-name { font-size: 14px; font-weight: bold; }
.thermal-divider { border: none; border-top: 1px dashed #000; margin: 6px 0; }
.thermal-row { display: flex; justify-content: space-between; }
.thermal-item { margin: 4px 0; }
.thermal-bold { font-weight: bold; }
.thermal-center { text-align: center; }
.thermal-footer { text-align: center; margin-top: 8px; font-size: 11px; }

/* ── WhatsApp Compose ──────────────────────────── */
.wa-compose {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.wa-preview {
  background: #0a1628;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: #e2e8f0;
  line-height: 1.7;
  white-space: pre-wrap;
  min-height: 120px;
  border: 1px solid rgba(37,211,102,0.2);
}

/* ── Progress Bar ──────────────────────────────── */
.progress-bar-wrap {
  height: 8px;
  background: var(--bg-input);
  border-radius: 20px;
  overflow: hidden;
  flex: 1;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 20px;
  transition: width 0.8s ease;
}

/* ── Tabs ──────────────────────────────────────── */
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 18px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }
.tab-btn.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(22,163,74,0.35); }

/* ── Quick Action Buttons ──────────────────────── */
.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

/* ── Info Row ──────────────────────────────────── */
.info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  margin-bottom: 10px;
}
.info-row .info-label { color: var(--text-muted); font-weight: 600; min-width: 140px; }
.info-row .info-val   { color: var(--text-primary); font-weight: 600; }

/* ── Summary Box ───────────────────────────────── */
.summary-box {
  background: linear-gradient(135deg, var(--bg-card2), rgba(22,163,74,0.06));
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  padding: 20px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.summary-row:last-child { border-bottom: none; }
.summary-row.total {
  font-size: 1rem;
  font-weight: 800;
  color: var(--primary-light);
  margin-top: 4px;
}

/* ── Scrollbar ─────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.15); }

/* ── Responsive ────────────────────────────────── */
@media(max-width:768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .page-area { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
}

/* ── Animations ────────────────────────────────── */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
.pulse { animation: pulse 2s infinite; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* ── Empty State ───────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 14px; display: block; opacity: 0.5; }
.empty-state h3 { font-size: 1rem; margin-bottom: 8px; color: var(--text-secondary); }
.empty-state p  { font-size: 0.84rem; }

/* ── Color Variables for Stat Cards ───────────── */
.stat-green  { --card-color: var(--primary-light); }
.stat-yellow { --card-color: var(--accent); }
.stat-red    { --card-color: var(--danger); }
.stat-blue   { --card-color: var(--info); }
.stat-purple { --card-color: var(--purple); }
.stat-cyan   { --card-color: #06b6d4; }
.stat-pink   { --card-color: #ec4899; }
.stat-orange { --card-color: #f97316; }
