/* Student dashboard + admin panel (English UI) */

:root {
  --ink: #07301F;
  --brand: #0B5D3B;
  --brand-soft: #E8F1EC;
  --accent: #E8A020;
  --page: #F3F6F4;
  --paper: #FFFFFF;
  --line: #DCE5DF;
  --muted: #5D6E66;
  --danger: #B3261E;
  --ok: #17794B;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: #16221C;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3, h4 { margin: 0 0 12px; color: var(--ink); line-height: 1.3; }
h1 { font-size: 24px; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
a { color: var(--brand); }
p { margin: 0 0 12px; }

.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }

/* ---------- sidebar ---------- */
.side { background: var(--ink); color: #BCD5C7; padding: 18px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .logo { color: #fff; font-weight: 700; font-size: 17px; text-decoration: none; display: block; padding: 6px 10px 18px; }
.side .logo small { display: block; font-weight: 400; font-size: 12px; color: #7FA791; }
.side nav a {
  display: flex; align-items: center; gap: 10px;
  color: #BCD5C7; text-decoration: none;
  padding: 9px 11px; border-radius: 9px; margin-bottom: 2px; font-size: 14.5px;
}
.side nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.side nav a.active { background: var(--brand); color: #fff; }
.side .group { font-size: 11.5px; letter-spacing: .04em; color: #6F9884; padding: 16px 11px 6px; }

/* ---------- main ---------- */
.main { padding: 22px 26px 60px; max-width: 1180px; }
.topline { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.topline .who { font-size: 14px; color: var(--muted); }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.panel .sub { color: var(--muted); font-size: 14px; margin-top: -6px; margin-bottom: 16px; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.stat { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat .label { font-size: 13px; color: var(--muted); }
.stat .value { font-size: 25px; font-weight: 700; color: var(--ink); }
.stat .delta { font-size: 13px; color: var(--ok); }

/* ---------- forms ---------- */
label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; color: var(--ink); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date],
input[type=datetime-local], input[type=url], input[type=tel], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 9px;
  font: inherit; background: #fff; margin-bottom: 14px;
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; }
.inline { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.inline > * { flex: 1; min-width: 160px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-weight: 500; }
.check input { width: auto; margin: 0; }
.hint { font-size: 12.5px; color: var(--muted); margin: -8px 0 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 9px; padding: 10px 18px; font: inherit; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--ink); }
.btn-accent { background: var(--accent); color: #241902; }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid #EDC7C4; }
.btn-sm { padding: 6px 12px; font-size: 13.5px; }
.btn:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- tables ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th { text-align: left; font-size: 12.5px; color: var(--muted); padding: 10px; border-bottom: 1px solid var(--line); font-weight: 600; }
table.data td { padding: 11px 10px; border-bottom: 1px solid #EEF2F0; vertical-align: middle; }
table.data tr:hover td { background: #FAFCFB; }
.tag { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); }
.tag.warn { background: #FDF3E0; color: #8A5B06; }
.tag.bad { background: #FDECEB; color: #8F1D16; }
.tag.muted { background: #EEF2F0; color: var(--muted); }

.notice { border-radius: 10px; padding: 12px 15px; margin-bottom: 16px; font-size: 14.5px; }
.notice-ok { background: #E8F5EE; color: #0B5D3B; border: 1px solid #BFE0CD; }
.notice-bad { background: #FDECEB; color: #8F1D16; border: 1px solid #F3C6C2; }

.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 10px; }
.bars div { flex: 1; background: var(--brand-soft); border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars div:hover { background: var(--brand); }

/* ---------- student player ---------- */
.player-layout { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.stage { background: #000; border-radius: var(--radius); overflow: hidden; position: relative; aspect-ratio: 16/9; }
.stage iframe, .stage video { width: 100%; height: 100%; border: 0; display: block; background: #000; }

.wm {
  position: absolute; pointer-events: none; user-select: none;
  color: rgba(255,255,255,.34); text-shadow: 0 1px 3px rgba(0,0,0,.65);
  font-size: 14px; font-weight: 600; letter-spacing: .02em;
  transition: left 2.4s ease-in-out, top 2.4s ease-in-out;
  z-index: 5; white-space: nowrap;
}
.wm-static {
  position: absolute; right: 10px; bottom: 8px; z-index: 5;
  color: rgba(255,255,255,.22); font-size: 12px; pointer-events: none; user-select: none;
}

.curriculum { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-height: 78vh; overflow-y: auto; }
.curriculum .mod { border-bottom: 1px solid var(--line); }
.curriculum .mod > div { padding: 12px 14px; font-weight: 600; font-size: 14px; background: #FAFCFB; }
.curriculum a.lesson {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 14px; border-top: 1px solid #F0F4F2;
  color: #2A3B33; text-decoration: none; font-size: 14px;
}
.curriculum a.lesson:hover { background: var(--brand-soft); }
.curriculum a.lesson.current { background: var(--brand-soft); border-left: 3px solid var(--brand); }
.curriculum a.lesson .dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); margin-top: 3px; }
.curriculum a.lesson.done .dot { background: var(--ok); border-color: var(--ok); }

.progressbar { height: 7px; background: #E6EDE9; border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.progressbar span { display: block; height: 100%; background: var(--brand); }

.resource-list { list-style: none; padding: 0; margin: 0; }
.resource-list li { border: 1px solid var(--line); border-radius: 9px; padding: 10px 13px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.lesson-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, #08361F, #0B3E27); }
.auth-card { background: #fff; border-radius: 16px; padding: 30px; width: 100%; max-width: 410px; }
.auth-card h1 { font-size: 21px; }
.auth-card .muted { color: var(--muted); font-size: 14px; }

@media (max-width: 1000px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .side .group { width: 100%; padding-top: 10px; }
  .player-layout { grid-template-columns: 1fr; }
  .main { padding: 18px 16px 50px; }
}
