/* =============================================
   CSS VARIABLES & RESET
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #141009;
  --bg2: #1d1812;
  --surface: rgba(255, 242, 218, 0.04);
  --surface-hover: rgba(255, 242, 218, 0.08);
  --border: rgba(255, 242, 218, 0.09);
  --border-hover: rgba(255, 242, 218, 0.22);
  --text: #f0e8d5;
  --text-muted: #9e8870;
  --text-dim: #5a4a38;

  --purple: #cf7840;
  --purple-light: #e89862;
  --purple-dark: #a05e28;
  --blue: #5a90a8;
  --blue-light: #7cb4cc;
  --cyan: #4a9898;
  --green: #6a9e72;
  --green-light: #8cc494;
  --orange: #c89420;
  --orange-light: #e8bc38;
  --red: #d04848;
  --red-light: #e88080;
  --pink: #c46868;

  --sidebar-w: 230px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --shadow: 0 8px 32px rgba(0,0,0,0.45);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.3);
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

.light-mode {
  --bg: #faf7f0;
  --bg2: #f4efe5;
  --surface: rgba(255, 253, 247, 0.88);
  --surface-hover: rgba(255, 253, 247, 0.97);
  --border: rgba(80, 55, 28, 0.12);
  --border-hover: rgba(80, 55, 28, 0.26);
  --text: #2a1e12;
  --text-muted: #7a6450;
  --text-dim: #a89880;
}

html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* =============================================
   ANIMATED BACKGROUND BLOBS
   ============================================= */
.bg-blobs {
  position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.blob {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.12;
  animation: blobFloat 18s ease-in-out infinite;
}
.blob-1 { width: 500px; height: 500px; background: var(--purple); top: -150px; left: -100px; animation-delay: 0s; }
.blob-2 { width: 400px; height: 400px; background: var(--blue); bottom: -100px; right: 100px; animation-delay: -6s; }
.blob-3 { width: 350px; height: 350px; background: var(--pink); top: 40%; left: 55%; animation-delay: -12s; }
@keyframes blobFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(40px,-30px) scale(1.08); }
  66% { transform: translate(-20px,40px) scale(0.95); }
}
.light-mode .blob { opacity: 0.07; }

/* =============================================
   LAYOUT
   ============================================= */
.app-wrapper {
  display: flex; min-height: 100vh; position: relative; z-index: 1;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  width: var(--sidebar-w);
  background: rgba(20, 14, 8, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition), transform var(--transition);
}
.light-mode .sidebar { background: rgba(240, 232, 215, 0.93); }

.sidebar-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px 18px 20px;
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex; align-items: center; gap: 10px;
}
.logo-icon {
  width: 34px; height: 34px; background: linear-gradient(135deg, var(--purple), var(--orange));
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.logo-text { font-size: 20px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--purple-light), var(--orange-light));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.sidebar-toggle {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 20px; padding: 4px; border-radius: 6px; transition: color var(--transition), background var(--transition);
  display: none;
}
.sidebar-toggle:hover { color: var(--text); background: var(--surface-hover); }

