/* =============================================
   BILLING — Premium Design System v3.0
   Per-User Custom Theme • Indian SaaS
   ============================================= */

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

/* =============================================
   THEME FOUNDATION — Override via PHP inline style
   ============================================= */
:root {
  /* ---- Primary Brand Color (overridden per user) ---- */
  --primary-h:       24;
  --primary-s:       95%;
  --primary-l:       54%;
  --primary:         hsl(var(--primary-h), var(--primary-s), var(--primary-l));
  --primary-dark:    hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) - 8%));
  --primary-light:   hsl(var(--primary-h), var(--primary-s), calc(var(--primary-l) + 28%));
  --primary-glow:    hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.18);
  --primary-subtle:  hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.10);
  --primary-border:  hsla(var(--primary-h), var(--primary-s), var(--primary-l), 0.35);

  /* ---- Semantic Colors ---- */
  --accent:          #6366F1;
  --success:         #10B981;
  --success-bg:      #ECFDF5;
  --warning:         #F59E0B;
  --warning-bg:      #FFFBEB;
  --danger:          #EF4444;
  --danger-bg:       #FEF2F2;
  --info:            #0EA5E9;
  --info-bg:         #F0F9FF;

  /* ---- Sidebar / Dark Surface ---- */
  --sidebar-bg:      #0B1120;
  --sidebar-hover:   #1a2540;
  --sidebar-active:  var(--primary-subtle);
  --sidebar-border:  var(--primary-border);

  /* ---- Layout ---- */
  --body-bg:         #F0F4F8;
  --card-bg:         #FFFFFF;
  --text-primary:    #0F172A;
  --text-secondary:  #475569;
  --text-muted:      #94A3B8;
  --border-color:    #E2E8F0;
  --border-hover:    #CBD5E1;

  /* ---- Shadows ---- */
  --shadow-xs:   0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg:   0 10px 25px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.05);
  --shadow-xl:   0 20px 40px rgba(0,0,0,0.12), 0 8px 16px rgba(0,0,0,0.06);
  --shadow-glow: 0 4px 20px var(--primary-glow);

  /* ---- Spacing / Shape ---- */
  --radius-xs:   4px;
  --radius-sm:   8px;
  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  /* ---- Dimensions ---- */
  --sidebar-w:   264px;
  --header-h:    60px;
  --transition:  0.2s 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', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--body-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition);
  scrollbar-width: thin;
  scrollbar-color: #1E293B transparent;
  border-right: 1px solid rgba(255,255,255,0.04);
}

.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

/* Sidebar Logo */
.sidebar-logo {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.sidebar-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 17px;
  color: #fff;
  margin-right: 10px;
  box-shadow: 0 4px 12px var(--primary-glow);
  flex-shrink: 0;
}

.sidebar-logo .logo-text {
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.5px;
  font-family: 'Outfit', sans-serif;
}

.sidebar-logo .logo-text span { color: var(--primary); }

.sidebar-logo .logo-tagline {
  font-size: 9.5px;
  color: rgba(255,255,255,0.3);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  display: block;
  margin-top: 1px;
  padding-left: 46px;
}

/* Sidebar Sections */
.sidebar-section { padding: 14px 10px 4px; }

.sidebar-section-title {
  font-size: 9.5px;
  font-weight: 700;
  color: rgba(255,255,255,0.25);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-item-wrapper { margin-bottom: 1px; }

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.58);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all var(--transition);
  position: relative;
  border-left: 3px solid transparent;
}

.sidebar-nav-link:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.sidebar-nav-link.active {
  background: var(--sidebar-active);
  color: var(--primary);
  border-left-color: var(--primary);
}

.sidebar-nav-link .nav-icon {
  width: 17px; height: 17px;
  flex-shrink: 0;
  opacity: 0.75;
}
.sidebar-nav-link:hover .nav-icon { opacity: 1; }
.sidebar-nav-link.active .nav-icon { opacity: 1; }

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

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius);
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}
.sidebar-user:hover { background: rgba(255,255,255,0.08); }

