/* ===========================
   TASKFLOW — MOBILE-FIRST CSS
   =========================== */

/* ---------- DESIGN TOKENS ---------- */
:root {
  /* Primary palette */
  --primary: #6C5CE7;
  --primary-light: #a29bfe;
  --primary-dark: #4834d4;
  --primary-glow: rgba(108, 92, 231, .18);

  /* Semantic */
  --success: #00b894;
  --warning: #fdcb6e;
  --danger: #e17055;
  --info: #74b9ff;

  /* Priority */
  --priority-low: #00b894;
  --priority-medium: #fdcb6e;
  --priority-high: #e17055;

  /* Surfaces — light mode */
  --bg: #f0f2f5;
  --surface: #ffffff;
  --surface-hover: #f7f7fa;
  --text: #1e1e2f;
  --text-secondary: #6b7280;
  --border: #e5e7eb;
  --shadow: 0 2px 12px rgba(0, 0, 0, .06);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .10);

  /* Layout */
  --nav-height: 64px;
  --header-height: 60px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --transition: .25s cubic-bezier(.4, 0, .2, 1);

  /* Typography */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- DARK MODE ---------- */
body.dark {
  --bg: #0f0f1a;
  --surface: #1a1a2e;
  --surface-hover: #232340;
  --text: #eaeaff;
  --text-secondary: #9ca3af;
  --border: #2d2d48;
  --shadow: 0 2px 12px rgba(0, 0, 0, .30);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, .40);
}

/* ---------- RESET ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

input,
textarea,
select,
button {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ---------- APP SHELL ---------- */
#app {
  max-width: 520px;
  margin: 0 auto;
  position: relative;
  min-height: 100dvh;
}

/* ---------- HEADER ---------- */
#app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: var(--primary);
  color: #fff;
  backdrop-filter: blur(12px);
}

.header-title {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -.5px;
}

.header-date {
  font-size: .75rem;
  opacity: .85;
  margin-top: 2px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: inherit;
  transition: background var(--transition);
}

.icon-btn:hover {
  background: rgba(255, 255, 255, .15);
}

/* ---------- SEARCH BAR ---------- */
.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.search-bar.hidden {
  display: none;
}

.search-icon {
  color: var(--text-secondary);
  font-size: 20px;
}

.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: .95rem;
  padding: 8px 0;
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

/* ---------- MAIN CONTENT ---------- */
#main-content {
  padding: 16px 16px calc(var(--nav-height) + 24px);
}

/* ---------- VIEWS ---------- */
.view {
  display: none;
  animation: fadeUp .3s ease;
}

.view.active {
  display: block;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- BOTTOM NAV ---------- */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -2px 20px rgba(0, 0, 0, .06);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom, 0);
  transition: background var(--transition);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 16px;
  color: var(--text-secondary);
  transition: color var(--transition), background var(--transition);
}

.nav-item .material-symbols-rounded {
  font-size: 24px;
  transition: transform .2s;
}

.nav-label {
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .3px;
}

.nav-item.active {
  color: var(--primary);
  background: var(--primary-glow);
}

.nav-item.active .material-symbols-rounded {
  transform: scale(1.12);
}

/* ---------- DASHBOARD ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.dash-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, background var(--transition);
}

.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.dash-card .material-symbols-rounded {
  font-size: 28px;
}

.dash-label {
  font-size: .7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
}

.dash-value {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 2px;
}

.dash-date .material-symbols-rounded {
  color: var(--primary);
}

.dash-tasks .material-symbols-rounded {
  color: var(--info);
}

.dash-pending .material-symbols-rounded {
  color: var(--warning);
}

.dash-budget .material-symbols-rounded {
  color: var(--success);
}

.dash-date {
  grid-column: 1 / -1;
}

/* ---------- SECTION TITLE ---------- */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text);
}

/* ---------- EMPTY STATE ---------- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state.hidden {
  display: none;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 8px;
  display: block;
  opacity: .4;
}

/* ---------- TASK LIST ---------- */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.task-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s, background var(--transition);
  position: relative;
  overflow: hidden;
}

.task-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.task-card.completed {
  opacity: .55;
}

.task-card.completed .task-card-title {
  text-decoration: line-through;
}

.task-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  margin-top: 2px;
  display: grid;
  place-items: center;
  transition: border-color var(--transition), background var(--transition);
  cursor: pointer;
}

