:root {
  --bg: #060908;
  --bg-2: #0a0f0d;
  --surface: rgba(18, 26, 23, 0.66);
  --surface-2: rgba(26, 37, 33, 0.72);
  --surface-hover: rgba(34, 48, 43, 0.78);
  --border: rgba(167, 243, 208, 0.075);
  --border-strong: rgba(167, 243, 208, 0.16);
  --text: #e9f5ef;
  --muted: #94a89f;
  --dim: #62756d;
  --emerald: #10b981;
  --emerald-2: #34d399;
  --emerald-deep: #047857;
  --forest: #14532d;
  --mint: #a7f3d0;
  --mint-soft: rgba(167, 243, 208, 0.1);
  --grad: linear-gradient(135deg, #6ee7b7 0%, #10b981 45%, #047857 100%);
  --grad-soft: linear-gradient(135deg, rgba(52, 211, 153, 0.18), rgba(4, 120, 87, 0.06));
  --glow: 0 0 0 1px rgba(52, 211, 153, 0.25), 0 8px 40px -8px rgba(16, 185, 129, 0.45);
  --high: #fb7185;
  --high-bg: rgba(251, 113, 133, 0.12);
  --med: #fbbf24;
  --med-bg: rgba(251, 191, 36, 0.12);
  --low: #6ee7b7;
  --low-bg: rgba(110, 231, 183, 0.1);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 20px 50px -20px rgba(0, 0, 0, 0.7);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", system-ui, sans-serif;
  --sidebar: 252px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(16, 185, 129, 0.16), transparent 60%),
    radial-gradient(700px 500px at -10% 110%, rgba(20, 83, 45, 0.35), transparent 60%),
    radial-gradient(600px 400px at 40% 40%, rgba(16, 185, 129, 0.04), transparent 70%);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: linear-gradient(rgba(167, 243, 208, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(167, 243, 208, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 70% 0%, #000 0%, transparent 70%);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: var(--emerald-2); text-decoration: none; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 26px 18px;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 16, 14, 0.85), rgba(6, 9, 8, 0.85));
  backdrop-filter: blur(20px);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 26px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--grad); box-shadow: var(--glow); color: #022c22;
}
.brand-mark svg.i { width: 21px; height: 21px; stroke-width: 2.1; }
.brand-name { font-weight: 680; letter-spacing: -0.02em; font-size: 17px; }
.brand-sub { font-size: 12px; color: var(--dim); }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 11px 12px; border-radius: 12px; color: var(--muted); font-weight: 520;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
  position: relative;
}
.nav-item:hover { background: var(--mint-soft); color: var(--text); }
.nav-item.active { color: var(--text); background: var(--grad-soft); box-shadow: inset 0 0 0 1px rgba(52, 211, 153, 0.18); }
.nav-item.active svg.i { color: var(--emerald-2); }
.nav-item .count {
  margin-left: auto; font-size: 12px; font-weight: 600; min-width: 22px; height: 22px; padding: 0 7px;
  display: grid; place-items: center; border-radius: 99px; background: rgba(167, 243, 208, 0.08); color: var(--mint);
}
.nav-item .count.hot { background: var(--grad); color: #022c22; }
.side-foot { margin-top: auto; }
.side-card {
  padding: 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
}
.side-card .t { font-size: 12px; color: var(--muted); }
.side-card .v { font-size: 22px; font-weight: 680; letter-spacing: -0.02em; margin: 2px 0 10px; }

main { min-width: 0; padding: 26px 34px 60px; }
.topbar { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; height: 44px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search:focus-within { border-color: rgba(52, 211, 153, 0.4); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; height: 100%; }
.search input::placeholder { color: var(--dim); }
.search kbd { font: 11px var(--font); color: var(--dim); border: 1px solid var(--border-strong); border-radius: 6px; padding: 2px 6px; }
.topbar .spacer { flex: 1; }
.sync-pill { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); padding: 8px 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--emerald-2); box-shadow: 0 0 10px var(--emerald-2); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 16px; border-radius: 12px; font-weight: 600; font-size: 14px;
  transition: transform 0.15s var(--ease), box-shadow 0.2s, background 0.2s, opacity 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--grad); color: #022c22; box-shadow: var(--glow); }
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(110, 231, 183, 0.5), 0 10px 44px -6px rgba(16, 185, 129, 0.65); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-hover); border-color: var(--border-strong); }
.btn-quiet { color: var(--muted); height: 34px; padding: 0 10px; font-weight: 540; }
.btn-quiet:hover { color: var(--text); background: var(--mint-soft); }
.btn-danger { color: var(--high); }
.btn-danger:hover { background: var(--high-bg); }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); }
.icon-btn:hover { background: var(--mint-soft); color: var(--text); }

