:root {
  --bg: #f6f4ee;
  --sidebar-bg: #14120f;
  --sidebar-fg: #cbc3ae;
  --panel-bg: #fffdfa;
  --text: #211d15;
  --text-dim: #78715f;
  --border: #e7e1d2;
  --accent: #c69a3c;
  --accent-strong: #8a6a1c;
  --accent-2: #1f9d6a;
  --danger: #c2483c;
  --warn: #d17f2a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(30,24,10,0.05);
  --font-mono: ui-monospace, "SF Mono", "Menlo", monospace;
  --badge-planned-bg: #e7ecf7; --badge-planned-fg: #435a92;
  --badge-progress-bg: #f7ecd2; --badge-progress-fg: #96650f;
  --badge-done-bg: #d9f3e5; --badge-done-fg: #167a53;
  --badge-paused-bg: #f7e1de; --badge-paused-fg: #a63f2f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: #100e0b;
    --sidebar-bg: #0a0908;
    --sidebar-fg: #a89b7c;
    --panel-bg: #1a1712;
    --text: #f3ecd9;
    --text-dim: #93896f;
    --border: #2c2820;
    --accent: #d9af52;
    --accent-strong: #d9af52;
    --accent-2: #2bb37e;
    --danger: #e2695c;
    --warn: #dd9a3f;
    --shadow: 0 1px 2px rgba(0,0,0,0.4);
    --badge-planned-bg: #22283d; --badge-planned-fg: #a9b7e6;
    --badge-progress-bg: #3d3320; --badge-progress-fg: #e8c377;
    --badge-done-bg: #15382b; --badge-done-fg: #6fdcae;
    --badge-paused-bg: #3a231f; --badge-paused-fg: #f0a394;
  }
}

:root[data-theme="light"] {
  --bg: #f6f4ee; --sidebar-bg: #14120f; --sidebar-fg: #cbc3ae; --panel-bg: #fffdfa;
  --text: #211d15; --text-dim: #78715f; --border: #e7e1d2;
  --accent: #c69a3c; --accent-strong: #8a6a1c; --accent-2: #1f9d6a; --danger: #c2483c; --warn: #d17f2a;
  --shadow: 0 1px 2px rgba(30,24,10,0.05);
  --badge-planned-bg: #e7ecf7; --badge-planned-fg: #435a92;
  --badge-progress-bg: #f7ecd2; --badge-progress-fg: #96650f;
  --badge-done-bg: #d9f3e5; --badge-done-fg: #167a53;
  --badge-paused-bg: #f7e1de; --badge-paused-fg: #a63f2f;
}

:root[data-theme="dark"] {
  --bg: #100e0b; --sidebar-bg: #0a0908; --sidebar-fg: #a89b7c; --panel-bg: #1a1712;
  --text: #f3ecd9; --text-dim: #93896f; --border: #2c2820;
  --accent: #d9af52; --accent-strong: #d9af52; --accent-2: #2bb37e; --danger: #e2695c; --warn: #dd9a3f;
  --shadow: 0 1px 2px rgba(0,0,0,0.4);
  --badge-planned-bg: #22283d; --badge-planned-fg: #a9b7e6;
  --badge-progress-bg: #3d3320; --badge-progress-fg: #e8c377;
  --badge-done-bg: #15382b; --badge-done-fg: #6fdcae;
  --badge-paused-bg: #3a231f; --badge-paused-fg: #f0a394;
}

:root[data-theme="blue"] {
  --bg: #0b1220; --sidebar-bg: #060a14; --sidebar-fg: #93a8c9; --panel-bg: #101a2e;
  --text: #eaf1ff; --text-dim: #7e93b8; --border: #1c2c47;
  --accent: #3f8ff2; --accent-strong: #3f8ff2; --accent-2: #22b880; --danger: #ef6b6b; --warn: #e0a542;
  --shadow: 0 1px 2px rgba(0,10,40,0.4);
  --badge-planned-bg: #1c2c47; --badge-planned-fg: #9db8e8;
  --badge-progress-bg: #3a2f18; --badge-progress-fg: #e8c377;
  --badge-done-bg: #0f3327; --badge-done-fg: #6fe0b3;
  --badge-paused-bg: #3a1f22; --badge-paused-fg: #f0a3a3;
}

