/* =====================================================================
   The Study Hub — styles
   Brand colors live in the :root block right below. Change them here
   and the whole site updates.
   ===================================================================== */

:root {
  color-scheme: light dark;
  --bg:     light-dark(#e9f3fd, #0e1726);  /* page background (sky blue) */
  --ink:    light-dark(#1d2940, #eef3fa);  /* main text (navy) */
  --muted:  light-dark(#55627a, #a8b5c8);  /* secondary text */
  --line:   light-dark(#cddcee, #2b3a54);  /* borders */
  --card:   light-dark(#ffffff, #152036);  /* cards and forms */
  --soft:   light-dark(#f2f8ff, #1a2740);  /* light fills */
  --band:   light-dark(#fdf4e1, #18233a);  /* header (cream) */
  --yellow: #f7c948;                       /* open times, badges */
  --ysoft:  light-dark(#fff4d3, #2f2808);
  --coral:  #f2836b;                       /* main buttons */
  --red:    light-dark(#e4523b, #ff8a70);  /* "We're here to help" red, decline */
  --rsoft:  light-dark(#fde6e1, #331813);
  --teal:   #2a9d8f;                       /* approve, success */
  --tsoft:  light-dark(#e0f3f0, #13302d);
  --blue:   #bcdcfa;                       /* language stickers */
  --edge:   #1d2940;                       /* sticker outlines */
}

* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.55 Inter, system-ui, sans-serif; overflow-x: clip; }
img { max-width: 100%; }
a { color: var(--teal); }
h1, h2, h3 { font-family: Poppins, Inter, sans-serif; line-height: 1.08; letter-spacing: -.02em; margin: 0; }
h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 800; }
h2 { font-size: 24px; font-weight: 800; }
h3 { font-size: 19px; font-weight: 700; }
p { margin: 0; }

/* ---------- layout ---------- */
.band { padding: clamp(22px, 3.5vw, 44px) max(5vw, 16px); }
.wrap { max-width: 1240px; margin: 0 auto; }
.top { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: end; margin-bottom: 22px; }
.top p { color: var(--muted); margin-top: 8px; max-width: 62ch; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 18px; }
.stack1 { display: grid; gap: 14px; }

/* ---------- header ---------- */
.site-header { background: var(--band); position: relative; overflow: hidden; border-bottom: 2px solid var(--line); padding-block: 16px; }
.site-header .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; }
.brand img { width: 58px; height: 58px; flex: none; }
.brand b { font: 800 22px Poppins, sans-serif; display: block; letter-spacing: -.02em; }
.brand span { font-size: 14px; color: var(--muted); }
.spark { position: absolute; pointer-events: none; }
nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
nav a, nav button { color: var(--ink); text-decoration: none; padding: 8px 14px; border-radius: 999px; font: 600 15px Inter, sans-serif; border: 2px solid var(--line); background: var(--card); cursor: pointer; }
nav a.on { background: var(--edge); color: #fff; border-color: var(--edge); }

.notice { background: var(--ysoft); border-bottom: 2px solid var(--line); padding: 10px max(5vw, 16px); font-size: 15px; }

/* ---------- stickers, chips, tags ---------- */
.free { display: inline-block; background: var(--yellow); color: #1d2940; border: 2px solid var(--edge); border-radius: 999px; padding: 3px 12px; font: 800 13px Poppins, sans-serif; margin-bottom: 10px; }
.help { color: var(--red); display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip { border: 2px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 8px 15px; font: 600 15px Inter, sans-serif; cursor: pointer; min-height: 42px; }
.chip.on { background: var(--blue); color: #1d2940; border-color: var(--edge); box-shadow: 0 3px 0 var(--edge); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.tag { font-size: 13px; padding: 3px 9px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.tag.lang { background: var(--blue); border: 2px solid var(--edge); color: #1d2940; font-weight: 700; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 2px solid var(--line); border-radius: 20px; padding: 18px; }
.who { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.av { width: 46px; height: 46px; border-radius: 50%; background: var(--yellow); color: #1d2940; border: 2px solid var(--edge); display: grid; place-items: center; font: 800 17px Poppins, sans-serif; flex: none; }
.meta { color: var(--muted); font-size: 14px; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: 18px; }
.note { background: var(--soft); border-radius: 10px; padding: 10px 12px; margin: 10px 0; font-size: 15px; }
.ok { background: var(--tsoft); border-radius: 12px; padding: 16px; margin-bottom: 14px; }
.warn { background: var(--ysoft); border-radius: 12px; padding: 14px 16px; font-size: 15px; }

/* ---------- week grid ---------- */
.week { display: grid; grid-template-columns: 66px repeat(5, minmax(0, 1fr)); gap: 4px; font-size: 13px; }
.week .dh { text-align: center; font-weight: 600; padding-bottom: 4px; line-height: 1.2; }
.week .dh small { display: block; color: var(--muted); font-weight: 400; }
.week .tm { color: var(--muted); align-self: center; white-space: nowrap; }
.cell { min-height: 40px; border-radius: 8px; background: var(--soft); }
.slot { min-height: 40px; border-radius: 9px; background: var(--yellow); color: #1d2940; border: 2px solid var(--edge); font: 700 13px Inter, sans-serif; cursor: pointer; box-shadow: 0 3px 0 var(--edge); }
.slot:hover, .slot:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.busy { min-height: 40px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; color: var(--muted); background: repeating-linear-gradient(135deg, var(--soft) 0 6px, transparent 6px 12px); border: 1px solid var(--line); }
.tog { min-height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--soft); cursor: pointer; font: 600 12px Inter, sans-serif; color: var(--muted); }
.tog.on { background: var(--yellow); border: 2px solid var(--edge); color: #1d2940; }

/* ---------- buttons ---------- */
.btn { border: 2px solid var(--edge); border-radius: 999px; padding: 10px 20px; font: 700 15px Inter, sans-serif; cursor: pointer; min-height: 44px; background: var(--coral); color: #1d2940; box-shadow: 0 3px 0 var(--edge); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge); }
.btn.ghost { background: var(--card); color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.no { background: var(--card); color: var(--red); border-color: var(--red); box-shadow: none; }
.btn.y { background: var(--yellow); }
.btn.go { background: var(--teal); color: #fff; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- forms ---------- */
label { font-weight: 600; font-size: 15px; display: block; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=url], select, textarea { width: 100%; font: 16px Inter, sans-serif; padding: 11px 12px; border: 1px solid color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 10px; background: var(--card); color: var(--ink); }
textarea { min-height: 84px; resize: vertical; }
.f { margin-bottom: 16px; }
.f2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; margin-bottom: 10px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--teal); }
.hint { font-size: 14px; color: var(--muted); margin-top: 5px; }
.err { color: var(--red); font-size: 14px; font-weight: 600; margin-top: 8px; }
.drop { border: 2px dashed var(--teal); border-radius: 14px; padding: 16px; text-align: center; background: var(--tsoft); }
.drop input { display: block; margin: 10px auto 0; max-width: 100%; }
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.th { position: relative; width: 88px; height: 112px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #fff; padding: 0; cursor: pointer; }
.th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.th .rm { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(0,0,0,.7); color: #fff; cursor: pointer; }

/* ---------- modal + lightbox ---------- */
.ov { position: fixed; inset: 0; background: rgba(10,14,20,.55); overflow: auto; z-index: 20; padding: 20px 12px; }
.panel { background: var(--bg); max-width: 600px; margin: 0 auto; border-radius: 22px; padding: 22px; border: 2px solid var(--line); }
.panel .ph { display: flex; justify-content: space-between; gap: 12px; align-items: start; margin-bottom: 16px; }
.x { background: var(--soft); border: 1px solid var(--line); color: var(--ink); border-radius: 50%; width: 40px; height: 40px; font-size: 18px; cursor: pointer; flex: none; }
.pick { background: var(--ysoft); border-radius: 12px; padding: 12px 14px; margin-bottom: 18px; font-weight: 600; }
.light { position: fixed; inset: 0; background: rgba(0,0,0,.85); z-index: 30; display: grid; place-items: center; padding: 16px; }
.light img { max-height: 88vh; border-radius: 8px; background: #fff; }
.light .x { position: fixed; top: 14px; right: 14px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--edge); color: #fff; padding: 12px 18px; border-radius: 999px; z-index: 40; font-weight: 600; max-width: calc(100% - 32px); }

/* ---------- tutor dashboard ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab { background: none; border: 0; border-bottom: 3px solid transparent; padding: 12px 14px; font: 600 15px Inter, sans-serif; color: var(--muted); cursor: pointer; }
.tab.on { color: var(--ink); border-color: var(--coral); }
.req { border-left: 6px solid var(--yellow); }
.req.approved { border-left-color: var(--teal); }
.req.declined, .req.cancelled { border-left-color: var(--red); opacity: .8; }
.status { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--ysoft); white-space: nowrap; }
.status.approved { background: var(--tsoft); color: var(--teal); }
.status.declined, .status.cancelled { background: var(--rsoft); color: var(--red); }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(9em, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--card); border: 2px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.stat b { display: block; font: 800 clamp(28px, 4vw, 38px)/1 Poppins, sans-serif; }
.stat span { font-size: 14px; color: var(--muted); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 14px; color: var(--muted); font-weight: 600; }

/* ---------- legal page ---------- */
.legal { max-width: 760px; }
.legal h2 { margin: 34px 0 10px; }
.legal h3 { margin: 20px 0 6px; font-size: 17px; }
.legal p, .legal li { font-size: 16px; margin-bottom: 8px; }
.legal ul { padding-left: 22px; margin: 0 0 10px; }

footer { border-top: 2px solid var(--line); color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; }

/* ---------- phones ---------- */
@media (max-width: 600px) {
  .week { grid-template-columns: 52px repeat(5, minmax(0, 1fr)); gap: 3px; }
  .panel { padding: 16px; }
  table { font-size: 13px; }
  th, td { padding: 6px 4px; }
  .stack thead { display: none; }
  .stack tr { display: grid; padding-block: 10px; border-bottom: 1px solid var(--line); }
  .stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 3px 0; }
  .stack td::before { content: attr(data-l); color: var(--muted); font-weight: 600; }
}