.sidebar-nav {
  flex: 1; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-muted);
  font-size: 14px; font-weight: 500;
  transition: all var(--transition); position: relative; overflow: hidden;
}
.nav-item::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--purple), var(--orange));
  opacity: 0; transition: opacity var(--transition); border-radius: var(--radius-sm);
}
.nav-item:hover { color: var(--text); background: var(--surface-hover); }
.nav-item.active { color: #fff; }
.nav-item.active::before { opacity: 1; }
.nav-icon { font-size: 18px; position: relative; z-index: 1; flex-shrink: 0; }
.nav-label { position: relative; z-index: 1; }

.sidebar-footer {
  padding: 16px 18px; border-top: 1px solid var(--border);
  text-align: center;
}
.date-display { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.time-display { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; margin-top: 4px; }

/* =============================================
   MAIN CONTENT
   ============================================= */
.main-content {
  flex: 1; margin-left: var(--sidebar-w);
  padding: 28px 32px 60px;
  min-height: 100vh; overflow-y: auto;
  transition: margin var(--transition);
}

/* =============================================
   HEADER
   ============================================= */
.top-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.page-subtitle { font-size: 14px; color: var(--text-muted); margin-top: 3px; }
.header-right { display: flex; align-items: center; gap: 12px; }

.streak-badge {
  display: flex; align-items: center; gap: 6px;
  background: rgba(200,148,32,0.15); border: 1px solid rgba(200,148,32,0.3);
  border-radius: 50px; padding: 6px 14px; font-size: 14px; font-weight: 600;
  color: var(--orange-light); cursor: default;
}
.theme-btn {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border);
  cursor: pointer; font-size: 18px; transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.theme-btn:hover { background: var(--surface-hover); transform: scale(1.1) rotate(20deg); }

/* =============================================
   SECTIONS
   ============================================= */
.section { display: flex; flex-direction: column; gap: 20px; animation: fadeIn 0.4s ease; }
.section.hidden { display: none; }
@keyframes fadeIn { from { opacity:0; transform: translateY(10px);} to { opacity:1; transform:none;} }

/* =============================================
   GLASS CARD
   ============================================= */
.glass-card {
  background: var(--surface);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.glass-card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-sm); }
.glass-card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.glass-card-header h2 { font-size: 15px; font-weight: 700; color: var(--text); }

/* =============================================
   SUMMARY CARDS
   ============================================= */
.summary-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.summary-card {
  border-radius: var(--radius); padding: 20px 22px;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.summary-card:hover { transform: translateY(-3px); box-shadow: 0 16px 48px rgba(0,0,0,0.35); }
.card-purple { background: linear-gradient(135deg, rgba(207,120,64,0.22), rgba(160,94,40,0.12)); border: 1px solid rgba(207,120,64,0.28); }
.card-green  { background: linear-gradient(135deg, rgba(106,158,114,0.22), rgba(80,130,88,0.12)); border: 1px solid rgba(106,158,114,0.28); }
.card-orange { background: linear-gradient(135deg, rgba(200,148,32,0.22), rgba(168,112,16,0.12)); border: 1px solid rgba(200,148,32,0.28); }
.card-blue   { background: linear-gradient(135deg, rgba(90,144,168,0.22), rgba(64,112,136,0.12)); border: 1px solid rgba(90,144,168,0.28); }
.card-icon { font-size: 28px; flex-shrink: 0; }
.card-value { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.card-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; font-weight: 500; }
.card-bg-icon {
  position: absolute; right: -10px; bottom: -10px;
  font-size: 64px; opacity: 0.07; pointer-events: none;
}

/* =============================================
   OVERVIEW GRIDS
   ============================================= */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Progress Ring */
.progress-ring-wrap { position: relative; width: 140px; height: 140px; margin: 10px auto 16px; }
.progress-ring { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--border); stroke-width: 10; }
.ring-fill {
  fill: none; stroke: url(#ringGradient); stroke-width: 10;
  stroke-linecap: round; stroke-dasharray: 345; stroke-dashoffset: 345;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4,0,0.2,1);
}
.progress-ring-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--text);
}

svg defs { display: none; }

.mini-todo-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mini-todo-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 6px 10px; border-radius: 8px;
  background: var(--surface-hover); color: var(--text-muted);
}
.mini-todo-item.done { text-decoration: line-through; opacity: 0.5; }
.mini-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot-high { background: var(--red); }
.dot-medium { background: var(--orange); }
.dot-low { background: var(--green); }

