/* ============================================================
   PRINCE ALEX DIGITAL PAYROLL SAAS
   Master Stylesheet - Premium Enterprise Design System
   ============================================================
   A world-class SaaS UI with Apple-quality design.
   Supports light/dark mode, responsive layouts, animations.
   ============================================================ */

/* ── CSS Variables & Design Tokens ─────────────────────── */
:root {
  /* Brand Colors */
  --brand-primary:       #6366F1;  /* Indigo 500 */
  --brand-primary-dark:  #4F46E5;  /* Indigo 600 */
  --brand-primary-light: #818CF8;  /* Indigo 400 */
  --brand-accent:        #F59E0B;  /* Amber 500 */
  --brand-accent-dark:   #D97706;  /* Amber 600 */

  /* Semantic Colors */
  --success:       #10B981;
  --success-dark:  #059669;
  --danger:        #EF4444;
  --danger-dark:   #DC2626;
  --warning:       #F59E0B;
  --info:          #3B82F6;

  /* Surface Colors (Light) */
  --bg:            #F8FAFC;
  --bg-2:          #F1F5F9;
  --bg-3:          #E2E8F0;
  --card:          #FFFFFF;
  --card-hover:    #FAFBFC;
  --card-border:   #E2E8F0;

  /* Text Colors (Light) */
  --text:          #0F172A;
  --text-2:        #334155;
  --text-3:        #64748B;
  --text-muted:    #94A3B8;
  --text-inverse:  #FFFFFF;

  /* Border Colors */
  --border:        #E2E8F0;
  --border-2:      #CBD5E1;
  --border-light:  #F1F5F9;

  /* Shadows */
  --shadow-xs:     0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:     0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg:     0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
  --shadow-xl:     0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04);
  --shadow-card:   0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.03);

  /* Layout */
  --sidebar-w:     260px;
  --sidebar-collapsed-w: 72px;
  --header-h:      64px;
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     14px;
  --radius-xl:     20px;

  /* Transitions */
  --transition:    0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce:        0.3s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-sans:     'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:     'DM Mono', 'SF Mono', 'Fira Code', monospace;
}

/* ── Dark Mode ─────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:            #020617;
  --bg-2:          #0F172A;
  --bg-3:          #1E293B;
  --card:          #1E293B;
  --card-hover:    #253349;
  --card-border:   #334155;

  --text:          #F1F5F9;
  --text-2:        #CBD5E1;
  --text-3:        #94A3B8;
  --text-muted:    #64748B;

  --border:        #334155;
  --border-2:      #475569;
  --border-light:  #1E293B;

  --shadow-xs:     0 1px 2px rgba(0,0,0,0.2);
  --shadow-sm:     0 1px 3px rgba(0,0,0,0.3);
  --shadow-md:     0 4px 6px rgba(0,0,0,0.3);
  --shadow-lg:     0 10px 15px rgba(0,0,0,0.3);
  --shadow-xl:     0 20px 25px rgba(0,0,0,0.4);
  --shadow-card:   0 1px 3px rgba(0,0,0,0.2);
}

/* ── Reset & Base ──────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  transition: background var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

a { color: var(--brand-primary); text-decoration: none; }
a:hover { color: var(--brand-primary-dark); }

img { max-width: 100%; display: block; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ── Selection ─────────────────────────────────────────── */
::selection { background: var(--brand-primary); color: white; }

/* ============================================================
   LAYOUT
   ============================================================ */

/* ── App Shell ─────────────────────────────────────────── */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  background: linear-gradient(180deg, #0F172A 0%, #1E293B 100%);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--transition-slow), width var(--transition-slow);
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.sidebar-brand-logo {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--brand-accent) 0%, #fb923c 100%);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 10px;
  box-shadow: 0 4px 12px rgba(245,158,11,0.3);
}

.sidebar-brand h2 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.3px;
}

.sidebar-brand p {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
  margin-top: 2px;
}

/* ── Navigation ────────────────────────────────────────── */
.nav-section {
  padding: 12px 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-category {
  color: rgba(255,255,255,0.25);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 0 20px 6px;
  margin-top: 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 20px;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 13.5px;
  font-weight: 500;
  margin: 1px 8px;
  border-radius: 10px;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: #fff;
}

.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--brand-accent);
  border-radius: 0 3px 3px 0;
}