.task-check:hover {
  border-color: var(--primary);
}

.task-card.completed .task-check {
  background: var(--success);
  border-color: var(--success);
}

.task-card.completed .task-check::after {
  content: '✓';
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.task-card-body {
  flex: 1;
  min-width: 0;
}

.task-card-title {
  font-weight: 600;
  font-size: .95rem;
  margin-bottom: 2px;
}

.task-card-desc {
  font-size: .8rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-time,
.task-cat-badge {
  font-size: .7rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 3px;
}

.task-time .material-symbols-rounded,
.task-cat-badge .material-symbols-rounded {
  font-size: 14px;
}

.priority-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 8px;
  border-radius: 20px;
  color: #fff;
}

.priority-badge.low {
  background: var(--priority-low);
}

.priority-badge.medium {
  background: var(--priority-medium);
  color: #333;
}

.priority-badge.high {
  background: var(--priority-high);
}

.task-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.task-actions .icon-btn {
  width: 32px;
  height: 32px;
  color: var(--text-secondary);
  font-size: 18px;
}

.task-actions .icon-btn:hover {
  color: var(--primary);
  background: var(--primary-glow);
}

/* ---------- FILTER BAR ---------- */
.filter-bar,
.category-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}

.filter-bar::-webkit-scrollbar,
.category-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill,
.cat-pill {
  flex-shrink: 0;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all var(--transition);
}

.filter-pill.active,
.cat-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px);
  right: calc(50% - 240px);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 20px rgba(108, 92, 231, .4);
  transition: transform .2s, box-shadow .2s;
  z-index: 50;
}

.fab:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(108, 92, 231, .5);
}

.fab .material-symbols-rounded {
  font-size: 28px;
}

@media (max-width: 520px) {
  .fab {
    right: 20px;
  }
}

/* ---------- BUDGET ---------- */
.budget-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.budget-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: background var(--transition);
}

.budget-card .material-symbols-rounded {
  font-size: 24px;
  margin-bottom: 4px;
}

.budget-label {
  font-size: .7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: .5px;
}

.budget-amount {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 4px;
}

.income-card .material-symbols-rounded {
  color: var(--success);
}

.expense-card .material-symbols-rounded {
  color: var(--danger);
}

.balance-card {
  grid-column: 1 / -1;
}

.balance-card .material-symbols-rounded {
  color: var(--primary);
}

.budget-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-xs);
  font-weight: 600;
  font-size: .85rem;
  transition: all var(--transition);
}

.btn-income {
  background: rgba(0, 184, 148, .12);
  color: var(--success);
  flex: 1;
  justify-content: center;
}

.btn-income:hover {
  background: rgba(0, 184, 148, .22);
}

.btn-expense {
  background: rgba(225, 112, 85, .12);
  color: var(--danger);
  flex: 1;
  justify-content: center;
}

.btn-expense:hover {
  background: rgba(225, 112, 85, .22);
}

.budget-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.budget-item {
  background: var(--surface);
  border-radius: var(--radius-xs);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
  transition: background var(--transition);
}

.budget-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.budget-item-left .material-symbols-rounded {
  font-size: 20px;
}

.budget-item-desc {
  font-weight: 500;
  font-size: .9rem;
}

.budget-item-amount {
  font-weight: 700;
  font-size: .95rem;
}

.budget-item-amount.income {
  color: var(--success);
}

.budget-item-amount.expense {
  color: var(--danger);
}

.budget-item-actions .icon-btn {
  width: 30px;
  height: 30px;
  color: var(--text-secondary);
}

.budget-item-actions .icon-btn:hover {
  color: var(--danger);
}

/* ---------- NOTES ---------- */
.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.note-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform .2s, box-shadow .2s, background var(--transition);
  position: relative;
  min-height: 120px;
  border-top: 4px solid var(--primary-light);
}

.note-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.note-card-title {
  font-weight: 700;
  font-size: .85rem;
}

.note-card-content {
  font-size: .78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  flex: 1;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
}

.note-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.note-card-date {
  font-size: .65rem;
  color: var(--text-secondary);
}

.note-card-actions {
  display: flex;
  gap: 2px;
}

.note-card-actions .icon-btn {
  width: 28px;
  height: 28px;
  color: var(--text-secondary);
}