.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.user-info .user-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  line-height: 1.2;
  display: block;
}
.user-info .user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
}

/* Upgrade Banner */
.upgrade-banner {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 10px 10px;
  color: #fff;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.upgrade-banner .icon { font-size: 18px; flex-shrink: 0; }
.upgrade-banner .text { font-size: 11.5px; font-weight: 600; }
.upgrade-banner a { color: #fff; font-weight: 700; text-decoration: underline; font-size: 11.5px; }

/* =============================================
   MAIN LAYOUT
   ============================================= */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  height: var(--header-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 14px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-xs);
}

.topbar-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-right: auto;
}

.topbar-action {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-search { position: relative; width: 220px; }
.topbar-search input {
  width: 100%;
  padding: 7px 12px 7px 34px;
  background: var(--body-bg);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition);
}
.topbar-search input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.topbar-search .search-icon {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%); color: var(--text-muted); font-size: 14px;
}

.topbar-btn {
  width: 34px; height: 34px;
  border-radius: var(--radius-sm);
  background: var(--body-bg);
  border: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-size: 15px;
  position: relative;
}
.topbar-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.notification-dot {
  position: absolute;
  top: 5px; right: 5px;
  width: 7px; height: 7px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid #fff;
}

.main-content {
  flex: 1;
  padding: 22px 24px;
}

/* =============================================
   CARDS
   ============================================= */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body { padding: 20px; }

/* =============================================
   KPI WIDGETS
   ============================================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.kpi-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* KPI colors */
