:root {
  --bg: #0f1216;
  --panel: #171c22;
  --panel-2: #1d242c;
  --line: #262f39;
  --text: #e8edf2;
  --muted: #8a97a6;
  --dim: #5c6775;
  --brand: #ff7a3d;       /* warm orange — friendly, doggo */
  --brand-2: #ffb15c;
  --accent: #4cc9b0;      /* teal for progress / done */
  --accent-2: #5aa9ff;
  --danger: #ff6b6b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Fredoka', var(--font);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 80% -10%, rgba(255,122,61,.09), transparent 60%),
              radial-gradient(1000px 500px at -10% 110%, rgba(90,169,255,.07), transparent 55%),
              var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: 252px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #141a20, #11161b);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; font-size: 22px;
  box-shadow: 0 6px 16px rgba(255,122,61,.35);
}
.brand-name { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); font-weight: 500; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 11px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14.5px;
  transition: .15s;
}
.nav-link span { font-size: 17px; width: 20px; text-align: center; }
.nav-link:hover { background: var(--panel-2); color: var(--text); }
.nav-link.active { background: linear-gradient(135deg, rgba(255,122,61,.18), rgba(255,177,92,.08)); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,122,61,.25); }
.sidebar-foot { padding: 12px 10px 2px; border-top: 1px solid var(--line); }
.foot-line { font-size: 12px; color: var(--muted); }
.foot-line.dim { color: var(--dim); margin-top: 2px; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end; gap: 20px;
  padding: 28px 34px 20px; border-bottom: 1px solid var(--line);
}
.topbar h1 { font-family: var(--display); font-size: 30px; font-weight: 700; }
.view-sub { color: var(--muted); font-size: 14px; margin-top: 4px; max-width: 640px; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.view-wrap { padding: 26px 34px 60px; }

/* ---------- Cards / grid ---------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card h3 { font-family: var(--display); font-size: 17px; margin-bottom: 4px; }
.card .lead { color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* ---------- Countdown / stat ---------- */
.stat {
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden;
}
.stat::after { content: ''; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
  background: radial-gradient(circle, rgba(255,122,61,.22), transparent 70%); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; }
.stat .big { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1.1; margin: 8px 0 2px; }
.stat .big small { font-size: 16px; color: var(--muted); font-weight: 500; }
.stat .meta { color: var(--muted); font-size: 13px; }
.stat.done .big { color: var(--accent); }

/* ---------- Member cards ---------- */
.member {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 14px; transition: .18s; box-shadow: var(--shadow);
}
.member:hover { border-color: rgba(255,122,61,.4); transform: translateY(-2px); }
.member-head { display: flex; align-items: center; gap: 14px; }
.member-ava {
  width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; font-size: 26px;
  background: linear-gradient(135deg, rgba(255,122,61,.22), rgba(90,169,255,.14)); border: 1px solid var(--line);
}
.member-name { font-family: var(--display); font-size: 20px; font-weight: 700; }
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .5px;
  padding: 3px 10px; border-radius: 999px; background: rgba(255,122,61,.16); color: var(--brand-2);
  border: 1px solid rgba(255,122,61,.3); margin-top: 3px;
}
.member .summary { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.resp-title { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--dim); font-weight: 700; margin-top: 2px; }
.resp { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.resp li { position: relative; padding-left: 22px; font-size: 13.5px; color: var(--text); line-height: 1.45; }
.resp li::before { content: '🐾'; position: absolute; left: 0; top: 0; font-size: 12px; opacity: .85; }
.member textarea { width: 100%; }

/* ---------- Timeline ---------- */
.rail { position: relative; padding-left: 36px; }
.rail::before { content: ''; position: absolute; left: 13px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.rail-item { position: relative; padding: 0 0 26px; }
.rail-dot {
  position: absolute; left: -29px; top: 2px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--brand); display: grid; place-items: center; font-size: 12px; z-index: 2;
}
.rail-item.done .rail-dot { background: var(--accent); border-color: var(--accent); color: #06231d; }
.rail-card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 16px 18px; }
.rail-card .when { font-size: 12.5px; color: var(--brand-2); font-weight: 700; letter-spacing: .3px; }
.rail-card h4 { font-family: var(--display); font-size: 17px; margin: 3px 0 5px; }
.rail-card p { color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.rail-card .countpill { float: right; font-size: 12px; color: var(--muted); }

/* ---------- Tasks ---------- */
.task-col-head { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 12px; }
.task-col-head h3 { font-family: var(--display); font-size: 16px; }
.task {
  display: flex; align-items: flex-start; gap: 12px; padding: 13px 15px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; transition: .14s;
}
.task:hover { border-color: #33404d; }
.task.done { opacity: .55; }
.task.done .task-title { text-decoration: line-through; }
.check {
  width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--dim); flex-shrink: 0; cursor: pointer;
  display: grid; place-items: center; margin-top: 1px; transition: .14s; background: transparent;
}
.check:hover { border-color: var(--accent); }
.check.on { background: var(--accent); border-color: var(--accent); }
.check.on::after { content: '✓'; color: #06231d; font-weight: 800; font-size: 13px; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 14.5px; }
.task-detail { color: var(--muted); font-size: 12.8px; margin-top: 3px; line-height: 1.45; }
.task-meta { display: flex; gap: 8px; align-items: center; margin-top: 7px; flex-wrap: wrap; }
.chip { font-size: 11px; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); font-weight: 600; }
.chip.who { color: var(--brand-2); border-color: rgba(255,122,61,.3); }
.task-del { color: var(--dim); cursor: pointer; font-size: 16px; line-height: 1; background: none; border: none; padding: 2px 4px; }
.task-del:hover { color: var(--danger); }

/* ---------- Calendar ---------- */
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cal-nav { display: flex; gap: 8px; align-items: center; }
.cal-month { font-family: var(--display); font-size: 20px; min-width: 190px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 7px; }
.cal-dow { text-align: center; font-size: 11.5px; color: var(--dim); font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding-bottom: 4px; }
.cal-cell { min-height: 92px; background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.cal-cell.out { opacity: .32; }
.cal-cell.today { border-color: var(--brand); box-shadow: inset 0 0 0 1px rgba(255,122,61,.4); }
.cal-num { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.cal-today-dot { color: var(--brand); }
.cal-ev { font-size: 11px; padding: 3px 6px; border-radius: 6px; line-height: 1.25; cursor: default; overflow: hidden; }
.cal-ev.meeting { background: rgba(90,169,255,.16); color: #a9cfff; border: 1px solid rgba(90,169,255,.25); }
.cal-ev.milestone { background: rgba(255,122,61,.18); color: var(--brand-2); border: 1px solid rgba(255,122,61,.3); }

/* ---------- Notes ---------- */
.note { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 16px 18px; margin-bottom: 12px; }
.note .meta { font-size: 12px; color: var(--dim); margin-bottom: 6px; display: flex; justify-content: space-between; }
.note p { font-size: 14px; line-height: 1.55; color: var(--text); white-space: pre-wrap; }

/* ---------- Forms / buttons ---------- */
.btn {
  font-family: var(--font); font-weight: 600; font-size: 13.5px; cursor: pointer;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); transition: .14s;
}
.btn:hover { border-color: #3a4855; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); border: none; color: #231000; box-shadow: 0 6px 16px rgba(255,122,61,.3); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
input, textarea, select {
  font-family: var(--font); font-size: 14px; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--brand); }
textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
label { font-size: 12.5px; color: var(--muted); font-weight: 600; display: block; margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; }

/* ---------- Modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5,8,11,.65); display: grid; place-items: center; z-index: 50; backdrop-filter: blur(3px); }
.modal { width: min(520px, 92vw); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 30px 70px rgba(0,0,0,.5); }
.modal h3 { font-family: var(--display); font-size: 20px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ---------- misc ---------- */
.section-title { font-family: var(--display); font-size: 18px; margin: 26px 0 14px; display: flex; align-items: center; gap: 10px; }
.section-title:first-child { margin-top: 4px; }
.pill-progress { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--line); }
.pill-progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 999px; transition: width .4s; }
.empty { color: var(--dim); font-size: 13.5px; padding: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 12px; }
.quote { border-left: 3px solid var(--brand); padding: 4px 0 4px 16px; color: var(--muted); font-style: italic; font-size: 14px; line-height: 1.6; }

@media (max-width: 1050px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 820px) {
  body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; padding: 14px; }
  .nav { flex-direction: row; flex-wrap: wrap; flex: 1 1 100%; }
  .sidebar-foot { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .view-wrap, .topbar { padding-left: 18px; padding-right: 18px; }
  .cal-cell { min-height: 68px; }
}
