/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Kanit', 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --primary-dark: #1e40af;
  --primary-light: #eff6ff;
  --text-dark: #1f2937;
  --text-muted: #6b7280;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border-color: #e2e8f0;
  --success: #10b981;
  --success-light: #e6f4ea;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --expense-gradient: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
  --balance-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --sidebar-width: 280px;
  --transition-speed: 0.3s;
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  overflow-x: hidden;
}

/* App Layout Grid */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Task Modal Styles */
.task-modal-content {
  max-width: 500px;
  background-color: var(--bg-white);
  padding: 24px;
  border-radius: 12px;
}

/* Sidebar Styling */
.sidebar {
  width: var(--sidebar-width);
  background-color: #1e3a8a; /* Deep elegant blue */
  color: #ffffff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: transform var(--transition-speed);
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.05);
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

.sidebar-brand span {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  flex: 1;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.menu-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  color: #ffffff;
}

.menu-item.active {
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.sidebar-divider {
  height: 1px;
  background-color: rgba(255, 255, 255, 0.1);
  margin: 16px 0;
}

.settings-item {
  color: #fca5a5; /* Soft red for settings */
  margin-top: auto; /* Push settings to bottom */
}

.settings-item:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #fecaca;
}

.sidebar-footer {
  padding: 20px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Main Content Styling */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition-speed);
}

/* Top Navigation Bar */
.topbar {
  background-color: var(--bg-white);
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 90;
}

.menu-toggle {
  display: none;
  cursor: pointer;
  color: var(--text-dark);
}

.view-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #1e3a8a;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.dot-status {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #22c55e;
}

.status-text {
  color: #166534;
  font-weight: 500;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  position: relative;
  padding: 6px 12px;
  border-radius: 30px;
  transition: background-color 0.2s;
}

.user-profile:hover {
  background-color: #f1f5f9;
}

.user-role {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
}

.avatar {
  width: 38px;
  height: 38px;
  background-color: var(--primary-color);
  color: #ffffff;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* User Dropdown */
.user-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  width: 170px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  margin-top: 8px;
  overflow: hidden;
  z-index: 110;
}

.user-dropdown.active {
  display: block;
}

.user-dropdown a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  color: var(--text-dark);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background-color 0.2s;
}

.user-dropdown a:hover {
  background-color: var(--primary-light);
  color: var(--primary-hover);
}

/* Excel Connection Green Banner */
.excel-banner {
  background-color: #e6f4ea;
  border-bottom: 1px solid #c2e7cc;
  padding: 12px 32px;
  display: flex;
  align-items: center;
}

.banner-content {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #137333;
  font-size: 0.9rem;
  font-weight: 500;
}

.banner-content i {
  width: 18px;
  height: 18px;
}

/* View Wrapper & Transitions */
.view-wrapper {
  padding: 32px;
  flex: 1;
  overflow-y: auto;
}

.app-view {
  display: none;
  animation: fadeIn 0.4s ease;
}

.app-view.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* General Layout helpers & Components */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1e3a8a;
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Styled Form Elements */
.styled-select, .styled-input {
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: 10px;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-dark);
  background-color: var(--bg-white);
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.styled-select:focus, .styled-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.styled-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%234b5563' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

.selector-container {
  width: 220px;
}

/* Styled Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
}

.btn-outline:hover {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-success {
  background-color: var(--success);
  color: #ffffff;
}

.btn-success:hover {
  background-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-danger {
  background-color: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  background-color: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* KPI Cards Layout */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

.kpi-card {
  border-radius: 20px;
  padding: 24px;
  color: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 25px -5px rgba(0, 0, 0, 0.1);
}

.income-card {
  background-color: var(--success);
}

.expense-card {
  background: var(--expense-gradient);
}

.balance-card {
  background: var(--balance-gradient);
}

.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2;
}

.kpi-label {
  font-size: 1rem;
  font-weight: 500;
  opacity: 0.9;
}

