/* ================================================================
   مصروفي - Web App Stylesheet
   Primary: #6366F1 | Secondary: #8B5CF6
   Font: IBM Plex Sans Arabic
================================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #D4AF37;
  --primary-glow: rgba(212, 175, 55, 0.4);
  --secondary: #B8860B;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --bg: #FDFDFD;
  --card: #FFFFFF;
  --text: #171717;
  --text-muted: #737373;
  --border: rgba(0,0,0,0.06);
  --glass: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.3);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 12px 32px rgba(0,0,0,0.08);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.12);
  --nav-bg: #FFFFFF;
  --input-bg: #F5F5F5;
  --radius-sm: 14px;
  --radius-md: 22px;
  --radius-lg: 28px;
  --radius-xl: 34px;
}

.dark-mode {
  --bg: #07090C;
  --card: #12161D;
  --text: #FFFFFF;
  --text-muted: #A3A3A3;
  --border: rgba(255,255,255,0.08);
  --glass: rgba(18, 22, 29, 0.7);
  --glass-border: rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-md: 0 12px 32px rgba(0,0,0,0.5);
  --shadow-lg: 0 24px 64px rgba(0,0,0,0.6);
  --nav-bg: #12161D;
  --input-bg: rgba(255,255,255,0.05);
}

html, body {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  height: 100%;
  overflow: hidden;
  user-select: none;
  transition: background 0.3s, color 0.3s;
}

/* ===== UTILITIES ===== */
.hidden { display: none !important; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }

/* ===== SPLASH ===== */
.splash {
  position: fixed;
  inset: 0;
  background: linear-gradient(145deg, var(--primary), var(--secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s, transform 0.5s;
}
.splash.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}
.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: splashIn 0.6s ease both;
}
@keyframes splashIn {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to { opacity: 1; transform: none; }
}
.splash-icon {
  width: 100px;
  height: 100px;
  background: rgba(255,255,255,0.15);
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255,255,255,0.2);
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}
.splash-icon .material-icons-round {
  font-size: 52px;
  color: white;
}
.splash-title {
  font-size: 38px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.5px;
}
.splash-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}
.splash-loader {
  width: 180px;
  height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  background: white;
  border-radius: 999px;
  animation: loadBar 1.5s ease-in-out forwards;
}
@keyframes loadBar {
  from { width: 0%; }
  to { width: 100%; }
}

/* ===== SCREEN ===== */
.screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow-y: auto;
  background: var(--bg);
}