.note-card-actions .icon-btn:hover {
  color: var(--primary);
}

/* ---------- WORLD CLOCK ---------- */

/* Animated gradient background */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes pulseGlow {

  0%,
  100% {
    box-shadow: 0 0 20px rgba(108, 92, 231, .3), 0 0 60px rgba(108, 92, 231, .1);
  }

  50% {
    box-shadow: 0 0 30px rgba(108, 92, 231, .5), 0 0 80px rgba(108, 92, 231, .2);
  }
}

@keyframes secondsTick {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.clock-hero {
  background: linear-gradient(-45deg, #6C5CE7, #4834d4, #a29bfe, #6C5CE7, #00b894);
  background-size: 400% 400%;
  animation: gradientShift 8s ease infinite, pulseGlow 3s ease-in-out infinite;
  color: #fff;
  border-radius: var(--radius);
  padding: 32px 20px 28px;
  text-align: center;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

/* Decorative circles behind hero */
.clock-hero::before {
  content: '';
  position: absolute;
  width: 200px;
  height: 200px;
  border: 2px solid rgba(255, 255, 255, .08);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.clock-hero::after {
  content: '';
  position: absolute;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: secondsTick 60s linear infinite;
  border-top-color: rgba(255, 255, 255, .35);
}

.clock-hero-time {
  font-size: 3.2rem;
  font-weight: 800;
  letter-spacing: 3px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .25);
  position: relative;
  z-index: 1;
}

.clock-hero-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: .85;
  margin-top: 6px;
  font-weight: 700;
  position: relative;
  z-index: 1;
}

.clock-hero-zone {
  font-size: .78rem;
  opacity: .65;
  margin-top: 4px;
  font-weight: 500;
  position: relative;
  z-index: 1;
}

.clock-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.clock-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100dvh - 340px);
  overflow-y: auto;
  padding-right: 2px;
  padding-bottom: 70px;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.clock-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 12px 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
  transition: transform .25s, box-shadow .25s, background var(--transition), border-color .3s;
  border-left: 4px solid var(--primary-light);
  min-height: 62px;
}

/* Alternating accent colors for cards */
.clock-card:nth-child(4n+1) {
  border-left-color: #6C5CE7;
}

.clock-card:nth-child(4n+2) {
  border-left-color: #00b894;
}

.clock-card:nth-child(4n+3) {
  border-left-color: #fdcb6e;
}

.clock-card:nth-child(4n+4) {
  border-left-color: #e17055;
}

.clock-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.clock-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.clock-card-flag {
  font-size: 1.4rem;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: var(--primary-glow);
  border-radius: 50%;
  flex-shrink: 0;
}

.clock-card-info {
  min-width: 0;
}