.kpi-value {
  font-size: 2.25rem;
  font-weight: 700;
}

.kpi-icon {
  width: 56px;
  height: 56px;
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.kpi-icon i {
  width: 28px;
  height: 28px;
}

/* Custom Watermark Icons in Cards */
.kpi-card::after {
  content: "";
  position: absolute;
  bottom: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  background-color: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  z-index: 1;
}

/* Breakdown Grid */
.breakdown-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid-card {
  background-color: var(--bg-white);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.grid-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
}

.grid-card-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-dark);
}

.grid-card-header i {
  width: 22px;
  height: 22px;
}

.text-green { color: var(--success); }
.text-pink { color: #ec4899; }
.text-blue { color: var(--primary-color); }

/* Donut Chart Container styling */
.chart-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 24px;
}

.custom-pie-chart {
  position: relative;
  width: 160px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-center-text {
  position: absolute;
  text-align: center;
  display: flex;
  flex-direction: column;
}

.chart-center-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
}

.chart-center-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.chart-legend {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-h: 150px;
  overflow-y: auto;
  padding-right: 6px;
}

.legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
}

.legend-label-col {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.legend-name {
  color: var(--text-dark);
  font-weight: 500;
}

.legend-percent {
  color: var(--text-muted);
}

.legend-amount {
  font-weight: 600;
  color: var(--text-dark);
}

/* Budget dashboard progress list */
.budget-container {
  display: flex;
  flex-direction: column;
  gap: 18px;
  flex: 1;
  overflow-y: auto;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  flex: 1;
  color: var(--text-muted);
}

.empty-icon {
  width: 64px;
  height: 64px;
  background-color: var(--bg-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-icon i {
  width: 30px;
  height: 30px;
}

.budget-progress-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.budget-progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.budget-progress-name {
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.budget-progress-stats {
  font-weight: 600;
}

.budget-progress-stats .total {
  color: var(--text-muted);
  font-weight: 400;
}

.progress-bar-bg {
  height: 8px;
  background-color: var(--border-color);
  border-radius: 10px;
  width: 100%;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.3s ease;
}

.progress-over {
  color: var(--danger) !important;
}

/* Calendar Card styling */
.calendar-card {
  background-color: var(--bg-white);
  border-radius: 20px;
  padding: 32px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.calendar-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 32px;
  margin-bottom: 30px;
}

.cal-nav-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  transition: all 0.2s;
}

.cal-nav-btn:hover {
  background-color: var(--primary-light);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.calendar-title {
  font-size: 1.4rem;
  font-weight: 600;
  color: #1e3a8a;
  min-width: 200px;
  text-align: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.day-name {
  text-align: center;
  font-weight: 600;
  color: var(--text-dark);
  padding: 12px 0;
  font-size: 0.95rem;
}

.day-name.sunday {
  color: var(--danger);
}

.calendar-cells-contents {
  grid-column: span 7;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.calendar-cell {
  background-color: var(--bg-light);
  border-radius: 12px;
  min-height: 100px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid transparent;
  transition: all 0.2s;
}

.calendar-cell:hover:not(.empty) {
  background-color: #f1f5f9;
  border-color: #cbd5e1;
}

.calendar-cell.empty {
  background-color: transparent;
  pointer-events: none;
}

.cell-day-num {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.calendar-cell.today .cell-day-num {
  background-color: var(--primary-color);
  color: white;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

.cell-data {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: right;
  margin-top: 10px;
}

.cell-amount {
  padding: 2px 4px;
  border-radius: 4px;
}

.cell-amount.income {
  color: var(--success);
}

.cell-amount.expense {
  color: #ec4899;
}

.calendar-legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.legend-item .bullet {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.bullet.income { background-color: var(--success); }
.bullet.expense { background-color: #ec4899; }
.bullet.balance { background-color: var(--primary-color); }

/* Recording View specific styling */
.records-card {
  background-color: var(--bg-white);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  margin-bottom: 30px;
  overflow: hidden;
}

.records-card-header {
  padding: 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}

.records-card-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.records-card-header h3 i {
  width: 20px;
  height: 20px;
}

.bg-blue {
  background-color: var(--primary-color);
}

.text-white {
  color: #ffffff;
}

.records-card-body {
  padding: 24px;
}

/* Dynamic Rows */
.transaction-row {
  display: grid;
  grid-template-columns: 2fr 2fr 2fr 2fr 3fr auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 18px;
  animation: fadeInRow 0.3s ease;
  background-color: var(--bg-light);
  padding: 18px;
  border-radius: 12px;
  border: 1px dashed var(--border-color);
}

@keyframes fadeInRow {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.row-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.row-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}

.row-remove-btn {
  background: transparent;
  border: none;
  color: var(--danger);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background-color 0.2s;
  height: 42px;
  width: 42px;
}

.row-remove-btn:hover {
  background-color: var(--danger-light);
}

.form-actions-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
}

.border-top {
  border-top: 1px solid var(--border-color);
  padding: 20px 24px;
}

/* History Filters */
.filter-drawer {
  background-color: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  padding: 18px 24px;
  display: none;
  animation: slideDown 0.2s ease-out;
}

.filter-drawer.active {
  display: block;
}

@keyframes slideDown {
  from { height: 0; opacity: 0; overflow: hidden; }
  to { height: auto; opacity: 1; }
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  align-items: end;
}

.filter-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-col label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
}

/* Custom responsive table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.history-table, .budget-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.history-table th, .history-table td,
.budget-table th, .budget-table td {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.history-table th, .budget-table th {
  background-color: var(--bg-light);
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.9rem;
}

.history-table tbody tr:hover,
.budget-table tbody tr:hover {
  background-color: #f8fafc;
}

.history-amount {
  font-weight: 600;
}

.history-amount.income {
  color: var(--success);
}

.history-amount.expense {
  color: var(--danger);
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.action-btn-item {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.action-btn-item.edit {
  color: var(--primary-color);
}

.action-btn-item.edit:hover {
  background-color: var(--primary-light);
}

.action-btn-item.delete {
  color: var(--danger);
}

.action-btn-item.delete:hover {
  background-color: var(--danger-light);
}

.table-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  color: var(--text-muted);
  gap: 12px;
}

.table-empty i {
  width: 48px;
  height: 48px;
}

/* Category View Specifics */
.two-column-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
}

.column-card {
  background-color: var(--bg-white);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.column-card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.column-card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.column-card-header h3 i {
  width: 20px;
  height: 20px;
}

.column-card-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
}

/* Color palette picker */
.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.color-option {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
}

.color-option:hover {
  transform: scale(1.15);
}

.color-option.selected {
  border-color: var(--text-dark);
  box-shadow: 0 0 0 2px #ffffff inset;
}

/* Category lists */
.category-list-header {
  flex-wrap: wrap;
  gap: 12px;
}

.tab-buttons {
  display: flex;
  background-color: var(--bg-light);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 6px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s;
}

.tab-btn:hover {
  color: var(--text-dark);
}

.tab-btn.active {
  background-color: var(--bg-white);
  color: var(--primary-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.category-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 6px;
}

.category-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--bg-white);
  transition: box-shadow 0.2s;
}

.category-card-item:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.category-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category-name-text {
  font-size: 0.9rem;
  font-weight: 500;
}

.category-delete-btn {
  background: transparent;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: all 0.2s;
}

.category-delete-btn:hover {
  color: var(--danger);
  background-color: var(--danger-light);
}

/* Budget View styling */
.budget-header-actions {
  display: flex;
  gap: 12px;
  width: auto;
}

.select-sm {
  width: 130px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.budget-table-input {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 12px;
  width: 100%;
  outline: none;
  font-weight: 500;
  transition: all 0.2s;
}

.budget-table-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.budget-table td {
  vertical-align: middle;
}

.budget-cat-col {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.budget-remaining {
  font-weight: 600;
}

.budget-remaining.positive {
  color: var(--success);
}

.budget-remaining.negative {
  color: var(--danger);
}

/* Settings view Specifics */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.settings-grid .grid-card {
  min-height: auto;
}

.settings-grid .grid-card-body {
  padding-top: 10px;
}

.toggle-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toggle-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

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

/* CSS Toggle Switch button */
.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 26px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

.settings-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.excel-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.template-download-box {
  text-align: center;
  margin-top: 10px;
}

.template-download-box a {
  font-size: 0.85rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.template-download-box a:hover {
  text-decoration: underline;
}

.border-danger {
  border-color: #fecaca;
}

.text-danger {
  color: var(--danger);
}

.danger-box {
  background-color: #fff5f5;
  border: 1px solid #fecaca;
  padding: 18px;
  border-radius: 12px;
}

.warning-text {
  font-size: 0.85rem;
  color: #b91c1c;
  line-height: 1.5;
  margin-bottom: 16px;
  font-weight: 500;
}

/* Modals Overlay & Box */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-dark);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-dark);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #1e293b;
  color: #ffffff;
  padding: 14px 28px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  z-index: 2000;
  transition: bottom 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-notification.active {
  bottom: 30px;
}

.toast-icon {
  display: flex;
  align-items: center;
  color: var(--success);
}

.toast-icon i {
  width: 20px;
  height: 20px;
}

.toast-content p {
  font-size: 0.9rem;
  font-weight: 500;
}

/* Passcode Lock Screen Overlay styling */
.lock-screen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lock-screen-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lock-card {
  background: var(--bg-white);
  border-radius: 24px;
  padding: 40px 32px;
  width: 90%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.lock-icon {
  width: 60px;
  height: 60px;
  background-color: var(--primary-light);
  color: var(--primary-color);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.lock-icon i {
  width: 28px;
  height: 28px;
}

.lock-card h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 6px;
}

.lock-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Passcode dots display */
.passcode-display {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-bottom: 30px;
}

.passcode-display .dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--border-color);
  transition: all 0.15s;
}

.passcode-display .dot.filled {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  transform: scale(1.2);
}

/* Circular Keypad buttons */
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.key-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background-color: var(--bg-light);
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dark);
  transition: all 0.15s;
  margin: 0 auto;
}

.key-btn:hover {
  background-color: #e2e8f0;
}

.key-btn:active {
  transform: scale(0.92);
  background-color: #cbd5e1;
}

.empty-btn {
  border: none;
  background: transparent;
  cursor: default;
  pointer-events: none;
}

.action-btn {
  background-color: transparent;
  border: none;
  color: var(--text-muted);
}

.action-btn:hover {
  background-color: var(--bg-light);
  color: var(--text-dark);
}

.error-text {
  color: var(--danger);
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 10px;
}

.lock-footer {
  margin-top: 24px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Sidebar Responsive Toggle classes */
@media (max-width: 1024px) {
  .app-container {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: 70px;
    position: sticky;
    top: 0;
    flex-direction: row;
    transform: none;
    z-index: 100;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 0;
  }
  
  .sidebar-brand {
    display: none; /* Hide brand to save space on top bar */
  }
  
  .sidebar-menu {
    flex-direction: row;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    width: max-content;
  }
  
  .sidebar-divider {
    display: none;
  }
  
  .menu-item {
    flex-direction: row;
    padding: 10px 15px;
    margin: 0;
    border-radius: 0;
    font-size: 1rem;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
  }
  
  .menu-item.active {
    background-color: transparent;
    color: #fff;
    border-bottom-color: #3b82f6;
  }
  
  .menu-item i {
    margin-right: 8px;
    font-size: 1.2rem;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .menu-toggle {
    display: none; /* No hamburger needed, it's a top bar now */
  }
  
  .topbar {
    top: 0;
    position: relative; /* Not sticky, let it scroll normally */
  }
  
  .cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .breakdown-grid {
    grid-template-columns: 1fr;
  }
  
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 16px; /* Ensure readability on mobile */
  }

  .sidebar {
    height: 60px;
  }

  .menu-item {
    font-size: 0.95rem;
    padding: 10px 12px;
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }
  
  .two-column-layout {
    grid-template-columns: 1fr;
  }
  
  .transaction-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  .transaction-row .row-group:nth-child(5) {
    grid-column: span 2;
  }
  
  .transaction-row .row-remove-btn {
    grid-column: span 2;
    width: 100%;
    margin-top: 8px;
  }
  
  .filter-row {
    grid-template-columns: 1fr;
  }
  
  .view-wrapper {
    padding: 12px;
  }
  
  .topbar {
    padding: 12px 16px;
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
  }

  .view-title {
    font-size: 1.3rem; /* Slightly larger for easier reading */
    width: 100%;
    text-align: center;
  }

  .topbar-actions {
    width: 100%;
    justify-content: center;
  }
}

/* In-app warning styling */
.in-app-warning {
  background-color: #ffe4e6;
  border-bottom: 2px solid #fca5a5;
  color: #991b1b;
  padding: 12px 20px;
  font-size: 0.9rem;
  z-index: 10000;
  position: relative;
  width: 100%;
}

.in-app-warning-content {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1200px;
  margin: 0 auto;
  line-height: 1.5;
}

.in-app-warning-content i {
  color: #dc2626;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

/* PWA install banner styling */
.pwa-install-banner {
  background-color: #ecfdf5;
  border-bottom: 2px solid #a7f3d0;
  color: #065f46;
  padding: 12px 20px;
  font-size: 0.9rem;
  z-index: 9998;
  position: relative;
  width: 100%;
}

.pwa-install-content {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1200px;
  margin: 0 auto;
  line-height: 1.5;
}

.pwa-install-content i {
  color: #10b981;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.pwa-install-content span {
  flex-grow: 1;
}

.close-banner-btn {
  background: transparent;
  border: none;
  font-size: 1.4rem;
  color: #065f46;
  cursor: pointer;
  padding: 0 4px;
  font-weight: bold;
  line-height: 1;
}

/* Report View Specific Styles */
.report-tab-btn.active {
  color: var(--primary-color) !important;
}

.report-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px;
}

.report-tab-btn:hover {
  color: var(--primary-color) !important;
}

/* Tables styling in reports */
.report-table th, .report-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.report-table tbody tr:hover {
  background-color: #f8fafc;
}

.report-table tbody tr:last-child {
  font-weight: 700;
  background-color: #eff6ff;
  border-top: 2px solid var(--primary-color);
  color: #1e3a8a;
}

/* Matrix Table: Month x Categories */
.report-matrix-table th, .report-matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.88rem;
}

.report-matrix-table thead tr {
  background-color: #f8fafc;
  border-bottom: 2px solid var(--border-color);
}

.report-matrix-table tbody tr:hover {
  background-color: #f8fafc;
}

.report-matrix-table tr.summary-row {
  font-weight: 700;
  background-color: #f1f5f9;
  border-top: 2px solid #cbd5e1;
  color: var(--text-dark);
}

/* SVG Chart Elements styling */
.svg-chart-axis-line {
  stroke: #cbd5e1;
  stroke-width: 1;
}

.svg-chart-grid-line {
  stroke: #e2e8f0;
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.svg-chart-text {
  font-size: 11px;
  fill: #64748b;
  font-weight: 500;
}

.svg-chart-bar {
  rx: 4px;
  ry: 4px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.svg-chart-bar:hover {
  opacity: 0.85;
}

.svg-chart-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 20px;
}

.svg-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

.svg-chart-line {
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.svg-chart-dot {
  stroke-width: 2;
  cursor: pointer;
  transition: all 0.2s;
}

.svg-chart-dot:hover {
  r: 6px;
}

/* Daily list elements */
.daily-day-card {
  background-color: var(--bg-white);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.daily-day-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 12px;
}

.daily-day-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e3a8a;
}

.daily-day-summary {
  display: flex;
  gap: 16px;
  font-size: 0.9rem;
  font-weight: 600;
}

.daily-day-sum-item.income {
  color: var(--success);
}

.daily-day-sum-item.expense {
  color: var(--danger);
}

.daily-tables-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 1024px) {
  .daily-tables-row {
    grid-template-columns: 1fr;
  }
}

.daily-subtable {
  width: 100%;
  border-collapse: collapse;
}

.daily-subtable th, .daily-subtable td {
  padding: 8px 12px;
  font-size: 0.88rem;
  border-bottom: 1px solid #f1f5f9;
}

.daily-subtable th {
  background-color: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  text-align: left;
}

.daily-subtable td.amount {
  font-weight: 600;
  text-align: right;
}

.daily-subtable td.amount.income {
  color: var(--success);
}

.daily-subtable td.amount.expense {
  color: var(--danger);
}


/* Habit Tracker Styles */
.habit-tracker-container {
  background-color: var(--bg-white);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
  margin-bottom: 24px;
}

.habit-table-wrapper {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-white);
}

.habit-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 800px;
}

.habit-table th, .habit-table td {
  padding: 10px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.habit-table th:last-child, .habit-table td:last-child {
  border-right: none;
}

.habit-sticky-col {
  position: sticky;
  left: 0;
  z-index: 10;
  background: inherit;
  text-align: left !important;
  min-width: 220px;
  border-right: 2px solid var(--border-color) !important;
}

.habit-day-col {
  min-width: 45px;
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-dark);
}

.habit-day-col.weekend {
  background: #fee2e2;
  color: #ef4444;
}

.habit-plant-stage {
  font-size: 24px;
  display: inline-block;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.habit-plant-stage.animate-pop {
  animation: plantPop 0.4s ease-out;
}

@keyframes plantPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.4) translateY(-4px); }
  100% { transform: scale(1); }
}