.nav-item .ni {
  font-size: 16px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-badge {
  margin-left: auto;
  background: var(--brand-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  min-width: 18px;
  text-align: center;
}

/* ── Sidebar Footer ────────────────────────────────────── */
.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sidebar-footer-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--brand-primary), #7C3AED);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

.sidebar-footer-info {
  flex: 1;
  overflow: hidden;
}

.sidebar-footer-info strong {
  color: #fff;
  font-size: 12px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer-info span {
  color: rgba(255,255,255,0.35);
  font-size: 10px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Main Content ──────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}

/* ── Topbar ────────────────────────────────────────────── */
.topbar {
  height: var(--header-h);
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  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;
}

[data-theme="dark"] .topbar {
  background: rgba(15,23,42,0.8);
  border-bottom-color: var(--border);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-title {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-btn {
  display: none;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all var(--transition);
}

.menu-btn:hover {
  background: var(--bg-3);
}

.topbar-date {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-2);
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* ── Content Area ──────────────────────────────────────── */
.content {
  padding: 28px 30px;
  flex: 1;
}

.section {
  display: none;
  animation: sectionEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.section.active {
  display: block;
}

@keyframes sectionEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   COMPONENTS
   ============================================================ */

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-sans);
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
  line-height: 1.4;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
  box-shadow: 0 2px 4px rgba(99,102,241,0.2);
}

.btn-primary:hover {
  background: var(--brand-primary-dark);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: #fff;
  box-shadow: 0 2px 4px rgba(16,185,129,0.2);
}

.btn-success:hover {
  background: var(--success-dark);
  transform: translateY(-1px);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--bg-2);
  border-color: var(--text-3);
}

.btn-ghost {
  background: var(--bg-2);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--bg-3);
}

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-xs { padding: 4px 9px; font-size: 11px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; border-radius: 12px; }
.btn-icon { padding: 8px; border-radius: 8px; }
.btn-block { width: 100%; justify-content: center; }

/* ── Stat Cards ────────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.sc-blue::after { background: linear-gradient(90deg, #3B82F6, #6366F1); }
.sc-green::after { background: linear-gradient(90deg, #10B981, #059669); }
.sc-red::after { background: linear-gradient(90deg, #EF4444, #DC2626); }
.sc-amber::after { background: linear-gradient(90deg, #F59E0B, #D97706); }
.sc-purple::after { background: linear-gradient(90deg, #8B5CF6, #7C3AED); }
.sc-pink::after { background: linear-gradient(90deg, #EC4899, #DB2777); }

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin-bottom: 14px;
}

.sc-blue .stat-icon { background: #DBEAFE; color: #2563EB; }
.sc-green .stat-icon { background: #D1FAE5; color: #059669; }
.sc-red .stat-icon { background: #FEE2E2; color: #DC2626; }
.sc-amber .stat-icon { background: #FEF3C7; color: #D97706; }
.sc-purple .stat-icon { background: #EDE9FE; color: #7C3AED; }
.sc-pink .stat-icon { background: #FCE7F3; color: #DB2777; }

[data-theme="dark"] .sc-blue .stat-icon { background: rgba(37,99,235,0.15); color: #60A5FA; }
[data-theme="dark"] .sc-green .stat-icon { background: rgba(16,185,129,0.15); color: #34D399; }
[data-theme="dark"] .sc-red .stat-icon { background: rgba(239,68,68,0.15); color: #F87171; }
[data-theme="dark"] .sc-amber .stat-icon { background: rgba(245,158,11,0.15); color: #FCD34D; }
[data-theme="dark"] .sc-purple .stat-icon { background: rgba(139,92,246,0.15); color: #A78BFA; }
[data-theme="dark"] .sc-pink .stat-icon { background: rgba(236,72,153,0.15); color: #F472B6; }

.stat-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.stat-value {
  font-size: 24px;
  font-weight: 700;
  margin: 6px 0 3px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.sc-blue .stat-value { color: #2563EB; }
.sc-green .stat-value { color: #059669; }
.sc-red .stat-value { color: #DC2626; }
.sc-amber .stat-value { color: #D97706; }
.sc-purple .stat-value { color: #7C3AED; }
.sc-pink .stat-value { color: #DB2777; }

[data-theme="dark"] .sc-blue .stat-value { color: #60A5FA; }
[data-theme="dark"] .sc-green .stat-value { color: #34D399; }
[data-theme="dark"] .sc-red .stat-value { color: #F87171; }
[data-theme="dark"] .sc-amber .stat-value { color: #FCD34D; }
[data-theme="dark"] .sc-purple .stat-value { color: #A78BFA; }
[data-theme="dark"] .sc-pink .stat-value { color: #F472B6; }

.stat-sub {
  font-size: 11.5px;
  color: var(--text-muted);
}

.stat-trend {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

.stat-trend.up { color: var(--success); }
.stat-trend.down { color: var(--danger); }

/* ── Table Container ───────────────────────────────────── */
.table-wrap {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  margin-bottom: 24px;
}

.table-head {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 14px;
  flex-wrap: wrap;
}

.table-head h3 {
  font-size: 15px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  background: var(--bg-2);
  padding: 11px 18px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}

tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--card-hover); transition: background 0.15s ease; }

