:root {
  --bg: #0f172a;
  --panel: #111827;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent: #93c5fd;
  --critical: #fb7185;
  --important: #fbbf24;
  --calm: #60a5fa;
  --done: #86efac;
  --recurring: #c084fc;
  --danger: #fca5a5;
  --shadow: 0 20px 70px rgba(0,0,0,.35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, .18), transparent 35%),
    radial-gradient(circle at bottom right, rgba(251, 191, 36, .10), transparent 30%),
    var(--bg);
  color: var(--text);
}
.app-shell { width: min(1180px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 48px; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.eyebrow { margin: 0 0 6px; color: var(--accent); letter-spacing: .12em; text-transform: uppercase; font-weight: 800; font-size: 12px; }
h1,h2,h3,p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(32px, 5vw, 56px); line-height: 1; }
.subtitle, .card p, .hint, .privacy-note { color: var(--muted); }
.hidden { display: none !important; }
.version-pill { background: rgba(147,197,253,.14); border: 1px solid rgba(147,197,253,.35); color: #dbeafe; padding: 9px 12px; border-radius: 999px; font-weight: 800; }
.tabs { display: flex; gap: 8px; background: rgba(15,23,42,.72); border: 1px solid rgba(148,163,184,.22); border-radius: 18px; padding: 6px; position: sticky; top: 8px; z-index: 5; backdrop-filter: blur(16px); margin-bottom: 18px; }
.tab-button { flex: 1; cursor: pointer; border: 0; border-radius: 13px; padding: 12px; background: transparent; color: var(--muted); font-weight: 800; }
.tab-button.active { background: #e5e7eb; color: #111827; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.card, .bucket { background: rgba(17,24,39,.88); border: 1px solid rgba(148,163,184,.18); border-radius: 24px; padding: 20px; box-shadow: var(--shadow); }
.card { margin-bottom: 18px; }
.auth-card { max-width: 560px; margin: 0 auto; }
.user-strip { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; background: rgba(17,24,39,.70); border: 1px solid rgba(148,163,184,.16); padding: 12px 14px; border-radius: 16px; }
.card-header, .calendar-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.task-form { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-weight: 800; color: #e5e7eb; }
.inline-check { display: flex; align-items: center; gap: 10px; }
.inline-check input { width: auto; }
input, textarea, select { width: 100%; border: 1px solid rgba(148,163,184,.24); background: #020617; color: var(--text); border-radius: 14px; padding: 12px 13px; font: inherit; }
textarea { min-height: 88px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.recurrence-box { border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.55); border-radius: 18px; padding: 14px; display: grid; gap: 12px; }
.recurrence-fields.muted-disabled { opacity: .45; }
.recurrence-fields.muted-disabled input, .recurrence-fields.muted-disabled select { pointer-events: none; }
.primary-button, .ghost-button, .file-button { border: 0; border-radius: 14px; padding: 12px 15px; font-weight: 900; cursor: pointer; font: inherit; text-align: center; }
.primary-button { background: #e5e7eb; color: #111827; }
.ghost-button, .file-button { background: rgba(148,163,184,.12); color: var(--text); border: 1px solid rgba(148,163,184,.23); }
.ghost-button.danger { color: var(--danger); }
.file-button input { display: none; }
.summary-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 18px; }
.summary-card { background: rgba(31,41,55,.86); border: 1px solid rgba(148,163,184,.16); border-radius: 18px; padding: 14px; }
.summary-card strong { display: block; font-size: 28px; }
.summary-card span { color: var(--muted); font-size: 13px; font-weight: 800; }
.task-columns { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.task-list, .history-list { display: grid; gap: 10px; min-height: 32px; }
.empty { color: #94a3b8; border: 1px dashed rgba(148,163,184,.23); border-radius: 14px; padding: 12px; font-size: 14px; }
.task-card, .history-item, .admin-user-card { background: rgba(15,23,42,.82); border: 1px solid rgba(148,163,184,.18); border-left: 5px solid var(--calm); border-radius: 16px; padding: 13px; }
.task-card.critical { border-left-color: var(--critical); }
.task-card.important { border-left-color: var(--important); }
.task-card.calm { border-left-color: var(--calm); }
.task-card.done { border-left-color: var(--done); opacity: .76; }
.task-title { font-weight: 950; margin-bottom: 5px; }
.task-meta { color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.badge { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 3px 8px; background: rgba(148,163,184,.12); color: #e2e8f0; font-size: 12px; font-weight: 900; }
.badge.recurring { color: #f3e8ff; background: rgba(192,132,252,.18); }
.task-note { color: #e2e8f0; font-size: 14px; white-space: pre-wrap; margin-bottom: 10px; }
.task-actions, .button-row { display: flex; flex-wrap: wrap; gap: 8px; }
.task-actions button { border: 0; border-radius: 999px; padding: 7px 9px; background: rgba(148,163,184,.14); color: var(--text); cursor: pointer; font-weight: 800; }
.task-actions .danger { color: var(--danger); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; color: var(--muted); margin-bottom: 14px; font-weight: 800; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: 6px; background: var(--calm); }
.dot.critical { background: var(--critical); } .dot.important { background: var(--important); } .dot.calm { background: var(--calm); } .dot.done { background: var(--done); } .dot.recurring { background: var(--recurring); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.weekdays { color: var(--muted); font-weight: 900; margin-bottom: 8px; text-align: center; }
.calendar-day { min-height: 90px; border-radius: 16px; border: 1px solid rgba(148,163,184,.16); background: rgba(15,23,42,.75); color: var(--text); padding: 10px; text-align: left; cursor: pointer; position: relative; }
.calendar-day.outside { opacity: .35; } .calendar-day.today { outline: 2px solid rgba(147,197,253,.8); } .calendar-day.selected { background: rgba(147,197,253,.18); }
.day-number { font-weight: 950; }
.markers { position: absolute; bottom: 9px; left: 9px; right: 9px; display: flex; gap: 5px; flex-wrap: wrap; }
.marker { min-width: 10px; height: 10px; border-radius: 999px; background: var(--calm); }
.marker.critical { background: var(--critical); } .marker.important { background: var(--important); } .marker.calm { background: var(--calm); } .marker.done { background: var(--done); } .marker.recurring { background: var(--recurring); }
.diagnostic-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 11px; margin-bottom: 16px; }
.diag-item { background: rgba(15,23,42,.75); border: 1px solid rgba(148,163,184,.16); border-radius: 16px; padding: 13px; min-width: 0; }
.diag-item strong { display: block; color: #fff; overflow-wrap: anywhere; word-break: break-word; }
.diag-item span { color: var(--muted); font-size: 13px; font-weight: 800; }
.diag-wide { grid-column: 1 / -1; }
.log-preview { white-space: pre-wrap; background: #020617; border: 1px solid rgba(148,163,184,.18); padding: 14px; border-radius: 16px; max-height: 360px; overflow: auto; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(2,6,23,.72); display: none; align-items: center; justify-content: center; padding: 18px; z-index: 40; backdrop-filter: blur(10px); }
.modal-backdrop.show { display: flex; }
.modal-card { width: min(520px,100%); background: #111827; border: 1px solid rgba(148,163,184,.22); border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.modal-card-wide { width: min(760px,100%); max-height: min(92vh,820px); overflow: auto; }
.modal-card p { color: var(--muted); line-height: 1.55; }
.modal-actions { justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none; background: #e5e7eb; color: #111827; border-radius: 999px; padding: 12px 16px; font-weight: 950; box-shadow: var(--shadow); transition: .2s ease; z-index: 50; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
code { background: rgba(148,163,184,.14); padding: 2px 5px; border-radius: 6px; }
details.recover-box { margin-top: 16px; }
details summary { cursor: pointer; color: var(--accent); font-weight: 800; margin-bottom: 12px; }
@media (max-width: 1080px) { .task-columns { grid-template-columns: 1fr 1fr; } .summary-grid { grid-template-columns: repeat(3,1fr); } .diagnostic-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .app-shell { width: min(100% - 18px, 1180px); padding-top: 14px; } .topbar, .card-header, .calendar-head { align-items: stretch; flex-direction: column; } .form-grid, .task-columns, .summary-grid, .diagnostic-grid { grid-template-columns: 1fr; } .calendar-day { min-height: 70px; } .tabs { top: 4px; overflow-x: auto; } .tab-button { min-width: 110px; } }
