/* ============================================================
   AL SHIFA MANAGEMENT SYSTEM - Master Stylesheet
   Theme: Maroon Red + White + Gold/Yellow
   ============================================================ */

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

/* ============================================================
   CSS VARIABLES - Design Tokens
   ============================================================ */
:root {
  --primary:        #8B0000;
  --primary-dark:   #5a0000;
  --primary-light:  #b30000;
  --primary-glass:  rgba(139,0,0,0.15);
  --accent:         #f0c040;
  --accent-dark:    #c9a000;
  --accent-light:   #ffe580;
  --white:          #ffffff;
  --off-white:      #f8f5f5;
  --bg-page:        #f0ebeb;
  --sidebar-bg:     #1a0000;
  --sidebar-hover:  rgba(240,192,64,0.12);
  --sidebar-active: rgba(240,192,64,0.22);
  --text-dark:      #1a1a2e;
  --text-muted:     #6c757d;
  --text-light:     #adb5bd;
  --border:         #e0d0d0;
  --success:        #198754;
  --danger:         #dc3545;
  --warning:        #fd7e14;
  --info:           #0dcaf0;
  --shadow-sm:      0 2px 8px rgba(139,0,0,0.08);
  --shadow-md:      0 4px 20px rgba(139,0,0,0.14);
  --shadow-lg:      0 8px 40px rgba(139,0,0,0.18);
  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --sidebar-width:  260px;
  --topbar-height:  64px;
  --transition:     all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #3d0000 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(240,192,64,0.12) 0%, transparent 70%);
  top: -150px; right: -150px;
  border-radius: 50%;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  bottom: -100px; left: -100px;
  border-radius: 50%;
}

.login-card {
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.35);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.3);
}

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

.login-logo .brand-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--accent);
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(139,0,0,0.35);
}

.login-logo h1 {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.login-logo p { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

.login-card .form-label {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  font-size: 13px;
}

.login-card .form-control {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 14px;
  transition: var(--transition);
  background: var(--off-white);
}

.login-card .form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glass);
  background: var(--white);
  outline: none;
}

.btn-login {
  width: 100%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.btn-login:hover {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139,0,0,0.35);
}

.alert-danger-custom {
  background: #fff5f5;
  border: 1px solid #fcc;
  border-left: 4px solid var(--danger);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 20px;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--accent);
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(139,0,0,0.4);
}

.sidebar-brand-text h2 {
  font-size: 13px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.sidebar-brand-text span {
  font-size: 10px;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar-section-label {
  padding: 20px 20px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.3);
}

.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 12px; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item svg, .nav-item i { font-size: 16px; flex-shrink: 0; width: 20px; text-align: center; }

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--accent);
  text-decoration: none;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--accent);
  font-weight: 600;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.05);
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: var(--white);
  flex-shrink: 0;
}

.user-info h4 { font-size: 13px; font-weight: 600; color: var(--white); }
.user-info small { font-size: 11px; color: rgba(255,255,255,0.4); text-transform: capitalize; }

.btn-logout {
  margin-top: 8px;
  width: 100%;
  background: rgba(220,53,69,0.15);
  border: 1px solid rgba(220,53,69,0.3);
  color: #ff6b7a;
  border-radius: var(--radius-sm);
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-logout:hover {
  background: rgba(220,53,69,0.25);
  color: #ff6b7a;
}

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

.topbar {
  height: var(--topbar-height);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-title { font-size: 18px; font-weight: 700; color: var(--primary); }
.topbar-subtitle { font-size: 12px; color: var(--text-muted); }

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

.topbar-date {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.btn-topbar {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--off-white);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  font-size: 16px;
}

.btn-topbar:hover { background: var(--primary-glass); color: var(--primary); }

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

.page-header {
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.page-header h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.5px;
}

.page-header p { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

/* ============================================================
   STATS CARDS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--primary);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

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

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

.stat-card-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.stat-card-icon.maroon { background: var(--primary-glass); color: var(--primary); }
.stat-card-icon.gold   { background: rgba(240,192,64,0.15); color: var(--accent-dark); }
.stat-card-icon.green  { background: rgba(25,135,84,0.12); color: var(--success); }
.stat-card-icon.blue   { background: rgba(13,202,240,0.12); color: #0a9aba; }
.stat-card-icon.orange { background: rgba(253,126,20,0.12); color: var(--warning); }
.stat-card-icon.red    { background: rgba(220,53,69,0.12); color: var(--danger); }

.stat-card-label { font-size: 12px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card-value { font-size: 26px; font-weight: 800; color: var(--text-dark); margin-top: 4px; letter-spacing: -0.5px; }
.stat-card-value .currency { font-size: 16px; font-weight: 600; color: var(--text-muted); vertical-align: super; }
.stat-card-change { font-size: 12px; margin-top: 6px; display: flex; align-items: center; gap: 4px; }
.stat-card-change.up { color: var(--success); }
.stat-card-change.down { color: var(--danger); }

/* ============================================================
   FILTER BAR
   ============================================================ */
.filter-bar {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.filter-bar label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.filter-tabs { display: flex; gap: 6px; }

.filter-tab {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--off-white);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab.active, .filter-tab:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

.filter-input {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-dark);
  background: var(--off-white);
  transition: var(--transition);
  font-family: inherit;
}

.filter-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glass);
  background: var(--white);
}

/* ============================================================
   CARDS & PANELS
   ============================================================ */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 22px; }

.charts-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.chart-container { position: relative; height: 280px; }

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
}

