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

/* ===== CSS Variables - Dark Theme (Default) ===== */
:root,
[data-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #161b27;
  --bg-card: #1e2536;
  --bg-card-hover: #252d42;
  --border: #2a3147;
  --border-light: #323d57;

  --accent-blue: #4f8ef7;
  --accent-blue-glow: rgba(79,142,247,0.18);
  --accent-emerald: #22d3a4;
  --accent-emerald-glow: rgba(34,211,164,0.15);
  --accent-rose: #f76f8e;
  --accent-rose-glow: rgba(247,111,142,0.15);
  --accent-amber: #f9a825;
  --accent-purple: #a78bfa;
  --accent-purple-glow: rgba(167,139,250,0.15);

  --text-primary: #e8eaf2;
  --text-secondary: #8892aa;
  --text-muted: #5a6480;

  --sidebar-w: 260px;
  --topbar-h: 68px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);
  --transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ===== Green Day Theme ===== */
[data-theme="green-day"] {
  --bg-primary: #f0faf4;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #e8f7ef;
  --border: #c3e8d2;
  --border-light: #a5d9bc;

  --accent-blue: #1a9e5c;
  --accent-blue-glow: rgba(26,158,92,0.15);
  --accent-emerald: #0d7a45;
  --accent-emerald-glow: rgba(13,122,69,0.15);
  --accent-rose: #e05a72;
  --accent-rose-glow: rgba(224,90,114,0.15);
  --accent-amber: #d68910;
  --accent-purple: #7c5cbf;
  --accent-purple-glow: rgba(124,92,191,0.15);

  --text-primary: #0d2b1a;
  --text-secondary: #3a6b4f;
  --text-muted: #7aaa8c;

  --shadow: 0 4px 24px rgba(13,122,69,0.12);
  --shadow-lg: 0 8px 40px rgba(13,122,69,0.18);
}

/* Theme transition */
body, .sidebar, .topbar, .stat-card, .cat-overview-card,
.withdrawal-item, .card, .form-input, .income-hero {
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Cairo', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* ===== Theme Toggle Button ===== */
.theme-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  border: 1.5px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
}
.theme-toggle-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-glow);
  transform: translateY(-1px);
}
.theme-toggle-btn .theme-icon {
  font-size: 1rem;
  transition: transform 0.4s ease;
}
.theme-toggle-btn:hover .theme-icon {
  transform: rotate(20deg) scale(1.15);
}