:root[data-theme="black"] {
  --bg: #000000; --sidebar-bg: #000000; --sidebar-fg: #9c9c9c; --panel-bg: #0d0d0d;
  --text: #f2f2f2; --text-dim: #8a8a8a; --border: #232323;
  --accent: #cda44e; --accent-strong: #cda44e; --accent-2: #29b57f; --danger: #e2685c; --warn: #cf9a45;
  --shadow: 0 1px 2px rgba(0,0,0,0.5);
  --badge-planned-bg: #1c1c1c; --badge-planned-fg: #a9b7e6;
  --badge-progress-bg: #242018; --badge-progress-fg: #e8c377;
  --badge-done-bg: #122019; --badge-done-fg: #6fdcae;
  --badge-paused-bg: #241818; --badge-paused-fg: #f0a394;
}

:root[data-theme="black-gold"] {
  --bg: #0a0806; --sidebar-bg: #000000; --sidebar-fg: #cbb27a; --panel-bg: #151210;
  --text: #f6eed9; --text-dim: #a2916c; --border: #2f2717;
  --accent: #e0b94e; --accent-strong: #e0b94e; --accent-2: #2bb37e; --danger: #dd6355; --warn: #c98f2e;
  --shadow: 0 1px 2px rgba(0,0,0,0.6);
  --badge-planned-bg: #1a2233; --badge-planned-fg: #9fb3dd;
  --badge-progress-bg: #332a14; --badge-progress-fg: #e8c377;
  --badge-done-bg: #11291f; --badge-done-fg: #63cd9d;
  --badge-paused-bg: #2e1a16; --badge-paused-fg: #e79484;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

button {
  font-family: inherit;
}

/* ---------- Lock screen ---------- */
.lock-screen {
  position: fixed; inset: 0;
  background: var(--sidebar-bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.lock-box {
  position: relative;
  background: var(--panel-bg);
  padding: 40px 36px;
  border-radius: 14px;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  width: 320px;
  text-align: center;
  overflow: hidden;
}
.lock-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--accent);
}
.lock-logo {
  width: 64px; height: 64px; margin: 0 auto 12px;
  border-radius: 16px; overflow: hidden;
  border: 1px solid var(--border);
}
.lock-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lock-box h1 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.2px; }
.lock-box p { color: var(--text-dim); font-size: 13px; margin: 0 0 18px; }
.lock-box input {
  width: 100%; padding: 12px; font-size: 20px; text-align: center;
  letter-spacing: 6px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); margin-bottom: 10px;
}
.lock-error { color: var(--danger); font-size: 12px; min-height: 16px; margin-bottom: 6px; }

