/* ═══════════════════════════════════════════════════════════
   Sing Local — App (admin / coach / student)
   Studio-dark. Warm ink, one accent per role.
   ═══════════════════════════════════════════════════════════ */

:root {
  --ink:        #15121b;
  --ink-2:      #1e1a27;
  --ink-3:      #282334;
  --line:       #383046;
  --text:       #f4f1ea;
  --text-dim:   #b3aec4;
  --text-faint: #837d95;
  --accent:     #ff6b5e;               /* student coral (default) */
  --accent-2:   #ffa270;
  --good:       #5ad19a;
  --warn:       #f5b301;
  --bad:        #ff5470;
  --radius:     16px;
  --radius-sm:  10px;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:  'Inter', system-ui, -apple-system, sans-serif;
  --shadow:     0 10px 40px rgba(0,0,0,.45);
}
[data-role="admin"]  { --accent: #f5b301; --accent-2: #ffd45e; }
[data-role="coach"]  { --accent: #8b7cff; --accent-2: #b3a6ff; }
[data-role="student"]{ --accent: #ff6b5e; --accent-2: #ffa270; }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(139,124,255,.10), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, rgba(255,107,94,.08), transparent 60%),
    var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
::selection { background: var(--accent); color: var(--ink); }

/* ── Boot splash ── */
.boot-splash { min-height: 100vh; display: flex; flex-direction: column; gap: 26px; align-items: center; justify-content: center; }
.boot-mark { font-family: var(--font-display); font-weight: 900; font-size: 34px; letter-spacing: -.5px; }
.boot-mark span { color: var(--accent); }
.boot-wave { display: flex; gap: 5px; align-items: flex-end; height: 34px; }
.boot-wave span { width: 6px; border-radius: 4px; background: var(--accent); animation: bw 1s ease-in-out infinite; }
.boot-wave span:nth-child(1){ animation-delay: 0s;   height: 40%; }
.boot-wave span:nth-child(2){ animation-delay: .12s; height: 70%; }
.boot-wave span:nth-child(3){ animation-delay: .24s; height: 100%;}
.boot-wave span:nth-child(4){ animation-delay: .36s; height: 65%; }
.boot-wave span:nth-child(5){ animation-delay: .48s; height: 45%; }
@keyframes bw { 0%,100% { transform: scaleY(.4); } 50% { transform: scaleY(1); } }

/* ── Shell ── */
.shell { max-width: 1180px; margin: 0 auto; padding: 0 20px 90px; }
.topbar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 0 14px; margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-display); font-weight: 900; font-size: 22px; letter-spacing: -.4px; white-space: nowrap; }
.brand span { color: var(--accent); }
.brand small { display: block; font-family: var(--font-body); font-weight: 500; font-size: 11px; color: var(--text-faint); letter-spacing: .12em; text-transform: uppercase; }
.topbar .spacer { flex: 1; }
.userchip { display: flex; align-items: center; gap: 10px; color: var(--text-dim); font-size: 13px; }
.userchip .avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--ink); font-weight: 700; font-size: 14px;
}
.rolepills { display: flex; gap: 6px; }
.rolepill {
  border: 1px solid var(--line); background: var(--ink-2); color: var(--text-dim);
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .22s ease;
}
.rolepill.active { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* ── Tabs ── */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 14px 0 22px; }
.tab {
  background: none; border: none; color: var(--text-dim); font-size: 14px; font-weight: 600;
  padding: 9px 16px; border-radius: 999px; cursor: pointer; transition: all .2s ease;
}
.tab:hover { color: var(--text); background: var(--ink-2); }
.tab.active { background: var(--ink-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.tab .bubble {
  display: inline-block; min-width: 19px; text-align: center; margin-left: 7px;
  background: var(--accent); color: var(--ink); border-radius: 999px; font-size: 11px; padding: 1px 6px;
}

/* ── Cards / layout ── */
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

.card {
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px;
}
.card h3 {
  font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.card h3 .minor { font-family: var(--font-body); font-size: 12px; font-weight: 500; color: var(--text-faint); }

.kpi { text-align: left; }
.kpi .n { font-family: var(--font-display); font-size: 30px; font-weight: 900; line-height: 1.1; color: var(--text); }
.kpi .l { font-size: 12px; color: var(--text-faint); letter-spacing: .06em; text-transform: uppercase; margin-top: 4px; }
.kpi.accent .n { color: var(--accent); }

/* ── Rows / lists ── */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; align-items: center; gap: 14px; padding: 13px 4px;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 14.5px; }
.row .s { font-size: 12.5px; color: var(--text-faint); margin-top: 1px; }
.row .actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.empty { color: var(--text-faint); font-size: 14px; padding: 22px 4px; text-align: center; }
.empty .big { font-size: 26px; display: block; margin-bottom: 6px; }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px; justify-content: center;
  background: var(--accent); color: var(--ink); border: none; border-radius: 999px;
  font-weight: 700; font-size: 13.5px; padding: 9px 18px; cursor: pointer;
  transition: transform .18s cubic-bezier(.3,.8,.3,1), filter .18s ease;
}
.btn:hover { transform: scale(1.05); filter: brightness(1.08); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--text-dim); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { color: var(--text); }
.btn.small { padding: 6px 13px; font-size: 12.5px; }
.btn.good { background: var(--good); }
.btn.bad { background: var(--bad); color: #fff; }
.btn.warn { background: var(--warn); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Status chips ── */
.chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase; background: var(--ink-3); color: var(--text-dim);
}
.chip.requested  { background: rgba(245,179,1,.16);  color: #ffd45e; }
.chip.confirmed  { background: rgba(90,209,154,.16); color: #7fe0b3; }
.chip.completed  { background: rgba(139,124,255,.18); color: #b3a6ff; }
.chip.cancelled, .chip.noshow, .chip.removed { background: rgba(255,84,112,.15); color: #ff8ba0; }
.chip.new        { background: rgba(255,107,94,.16); color: #ffa294; }
.chip.contacted  { background: rgba(245,179,1,.16);  color: #ffd45e; }
.chip.converted  { background: rgba(90,209,154,.16); color: #7fe0b3; }
.chip.closed     { background: var(--ink-3); color: var(--text-faint); }
.chip.active, .chip.certified, .chip.published { background: rgba(90,209,154,.16); color: #7fe0b3; }
.chip.pending, .chip.course, .chip.exam_passed, .chip.interview { background: rgba(245,179,1,.16); color: #ffd45e; }
.chip.paused { background: var(--ink-3); color: var(--text-faint); }
.chip.founder { background: linear-gradient(135deg, rgba(245,179,1,.25), rgba(255,107,94,.25)); color: #ffd45e; }
.chip.milestone { background: linear-gradient(135deg, rgba(139,124,255,.25), rgba(255,107,94,.25)); color: #cfc6ff; }

/* ── Forms ── */
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-dim); letter-spacing: .05em; text-transform: uppercase; margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; background: var(--ink); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 10px 13px; font-size: 14px; font-family: inherit;
  transition: border-color .2s ease;
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--accent); }
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: 11.5px; color: var(--text-faint); margin-top: 4px; }
.frow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .frow { grid-template-columns: 1fr; } }

/* ── Stars ── */
.stars { color: var(--warn); letter-spacing: 2px; font-size: 14px; white-space: nowrap; }
.stars .off { color: var(--ink-3); }
.starpick { display: flex; gap: 6px; font-size: 26px; cursor: pointer; }
.starpick span { color: var(--ink-3); transition: transform .15s ease, color .15s ease; }
.starpick span.on { color: var(--warn); }
.starpick span:hover { transform: scale(1.25); }

/* ── Level ring ── */
.levelcard { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.ring { position: relative; width: 130px; height: 130px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .track { stroke: var(--ink-3); }
.ring .fill { stroke: url(#gradRing); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.3,.8,.3,1); }
.ring .mid { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .mid .lv { font-family: var(--font-display); font-weight: 900; font-size: 30px; line-height: 1; }
.ring .mid .lbl { font-size: 10px; color: var(--text-faint); letter-spacing: .1em; text-transform: uppercase; }
.levelmeta .name { font-family: var(--font-display); font-size: 24px; font-weight: 900; }
.levelmeta .sub { color: var(--text-dim); font-size: 13px; margin-top: 3px; }
.levelmeta .xpbar { margin-top: 12px; width: 240px; max-width: 60vw; height: 8px; border-radius: 99px; background: var(--ink-3); overflow: hidden; }
.levelmeta .xpbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 1s cubic-bezier(.3,.8,.3,1); }

/* ── Ladder ── */
.ladder { display: flex; flex-direction: column; gap: 0; }
.ladder .step { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.ladder .step:last-child { border-bottom: none; }
.ladder .n { width: 30px; height: 30px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--ink-3); color: var(--text-faint); }
.ladder .step.reached .n { background: var(--accent); color: var(--ink); }
.ladder .step.current { background: linear-gradient(90deg, rgba(255,255,255,.03), transparent); border-radius: 8px; }
.ladder .nm { flex: 1; font-weight: 600; font-size: 14px; }
.ladder .xp { font-size: 12px; color: var(--text-faint); }

/* ── Availability editor ── */
.avail-day { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.avail-day:last-child { border-bottom: none; }
.avail-day .d { width: 44px; font-weight: 700; font-size: 13px; color: var(--text-dim); padding-top: 8px; }
.avail-day .wins { flex: 1; display: flex; flex-wrap: wrap; gap: 8px; }
.winchip { display: inline-flex; align-items: center; gap: 8px; background: var(--ink-3); border: 1px solid var(--line); border-radius: 999px; padding: 5px 8px 5px 14px; font-size: 13px; }
.winchip button { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px; }
.winchip button:hover { color: var(--bad); }
.addwin { display: inline-flex; gap: 6px; align-items: center; }
.addwin select { background: var(--ink); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 13px; }

/* ── Slot picker ── */
.slotgrid { display: flex; flex-direction: column; gap: 14px; max-height: 46vh; overflow-y: auto; padding-right: 4px; }
.slotday .dh { font-weight: 700; font-size: 13px; color: var(--text-dim); margin-bottom: 7px; }
.slotday .ss { display: flex; flex-wrap: wrap; gap: 7px; }
.slotbtn {
  background: var(--ink-3); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all .15s ease;
}
.slotbtn:hover { border-color: var(--accent); }
.slotbtn.sel { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* ── Video grid ── */
.vidgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.vid { background: var(--ink); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.vid .thumb { position: relative; aspect-ratio: 16/9; display: block; background: #000; }
.vid .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; }
.vid .thumb .play {
  position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px;
  color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.6); transition: transform .2s ease;
}
.vid .thumb:hover .play { transform: scale(1.2); }
.vid .meta { padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.vid .meta .t { font-size: 13px; font-weight: 600; }
.vid .meta .c { font-size: 11px; color: var(--text-faint); }
.vid iframe { width: 100%; aspect-ratio: 16/9; border: 0; display: block; }

/* ── Modal ── */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 18px; }
.modal-wrap .scrim { position: absolute; inset: 0; background: rgba(10,8,14,.72); backdrop-filter: blur(4px); animation: fadeIn .2s ease; }
.modal {
  position: relative; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); animation: popIn .28s cubic-bezier(.3,.8,.3,1);
}
.modal h2 { font-family: var(--font-display); font-size: 21px; font-weight: 900; margin-bottom: 4px; }
.modal .sub { color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }
.modal .foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal .x { position: absolute; top: 14px; right: 16px; background: none; border: none; color: var(--text-faint); font-size: 22px; cursor: pointer; }
.modal .x:hover { color: var(--text); }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes popIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }

/* ── Toasts ── */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--ink-3); border: 1px solid var(--line); color: var(--text);
  padding: 11px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  box-shadow: var(--shadow); animation: toastIn .3s cubic-bezier(.3,.8,.3,1);
}
.toast.good { border-color: rgba(90,209,154,.4); }
.toast.bad { border-color: rgba(255,84,112,.5); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px); } }

/* ── Level-up celebration ── */
.levelup { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; background: rgba(10,8,14,.82); animation: fadeIn .3s ease; }
.levelup .inner { text-align: center; animation: popIn .5s cubic-bezier(.3,.8,.3,1); }
.levelup .big { font-family: var(--font-display); font-size: clamp(40px, 9vw, 80px); font-weight: 900; background: linear-gradient(90deg, var(--accent), var(--accent-2), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.levelup .nm { font-size: 20px; color: var(--text); margin-top: 6px; }
.levelup .btn { margin-top: 26px; }

/* ── Login gate ── */
.gate { min-height: 82vh; display: grid; place-items: center; text-align: center; padding: 30px 16px; }
.gate .mark { font-family: var(--font-display); font-weight: 900; font-size: clamp(34px, 7vw, 56px); letter-spacing: -1px; }
.gate .mark span { color: var(--accent); }
.gate p { color: var(--text-dim); max-width: 420px; margin: 14px auto 26px; }
.gate .waves { display: flex; gap: 6px; align-items: flex-end; height: 44px; justify-content: center; margin-bottom: 26px; }
.gate .waves i { width: 7px; border-radius: 5px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); animation: bw 1.2s ease-in-out infinite; }
.gate .waves i:nth-child(1){ animation-delay: 0s;   height: 34%; }
.gate .waves i:nth-child(2){ animation-delay: .1s;  height: 62%; }
.gate .waves i:nth-child(3){ animation-delay: .2s;  height: 100%;}
.gate .waves i:nth-child(4){ animation-delay: .3s;  height: 78%; }
.gate .waves i:nth-child(5){ animation-delay: .4s;  height: 52%; }
.gate .waves i:nth-child(6){ animation-delay: .5s;  height: 30%; }

/* ── Utility ── */
.mt { margin-top: 16px; }
.muted { color: var(--text-faint); font-size: 12.5px; }
.right { text-align: right; }
.money { font-variant-numeric: tabular-nums; }
.searchbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.searchbar input, .searchbar select {
  background: var(--ink-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 9px 16px; font-size: 13.5px; min-width: 160px;
}
.searchbar input:focus, .searchbar select:focus { outline: none; border-color: var(--accent); }
.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.pagehead h1 { font-family: var(--font-display); font-size: 26px; font-weight: 900; letter-spacing: -.4px; }
.pagehead .sub { color: var(--text-faint); font-size: 13px; margin-top: 3px; }