/* Bar Chart */
.bar-chart-wrap { display: flex; flex-direction: column; gap: 8px; }
.bar-chart-item { display: flex; align-items: center; gap: 10px; }
.bar-chart-label { font-size: 12px; color: var(--text-muted); width: 90px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-chart-bar { flex: 1; height: 8px; background: var(--border); border-radius: 50px; overflow: hidden; }
.bar-chart-bar-fill { height: 100%; border-radius: 50px; transition: width 0.6s ease; }
.bar-chart-value { font-size: 12px; font-weight: 600; color: var(--text); width: 80px; text-align: right; flex-shrink: 0; }

/* Budget Progress */
.budget-progress-wrap { margin-top: 14px; }
.budget-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.budget-bar { height: 8px; background: var(--border); border-radius: 50px; overflow: hidden; position: relative; }
.budget-bar-fill { height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); border-radius: 50px; transition: width 0.6s ease; }
.budget-bar.large { height: 16px; }
.budget-bar-pct { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 600; color: #fff; padding-right: 6px; }

/* Preview List */
.preview-list { display: flex; flex-direction: column; gap: 8px; }
.preview-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-hover); font-size: 13px;
  transition: background var(--transition);
}
.preview-item:hover { background: rgba(255,242,218,0.1); }
.preview-item-name { color: var(--text); font-weight: 500; flex: 1; }
.preview-item-meta { color: var(--text-muted); font-size: 12px; }
.preview-item-amount { color: var(--orange-light); font-weight: 700; font-size: 13px; }

/* =============================================
   BADGES
   ============================================= */
.badge { padding: 3px 10px; border-radius: 50px; font-size: 12px; font-weight: 700; }
.badge-purple { background: rgba(207,120,64,0.2); color: var(--purple-light); }
.badge-orange { background: rgba(200,148,32,0.2); color: var(--orange-light); }
.badge-green { background: rgba(106,158,114,0.2); color: var(--green-light); }

/* =============================================
   TODO SECTION
   ============================================= */
.section-toolbar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.filter-tabs { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 50px; padding: 4px; }
.filter-tab {
  padding: 7px 16px; border-radius: 50px; border: none; background: none;
  color: var(--text-muted); font-size: 13px; font-weight: 500; cursor: pointer;
  transition: all var(--transition);
}
.filter-tab.active { background: linear-gradient(135deg, var(--purple), var(--orange)); color: #fff; }
.filter-tab:hover:not(.active) { color: var(--text); background: var(--surface-hover); }

.toolbar-actions { display: flex; gap: 8px; align-items: center; }

/* Forms */
.add-form-card h2 { font-size: 15px; font-weight: 700; margin-bottom: 14px; }
.add-form { display: flex; flex-direction: column; gap: 10px; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.flex-1 { flex: 1; min-width: 140px; }
.flex-2 { flex: 2; }

.text-input {
  background: rgba(255,242,218,0.06); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  color: var(--text); font-family: inherit; font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.light-mode .text-input { background: rgba(255,253,247,0.8); }
.text-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(207,120,64,0.15); }
.text-input::placeholder { color: var(--text-dim); }

.select-input {
  background: #1d1812; border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  color: var(--text); font-family: inherit; font-size: 14px;
  cursor: pointer; outline: none;
  transition: border-color var(--transition);
  color-scheme: dark;
}
.select-input option {
  background: #1d1812;
  color: #f0e8d5;
}
.light-mode .select-input {
  background: rgba(255,253,247,0.95);
  color-scheme: light;
}
.light-mode .select-input option {
  background: #f4efe5;
  color: #2a1e12;
}
.select-input:focus { border-color: var(--purple); }

.input-prefix-wrap { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: rgba(255,242,218,0.06); }
.light-mode .input-prefix-wrap { background: rgba(255,253,247,0.8); }
.input-prefix { padding: 10px 10px; background: rgba(255,242,218,0.06); color: var(--text-muted); font-size: 13px; border-right: 1px solid var(--border); white-space: nowrap; }
.input-prefix-wrap .text-input { border: none; border-radius: 0; background: transparent; }
.input-prefix-wrap .text-input:focus { box-shadow: none; }

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--orange));
  border: none; border-radius: var(--radius-sm); padding: 10px 20px;
  color: #fff; font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all var(--transition);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(207,120,64,0.4); }
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 18px; color: var(--text); font-family: inherit; font-size: 14px;
  cursor: pointer; transition: all var(--transition);
}
.btn-secondary:hover { background: var(--surface-hover); }