/* ---------- Layout ---------- */
.app { display: flex; height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-fg);
  display: flex; flex-direction: column;
  padding: 20px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 20px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px; overflow: hidden;
  flex-shrink: 0;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-name { font-weight: 700; font-size: 14.5px; color: #fff; line-height: 1.15; letter-spacing: -.1px; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  text-align: left; background: none; border: none; color: var(--sidebar-fg);
  padding: 10px 12px; border-radius: 10px; font-size: 13.5px; cursor: pointer;
  display: flex; align-items: center; gap: 11px; position: relative;
  transition: background .18s ease, color .18s ease;
}
.nav-icon {
  width: 22px; height: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #7d7666; transition: color .18s ease, transform .18s ease;
}
.nav-icon svg { width: 18px; height: 18px; }
.nav-label { font-weight: 500; letter-spacing: .1px; }
.nav-item:hover { background: rgba(255,255,255,0.06); }
.nav-item:hover .nav-icon { color: #d8cfb5; }
.nav-item.active {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: #fff;
}
.nav-item.active .nav-icon { color: #fff; transform: scale(1.04); }
.nav-item.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px;
  background: var(--accent);
}
.sidebar-footer { font-size: 11px; color: #5c5646; padding: 8px; }

/* ---------- Language switcher ---------- */
.lang-switch {
  display: flex; gap: 3px; padding: 3px; margin: 4px 8px 10px;
  background: rgba(255,255,255,0.04); border-radius: 10px;
}
.lang-switch button {
  flex: 1; border: none; background: none; color: #7d7666;
  font-size: 11px; font-weight: 600; letter-spacing: .3px; padding: 6px 0;
  border-radius: 7px; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.lang-switch button:hover { color: #d8cfb5; }
.lang-switch button.active {
  background: var(--accent); color: #241c0c;
}
.lang-switch-panel {
  background: var(--bg); max-width: 260px;
}
.lang-switch-panel button { color: var(--text-dim); }
.lang-switch-panel button:hover { color: var(--text); }

.content { flex: 1; overflow-y: auto; padding: 30px 36px 60px; }
.view { display: none; }
.view.active { display: block; }

.view-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 22px; flex-wrap: wrap; gap: 10px;
}
.view-header h1 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -.3px; }
.subtitle { color: var(--text-dim); margin: 4px 0 0; font-size: 13px; }
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ---------- Buttons / inputs ---------- */
.btn {
  border: 1px solid var(--border); background: var(--panel-bg); color: var(--text);
  padding: 9px 16px; border-radius: 9px; font-size: 13px; cursor: pointer;
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}
.btn:hover { box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  color: #241c0c; border: none; font-weight: 700; letter-spacing: .1px;
}
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, black); }
.btn-danger { background: var(--danger); color: white; border: none; }
.btn-small { padding: 5px 10px; font-size: 12px; }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0; color: var(--text-dim);
}
.btn-icon svg, .btn-icon .icon svg { width: 14px; height: 14px; display: block; }
.btn-icon:hover { color: var(--accent-strong); }
.btn-icon-danger:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }

.icon { display: inline-flex; }
.icon svg { width: 16px; height: 16px; }
.icon-xs svg { width: 10px; height: 10px; }
.cal-chip-deadline { display: flex; align-items: center; gap: 4px; color: var(--danger); }

.type-tag { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.type-tag .icon svg { width: 15px; height: 15px; }
.type-income { color: var(--accent-2); }
.type-expense { color: var(--danger); }

.status-ok { display: flex; align-items: center; gap: 7px; color: var(--accent-2); font-weight: 500; }
.status-ok .icon { background: color-mix(in srgb, var(--accent-2) 14%, transparent); border-radius: 50%; padding: 3px; }
.status-ok .icon svg { width: 13px; height: 13px; }

input, select, textarea {
  font-family: inherit; font-size: 13px; color: var(--text);
  background: var(--panel-bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-strong); outline-offset: -1px; }

.filters { display: flex; gap: 10px; margin-bottom: 16px; }
.filters input { flex: 1; }

/* ---------- Cards ---------- */
.cards-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 14px; margin-bottom: 20px; }
.card {
  background: var(--panel-bg); border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
  transition: border-color .15s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.card .card-label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
.card .card-value { font-family: var(--font-mono); font-size: 22px; font-weight: 600; letter-spacing: -.2px; font-variant-numeric: tabular-nums; }
.card .card-delta { font-size: 12px; margin-top: 4px; }
.delta-up { color: var(--accent-2); }
.delta-down { color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel-bg); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); margin-bottom: 16px; border: 1px solid var(--border);
}
.panel h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; letter-spacing: .1px; }
.panel-header-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.panel-header-row h3 { margin: 0; }
.chart-box { min-height: 220px; }
.list-box { display: flex; flex-direction: column; gap: 8px; max-height: 260px; overflow-y: auto; }
.list-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 8px; background: var(--bg); font-size: 13px;
}
.list-empty { color: var(--text-dim); font-size: 13px; padding: 10px 0; }

/* ---------- Bulk actions ---------- */
.bulk-actions {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding: 10px 14px; background: var(--panel-bg); border-radius: 10px; box-shadow: var(--shadow);
}
.bulk-actions #bulkCount { font-size: 13px; font-weight: 600; margin-right: auto; }