/* ---------- Hero ---------- */
.view { animation: rise 0.45s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 28px; justify-content: space-between;
  padding: 30px 32px; border-radius: 26px; margin-bottom: 22px;
  background:
    radial-gradient(500px 220px at 100% 0%, rgba(52, 211, 153, 0.22), transparent 70%),
    linear-gradient(135deg, rgba(20, 83, 45, 0.55), rgba(10, 16, 14, 0.7));
  border: 1px solid rgba(110, 231, 183, 0.14);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.18), transparent 65%);
}
.hero-date { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mint); opacity: 0.85; font-weight: 600; }
.hero h1 { margin: 6px 0 10px; font-size: clamp(26px, 3.4vw, 38px); line-height: 1.1; letter-spacing: -0.035em; font-weight: 720; }
.hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--muted); max-width: 560px; font-size: 15.5px; }
.hero p b { color: var(--text); font-weight: 600; }
.ring { position: relative; width: 132px; height: 132px; flex: none; z-index: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(167, 243, 208, 0.1); }
.ring .bar { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.55)); }
.ring .label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .label b { font-size: 28px; letter-spacing: -0.03em; font-weight: 720; }
.ring .label small { font-size: 11.5px; color: var(--muted); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat {
  text-align: left; padding: 18px 18px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow);
  backdrop-filter: blur(16px); transition: transform 0.25s var(--ease), border-color 0.25s, background 0.25s;
}
.stat:hover { transform: translateY(-3px); border-color: rgba(52, 211, 153, 0.28); background: var(--surface-2); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 13.5px; font-weight: 540; }
.stat-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--mint-soft); color: var(--emerald-2); }
.stat-num { font-size: 34px; font-weight: 720; letter-spacing: -0.04em; margin: 10px 0 2px; }
.stat-sub { font-size: 12.5px; color: var(--dim); }
.stat-sub .warn { color: var(--high); }
.meter { height: 6px; border-radius: 99px; background: rgba(167, 243, 208, 0.08); overflow: hidden; margin-top: 12px; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--grad); box-shadow: 0 0 12px rgba(52, 211, 153, 0.6); transition: width 0.9s var(--ease); }

/* ---------- Cards / grid ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 18px; }
.span-7 { grid-column: span 7; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
.span-6 { grid-column: span 6; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.card {
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 20px; min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-head h2 { margin: 0; font-size: 16px; font-weight: 650; letter-spacing: -0.01em; }
.card-head .badge { font-size: 12px; color: var(--mint); background: var(--mint-soft); padding: 3px 9px; border-radius: 99px; font-weight: 600; }
.card-head .more { margin-left: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-radius: 8px; }
.card-head .more:hover { color: var(--emerald-2); background: var(--mint-soft); }
.card-head .more svg.i { width: 15px; height: 15px; }
.card-ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--grad-soft); color: var(--emerald-2); }
.card-ic svg.i { width: 16px; height: 16px; }
.card.feature { background: linear-gradient(180deg, rgba(16, 185, 129, 0.08), rgba(18, 26, 23, 0.66) 40%); border-color: rgba(52, 211, 153, 0.18); }

/* ---------- Task rows ---------- */
.tlist { display: flex; flex-direction: column; gap: 4px; }
.task {
  display: flex; align-items: flex-start; gap: 12px; padding: 11px 10px; border-radius: 14px;
  transition: background 0.2s var(--ease), opacity 0.35s, transform 0.35s var(--ease);
  cursor: pointer; position: relative;
}
.task:hover { background: rgba(167, 243, 208, 0.045); }
.task.leaving { opacity: 0; transform: translateX(12px); }
.check {
  flex: none; width: 24px; height: 24px; margin-top: 1px; border-radius: 8px;
  border: 1.8px solid rgba(167, 243, 208, 0.32); display: grid; place-items: center;
  transition: all 0.25s var(--ease); position: relative;
}
.check::before { content: ""; position: absolute; inset: -10px; } /* bigger tap target */
.check:hover { border-color: var(--emerald-2); background: rgba(16, 185, 129, 0.12); }
.check svg { width: 14px; height: 14px; stroke: #022c22; stroke-width: 3.2; fill: none; stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset 0.35s var(--ease) 0.05s; }
.task.done .check, .check.on { background: rgba(16, 185, 129, 0.12); border-color: rgba(52, 211, 153, 0.55); }
.task.done .check svg, .check.on svg { stroke: var(--emerald-2); stroke-width: 3; stroke-dashoffset: 0; }
.task.just .check svg { animation: draw 0.4s var(--ease); }
.task.just .check { animation: tick 0.4s var(--ease); }
@keyframes draw { from { stroke-dashoffset: 20; } }
@keyframes tick { 40% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0.12); } }
.task-main { flex: 1; min-width: 0; }
.task-title { font-weight: 560; font-size: 14.8px; letter-spacing: -0.005em; transition: color 0.3s; }
.task.done .task-title { color: #6f7a76; text-decoration: line-through; text-decoration-color: rgba(148, 163, 158, 0.7); text-decoration-thickness: 1.5px; }
.task.done .task-desc { color: #59625f; }
.task.done .meta .chip { opacity: 0.6; }
.task.done .meta .chip.chip-done { opacity: 1; color: var(--emerald-2); background: rgba(16, 185, 129, 0.1); }
.task-desc { color: var(--dim); font-size: 13px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; align-items: center; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 7px;
  font-size: 12px; font-weight: 540; color: var(--muted); background: rgba(167, 243, 208, 0.06); white-space: nowrap;
}
.chip svg.i { width: 12.5px; height: 12.5px; }
.chip.p-high { color: var(--high); background: var(--high-bg); }
.chip.p-medium { color: var(--med); background: var(--med-bg); }
.chip.p-low { color: var(--low); background: var(--low-bg); }
.chip.overdue { color: var(--high); background: var(--high-bg); }
.chip.today { color: var(--mint); background: rgba(16, 185, 129, 0.16); }
.pdot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.task-actions { display: flex; gap: 2px; opacity: 0; transition: opacity 0.2s; }
.task:hover .task-actions, .task:focus-within .task-actions { opacity: 1; }
.empty { text-align: center; padding: 28px 12px; color: var(--dim); font-size: 14px; }
.empty .big { font-size: 15px; color: var(--muted); font-weight: 560; margin-bottom: 4px; }
.empty svg.i { width: 28px; height: 28px; color: var(--emerald); opacity: 0.7; margin-bottom: 8px; }
.group-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); font-weight: 600; padding: 14px 10px 6px; display: flex; gap: 8px; align-items: center; }
.group-label .n { color: var(--mint); opacity: 0.7; }

/* ---------- Feed ---------- */
.feed { display: flex; flex-direction: column; gap: 10px; }
.sugg {
  padding: 14px; border-radius: 16px; background: rgba(10, 16, 14, 0.55); border: 1px solid var(--border);
  transition: border-color 0.25s, transform 0.35s var(--ease), opacity 0.35s;
}
.sugg:hover { border-color: rgba(52, 211, 153, 0.25); }
.sugg.leaving { opacity: 0; transform: scale(0.97); }
.sugg-top { display: flex; gap: 10px; align-items: flex-start; }
.sugg-ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--grad-soft); color: var(--emerald-2); }
.sugg-title { font-weight: 600; font-size: 14.5px; }
.sugg-from { font-size: 12.5px; color: var(--dim); margin-top: 1px; }
.sugg-detail { color: var(--muted); font-size: 13.2px; margin: 8px 0 0 42px; }
.sugg .meta { margin-left: 42px; }
.sugg-actions { display: flex; gap: 8px; margin: 12px 0 0 42px; }
.new-tag { font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; color: #022c22; background: var(--grad); padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: 2px; }

/* ---------- Agenda ---------- */
.agenda { display: flex; flex-direction: column; gap: 2px; }
.ev { display: flex; gap: 14px; padding: 10px; border-radius: 12px; align-items: center; }
.ev:hover { background: rgba(167, 243, 208, 0.04); }
.ev-time { width: 64px; flex: none; text-align: right; font-size: 13px; font-weight: 600; color: var(--mint); font-variant-numeric: tabular-nums; }
.ev-time small { display: block; color: var(--dim); font-weight: 500; font-size: 11.5px; }
.ev-bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--grad); box-shadow: 0 0 10px rgba(52, 211, 153, 0.5); }
.ev-title { font-weight: 560; font-size: 14.3px; }
.ev-loc { font-size: 12.5px; color: var(--dim); display: flex; align-items: center; gap: 4px; margin-top: 1px; }
.ev-loc svg.i { width: 12px; height: 12px; }
.ev.now .ev-bar { animation: pulse 2s infinite; }
.day-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); font-weight: 600; padding: 12px 10px 4px; }

/* ---------- Progress ---------- */
.prog-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 9px 2px; }
.prog-row .name { font-size: 13.5px; font-weight: 540; }
.prog-row .num { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog-row .meter { grid-column: 1 / -1; margin-top: 2px; height: 7px; }
.week-bars { display: flex; align-items: flex-end; gap: 8px; height: 92px; padding: 6px 2px 0; margin-bottom: 8px; }
.wb { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.wb i { width: 100%; max-width: 30px; border-radius: 8px 8px 4px 4px; background: rgba(167, 243, 208, 0.08); min-height: 4px; transition: height 0.9s var(--ease); }
.wb.has i { background: var(--grad); box-shadow: 0 0 14px rgba(52, 211, 153, 0.35); }
.wb small { font-size: 11px; color: var(--dim); }
.wb.today small { color: var(--mint); font-weight: 650; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.sub-h { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); font-weight: 600; margin-bottom: 6px; }

/* ---------- Tasks page ---------- */
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { margin: 0; font-size: 30px; letter-spacing: -0.035em; font-weight: 720; }
.page-h p { margin: 4px 0 0; color: var(--muted); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.seg { display: inline-flex; padding: 4px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); gap: 2px; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { height: 32px; padding: 0 12px; border-radius: 9px; font-size: 13.2px; font-weight: 560; color: var(--muted); white-space: nowrap; transition: all 0.2s var(--ease); }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--grad); color: #022c22; box-shadow: 0 2px 14px -2px rgba(16, 185, 129, 0.6); }
.seg button .n { opacity: 0.6; margin-left: 4px; font-weight: 500; }
.select {
  height: 40px; padding: 0 32px 0 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text);
  appearance: none; -webkit-appearance: none; font-size: 13.5px; outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a89f' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}
.select:focus { border-color: rgba(52, 211, 153, 0.4); }

/* ---------- Modal ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(2, 6, 4, 0.62); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade 0.2s; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(560px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  border-radius: 24px; background: linear-gradient(180deg, #121b17, #0c1310); border: 1px solid var(--border-strong);
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(52, 211, 153, 0.06);
  padding: 22px; animation: pop 0.32s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.modal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-h h3 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; color: var(--muted); font-weight: 560; margin-bottom: 6px; }
.input, .textarea {
  width: 100%; border-radius: 12px; background: rgba(6, 9, 8, 0.6); border: 1px solid var(--border-strong);
  padding: 11px 13px; outline: none; transition: border-color 0.2s, box-shadow 0.2s; font-size: 15px;
}
.input:focus, .textarea:focus { border-color: rgba(52, 211, 153, 0.5); box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12); }
.input.title { font-size: 17px; font-weight: 600; }
.textarea { min-height: 76px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.quick button { font-size: 12.5px; padding: 5px 10px; border-radius: 8px; background: var(--mint-soft); color: var(--mint); font-weight: 560; }
.quick button:hover { background: rgba(16, 185, 129, 0.2); }
.seg.full { display: flex; width: 100%; }
.seg.full button { flex: 1; }
.seg .p-high.on { background: linear-gradient(135deg, #fda4af, #fb7185); color: #3b0711; box-shadow: none; }
.seg .p-medium.on { background: linear-gradient(135deg, #fde68a, #fbbf24); color: #3a2a02; box-shadow: none; }
.modal-f { display: flex; align-items: center; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.modal-f .spacer { flex: 1; }
.history { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: rgba(6, 9, 8, 0.5); font-size: 12.8px; color: var(--muted); }
.history div { padding: 3px 0; display: flex; gap: 10px; }
.history time { color: var(--dim); min-width: 118px; font-variant-numeric: tabular-nums; }
.err { color: var(--high); font-size: 13px; margin-top: 8px; }
.stamp { font-size: 12px; color: var(--dim); margin-top: -4px; margin-bottom: 12px; }

/* ---------- Toast ---------- */
.toasts { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 16px; border-radius: 14px;
  background: rgba(18, 28, 24, 0.95); border: 1px solid var(--border-strong); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.7);
  font-size: 14px; animation: pop 0.3s var(--ease); backdrop-filter: blur(12px);
}
.toast svg.i { color: var(--emerald-2); }
.toast button { color: var(--emerald-2); font-weight: 650; padding: 5px 9px; border-radius: 8px; }
.toast button:hover { background: var(--mint-soft); }

/* ---------- Mobile ---------- */
.tabbar, .fab, .m-head, .search.m-search { display: none; }
@media (max-width: 1180px) {
  .span-7, .span-5, .span-8, .span-4 { grid-column: span 12; }
  .span-4.third { grid-column: span 6; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar, .topbar { display: none; }
  main { padding: calc(env(safe-area-inset-top) + 14px) 16px calc(env(safe-area-inset-bottom) + 104px); }
  .m-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
  .m-head .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
  .m-head .brand-name { font-size: 16px; }
  .m-head .icon-btn { margin-left: auto; width: 40px; height: 40px; background: var(--surface); border: 1px solid var(--border); }
  .search.m-search { margin-bottom: 14px; }
  .search.m-search.open { display: flex; max-width: none; }
  .hero { padding: 22px 20px; border-radius: 22px; gap: 14px; }
  .hero p { font-size: 14.5px; }
  .ring { width: 92px; height: 92px; }
  .ring .label b { font-size: 21px; }
  .ring .label small { font-size: 10px; }
  .stats { gap: 10px; }
  .stat { padding: 14px; border-radius: 18px; }
  .stat-num { font-size: 28px; margin-top: 6px; }
  .stat-ic { width: 30px; height: 30px; }
  .grid { gap: 12px; }
  .span-4.third { grid-column: span 12; }
  .card { padding: 16px; border-radius: 20px; }
  .task { padding: 12px 6px; gap: 14px; }
  .check { width: 28px; height: 28px; border-radius: 9px; }
  .check svg { width: 16px; height: 16px; }
  .task-title { font-size: 15.5px; }
  .task-actions { display: none; }
  .split { grid-template-columns: 1fr; gap: 14px; }
  .sugg-detail, .sugg .meta, .sugg-actions { margin-left: 0; }
  .sugg-actions .btn { flex: 1; height: 44px; }
  .page-h h1 { font-size: 26px; }
  .toolbar .search { flex: 1 1 100% !important; }
  .toolbar .select { flex: 1 1 28%; min-width: 0; padding-right: 26px; background-position: right 8px center; }
  .toolbar > .seg:last-child { flex: 1 1 100%; }
  .toolbar > .seg:last-child button { flex: 1; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 10px);
    z-index: 40; height: 66px; border-radius: 22px; padding: 0 6px;
    background: rgba(12, 19, 16, 0.82); backdrop-filter: blur(24px) saturate(1.4); -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid var(--border-strong); box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.8);
  }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 560; color: var(--dim); position: relative; }
  .tab svg.i { width: 22px; height: 22px; }
  .tab.on { color: var(--emerald-2); }
  .tab.on::before { content: ""; position: absolute; top: 6px; width: 34px; height: 3px; border-radius: 3px; background: var(--grad); box-shadow: 0 0 10px var(--emerald-2); }
  .tab .dot { position: absolute; top: 10px; left: calc(50% + 7px); min-width: 16px; height: 16px; border-radius: 99px; background: var(--grad); color: #022c22; font-size: 10px; font-weight: 700; display: grid; place-items: center; padding: 0 4px; }
  .tab-add { display: grid; place-items: center; }
  .tab-add span { width: 50px; height: 50px; border-radius: 17px; display: grid; place-items: center; background: var(--grad); color: #022c22; box-shadow: var(--glow); }
  .tab-add svg.i { width: 24px; height: 24px; stroke-width: 2.4; }
  .scrim { place-items: end center; padding: 0; }
  .modal { width: 100%; border-radius: 26px 26px 0 0; max-height: 92vh; padding: 18px 18px calc(env(safe-area-inset-bottom) + 18px); animation: sheet 0.35s var(--ease); }
  @keyframes sheet { from { transform: translateY(40px); opacity: 0; } }
  .modal::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 3px; background: rgba(167, 243, 208, 0.2); margin: -6px auto 12px; }
  .input, .textarea { font-size: 16px; } /* stops iOS zoom on focus */
  .toasts { bottom: calc(env(safe-area-inset-bottom) + 90px); width: calc(100% - 32px); }
  .toast { width: 100%; justify-content: space-between; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Sign-in ---------- */
body.auth { display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  position: relative; z-index: 1; width: min(380px, 100%); text-align: center; display: flex; flex-direction: column; gap: 12px;
  padding: 32px 26px 22px; border-radius: 26px; background: linear-gradient(180deg, rgba(20, 31, 27, 0.85), rgba(10, 15, 13, 0.85));
  border: 1px solid var(--border-strong); box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.8), var(--glow); backdrop-filter: blur(20px);
  animation: pop 0.4s var(--ease);
}
.auth-icon { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto 6px; box-shadow: var(--glow); }
.auth-card h1 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.auth-card p { margin: 0 0 8px; color: var(--muted); font-size: 14.5px; }
.auth-card .input { text-align: center; font-size: 17px; letter-spacing: 0.08em; }
.auth-card .btn { height: 48px; margin-top: 4px; }
.auth-card .btn:disabled { opacity: 0.6; }
.auth-foot { font-size: 12px; color: var(--dim); margin-top: 6px; }