.habit-checkbox {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: #10b981;
}

.habit-percent-cell {
  font-size: 0.85rem;
  font-weight: 600;
  background: #f8fafc;
}

.habit-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.habit-input-row input {
  flex: 1;
}

/* Habit KPI Cards */
.habit-kpi-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.habit-kpi-card {
  border-radius: 12px;
  padding: 20px;
  color: white;
  display: flex;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.habit-kpi-card::after {
  content: "";
  position: absolute;
  top: -20px;
  right: -20px;
  width: 100px;
  height: 100px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  z-index: 1;
}

.habit-kpi-blue {
  background: #3b82f6;
}

.habit-kpi-orange {
  background: #f97316;
}

.habit-kpi-green {
  background: #10b981;
}

.kpi-content {
  z-index: 2;
  display: flex;
  flex-direction: column;
}

.habit-kpi-card .kpi-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 8px;
  opacity: 0.95;
}

.habit-kpi-card .kpi-number {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1;
}

.habit-kpi-card .kpi-subtitle {
  font-size: 0.75rem;
  opacity: 0.85;
}

.habit-kpi-card .kpi-icon {
  z-index: 2;
  opacity: 0.8;
  display: flex;
  align-items: center;
}

.habit-kpi-card .kpi-icon i {
  width: 32px;
  height: 32px;
}