/* ---------- Projects grid ---------- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px,1fr)); gap: 14px; }
.project-card {
  background: var(--panel-bg); border-radius: var(--radius); padding: 34px 16px 16px;
  box-shadow: var(--shadow); border-left: 5px solid var(--accent); cursor: pointer;
  transition: transform .1s, box-shadow .15s; position: relative;
}
.project-card:hover { transform: translateY(-2px); }
.project-card.is-selected { box-shadow: 0 0 0 2px var(--accent), var(--shadow); }
.project-card .pc-select {
  position: absolute; top: 12px; left: 12px; width: 16px; height: 16px;
  accent-color: var(--accent); cursor: pointer; z-index: 2;
}
.project-card .pc-top { display: flex; justify-content: space-between; align-items: flex-start; }
.project-card .pc-top-actions { display: flex; align-items: center; gap: 6px; }
.project-card h4 { margin: 0 0 4px; font-size: 15px; }
.project-card .pc-client { color: var(--text-dim); font-size: 12px; margin-bottom: 10px; }
.project-card .pc-price { font-family: var(--font-mono); font-weight: 600; font-size: 16px; font-variant-numeric: tabular-nums; }
.pc-tasks {
  display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim);
  margin-top: 8px;
}
.pc-tasks .icon svg { width: 12px; height: 12px; }
.pc-paid-badge {
  display: inline-flex; align-items: center; gap: 3px; font-size: 10px; font-weight: 700;
  color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 14%, transparent); border-radius: 20px;
  padding: 2px 8px 2px 6px; vertical-align: middle; margin-left: 4px;
}
.pc-paid-badge .icon svg { width: 10px; height: 10px; }
.project-card .pc-percent {
  font-size: 11px; color: var(--accent-strong); font-weight: 600; margin-top: 2px;
  display: inline-flex; align-items: center; gap: 4px;
}
.project-card .pc-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-top: 10px; }
.badge {
  font-size: 11px; padding: 3px 9px; border-radius: 20px; font-weight: 600;
}
.badge-planned { background: var(--badge-planned-bg); color: var(--badge-planned-fg); }
.badge-in_progress { background: var(--badge-progress-bg); color: var(--badge-progress-fg); }
.badge-done { background: var(--badge-done-bg); color: var(--badge-done-fg); }
.badge-paused { background: var(--badge-paused-bg); color: var(--badge-paused-fg); }

/* ---------- Calendar ---------- */
.cal-nav { display: flex; align-items: center; gap: 10px; }
.month-nav { display: flex; align-items: center; gap: 6px; }
.month-nav input[type="month"] { min-width: 132px; }
.cal-label { font-weight: 600; min-width: 160px; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--text-dim); padding-bottom: 4px; }
.cal-day {
  background: var(--panel-bg); border-radius: 8px; min-height: 96px; padding: 8px;
  box-shadow: var(--shadow); cursor: pointer; position: relative;
  display: flex; flex-direction: column; gap: 4px;
}
.cal-day.other-month { opacity: 0.35; }
.cal-day.is-today { border: 2px solid var(--accent); }
.cal-day .cal-daynum { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.cal-plan-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); display: inline-block;
}
.hour-grid {
  display: flex; flex-direction: column; gap: 3px; max-height: 280px; overflow-y: auto;
  padding-right: 2px;
}
.hour-row { display: flex; align-items: center; gap: 8px; }
.hour-row:nth-child(odd) .hour-label { color: var(--text); font-weight: 600; }
.hour-label {
  width: 46px; flex-shrink: 0; font-size: 11px; color: var(--text-dim);
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
}
.hour-input {
  flex: 1; padding: 5px 9px; font-size: 12px;
}
.hour-event-chip {
  display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0;
  font-size: 10px; padding: 2px 6px; border-radius: 6px; color: var(--text);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hour-event-chip .icon svg { width: 9px; height: 9px; }
.cal-chip {
  font-size: 10px; padding: 2px 6px; border-radius: 6px; background: var(--bg);
  color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-chip-recurring { cursor: pointer; }
.cal-chip-recurring .icon svg { width: 9px; height: 9px; }

/* ---------- Weekday picker ---------- */
.weekday-picker { display: flex; gap: 6px; }
.weekday-btn {
  flex: 1; padding: 8px 0; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.weekday-btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.weekday-btn.active { background: var(--accent); color: #241c0c; border-color: var(--accent); }

/* ---------- Table ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; color: var(--text-dim); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.table tr:hover td { background: var(--bg); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,8,4,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 500;
}
.modal {
  background: var(--panel-bg); border-radius: 12px; padding: 26px;
  width: 460px; max-width: 92vw; max-height: 88vh; overflow-y: auto;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.modal h2 { margin-top: 0; font-size: 18px; }
.form-row { margin-bottom: 12px; display: flex; flex-direction: column; gap: 5px; }
.form-row label { font-size: 12px; color: var(--text-dim); }
.form-hint { font-size: 11px; color: var(--text-dim); }
.form-row input, .form-row select, .form-row textarea { width: 100%; }
.form-inline { display: flex; gap: 10px; }
.form-inline > div { flex: 1; }
.checkbox-row {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text);
  margin-bottom: 12px; cursor: pointer;
}
.checkbox-row input { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

.task-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; margin-bottom: 8px; }
.task-row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; background: var(--bg); border-left: 3px solid var(--danger); }
.task-row input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; flex-shrink: 0; }
.task-text { flex: 1; font-size: 13px; color: var(--text); }
.task-row.task-done { border-left-color: var(--accent-2); }
.task-row.task-done .task-text { text-decoration: line-through; color: var(--text-dim); }
.task-add-row { display: flex; gap: 8px; }
.task-add-row input { flex: 1; }

/* ---------- Changelog ---------- */
.changelog-entry { position: relative; padding-left: 24px; }
.changelog-entry::before {
  content: ''; position: absolute; left: 0; top: 24px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--accent);
}
.changelog-date {
  font-size: 11px; font-weight: 700; letter-spacing: .4px; color: var(--text-dim);
  text-transform: uppercase;
}
.changelog-title { margin: 6px 0 10px; font-size: 15px; }
.changelog-items { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.changelog-items li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text-dim); line-height: 1.4; }
.changelog-items .icon { color: var(--accent-2); flex-shrink: 0; margin-top: 2px; }
.changelog-items .icon svg { width: 13px; height: 13px; }

/* ---------- Buttons with inline icon (e.g. invoice) ---------- */
.btn .icon { display: inline-flex; vertical-align: -2px; margin-right: 6px; }
.btn .icon svg { width: 14px; height: 14px; }

/* ---------- Clients CRM ---------- */
.client-card h4 { display: flex; align-items: center; gap: 7px; }
.client-card h4 .icon { color: var(--accent-strong); flex-shrink: 0; }
.client-card h4 .icon svg { width: 15px; height: 15px; }
.client-notes-preview {
  margin-top: 10px; font-size: 12px; color: var(--text-dim); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.badge-paused .icon { display: inline-flex; margin-right: 4px; vertical-align: -2px; }
.badge-paused .icon svg { width: 11px; height: 11px; }

/* ---------- Goals ---------- */
.goals-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .goals-grid { grid-template-columns: 1fr; } }

/* ---------- Task board ---------- */
.task-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .task-board { grid-template-columns: 1fr; } }
.task-column {
  background: var(--panel-bg); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}
.task-column h3 { margin: 0 0 12px; font-size: 13px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .4px; }
.task-column-list { display: flex; flex-direction: column; gap: 10px; min-height: 40px; }
.task-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 12px;
  transition: border-color .15s ease;
}
.task-card:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.task-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.task-priority { font-size: 10px; font-weight: 700; letter-spacing: .3px; padding: 2px 8px; border-radius: 20px; text-transform: uppercase; }
.task-priority-low { background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2); }
.task-priority-med { background: color-mix(in srgb, var(--warn) 20%, transparent); color: var(--warn); }
.task-priority-high { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.task-card-title { font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; margin-bottom: 4px; }
.task-card-title:hover { color: var(--accent-strong); }
.task-card-project { font-size: 11.5px; color: var(--text-dim); margin-bottom: 4px; }
.task-card-deadline { font-size: 11px; color: var(--text-dim); }
.task-card-overdue { color: var(--danger); font-weight: 600; }
.task-card-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.task-card-actions .btn { padding: 4px 9px; font-size: 11px; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.color-swatch {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; transition: transform .12s ease, border-color .12s ease;
}
.color-swatch:hover { transform: scale(1.12); }
.color-swatch.active { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel-bg), 0 0 0 3px var(--text); }

/* ---------- Theme picker ---------- */
.theme-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.theme-swatch {
  display: flex; align-items: center; gap: 9px; padding: 9px 14px 9px 10px;
  border-radius: 9px; border: 1px solid var(--border); background: var(--bg);
  cursor: pointer; font-size: 13px; color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
.theme-swatch:hover { transform: translateY(-1px); }
.theme-swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.theme-dot { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.theme-dot-system { background: linear-gradient(135deg, #f6f4ee 50%, #100e0b 50%); }
.theme-dot-light { background: #f6f4ee; box-shadow: inset 0 0 0 1px #e7e1d2; }
.theme-dot-dark { background: #100e0b; }
.theme-dot-blue { background: linear-gradient(135deg, #0b1220, #3f8ff2); }
.theme-dot-black { background: #000; box-shadow: inset 0 0 0 1px #262626; }
.theme-dot-black-gold { background: linear-gradient(135deg, #0a0806, #e0b94e); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-wide { width: 520px; }
.fx-rows { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; max-height: 56vh; overflow-y: auto; padding-right: 2px; }
.fx-row { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px 2px; background: var(--bg); }
.fx-row-top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.fx-row-top .fx-type { flex: 1; width: auto; }

/* ---------- Import ---------- */
.import-panel { padding: 32px; }
.import-desc { color: var(--text-dim); font-size: 13.5px; line-height: 1.6; max-width: 560px; margin: 0 0 24px; }

.import-dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 56px 24px;
  border: 1.5px dashed var(--border); border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 3%, var(--bg));
  cursor: pointer; transition: border-color .2s ease, background .2s ease, transform .15s ease;
}
.import-dropzone:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
  transform: translateY(-2px);
}
.import-dropzone-icon {
  width: 64px; height: 64px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #241c0c;
}
.import-dropzone-icon svg { width: 28px; height: 28px; }
.import-dropzone-title { font-size: 16px; font-weight: 700; color: var(--text); }
.import-dropzone-sub {
  font-size: 11px; font-weight: 600; letter-spacing: .8px; color: var(--text-dim);
}

#importArea { margin-top: 22px; }
.import-status {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px; border-radius: 12px; background: var(--panel-bg);
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
.import-status-icon {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.import-status-icon svg { width: 20px; height: 20px; }
.import-status-processing .import-status-icon {
  background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-strong);
  animation: import-spin 1s linear infinite;
}
.import-status-success .import-status-icon {
  background: color-mix(in srgb, var(--accent-2) 16%, transparent); color: var(--accent-2);
}
.import-status-error .import-status-icon {
  background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger);
}
.import-status-title { font-size: 14px; font-weight: 600; color: var(--text); }
.import-status-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.import-stats { display: flex; gap: 10px; margin-top: 10px; }
.import-stat {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600;
  padding: 5px 12px; border-radius: 20px;
}
.import-stat-income { background: color-mix(in srgb, var(--accent-2) 14%, transparent); color: var(--accent-2); }
.import-stat-expense { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.import-stat svg { width: 13px; height: 13px; }
@keyframes import-spin { to { transform: rotate(360deg); } }

.import-table-wrap { overflow-x: auto; margin-top: 14px; }
.map-row { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.map-row label { width: 140px; font-size: 12px; color: var(--text-dim); }
.map-row select { flex: 1; }

/* ---------- Simple SVG chart helpers ---------- */
.bars-chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 10px; }
.bars-chart .bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bars-chart .bar-pair { display: flex; gap: 3px; align-items: flex-end; height: 100%; }
.bars-chart .bar { width: 12px; border-radius: 4px 4px 0 0; }
.bars-chart .bar-income { background: var(--accent-2); }
.bars-chart .bar-expense { background: var(--danger); }
.bars-chart .bar-label { font-size: 10px; color: var(--text-dim); margin-top: 6px; }
.legend { display: flex; gap: 16px; font-size: 12px; margin-top: 10px; color: var(--text-dim); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut-legend { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.donut-legend .dl-row { display: flex; align-items: center; gap: 6px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

/* ---------- Premium polish: scrollbars ---------- */
.content::-webkit-scrollbar, .list-box::-webkit-scrollbar, .sidebar::-webkit-scrollbar { width: 9px; height: 9px; }
.content::-webkit-scrollbar-track, .list-box::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb, .list-box::-webkit-scrollbar-thumb {
  background: rgba(130,120,95,0.28); border-radius: 20px; border: 2px solid transparent; background-clip: padding-box;
}
.content::-webkit-scrollbar-thumb:hover, .list-box::-webkit-scrollbar-thumb:hover { background: rgba(130,120,95,0.45); background-clip: padding-box; }

/* ---------- Profile picker (personal vs business) ---------- */
.profile-options { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.profile-option {
  display: flex; flex-direction: column; align-items: flex-start; gap: 3px;
  text-align: left; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); cursor: pointer;
  transition: border-color .15s ease, transform .12s ease;
}
.profile-option:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.profile-option.active { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent); }
.profile-option-title { font-size: 13.5px; font-weight: 600; }
.profile-option-desc { font-size: 11.5px; color: var(--text-dim); }

/* ---------- Custom date picker ---------- */
.dp-field { position: relative; }
.dp-field input.dp-input { width: 100%; padding-right: 34px; cursor: pointer; }
.dp-field .dp-icon { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--text-dim); display: flex; }
.dp-field .dp-icon svg { width: 15px; height: 15px; }
.dp-popover {
  background: var(--panel-bg); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3); padding: 12px; width: 240px; z-index: 600;
}
.dp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-nav .btn-small { padding: 3px 9px; }
.dp-label { font-size: 13px; font-weight: 600; text-transform: capitalize; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.dp-dow { font-size: 10px; color: var(--text-dim); text-align: center; padding-bottom: 4px; }
.dp-day {
  border: none; background: none; color: var(--text); font-size: 12px;
  padding: 6px 0; border-radius: 6px; cursor: pointer; font-variant-numeric: tabular-nums;
}
.dp-day:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.dp-day.active { background: var(--accent); color: #241c0c; font-weight: 700; }
.dp-footer { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }

/* ---------- Accessibility ---------- */
button:focus-visible, .nav-item:focus-visible, .theme-swatch:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent-strong); outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important; scroll-behavior: auto !important;
  }
}

/* ---------- Day agenda ---------- */
.agenda-place { display: inline-flex; align-items: center; gap: 3px; color: var(--text-dim); font-size: 12px; margin-left: 6px; }
.agenda-place .icon svg { width: 11px; height: 11px; }
.agenda-kind { font-size: 11px; color: var(--text-dim); margin-right: 6px; }


/* ---------- Bank from phone ---------- */
.bank-panel { margin-top: 20px; }
.bank-panel h3 { margin: 0 0 8px; font-size: 16px; }
.bank-dropzone { padding: 32px 24px; }
.bank-dropzone.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.bank-paste { width: 100%; margin: 16px 0 10px; resize: vertical; font-size: 13px; }
.bank-guide { margin-top: 20px; font-size: 13px; color: var(--text-dim); }
.bank-guide summary { cursor: pointer; font-weight: 600; color: var(--text); }
.bank-guide ol { margin: 10px 0 0; padding-left: 20px; line-height: 1.6; }

/* ---------- Phone layout (iPhone home-screen app) ---------- */
@media (max-width: 700px) {
  .app { flex-direction: column-reverse; height: 100dvh; }
  .sidebar {
    width: 100%; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    overflow-x: auto; overflow-y: hidden; gap: 2px; border-right: 0;
  }
  .sidebar .brand { display: none; }
  .sidebar .nav { flex-direction: row; flex: none; }
  .nav-item { flex-direction: column; gap: 3px; padding: 8px 12px; min-width: 64px; font-size: 10px; white-space: nowrap; }
  .nav-item.active::before { display: none; }
  .sidebar-footer { display: none; }
  .content { padding: calc(18px + env(safe-area-inset-top)) 16px 24px; }
  .modal { max-width: 94vw; }
  table { font-size: 12px; }
  .panel, .import-panel { padding: 18px; overflow-x: auto; }
}