.btn-danger {
  background: linear-gradient(135deg, var(--red), #903030); border: none; border-radius: var(--radius-sm);
  padding: 8px 18px; color: #fff; font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.btn-danger:hover { box-shadow: 0 4px 14px rgba(208,72,72,0.4); }

.btn-danger-sm {
  background: rgba(208,72,72,0.12); border: 1px solid rgba(208,72,72,0.25); border-radius: var(--radius-sm);
  padding: 8px 14px; color: var(--red-light); font-family: inherit; font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap; transition: all var(--transition);
}
.btn-danger-sm:hover { background: rgba(208,72,72,0.2); }

/* Todo Stats Row */
.todo-stats-row { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-pill {
  padding: 6px 16px; border-radius: 50px; font-size: 13px; font-weight: 500;
  display: flex; gap: 6px; align-items: center;
}
.stat-all { background: rgba(255,242,218,0.08); color: var(--text-muted); }
.stat-pending { background: rgba(90,144,168,0.15); color: var(--blue-light); }
.stat-done { background: rgba(106,158,114,0.15); color: var(--green-light); }
.stat-high { background: rgba(208,72,72,0.15); color: var(--red-light); }

/* Todo List Items */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: var(--radius-sm);
  background: var(--surface-hover); border: 1px solid transparent;
  transition: all var(--transition); animation: slideIn 0.3s ease;
  position: relative; overflow: hidden;
}
@keyframes slideIn { from { opacity:0; transform:translateX(-10px);} to{opacity:1;transform:none;} }
.todo-item:hover { border-color: var(--border-hover); background: rgba(255,242,218,0.07); }
.todo-item.done-item { opacity: 0.55; }
.todo-item.priority-high { border-left: 3px solid var(--red); }
.todo-item.priority-medium { border-left: 3px solid var(--orange); }
.todo-item.priority-low { border-left: 3px solid var(--green); }

.todo-check {
  width: 20px; height: 20px; border-radius: 6px; border: 2px solid var(--border);
  flex-shrink: 0; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition); margin-top: 1px;
}
.todo-check:hover { border-color: var(--purple); background: rgba(207,120,64,0.1); }
.todo-check.checked { background: linear-gradient(135deg, var(--purple), var(--orange)); border-color: transparent; }
.todo-check.checked::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 700; }

.todo-body { flex: 1; min-width: 0; }
.todo-text { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.4; word-break: break-word; }
.todo-item.done-item .todo-text { text-decoration: line-through; color: var(--text-muted); }
.todo-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.todo-cat { font-size: 11px; color: var(--text-muted); background: rgba(255,242,218,0.07); padding: 2px 8px; border-radius: 50px; }
.todo-due { font-size: 11px; color: var(--cyan); }
.todo-due.overdue { color: var(--red-light); }
.priority-tag { font-size: 11px; padding: 2px 8px; border-radius: 50px; font-weight: 600; }
.ptag-high { background: rgba(208,72,72,0.15); color: var(--red-light); }
.ptag-medium { background: rgba(200,148,32,0.15); color: var(--orange-light); }
.ptag-low { background: rgba(106,158,114,0.15); color: var(--green-light); }

.todo-actions { display: flex; gap: 4px; opacity: 0.45; transition: opacity var(--transition); }
.todo-item:hover .todo-actions { opacity: 1; }
.icon-btn {
  width: 28px; height: 28px; border-radius: 6px; border: none; background: none;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-muted); transition: background var(--transition), color var(--transition);
}
.icon-btn:not(.del) { color: var(--text-muted); }
.icon-btn:not(.del):hover { color: var(--text); }
.icon-btn:hover { background: var(--surface-hover); }
.icon-btn.del:hover { background: rgba(208,72,72,0.15); }

