/* ===================== Glass theme (variant C): light + dark ===================== */
:root, :root[data-theme="light"] {
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Inter, system-ui, sans-serif;
  --page: linear-gradient(160deg, #dfe8ff 0%, #f4e9ff 48%, #ffe9e0 100%);
  --glow1: #8fb4ff; --glow2: #ffb48f;
  --bg: rgba(255,255,255,.5); --panel-bg: rgba(255,255,255,.58);
  --sidebar-bg: rgba(255,255,255,.5); --sidebar-fg: #5c5c66;
  --text: #16161a; --text-dim: #5c5c66; --border: rgba(22,22,26,.1);
  --accent: #16161a; --accent-strong: #16161a; --accent-ink: #ffffff;
  --accent-2: #1f9d6a; --danger: #e5484d; --warn: #d9822b;
  --glass-edge: rgba(255,255,255,.8); --glass-shadow: 0 8px 30px rgba(80,90,140,.12);
  --radius: 22px; --shadow: 0 8px 30px rgba(80,90,140,.12);
  --badge-planned-bg: rgba(67,90,146,.14); --badge-planned-fg: #435a92;
  --badge-progress-bg: rgba(217,130,43,.16); --badge-progress-fg: #a8601c;
  --badge-done-bg: rgba(31,157,106,.16); --badge-done-fg: #167a53;
  --badge-paused-bg: rgba(229,72,77,.14); --badge-paused-fg: #b8383c;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --page: linear-gradient(160deg, #0f1220 0%, #1a1530 50%, #251719 100%);
    --glow1: #3d5bd9; --glow2: #c4592b;
    --bg: rgba(255,255,255,.06); --panel-bg: rgba(255,255,255,.075);
    --sidebar-bg: rgba(30,30,44,.55); --sidebar-fg: #a6a6b4;
    --text: #f5f5f7; --text-dim: #a1a1ad; --border: rgba(255,255,255,.1);
    --accent: #f5f5f7; --accent-strong: #f5f5f7; --accent-ink: #16161a;
    --accent-2: #3ddc97; --danger: #ff6b70; --warn: #ffb05c;
    --glass-edge: rgba(255,255,255,.14); --glass-shadow: 0 10px 34px rgba(0,0,0,.38);
    --shadow: 0 10px 34px rgba(0,0,0,.38);
    --badge-planned-bg: rgba(120,150,255,.18); --badge-planned-fg: #b3c3ff;
    --badge-progress-bg: rgba(255,176,92,.18); --badge-progress-fg: #ffc98f;
    --badge-done-bg: rgba(61,220,151,.16); --badge-done-fg: #7ae8b8;
    --badge-paused-bg: rgba(255,107,112,.16); --badge-paused-fg: #ff9a9d;
    color-scheme: dark;
  }
}
:root[data-theme="dark"], :root[data-theme="blue"], :root[data-theme="black"], :root[data-theme="black-gold"] {
  --page: linear-gradient(160deg, #0f1220 0%, #1a1530 50%, #251719 100%);
  --glow1: #3d5bd9; --glow2: #c4592b;
  --bg: rgba(255,255,255,.06); --panel-bg: rgba(255,255,255,.075);
  --sidebar-bg: rgba(30,30,44,.55); --sidebar-fg: #a6a6b4;
  --text: #f5f5f7; --text-dim: #a1a1ad; --border: rgba(255,255,255,.1);
  --accent: #f5f5f7; --accent-strong: #f5f5f7; --accent-ink: #16161a;
  --accent-2: #3ddc97; --danger: #ff6b70; --warn: #ffb05c;
  --glass-edge: rgba(255,255,255,.14); --glass-shadow: 0 10px 34px rgba(0,0,0,.38);
  --shadow: 0 10px 34px rgba(0,0,0,.38);
  --badge-planned-bg: rgba(120,150,255,.18); --badge-planned-fg: #b3c3ff;
  --badge-progress-bg: rgba(255,176,92,.18); --badge-progress-fg: #ffc98f;
  --badge-done-bg: rgba(61,220,151,.16); --badge-done-fg: #7ae8b8;
  --badge-paused-bg: rgba(255,107,112,.16); --badge-paused-fg: #ff9a9d;
  color-scheme: dark;
}

html { background: var(--page); background-attachment: fixed; }
body { font-family: var(--font-ui); background: transparent; color: var(--text); -webkit-font-smoothing: antialiased; letter-spacing: -.1px; }
body::before, body::after { content: ""; position: fixed; border-radius: 50%; pointer-events: none; z-index: 0; }
body::before { width: 420px; height: 420px; top: -140px; right: -120px; background: radial-gradient(circle, var(--glow1) 0%, transparent 66%); opacity: .75; }
body::after { width: 380px; height: 380px; bottom: -120px; left: -110px; background: radial-gradient(circle, var(--glow2) 0%, transparent 66%); opacity: .6; }
.app { position: relative; z-index: 1; background: transparent; }

/* glass surfaces */
.panel, .card, .project-card, .client-card, .task-card, .task-column, .list-box, .modal, .lock-box, .dp-popover {
  background: var(--panel-bg); border: 1px solid var(--glass-edge); border-radius: var(--radius);
  box-shadow: var(--glass-shadow); -webkit-backdrop-filter: blur(26px) saturate(1.6); backdrop-filter: blur(26px) saturate(1.6);
}
.modal-overlay { background: rgba(10,10,20,.35); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.card-value { letter-spacing: -1px; font-weight: 700; }
.view-header h1 { font-size: 34px; font-weight: 700; letter-spacing: -.9px; }
.subtitle, .card-label, .import-desc { color: var(--text-dim); }

/* buttons & fields */
.btn { border-radius: 999px; border: 1px solid var(--glass-edge); background: var(--bg); color: var(--text); font-weight: 600; padding: 9px 16px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); transition: transform .15s ease, background .15s ease; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn-danger { color: var(--danger); }
.btn-small { padding: 6px 12px; }
input, select, textarea { font-family: inherit; background: var(--bg); color: var(--text); border: 1px solid var(--glass-edge); border-radius: 14px; }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--text) 35%, transparent); outline-offset: 0; }
.type-tag, .badge { border-radius: 999px; }
.table th, table th { color: var(--text-dim); font-weight: 600; }
.table td, .table th, table td, table th { border-color: var(--border); }
.import-dropzone { background: var(--bg); border: 1.5px dashed var(--border); border-radius: 22px; }
.import-dropzone:hover { border-color: var(--text-dim); background: var(--panel-bg); }
.import-dropzone-icon { background: var(--accent); color: var(--accent-ink); }
.import-status { background: var(--bg); border: 1px solid var(--glass-edge); border-radius: 18px; }

