:root {
  --blue: #005a8c;
  --blue-d: #003d61;
  --blue-l: #e8f2f8;
  --blue-m: #c5dcea;
  --sand: #f6f1ea;
  --paper: #fffdf9;
  --ink: #1c242c;
  --muted: #5b6772;
  --line: #d8cfc4;
  --good: #2a7a4b;
  --good-bg: #e6f4ea;
  --warn: #b45309;
  --warn-bg: #fff4e5;
  --rose: #9b1d4a;
  --shadow: 0 10px 30px rgba(0, 40, 70, 0.08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--ink);
  background: var(--sand);
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

/* Top bar */
.topbar {
  background: var(--blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.brand-mark {
  width: 38px; height: 38px;
  border: 2px solid #fff;
  border-radius: 8px;
  display: grid; place-items: center;
  font-family: "Source Serif 4", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-text small { display: block; opacity: 0.78; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.brand-text strong { font-size: 17px; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.who { font-size: 13px; opacity: 0.9; }

.btn {
  border: 0; border-radius: 10px;
  padding: 9px 14px;
  background: #fff; color: var(--blue-d);
  font-weight: 600;
}
.btn.ghost { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.35); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.soft { background: var(--blue-l); color: var(--blue-d); }
.btn.danger { background: #fde8ee; color: var(--rose); }
.btn.sm { padding: 6px 10px; font-size: 13px; }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

/* Landing */
.hero {
  background:
    linear-gradient(180deg, rgba(0,61,97,.55), rgba(0,40,70,.78)),
    radial-gradient(circle at 20% 20%, #4aa3c7, transparent 40%),
    linear-gradient(135deg, #003d61, #0a6aa3);
  color: #fff;
  padding: 72px 0 56px;
}
.hero h1 {
  font-family: "Source Serif 4", serif;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.15;
  margin: 0 0 12px;
  font-weight: 600;
}
.hero p.lead { max-width: 620px; font-size: 18px; opacity: 0.92; }
.badge {
  display: inline-block;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.25);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.hero .btn { min-width: 160px; }
.notice {
  margin-top: 28px;
  font-size: 13px;
  opacity: 0.8;
  max-width: 680px;
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 18px; }
.card p { margin: 0; color: var(--muted); }

.section { padding: 36px 0; }
.section h2 {
  font-family: "Source Serif 4", serif;
  font-size: 28px;
  margin: 0 0 8px;
}

/* Auth */
.auth-box { max-width: 460px; margin: 48px auto; }
.tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.tabs button {
  flex: 1; padding: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
}
.tabs button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
label { display: block; font-size: 13px; font-weight: 600; margin: 12px 0 6px; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 10px; }
.error { color: var(--rose); font-size: 13px; margin-top: 8px; }
.demo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }

/* App layout */
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 62px); }
.side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 18px 12px;
}
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side button.nav {
  text-align: left;
  background: transparent;
  border: 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink);
}
.side button.nav.on, .side button.nav:hover { background: var(--blue-l); color: var(--blue-d); }
.main { padding: 24px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 18px 0 24px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.stat b { display: block; font-size: 28px; color: var(--blue); }
.stat span { color: var(--muted); font-size: 13px; }

.list { display: grid; gap: 12px; }
.item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.item h4 { margin: 0 0 4px; }
.item p { margin: 0; color: var(--muted); font-size: 14px; }
.progress {
  height: 8px; background: var(--blue-l); border-radius: 99px; overflow: hidden; margin-top: 10px;
}
.progress > i { display: block; height: 100%; background: var(--blue); }

.chip {
  display: inline-block;
  background: var(--blue-l);
  color: var(--blue-d);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
}
.chip.ok { background: var(--good-bg); color: var(--good); }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }

.task { display: flex; gap: 10px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--line); }
.task input { width: auto; margin-top: 4px; }
.done { text-decoration: line-through; color: var(--muted); }

.timer {
  background: var(--blue-d);
  color: #fff;
  border-radius: 16px;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}
.timer .clock { font-size: 36px; font-variant-numeric: tabular-nums; font-weight: 700; }

.footer {
  margin-top: auto;
  padding: 18px 22px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.modal-bg {
  position: fixed; inset: 0;
  background: rgba(16, 24, 32, .45);
  display: grid; place-items: center;
  padding: 20px;
  z-index: 20;
}
.modal { width: min(560px, 100%); background: #fff; border-radius: 18px; padding: 22px; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: var(--blue-l); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }

.empty { padding: 28px; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 14px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .side { border-right: 0; border-bottom: 1px solid var(--line); }
  .side nav { flex-direction: row; overflow: auto; }
  .grid-3, .stats, .row-2 { grid-template-columns: 1fr; }
  .item { flex-direction: column; }
}
