@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root{
  --bg:#0f172a;
  --surface:#111827;
  --surface-soft:#1f2937;
  --text:#f9fafb;
  --muted:#cbd5e1;
  --accent:#60a5fa;
  --accent-2:#38bdf8;
  --green:#22c55e;
  --green-soft:rgba(34,197,94,.14);
  --border:rgba(255,255,255,.12);
  --shadow:0 18px 38px rgba(2,6,23,.45);
}

body[data-theme="light"]{
  --bg:#f5f8ff;
  --surface:#ffffff;
  --surface-soft:#eef4ff;
  --text:#14213d;
  --muted:#4f607a;
  --accent:#2747b7;
  --accent-2:#3b82f6;
  --green:#15803d;
  --green-soft:rgba(21,128,61,.10);
  --border:rgba(20,33,61,.12);
  --shadow:0 18px 38px rgba(20,33,61,.08);
}

*{margin:0;padding:0;box-sizing:border-box;}
body{
  font-family:Inter,system-ui,-apple-system,'Segoe UI',Roboto,'Helvetica Neue',Arial;
  background:linear-gradient(135deg,var(--surface-soft) 0%, var(--bg) 100%);
  color:var(--text);
  line-height:1.7;
  min-height:100vh;
}
a{color:inherit}

.theme-toggle{
  position:fixed;top:20px;right:20px;z-index:99;
  display:flex;align-items:center;gap:8px;
  background:var(--surface);color:var(--text);
  border:1px solid var(--border);border-radius:999px;
  padding:8px 16px;font-size:.85rem;font-weight:600;
  cursor:pointer;box-shadow:var(--shadow);
}
.theme-toggle:hover{border-color:var(--accent)}

.layout{
  display:grid;grid-template-columns:250px 1fr;
  min-height:100vh;max-width:1280px;margin:0 auto;
}