/* Calendar & Todo Layout */
.calendar-layout-container {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 24px;
}

@media (max-width: 1024px) {
  .calendar-layout-container {
    grid-template-columns: 1fr;
  }
}

.calendar-sidebar-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.sidebar-date-header h3 {
  font-size: 1.1rem;
  color: var(--text-dark);
}

.sidebar-section {
  display: flex;
  flex-direction: column;
}

.sidebar-section.todo-section-flex {
  max-height: 50%;
  overflow-y: visible;
}

.sidebar-subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-tx-list {
  background: white;
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
  max-height: 250px;
  overflow-y: auto;
}

.tx-section-card {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.2);
  margin-top: 8px;
}

.tx-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.tx-section-header h4 {
  color: white !important;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tx-section-header .tx-count-badge {
  background: white;
  color: var(--primary-color);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

.sidebar-tx-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
  font-size: 0.9rem;
}

.sidebar-tx-item.income .tx-amt { color: var(--success); font-weight: 600; }
.sidebar-tx-item.expense .tx-amt { color: var(--danger); font-weight: 600; }

.sidebar-tx-item .tx-name {
  color: var(--text-dark);
  flex: 1;
}

.sidebar-tx-list .empty-text {
  text-align: center;
  font-size: 0.85rem;
  color: #94a3b8;
  padding: 16px;
}

.todo-section-card {
  background: linear-gradient(135deg, #8b5cf6, #ec4899); /* Modern Purple to Pink gradient */
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 10px rgba(236, 72, 153, 0.2);
  display: flex;
  flex-direction: column;
  max-height: 50%;
}

.todo-section-header {
  margin-bottom: 12px;
}

.todo-section-header h4 {
  color: white !important;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.todo-section-body {
  background: white;
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.todo-header {
  margin-bottom: 20px;
}

.todo-header h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-color);
  margin-bottom: 4px;
}

.todo-date-text {
  font-size: 0.9rem;
  color: #64748b;
}

.todo-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.todo-input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
}

.todo-list-container {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.todo-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
  border-color: #e2e8f0;
}

.todo-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.todo-text {
  flex: 1;
  font-size: 0.95rem;
}

.todo-text.completed {
  text-decoration: line-through;
  color: #94a3b8;
}

.todo-delete-btn {
  background: none;
  border: none;
  color: #cbd5e1;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.todo-delete-btn:hover {
  color: #ef4444;
  background: #fee2e2;
}

.cell-habit-status {
  font-size: 0.8rem;
  color: #64748b;
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: 500;
}

/* Detailed Calendar Cell Styles */
.calendar-grid .calendar-cell {
  display: flex;
  flex-direction: column;
  min-height: 100px;
  max-height: 140px;
  overflow-y: auto;
  padding: 6px;
}

.calendar-grid .calendar-cell.selected-day {
  background-color: #f0fdf4;
  border: 2px solid var(--primary-color);
}

.cell-tx-item {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 4px;
  border-radius: 4px;
  margin-bottom: 2px;
}

.cell-tx-item.income {
  background-color: #dcfce7;
  color: #166534;
}

.cell-tx-item.expense {
  background-color: #fee2e2;
  color: #991b1b;
}

.cell-todo-item {
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 2px 4px;
  margin-bottom: 2px;
  color: #475569;
  background-color: #f1f5f9;
  border-radius: 4px;
}

/* Modal Overlay Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Task Modal Styles */
.task-modal-content {
  max-width: 500px;
  width: 90%;
  border-radius: 12px;
  overflow: hidden;
  background-color: var(--bg-white);
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-row.three-cols .form-group {
  flex: 1;
}

.form-row.two-cols .form-group {
  flex: 1;
}

.urgency-selector {
  display: flex;
  gap: 8px;
}

.urgency-option {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.urgency-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.urgency-option span {
  display: block;
  text-align: center;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.urgency-option.low span {
  background: #e6f4ea;
  color: #10b981;
}
.urgency-option.medium span {
  background: #fef3c7;
  color: #f59e0b;
}
.urgency-option.high span {
  background: #fee2e2;
  color: #ef4444;
}

.urgency-option input[type="radio"]:checked + span {
  border-color: currentColor;
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.task-item-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-item-meta {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  color: #64748b;
}

.task-item-urgency {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
}
.task-item-urgency.low { background: #e6f4ea; color: #10b981; }
.task-item-urgency.medium { background: #fef3c7; color: #f59e0b; }
.task-item-urgency.high { background: #fee2e2; color: #ef4444; }
