/* ================================================
   RozKharch v2 — Colorful Professional
   Light & Vibrant Finance Dashboard
   ================================================ */

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

:root {
  --bg-base:        #f0f4ff;
  --bg-surface:     #ffffff;
  --bg-raised:      #f5f7ff;
  --bg-overlay:     #eef1fb;
  --bg-hover:       #e4e9f9;
  --accent:         #6c63ff;
  --accent-dim:     rgba(108,99,255,0.10);
  --accent-mid:     #5750e3;
  --blue:           #2196f3;
  --blue-dim:       rgba(33,150,243,0.10);
  --orange:         #ff7043;
  --orange-dim:     rgba(255,112,67,0.10);
  --red:            #e91e63;
  --red-dim:        rgba(233,30,99,0.10);
  --purple:         #9c27b0;
  --purple-dim:     rgba(156,39,176,0.10);
  --green:          #00c853;
  --text-primary:   #1a1d2e;
  --text-secondary: #4a5180;
  --text-muted:     #8891b4;
  --border:         rgba(108,99,255,0.12);
  --border-bright:  rgba(108,99,255,0.28);
  --sidebar-w:      262px;
  --header-h:       64px;
  --shadow-sm:      0 2px 8px rgba(108,99,255,0.10);
  --shadow-md:      0 8px 32px rgba(108,99,255,0.13);
  --shadow-lg:      0 24px 64px rgba(108,99,255,0.16);
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 26px;
  --font: 'Sora', sans-serif;
  --mono: 'JetBrains Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 900px 700px at 15% 0%, rgba(108,99,255,0.07) 0%, transparent 60%),
    radial-gradient(ellipse 700px 900px at 85% 100%, rgba(33,150,243,0.07) 0%, transparent 60%);
  pointer-events: none; z-index: 0;
}

a { text-decoration: none; color: inherit; }
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-hover); border-radius: 4px; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #6c63ff 0%, #5750e3 60%, #4338ca 100%);
  border-right: none;
  min-height: 100vh;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 1000;
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 4px 0 24px rgba(108,99,255,0.25);
}

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

.logo-icon-wrap {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, #fff, rgba(255,255,255,0.85));
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.15);
  flex-shrink: 0;
}

.logo-text-block .logo-name {
  font-size: 1.1rem; font-weight: 800; letter-spacing: -0.5px; color: #fff; line-height: 1;
}
.logo-text-block .logo-sub {
  font-size: 0.62rem; color: rgba(255,255,255,0.6); font-family: var(--mono); letter-spacing: 0.5px; margin-top: 2px;
}

.nav-group-label {
  font-size: 0.62rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: rgba(255,255,255,0.45);
  padding: 18px 20px 6px;
}

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

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  color: rgba(255,255,255,0.7); font-size: 0.855rem; font-weight: 500;
  transition: all 0.18s; cursor: pointer; margin-bottom: 2px;
  position: relative;
}

.nav-item .ni-icon {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 7px; font-size: 0.85rem;
  background: transparent; flex-shrink: 0;
  transition: background 0.18s, color 0.18s;
}

.nav-item:hover { background: rgba(255,255,255,0.12); color: #fff; }
.nav-item:hover .ni-icon { background: rgba(255,255,255,0.1); }

.nav-item.active { color: #fff; background: rgba(255,255,255,0.2); }
.nav-item.active .ni-icon { background: rgba(255,255,255,0.18); color: #fff; }
.nav-item.active::before {
  content: ''; position: absolute;
  left: 0; top: 8px; bottom: 8px;
  width: 3px; background: #fff; border-radius: 0 3px 3px 0;
}

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

.sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: rgba(255,255,255,0.1); margin-bottom: 8px;
  cursor: pointer; transition: background 0.15s;
}
.sb-user:hover { background: rgba(255,255,255,0.18); }

.sb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #fff, #e0d7ff);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.78rem; color: #6c63ff; flex-shrink: 0;
}

.sb-user-info .sb-name { font-size: 0.8rem; font-weight: 600; color: #fff; }
.sb-user-info .sb-email { font-size: 0.68rem; color: rgba(255,255,255,0.55); }

.logout-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--r-sm);
  color: rgba(255,255,255,0.6); font-size: 0.83rem; font-weight: 500;
  transition: all 0.15s; cursor: pointer;
}
.logout-link:hover { background: rgba(255,90,126,0.25); color: #ffb3c6; }

/* ─── MAIN ─── */
.main-wrapper {
  margin-left: var(--sidebar-w); flex: 1;
  min-height: 100vh; display: flex; flex-direction: column;
  position: relative; z-index: 1;
}

.top-header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(24px);
  height: var(--header-h);
  display: flex; align-items: center;
  padding: 0 32px; gap: 14px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(108,99,255,0.08);
}