.clock-card-city {
  font-weight: 700;
  font-size: .85rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.clock-card-zone {
  font-size: .62rem;
  color: var(--text-secondary);
  letter-spacing: .2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 110px;
}

.clock-card-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.clock-card-time-wrap {
  text-align: right;
}

.clock-card-time {
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.dark .clock-card-time {
  background: linear-gradient(135deg, #a29bfe, #dfe6e9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.clock-card-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}

.clock-card-date {
  font-size: .58rem;
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.clock-card-diff {
  font-size: .55rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 8px;
  white-space: nowrap;
  letter-spacing: .2px;
}

/* Color-coded offset badges */
.clock-card:nth-child(4n+1) .clock-card-diff {
  background: rgba(108, 92, 231, .15);
  color: #6C5CE7;
}

.clock-card:nth-child(4n+2) .clock-card-diff {
  background: rgba(0, 184, 148, .15);
  color: #00b894;
}

.clock-card:nth-child(4n+3) .clock-card-diff {
  background: rgba(253, 203, 110, .2);
  color: #e17055;
}

.clock-card:nth-child(4n+4) .clock-card-diff {
  background: rgba(225, 112, 85, .15);
  color: #e17055;
}

body.dark .clock-card:nth-child(4n+1) .clock-card-diff {
  background: rgba(108, 92, 231, .25);
  color: #a29bfe;
}

body.dark .clock-card:nth-child(4n+2) .clock-card-diff {
  background: rgba(0, 184, 148, .25);
  color: #55efc4;
}

body.dark .clock-card:nth-child(4n+3) .clock-card-diff {
  background: rgba(253, 203, 110, .2);
  color: #fdcb6e;
}

body.dark .clock-card:nth-child(4n+4) .clock-card-diff {
  background: rgba(225, 112, 85, .25);
  color: #fab1a0;
}

.clock-card-remove {
  width: 26px;
  height: 26px;
  color: var(--text-secondary);
  opacity: .4;
  transition: opacity .2s, color .2s;
  flex-shrink: 0;
}

.clock-card:hover .clock-card-remove {
  opacity: 1;
}

.clock-card-remove:hover {
  color: var(--danger);
}

/* TZ Modal */
.tz-search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 8px 12px;
  margin-bottom: 12px;
  background: var(--bg);
  transition: border-color var(--transition), background var(--transition);
}

.tz-search-wrap:focus-within {
  border-color: var(--primary);
}

.tz-search-wrap input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: .9rem;
}

.tz-search-wrap input::placeholder {
  color: var(--text-secondary);
}

.tz-options {
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tz-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: background var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  color: var(--text);
  font-size: .88rem;
  font-weight: 500;
}

.tz-option:hover {
  background: var(--primary-glow);
}

.tz-option-flag {
  font-size: 1.3rem;
}

.tz-option-info {
  flex: 1;
}

.tz-option-city {
  font-weight: 600;
}

.tz-option-zone {
  font-size: .72rem;
  color: var(--text-secondary);
}

.tz-option-added {
  font-size: .7rem;
  color: var(--success);
  font-weight: 600;
}

/* ---------- SETTINGS ---------- */
.settings-group {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 4px 0;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: background var(--transition);
}

.settings-group-title {
  font-size: .75rem;
  text-transform: uppercase;
  color: var(--text-secondary);
  font-weight: 700;
  letter-spacing: .5px;
  padding: 12px 20px 4px;
}

.settings-item,
.settings-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 20px;
  gap: 12px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  transition: background var(--transition);
}

.settings-item:hover,
.settings-btn:hover {
  background: var(--surface-hover);
}

.settings-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.settings-info .material-symbols-rounded {
  font-size: 22px;
  color: var(--primary);
}

.settings-btn .material-symbols-rounded {
  font-size: 22px;
  color: var(--primary);
}

.settings-btn.danger {
  color: var(--danger);
}

.settings-btn.danger .material-symbols-rounded {
  color: var(--danger);
}

/* Toggle Switch */
.switch {
  position: relative;
  width: 48px;
  height: 26px;
  display: inline-block;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 26px;
  transition: background var(--transition);
  cursor: pointer;
}

.slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .15);
}

.switch input:checked+.slider {
  background: var(--primary);
}

.switch input:checked+.slider::before {
  transform: translateX(22px);
}

.app-version {
  text-align: center;
  font-size: .72rem;
  color: var(--text-secondary);
  padding: 16px;
}

/* ---------- MODAL ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  display: grid;
  place-items: end center;
  z-index: 500;
  animation: fadeIn .2s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.modal {
  background: var(--surface);
  width: 100%;
  max-width: 520px;
  max-height: 85dvh;
  overflow-y: auto;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 20px 32px;
  animation: slideUp .3s ease;
  transition: background var(--transition);
}

@keyframes slideUp {
  from {
    transform: translateY(100%);
  }

  to {
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.1rem;
  font-weight: 700;
}

/* ---------- FORMS ---------- */
.form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.form-label input,
.form-label textarea,
.form-label select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: .9rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.form-label input:focus,
.form-label textarea:focus,
.form-label select:focus {
  border-color: var(--primary);
}

.form-label textarea {
  resize: vertical;
}