/* sidebar (desktop) */
.sidebar { background: var(--sidebar-bg); color: var(--sidebar-fg); -webkit-backdrop-filter: blur(26px) saturate(1.6); backdrop-filter: blur(26px) saturate(1.6);
  margin: 12px 0 12px 12px; border-radius: 26px; border: 1px solid var(--glass-edge); height: calc(100vh - 24px); }
.brand-name { color: var(--text); }
.nav-item { color: var(--sidebar-fg); border-radius: 14px; }
.nav-icon { color: var(--text-dim); }
.nav-item:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.nav-item:hover .nav-icon { color: var(--text); }
.nav-item.active { background: var(--accent); color: var(--accent-ink); }
.nav-item.active .nav-icon { color: var(--accent-ink); }
.nav-item.active::before { display: none; }
.lang-switch { background: var(--bg); }
.lang-switch button { color: var(--text-dim); }
.lang-switch button.active { background: var(--accent); color: var(--accent-ink); }
.sidebar-footer { color: var(--text-dim); }
.content { background: transparent; }
.theme-swatch.active { border-color: var(--text); }

/* floating add button + floating tab bar on phones */
#fabAdd { display: none; }
@media (max-width: 700px) {
  html { background-attachment: scroll; }
  .app { flex-direction: column; height: 100dvh; }
  .sidebar {
    position: fixed; left: 14px; right: 14px; bottom: calc(12px + env(safe-area-inset-bottom)); width: auto; height: 66px; margin: 0; z-index: 30;
    flex-direction: row; align-items: center; padding: 7px; border-radius: 33px; overflow-x: auto; overflow-y: hidden; gap: 0;
    box-shadow: 0 14px 40px rgba(20,20,40,.22); scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar .brand, .sidebar-footer, .lang-switch { display: none; }
  .sidebar .nav { flex-direction: row; flex: none; gap: 2px; }
  .nav-item { flex-direction: column; justify-content: center; gap: 2px; min-width: 62px; height: 52px; padding: 4px 8px; border-radius: 26px; font-size: 10px; white-space: nowrap; }
  .nav-icon { width: 22px; height: 22px; }
  .nav-label { font-size: 10px; font-weight: 600; }
  .content { padding: calc(20px + env(safe-area-inset-top)) 16px calc(120px + env(safe-area-inset-bottom)); }
  .view-header h1 { font-size: 30px; }
  .panel, .import-panel { padding: 18px; border-radius: 24px; }
  #fabAdd {
    display: grid; place-items: center; position: fixed; right: 22px; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 31;
    width: 56px; height: 56px; border-radius: 28px; border: 0; background: var(--accent); color: var(--accent-ink);
    font-size: 30px; font-weight: 300; line-height: 1; box-shadow: 0 10px 24px rgba(20,20,40,.3); cursor: pointer;
  }
  body[data-view="settings"] #fabAdd, body[data-view="import"] #fabAdd, body[data-view="changelog"] #fabAdd,
  body[data-view="calendar"] #fabAdd, body[data-view="analytics"] #fabAdd { display: none; }
}

