:root{--ink:#21352e;--muted:#718178;--paper:#f5f6f2;--line:#dde5dc;--brand:#2d644e;--card:#fff;--red:#a54d39;--bg-color:var(--paper);--text-color:var(--ink);--card-bg:var(--card);--input-bg:var(--card);--border-color:var(--line);--shadow:0 4px 20px #18342105;--task-shadow:none;--task-hover-bg:#f8faf5;--q1-color:#a54d39;--q2-color:#326b52;--q3-color:#9b741d;--q4-color:#687c98;--q1-grad:#bf7864;--q2-grad:#559175;--q3-grad:#c6a348;--q4-grad:#94a6bc}
*{box-sizing:border-box}body{font-family:Inter,system-ui,sans-serif;margin:0;background:var(--paper);color:var(--ink);line-height:1.5}button,input,select,textarea{font:inherit}button,a,input,select{touch-action:manipulation}button{cursor:pointer}a{color:var(--brand)}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #92b7a2;outline-offset:3px}[hidden]{display:none!important}.muted{color:var(--muted)}.eyebrow{text-transform:uppercase;letter-spacing:.16em;font-size:11px;font-weight:700;color:var(--muted)}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;font-weight:750;font-size:17px;color:var(--ink)}.mark{display:grid;grid-template-columns:1fr 1fr;gap:3px;width:27px;height:27px}.mark i{background:var(--brand);border-radius:2px}.mark i:nth-child(2){opacity:.5}.mark i:nth-child(3){opacity:.3}.mark i:nth-child(4){opacity:.7}.sidebar{position:fixed;inset:0 auto 0 0;width:218px;padding:30px 22px;background:var(--card);border-right:1px solid var(--line);display:flex;flex-direction:column;z-index:10}.sidebar .brand{margin-bottom:48px}.sidebar nav{display:grid;gap:6px}.sidebar a.navlink{display:block;text-decoration:none;color:var(--muted);padding:11px 12px;border-radius:7px;font-size:13px;font-weight:600}.sidebar a.current{background:#eaf0e9;color:var(--brand)}.sidebar-foot{margin-top:auto;font-size:12px;color:var(--muted);border-top:1px solid var(--line);padding-top:20px}.workspace{padding:32px 38px 72px;margin-left:218px;max-width:1600px}.page-top{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding-bottom:22px;margin-bottom:28px;gap:16px}.greeting{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:26px;gap:20px}.greeting h1{font-size:34px;line-height:1.2;letter-spacing:-1.3px;font-weight:650;margin:8px 0 10px}.greeting p{font-size:14px;color:var(--muted);margin:0}.btn{background:var(--card);border:1px solid var(--line);border-radius:7px;padding:9px 14px;color:var(--ink);text-decoration:none;font-size:13px;font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:7px}.btn.primary{background:var(--brand);color:#fff;border-color:var(--brand)}.btn.danger{color:var(--red)}.btn:disabled{opacity:.5;cursor:wait}.stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));border:1px solid var(--line);border-radius:10px;background:var(--card);margin:24px 0}.stat{padding:20px 22px}.stat+.stat{border-left:1px solid var(--line)}.stat span{font-size:12px;color:var(--muted)}.stat strong{display:block;font-size:30px;font-weight:550;letter-spacing:-1px;margin:4px 0}.stat small{font-size:11px;color:var(--muted)}.panel{border:1px solid var(--line);background:var(--card);border-radius:10px;overflow:hidden}.panel-header{display:flex;gap:15px;justify-content:space-between;align-items:center;padding:20px}.panel-header h2{font-size:17px;margin:0}.panel-header p{font-size:12px;color:var(--muted);margin:3px 0 0}.table-scroll{overflow:auto}table{border-collapse:collapse;width:100%;text-align:left;white-space:nowrap}th{font-size:10px;text-transform:uppercase;letter-spacing:.1em;font-weight:600;color:var(--muted);background:var(--paper)}td,th{padding:15px 20px;border-top:1px solid var(--line)}td{font-size:13px}.actions{display:flex;gap:6px;flex-wrap:wrap}.actions .btn{font-size:11px;padding:6px 8px}.pill{font-size:11px;background:#edf3eb;color:#396649;border-radius:20px;padding:4px 8px;display:inline-block}.pill.off{background:#f9ede8;color:var(--red)}.search-field,input.field,select.field{border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:7px;padding:10px 12px}.empty{padding:40px;text-align:center;color:var(--muted);font-size:13px}.notice{background:#fff4db;color:#775b18;border:1px solid #e8d6a6;border-radius:8px;padding:12px 16px;font-size:13px;margin-bottom:16px}.toast-admin{position:fixed;bottom:25px;right:25px;padding:14px 18px;background:#21352e;color:white;border-radius:8px;z-index:100}.audit{margin-top:24px}.audit ul{list-style:none;padding:0;margin:0}.audit li{padding:12px 20px;border-top:1px solid var(--line);font-size:12px}.audit time{color:var(--muted);margin-right:16px}dialog{border:1px solid var(--line);border-radius:12px;width:min(440px,92vw);padding:26px;color:var(--ink);background:var(--card)}dialog::backdrop{background:#182b2480;backdrop-filter:blur(3px)}dialog h2{margin:0 0 8px}dialog p{color:var(--muted);font-size:13px}label.form-label{display:grid;gap:6px;font-size:12px;margin:16px 0}.dialog-actions{display:flex;gap:8px;justify-content:flex-end;margin-top:22px}.form-error{color:#ae422f;font-size:13px;min-height:20px}.auth-layout{display:grid;grid-template-columns:1fr 1fr;min-height:100vh}.auth-story{padding:48px 64px;background:#e8eee4;display:flex;flex-direction:column;justify-content:space-between}.auth-story h1{font-size:clamp(36px,4vw,62px);letter-spacing:-2px;line-height:1.13;font-weight:550;max-width:520px}.auth-story p{font-size:16px;max-width:400px;color:#657763}.mini-matrix{display:grid;grid-template-columns:1fr 1fr;gap:10px;max-width:420px;margin:32px 0}.mini-matrix div{padding:22px;border-radius:9px;min-height:105px;background:#fff9;font-size:12px}.mini-matrix b{display:block;margin:8px 0;font-size:15px}.auth-main{display:grid;place-items:center;padding:32px;background:var(--card)}.auth-form{width:100%;max-width:370px}.auth-form h2{font-size:29px;letter-spacing:-.8px;margin:10px 0}.auth-form>.btn{width:100%}.auth-note{font-size:12px;color:var(--muted);text-align:center;margin-top:24px}.auth-form .field{width:100%}.auth-form .primary{width:100%;margin-top:14px;padding:12px}.auth-form p{color:var(--muted);font-size:13px}
@media(max-width:1100px){.sidebar{width:180px;padding:26px 15px}.workspace{margin-left:180px;padding:26px}.brand{font-size:14px}.stat{padding:16px}.auth-story{padding:36px}}
@media(max-width:760px){.sidebar{position:static;width:100%;padding:16px 20px;border-right:0;border-bottom:1px solid var(--line);display:block}.sidebar .brand{margin:0 0 12px}.sidebar nav{display:flex;gap:5px;flex-wrap:wrap}.sidebar a.navlink{padding:5px 8px;font-size:12px}.sidebar-foot{display:none}.workspace{margin:0;padding:20px 16px 60px}.page-top{margin-bottom:20px}.greeting{display:block}.greeting h1{font-size:28px}.greeting>.btn{margin-top:16px}.stats{grid-template-columns:repeat(2,1fr)}.stat:nth-child(3){border-left:0}.stat:nth-child(n+3){border-top:1px solid var(--line)}.panel-header{align-items:flex-start;flex-direction:column}.auth-layout{grid-template-columns:1fr}.auth-story{padding:24px}.auth-story h1{font-size:30px;letter-spacing:-1px}.auth-story p,.mini-matrix,.auth-story footer{display:none}.auth-main{padding:30px 24px}.greeting p{font-size:13px}}

/* One palette for app, admin, account pages and browser-native controls. */
html { color-scheme: light; background: var(--paper); }
html[data-theme="dark"] {
  color-scheme: dark;
  --paper:#111916; --card:#1b2721; --ink:#e4eee7; --muted:#acbdb1;
  --line:#3b5043; --brand:#96d2ad; --red:#ffa592;
  --bg-color:var(--paper); --text-color:var(--ink); --card-bg:var(--card);
  --input-bg:#152019; --border-color:var(--line); --task-hover-bg:#26372d;
  --shadow:0 8px 26px #0003; --task-shadow:none;
  --q1-color:#ffa592; --q2-color:#96d2ad; --q3-color:#e8cb7c; --q4-color:#abc3e1;
  --q1-grad:linear-gradient(135deg,#934a3c,#67382f);
  --q2-grad:linear-gradient(135deg,#427957,#2c543c);
  --q3-grad:linear-gradient(135deg,#8a7334,#665422);
  --q4-grad:linear-gradient(135deg,#536d89,#354a61);
}
html[data-theme="dark"] .sidebar a.current { background:#2b4233; }
html[data-theme="dark"] .sidebar a.navlink:hover { background:#26372d; color:var(--ink); }
html[data-theme="dark"] .btn.primary,
html[data-theme="dark"] .workspace button.add-btn { background:#96d2ad; color:#13281b; border-color:#96d2ad; }
html[data-theme="dark"] .pill { background:#294132; color:#b2e5c1; }
html[data-theme="dark"] .pill.off { background:#4a2c28; color:#ffb8a8; }
html[data-theme="dark"] .notice { background:#3a321e; color:#efd58d; border-color:#75613a; }
html[data-theme="dark"] .form-error { color:#ffb2a2; }
html[data-theme="dark"] .auth-story { background:#17281e; }
html[data-theme="dark"] .auth-story p { color:var(--muted); }
html[data-theme="dark"] .mini-matrix div { background:#263c2e; }
html[data-theme="dark"] .toast-admin,
html[data-theme="dark"] .toast { background:#2d4235; color:var(--ink); border:1px solid var(--line); }
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color:#9bad9f; opacity:1; }
html[data-theme="dark"] .task-text a { color:#a3c9ff; }
html[data-theme="dark"] .tiny-date { color:var(--muted); }
html[data-theme="dark"] .tiny-date.overdue { background:#482923; color:#ffb2a2; border-color:#976557; }
html[data-theme="dark"] .t-work { background:#253c54; color:#bcdaff; }
html[data-theme="dark"] .t-family { background:#294132; color:#b2e5c1; }
html[data-theme="dark"] .t-study { background:#3b304e; color:#dfc2ff; }
html[data-theme="dark"] .t-del:hover { background:#482923; color:#ffb2a2; border-color:#976557; }
html[data-theme="dark"] .pomo-target.exceeded { background:#433a23; color:#f4d994; border-color:#897443; }
html[data-theme="dark"] .controls button { color:var(--ink)!important; border-color:var(--line)!important; }
html[data-theme="dark"] .selection-bar button,
html[data-theme="dark"] .modal-actions button { color:var(--ink); }
html[data-theme="dark"] #btn-delete-selected { background:#803f34!important; color:#fff!important; }
html[data-theme="dark"] .modal-actions button[onclick="processBulkImport()"] { background:#315c43!important; color:#fff!important; }
html[data-theme="dark"] #btn-copy { background:#64501f!important; color:#fff!important; }
html[data-theme="dark"] .toast button { background:#96d2ad; color:#13281b; }
html[data-theme="dark"] .save-indicator.saving { background:#5f4917; color:#fff1c3; }
html[data-theme="dark"] .save-indicator.saved { background:#2b593b; color:#dcffe7; }
html[data-theme="dark"] .save-indicator.error { background:#7a3026; color:#ffe6df; }
html[data-theme="dark"] li.completed .checkbox::after { color:#102418; }
html[data-theme="dark"] .select-checkbox { border-color:#91a997; }
html[data-theme="dark"] li.selected { background:#402a25!important; }
html[data-theme="dark"] li.selected .select-checkbox::after { color:#301a12; }
.theme-toggle { white-space:nowrap; }
.auth-theme-toggle { margin-left:auto; align-self:flex-start; margin-top:18px; }
.admin-top-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
@media(max-width:760px) { .admin-top-actions { justify-content:flex-end; } }