table.data-table thead th {
  padding: 13px 16px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  background: var(--off-white);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

table.data-table tbody tr {
  border-bottom: 1px solid #f0e8e8;
  transition: var(--transition);
}

table.data-table tbody tr:hover { background: #fdf8f8; }
table.data-table tbody tr:last-child { border-bottom: none; }

table.data-table tbody td {
  padding: 13px 16px;
  font-size: 13.5px;
  color: var(--text-dark);
  vertical-align: middle;
}

table.data-table tfoot td {
  padding: 13px 16px;
  font-size: 13px;
  font-weight: 700;
  background: var(--off-white);
  border-top: 2px solid var(--border);
}

/* ============================================================
   BADGES & PILLS
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.badge-lab { background: rgba(139,0,0,0.1); color: var(--primary); }
.badge-pharmacy { background: rgba(13,110,253,0.1); color: #0d6efd; }
.badge-pending { background: rgba(253,126,20,0.12); color: #c45e00; }
.badge-partial { background: rgba(13,202,240,0.12); color: #0a9aba; }
.badge-received { background: rgba(25,135,84,0.12); color: var(--success); }
.badge-cash { background: rgba(25,135,84,0.1); color: var(--success); }
.badge-upi { background: rgba(111,66,193,0.1); color: #6f42c1; }
.badge-credit { background: rgba(253,126,20,0.1); color: var(--warning); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: var(--white);
  box-shadow: 0 2px 8px rgba(139,0,0,0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(139,0,0,0.35);
  color: var(--white);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: var(--text-dark);
  box-shadow: 0 2px 8px rgba(240,192,64,0.3);
}

.btn-accent:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(240,192,64,0.4);
  color: var(--text-dark);
}

.btn-success { background: var(--success); color: var(--white); }
.btn-success:hover { background: #157347; color: var(--white); transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: var(--white); }
.btn-danger:hover { background: #b02a37; color: var(--white); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover { background: var(--primary); color: var(--white); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 8px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 40px 80px rgba(0,0,0,0.3);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
}

.modal-overlay.active .modal-box {
  transform: translateY(0) scale(1);
}

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

.modal-header {
  padding: 22px 26px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-close {
  background: rgba(255,255,255,0.15);
  border: none;
  color: var(--white);
  font-size: 18px;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}

.modal-close:hover { background: rgba(255,255,255,0.25); }

.modal-body { padding: 26px; }
.modal-footer {
  padding: 18px 26px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background: var(--off-white);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 18px; }

.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.form-control {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13.5px;
  color: var(--text-dark);
  background: var(--white);
  transition: var(--transition);
  font-family: inherit;
}

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

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

.form-divider {
  border: none;
  border-top: 1.5px dashed var(--border);
  margin: 20px 0;
  position: relative;
}

.form-divider::after {
  content: attr(data-label);
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  background: var(--white);
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-section {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 16px;
}

.form-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.type-option input { display: none; }

.type-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.type-option label:hover { border-color: var(--primary); color: var(--primary); }

.type-option input:checked + label {
  border-color: var(--primary);
  background: var(--primary-glass);
  color: var(--primary);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.14);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  pointer-events: all;
  transform: translateX(120%);
  transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
}

.toast.show { transform: translateX(0); }

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

.toast-icon { font-size: 20px; flex-shrink: 0; }
.toast-body { flex: 1; }
.toast-body .toast-title { font-size: 13.5px; font-weight: 700; color: var(--text-dark); }
.toast-body .toast-msg   { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }

.toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px; padding: 0;
  transition: var(--transition); flex-shrink: 0;
}

.toast-close:hover { color: var(--text-dark); }

/* ============================================================
   LOADING STATES
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, #f0e8e8 25%, #f8f2f2 50%, #f0e8e8 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 6px;
}

@keyframes skeleton-loading {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-spinner {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(139,0,0,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.btn .loading-spinner { width: 14px; height: 14px; border-width: 2px; }

/* ============================================================
   PROGRESS BAR
   ============================================================ */
.progress-bar-container {
  background: var(--border);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  border-radius: 20px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  transition: width 0.6s ease;
}

.progress-bar.gold { background: linear-gradient(90deg, var(--accent-dark), var(--accent)); }
.progress-bar.green { background: linear-gradient(90deg, #0d6830, var(--success)); }

/* ============================================================
   AMOUNT DISPLAY
   ============================================================ */
.amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.amount.positive { color: var(--success); }
.amount.negative { color: var(--danger); }
.amount.neutral  { color: var(--text-dark); }
.amount::before  { content: '₹'; font-size: 0.85em; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 30px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 20px;
  opacity: 0.4;
}

.empty-state h3 { font-size: 18px; font-weight: 700; color: var(--text-dark); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; max-width: 300px; margin: 0 auto; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .charts-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.mobile-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .page-content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .filter-bar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .modal-box { border-radius: var(--radius-md); }
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-maroon  { color: var(--primary) !important; }
.text-accent  { color: var(--accent-dark) !important; }
.text-success { color: var(--success) !important; }
.text-danger  { color: var(--danger) !important; }
.text-muted   { color: var(--text-muted) !important; }
.fw-600       { font-weight: 600 !important; }
.fw-700       { font-weight: 700 !important; }
.fw-800       { font-weight: 800 !important; }
.d-none       { display: none !important; }
.d-flex       { display: flex !important; }
.align-center { align-items: center !important; }
.gap-2        { gap: 8px !important; }
.gap-3        { gap: 12px !important; }
.mt-0         { margin-top: 0 !important; }
.mb-0         { margin-bottom: 0 !important; }
.w-100        { width: 100% !important; }

/* Scrollbar */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--off-white); }
::-webkit-scrollbar-thumb { background: #d0b0b0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }
