/* ─── S-5 Time Management, Productivity & Workplace Wellness ───────────────
   Palette: cream / sage / terracotta / soft gold / charcoal
   Calmer, wellness-leaning. Distinct from S-1..S-4.                          */

:root {
  --cream: #F7F4ED;
  --cream-2: #EFEADD;
  --paper: #FFFFFF;
  --sage: #6B8E5A;
  --sage-dark: #4F6E42;
  --sage-soft: #D8E4CE;
  --terracotta: #C97D60;
  --terracotta-dark: #A65A3F;
  --gold: #D4AF6A;
  --gold-soft: #F2E3B8;
  --charcoal: #2B2B2B;
  --ink: #3A3A3A;
  --muted: #7A7569;
  --line: #E2DCCB;
  --danger: #B23A48;
  --ok: #4F6E42;
  --shadow: 0 2px 8px rgba(60, 50, 30, 0.08);
  --shadow-lg: 0 6px 24px rgba(60, 50, 30, 0.12);
  --radius: 10px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
  font-size: 15px;
}
h1, h2, h3, h4 { color: var(--charcoal); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 1.7rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.3rem; margin: 1.4rem 0 0.6rem; }
h3 { font-size: 1.08rem; margin: 1rem 0 0.4rem; color: var(--sage-dark); }
h4 { font-size: 0.98rem; margin: 0.8rem 0 0.3rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
p { margin: 0.5rem 0; }
a { color: var(--terracotta-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
hr { border: none; border-top: 1px solid var(--line); margin: 1.4rem 0; }

/* ── Layout ── */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: var(--sage-dark);
  color: var(--cream);
  padding: 0.7rem 1.2rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow);
}
.topbar .brand { font-weight: 700; font-size: 1.05rem; letter-spacing: 0.02em; }
.topbar .brand .accent { color: var(--gold-soft); }
.topbar .who { margin-left: auto; font-size: 0.88rem; opacity: 0.9; }
.topbar .who .role { background: var(--terracotta); color: white; padding: 2px 8px; border-radius: 6px; font-size: 0.78rem; margin-left: 0.5rem; }
.topbar button.logout { background: transparent; border: 1px solid var(--sage-soft); color: var(--cream); padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; margin-left: 0.8rem; }
.topbar button.logout:hover { background: rgba(255,255,255,0.1); }

.layout { display: flex; flex: 1; min-height: 0; }
.sidebar {
  width: 220px;
  background: var(--cream-2);
  border-right: 1px solid var(--line);
  padding: 1rem 0.6rem;
  overflow-y: auto;
}
.sidebar a {
  display: block;
  padding: 0.5rem 0.8rem;
  margin: 2px 0;
  border-radius: 8px;
  color: var(--ink);
  font-size: 0.92rem;
}
.sidebar a:hover { background: var(--sage-soft); text-decoration: none; }
.sidebar a.active { background: var(--sage); color: white; font-weight: 500; }
.sidebar .group-label { font-size: 0.72rem; text-transform: uppercase; color: var(--muted); padding: 0.8rem 0.8rem 0.3rem; letter-spacing: 0.08em; }

.main {
  flex: 1;
  padding: 1.6rem 2rem;
  overflow-y: auto;
  background: var(--cream);
}
.main-inner { max-width: 980px; }

/* ── Cards ── */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.3rem;
  margin: 0.8rem 0;
  box-shadow: var(--shadow);
}
.card.tight { padding: 0.7rem 0.9rem; }
.card.accent { border-left: 4px solid var(--terracotta); }
.card.sage { border-left: 4px solid var(--sage); }
.card.gold { border-left: 4px solid var(--gold); background: var(--gold-soft); }
.card-title { font-weight: 600; color: var(--charcoal); margin-bottom: 0.3rem; }

/* ── Forms ── */
label { display: block; font-size: 0.88rem; color: var(--muted); margin: 0.6rem 0 0.2rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], textarea, select {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  font: inherit;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--sage); box-shadow: 0 0 0 3px rgba(107,142,90,0.18); }
textarea { resize: vertical; min-height: 80px; }

button, .btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  background: var(--sage);
  color: white;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