/* Green Day theme specifics */
[data-theme="green-day"] .logo-icon {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  box-shadow: 0 4px 16px rgba(34,197,94,0.25);
}
[data-theme="green-day"] .nav-item.active {
  background: linear-gradient(90deg, rgba(26,158,92,0.12), transparent);
  color: var(--accent-blue);
  border-right: 3px solid var(--accent-blue);
}
[data-theme="green-day"] .btn-primary {
  background: #1a9e5c;
}
[data-theme="green-day"] .btn-primary:hover {
  background: #157a47;
  box-shadow: 0 4px 16px rgba(26,158,92,0.3);
}
[data-theme="green-day"] .btn-emerald {
  background: #0d7a45;
  color: #fff;
}
[data-theme="green-day"] .currency-badge {
  background: #1a9e5c;
}
[data-theme="green-day"] .income-input-group input:focus {
  border-color: #1a9e5c;
  box-shadow: 0 0 0 3px rgba(26,158,92,0.15);
}
[data-theme="green-day"] .form-input:focus {
  border-color: #1a9e5c;
  box-shadow: 0 0 0 3px rgba(26,158,92,0.15);
}
[data-theme="green-day"] .income-hero-bg {
  background: linear-gradient(135deg, rgba(26,158,92,0.12) 0%, transparent 60%);
}
[data-theme="green-day"] ::-webkit-scrollbar-track { background: #e8f7ef; }
[data-theme="green-day"] ::-webkit-scrollbar-thumb { background: #a5d9bc; }
[data-theme="green-day"] ::-webkit-scrollbar-thumb:hover { background: #7aaa8c; }
[data-theme="green-day"] .data-table th { background: #e8f7ef; }
[data-theme="green-day"] .data-table tr:hover td { background: #e8f7ef; }
[data-theme="green-day"] .current-month { background: #e8f7ef; }

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== Sidebar ===== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  right: 0; /* Visible by default on desktop */
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}
.sidebar.open {
  right: 0;
}

.sidebar-header {
  padding: 1.5rem 1.25rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.logo { display: flex; align-items: center; gap: 0.75rem; }
.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  box-shadow: 0 4px 16px var(--accent-blue-glow);
}
.logo-title { display: block; font-size: 0.95rem; font-weight: 800; color: var(--text-primary); }
.logo-sub { display: block; font-size: 0.7rem; color: var(--text-muted); }

.sidebar-toggle {
  background: none; border: none; color: var(--text-secondary);
  font-size: 1.2rem; cursor: pointer; padding: 4px;
  border-radius: 6px; transition: var(--transition);
  display: none;
}
.sidebar-toggle:hover { background: var(--border); color: var(--text-primary); }

.sidebar-close-btn {
  display: none;
  background: var(--bg-primary); 
  border: 1px solid var(--border); 
  color: var(--text-secondary);
  font-size: 1.2rem; 
  cursor: pointer; 
  width: 36px;
  height: 36px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.sidebar-close-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent-rose);
  border-color: var(--accent-rose);
}

@media (max-width: 768px) {
  .sidebar-close-btn { display: flex; }
}

/* ===== Overlay ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.nav-section { padding: 1.25rem 0.75rem 0.5rem; }
.nav-label {
  font-size: 0.65rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.1em;
  padding: 0 0.5rem; display: block; margin-bottom: 0.5rem;
}

.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.65rem 0.75rem; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-secondary);
  font-weight: 600; font-size: 0.9rem;
  transition: var(--transition); margin-bottom: 2px;
  position: relative; overflow: hidden;
}
.nav-item:hover { background: var(--bg-card); color: var(--text-primary); }
.nav-item.active {
  background: linear-gradient(90deg, var(--accent-blue-glow), transparent);
  color: var(--accent-blue);
  border-right: 3px solid var(--accent-blue);
}
.nav-icon { font-size: 1.1rem; flex-shrink: 0; }
.nav-badge {
  margin-right: auto; background: var(--accent-rose);
  color: white; font-size: 0.65rem; font-weight: 800;
  padding: 2px 7px; border-radius: 20px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}
.storage-status {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; color: var(--text-muted);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald-glow);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }

/* ===== Main Content ===== */
.main-content {
  margin-right: var(--sidebar-w);
  min-height: 100vh;
  flex: 1;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  min-width: 0; /* Prevent flex child from overflowing */
  overflow-x: hidden;
}

/* ===== Topbar ===== */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
}
.topbar-right, .topbar-left { display: flex; align-items: center; gap: 1rem; }
.menu-btn {
  background: none; border: none; color: var(--text-secondary);
  font-size: 1.3rem; cursor: pointer; display: none;
  padding: 6px; border-radius: 8px; transition: var(--transition);
}
.menu-btn:hover { background: var(--border); color: var(--text-primary); }
.page-breadcrumb { font-size: 0.95rem; font-weight: 700; color: var(--text-primary); }
.current-month { font-size: 0.8rem; color: var(--text-muted); background: var(--bg-card); padding: 4px 12px; border-radius: 20px; }

/* ===== Page Content ===== */
.page-content { padding: 1.75rem; max-width: 1200px; width: 100%; box-sizing: border-box; }


/* ===== Income Hero ===== */
.income-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.5rem;
  position: relative; overflow: hidden;
}
.income-hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--accent-blue-glow) 0%, transparent 60%);
  pointer-events: none;
}
.income-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  position: relative;
  z-index: 1;
}

.income-hero-main {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.income-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.income-value-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.income-amount {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
}

.income-trend {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--accent-emerald-glow);
  color: var(--accent-emerald);
  display: flex;
  align-items: center;
  gap: 4px;
}

.income-hero-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

@media (max-width: 768px) {
  .income-hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }
  
  .income-hero-actions {
    width: 100%;
  }
  
  .income-hero-actions .btn {
    flex: 1;
    justify-content: center;
  }
  
  .income-amount {
    font-size: 2rem;
  }
}


