:root {
  --bg: #ffffff;
  --bg2: #f5f5f5;
  --text: #222;
  --text-light: #555;
  --card-bg: #ffffff;
  --border: #ddd;
  --navbar-bg: #222;
  --navbar-text: #fff;
  --sidebar-bg: #f5f5f5;
}

:root[data-theme="dark"] {
  --bg: #121212;
  --bg2: #1e1e1e;
  --text: #eaeaea;
  --text-light: #bbbbbb;
  --card-bg: #1e1e1e;
  --border: #333;
  --navbar-bg: #000;
  --navbar-text: #fff;
  --sidebar-bg: #1a1a1a;
}

* {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}


body {
  background: var(--bg);
  color: var(--text);
  transition: background 0.3s ease, color 0.3s ease;
}


.navbar {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: #222;
  color: #fff;
}

.navbar button {
  margin-left: 10px;
}

.sidebar {
  width: 200px;
  background: #f5f5f5;
  padding: 20px;
}

.account-card {
  background: #fff;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 10px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  background: #fff;
  padding: 20px;
  margin: 100px auto;
  width: 400px;
  border-radius: 8px;
}

.layout {
  display: flex;
}

.dashboard {
  flex: 1;
  padding: 20px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.card {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}

.chart-placeholder {
  background: #f3f3f3;
  height: 200px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

.quick-actions button {
  margin-right: 10px;
}

.accounts-page h1 {
  margin-bottom: 20px;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.account-item {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.account-item .actions {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

button.primary {
  background: #007bff;
  color: #fff;
  padding: 10px 15px;
  border-radius: 6px;
}

button.danger {
  background: #dc3545;
  color: #fff;
}

.transactions-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.transactions-table th,
.transactions-table td {
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.transactions-table td.expense {
  color: #dc3545;
}

.transactions-table td.income {
  color: #28a745;
}

.transactions-table .actions button {
  margin-right: 8px;
}

.recurring-item {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.recurring-item .left p {
  margin: 3px 0;
}

.recurring-item .right button {
  margin-left: 10px;
}

.categories-page h1 {
  margin-bottom: 20px;
}

.category-list {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

.category-list li {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.category-list .actions button {
  margin-left: 10px;
}

.reports-page h1 {
  margin-bottom: 20px;
}

.summary-section {
  margin-bottom: 40px;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
}

.chart-placeholder {
  background: #f3f3f3;
  height: 240px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
}

.export-section button {
  margin-right: 10px;
}

.occurrences-page h1 {
  margin-bottom: 20px;
}

.occurrence-day {
  margin-bottom: 30px;
}

.occurrence-day h2 {
  margin-bottom: 10px;
}

.occurrence-item {
  background: #fff;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.occurrence-item.pending .status {
  color: #ffc107;
}

.occurrence-item.paid .status {
  color: #28a745;
}

.occurrence-item.skipped .status {
  color: #6c757d;
}

.occurrence-item.overdue .status {
  color: #dc3545;
}

.occurrence-item .right button {
  margin-left: 10px;
}

.payees-page h1 {
  margin-bottom: 20px;
}

.payee-list {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

.payee-list li {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.payee-list .actions button {
  margin-left: 10px;
}

.income-sources-page h1 {
  margin-bottom: 20px;
}

.income-source-list {
  list-style: none;
  padding: 0;
  margin-top: 15px;
}

.income-source-list li {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.income-source-list .actions button {
  margin-left: 10px;
}

.transfer-page h1 {
  margin-bottom: 20px;
}

.transfer-page button.primary {
  margin-bottom: 20px;
}

#transferModal label {
  display: block;
  margin-top: 10px;
  font-weight: bold;
}

#transferModal select,
#transferModal input {
  width: 100%;
  margin-top: 5px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.settings-page h1 {
  margin-bottom: 20px;
}

.profile-card,
.pref-card {
  background: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  margin-bottom: 30px;
}

.profile-card input,
.pref-card select {
  width: 100%;
  margin-top: 5px;
  margin-bottom: 15px;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.logout-section button.danger {
  background: #dc3545;
  color: #fff;
  padding: 10px 15px;
  border-radius: 6px;
}

canvas {
  max-width: 100%;
  margin-bottom: 40px;
}

/* NAVBAR */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #222;
  color: #fff;
  padding: 12px 20px;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar .brand {
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
}

.navbar button {
  margin-left: 10px;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
}

.mobile-toggle {
  display: none;
}

/* SIDEBAR */
.sidebar {
  width: 240px;
  background: #f5f5f5;
  padding: 20px;
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.sidebar ul {
  list-style: none;
  padding: 0;
}

.sidebar li {
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
}

.sidebar li:hover {
  background: #e2e2e2;
}

/* APP SHELL */
.app-shell {
  display: flex;
}

.app-content {
  flex: 1;
  padding: 20px;
}

/* MOBILE */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    height: calc(100vh - 60px);
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .mobile-toggle {
    display: inline-block;
  }
}

/* Base layout */
.app-shell {
  display: flex;
  min-height: calc(100vh - 60px);
}

.app-content {
  flex: 1;
  padding: 20px;
}

/* Mobile layout */
@media (max-width: 900px) {
  .app-shell {
    flex-direction: column;
  }

  .app-content {
    padding: 15px;
  }
}

/* Desktop sidebar */
.sidebar {
  width: 240px;
  background: #f5f5f5;
  padding: 20px;
  height: calc(100vh - 60px);
  position: sticky;
  top: 60px;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

/* Mobile sidebar */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 240px;
    height: calc(100vh - 60px);
    transform: translateX(-100%);
    z-index: 2000;
  }

  .sidebar.open {
    transform: translateX(0);
  }
}

/* Mobile navbar */
@media (max-width: 900px) {
  .navbar .nav-right button {
    display: none;
  }

  .navbar .mobile-toggle {
    display: inline-block;
    font-size: 24px;
    margin-right: 10px;
  }
}

/* Cards */
.summary-cards,
.accounts-grid {
  display: grid;
  gap: 15px;
}

/* Desktop */
.summary-cards {
  grid-template-columns: repeat(4, 1fr);
}

.accounts-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* Mobile */
@media (max-width: 600px) {
  .summary-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .accounts-grid {
    grid-template-columns: 1fr;
  }
}

/* Table wrapper */
.table-responsive {
  overflow-x: auto;
}

/* Mobile stacked rows */
@media (max-width: 700px) {
  table thead {
    display: none;
  }

  table tr {
    display: block;
    margin-bottom: 15px;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
  }

  table td {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
  }

  table td::before {
    content: attr(data-label);
    font-weight: bold;
    color: #555;
  }
}

/* Mobile modal */
@media (max-width: 600px) {
  .modal-content {
    width: 90%;
    margin: 40px auto;
    padding: 15px;
  }

  .modal-actions button {
    width: 100%;
    margin-bottom: 10px;
  }
}

@media (max-width: 600px) {
  h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  h3 { font-size: 18px; }
  p, li, input, select, button { font-size: 16px; }
}

@media (max-width: 600px) {
  .occurrence-item {
    flex-direction: column;
    text-align: left;
  }

  .occurrence-item .right {
    margin-top: 10px;
  }

  .occurrence-item button {
    width: 100%;
    margin-bottom: 10px;
  }
}

.notif-bell {
  position: relative;
  font-size: 20px;
}

.notif-count {
  position: absolute;
  top: -6px;
  right: -10px;
  background: #dc3545;
  color: #fff;
  padding: 2px 6px;
  border-radius: 50%;
  font-size: 12px;
}

.notif-list {
  list-style: none;
  padding: 0;
}

.notif-item {
  background: var(--card-bg);
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  border: 1px solid var(--border);
}

.notif-item.unread {
  border-left: 4px solid #007bff;
}

.notif-item .right button {
  margin-left: 10px;
}

.onboarding {
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.onboarding .subtitle {
  color: var(--text-light);
  margin-bottom: 20px;
}

.onboarding-actions {
  margin-top: 25px;
  display: flex;
  justify-content: space-between;
}

.onboarding-actions button {
  padding: 10px 15px;
  border-radius: 6px;
}

.onboarding input,
.onboarding select {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.account-selector {
  margin-bottom: 20px;
}

.selector-btn {
  padding: 10px 15px;
  margin-right: 10px;
  border-radius: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  cursor: pointer;
}

.selector-btn.active {
  background: #007bff;
  color: #fff;
}

.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 15px;
}

.account-card {
  background: var(--card-bg);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.forecast-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 30px;
}

.forecast-table th,
.forecast-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.forecast-summary {
  margin-bottom: 40px;
}

.insight-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.insight-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.ai-summary {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 30px;
  border: 1px solid var(--border);
}

.budget-total {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 30px;
  border: 1px solid var(--border);
}

.big-number {
  font-size: 32px;
  font-weight: bold;
}

.budget-category-list {
  list-style: none;
  padding: 0;
}

.budget-category-item {
  background: var(--card-bg);
  padding: 15px;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 15px;
}

.progress {
  background: #ddd;
  height: 10px;
  border-radius: 6px;
  margin: 10px 0;
}

.progress .bar {
  height: 10px;
  background: #007bff;
  border-radius: 6px;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.goal-card {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.goal-card .progress {
  background: #ddd;
  height: 10px;
  border-radius: 6px;
  margin: 10px 0;
}

.goal-card .bar {
  height: 10px;
  background: #28a745;
  border-radius: 6px;
}

.goal-date {
  color: var(--text-light);
}

.alert-list {
  list-style: none;
  padding: 0;
}

.alert-item {
  background: var(--card-bg);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--border);
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
}

.alert-item.high {
  border-left: 6px solid #dc3545;
}

.alert-item.medium {
  border-left: 6px solid #ffc107;
}

.alert-item.low {
  border-left: 6px solid #007bff;
}