.form-hint {
  font-size: .7rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-label.half {
  flex: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  padding: 12px;
  border-radius: var(--radius-xs);
  font-weight: 700;
  font-size: .95rem;
  transition: background var(--transition), transform .15s;
  justify-content: center;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-primary:active {
  transform: scale(.97);
}

.btn-full {
  width: 100%;
  display: flex;
}

/* ---------- TOAST ---------- */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 24px;
  border-radius: 24px;
  font-size: .85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 600;
  animation: toastIn .3s ease;
  white-space: nowrap;
}

.toast.hidden {
  display: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ---------- RESPONSIVE — DESKTOP ---------- */

/* Tablet: center modal, round nav corners */
@media (min-width: 768px) {
  .modal {
    border-radius: var(--radius);
    margin-bottom: 40px;
  }

  .modal-overlay {
    place-items: center;
  }
}

/* Desktop: sidebar nav + wide content */
@media (min-width: 860px) {
  #app {
    max-width: 1200px;
    display: grid;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto 1fr;
    min-height: 100dvh;
    gap: 0;
  }

  /* Header: spans full width */
  #app-header {
    grid-column: 1 / -1;
    position: sticky;
    top: 44px;
    /* below the sub-nav bar */
    border-radius: 0;
    padding: 16px 32px;
  }

  .header-title {
    font-size: 1.5rem;
  }

  /* Bottom nav → Sidebar nav */
  #bottom-nav {
    position: sticky;
    top: calc(44px + 60px);
    /* sub-nav + header height */
    height: calc(100dvh - 44px - 60px);
    width: 220px;
    max-width: none;
    left: auto;
    transform: none;
    bottom: auto;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 20px 12px;
    gap: 4px;
    border-top: none;
    border-right: 1px solid var(--border);
    box-shadow: none;
    overflow-y: auto;
    z-index: 50;
  }

  .nav-item {
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-xs);
    font-size: 0.9rem;
  }

  .nav-item .material-symbols-rounded {
    font-size: 22px;
  }

  .nav-label {
    font-size: 0.85rem;
    letter-spacing: 0;
  }

  .nav-item.active {
    background: var(--primary);
    color: #fff;
  }

  .nav-item.active .material-symbols-rounded {
    transform: none;
  }

  /* Main content: wider area */
  #main-content {
    padding: 28px 36px 40px !important;
    grid-column: 2;
    grid-row: 2;
    overflow-y: auto;
    max-height: calc(100dvh - 44px - 60px);
  }

  /* Dashboard grid: 4 columns on desktop */
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .dash-card {
    padding: 20px;
    border-radius: var(--radius);
  }

  .dash-card .material-symbols-rounded {
    font-size: 32px;
  }

  .dash-value {
    font-size: 1.3rem;
  }

  .dash-label {
    font-size: 0.75rem;
  }

  .dash-date {
    grid-column: auto;
  }

  /* Section title */
  .section-title {
    font-size: 1.2rem;
    margin-bottom: 16px;
  }

  /* Task list: wider cards */
  .task-card {
    padding: 18px 22px;
    border-radius: var(--radius);
  }

  .task-card-title {
    font-size: 1rem;
  }

  .task-card-desc {
    font-size: 0.85rem;
  }

  /* Filter bar: larger pills */
  .filter-pill,
  .cat-pill {
    padding: 8px 20px;
    font-size: 0.85rem;
  }

  /* Notes grid: 3 columns */
  .notes-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .note-card {
    padding: 20px;
    min-height: 140px;
    border-radius: var(--radius);
  }

  .note-card-title {
    font-size: 0.95rem;
  }

  .note-card-content {
    font-size: 0.85rem;
  }

  /* Budget: 3 columns */
  .budget-summary {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }

  .budget-card {
    padding: 20px;
    border-radius: var(--radius);
  }

  .balance-card {
    grid-column: auto;
  }

  .budget-amount {
    font-size: 1.3rem;
  }

  .budget-actions {
    max-width: 400px;
  }

  /* Clock hero: wider */
  .clock-hero {
    padding: 40px 32px;
    border-radius: var(--radius);
  }

  .clock-hero-time {
    font-size: 4rem;
  }

  .clock-list {
    max-height: none;
    padding-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* FAB */
  .fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 60px;
    height: 60px;
  }

  /* Toast */
  .toast {
    bottom: 32px;
  }

  /* Settings */
  .settings-group {
    max-width: 600px;
  }

  /* Modal */
  .modal {
    max-width: 560px;
  }

  /* Empty state */
  .empty-state {
    padding: 60px 20px;
  }

  .empty-icon {
    font-size: 56px;
  }
}

/* Extra-wide screens */
@media (min-width: 1200px) {
  .dashboard-grid {
    gap: 20px;
  }

  .notes-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .clock-list {
    grid-template-columns: repeat(3, 1fr);
  }

  #main-content {
    padding: 32px 48px 40px !important;
  }
}