/* ===== ONBOARDING ===== */
.onboarding-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 32px 24px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.onboarding-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 0 10px;
  animation: fadeSlideDown 0.5s ease both;
}
.ob-icon-wrap {
  width: 90px;
  height: 90px;
  background: linear-gradient(145deg, #D4AF37, #B8860B);
  border-radius: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(212, 175, 55, 0.35);
}
.ob-icon {
  font-size: 48px !important;
  color: white;
}
.ob-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--primary);
}
.ob-sub {
  font-size: 15px;
  color: var(--text-muted);
}
.ob-step { flex: 1; padding-top: 24px; animation: fadeSlideUp 0.4s ease both; }
.ob-step.hidden { display: none !important; }
.ob-step-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  text-align: center;
}
.ob-step-sub {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 8px;
}
.job-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.job-card {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.job-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.job-card.selected {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}
.job-card-full {
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  margin-top: 14px;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.job-card-full:hover { box-shadow: var(--shadow-md); }
.job-card-full.selected {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 24px rgba(99,102,241,0.35);
}
.job-icon {
  font-size: 30px;
  color: var(--primary);
  transition: color 0.2s;
}
.job-card.selected .job-icon,
.job-card-full.selected .job-icon { color: white; }
.job-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  transition: color 0.2s;
}
.job-card.selected .job-label,
.job-card-full.selected .job-label { color: white; }
.ob-buttons {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ===== BUTTONS ===== */
.btn-primary {
  background: var(--gold-gradient, linear-gradient(135deg, #D4AF37, #B8860B));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(99,102,241,0.45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-ghost:hover { background: var(--input-bg); }
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--input-bg); }
.btn-danger {
  background: var(--danger);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger:hover { background: #DC2626; }

/* ===== FORM ===== */
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-label .material-icons-round { font-size: 16px; color: var(--primary); }
.form-input {
  background: var(--input-bg);
  border: 1.5px solid transparent;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  direction: rtl;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
textarea.form-input { resize: none; }
.amount-input-wrap {
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border-radius: var(--radius-md);
  padding: 4px 18px;
  border: 1.5px solid transparent;
  transition: border-color 0.2s;
  overflow: hidden;
  width: 100%;
}
.amount-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.currency-prefix {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  white-space: nowrap;
  padding-left: 8px;
  flex-shrink: 0;
}
.amount-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  font-family: inherit;
  text-align: right;
  direction: rtl;
  width: 100%;
  -moz-appearance: textfield;
  appearance: textfield;
}
.amount-input::-webkit-inner-spin-button,
.amount-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.second-income-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
input[type="checkbox"] {
  accent-color: var(--primary);
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* ===== GLASS CARD ===== */
.glass-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* ===== APP LAYOUT ===== */
.app-container {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
}
.tab-content {
  flex: 1;
  overflow: hidden;
  position: absolute;
  inset: 0;
  bottom: 72px;
}
.tab-content.active { display: block; }
.content-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 20px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.content-scroll::-webkit-scrollbar { display: none; }

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: var(--nav-bg);
  display: flex;
  align-items: center;
  justify-content: space-around;
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 0 8px;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 12px;
}
.nav-item:hover { background: var(--input-bg); }
.nav-icon {
  font-size: 24px !important;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}
.nav-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}
.nav-item.active .nav-icon,
.nav-item.active .nav-label {
  color: var(--primary);
}
.nav-item.active .nav-icon { transform: scale(1.1); }
.nav-fab {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(99,102,241,0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 12px;
}
.nav-fab:hover { transform: scale(1.08); box-shadow: 0 10px 28px rgba(99,102,241,0.5); }
.nav-fab:active { transform: scale(0.95); }
.nav-fab .material-icons-round { color: white; font-size: 28px !important; }

/* ===== HOME HEADER ===== */
.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-logo-small {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}
.app-logo-small .material-icons-round { color: white; font-size: 24px !important; }
.greeting {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.current-month {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}
.header-right { display: flex; gap: 8px; }
.notif-btn, .theme-toggle-btn {
  width: 44px;
  height: 44px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.notif-btn:hover, .theme-toggle-btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.notif-btn .material-icons-round,
.theme-toggle-btn .material-icons-round { color: var(--text); font-size: 22px !important; }

/* ===== BALANCE CARD ===== */
.balance-card {
  position: relative;
  background: linear-gradient(135deg, #D4AF37 0%, #B8860B 100%);
  border-radius: var(--radius-xl);
  padding: 24px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 12px 40px rgba(212, 175, 55, 0.4);
}
.balance-card-bg {
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='400' height='250' viewBox='0 0 400 250' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='320' cy='-30' r='150' fill='rgba(255,255,255,0.05)'/%3E%3Ccircle cx='50' cy='200' r='120' fill='rgba(255,255,255,0.04)'/%3E%3C/svg%3E") no-repeat;
  background-size: cover;
  pointer-events: none;
}
.balance-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.balance-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
}
.balance-label .material-icons-round { font-size: 17px !important; }
.balance-days {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: white;
  backdrop-filter: blur(4px);
}
.balance-amount {
  font-size: 36px;
  font-weight: 900;
  color: white;
  letter-spacing: -1px;
  margin-bottom: 16px;
  direction: ltr;
  text-align: right;
}
.balance-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.balance-progress-bar {
  flex: 1;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 999px;
  overflow: hidden;
}
.balance-progress-fill {
  height: 100%;
  background: rgba(255,255,255,0.85);
  border-radius: 999px;
  transition: width 0.6s ease;
}
.balance-progress-pct {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  min-width: 36px;
  text-align: right;
}
.balance-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  backdrop-filter: blur(4px);
}
.balance-detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.balance-detail-label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
}
.balance-detail-value {
  font-size: 16px;
  font-weight: 800;
  color: white;
  direction: ltr;
  text-align: right;
}
.balance-detail-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.2);
}

/* ===== SECTION HEADERS ===== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}
.see-all-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 8px;
}

/* ===== QUICK ACTIONS ===== */
.quick-actions-scroll {
  margin: 0 -20px;
  margin-bottom: 24px;
}
.quick-actions-row {
  display: flex;
  gap: 12px;
  padding: 4px 20px 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.quick-actions-row::-webkit-scrollbar { display: none; }
.quick-action-chip {
  flex-shrink: 0;
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 10px;
  width: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}
.quick-action-chip:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quick-action-chip:active { transform: scale(0.96); }
.qa-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qa-icon-wrap .material-icons-round { font-size: 22px !important; }
.qa-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}

/* ===== EXPENSE CARD ===== */
.expense-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.expense-card:hover { transform: translateX(-2px); box-shadow: var(--shadow-md); }
.expense-card:active { transform: scale(0.99); }
.expense-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.expense-icon-wrap .material-icons-round { font-size: 24px !important; }
.expense-info { flex: 1; min-width: 0; }
.expense-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.expense-cat {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.expense-date { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.expense-amount-badge {
  font-size: 15px;
  font-weight: 800;
  color: var(--danger);
  white-space: nowrap;
  direction: ltr;
}
.expense-delete-btn {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 56px;
  background: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-100%);
  transition: transform 0.3s;
  cursor: pointer;
}
.expense-card:hover .expense-delete-btn { transform: translateX(0); }
.expense-delete-btn .material-icons-round { color: white; }

/* ===== EMPTY STATE ===== */
.empty-state {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.empty-icon-wrap {
  width: 72px;
  height: 72px;
  background: rgba(99,102,241,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-icon-wrap .material-icons-round { font-size: 36px !important; color: var(--primary); }
.empty-title { font-size: 16px; font-weight: 700; color: var(--text); }
.empty-sub { font-size: 13px; color: var(--text-muted); }

/* ===== CATEGORY GRID ===== */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.cat-grid-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-height: 100px;
  box-shadow: var(--shadow-sm);
}
.cat-grid-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-grid-icon-wrap .material-icons-round { font-size: 22px !important; }
.cat-grid-name { font-size: 14px; font-weight: 700; color: var(--text); }
.cat-grid-pct { font-size: 12px; color: var(--text-muted); }

/* ===== PAGE TITLES ===== */
.page-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.page-sub {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ===== MONTH SELECTOR ===== */
.month-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.month-nav-btn {
  width: 40px;
  height: 40px;
  background: var(--input-bg);
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.month-nav-btn:hover { background: rgba(99,102,241,0.1); }
.month-nav-btn .material-icons-round { color: var(--text); }
.month-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.month-label { font-size: 17px; font-weight: 800; color: var(--text); }

/* ===== SUMMARY GRID ===== */
.summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}
.summary-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.summary-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; display: block; margin-bottom: 6px; }
.summary-value { font-size: 17px; font-weight: 800; color: var(--text); display: block; direction: ltr; }

/* ===== CHARTS ===== */
.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.chart-title { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 16px; }
.pie-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 20px;
}
.pie-wrap canvas { position: relative; z-index: 2; }
.pie-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1;
  pointer-events: none;
}
.pie-center-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.pie-center-value { font-size: 18px; font-weight: 800; color: var(--text); direction: ltr; }
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== GOALS ===== */
.goal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}
.goal-icon { font-size: 48px !important; color: var(--primary); }
.goal-title { font-size: 22px; font-weight: 800; color: var(--text); text-align: center; }
.goal-circle-wrap {
  position: relative;
  width: 180px;
  height: 180px;
}
.goal-ring { width: 100%; height: 100%; }
.goal-ring-bg { stroke: var(--input-bg); }
.goal-ring-fill {
  stroke: var(--primary);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.goal-circle-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.goal-pct { font-size: 38px; font-weight: 900; color: var(--primary); }
.goal-pct-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.goal-amounts {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  background: var(--input-bg);
  border-radius: var(--radius-lg);
  padding: 14px;
}
.goal-amount-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.goal-amount-label { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.goal-amount-value { font-size: 16px; font-weight: 800; color: var(--text); direction: ltr; }
.goal-divider { width: 1px; height: 40px; background: var(--border); }
.goal-actions { display: flex; flex-direction: column; gap: 12px; }

/* ===== SETTINGS ===== */
.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.settings-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 18px;
  cursor: pointer;
  transition: background 0.15s;
}
.settings-tile:hover { background: var(--input-bg); }
.settings-tile.destructive:hover { background: rgba(239,68,68,0.05); }
.settings-tile-icon {
  width: 40px;
  height: 40px;
  background: rgba(99,102,241,0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-tile-icon .material-icons-round { color: var(--primary); font-size: 20px !important; }
.settings-tile-icon.destructive { background: rgba(239,68,68,0.1); }
.settings-tile-icon.destructive .material-icons-round { color: var(--danger); }
.settings-tile-body { flex: 1; min-width: 0; }
.settings-tile-title { display: block; font-size: 15px; font-weight: 700; color: var(--text); }
.settings-tile-title.destructive { color: var(--danger); }
.settings-tile-sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.settings-tile-arrow { color: var(--text-muted); font-size: 14px !important; }
.settings-divider { height: 1px; background: var(--border); margin: 0 18px; }

/* ===== MODALS ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  animation: overlayIn 0.25s ease both;
  backdrop-filter: blur(4px);
}
@keyframes overlayIn {
  from { background: rgba(0,0,0,0); backdrop-filter: blur(0); }
  to { background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); }
}
.modal-sheet {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  background: var(--card);
  border-radius: 28px 28px 0 0;
  max-height: 90vh;
  overflow-y: auto;
  animation: sheetUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  box-shadow: 0 -12px 60px rgba(0,0,0,0.2);
}
.modal-sheet::-webkit-scrollbar { display: none; }
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.small-sheet { max-height: 70vh; }
.modal-drag-handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  margin: 12px auto 0;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 0;
}
.modal-title { font-size: 20px; font-weight: 800; color: var(--text); }
.modal-close-btn {
  width: 36px;
  height: 36px;
  background: var(--input-bg);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close-btn:hover { background: rgba(239,68,68,0.1); }
.modal-close-btn .material-icons-round { color: var(--text-muted); font-size: 20px !important; }
.modal-body { padding: 16px 20px 20px; }

/* ===== EXPENSE MODAL AMOUNT ===== */
.expense-amount-section {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 24px 20px;
  text-align: center;
  overflow: hidden;
}
.expense-amount-label {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  font-weight: 600;
  margin-bottom: 8px;
}
.expense-amount-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  width: 100%;
}
.expense-currency {
  font-size: 22px;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}
.expense-amount-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 52px;
  font-weight: 900;
  color: white;
  font-family: inherit;
  width: 200px;
  max-width: calc(100% - 70px);
  text-align: center;
  direction: rtl;
  -moz-appearance: textfield;
  appearance: textfield;
}
.expense-amount-input::-webkit-inner-spin-button,
.expense-amount-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.expense-amount-input::placeholder { color: rgba(255,255,255,0.4); }

/* ===== CATEGORY CHIPS ===== */
.category-chips-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
}
.category-chips-row::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  width: 76px;
  height: 80px;
  justify-content: center;
}
.cat-chip:hover { border-color: rgba(99,102,241,0.3); }
.cat-chip.selected { background: rgba(99,102,241,0.1); border-color: var(--primary); }
.cat-chip .material-icons-round { font-size: 24px !important; }
.cat-chip-label { font-size: 11px; font-weight: 700; color: var(--text); text-align: center; white-space: nowrap; }
.cat-chip-add {
  background: rgba(99,102,241,0.07);
  border: 2px dashed rgba(99,102,241,0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  width: 76px;
  height: 80px;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.cat-chip-add:hover { background: rgba(99,102,241,0.12); }
.cat-chip-add .material-icons-round { font-size: 24px !important; color: var(--primary); }
.cat-chip-add-label { font-size: 11px; font-weight: 700; color: var(--primary); }

/* ===== ICON PICKER ===== */
.icon-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.icon-opt {
  width: 44px;
  height: 44px;
  background: var(--input-bg);
  border: 2px solid transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}
.icon-opt:hover { border-color: rgba(99,102,241,0.3); }
.icon-opt.selected { background: rgba(99,102,241,0.1); border-color: var(--primary); }
.icon-opt .material-icons-round { font-size: 22px !important; color: var(--text); }
.icon-opt.selected .material-icons-round { color: var(--primary); }
.color-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.color-opt {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
}
.color-opt:hover { transform: scale(1.1); }
.color-opt.selected { border-color: white; box-shadow: 0 0 0 2px var(--primary); }

/* ===== THEME OPTIONS ===== */
.theme-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  transition: background 0.15s;
  margin-bottom: 8px;
}
.theme-option:hover { background: var(--input-bg); }
.theme-option .material-icons-round { color: var(--primary); }
.theme-check { margin-right: auto; color: var(--primary); }

/* ===== ABOUT MODAL ===== */
.about-icon-wrap {
  width: 80px;
  height: 80px;
  background: rgba(99,102,241,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}
.about-icon { font-size: 40px !important; color: var(--primary); }
.about-title { font-size: 22px; font-weight: 800; color: var(--text); margin-bottom: 12px; }
.about-desc { font-size: 14px; color: var(--text-muted); line-height: 1.7; }
.about-divider { height: 1px; background: var(--border); margin: 16px 0; }
.about-credit { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.about-dev-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: rgba(99,102,241,0.07);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: 12px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 15px;
  transition: all 0.2s;
}
.about-dev-link:hover { background: rgba(99,102,241,0.12); }
.about-handle { font-size: 13px; opacity: 0.7; }

/* ===== CONFIRM DIALOG ===== */
.confirm-box {
  background: var(--card);
  border-radius: 24px;
  padding: 28px 24px;
  margin: 20px;
  width: calc(100% - 40px);
  max-width: 360px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: none; }
}
.confirm-title { font-size: 18px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.confirm-msg { font-size: 14px; color: var(--text-muted); margin-bottom: 20px; }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--card);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 9999;
  animation: toastIn 0.3s ease both;
  max-width: 80vw;
  text-align: center;
  box-shadow: var(--shadow-lg);
  pointer-events: none;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== ANIMATIONS ===== */
.fade-in { animation: fadeIn 0.4s ease both; }
.slide-up { animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

/* ===== RESPONSIVE ===== */
@media (min-width: 500px) {
  .app-container, .modal-overlay { max-width: 430px; margin: 0 auto; }
  .onboarding-container { max-width: 430px; }
}
@media (min-width: 880px) {
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%);
    overflow: hidden;
  }
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 20% 50%, rgba(99,102,241,0.15) 0%, transparent 60%),
                radial-gradient(circle at 80% 20%, rgba(139,92,246,0.12) 0%, transparent 60%);
    pointer-events: none;
  }
  .splash {
    max-width: 430px; height: 850px; border-radius: 48px;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    box-shadow: 0 40px 100px rgba(0,0,0,0.6);
  }
  .screen {
    max-width: 430px; height: 850px; border-radius: 48px;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    box-shadow: 0 40px 100px rgba(0,0,0,0.6); overflow: hidden;
  }
  .app-container {
    max-width: 430px; height: 850px;
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    border-radius: 48px; box-shadow: 0 40px 100px rgba(0,0,0,0.6);
    overflow: hidden; position: fixed;
  }
  .bottom-nav {
    border-radius: 0 0 48px 48px;
    position: absolute; max-width: none;
  }
  .modal-overlay {
    position: fixed;
    max-width: 430px;
    left: 50%; transform: translateX(-50%);
    border-radius: 48px; overflow: hidden;
    right: auto; width: 430px;
  }
  .tab-content { border-radius: 48px 48px 0 0; }
  .confirm-dialog.modal-overlay {
    position: fixed; inset: auto;
    left: 50%; top: 50%;
    transform: translate(-50%, -50%);
    max-width: 430px; width: 430px;
    height: auto; background: rgba(0,0,0,0.6);
    border-radius: 0;
  }
}