.menu-toggle {
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text-secondary); width: 36px; height: 36px;
  border-radius: var(--r-sm); display: none;
  align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.85rem; transition: all 0.15s;
}
.menu-toggle:hover { background: var(--bg-overlay); color: var(--text-primary); }

.header-title {
  font-size: 0.92rem; font-weight: 700;
  color: var(--text-primary); flex: 1;
}

.header-right { display: flex; align-items: center; gap: 10px; margin-left: auto; }

.hdr-date {
  font-family: var(--mono); font-size: 0.7rem;
  color: var(--text-muted); background: var(--bg-raised);
  padding: 5px 11px; border-radius: 20px; border: 1px solid var(--border);
}

.hdr-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.75rem; color: #fff;
}

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

/* ─── PAGE HEADER ─── */
.page-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 24px; flex-wrap: wrap; gap: 14px;
}

.page-header h2 {
  font-size: 1.5rem; font-weight: 800;
  letter-spacing: -0.5px; color: var(--text-primary);
}

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

/* ─── STATS GRID ─── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px; margin-bottom: 20px;
}

.stat-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 20px 22px;
  position: relative; overflow: hidden;
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
  cursor: default;
}

.stat-card:hover { transform: translateY(-3px); border-color: var(--border-bright); }

.stat-card::before {
  content: ''; position: absolute;
  bottom: 0; right: 0;
  width: 80px; height: 80px;
  border-radius: 50%; opacity: 0.10;
  transition: transform 0.3s;
}
.stat-card:hover::before { transform: scale(1.3); }

.stat-card::after {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 3px;
  border-radius: 3px 3px 0 0;
  opacity: 1;
}

.stat-card.green::before  { background: #00c853; }
.stat-card.blue::before   { background: var(--blue); }
.stat-card.orange::before { background: var(--orange); }
.stat-card.red::before    { background: var(--red); }
.stat-card.green::after   { background: linear-gradient(90deg, #00c853, #69f0ae); }
.stat-card.blue::after    { background: linear-gradient(90deg, #2196f3, #64b5f6); }
.stat-card.orange::after  { background: linear-gradient(90deg, #ff7043, #ffab91); }
.stat-card.red::after     { background: linear-gradient(90deg, #e91e63, #f48fb1); }

.stat-card.green:hover  { box-shadow: 0 8px 32px rgba(0,200,83,0.18); }
.stat-card.blue:hover   { box-shadow: 0 8px 32px rgba(33,150,243,0.18); }
.stat-card.orange:hover { box-shadow: 0 8px 32px rgba(255,112,67,0.18); }
.stat-card.red:hover    { box-shadow: 0 8px 32px rgba(233,30,99,0.18); }

.stat-top {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 14px;
}

.stat-icon {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.stat-card.green  .stat-icon { background: rgba(0,200,83,0.12); }
.stat-card.blue   .stat-icon { background: rgba(33,150,243,0.12); }
.stat-card.orange .stat-icon { background: rgba(255,112,67,0.12); }
.stat-card.red    .stat-icon { background: rgba(233,30,99,0.12); }

.stat-badge {
  font-family: var(--mono); font-size: 0.65rem; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
}
.stat-badge.up   { background: rgba(0,200,83,0.12); color: #00a844; }
.stat-badge.down { background: rgba(233,30,99,0.12); color: var(--red); }
.stat-badge.neu  { background: var(--bg-overlay); color: var(--text-muted); }

.stat-value {
  font-family: var(--mono);
  font-size: 1.7rem; font-weight: 800;
  letter-spacing: -1px; line-height: 1; margin-bottom: 5px;
}
.stat-card.green  .stat-value { color: #00a844; }
.stat-card.blue   .stat-value { color: #1976d2; }
.stat-card.orange .stat-value { color: #e64a19; }
.stat-card.red    .stat-value { color: #c2185b; }

.stat-label {
  font-size: 0.72rem; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}

/* ─── CARDS ─── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 22px;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: var(--shadow-sm);
}
.card:hover { border-color: var(--border-bright); box-shadow: var(--shadow-md); }

.card-header {
  display: flex; align-items: center;
  justify-content: space-between; margin-bottom: 18px;
}

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

.card-title-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); display: inline-block;
}

/* ─── LAYOUTS ─── */
.grid-2   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-3   { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-2-1 { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; margin-bottom: 14px; }

/* ─── TABLE ─── */
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }

thead th {
  padding: 10px 16px;
  text-align: left; font-size: 0.68rem;
  font-weight: 700; text-transform: uppercase;
  letter-spacing: 1px; color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised); white-space: nowrap;
}

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; }
tbody tr:hover { background: var(--bg-raised); }
tbody tr:last-child { border-bottom: none; }

tbody td {
  padding: 13px 16px; font-size: 0.855rem;
  color: var(--text-secondary); vertical-align: middle;
}

/* ─── BADGES ─── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 0.67rem; font-weight: 700;
  font-family: var(--mono); letter-spacing: 0.5px;
}
.badge-cash       { background: rgba(0,200,83,0.12);    color: #00a844; }
.badge-upi        { background: rgba(33,150,243,0.12);   color: #1976d2; }
.badge-card       { background: rgba(156,39,176,0.12);   color: var(--purple); }
.badge-netbanking { background: rgba(255,112,67,0.12);   color: #e64a19; }
.badge-other      { background: var(--bg-overlay);        color: var(--text-muted); }

/* ─── FORMS ─── */
.form-group { margin-bottom: 16px; }

.form-label {
  display: block; font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 6px;
}

.form-control {
  width: 100%; padding: 10px 13px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--r-sm); font-size: 0.855rem;
  font-family: var(--font); color: var(--text-primary);
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  outline: none;
}
.form-control:focus {
  border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(108,99,255,0.10);
}
.form-control::placeholder { color: var(--text-muted); }
select.form-control {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%238891b4' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
  padding-right: 32px;
}
textarea.form-control { resize: vertical; min-height: 88px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-hint { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* ─── BUTTONS ─── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 18px; border-radius: var(--r-sm);
  font-family: var(--font); font-size: 0.82rem;
  font-weight: 600; border: none; cursor: pointer;
  transition: all 0.18s; white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-mid)); color: #fff; font-weight: 700;
}
.btn-primary:hover {
  background: linear-gradient(135deg, var(--accent-mid), #4338ca); transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(108,99,255,0.35);
}

.btn-blue { background: linear-gradient(135deg, #2196f3, #1976d2); color: #fff; font-weight: 700; }
.btn-blue:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-success { background: linear-gradient(135deg, #00c853, #00a844); color: #fff; font-weight: 700; }
.btn-success:hover { opacity: 0.88; transform: translateY(-1px); }

.btn-danger {
  background: var(--red-dim); color: var(--red);
  border: 1px solid rgba(233,30,99,0.2);
}
.btn-danger:hover { background: rgba(233,30,99,0.18); }

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

.btn-sm { padding: 7px 13px; font-size: 0.76rem; }
.btn-lg { padding: 12px 26px; font-size: 0.9rem; }

/* ─── PROGRESS ─── */
.progress-wrap {
  background: var(--bg-overlay); border-radius: 20px;
  height: 5px; overflow: hidden; margin: 6px 0;
}
.progress-fill {
  height: 100%; border-radius: 20px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}
.progress-fill.green  { background: linear-gradient(90deg, #00c853, #69f0ae); }
.progress-fill.yellow { background: linear-gradient(90deg, #ffc107, #ffd54f); }
.progress-fill.red    { background: linear-gradient(90deg, var(--red), #f48fb1); }

/* ─── EXPENSE ITEMS ─── */
.expense-item {
  display: flex; align-items: center; gap: 13px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  transition: padding-left 0.15s;
}
.expense-item:last-child { border-bottom: none; }
.expense-item:hover { padding-left: 4px; }

.expense-icon-wrap {
  width: 38px; height: 38px; background: var(--bg-raised);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; flex-shrink: 0; border: 1px solid var(--border);
}

.expense-info { flex: 1; min-width: 0; }
.expense-title {
  font-weight: 600; font-size: 0.855rem; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.expense-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
.expense-amount { font-family: var(--mono); font-weight: 700; font-size: 0.875rem; color: var(--red); flex-shrink: 0; }

/* ─── ALERTS ─── */
.alert {
  padding: 12px 15px; border-radius: var(--r-sm);
  font-size: 0.855rem; font-weight: 500;
  margin-bottom: 16px; display: flex; align-items: center; gap: 9px;
  animation: alertIn 0.3s ease;
}
@keyframes alertIn { from { opacity:0; transform: translateY(-6px); } to { opacity:1; transform: none; } }

.alert-success { background: rgba(0,200,83,0.08);   color: #00a844; border: 1px solid rgba(0,200,83,0.25); }
.alert-error   { background: rgba(233,30,99,0.08);  color: var(--red); border: 1px solid rgba(233,30,99,0.25); }
.alert-info    { background: rgba(33,150,243,0.08); color: #1976d2;   border: 1px solid rgba(33,150,243,0.25); }

/* ─── AUTH PAGE ─── */
.auth-page {
  min-height: 100vh; background: var(--bg-base);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; position: relative;
}
.auth-page::before {
  content: ''; position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 700px 500px at 20% 50%, rgba(108,99,255,0.09), transparent),
    radial-gradient(ellipse 500px 700px at 80% 30%, rgba(33,150,243,0.09), transparent);
}
.auth-wrap {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 420px;
  gap: 64px; align-items: center;
  max-width: 980px; width: 100%;
}
.auth-branding .brand-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 36px; }
.auth-branding h1 {
  font-size: 3rem; font-weight: 800; letter-spacing: -2px;
  line-height: 1.05; margin-bottom: 18px;
}
.auth-branding h1 .hi { color: var(--accent); }
.auth-branding p { color: var(--text-muted); font-size: 0.95rem; line-height: 1.75; max-width: 360px; }
.auth-features { display: flex; flex-direction: column; gap: 10px; margin-top: 30px; }
.auth-feature {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.855rem; color: var(--text-secondary);
}
.auth-feature-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}

.auth-card {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: 38px; box-shadow: var(--shadow-lg);
}
.auth-card-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 5px; }
.auth-card-sub { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 26px; }

.auth-tabs {
  display: flex; gap: 4px; background: var(--bg-raised);
  border-radius: var(--r-sm); padding: 4px; margin-bottom: 26px;
}
.auth-tab {
  flex: 1; padding: 9px; text-align: center;
  font-weight: 600; font-size: 0.8rem; cursor: pointer;
  transition: all 0.2s; background: transparent;
  border: none; font-family: var(--font); color: var(--text-muted);
  border-radius: calc(var(--r-sm) - 2px);
}
.auth-tab.active { background: var(--bg-surface); color: var(--accent); box-shadow: 0 2px 8px rgba(108,99,255,0.15); }

.demo-badge {
  background: var(--accent-dim); border: 1px solid var(--border-bright);
  border-radius: var(--r-sm); padding: 11px 14px;
  margin-bottom: 18px; font-size: 0.75rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 9px;
}
.demo-badge .db-key { font-family: var(--mono); color: var(--accent); font-weight: 700; }

/* ─── FILTER BAR ─── */
.filter-bar {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 13px 16px;
  margin-bottom: 14px; display: flex;
  align-items: center; gap: 10px; flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
}
.filter-bar .form-control { max-width: 165px; padding: 8px 12px; font-size: 0.8rem; }
.filter-total { margin-left: auto; font-family: var(--mono); font-weight: 700; font-size: 0.95rem; color: var(--red); }

/* ─── EMPTY STATE ─── */
.empty-state { text-align: center; padding: 52px 20px; }
.empty-state .ei { font-size: 3rem; display: block; margin-bottom: 14px; opacity: 0.25; }
.empty-state h3 { font-size: 1rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 7px; }
.empty-state p { font-size: 0.83rem; color: var(--text-muted); margin-bottom: 18px; }

/* ─── CAT PILL ─── */
.cat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 6px;
  font-size: 0.7rem; font-weight: 700;
}

/* ─── DIVIDER ─── */
.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ─── SEARCH WRAP ─── */
.search-wrap { position: relative; display: inline-block; }
.search-wrap i { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 0.75rem; pointer-events: none; }
.search-wrap input { padding-left: 32px; }

/* ─── BUDGET CARD ─── */
.budget-strip {
  background: var(--bg-surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 18px 22px;
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.budget-pct-big { font-family: var(--mono); font-size: 2.2rem; font-weight: 800; line-height: 1; flex-shrink: 0; }
.budget-bar-area { flex: 1; }
.budget-bar-label { display: flex; justify-content: space-between; font-size: 0.75rem; margin-bottom: 5px; color: var(--text-muted); }

/* ─── RESPONSIVE ─── */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-wrapper { margin-left: 0; }
  .menu-toggle { display: flex; }
  .grid-2, .grid-2-1, .form-grid { grid-template-columns: 1fr; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-branding { display: none; }
  .main-content { padding: 20px; }
  .top-header { padding: 0 20px; }
  .sidebar-overlay {
    display: block; position: fixed; inset: 0;
    background: rgba(108,99,255,0.3); z-index: 999;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s; backdrop-filter: blur(4px);
  }
  .sidebar-overlay.active { opacity: 1; pointer-events: all; }
}
@media (max-width: 576px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-value { font-size: 1.3rem; }
  .main-content { padding: 14px; }
}

/* ─── ANIMATIONS ─── */
@keyframes fadeUp { from { opacity:0; transform:translateY(14px); } to { opacity:1; transform:none; } }

.stats-grid .stat-card { animation: fadeUp 0.4s ease both; }
.stats-grid .stat-card:nth-child(1) { animation-delay: .04s; }
.stats-grid .stat-card:nth-child(2) { animation-delay: .08s; }
.stats-grid .stat-card:nth-child(3) { animation-delay: .12s; }
.stats-grid .stat-card:nth-child(4) { animation-delay: .16s; }

.card { animation: fadeUp 0.4s ease both; }

/* utility */
.mono { font-family: var(--mono); }
.text-accent  { color: var(--accent); }
.text-red     { color: var(--red); }
.text-blue    { color: var(--blue); }
.text-orange  { color: var(--orange); }
.text-muted   { color: var(--text-muted); }
.fw-7 { font-weight: 700; }
.fw-8 { font-weight: 800; }

/* ─── DARK MODE OVERRIDE ─── */
[data-theme="dark"] {
  --bg-base:        #08090d;
  --bg-surface:     #0f1117;
  --bg-raised:      #161922;
  --bg-overlay:     #1d2130;
  --bg-hover:       #242838;
  --text-primary:   #f0f2f8;
  --text-secondary: #8892a4;
  --text-muted:     #4a5568;
  --border:         rgba(255,255,255,0.07);
  --border-bright:  rgba(255,255,255,0.13);
  --shadow-sm:      0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:      0 24px 64px rgba(0,0,0,0.6);
}

[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #1a1440 0%, #0f0c2e 60%, #08090d 100%);
}

[data-theme="dark"] .top-header {
  background: rgba(15,17,23,0.95);
}

[data-theme="dark"] .card,
[data-theme="dark"] .filter-bar,
[data-theme="dark"] .budget-strip {
  box-shadow: none;
}

[data-theme="dark"] select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath fill='%234a5568' d='M5 6L0 0h10z'/%3E%3C/svg%3E");
}

/* ─── RECURRING PAGE STYLES ─── */
.freq-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 0.67rem; font-weight: 700;
  font-family: var(--mono);
}
.freq-monthly { background: rgba(108,99,255,0.12); color: var(--accent); }
.freq-weekly  { background: rgba(33,150,243,0.12); color: var(--blue); }
.freq-daily   { background: rgba(255,112,67,0.12); color: var(--orange); }

.due-soon { color: var(--orange); font-weight: 700; }
.due-today { color: var(--red); font-weight: 700; }
.due-ok { color: var(--text-muted); }

/* ─── PRINT STYLES ─── */
@media print {
  .sidebar, .top-header, .page-header .btn,
  .filter-bar, #printReport, #exportCSV,
  .btn-delete-confirm, .btn-outline { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  body { background: white !important; color: #000 !important; }
  .card { border: 1px solid #ccc !important; box-shadow: none !important; }
  .stat-value, .stat-label { color: #000 !important; }
}

/* ─── DARK/LIGHT TOGGLE BTN ─── */
.theme-toggle-btn {
  background: var(--bg-raised); border: 1px solid var(--border);
  color: var(--text-secondary); width: 36px; height: 36px;
  border-radius: var(--r-sm); display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; font-size: 0.85rem; transition: all 0.2s;
}
.theme-toggle-btn:hover { background: var(--accent-dim); color: var(--accent); border-color: var(--accent); }

/* ─── BUDGET ALERT ANIMATION ─── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