/* ── Badges & Pills ────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  gap: 4px;
  white-space: nowrap;
}

.badge-blue { background: #DBEAFE; color: #1D4ED8; }
.badge-green { background: #D1FAE5; color: #065F46; }
.badge-amber { background: #FEF3C7; color: #92400E; }
.badge-red { background: #FEE2E2; color: #991B1B; }
.badge-purple { background: #EDE9FE; color: #6D28D9; }
.badge-gray { background: #F3F4F6; color: #374151; }

[data-theme="dark"] .badge-blue { background: rgba(37,99,235,0.2); color: #93C5FD; }
[data-theme="dark"] .badge-green { background: rgba(16,185,129,0.2); color: #6EE7B7; }
[data-theme="dark"] .badge-amber { background: rgba(245,158,11,0.2); color: #FCD34D; }
[data-theme="dark"] .badge-red { background: rgba(239,68,68,0.2); color: #FCA5A5; }
[data-theme="dark"] .badge-purple { background: rgba(139,92,246,0.2); color: #C4B5FD; }
[data-theme="dark"] .badge-gray { background: rgba(156,163,175,0.2); color: #D1D5DB; }

/* ── Search Input ──────────────────────────────────────── */
.search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.search-box .search-icon {
  position: absolute;
  left: 11px;
  font-size: 13px;
  pointer-events: none;
  color: var(--text-muted);
}

.search-input {
  padding: 8px 12px 8px 34px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-sans);
  width: 240px;
  transition: all var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--brand-primary);
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.search-input::placeholder { color: var(--text-muted); }

/* ── Form Inputs ───────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group.col-span-2 { grid-column: 1 / -1; }
.form-group.col-span-3 { grid-column: span 3; }

label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  letter-spacing: 0.2px;
}

label .req { color: var(--danger); margin-left: 2px; }

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
select,
textarea {
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-sans);
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
  background: var(--card);
}

input.error { border-color: var(--danger); }
input.success { border-color: var(--success); }

textarea {
  resize: vertical;
  min-height: 80px;
}

.form-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 6px 0;
}

.form-divider span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  white-space: nowrap;
}

.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.form-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: modalIn 0.3s var(--bounce);
}

@keyframes modalIn {
  from { transform: scale(0.92) translateY(-20px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-inner { padding: 28px; }
.modal-sm { max-width: 420px; }
.modal-md { max-width: 560px; }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }
.modal-full { max-width: 95vw; }

.modal-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-hdr h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-2);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.modal-close-btn:hover {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}

/* ── Toast Notifications ───────────────────────────────── */
#toastZone {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  min-width: 300px;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  animation: toastIn 0.35s var(--bounce), toastOut 0.3s ease 2.7s forwards;
  pointer-events: all;
  backdrop-filter: blur(8px);
}

