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

:root {
  --ink: #111114;
  --ink-2: #2A2A30;
  --muted: #6E6E78;
  --line: #E6E6E0;
  --paper: #F6F6F1;
  --card: #FFFFFF;
  --yellow: #FFE600;
  --yellow-deep: #E6CF00;
  --yellow-soft: #FFF7B3;
  --peach: #F9D9C1;
  --green: #1E9E5A;
  --red: #D92D20;
  --shadow: 0 1px 2px rgba(17,17,20,.04), 0 8px 24px -12px rgba(17,17,20,.18);
  --radius: 18px;
  --display: 'Sora', system-ui, sans-serif;
  --body: 'Manrope', system-ui, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); color: var(--ink); background: var(--paper); line-height: 1.5; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; margin: 0; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink); color: #fff;
  border-bottom: 4px solid var(--yellow);
}
.topbar .wrap { display: flex; align-items: center; gap: 14px; padding: 10px 20px; max-width: 1240px; margin: 0 auto; }
.topbar img { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 0 0 2px var(--yellow); }
.topbar .brand { font-family: var(--display); font-weight: 800; font-size: 1.15rem; letter-spacing: -.01em; }
.topbar .brand span { color: var(--yellow); }
.topbar .sub { font-size: .72rem; color: #BDBDC6; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.topbar .spacer { flex: 1; }
.lang { display: inline-flex; background: #26262D; border-radius: 999px; padding: 3px; }
.lang button { border: 0; background: transparent; color: #BDBDC6; padding: 5px 12px; border-radius: 999px; font-weight: 700; font-size: .8rem; cursor: pointer; }
.lang button.on { background: var(--yellow); color: var(--ink); }

/* ---------- layout ---------- */
.page { max-width: 1240px; margin: 0 auto; padding: 28px 20px 80px; }
.hero { display: grid; gap: 6px; margin-bottom: 22px; }
.hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
.hero p { margin: 0; color: var(--muted); max-width: 60ch; }
.eyebrow { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; color: var(--muted); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px; }
@media (max-width: 600px) { .card { padding: 18px; border-radius: 14px; } .page { padding: 18px 12px 70px; } }

/* steps */
.steps { display: flex; gap: 8px; align-items: center; margin: 0 0 18px; flex-wrap: wrap; }
.step { display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.step i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-family: var(--display); font-size: .78rem; background: #EDEDE7; color: var(--muted); }
.step.on { color: var(--ink); } .step.on i { background: var(--yellow); color: var(--ink); }
.step.done i { background: var(--ink); color: var(--yellow); }
.step + .step::before { content: ''; width: 24px; height: 2px; background: var(--line); margin-right: 2px; }
@media (max-width: 600px) { .step + .step::before { width: 10px; } .step b { display: none; } }

/* forms */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(2, 1fr); }
.grid .full { grid-column: 1 / -1; }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }
label.f { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
label.f small { color: var(--muted); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; border: 1.5px solid var(--line); background: #FBFBF8; border-radius: 12px; padding: 12px 14px; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--ink); box-shadow: 0 0 0 4px var(--yellow-soft); outline: none; background: #fff; }
.input.bad { border-color: var(--red); }
.err { color: var(--red); font-size: .8rem; font-weight: 600; min-height: 1em; }
textarea.input { resize: vertical; min-height: 80px; }

.btn { border: 0; cursor: pointer; border-radius: 999px; padding: 13px 24px; font-weight: 800; font-family: var(--display); font-size: .95rem; display: inline-flex; gap: 8px; align-items: center; justify-content: center; transition: transform .12s, box-shadow .15s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--yellow); box-shadow: 0 10px 22px -10px rgba(17,17,20,.6); }
.btn.primary:hover { background: #000; }
.btn.yellow { background: var(--yellow); color: var(--ink); }
.btn.yellow:hover { background: var(--yellow-deep); }
.btn.ghost { background: transparent; border: 1.5px solid var(--line); color: var(--ink-2); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.danger { background: #FDEBE9; color: var(--red); }
.btn.sm { padding: 8px 14px; font-size: .8rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }

/* ---------- schedule ---------- */
.sched-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); font-weight: 600; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--line); background: var(--peach); display: inline-block; }
.legend i.sel { background: var(--yellow); border-color: var(--yellow-deep); box-shadow: 0 0 0 3px var(--yellow-soft); }
.legend i.lock { background: #F1F1EC; }
.legend i.can { background: #fff; background-image: linear-gradient(135deg, transparent 46%, var(--red) 46%, var(--red) 54%, transparent 54%); }

.daytabs { display: none; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.daytabs button { flex: 0 0 auto; border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-weight: 700; font-size: .82rem; cursor: pointer; }
.daytabs button.on { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
.daytabs button .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); margin-left: 6px; vertical-align: middle; }

.sched { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.daycol { display: grid; gap: 8px; align-content: start; }
.daycol.weekend { position: relative; }
.daycol.weekend::before { content: ''; position: absolute; left: -6px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.dayhead { border-radius: 12px; padding: 10px 6px; text-align: center; font-family: var(--display); font-weight: 800; font-size: .85rem; color: var(--ink); }
.dayhead small { display: block; font-family: var(--body); font-weight: 600; color: rgba(17,17,20,.62); font-size: .72rem; }
.d1 { background: #8FD7F7; } .d2 { background: #FFE600; } .d3 { background: #FFE27A; } .d4 { background: #B7E28A; } .d5 { background: #F7C2A3; } .d6 { background: #FFC933; } .d7 { background: #FF7AD5; }

.tile {
  position: relative; width: 100%; text-align: left; border: 1.5px solid #F2C6A8; background: var(--peach); border-radius: 14px; padding: 10px 10px 9px; cursor: pointer;
  display: grid; gap: 2px; transition: transform .15s, box-shadow .2s, background .2s, border-color .2s; overflow: hidden;
}
.tile .time { font-size: .72rem; font-weight: 700; color: rgba(17,17,20,.62); letter-spacing: .02em; }
.tile .lvl { font-family: var(--display); font-weight: 800; font-size: 1.35rem; line-height: 1.15; letter-spacing: -.02em; }
.tile .meta { font-size: .7rem; color: rgba(17,17,20,.6); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile:hover { transform: translateY(-2px); box-shadow: 0 10px 18px -12px rgba(17,17,20,.4); }
.tile.on { background: var(--yellow); border-color: var(--yellow-deep); box-shadow: 0 0 0 4px var(--yellow-soft), 0 0 24px 2px rgba(255,230,0,.75); animation: glow 1.6s ease-in-out infinite alternate; }
.tile.on::after { content: '✓'; position: absolute; top: 8px; right: 10px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--yellow); font-size: .7rem; display: grid; place-items: center; font-weight: 800; }
@keyframes glow { from { box-shadow: 0 0 0 4px var(--yellow-soft), 0 0 16px 0 rgba(255,230,0,.55); } to { box-shadow: 0 0 0 5px var(--yellow-soft), 0 0 30px 4px rgba(255,230,0,.9); } }
.tile.lock { background: #F1F1EC; border-color: var(--line); color: #A3A3AB; cursor: not-allowed; }
.tile.lock .time, .tile.lock .meta { color: #A3A3AB; }
.tile.lock:hover { transform: none; box-shadow: none; }
.tile.full { background: #F1F1EC; border-color: var(--line); cursor: not-allowed; }
.tile.cancel { background: #fff; border-color: #F3C1BC; cursor: pointer; }
.tile.cancel .lvl { color: #B9B9C0; text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 3px; }
.tile.cancel::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 1.5px), var(--red) calc(50% - 1.5px), var(--red) calc(50% + 1.5px), transparent calc(50% + 1.5px)); opacity: .75; pointer-events: none; }
.tile.cancel:hover { transform: none; box-shadow: none; }

.classroom { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.classroom .pill { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; font-size: .8rem; font-weight: 600; background: #fff; }
.classroom .pill b { color: var(--ink); }

@media (max-width: 820px) {
  .daytabs { display: flex; }
  .sched { grid-template-columns: 1fr; }
  .daycol { display: none; }
  .daycol.show { display: grid; grid-template-columns: repeat(2, 1fr); }
  .daycol.show .dayhead { grid-column: 1/-1; }
  .daycol.weekend::before { display: none; }
  .tile .lvl { font-size: 1.5rem; }
}

/* toast & modal */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 99; max-width: 92vw; text-align: center; border-left: 4px solid var(--yellow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { border-left-color: var(--red); }
.modal-bg { position: fixed; inset: 0; background: rgba(17,17,20,.5); display: none; place-items: center; z-index: 90; padding: 16px; backdrop-filter: blur(3px); }
.modal-bg.show { display: grid; }
.modal { background: #fff; border-radius: 18px; padding: 24px; max-width: 520px; width: 100%; box-shadow: 0 30px 60px -20px rgba(0,0,0,.4); max-height: 92vh; overflow: auto; }
.modal h3 { font-size: 1.1rem; margin-bottom: 10px; }

/* confirmation */
.done-wrap { text-align: center; display: grid; gap: 14px; justify-items: center; }
.done-ico { width: 70px; height: 70px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; font-size: 2rem; font-weight: 900; font-family: var(--display); animation: pop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.summary { width: 100%; max-width: 560px; text-align: left; display: grid; gap: 8px; }
.summary .row { display: flex; gap: 12px; align-items: center; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #FBFBF8; }
.summary .row .lv { font-family: var(--display); font-weight: 800; font-size: 1.2rem; background: var(--yellow); border-radius: 8px; padding: 2px 10px; }
.summary .row .dt { font-weight: 700; }
.summary .row .dt small { display: block; color: var(--muted); font-weight: 600; }
.note { font-size: .85rem; color: var(--muted); }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 12px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--yellow); }
.stat { display: grid; gap: 2px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.stat b { font-family: var(--display); font-size: 1.6rem; }
.stat span { color: var(--muted); font-size: .8rem; font-weight: 600; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 18px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { text-align: left; font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:hover td { background: #FBFBF6; }
.tbl-wrap { overflow-x: auto; }
.tag { display: inline-block; border-radius: 999px; padding: 2px 9px; font-size: .72rem; font-weight: 700; background: #EDEDE7; }
.tag.y { background: var(--yellow); } .tag.g { background: #DDF5E6; color: #137A42; } .tag.r { background: #FDEBE9; color: var(--red); } .tag.b { background: #E7F1FF; color: #1D4ED8; }
.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-sched .tile { cursor: pointer; }
.admin-sched .tile .edit { position: absolute; right: 6px; top: 6px; font-size: .65rem; background: rgba(255,255,255,.7); border-radius: 6px; padding: 2px 6px; font-weight: 700; }
.admin-sched .tile.cancel .edit { background: #FDEBE9; color: var(--red); }
.help { background: var(--yellow-soft); border: 1px solid #F1DF70; border-radius: 12px; padding: 12px 14px; font-size: .85rem; margin-bottom: 14px; }
.help code { background: #fff; padding: 1px 6px; border-radius: 5px; }
.qr-box { display: grid; gap: 14px; justify-items: center; text-align: center; }
.qr-box img { width: min(320px, 80vw); border-radius: 16px; border: 1px solid var(--line); }
.login { max-width: 420px; margin: 60px auto; }
.hidden { display: none !important; }
a.btn { text-decoration: none; }
@media (max-width: 600px) { .topbar .sub { display: none; } .topbar img { width: 40px; height: 40px; } .topbar .brand { font-size: 1rem; } }