/* ===== Stats Grid ===== */
.stats-grid {
  display: grid; 
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem; 
  margin-bottom: 1.5rem;
}
/* Override inline repeat(3,1fr) on mobile */
@media (max-width: 768px) {
  .stats-grid[style*="grid-template-columns"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
@media (max-width: 400px) {
  .stats-grid[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  display: flex; align-items: center; gap: 1rem;
  transition: var(--transition); position: relative; overflow: hidden;
}
.stat-card::before {
  content:''; position: absolute; top: 0; right: 0;
  width: 100%; height: 3px; border-radius: 3px 3px 0 0;
}

/* Wallet Realistic Cards */
.wallet-card {
    position: relative;
    padding: 1.5rem;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 140px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.wallet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    border-color: var(--border-light);
}
.wallet-card-bg {
    position: absolute;
    top: -20%;
    right: -10%;
    width: 120px;
    height: 120px;
    background: currentColor;
    border-radius: 50%;
    opacity: 0.05;
    filter: blur(40px);
    z-index: 0;
}
.wallet-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}
.wallet-info {
    position: relative;
    z-index: 1;
}
.wallet-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.wallet-balance {
    font-size: 1.6rem;
    font-weight: 900;
    margin-top: 4px;
    font-family: 'Cairo', sans-serif;
}
.wallet-chip {
    position: absolute;
    top: 1.5rem;
    left: 1.5rem;
    width: 35px;
    height: 25px;
    background: linear-gradient(135deg, #ffd700, #b8860b);
    border-radius: 4px;
    opacity: 0.6;
}
.stat-income::before { background: var(--accent-blue); }
.stat-obligations::before { background: var(--accent-rose); }
.stat-net::before { background: var(--accent-emerald); }
.stat-spent::before { background: var(--accent-amber); }
.stat-card:hover { background: var(--bg-card-hover); transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon { font-size: 1.8rem; }
.stat-label { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; margin-bottom: 0.2rem; }
.stat-value { display: block; font-size: 1.2rem; font-weight: 900; color: var(--text-primary); }
.stat-income .stat-value { color: var(--accent-blue); }
.stat-obligations .stat-value { color: var(--accent-rose); }
.stat-net .stat-value { color: var(--accent-emerald); }
.stat-spent .stat-value { color: var(--accent-amber); }

/* ===== Section Header ===== */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1rem;
}
.section-header h2 { font-size: 1.1rem; font-weight: 800; }

/* ===== Categories Overview ===== */
.categories-overview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.cat-overview-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; transition: var(--transition);
}
.cat-overview-card:hover { background: var(--bg-card-hover); }
.cat-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.cat-name { font-weight: 800; font-size: 0.95rem; }
.cat-pct {
  background: var(--bg-secondary); color: var(--text-secondary);
  padding: 3px 10px; border-radius: 20px; font-size: 0.75rem; font-weight: 700;
}
.cat-amounts { display: flex; justify-content: space-between; margin-bottom: 0.75rem; }
.cat-balance { font-size: 1.2rem; font-weight: 900; }
.cat-spent { font-size: 0.8rem; color: var(--text-muted); }
.progress-bar-bg { height: 8px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 4px; transition: width 0.6s cubic-bezier(0.4,0,0.2,1); }

/* ===== Recent Withdrawals ===== */
.recent-withdrawals { display: flex; flex-direction: column; gap: 0.5rem; }
.withdrawal-item {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.85rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between;
  transition: var(--transition);
}
.withdrawal-item:hover { background: var(--bg-card-hover); }
.withdrawal-info { display: flex; align-items: center; gap: 1rem; }
.withdrawal-cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.withdrawal-note { font-weight: 700; font-size: 0.9rem; }
.withdrawal-date { font-size: 0.75rem; color: var(--text-muted); }
.withdrawal-amount { font-weight: 900; color: var(--accent-rose); font-size: 1rem; }

/* ===== Alerts ===== */
.alert {
  padding: 0.9rem 1.25rem; border-radius: var(--radius-sm);
  font-weight: 700; margin-bottom: 1rem; font-size: 0.85rem;
  border-right: 4px solid;
}
.alert-warning { background: rgba(249,168,37,0.1); border-color: var(--accent-amber); color: var(--accent-amber); }
.alert-danger { background: var(--accent-rose-glow); border-color: var(--accent-rose); color: var(--accent-rose); }
.hidden { display: none !important; }

/* ===== Overlay ===== */
.overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
  z-index: 90;
}
.overlay.active { display: block; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.55rem 1.2rem; border-radius: var(--radius-sm);
  font-family: 'Cairo', sans-serif; font-weight: 700; font-size: 0.85rem;
  cursor: pointer; border: none; text-decoration: none; transition: var(--transition);
}
.btn-primary { background: var(--accent-blue); color: white; }
.btn-primary:hover { background: #3d7ce0; box-shadow: 0 4px 16px var(--accent-blue-glow); transform: translateY(-1px); }
.btn-danger { background: var(--accent-rose); color: white; }
.btn-danger:hover { background: #e55a79; box-shadow: 0 4px 16px var(--accent-rose-glow); }
.btn-outline { background: transparent; border: 1px solid var(--border-light); color: var(--text-secondary); }
.btn-outline:hover { background: var(--bg-card); color: var(--text-primary); }
.btn-ghost { background: var(--bg-card); color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text-primary); }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-emerald { background: var(--accent-emerald); color: #0f1117; }
.btn-emerald:hover { opacity: 0.88; box-shadow: 0 4px 16px var(--accent-emerald-glow); }
.btn-icon { padding: 0.4rem; width: 32px; height: 32px; justify-content: center; border-radius: 6px; }

/* ===== Cards ===== */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.5rem;
}
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border);
}
.card-title { font-size: 1rem; font-weight: 800; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 0.4rem; }
.form-input {
  width: 100%; padding: 0.65rem 1rem;
  background: var(--bg-secondary); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-primary);
  font-family: 'Cairo', sans-serif; font-size: 0.9rem; font-weight: 600;
  outline: none; transition: var(--transition);
}
.form-input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px var(--accent-blue-glow); }
.form-input::placeholder { color: var(--text-muted); }
.input-row { display: flex; gap: 0.75rem; align-items: flex-end; }
.input-row .form-group { flex: 1; margin-bottom: 0; }