.toast-success { background: linear-gradient(135deg, #059669, #10B981); }
.toast-error { background: linear-gradient(135deg, #DC2626, #EF4444); }
.toast-info { background: linear-gradient(135deg, #1D4ED8, #3B82F6); }
.toast-warning { background: linear-gradient(135deg, #D97706, #F59E0B); }

.toast-icon { font-size: 18px; flex-shrink: 0; }

@keyframes toastIn {
  from { transform: translateX(100px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  to { transform: translateX(100px); opacity: 0; }
}

/* ── Loading States ────────────────────────────────────── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--brand-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Skeleton Loading ──────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--bg-3) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-line {
  height: 14px;
  margin-bottom: 8px;
  width: 100%;
}

.skeleton-line.w-75 { width: 75%; }
.skeleton-line.w-50 { width: 50%; }
.skeleton-line.w-25 { width: 25%; }

.skeleton-card {
  height: 120px;
  margin-bottom: 16px;
}

/* ── Empty State ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-muted);
}

.empty-state .es-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  opacity: 0.6;
}

.empty-state p {
  font-size: 15px;
  font-weight: 500;
}

.empty-state small {
  font-size: 12px;
  opacity: 0.7;
  margin-top: 6px;
  display: block;
}

/* ── Action Bar ────────────────────────────────────────── */
.action-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* ── Payroll Calculator ────────────────────────────────── */
.calc-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 24px;
}

.calc-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.calc-inputs {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.calc-extras {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.result-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-top: 18px;
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.result-header h4 { font-size: 14px; font-weight: 700; }

.result-section { margin-bottom: 6px; }

.result-section-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-muted);
  padding: 6px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}

.result-row.subtotal {
  font-weight: 700;
  border-top: 1px dashed var(--border);
  margin-top: 3px;
  padding-top: 7px;
}

.result-row.net-pay {
  background: linear-gradient(135deg, var(--success), #059669);
  color: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  font-weight: 800;
  font-size: 15px;
  margin-top: 12px;
}

.amount { font-family: var(--font-mono); font-size: 12.5px; }
.amount.deduction { color: var(--danger); }
.amount.positive { color: var(--success); }

/* ── Payslip Card ──────────────────────────────────────── */
.slip-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), box-shadow var(--transition);
  gap: 14px;
}

.slip-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.slip-card-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.slip-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-primary), #7C3AED);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.slip-card-info h4 {
  font-size: 14px;
  font-weight: 700;
}

.slip-card-info p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.slip-card-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.slip-net { text-align: right; }

.slip-net strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--success);
}

.slip-net small {
  font-size: 11px;
  color: var(--text-muted);
}

/* ── Payslip Preview ───────────────────────────────────── */
.payslip-preview {
  background: #fff;
  color: #000;
  font-size: 11.5px;
  line-height: 1.4;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #ddd;
}

.ps-header {
  background: #1B3B6F;
  color: #fff;
  text-align: center;
  padding: 20px 24px 16px;
}

.ps-company-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
}

.ps-company-sub { font-size: 11px; opacity: 0.7; }

.ps-title {
  background: #F59E0B;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 8px;
  letter-spacing: 0.5px;
}

.ps-employee-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1.5px solid #1B3B6F;
}

.ps-emp-col { padding: 14px 18px; }
.ps-emp-col:first-child { border-right: 1px solid #e5e7eb; }

.ps-emp-row {
  display: flex;
  gap: 6px;
  padding: 3px 0;
  font-size: 11.5px;
}

.ps-emp-row .ps-label {
  color: #6b7280;
  font-weight: 600;
  min-width: 90px;
}

.ps-emp-row .ps-val { font-weight: 500; }

.ps-body { display: grid; grid-template-columns: 1fr 1fr; }
.ps-col { border-right: 1px solid #e5e7eb; }
.ps-col:last-child { border-right: none; }

.ps-section-title {
  background: #f3f4f6;
  padding: 6px 14px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #374151;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}

.ps-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 14px;
  font-size: 11.5px;
}

.ps-row:nth-child(even) { background: #f9fafb; }

.ps-row.ps-subtotal {
  font-weight: 700;
  background: #e9ecef !important;
  border-top: 1.5px solid #cbd5e1;
  padding: 7px 14px;
}

.ps-amount { font-family: var(--font-mono); font-size: 11px; }

.ps-net-pay {
  background: #1B3B6F;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 800;
}

.ps-net-amount { font-family: var(--font-mono); font-size: 18px; }

.ps-footer {
  background: #f9fafb;
  border-top: 1px solid #e5e7eb;
  padding: 14px 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  font-size: 10.5px;
  color: #6b7280;
}

.ps-footer div strong {
  display: block;
  color: #374151;
  font-size: 11px;
  margin-bottom: 1px;
}

.ps-footer-note {
  grid-column: 1 / -1;
  text-align: center;
  margin-top: 6px;
  font-size: 10px;
  color: #9ca3af;
  font-style: italic;
}

/* ── Login Section ─────────────────────────────────────── */
#loginSection {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.login-card {
  background: var(--card);
  padding: 44px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 420px;
  text-align: center;
  border: 1px solid var(--border);
}

.login-card h2 {
  margin-bottom: 8px;
  font-size: 26px;
  color: var(--text);
  font-weight: 700;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 14px;
}

.login-divider {
  display: flex;
  align-items: center;
  margin: 22px 0;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-divider::before,
.login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-divider span { padding: 0 12px; }

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #fff;
  color: #1e293b;
  border: 1.5px solid var(--border);
  padding: 12px;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
  font-size: 13px;
}

.btn-google:hover {
  background: var(--bg-2);
  border-color: var(--border-2);
}

.btn-google img { width: 18px; height: 18px; }

.login-card input {
  width: 100%;
  padding: 12px 16px;
  font-size: 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-2);
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.login-card input:focus {
  border-color: var(--brand-primary);
  background: var(--card);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
  outline: none;
}

/* ── Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-2);
  padding: 4px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.tab {
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-3);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: transparent;
  font-family: var(--font-sans);
}

.tab:hover { color: var(--text); }

.tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* ── Dark Mode Toggle ──────────────────────────────────── */
.dark-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  transition: all var(--transition);
  font-family: var(--font-sans);
}

.dark-toggle:hover { background: var(--bg-3); }

/* ── Filter Dropdown ───────────────────────────────────── */
.filter-select {
  padding: 7px 12px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--bg-2);
  color: var(--text);
  font-size: 12.5px;
  font-family: var(--font-sans);
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--brand-primary);
}

/* ── Pagination ────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 20px;
  justify-content: center;
}

.page-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.page-btn:hover { background: var(--bg-2); }
.page-btn.active { background: var(--brand-primary); color: #fff; border-color: var(--brand-primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Stats Grid (3 columns) ────────────────────────────── */
.stats-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

/* ── Chart Container ───────────────────────────────────── */
.chart-container {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.chart-container h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.chart-box {
  width: 100%;
  height: 280px;
  position: relative;
}

/* ── Avatar ────────────────────────────────────────────── */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  flex-shrink: 0;
}

.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 72px; height: 72px; font-size: 26px; }

