
:root {
  --bg: #0b0d10;
  --card: #141820;
  --muted: #9ca3af;
  --text: #e5e7eb;
  --grid-border: #2a3242;
  --accent: #4f8cff;
  --slot-bg: #0f1420;
  --pill: #0d1117;
  --slot-h: 64px;
}
html.theme-light {
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #111827;
  --grid-border: #e5e7eb;
  --accent: #2563eb;
  --slot-bg: #f3f4f6;
  --pill: #f3f4f6;
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; background:var(--bg); color:var(--text); font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial;}
a { color: var(--accent); text-decoration: none; }

.site-header, .site-footer { max-width: 1100px; margin: 0 auto; padding: 16px; display:flex; align-items:center; justify-content:space-between; }
.site-header h1 { margin:0; font-size: 20px; font-weight: 700; }
.actions { display:flex; align-items:center; gap:12px; }
.icon-btn { border:1px solid var(--grid-border); background:var(--card); color:var(--text); border-radius:10px; padding:6px 10px; cursor:pointer; }
.icon-btn:hover { background: rgba(255,255,255,.06); }

.controls { max-width:1100px; margin:0 auto; padding: 0 16px 12px; }
.controls-form { display:flex; gap:12px; flex-wrap: wrap; align-items:center; }
.controls label { display:flex; align-items:center; gap:8px; }
.controls select, .controls input { background:#0d1117; color:#e5e7eb; border:1px solid var(--grid-border); border-radius:10px; padding:8px 10px; }
html.theme-light .controls select, html.theme-light .controls input { background:#fff; color:#111827; border-color:#e5e7eb; }
.controls .badge { background: var(--pill); border:1px solid var(--grid-border); padding:6px 10px; border-radius:999px; font-weight:700; }
.btn { padding:8px 12px; border-radius:10px; border:1px solid var(--grid-border); background: var(--accent); color:#fff; text-decoration:none; }

.timetable-wrapper { max-width: 1100px; margin: 0 auto; padding: 12px; }
.timetable { background: var(--card); border-radius: 16px; padding: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.3); overflow-x: auto; }

.grid.head { display:grid; grid-template-columns: 60px repeat(7, 1fr); border-bottom:1px solid var(--grid-border); }
.grid.body { display:grid; grid-template-columns: 60px repeat(7, 1fr); grid-auto-flow: row; grid-auto-rows: var(--slot-h); }
.row { display: contents; }

.cell { border-right:1px solid var(--grid-border); border-bottom:1px solid var(--grid-border); padding:10px; }
.cell.corner { background:var(--slot-bg); position:sticky; left:0; z-index:3; }
.cell.day { text-align:center; font-weight:600; }
.cell.slot { position:sticky; left:0; z-index:2; text-align:center; font-weight:600; background:var(--slot-bg); }
.cell.empty { background: transparent; }
.cell.hidden { display:none; }

.cell.course { border-radius: 12px; padding:0; margin:6px; display:flex; border:1px solid rgba(0,0,0,.06); }
.cell.course .inner { padding:10px 12px; display:flex; flex-direction:column; gap:6px; margin:auto 0; }
.cell.course .title, .cell.course .meta { color: inherit !important; }
.cell.course .meta { font-size: 12px; opacity:.95; }

.grid.head, .grid.body { min-width: 760px; }

@media (max-width: 640px) {
  :root { --slot-h: 56px; }
  .grid.head, .grid.body { grid-template-columns: 40px repeat(7, minmax(140px, 1fr)); }
  .cell { padding:8px; }
  .cell.course { margin:4px; }
}