/* ===== Tables ===== */
/* Wrapper for horizontal scroll on mobile */
.table-scroll-wrapper {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  width: 100%;
}
.data-table { width: 100%; border-collapse: collapse; }
.data-table-wide { min-width: 520px; }
.data-table th {
  text-align: right; padding: 0.75rem 1rem;
  font-size: 0.75rem; font-weight: 700; color: var(--text-muted);
  border-bottom: 1px solid var(--border); background: var(--bg-secondary);
  white-space: nowrap;
}
.data-table td {
  padding: 0.9rem 1rem; border-bottom: 1px solid var(--border);
  font-size: 0.88rem; font-weight: 600;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-card-hover); }

/* ===== Color Dots ===== */
.dot-blue { background: var(--accent-blue); }
.dot-purple { background: var(--accent-purple); }
.dot-emerald { background: var(--accent-emerald); }
.dot-amber { background: var(--accent-amber); }
.dot-rose { background: var(--accent-rose); }
.dot-cyan { background: #22d3ee; }

/* ===== Empty State ===== */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 0.9rem; }

/* ===== Page Title ===== */
.page-title { margin-bottom: 1.5rem; }
.page-title h1 {
  font-size: 1.5rem; font-weight: 900;
  display: flex; align-items: center; gap: 0.55rem;
  flex-wrap: wrap; min-width: 0;
}
.page-title h1 > i { font-size: 1.05em; line-height: 1; flex-shrink: 0; }
.page-title p { color: var(--text-muted); font-size: 0.85rem; margin-top: 0.25rem; }
/* ===== Icon Color Utilities ===== */
.text-income { color: var(--accent-blue) !important; }
.text-obligations { color: var(--accent-rose) !important; }
.text-net { color: var(--accent-emerald) !important; }
.text-spent { color: var(--accent-amber) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-cyan { color: #22d3ee !important; }
.text-emerald { color: var(--accent-emerald) !important; }
.text-rose { color: var(--accent-rose) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-amber { color: var(--accent-amber) !important; }

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
@media (max-width: 992px) {
  .settings-grid { grid-template-columns: 1fr; }
}

/* Generic Responsive Grids */
.grid-2-1 {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 1.5rem;
}

.grid-1-2 {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

.grid-form {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.75rem;
  align-items: flex-end;
}

@media (max-width: 992px) {
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .grid-form { grid-template-columns: 1fr 1fr; }
  .grid-form button { grid-column: span 2; width: 100%; }
}

@media (max-width: 480px) {
  .grid-form { grid-template-columns: 1fr; }
  .grid-form button { grid-column: span 1; }
}

/* ===== Responsive - Tablet ===== */
@media (max-width: 1024px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .categories-overview { grid-template-columns: 1fr; }
}

/* ===== Responsive - Mobile ===== */
@media (max-width: 768px) {
  /* Sidebar */
  .sidebar {
    box-shadow: var(--shadow-lg);
    z-index: 2000;
    width: 280px;
    right: -280px;
  }
  .sidebar.open { right: 0; }
  .sidebar-toggle { display: flex; }
  .main-content { margin-right: 0; }
  .menu-btn { display: flex !important; }

  /* Topbar */
  .topbar {
    padding: 0 0.75rem;
    height: 58px;
    gap: 0.5rem;
  }
  .topbar-right { gap: 0.55rem; min-width: 0; flex: 1 1 auto; }
  .topbar-left { gap: 1rem; flex-shrink: 0; }
  .topbar-left > * { flex-shrink: 0; }
  .page-breadcrumb {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .current-month { display: none; } /* Hide month on mobile, saves space */
  .btn-sm { padding: 4px 8px; font-size: 0.7rem; }

  /* Page Content */
  .page-content { padding: 0.75rem; }

  /* Stats Grid */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
  .stat-card { padding: 0.85rem 1rem; }
  .stat-value { font-size: 1rem; }
  .stat-label { font-size: 0.72rem; }
  .stat-icon { font-size: 1.1rem; margin-bottom: 0.3rem; }

  /* Income Hero */
  .income-hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .income-hero-text h1 { font-size: 1.3rem; }
  .income-hero-text p { font-size: 0.85rem; }
  .income-input-wrapper { width: 100%; }
  #total-income-display { font-size: 1.6rem !important; }

  /* Cards */
  .card { padding: 1rem; }
  .card-header { flex-wrap: wrap; gap: 0.5rem; }

  /* Wallets Grid */
  #wallets-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 0.6rem !important;
  }

  /* Categories Overview */
  .categories-overview {
    grid-template-columns: 1fr;
  }
  .cat-overview-card { padding: 1rem; }

  /* Tables - adaptive on mobile */
  .card { overflow: hidden; }
  .table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-radius: var(--radius-sm);
  }
  .table-scroll-wrapper::-webkit-scrollbar {
    height: 4px;
  }
  .table-scroll-wrapper::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }
  .data-table { min-width: 100%; width: 100%; }
  .data-table th, .data-table td { padding: 0.65rem 0.45rem; font-size: 0.8rem; }
  .data-table th { white-space: nowrap; }

  /* Forms */
  .withdraw-form { gap: 0.4rem; }
  .form-input { font-size: 0.9rem; padding: 0.5rem 0.75rem; }

  /* Section headers */
  .section-header { flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
  .section-header h2 { font-size: 1rem; }

  /* Goals Grid */
  .goals-grid { grid-template-columns: 1fr !important; }

  /* Recent withdrawals */
  .withdrawal-item { padding: 0.6rem 0.75rem; }
  .withdrawal-note { font-size: 0.85rem; }

  /* Page Title */
  .page-title h1 { font-size: 1.3rem; }
  .page-title p { font-size: 0.8rem; }

  /* Transfer panels */
  #wallet-transfer-panel .form-group,
  #income-sources-panel .form-group { min-width: 100% !important; }
}

/* ===== Responsive - Small Mobile ===== */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.5rem; }
  .stat-card { padding: 0.75rem; gap: 0.6rem; }
  .stat-value { font-size: 0.88rem; }
  .stat-icon { font-size: 1rem; }

  /* Wallets: single column on tiny screens */
  #wallets-grid { grid-template-columns: 1fr !important; }

  .income-hero { padding: 1.25rem 1rem; border-radius: var(--radius); }
  .income-hero-text h1 { font-size: 1.1rem; }

  /* Obligation grid layout */
  .grid-2-1 {
    grid-template-columns: 1fr !important;
  }

  /* Categories withdraw form */
  .cat-card { padding: 1rem; }
  .withdraw-form input[type="number"],
  .withdraw-form select { font-size: 1rem; }

  /* Topbar compact */
  .topbar { height: 54px; gap: 0.4rem; }
  .topbar-left { gap: 0.9rem; }
  .topbar .btn-sm { padding: 5px 9px; font-size: 0.68rem; }
  .page-breadcrumb { font-size: 0.8rem; }
  .logo-title { font-size: 0.9rem; }
  .logo-sub { font-size: 0.65rem; }

  /* Theme toggle - hide text on very small screens */
  .theme-toggle-btn span:not(.theme-icon) { display: none; }
  .theme-toggle-btn { padding: 0.4rem 0.6rem; }

  /* Table columns shrink */
  .data-table th, .data-table td { padding: 0.5rem 0.35rem; font-size: 0.76rem; }
  .data-table .btn-icon { width: 28px; height: 28px; font-size: 0.78rem; padding: 0.2rem; }

  /* Stats Grid balanced odd child */
  .stats-grid > .stat-card:last-child:nth-child(odd) {
    grid-column: span 2;
  }
}

/* Utilities for responsive visibility */
.hide-mobile { display: inline-block; }
.show-mobile { display: none; }
@media (max-width: 600px) {
  .hide-mobile { display: none !important; }
  .show-mobile { display: inline-block !important; }
}

/* Paid obligation row styling */
.is-paid .ob-name,
.is-paid .ob-amount {
  text-decoration: line-through;
  opacity: 0.55;
}
.ob-wallet-badge {
  font-size: 0.65rem;
  background: var(--bg-secondary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
}

/* Withdrawals table: keep short cells on one line so nothing clips */
.data-table .cat-pill,
.data-table .wd-date { white-space: nowrap; }

/* Prevent horizontal body scroll on mobile */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; max-width: 100%; }
}


