/* =============================================================================
   Student Tracker — soothing pastel + modern academic aesthetic
   Palette: sage green · lavender · warm peach · sky blue · butter yellow
   Background: off-white #FAFAFA / soft slate
   ============================================================================= */

:root {
  --canvas: #FAFAFA;
  --slate: #F1F0F4;
  --ink: #2D2B3A;
  --muted: #6B6678;
  --sage: #A9D8C7;
  --sage-d: #5CB89A;
  --lav: #C7B8F0;
  --lav-d: #9B7FE0;
  --peach: #F7C8A9;
  --peach-d: #E8975C;
  --sky: #A9D4F0;
  --sky-d: #6BAED6;
  --butter: #F4E0A3;
  --butter-d: #D9B84E;
  --card: #FFFFFF;
  --line: #ECE9F2;
  --shadow: 0 4px 20px rgba(45, 43, 58, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }

/* ---- Bento grid ---------------------------------------------------------- */
.bento {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}
.bento-card { min-width: 0; }
/* Calendar spans wide; others tile tightly — zero wasted whitespace */
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }

@media (max-width: 1100px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .span-2, .span-3, .span-4 { grid-column: span 2; }
}
@media (max-width: 680px) {
  .bento { grid-template-columns: 1fr; }
  .span-2, .span-3, .span-4 { grid-column: span 1; }
}

/* ---- Cards --------------------------------------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.card-scroll { overflow: auto; }

/* Section accents */
.accent-sky    { border-top: 4px solid var(--sky); }
.accent-lav    { border-top: 4px solid var(--lav); }
.accent-peach  { border-top: 4px solid var(--peach); }
.accent-sage   { border-top: 4px solid var(--sage); }
.accent-butter { border-top: 4px solid var(--butter); }

/* ---- Buttons ------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 12px;
  padding: 9px 14px; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
  user-select: none; white-space: nowrap;
}
.btn:hover { filter: brightness(0.97); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--lav-d); color: #fff; }
.btn-ghost { background: var(--slate); color: var(--ink); border-color: var(--line); }
.btn-danger { background: #FBE0E0; color: #B4453A; border-color: #F3C9C9; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-sky { background: var(--sky-d); color: #fff; }
.btn-sage { background: var(--sage-d); color: #fff; }
.btn-peach { background: var(--peach-d); color: #fff; }
.btn-butter { background: var(--butter-d); color: #2D2B3A; }

/* ---- Inputs -------------------------------------------------------------- */
.field {
  width: 100%; border: 1px solid var(--line); border-radius: 12px;
  padding: 9px 12px; font-size: 14px; background: #fff; color: var(--ink);
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.field:focus { border-color: var(--lav-d); box-shadow: 0 0 0 3px rgba(155,127,224,.18); }
label.lbl { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---- Chips / badges ------------------------------------------------------ */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.chip-high { background: #FBE0E0; color: #B4453A; }
.chip-medium { background: var(--butter); color: #8A6D1F; }
.chip-low { background: var(--sage); color: #2E7D5B; }
.chip-exam { background: #FBE0E0; color: #B4453A; }
.chip-assignment { background: var(--butter); color: #8A6D1F; }
.chip-study { background: var(--lav); color: #5B3FA8; }
.chip-other { background: var(--slate); color: var(--muted); }

/* ---- Progress bars ------------------------------------------------------- */
.bar { height: 10px; border-radius: 999px; background: var(--slate); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; transition: width .35s ease, background .35s ease; }

/* ---- Calendar ------------------------------------------------------------ */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0,1fr)); gap: 4px; }
.cal-dow { font-size: 11px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; text-transform: uppercase; }
.cal-cell {
  position: relative; min-height: 58px; border: 1px solid var(--line); border-radius: 10px;
  padding: 4px 5px; background: #fff; cursor: pointer; transition: background .12s ease, border-color .12s ease;
  display: flex; flex-direction: column; gap: 2px;
}
.cal-cell:hover { background: #F6F4FB; border-color: var(--lav); }
.cal-cell.muted { background: var(--slate); color: var(--muted); }
.cal-cell.today { border: 2px solid var(--sky-d); box-shadow: inset 0 0 0 1px rgba(107,174,214,.25); }
.cal-cell.selected { border: 2px solid var(--lav-d); }

/* ---- LeetCode-style productivity heatmap -------------------------------- */
/* neutral soft gray/off-white for 0 -> escalating soft sage/mint shades       */
.heat-0 { background: #FFFFFF; }
.heat-1 { background: #EAF6EF; }   /* faint mint */
.heat-2 { background: #C9EAD8; }   /* soft sage */
.heat-3 { background: #9DD6B6; }   /* sage/mint */
.heat-4 { background: #6FC293; }   /* vivid sage */
.cal-cell.muted.heat-0, .cal-cell.muted.heat-1, .cal-cell.muted.heat-2, .cal-cell.muted.heat-3, .cal-cell.muted.heat-4 { background: var(--slate); }

.hidden { display: none !important; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.cal-daynum { font-size: 12px; font-weight: 700; }
.cal-dots { display: flex; flex-wrap: wrap; gap: 3px; margin-top: auto; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; }
.cal-ev { font-size: 9px; line-height: 1.15; border-radius: 5px; padding: 1px 4px; color: #2D2B3A; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Stopwatch ----------------------------------------------------------- */
.sw-display {
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum";
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: clamp(22px, 4vw, 40px); font-weight: 800; letter-spacing: .02em;
  text-align: center; padding: 14px 8px; border-radius: 14px;
  background: #F4EFFD; color: #5B3FA8; border: 1px solid var(--lav);
}

/* ---- Todo ---------------------------------------------------------------- */
.todo-row { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.todo-row.done { opacity: .6; }
.todo-row.done .todo-title { text-decoration: line-through; }
.todo-check { width: 20px; height: 20px; accent-color: var(--sage-d); cursor: pointer; }

/* ---- Animations ---------------------------------------------------------- */
@keyframes pop { 0% { transform: scale(.8); opacity:0;} 60%{transform:scale(1.05);} 100%{transform:scale(1);opacity:1;} }
.pop { animation: pop .25s ease; }
@keyframes slidein { from { transform: translateY(8px); opacity:0;} to {transform:translateY(0);opacity:1;} }
.slidein { animation: slidein .25s ease; }

/* ---- Scrollbars ---------------------------------------------------------- */
.card-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.card-scroll::-webkit-scrollbar-thumb { background: #DDD8EA; border-radius: 8px; }

/* ---- Auth ---------------------------------------------------------------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--canvas); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: 0 12px 44px rgba(45,43,58,.08); }

/* ---- Top bar ------------------------------------------------------------- */
.topbar { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 18px; background:#fff; border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20; flex-wrap:wrap; }
.avatar { width:38px; height:38px; border-radius:50%; display:grid; place-items:center; font-weight:800; color:#2D2B3A; border:2px solid #fff; box-shadow:0 0 0 1px var(--line); }

/* +3/+7 revision dots */
.cal-rev-dot { position: absolute; top: 3px; right: 4px; font-size: 10px; line-height: 1; }