.chart-box, .donut-wrap, .bars-chart { background: transparent !important; border: 0 !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
.chart-box svg text, .bars-chart text { fill: var(--text-dim); }
.card-value { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.cards-row { gap: 12px; }
@media (max-width: 700px) {
  .cards-row { display: grid; grid-template-columns: 1fr 1fr; }
  .cards-row .card { padding: 14px 16px; }
  .card-value { font-size: 22px; }
}
.bars-chart .bar-group { flex: 1 1 0; min-width: 0; }
@media (max-width: 700px) {
  .bars-chart { gap: 3px; }
  .bars-chart .bar-pair { gap: 2px; }
  .bars-chart .bar { width: 6px; }
  .bars-chart .bar-label { font-size: 8px; text-align: center; overflow-wrap: anywhere; line-height: 1.15; }
}
.card-value, .card-value * { font-family: var(--font-ui) !important; }

/* ===================== variant C — Apple-style screens ===================== */
:root, :root[data-theme="light"] { --ic-bg: rgba(255,255,255,.8); --ic-edge: rgba(255,255,255,.9); --bar-off: rgba(22,22,26,.14); --sep: rgba(255,255,255,.75); --pos: #1f9d6a; --float-fg: #6e6e78; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --ic-bg: rgba(255,255,255,.1); --ic-edge: rgba(255,255,255,.16); --bar-off: rgba(255,255,255,.16); --sep: rgba(255,255,255,.09); --pos: #3ddc97; --float-fg: #9a9aa8; } }
:root[data-theme="dark"], :root[data-theme="blue"], :root[data-theme="black"], :root[data-theme="black-gold"] { --ic-bg: rgba(255,255,255,.1); --ic-edge: rgba(255,255,255,.16); --bar-off: rgba(255,255,255,.16); --sep: rgba(255,255,255,.09); --pos: #3ddc97; --float-fg: #9a9aa8; }

.glass { background: var(--panel-bg); border: 1px solid var(--glass-edge); border-radius: 28px; box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(26px) saturate(1.6); backdrop-filter: blur(26px) saturate(1.6); }
.hero { padding: 20px 20px 18px; margin-bottom: 12px; }
.hero small { font-size: 13px; color: var(--text-dim); }
.hero .big { font-size: 42px; font-weight: 700; letter-spacing: -1.5px; margin: 2px 0 14px; line-height: 1.1; }
.hero .big.neg { color: var(--danger); }
.hero .bars { display: flex; align-items: flex-end; gap: 7px; height: 64px; }
.hero .bars i { flex: 1; border-radius: 7px; background: var(--bar-off); min-height: 6px; }
.hero .bars i.on { background: var(--accent); }
#financeHero .big { margin-bottom: 2px; }
.two { display: flex; gap: 12px; margin-bottom: 12px; }
.two .glass { flex: 1; padding: 14px 16px; min-width: 0; }
.two small { font-size: 12px; color: var(--text-dim); display: block; }
.two b { font-size: 21px; letter-spacing: -.5px; font-weight: 700; display: block; white-space: nowrap; }
.sec-label { font-size: 13px; font-weight: 600; color: var(--text-dim); margin: 18px 6px 8px; letter-spacing: .1px; }
.glass.list { margin-bottom: 14px; overflow: hidden; padding: 2px 0; }
.li { display: flex; align-items: center; gap: 12px; padding: 11px 16px; position: relative; }
.li + .li { border-top: 1px solid var(--sep); }
.li .ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--ic-bg); border: 1px solid var(--ic-edge); }
.li .ic svg { width: 19px; height: 19px; stroke: var(--text); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.li .t { flex: 1; min-width: 0; }
.li .t b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .t .s { font-size: 12.5px; color: var(--text-dim); }
.li .a { font-size: 15px; font-weight: 600; letter-spacing: -.2px; white-space: nowrap; }
.li .a.pos { color: var(--pos); }
.tx-del { border: 0; background: transparent; color: var(--text-dim); font-size: 22px; line-height: 1; width: 28px; height: 28px; border-radius: 14px; cursor: pointer; }
.tx-del:hover { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.glass .list-empty { padding: 22px 16px; text-align: center; color: var(--text-dim); }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; }
.mini-stats .card { padding: 14px 16px; border-radius: 22px; }
.mini-stats .card-value { font-size: 20px; }

/* header: big title, compact month stepper */
.view-header { margin-bottom: 14px; }
.view-header h1 { font-size: 34px; font-weight: 700; letter-spacing: -.9px; }
.month-nav { display: inline-flex; align-items: center; gap: 4px; background: var(--bg); border: 1px solid var(--glass-edge); border-radius: 999px; padding: 3px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.month-nav .btn { border: 0; background: transparent; padding: 6px 12px; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.month-nav input[type=month] { border: 0; background: transparent; font-weight: 600; padding: 6px 4px; min-width: 0; width: 150px; }
.header-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* iOS segmented control for switches */
.lang-switch { border: 1px solid var(--glass-edge); border-radius: 999px; padding: 3px; }
.lang-switch button { border-radius: 999px; font-weight: 600; }

/* inputs: grouped, soft */
input, select, textarea { border-radius: 14px; padding: 11px 14px; font-size: 16px; }
.btn-primary { box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 28%, transparent); }

/* more sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; }
.sheet-wrap.hidden { display: none; }
.sheet-back { position: absolute; inset: 0; background: rgba(10,10,20,.32); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sheet { position: relative; width: 100%; border-radius: 30px 30px 0 0; padding: 10px 18px calc(28px + env(safe-area-inset-bottom)); animation: sheetUp .25s ease; }
.sheet-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 16px; }
.sheet-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.sheet-item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border: 1px solid var(--glass-edge); background: var(--bg); color: var(--text); border-radius: 22px; font: 600 12px var(--font-ui); cursor: pointer; }
.sheet-item.on { background: var(--accent); color: var(--accent-ink); }
.sheet-item .nav-icon { width: 26px; height: 26px; display: block; }
.sheet-item .nav-icon svg { width: 100%; height: 100%; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.nav-more { display: none; }

@media (max-width: 700px) {
  .nav-item:not(.tab-main):not(.nav-more) { display: none; }
  .nav-more { display: flex; }
  .sidebar { height: 64px; justify-content: space-around; border-radius: 32px; overflow: hidden; padding: 6px 8px; }
  .sidebar .nav { flex: 1; justify-content: space-around; }
  .nav-item { min-width: 0; flex: 1; height: 52px; width: 52px; max-width: 64px; border-radius: 26px; color: var(--float-fg); }
  .nav-item .nav-label { display: none; }
  .nav-icon { width: 25px; height: 25px; }
  .nav-icon svg { stroke-width: 1.7; }
  .nav-item.active { width: 52px; flex: none; }
  .view-header { flex-direction: column; align-items: flex-start; gap: 10px; }
  .view-header h1 { font-size: 30px; }
  .hero .big { font-size: 40px; }
  .view-header .subtitle { margin-top: 2px; }
}
@media (min-width: 701px) {
  #view-dashboard .hero, #view-dashboard .two, #view-dashboard .glass.list, #view-dashboard .sec-label,
  #view-finance .hero, #view-finance .two, #view-finance .glass.list, #view-finance .sec-label { max-width: 760px; }
}
.modal { border-radius: 30px; }
@media (max-width: 700px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-width: none; max-height: 92dvh; border-radius: 30px 30px 0 0; animation: sheetUp .25s ease; }
}
.month-nav input[type=month]::-webkit-calendar-picker-indicator { display: none; }
.month-nav input[type=month] { width: 140px; text-align: center; font-size: 15px; }
@media (max-width: 700px) {
  .filters { flex-direction: column; align-items: stretch; gap: 10px; }
  .filters input, .filters select { width: 100%; }
}
