:root {
  color-scheme: dark;
  --bg: #101010;
  --panel: #181818;
  --panel-2: #202020;
  --line: #303030;
  --muted: #9d9d9d;
  --text: #f5f2ec;
  --red: #ee2d27;
  --blue: #3078d3;
  --amber: #d08a18;
  --green: #49a56c;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 28px 20px; border-right: 1px solid var(--line); background: #131313; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 34px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; background: var(--red); font-weight: 900; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; }
.brand small { color: var(--muted); margin-top: 2px; }
.sidebar-label { color: #6f6f6f; text-transform: uppercase; font-weight: 800; letter-spacing: .12em; font-size: 10px; margin: 28px 12px 8px; }
.nav { display: grid; gap: 5px; }
.nav-item { width: 100%; border: 0; background: transparent; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border-radius: 9px; cursor: pointer; color: #cfcfcf; text-align: left; }
.nav-item:hover, .nav-item.active { background: #252525; color: #fff; }
.nav-item b { color: #777; font-size: 12px; }
.project-name { display: flex; align-items: center; gap: 9px; }
.project-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--project); }
.privacy-note { margin-top: auto; padding: 13px; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 8px; }
.lock-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(73,165,108,.12); }

.main { padding: 32px clamp(22px, 4vw, 58px) 60px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -.04em; }
h2 { font-size: 21px; letter-spacing: -.02em; }
.eyebrow { color: var(--red); text-transform: uppercase; letter-spacing: .13em; font-size: 10px; font-weight: 900; margin-bottom: 7px; }
.top-actions, .dialog-actions { display: flex; align-items: center; gap: 10px; }
.button { border: 1px solid transparent; border-radius: 8px; padding: 10px 15px; cursor: pointer; font-weight: 750; }
.button.primary { background: var(--red); }
.button.secondary { background: transparent; border-color: #3b3b3b; }
.button.danger { background: transparent; border-color: #71302d; color: #ff7770; }
.button:hover { filter: brightness(1.08); }

.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 16px; }
.section-heading > p { color: var(--muted); font-size: 13px; }
.section-heading.compact { align-items: center; }
.focus-section, .week-section, .work-section { margin-top: 30px; }
.focus-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.focus-card { min-height: 128px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, #212121, #171717); padding: 17px; display: flex; flex-direction: column; gap: 13px; cursor: pointer; text-align: left; }
.focus-card:hover { border-color: #4d4d4d; transform: translateY(-1px); }
.focus-index { color: #777; font-size: 12px; font-weight: 900; }
.focus-card strong { font-size: 17px; line-height: 1.3; }
.empty-focus { color: #666; font-weight: 650; }
.meta { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.tag { border: 1px solid #383838; border-radius: 999px; padding: 4px 7px; display: inline-flex; align-items: center; gap: 6px; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--project, #777); }

.week-grid { display: grid; grid-template-columns: repeat(7, minmax(122px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.day { min-height: 126px; border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: #161616; }
.day.today { border-color: #793431; background: #1d1717; }
.day-head { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 11px; }
.day.today .day-head { color: #ff7770; }
.day-task { width: 100%; display: block; padding: 8px; margin-top: 7px; border: 0; border-left: 3px solid var(--project); border-radius: 5px; background: #252525; text-align: left; font-size: 11px; line-height: 1.35; cursor: pointer; }

.work-section { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.work-column { min-width: 0; }
.count-pill { min-width: 28px; padding: 5px 8px; text-align: center; background: #292929; color: var(--muted); border-radius: 999px; font-size: 12px; }
.task-list { display: grid; gap: 8px; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 11px; align-items: start; padding: 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.task:hover { border-color: #484848; }
.task-check { width: 20px; height: 20px; border-radius: 50%; border: 1px solid #555; background: transparent; cursor: pointer; }
.task-check:hover { border-color: var(--green); }
.task-body { cursor: pointer; min-width: 0; }
.task-title { font-size: 14px; font-weight: 720; line-height: 1.35; }
.task-notes { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.task-date { color: var(--muted); font-size: 11px; white-space: nowrap; }
.task-date.overdue { color: #ff7770; }
.task-source { color: #777; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.empty-state { padding: 24px; text-align: center; color: #6f6f6f; border: 1px dashed #333; border-radius: 10px; }

.error-banner { margin-top: 18px; padding: 13px 15px; border: 1px solid #71302d; background: #261514; color: #ffaaa6; border-radius: 9px; }
.hidden { display: none !important; }

dialog { width: min(660px, calc(100vw - 32px)); border: 1px solid #3a3a3a; border-radius: 15px; background: #181818; color: var(--text); padding: 0; box-shadow: 0 30px 90px rgba(0,0,0,.65); }
dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
form { padding: 22px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 20px; }
.icon-button { border: 0; background: transparent; color: var(--muted); font-size: 28px; cursor: pointer; }
label { display: grid; gap: 7px; color: #bcbcbc; font-size: 12px; font-weight: 700; margin-bottom: 14px; }
input, select, textarea { width: 100%; border: 1px solid #3d3d3d; border-radius: 7px; background: #111; color: var(--text); padding: 10px 11px; outline: 0; }
input:focus, select:focus, textarea:focus { border-color: #7b7b7b; }
textarea { resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.dialog-actions { display: grid; grid-template-columns: auto 1fr auto auto; margin-top: 8px; }

@media (max-width: 980px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 18px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin-bottom: 16px; }
  .nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .projects { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sidebar-label { margin-top: 18px; }
  .privacy-note { display: none; }
  .focus-grid { grid-template-columns: 1fr; }
  .work-section { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .main { padding: 22px 14px 40px; }
  .topbar { align-items: flex-start; }
  .top-actions .secondary { display: none; }
  .nav { display: flex; overflow-x: auto; }
  .nav-item { min-width: max-content; }
  .projects { display: grid; grid-template-columns: 1fr; }
  .section-heading > p { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog-actions { grid-template-columns: 1fr 1fr; }
  .dialog-actions span { display: none; }
}