/* =========================================================
   v2 — income-as-event model: today card, money strip,
   obligations, sheets, setup flow
   ========================================================= */

/* ---- Today card ---- */
.today-card {
  position: relative;
  border-radius: 18px;
  padding: 1.3rem 1.15rem 1.15rem;
  background: linear-gradient(135deg, #1b2233 0%, #1e2536 55%, #232c42 100%);
  border: 1px solid var(--border-light);
  box-shadow: 0 10px 30px rgba(0,0,0,0.28);
  overflow: hidden;
  margin-bottom: 0.9rem;
}
[data-theme="green-day"] .today-card { background: linear-gradient(135deg, #ffffff, #eefaf2); }
.today-card::after {
  content: '';
  position: absolute;
  top: -60px; left: -40px;
  width: 180px; height: 180px;
  border-radius: 50%;
  background: var(--accent-emerald);
  opacity: 0.1;
  filter: blur(40px);
  pointer-events: none;
}
.today-label {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 800; color: var(--text-secondary);
}
.today-label i { color: var(--accent-emerald); }
.today-amount {
  font-size: 2.5rem; font-weight: 900; line-height: 1.15;
  margin: 0.3rem 0 0.25rem; letter-spacing: -0.5px; color: var(--text-primary);
}
.today-sub { font-size: 0.79rem; color: var(--text-secondary); font-weight: 600; line-height: 1.65; }
.today-sub strong { color: var(--text-primary); font-weight: 900; }
.today-warn { color: var(--accent-amber); font-weight: 800; }
.today-bar-wrap { height: 8px; border-radius: 99px; background: var(--bg-secondary); margin: 0.9rem 0 0.7rem; overflow: hidden; }
.today-bar { height: 100%; width: 2%; border-radius: 99px; background: var(--accent-emerald); transition: width 0.5s ease, background 0.3s; }
.today-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; flex-wrap: wrap; }
.today-note { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; }
.today-actions { display: flex; gap: 0.5rem; margin-right: auto; }
.today-actions .btn { padding: 0.6rem 1rem; font-size: 0.85rem; white-space: nowrap; }

/* ---- Money strip ---- */
.money-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.55rem; margin-bottom: 1.4rem; }
@media (min-width: 900px) { .money-strip { grid-template-columns: repeat(4, 1fr); } }
.money-item {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
  padding: 0.7rem 0.8rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0;
}
.money-label { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; }
.money-value {
  font-size: 1rem; font-weight: 900; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.money-value.rose { color: var(--accent-rose); }
.money-value.emerald { color: var(--accent-emerald); }
.money-value.amber { color: var(--accent-amber); }

/* ---- Due obligations ---- */
.due-list { display: flex; flex-direction: column; gap: 0.5rem; }
.due-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.7rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 0.75rem 0.9rem;
}
.due-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.due-name { font-weight: 800; font-size: 0.9rem; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.due-date { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; }
.due-money { display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem; flex-shrink: 0; padding-inline-start: 0.5rem; }
.due-amount { font-weight: 900; font-size: 0.95rem; color: var(--text-primary); white-space: nowrap; }
.due-sub { font-size: 0.66rem; color: var(--text-muted); font-weight: 700; white-space: nowrap; }
.due-sub.ok { color: var(--accent-emerald); }

/* ---- Wallets ---- */
.wallets-grid { display: grid; grid-template-columns: 1fr; gap: 0.55rem; }
@media (min-width: 700px) { .wallets-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }
.wallet-card-clean {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 0.85rem 1rem; min-width: 0;
}
.wallet-card-clean .wallet-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.15rem;
}
.wallet-card-clean .wallet-info { display: flex; flex-direction: column; min-width: 0; }
.wallet-card-clean .wallet-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 700; }
.wallet-card-clean .wallet-balance { font-size: 1.15rem; font-weight: 900; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Income log ---- */
.income-list { display: flex; flex-direction: column; gap: 0.5rem; }
.income-item {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 0.7rem 0.85rem;
}
.income-main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.income-name { font-weight: 800; font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.income-meta { font-size: 0.66rem; color: var(--text-muted); font-weight: 600; }
.income-money { display: flex; flex-direction: column; align-items: flex-end; gap: 0.1rem; flex-shrink: 0; }
.income-amount { color: var(--accent-emerald); font-weight: 900; font-size: 0.9rem; white-space: nowrap; }
.income-split { font-size: 0.64rem; color: var(--text-muted); font-weight: 700; white-space: nowrap; }

/* ---- Chart card ---- */
.chart-card { padding: 1rem; display: flex; align-items: center; justify-content: center; min-height: 260px; }

/* ---- Small helpers ---- */
.muted-note { font-size: 0.74rem; color: var(--text-muted); font-weight: 700; }
.cat-mini-label { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 2px; }
.empty-state.small { padding: 1.2rem 0.5rem; }
.empty-state.small .empty-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.transfer-panel { border-color: var(--accent-blue); margin-bottom: 1rem; }
.transfer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; align-items: end; }
@media (max-width: 768px) { .transfer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .transfer-grid { grid-template-columns: 1fr; } }

/* ---- Bottom sheets ---- */
.sheet {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(6,8,14,0.72);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(3px);
}
@media (min-width: 640px) { .sheet { align-items: center; padding: 1.5rem; } }
.sheet-card {
  width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 20px 20px 0 0; padding: 1.1rem 1.1rem 1.4rem;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}
@media (min-width: 640px) { .sheet-card { border-radius: 18px; padding: 1.4rem; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.9rem; }
.sheet-head h3 { font-size: 1rem; font-weight: 900; display: flex; align-items: center; gap: 0.45rem; }
.sheet-big { font-size: 1.55rem; font-weight: 900; text-align: center; padding: 0.65rem; }
.sheet-submit { width: 100%; justify-content: center; margin-top: 0.9rem; padding: 0.85rem; }
.chip-row { display: flex; gap: 0.4rem; margin: 0.5rem 0 0.9rem; flex-wrap: wrap; }
.chip {
  flex: 1; min-width: 58px; padding: 0.5rem 0.5rem; border-radius: 10px;
  border: 1px solid var(--border-light); background: var(--bg-secondary); color: var(--text-secondary);
  font-family: 'Cairo', sans-serif; font-weight: 800; font-size: 0.82rem; cursor: pointer;
  transition: var(--transition);
}
.chip:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
@media (max-width: 420px) { .form-row { grid-template-columns: 1fr; } }

/* ---- Income split preview ---- */
.split-preview:not(:empty) {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 12px; padding: 0.7rem 0.8rem; margin-top: 0.5rem;
}
.split-head { font-size: 0.7rem; font-weight: 800; color: var(--text-muted); margin-bottom: 0.45rem; }
.split-group { margin-bottom: 0.5rem; }
.split-group:last-child { margin-bottom: 0; }
.split-title { font-size: 0.7rem; font-weight: 800; color: var(--accent-blue); display: flex; align-items: center; gap: 0.35rem; margin-bottom: 0.25rem; }
.split-line { display: flex; justify-content: space-between; font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); padding: 0.1rem 0; }

/* ---- Obligation cards ---- */
.ob-list { display: flex; flex-direction: column; gap: 0.6rem; }
.ob-card { background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 12px; padding: 0.85rem 0.9rem; }
.ob-card.is-paid { opacity: 0.78; }
.ob-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.6rem; }
.ob-main { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.ob-title { font-weight: 800; font-size: 0.92rem; }
.ob-due { font-size: 0.68rem; color: var(--text-muted); font-weight: 700; display: inline-flex; align-items: center; gap: 0.25rem; }
.ob-total { font-weight: 900; font-size: 0.98rem; white-space: nowrap; color: var(--accent-rose); }
.ob-card.is-paid .ob-total { color: var(--text-muted); text-decoration: line-through; }
.ob-bar { height: 6px; border-radius: 99px; background: var(--bg-card); margin: 0.6rem 0 0.45rem; overflow: hidden; }
.ob-bar-fill { height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.ob-meta { display: flex; gap: 0.65rem; flex-wrap: wrap; font-size: 0.67rem; color: var(--text-muted); font-weight: 700; }
.ob-meta strong { color: var(--text-primary); font-weight: 900; }
.ob-actions { display: flex; gap: 0.4rem; margin-top: 0.6rem; }
.ob-actions .btn { flex: 1; justify-content: center; }

/* ---- Setup flow ---- */
.setup-overlay {
  position: fixed; inset: 0; z-index: 9500;
  background: rgba(6,8,14,0.9);
  display: flex; align-items: center; justify-content: center;
  padding: 0.75rem; overflow-y: auto;
}
.setup-card {
  width: 100%; max-width: 460px; max-height: 94vh; overflow-y: auto;
  background: var(--bg-card); border: 1px solid var(--border-light);
  border-radius: 20px; padding: 1.1rem 1.1rem 1.2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.setup-head { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; }
.setup-logo {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-blue), #2f6fd0);
  display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.05rem;
}
.setup-title { font-weight: 900; font-size: 0.98rem; }
.setup-sub { font-size: 0.7rem; color: var(--text-muted); font-weight: 700; }
.setup-dots { display: flex; gap: 0.3rem; margin-right: auto; align-items: center; }
.setup-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-light); transition: var(--transition); }
.setup-dot.active { background: var(--accent-blue); width: 16px; border-radius: 99px; }
.setup-dot.done { background: var(--accent-emerald); }
.setup-step h3 { font-size: 0.96rem; font-weight: 900; margin-bottom: 0.2rem; }
.setup-hint { font-size: 0.73rem; color: var(--text-muted); font-weight: 600; line-height: 1.7; margin-bottom: 0.8rem; }
.setup-row { display: grid; grid-template-columns: 1fr 84px 34px; gap: 0.35rem; align-items: center; margin-bottom: 0.45rem; }
.setup-row-sub { grid-template-columns: 1fr 1fr; }
.setup-row-sub.one { grid-template-columns: 1fr; }
.setup-cat-row { grid-template-columns: 10px 1fr 58px 88px; }
.setup-cat-dot { width: 10px; height: 10px; border-radius: 50%; display: block; }
.setup-num { text-align: center; font-weight: 800; }
.setup-kind { font-size: 0.7rem; padding: 0.4rem; }
.setup-add { width: 100%; justify-content: center; margin-top: 0.2rem; font-size: 0.74rem; }
.setup-two { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-bottom: 0.8rem; }
.setup-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.7rem; font-weight: 700; color: var(--text-secondary); }
.setup-note { font-size: 0.7rem; font-weight: 700; color: var(--accent-emerald); margin-top: 0.5rem; }
.setup-note.warn { color: var(--accent-amber); }
.setup-foot { display: flex; gap: 0.5rem; margin-top: 1rem; }
.setup-foot .btn { flex: 1; justify-content: center; }