/* ---------- Sidebar ---------- */
.sidebar{
  background:var(--surface);border-right:1px solid var(--border);
  padding:24px 18px;position:sticky;top:0;height:100vh;overflow-y:auto;
}
.brand .flag{font-size:2.2rem}
.brand h1{font-size:1.15rem;font-weight:800;margin:6px 0 2px}
.brand .tagline{color:var(--accent);font-weight:600;font-size:.9rem}
.brand p{color:var(--muted);font-size:.85rem}
.nav-title{
  font-size:.7rem;font-weight:800;letter-spacing:.16em;text-transform:uppercase;
  color:var(--muted);margin:22px 0 8px;opacity:.8;
}
.sidebar a{
  display:block;padding:9px 12px;border-radius:10px;
  color:var(--text);text-decoration:none;font-size:.9rem;font-weight:500;
  margin-bottom:3px;transition:background .15s;
}
.sidebar a:hover{background:var(--surface-soft)}
.sidebar a.active{background:var(--accent);color:#fff}
.reset-btn{
  width:100%;margin-top:6px;padding:9px;border:1px solid var(--border);
  border-radius:10px;background:var(--surface);color:var(--muted);
  cursor:pointer;font-weight:600;font-size:.85rem;
}
.reset-btn:hover{border-color:#ef4444;color:#ef4444}

/* ---------- Main ---------- */
.main{padding:28px 32px}
.book{max-width:860px;margin:0 auto}
.page-head{
  display:flex;justify-content:space-between;align-items:flex-end;gap:20px;
  flex-wrap:wrap;margin-bottom:22px;
}
.page-head h2{font-size:1.7rem;font-weight:800}
.page-sub{color:var(--muted);margin-top:4px;font-size:.95rem;max-width:560px}
.progress-box{min-width:200px}
.progress-label{font-size:.85rem;font-weight:700;margin-bottom:6px;color:var(--muted)}
.progress-bar{height:10px;background:var(--surface-soft);border-radius:999px;overflow:hidden;border:1px solid var(--border)}
.progress-fill{height:100%;background:linear-gradient(90deg,var(--green),var(--accent-2));width:0;transition:width .4s}

.day-tabs{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:20px}
.tbtn{
  width:36px;height:36px;border-radius:10px;border:1px solid var(--border);
  background:var(--surface);color:var(--muted);font-weight:700;cursor:pointer;
  font-size:.85rem;transition:all .15s;
}
.tbtn:hover{border-color:var(--accent);color:var(--text)}
.tbtn.active{background:var(--accent);color:#fff;border-color:var(--accent)}
.tbtn.done{background:var(--green-soft);border-color:var(--green);color:var(--green)}
.tbtn.done.active{background:var(--green);color:#fff}

/* ---------- Day view ---------- */
.dayview{
  background:var(--surface);border:1px solid var(--border);
  border-radius:18px;box-shadow:var(--shadow);padding:28px;
  animation:fade .25s ease;
}
@keyframes fade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.dayhead{border-bottom:1px solid var(--border);padding-bottom:16px;margin-bottom:18px}
.chip{
  display:inline-block;font-size:.72rem;font-weight:800;letter-spacing:.08em;
  text-transform:uppercase;color:var(--accent);background:var(--accent-2);
  background:transparent;border:1px solid var(--accent);padding:3px 10px;border-radius:999px;
}
.dayhead h3{font-size:1.4rem;font-weight:800;margin:10px 0 4px}
.focus{color:var(--muted);font-size:.95rem}
.done-btn{
  margin-top:14px;padding:9px 18px;border-radius:10px;border:none;cursor:pointer;
  background:var(--accent);color:#fff;font-weight:700;font-size:.9rem;
}
.done-btn.is-done{background:var(--green)}

.taskgrid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}
.taskcard{
  background:var(--surface-soft);border:1px solid var(--border);
  border-radius:14px;padding:16px;
}
.taskcard-wide{grid-column:1/-1}
.taskcard h4{font-size:.8rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-bottom:10px}
.task-stack{display:flex;flex-direction:column;gap:6px}
.task-link{
  display:inline-block;margin-bottom:6px;padding:7px 12px;border-radius:9px;
  background:var(--surface);border:1px solid var(--border);
  text-decoration:none;font-size:.9rem;font-weight:600;color:var(--accent);
  transition:border-color .15s;
}
.task-link:hover{border-color:var(--accent)}
.task-link.big{font-size:.95rem;color:var(--text)}
.task-link.muted{color:var(--muted);cursor:default;border-style:dashed}
.action{color:var(--text);font-size:.95rem}

/* ---------- Reading content blocks ---------- */
.block{margin-bottom:22px}
.block-title{
  font-size:.8rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase;
  color:var(--muted);margin-bottom:12px;
}
.wgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:8px}
.wcard{
  display:flex;flex-direction:column;gap:2px;
  background:var(--surface-soft);border:1px solid var(--border);
  border-radius:10px;padding:10px 12px;
}
.wde{font-weight:700;font-size:.95rem;color:var(--text)}
.wen{color:var(--muted);font-size:.82rem}

.sentlist{list-style:none;display:flex;flex-direction:column;gap:8px}
.sent{
  background:var(--surface-soft);border:1px solid var(--border);
  border-left:3px solid var(--accent);border-radius:10px;padding:10px 14px;
  display:flex;flex-direction:column;gap:2px;
}
.sde{font-weight:600;color:var(--text);font-size:.98rem}
.sen{color:var(--muted);font-size:.85rem;font-style:italic}

.para{
  background:var(--surface-soft);border:1px solid var(--border);
  border-radius:12px;padding:14px 16px;margin-bottom:10px;
}
.pde{font-size:1rem;line-height:1.75;color:var(--text);margin-bottom:4px}
.pen{font-size:.88rem;color:var(--muted);font-style:italic}

/* ---------- Pager ---------- */
.pager{display:flex;align-items:center;justify-content:space-between;margin-top:20px}
.pg-btn{
  padding:9px 20px;border-radius:10px;border:1px solid var(--border);
  background:var(--surface);color:var(--text);cursor:pointer;font-weight:700;
}
.pg-btn:hover{border-color:var(--accent)}
.pg-label{color:var(--muted);font-weight:600;font-size:.9rem}

.footer{text-align:center;color:var(--muted);font-size:.85rem;padding:20px}

@media(max-width:820px){
  .layout{grid-template-columns:1fr}
  .sidebar{position:static;height:auto;border-right:none;border-bottom:1px solid var(--border)}
  .main{padding:20px 16px}
  .taskgrid{grid-template-columns:1fr}
}