.kpi-card.sales::before        { background: var(--primary); }
.kpi-card.purchases::before    { background: var(--accent); }
.kpi-card.receivables::before  { background: var(--success); }
.kpi-card.payables::before     { background: var(--warning); }
.kpi-card.cash::before         { background: var(--info); }
.kpi-card.overdue::before      { background: var(--danger); }
.kpi-card.stock::before        { background: #8B5CF6; }
.kpi-card.profit::before       { background: var(--success); }

.kpi-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.kpi-card.sales .kpi-icon       { background: var(--primary-subtle); color: var(--primary); }
.kpi-card.purchases .kpi-icon   { background: #EEF2FF; color: var(--accent); }
.kpi-card.receivables .kpi-icon { background: var(--success-bg); color: var(--success); }
.kpi-card.payables .kpi-icon    { background: var(--warning-bg); color: var(--warning); }
.kpi-card.cash .kpi-icon        { background: var(--info-bg); color: var(--info); }
.kpi-card.overdue .kpi-icon     { background: var(--danger-bg); color: var(--danger); }
.kpi-card.stock .kpi-icon       { background: #F5F3FF; color: #8B5CF6; }
.kpi-card.profit .kpi-icon      { background: var(--success-bg); color: var(--success); }

.kpi-body { flex: 1; min-width: 0; }
.kpi-label { font-size: 11.5px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; white-space: nowrap; }
.kpi-value { font-size: 21px; font-weight: 800; color: var(--text-primary); line-height: 1.1; letter-spacing: -0.5px; }
.kpi-sub   { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.kpi-delta {
  font-size: 11px; font-weight: 600;
  padding: 2px 7px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 2px;
}
.kpi-delta.up   { background: var(--success-bg); color: #065f46; }
.kpi-delta.down { background: var(--danger-bg); color: #991B1B; }

/* =============================================
   TABLES
   ============================================= */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead th {
  background: #F8FAFC;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.data-table tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--text-primary);
  vertical-align: middle;
}

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

/* =============================================
   BADGES
   ============================================= */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.bg-success   { background: #DCFCE7 !important; color: #166534 !important; }
.bg-danger    { background: #FEE2E2 !important; color: #991B1B !important; }
.bg-warning   { background: #FEF9C3 !important; color: #854d0e !important; }
.bg-info      { background: #E0F2FE !important; color: #075985 !important; }
.bg-secondary { background: #F1F5F9 !important; color: #475569 !important; }
.bg-primary   { background: var(--primary-subtle) !important; color: var(--primary-dark) !important; }
.bg-dark      { background: #1E293B !important; color: #CBD5E1 !important; }

/* =============================================
   BUTTONS
   ============================================= */
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  color: #fff;
  font-weight: 600;
  font-size: 13.5px;
  padding: 9px 20px;
  border-radius: var(--radius);
  transition: all var(--transition);
  box-shadow: 0 2px 10px var(--primary-glow);
  cursor: pointer;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--primary-glow);
  opacity: 0.95;
  color: #fff;
}
.btn-primary:active { transform: translateY(0); }

.btn-outline-primary {
  border: 1.5px solid var(--primary);
  color: var(--primary);
  background: transparent;
  font-weight: 600;
  font-size: 13.5px;
  padding: 8px 20px;
  border-radius: var(--radius);
  transition: all var(--transition);
  cursor: pointer;
}
.btn-outline-primary:hover {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

.btn-sm { padding: 5px 12px !important; font-size: 12px !important; }
.btn-xs { padding: 3px 8px  !important; font-size: 11px !important; }

.btn-icon {
  width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 18px !important;
}

/* Override Bootstrap's btn-secondary, btn-light, etc. */
.btn-secondary { border-radius: var(--radius) !important; }

/* =============================================
   FORMS
   ============================================= */
.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.form-control, .form-select {
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text-primary);
  background: #fff;
  transition: all var(--transition);
  box-shadow: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  outline: none;
}
.form-control::placeholder { color: var(--text-muted); }

.input-group .form-control { border-radius: 0; }
.input-group .input-group-text {
  background: #F8FAFC;
  border-color: var(--border-color);
  font-size: 14px;
  color: var(--text-secondary);
}

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin: 0;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.breadcrumb {
  background: none; padding: 0; margin: 0; font-size: 12px;
}
.breadcrumb-item a { color: var(--primary); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-secondary); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }

/* =============================================
   STATUS DOT
   ============================================= */
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
}
.status-dot::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* =============================================
   ALERTS / FLASH
   ============================================= */
.alert {
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  padding: 12px 16px;
}
.alert-danger  { background: var(--danger-bg); color: #B91C1C; }
.alert-success { background: var(--success-bg); color: #166534; }
.alert-warning { background: var(--warning-bg); color: #92400E; }
.alert-info    { background: var(--info-bg); color: #0369A1; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state {
  text-align: center;
  padding: 60px 24px;
}
.empty-icon { font-size: 56px; margin-bottom: 16px; opacity: 0.3; }
.empty-title { font-size: 18px; font-weight: 700; color: var(--text-primary); margin-bottom: 8px; }
.empty-subtitle { font-size: 14px; color: var(--text-secondary); }

/* =============================================
   INVOICE SPECIFIC
   ============================================= */
.invoice-item-row input { font-size: 13px; }
.items-table th {
  background: #F8FAFC;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 12px;
}
.items-table td { padding: 8px 12px; vertical-align: middle; }
.items-table .remove-row {
  color: var(--danger); cursor: pointer;
  background: none; border: none; font-size: 18px; line-height: 1;
}
.items-table .remove-row:hover { opacity: 0.7; }
.invoice-summary { border-top: 2px solid var(--border-color); padding-top: 16px; }
.invoice-summary .summary-row {
  display: flex; justify-content: space-between;
  padding: 6px 0; font-size: 14px;
}
.invoice-summary .summary-row.total {
  font-weight: 800; font-size: 18px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px; margin-top: 8px;
  color: var(--primary);
}

/* =============================================
   AUTH LAYOUT
   ============================================= */
.auth-page {
  min-height: 100vh;
  background: radial-gradient(ellipse at 0% 0%, #0D1B2A 0%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: '';
  position: absolute;
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  top: -300px; right: -200px;
  border-radius: 50%;
  pointer-events: none;
}
.auth-page::after {
  content: '';
  position: absolute;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(99,102,241,0.08) 0%, transparent 70%);
  bottom: -100px; left: -150px;
  border-radius: 50%;
  pointer-events: none;
}

.auth-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-xl);
  padding: 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
  position: relative;
  z-index: 1;
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon {
  width: 58px; height: 58px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 28px;
  color: #fff;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px var(--primary-glow);
}
.auth-logo h1 {
  font-size: 28px; font-weight: 800;
  color: #fff; letter-spacing: -1px;
  font-family: 'Outfit', sans-serif;
}
.auth-logo h1 span { color: var(--primary); }
.auth-logo p { font-size: 14px; color: #94A3B8; margin-top: 4px; }

.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: var(--text-muted); font-size: 12px;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px;
  background: rgba(255,255,255,0.08);
}

/* Auth form inputs (dark mode) */
.auth-page .form-control, .auth-page .form-select {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
}
.auth-page .form-control:focus {
  background: rgba(255,255,255,0.09);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}
.auth-page .form-control::placeholder { color: rgba(255,255,255,0.3); }
.auth-page .form-label { color: rgba(255,255,255,0.75); }

/* =============================================
   CHART CONTAINERS
   ============================================= */
.chart-container { position: relative; }

/* =============================================
   TOAST / NOTIFICATIONS
   ============================================= */
#toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast-msg {
  background: #1E293B;
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 3px solid var(--primary);
}
.toast-msg.success { background: #064e3b; border-left-color: var(--success); }
.toast-msg.error   { background: #7f1d1d; border-left-color: var(--danger); }
.toast-msg.warning { background: #78350f; border-left-color: var(--warning); }

/* =============================================
   ANIMATIONS
   ============================================= */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(40px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-fade-in-up { animation: fadeInUp 0.4s ease forwards; }
.animate-delay-1 { animation-delay: 0.05s; opacity: 0; }
.animate-delay-2 { animation-delay: 0.10s; opacity: 0; }
.animate-delay-3 { animation-delay: 0.15s; opacity: 0; }
.animate-delay-4 { animation-delay: 0.20s; opacity: 0; }

.skeleton {
  background: linear-gradient(90deg, #F1F5F9 25%, #E8EEFA 50%, #F1F5F9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* =============================================
   PRINT / PDF
   ============================================= */
@media print {
  .sidebar, .topbar, .topbar-action, .no-print,
  .btn, .page-header .btn-primary { display: none !important; }
  .main-wrapper { margin-left: 0; }
  .main-content { padding: 0; }
  body { background: #fff; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1200px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-264px); }
  .sidebar.open { transform: translateX(0); width: 264px; }
  .main-wrapper { margin-left: 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .main-content { padding: 16px; }
  .topbar { padding: 0 14px; }
}
@media (max-width: 480px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px; }
}

/* =============================================
   UTILITIES
   ============================================= */
.text-primary-color { color: var(--primary) !important; }
.text-success-color { color: var(--success) !important; }
.text-danger-color  { color: var(--danger)  !important; }
.text-warning-color { color: var(--warning) !important; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }
.rounded-xl { border-radius: var(--radius-xl) !important; }
.gap-8 { gap: 8px; }
.cursor-pointer { cursor: pointer; }

/* Thin card variant */
.card-flush { border-radius: var(--radius) !important; }
.border-primary-subtle { border-color: var(--primary-border) !important; }
.bg-primary-subtle { background: var(--primary-subtle) !important; color: var(--primary-dark) !important; }

/* =============================================
   THEME PICKER (Settings Page)
   ============================================= */
.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 0 6px;
}

.theme-swatch {
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s ease;
  position: relative;
  outline: none;
  box-shadow: var(--shadow-sm);
}
.theme-swatch:hover {
  transform: scale(1.15);
  box-shadow: var(--shadow-md);
}
.theme-swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 3px var(--primary), var(--shadow-md);
  transform: scale(1.12);
}
.theme-swatch::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.08);
}

/* Custom color input wrapper */
.custom-color-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.custom-color-wrap input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  background: none;
  box-shadow: var(--shadow-sm);
}
.custom-color-wrap input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.custom-color-wrap input[type="color"]::-webkit-color-swatch { border: 2px solid #e2e8f0; border-radius: 50%; }

/* =============================================
   LANDING & PUBLIC COMPONENTS
   ============================================= */
:root {
  --lp-primary: #4f46e5;
  --lp-primary-glow: rgba(79, 70, 229, 0.4);
  --lp-secondary: #0ea5e9;
  --lp-gradient-accent: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  --lp-glass-bg: rgba(30, 41, 59, 0.7);
  --lp-glass-border: rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 12px !important;
  text-decoration: none !important;
}
.logo-icon {
  width: 36px; height: 36px;
  background: var(--lp-gradient-accent);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 20px; color: white;
  box-shadow: 0 4px 15px var(--lp-primary-glow);
}
.logo-text {
  font-size: 26px !important;
  font-weight: 700 !important;
  color: white !important;
  letter-spacing: -0.5px !important;
  font-family: 'Outfit', sans-serif !important;
}
.logo-text span { color: var(--lp-secondary) !important; }

.navbar {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 18px 6% !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  border-bottom: 1px solid var(--lp-glass-border) !important;
  background: rgba(2, 6, 23, 0.75) !important;
  transition: all 0.3s ease;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 999;
}
.nav-actions {
  display: flex !important;
  gap: 16px !important;
  align-items: center !important;
}
.nav-mobile-toggle {
  display: none;
  background: none; border: none; color: #fff; font-size: 24px; cursor: pointer;
}
@media (max-width: 991px) {
  .nav-mobile-toggle { display: block !important; }
  .nav-actions {
    position: absolute;
    top: 100%; left: 0; width: 100%;
    background: rgba(2, 6, 23, 0.97);
    flex-direction: column; padding: 20px; gap: 12px;
    border-bottom: 1px solid var(--lp-glass-border);
    display: none !important;
  }
  .nav-actions.show { display: flex !important; }
}

/* =============================================
   LANDING FOOTER
   ============================================= */
.landing-footer {
  background: #020617;
  padding: 80px 6% 40px;
  border-top: 1px solid rgba(255,255,255,0.05);
  color: #94A3B8;
  position: relative;
  z-index: 10;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 60px;
  max-width: 1200px;
  margin: 0 auto 60px;
}
.footer-brand .logo { margin-bottom: 20px; }
.footer-brand p { max-width: 300px; font-size: 15px; line-height: 1.6; }
.footer-title { color: #fff; font-weight: 700; font-size: 15px; margin-bottom: 20px; }
.footer-links { list-style: none; padding: 0; }
.footer-links li { margin-bottom: 10px; }
.footer-links a {
  color: #94A3B8; text-decoration: none; font-size: 14px; transition: color 0.2s;
}
.footer-links a:hover { color: var(--lp-primary); }
.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 20px; font-size: 13px;
}
.made-in-india {
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.03);
  padding: 6px 12px; border-radius: 50px;
  border: 1px solid rgba(255,255,255,0.05);
}
.landing-footer .social-link {
  width: 40px !important; height: 40px !important;
  background: rgba(255,255,255,0.05) !important;
  backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  border-radius: 12px !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  color: #94A3B8 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  text-decoration: none;
}
.landing-footer .social-link:hover {
  background: var(--lp-gradient-accent) !important;
  color: #fff !important;
  transform: translateY(-5px) !important;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3) !important;
  border-color: transparent !important;
}
.footer-newsletter-input {
  flex: 1; min-width: 250px;
  background: rgba(255,255,255,0.03) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  color: #fff !important;
  border-radius: 50px !important;
  padding: 14px 24px !important;
  transition: all 0.3s ease !important;
}
.footer-newsletter-input:focus {
  border-color: var(--lp-primary) !important;
  background: rgba(255,255,255,0.06) !important;
  box-shadow: 0 0 0 4px var(--lp-primary-glow) !important;
}

@media (max-width: 991px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 576px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}