/* ---- Toast ---- */
.app-toast {
  position: fixed; bottom: 1.5rem; left: 50%; z-index: 99999;
  transform: translateX(-50%) translateY(160%);
  background: var(--bg-card); border: 1px solid var(--accent-emerald); color: var(--accent-emerald);
  padding: 0.7rem 1.2rem; border-radius: 99px; font-weight: 800; font-size: 0.82rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4); max-width: 90vw; text-align: center;
  transition: transform 0.3s ease;
}
.app-toast.info { border-color: var(--accent-blue); color: var(--accent-blue); }
.app-toast.show { transform: translateX(-50%) translateY(0); }

@media (max-width: 480px) {
  .today-amount { font-size: 2.15rem; }
  .today-actions { width: 100%; }
  .today-actions .btn { flex: 1; justify-content: center; }
}

/* Number inputs: no spinner arrows (they collide with the value in RTL) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.sheet-big::-webkit-inner-spin-button { display: none; }

/* ---- Sign-in / recovery gate ---- */
.auth-gate {
  position: fixed; inset: 0; z-index: 99998;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
  background: radial-gradient(circle at 50% 0%, rgba(79,142,247,0.12), transparent 60%), var(--bg-primary);
  overflow-y: auto;
}
.auth-card {
  width: 100%; max-width: 360px; margin: auto;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 1.75rem 1.35rem;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.auth-logo {
  width: 56px; height: 56px; margin: 0 auto 0.7rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 18px; font-size: 1.5rem; color: #fff;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  box-shadow: 0 8px 24px var(--accent-blue-glow);
}
.auth-brand { font-size: 1.35rem; font-weight: 800; letter-spacing: 0.3px; margin-bottom: 0.35rem; }
.auth-sub { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); line-height: 1.6; margin-bottom: 1.1rem; }
.auth-card .form-group { text-align: right; margin-bottom: 0.8rem; }
.auth-card .form-input { width: 100%; text-align: left; }
.auth-submit { width: 100%; justify-content: center; margin-top: 0.35rem; padding: 0.7rem; }
.auth-error { color: var(--accent-rose); font-size: 0.75rem; font-weight: 700; min-height: 1.1rem; margin-top: 0.6rem; }
.auth-foot { font-size: 0.68rem; font-weight: 600; color: var(--text-muted); line-height: 1.6; margin-top: 0.9rem; }
@media (max-width: 400px) {
  .auth-card { padding: 1.5rem 1.1rem; border-radius: 18px; }
  .auth-brand { font-size: 1.2rem; }
}