button:hover, .btn:hover { background: var(--sage-dark); }
button.secondary, .btn.secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line); }
button.secondary:hover { background: var(--cream-2); }
button.terracotta, .btn.terracotta { background: var(--terracotta); }
button.terracotta:hover { background: var(--terracotta-dark); }
button.gold { background: var(--gold); color: var(--charcoal); }
button.gold:hover { background: #c19f5b; }
button.tiny { padding: 0.25rem 0.55rem; font-size: 0.82rem; border-radius: 6px; }
button.danger { background: var(--danger); }
button:disabled { opacity: 0.5; cursor: not-allowed; }

.row { display: flex; gap: 0.8rem; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 180px; }
.row.tight { gap: 0.4rem; }

/* ── Tables ── */
table { width: 100%; border-collapse: collapse; margin: 0.6rem 0; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); }
th { background: var(--cream-2); color: var(--muted); font-weight: 500; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
tr:hover td { background: var(--cream); }

/* ── Badges / pills ── */
.pill { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: 0.78rem; font-weight: 500; }
.pill.sage { background: var(--sage-soft); color: var(--sage-dark); }
.pill.gold { background: var(--gold-soft); color: #7a5d23; }
.pill.terra { background: #f4d8cc; color: var(--terracotta-dark); }
.pill.grey { background: #e8e3d5; color: var(--muted); }
.pill.green { background: #cde2c0; color: var(--ok); }

/* ── MCQ ── */
.mcq-q { font-weight: 500; margin-top: 1rem; }
.mcq-opt { display: block; padding: 0.55rem 0.75rem; margin: 0.3rem 0; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; background: var(--paper); }
.mcq-opt:hover { background: var(--sage-soft); }
.mcq-opt.selected { background: var(--sage); color: white; border-color: var(--sage-dark); }
.mcq-opt.correct { background: #d6e8cb; border-color: var(--ok); }
.mcq-opt.wrong { background: #f4d8cc; border-color: var(--danger); }
.mcq-explain { font-size: 0.88rem; color: var(--muted); margin-top: 0.3rem; padding: 0.4rem 0.6rem; background: var(--cream-2); border-radius: 6px; }

/* ── Eisenhower matrix ── */
.eisenhower { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin: 1rem 0; }
.eisenhower .quad { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 0.8rem; min-height: 140px; }
.eisenhower .quad.q1 { border-top: 4px solid var(--danger); }
.eisenhower .quad.q2 { border-top: 4px solid var(--sage); }
.eisenhower .quad.q3 { border-top: 4px solid var(--gold); }
.eisenhower .quad.q4 { border-top: 4px solid var(--muted); }
.eisenhower .quad-title { font-weight: 600; font-size: 0.88rem; color: var(--charcoal); margin-bottom: 0.3rem; }
.eisenhower .quad-sub { font-size: 0.76rem; color: var(--muted); margin-bottom: 0.5rem; }
.eisenhower .item { display: flex; align-items: center; gap: 0.4rem; padding: 0.25rem 0; font-size: 0.88rem; border-bottom: 1px dashed var(--line); }
.eisenhower .item button { background: none; color: var(--muted); padding: 0 4px; font-size: 0.8rem; }
.eisenhower .item button:hover { color: var(--danger); }

/* ── Habits ── */
.habit-row { display: flex; align-items: center; gap: 0.8rem; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.habit-row .h-name { flex: 1; }
.streak-dots { display: flex; gap: 3px; }
.streak-dots .dot { width: 14px; height: 14px; border-radius: 3px; background: var(--cream-2); border: 1px solid var(--line); }
.streak-dots .dot.done { background: var(--sage); border-color: var(--sage-dark); }

/* ── Self-assessment ── */
.assess-item { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.assess-item .stmt { margin-bottom: 0.3rem; }
.likert { display: flex; gap: 6px; }
.likert label { display: flex; flex-direction: column; align-items: center; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; min-width: 50px; margin: 0; font-size: 0.78rem; color: var(--muted); }
.likert label:hover { background: var(--sage-soft); }
.likert input { display: none; }
.likert input:checked + span { color: var(--sage-dark); font-weight: 600; }

/* ── Gradebook ── */
.grade-band { font-weight: 700; font-size: 1.4rem; }
.grade-band.A\+, .grade-band.A { color: var(--ok); }
.grade-band.B { color: var(--gold); }
.grade-band.C, .grade-band.D { color: var(--terracotta-dark); }

/* ── Login / landing ── */
.center-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { background: var(--paper); border-radius: 12px; padding: 2rem 2.2rem; max-width: 420px; width: 100%; box-shadow: var(--shadow-lg); border-top: 5px solid var(--sage); }
.auth-card h1 { margin-bottom: 0.2rem; }
.auth-card .tag { color: var(--muted); font-size: 0.92rem; margin-bottom: 1.2rem; }
.auth-tabs { display: flex; gap: 6px; margin: 1rem 0; }
.auth-tabs button { flex: 1; background: var(--cream-2); color: var(--ink); }
.auth-tabs button.active { background: var(--sage); color: white; }

.error-msg { background: #f4d8cc; color: var(--terracotta-dark); border: 1px solid var(--terracotta); padding: 0.5rem 0.8rem; border-radius: 6px; font-size: 0.88rem; margin: 0.6rem 0; }
.success-msg { background: #d6e8cb; color: var(--ok); border: 1px solid var(--sage); padding: 0.5rem 0.8rem; border-radius: 6px; font-size: 0.88rem; margin: 0.6rem 0; }

.muted { color: var(--muted); font-size: 0.88rem; }
.mono { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 0.88rem; }
.spacer { height: 1rem; }

/* ── Progress bar ── */
.progress { background: var(--cream-2); height: 8px; border-radius: 4px; overflow: hidden; margin: 0.2rem 0; }
.progress .fill { background: var(--sage); height: 100%; transition: width 0.3s; }

/* ── Capstone weeks ── */
.cap-week { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 1rem; margin: 0.6rem 0; }
.cap-week.done { border-left: 4px solid var(--sage); }
.cap-week.pending { border-left: 4px solid var(--gold); }

/* ── Responsive ── */
@media (max-width: 760px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--line); padding: 0.4rem; display: flex; overflow-x: auto; }
  .sidebar a { white-space: nowrap; }
  .sidebar .group-label { display: none; }
  .main { padding: 1rem; }
  .eisenhower { grid-template-columns: 1fr; }
}