/* ── Progress Bar ──────────────────────────────────────── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-2);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s ease;
}

.progress-fill.blue { background: var(--brand-primary); }
.progress-fill.green { background: var(--success); }
.progress-fill.amber { background: var(--brand-accent); }
.progress-fill.red { background: var(--danger); }

/* ── Tooltip ───────────────────────────────────────────── */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) scale(0.9);
  background: var(--text);
  color: var(--text-inverse);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

/* ── Dropdown Menu ─────────────────────────────────────── */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 180px;
  padding: 6px;
  z-index: 50;
  display: none;
  animation: dropdownIn 0.15s ease;
}

@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.dropdown.open .dropdown-menu { display: block; }

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease;
  border: none;
  background: transparent;
  width: 100%;
  font-family: var(--font-sans);
  text-align: left;
}

.dropdown-item:hover { background: var(--bg-2); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-item.danger:hover { background: #FEE2E2; }

[data-theme="dark"] .dropdown-item.danger:hover { background: rgba(239,68,68,0.15); }

/* ── Switch / Toggle ───────────────────────────────────── */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input { opacity: 0; width: 0; height: 0; }

.switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border-2);
  border-radius: 12px;
  transition: all var(--transition);
}

.switch-slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition);
}

.switch input:checked + .switch-slider {
  background: var(--brand-primary);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

/* ── Card Component ────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  padding: 24px;
  margin-bottom: 20px;
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
}

/* ── Grid Layouts ──────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ── Flex Utilities ────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.flex-1 { flex: 1; }
.shrink-0 { flex-shrink: 0; }

/* ── Spacing Utilities ─────────────────────────────────── */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mt-6 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-5 { margin-bottom: 20px; }
.mb-6 { margin-bottom: 24px; }
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }

/* ── Text Utilities ────────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--text-muted); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Color Utilities ───────────────────────────────────── */
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-primary { color: var(--brand-primary); }

/* ── Border Utilities ──────────────────────────────────── */
.border { border: 1px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: 50%; }

/* ── Background Utilities ──────────────────────────────── */
.bg-card { background: var(--card); }
.bg-2 { background: var(--bg-2); }
.bg-3 { background: var(--bg-3); }

/* ── Shadow Utilities ──────────────────────────────────── */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* ── Width Utilities ───────────────────────────────────── */
.w-full { width: 100%; }
.w-auto { width: auto; }

/* ── Divider ───────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

/* ── Status Indicator ──────────────────────────────────── */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.active { background: var(--success); }
.status-dot.inactive { background: var(--text-muted); }
.status-dot.pending { background: var(--warning); }
.status-dot.suspended { background: var(--danger); }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 1024px) {
  .calc-extras { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .calc-extras { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w);
  }

  .sidebar.open { transform: translateX(0); }

  .main { margin-left: 0; }

  .menu-btn { display: flex; }

  .form-grid { grid-template-columns: 1fr; }
  .form-group.col-span-2 { grid-column: 1; }

  .calc-inputs { grid-template-columns: 1fr; }
  .calc-extras { grid-template-columns: 1fr 1fr; }

  .ps-body { grid-template-columns: 1fr; }
  .ps-employee-grid { grid-template-columns: 1fr; }
  .ps-col { border-right: none; border-bottom: 1px solid #e5e7eb; }
  .ps-footer { grid-template-columns: 1fr; }

  .content { padding: 18px; }
  .topbar { padding: 0 18px; }

  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stats-grid-3 { grid-template-columns: 1fr; }

  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .calc-extras { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: 1fr; }
  .topbar-date { display: none; }
  .search-input { width: 160px; }
  .login-card { padding: 28px 20px; }
}