/* ---- Sync badge (topbar) ---- */
.sync-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.65rem; border-radius: 99px;
  font-family: inherit; font-size: 0.68rem; font-weight: 800; line-height: 1;
  cursor: pointer; white-space: nowrap;
  background: transparent; border: 1px solid var(--border-light); color: var(--text-secondary);
  transition: var(--transition);
}
.sync-badge:hover { border-color: var(--text-muted); }
.sync-badge.ok { color: var(--accent-emerald); border-color: rgba(34,211,164,0.35); background: rgba(34,211,164,0.08); }
.sync-badge.ok::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-emerald); }
.sync-badge.pending { color: var(--accent-amber); border-color: rgba(249,168,37,0.35); background: rgba(249,168,37,0.08); }
.sync-badge.offline { color: var(--accent-rose); border-color: rgba(247,111,142,0.35); background: rgba(247,111,142,0.08); }

/* Setup: keep the next/back buttons reachable while the form scrolls */
.setup-foot {
  position: sticky; bottom: 0; background: var(--bg-card);
  padding: 0.6rem 0 0.1rem; margin-top: 0.8rem;
  box-shadow: 0 -12px 18px -14px rgba(0,0,0,0.8);
}

/* Setup card: header fixed, body scrolls, footer pinned (no overlap) */
.setup-card { display: flex; flex-direction: column; overflow: hidden; }
.setup-head { flex-shrink: 0; }
.setup-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.setup-foot { position: static; box-shadow: none; border-top: 1px solid var(--border); padding-top: 0.7rem; margin-top: 0.7rem; }

.split-note { font-size: 0.68rem; font-weight: 700; color: var(--accent-emerald); line-height: 1.6; margin-bottom: 0.6rem; display: flex; gap: 0.35rem; align-items: flex-start; }