/* =============================================
   EXPENSE SECTION
   ============================================= */
.budget-setup-card {}
.budget-setup-row { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.budget-input-wrap { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 200px; }
.budget-input-wrap label { font-size: 12px; color: var(--text-muted); font-weight: 500; }
.budget-status-display { display: flex; gap: 20px; }
.budget-stat { display: flex; flex-direction: column; gap: 2px; }
.bstat-label { font-size: 11px; color: var(--text-muted); }
.bstat-value { font-size: 16px; font-weight: 700; color: var(--text); }
.bstat-value.red { color: var(--red-light); }
.bstat-value.green { color: var(--green-light); }

.expense-top-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.expense-charts-row { display: flex; gap: 20px; align-items: flex-start; }

/* Category Chart */
.category-chart { display: flex; flex-direction: column; gap: 10px; }
.cat-chart-item { display: flex; flex-direction: column; gap: 4px; }
.cat-chart-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--text-muted); }
.cat-chart-amount { font-weight: 600; color: var(--text); }
.cat-bar { height: 6px; background: var(--border); border-radius: 50px; overflow: hidden; }
.cat-bar-fill { height: 100%; border-radius: 50px; transition: width 0.6s ease; }

/* Expense List */
.expense-list { display: flex; flex-direction: column; gap: 8px; }
.expense-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-hover); border: 1px solid transparent;
  transition: all var(--transition); animation: slideIn 0.3s ease;
}
.expense-item:hover { border-color: var(--border-hover); }
.expense-cat-icon { font-size: 22px; flex-shrink: 0; }
.expense-body { flex: 1; min-width: 0; }
.expense-desc { font-size: 14px; font-weight: 500; color: var(--text); }
.expense-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.expense-amount { font-size: 16px; font-weight: 700; color: var(--orange-light); white-space: nowrap; }
.expense-del { opacity: 0.45; transition: opacity var(--transition); }
.expense-item:hover .expense-del { opacity: 1; }

/* =============================================
   KANBAN SECTION
   ============================================= */
.kanban-board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
  align-items: flex-start;
}

.kanban-col {
  min-width: 268px;
  width: 268px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color var(--transition);
}
.kanban-col:hover { border-color: var(--border-hover); }

.kanban-col-header {
  padding: 14px 16px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.kanban-col-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.col-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.col-count {
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-hover);
  color: var(--text-muted);
  padding: 1px 8px;
  border-radius: 50px;
  min-width: 22px;
  text-align: center;
}

.col-add-btn {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1.5px dashed var(--border);
  background: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
  flex-shrink: 0;
}
.col-add-btn:hover {
  border-style: solid;
  border-color: var(--purple-light);
  color: var(--purple-light);
  background: var(--surface-hover);
}

.kanban-col-body {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
  transition: background var(--transition);
}
.kanban-col-body.drag-over {
  background: rgba(207,120,64,0.06);
}

/* Kanban Card */
.kanban-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: grab;
  transition: all var(--transition);
  animation: cardIn 0.25s ease;
  border-left: 3px solid transparent;
  user-select: none;
}
@keyframes cardIn { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.kanban-card:active { cursor: grabbing; }
.kanban-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.kanban-card.dragging {
  opacity: 0.45;
  transform: scale(0.97) rotate(0.8deg);
  box-shadow: var(--shadow);
}
.kanban-card.priority-high { border-left-color: var(--red); }
.kanban-card.priority-medium { border-left-color: var(--orange); }
.kanban-card.priority-low { border-left-color: var(--green); }

.kanban-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: 4px;
  min-height: 24px;
}

.kanban-card-actions {
  display: flex;
  gap: 2px;
  opacity: 0.4;
  transition: opacity var(--transition);
}
.kanban-card:hover .kanban-card-actions { opacity: 1; }

.kanban-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
  margin-bottom: 8px;
}

.kanban-card-due {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kanban-card-due.overdue { color: var(--red-light); }

.kanban-card-footer {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.kanban-empty {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  padding: 16px 8px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
}

/* Inline add form */
.kanban-inline-form {
  padding: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  background: rgba(255,242,218,0.03);
}
.kanban-inline-form.hidden { display: none; }

.kanban-form-row {
  display: flex;
  gap: 8px;
}
.kanban-form-row .text-input,
.kanban-form-row .select-input {
  font-size: 13px;
  padding: 8px 10px;
}

.kanban-form-actions {
  display: flex;
  gap: 8px;
}
.kanban-form-actions .btn-primary {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
}
.kanban-form-actions .btn-secondary {
  padding: 8px 14px;
  font-size: 13px;
}

/* Move context menu */
.move-menu {
  position: fixed;
  z-index: 500;
  background: var(--bg2);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-sm);
  padding: 6px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 155px;
  animation: fadeIn 0.15s ease;
}

.move-menu-item {
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-xs);
  transition: background var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.move-menu-item:hover { background: var(--surface-hover); }

.kanban-stats-row { display: flex; gap: 10px; flex-wrap: wrap; }

/* =============================================
   EMPTY STATE
   ============================================= */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 40px; }
.empty-icon { font-size: 48px; opacity: 0.35; }
.empty-state p { color: var(--text-muted); font-size: 14px; text-align: center; }
.empty-state-sm { color: var(--text-muted); font-size: 13px; text-align: center; padding: 12px 0; }

/* =============================================
   TOAST
   ============================================= */
.toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 999;
  background: rgba(22, 14, 8, 0.96); border: 1px solid var(--border);
  backdrop-filter: blur(12px); border-radius: var(--radius-sm);
  padding: 12px 20px; font-size: 14px; font-weight: 500; color: var(--text);
  transform: translateY(80px); opacity: 0;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  max-width: 320px; box-shadow: var(--shadow);
}
.toast.show { transform: translateY(0); opacity: 1; }
.light-mode .toast { background: rgba(240, 232, 215, 0.97); }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 32px; max-width: 380px; width: 90%; text-align: center;
  box-shadow: var(--shadow); animation: modalIn 0.3s ease;
}
@keyframes modalIn { from { opacity:0; transform:scale(0.9);} to{opacity:1;transform:none;} }
.modal-icon { font-size: 40px; margin-bottom: 12px; }
.modal h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.modal p { color: var(--text-muted); font-size: 14px; margin-bottom: 24px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .overview-grid { grid-template-columns: 1fr; }
  .expense-charts-row { flex-direction: column; }
  .kanban-board { flex-direction: column; overflow-x: visible; }
  .kanban-col { min-width: 100%; width: 100%; max-height: 420px; }
  .kanban-col-body { max-height: 280px; overflow-y: auto; }
}
@media (max-width: 700px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-100%); width: 230px; }
  .sidebar.open { transform: translateX(0); --sidebar-w: 230px; }
  .sidebar-toggle { display: flex; }
  .main-content { margin-left: 0; padding: 20px 16px 60px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .form-row { flex-direction: column; }
  .form-row .text-input, .form-row .select-input, .form-row .input-prefix-wrap { width: 100%; }
  .budget-setup-row { flex-direction: column; }
  .budget-status-display { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .summary-grid { grid-template-columns: 1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 50px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* Color utilities */
.red { color: var(--red-light); }
.green { color: var(--green-light); }

/* Date input */
input[type="date"] {
  background: #1d1812;
  color-scheme: dark;
}
.light-mode input[type="date"] {
  background: rgba(255,253,247,0.95);
  color-scheme: light;
}
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.6); cursor: pointer; }
.light-mode input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(0.3); }
