/* ============================================================
   Omran Semi International School — Presentation Skills Platform
   Premium UI · navy/gold identity · hand-drawn SVG icon system
   ============================================================ */
:root {
  --navy: #16357e;
  --navy-2: #0d2158;
  --navy-3: #27479c;
  --navy-soft: #e9eefb;
  --gold: #f5a623;
  --gold-2: #ffd166;
  --gold-deep: #c07f0a;
  --gold-soft: #fff7e6;
  --green: #0f9d6e;
  --green-soft: #e6f7f1;
  --red: #d64545;
  --red-soft: #fdecec;
  --amber: #b7791f;
  --bg: #eef2f9;
  --bg-2: #f7f9fd;
  --card: #ffffff;
  --text: #17203a;
  --muted: #66718f;
  --faint: #98a1bb;
  --line: #e2e7f3;
  --line-2: #d3daec;
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 2px 10px rgba(16, 32, 80, .06);
  --shadow: 0 10px 34px rgba(16, 32, 80, .10);
  --shadow-lg: 0 18px 50px rgba(16, 32, 80, .16);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1100px 420px at 100% -8%, #e4ebfb 0%, transparent 60%),
    radial-gradient(900px 380px at -5% 12%, #fdf1dd 0%, transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
img { max-width: 100%; }
a { color: var(--navy); }
button { font-family: var(--font); }
[hidden] { display: none !important; }
.ic { width: 22px; height: 22px; flex: none; display: block; }
.ic-sm { width: 15px; height: 15px; }
.ic-lg { width: 26px; height: 26px; }

/* ---------- mode banner ---------- */
.mode-banner {
  padding: 10px 16px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  background: linear-gradient(90deg, #fff6dd, #ffefd0);
  color: #7a5b00;
  border-bottom: 1px solid #f0df9e;
  position: sticky;
  top: 0;
  z-index: 60;
}
.mode-banner.setup {
  background: var(--navy-soft);
  color: var(--navy-2);
  border-bottom-color: #c9d4f2;
}
.mode-banner a { color: inherit; }
.mode-banner code {
  background: rgba(255, 255, 255, .7);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 12.5px;
}

/* ---------- header ---------- */
.site-header {
  background: linear-gradient(115deg, var(--navy-2) 0%, var(--navy) 55%, var(--navy-3) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-2) 45%, var(--gold) 100%);
  opacity: .9;
}
.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 15px 22px 17px;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}
.logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
  object-fit: contain;
  flex: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
}
.titles h1 {
  margin: 0;
  font-size: clamp(17px, 2.4vw, 23px);
  letter-spacing: .2px;
  line-height: 1.2;
  font-weight: 700;
}
.titles p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: #c6d2f4;
  letter-spacing: .2px;
}
.header-meta {
  margin-left: auto;
  display: flex;
  gap: 9px;
  align-items: center;
  flex-wrap: wrap;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .22);
  color: #fff;
  white-space: nowrap;
}
.pill-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  border: none;
  color: #452d00;
  box-shadow: 0 3px 12px rgba(245, 166, 35, .38);
}
.pill-ghost {
  background: transparent;
  cursor: pointer;
  text-decoration: none;
}
.pill-ghost:hover { background: rgba(255, 255, 255, .18); }

/* ---------- encouraging phrase ---------- */
.phrase-banner {
  max-width: 1240px;
  margin: 18px auto 0;
  padding: 13px 18px;
  width: calc(100% - 36px);
  display: flex;
  align-items: center;
  gap: 13px;
  background: linear-gradient(100deg, var(--gold-soft), #fffdf7 55%, var(--gold-soft));
  border: 1px solid #f3e0b2;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.phrase-ico {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #5a3c00;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: 0 4px 12px rgba(245, 166, 35, .35);
}
.phrase-ico .ic { width: 22px; height: 22px; }
.phrase-banner p {
  margin: 0;
  font-size: 14.8px;
  font-weight: 600;
  color: #6d4d05;
}

/* ---------- main menu (segmented) ---------- */
.main-menu {
  max-width: 1240px;
  margin: 18px auto 0;
  width: calc(100% - 36px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.menu-btn {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 16px;
  text-align: left;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #fbfcff);
  color: var(--navy);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.menu-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.menu-btn.active {
  background: linear-gradient(120deg, var(--navy-2), var(--navy) 70%, var(--navy-3));
  border-color: var(--navy-2);
  color: #fff;
  box-shadow: 0 12px 30px rgba(13, 33, 88, .32);
}
.mb-ico {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--navy-soft);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background .15s, color .15s;
}
.menu-btn.active .mb-ico {
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #452d00;
  box-shadow: 0 4px 14px rgba(245, 166, 35, .45);
}
.mb-text { display: flex; flex-direction: column; min-width: 0; }
.mb-text b { font-size: 14.8px; font-weight: 700; letter-spacing: .1px; }
.mb-text small { font-size: 11.8px; opacity: .72; font-weight: 500; margin-top: 1px; }

/* ---------- layout ---------- */
main {
  max-width: 1240px;
  margin: 18px auto 26px;
  width: calc(100% - 36px);
  flex: 1;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------- toolbar (controls) — .controls kept as alias for the teacher portal ---------- */
.toolbar, .controls {
  padding: 13px 15px;
  display: flex;
  gap: 13px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.ctl-hint {
  margin: 0 0 0 auto;
  font-size: 13px;
  color: var(--muted);
  max-width: 340px;
}
.ctl-hint .ic {
  display: inline-block;
  vertical-align: -3.5px;
  margin-right: 6px;
  color: var(--navy-3);
}
.ctl-hint strong { color: var(--navy); }

/* ---------- custom dropdown ---------- */
.dd { position: relative; }
.dd-btn {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 218px;
  padding: 9px 12px;
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 13px;
  cursor: pointer;
  transition: border-color .14s, box-shadow .14s;
  box-shadow: 0 1px 3px rgba(16, 32, 80, .05);
}
.dd-btn:hover { border-color: #b9c5e6; }
.dd-btn.open, .dd-btn:focus-visible {
  border-color: var(--navy);
  box-shadow: 0 0 0 3.5px rgba(22, 53, 126, .13);
  outline: none;
}
.dd-btn:disabled { opacity: .5; cursor: not-allowed; }
.dd-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--navy-soft);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.dd-ico .ic { width: 19px; height: 19px; }
.dd-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}
.dd-text small {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .9px;
  color: var(--faint);
}
.dd-text b {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 195px;
}
.dd-chev {
  color: var(--faint);
  display: flex;
  transition: transform .18s;
}
.dd-btn.open .dd-chev { transform: rotate(180deg); color: var(--navy); }
.dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 50;
  min-width: 290px;
  max-width: 340px;
  background: #fff;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: dd-in .14s ease;
}
@keyframes dd-in {
  from { opacity: 0; transform: translateY(-6px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.dd-items { max-height: 340px; overflow-y: auto; }
.dd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  background: none;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.dd-item:hover { background: var(--navy-soft); }
.dd-item.selected { background: linear-gradient(100deg, var(--navy-soft), #f2f5fd); color: var(--navy-2); }
.dd-item-ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f1f4fb;
  color: var(--navy-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.dd-item.selected .dd-item-ico { background: #fff; }
.dd-item-ico .ic { width: 16px; height: 16px; }
.dd-item-label { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-item-note {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--faint);
  background: #f1f4fb;
  padding: 2.5px 7px;
  border-radius: 999px;
  white-space: nowrap;
}
.dd-item.selected .dd-item-note { background: #fff; color: var(--navy); }
.dd-item-check { color: var(--navy); display: none; }
.dd-item.selected .dd-item-check { display: flex; }
.dd select {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  padding: 0;
  border: none;
  left: 0;
  top: 0;
}

/* ---------- leaderboard card ---------- */
.lb-card { overflow: hidden; }
.lb-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(420px 90px at 8% -30%, rgba(22, 53, 126, .07), transparent),
    linear-gradient(180deg, #fbfcff, #fff);
  flex-wrap: wrap;
}
.lb-title { display: flex; align-items: center; gap: 13px; }
.lb-title-ico {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  color: var(--gold-2);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(22, 53, 126, .32);
}
.lb-title h2 { margin: 0; font-size: 18.5px; letter-spacing: .1px; }
.lb-title p { margin: 2px 0 0; font-size: 12.8px; color: var(--muted); font-weight: 600; }
.lb-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #f2f5fc;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.mini-badge b { color: var(--navy); font-weight: 800; }
.mini-badge .ic { color: var(--navy-3); }
.mini-badge.live { color: var(--green); background: var(--green-soft); border-color: #c9ecdf; font-weight: 700; }
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(15, 157, 110, .5);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 157, 110, .45); }
  70% { box-shadow: 0 0 0 7px rgba(15, 157, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 157, 110, 0); }
}

/* ---------- podium ---------- */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(8px, 3vw, 26px);
  padding: 26px 18px 6px;
  background:
    radial-gradient(500px 150px at 50% 0%, rgba(245, 166, 35, .12), transparent 70%),
    linear-gradient(180deg, #fdfeff, #fff);
  border-bottom: 1px dashed var(--line-2);
}
.pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: min(215px, 30%);
  padding: 14px 12px 15px;
  border-radius: 16px;
  background: #fff;
  border: 1.5px solid var(--line);
  box-shadow: var(--shadow-sm);
  position: relative;
  text-align: center;
  transition: transform .18s ease;
}
.pod:hover { transform: translateY(-4px); }
.pod .pod-place {
  position: absolute;
  top: -17px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  border: 3px solid #fff;
  box-shadow: 0 5px 14px rgba(16, 32, 80, .25);
}
.pod .pod-crown { color: var(--gold-deep); }
.pod .pod-name { font-weight: 800; font-size: 14.8px; color: var(--text); line-height: 1.25; margin-top: 6px; }
.pod .pod-class { margin: 0; }
.pod .pod-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: .3px;
}
.pod .pod-value small { font-size: 11px; color: var(--muted); font-weight: 700; margin-left: 2px; }
.pod .pod-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .7px; color: var(--faint); font-weight: 800; }
.pod.p-1 {
  border-color: #f0d9a4;
  background: linear-gradient(180deg, #fffdf5, #fff);
  box-shadow: 0 14px 34px rgba(245, 166, 35, .22);
  padding-top: 18px;
  padding-bottom: 18px;
}
.pod.p-1 .pod-place { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #4a3000; width: 38px; height: 38px; top: -19px; }
.pod.p-1 .pod-name { font-size: 16px; }
.pod.p-1 .pod-value { font-size: 23px; }
.pod.p-2 .pod-place { background: linear-gradient(135deg, #9aa7c2, #c7d0e2); }
.pod.p-3 .pod-place { background: linear-gradient(135deg, #c9854b, #e5b083); }

/* ---------- leaderboard table ---------- */
.table-wrap { overflow-x: auto; }
.leaderboard th, .leaderboard td {
  padding: 10px 10px;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid #edf0f8;
  white-space: nowrap;
}
.leaderboard thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f6f8fd;
  font-size: 10.8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--navy);
  border-bottom: 2px solid var(--navy-soft);
  padding-top: 12px;
  padding-bottom: 12px;
}
.leaderboard th.th-student, .leaderboard td.lb-name { text-align: left; }
.leaderboard th.th-class { text-align: center; }
.sortable { cursor: pointer; user-select: none; transition: background .12s, color .12s; }
.sortable:hover { background: #e9eefb; color: var(--navy-2); }
.sortable.sorted { background: var(--navy-soft); color: var(--navy-2); box-shadow: inset 0 -2px 0 var(--navy); }
.th-sub { display: block; font-size: 9.3px; color: var(--faint); font-weight: 700; letter-spacing: .4px; }
.th-total { background: #eef2ff !important; color: var(--navy-2) !important; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  background: #f1f4fb;
  color: var(--muted);
}
.rb-1 { background: linear-gradient(135deg, var(--gold), var(--gold-2)); color: #4a3000; box-shadow: 0 3px 10px rgba(245, 166, 35, .4); }
.rb-2 { background: linear-gradient(135deg, #8fa0bf, #c3cde1); color: #26304a; }
.rb-3 { background: linear-gradient(135deg, #c9854b, #e8b689); color: #4a2c12; }

.lb-name { font-weight: 700; color: var(--text); }
.lb-name .no { color: var(--faint); font-weight: 700; font-size: 11.5px; margin-right: 8px; min-width: 16px; display: inline-block; text-align: right; }
.class-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.3px;
  font-weight: 700;
  background: var(--navy-soft);
  color: var(--navy);
  border: 1px solid #d6dff7;
}
.class-chip .ic { width: 12px; height: 12px; }

.metric-cell { color: #35405c; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-cell.empty { color: #ccd3e6; font-weight: 500; }
.metric-cell.heat-hi { background: #e8f7f0; color: #0b7a55; }
.metric-cell.heat-mid { background: #eef3fd; color: #2c4d9e; }
.metric-cell.heat-lo { background: #fff3e4; color: #a05f0e; }
.metric-cell.heat-vlo { background: #fdeeee; color: #b03a3a; }

.lb-total { padding: 8px !important; }
.total-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 5px 11px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 3px 10px rgba(22, 53, 126, .28);
}
.total-chip small { font-size: 9.5px; font-weight: 700; opacity: .75; }
.total-chip.muted-chip { background: #eef1f8; color: var(--faint); box-shadow: none; }

tr.row-top td { background: #fffaee; }
tr.row-top-2 td { background: #f8fafd; }
tr.row-top-3 td { background: #fdf6f0; }
tr:hover td { background: #f2f6ff; }
tr.row-top:hover td { background: #fff5dd; }
tbody tr:last-child td { border-bottom: none; }

.loading-cell { padding: 36px !important; color: var(--muted); font-weight: 600; }
.empty {
  padding: 30px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.65;
}
.empty strong { color: var(--navy); }

.lb-legend {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  background: #fbfcfe;
  font-size: 11.6px;
  color: var(--muted);
  font-weight: 600;
}
.lg-item { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.lg-dot.hi { background: #bfe9d8; border: 1px solid #7fd4b5; }
.lg-dot.mid { background: #cddaf7; border: 1px solid #9db4ec; }
.lg-dot.lo { background: #ffe1bd; border: 1px solid #f5bc7a; }
.lg-sep { width: 1px; height: 16px; background: var(--line-2); }
.lg-note { color: var(--faint); font-weight: 500; }

.foot-note {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
  margin: 14px auto 0;
}
.foot-note strong { color: var(--navy); }

/* ---------- PME ---------- */
.pme-key {
  display: flex;
  gap: 15px;
  align-items: center;
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}
.key-item { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-focus { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.dot-strong { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.dot-class { background: var(--navy-3); box-shadow: 0 0 0 3px var(--navy-soft); }

.intro-card {
  display: flex;
  align-items: center;
  gap: 20px;
  text-align: left;
  padding: 26px;
}
.intro-ico {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--navy), var(--navy-3));
  color: var(--gold-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: 0 10px 26px rgba(22, 53, 126, .3);
}
.intro-ico .ic { width: 32px; height: 32px; }
.intro-card h3 { margin: 0 0 6px; font-size: 18px; color: var(--navy-2); }
.intro-card p { margin: 0; font-size: 14.5px; color: var(--muted); max-width: 780px; }

.pme-hero {
  border-left: 5px solid var(--gold);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 18px;
}
.pme-id { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--navy), #3d63c9);
  color: #fff;
  font-size: 25px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: 0 10px 24px rgba(22, 53, 126, .32);
}
.pme-name { flex: 1; min-width: 200px; }
.pme-name h2 { margin: 0; font-size: 21.5px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pme-name .sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.trend-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
}
.trend-up { background: var(--green-soft); color: var(--green); border: 1px solid #bfe9d8; }
.trend-down { background: var(--red-soft); color: var(--red); border: 1px solid #f5c6c6; }
.trend-flat { background: #f1f4fb; color: var(--muted); border: 1px solid var(--line); }

.gauge-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #f6f8ff, #fff);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.gauge { width: 118px; height: 118px; flex: none; position: relative; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .g-track { fill: none; stroke: #e7ebf6; stroke-width: 11; }
.gauge .g-val { fill: none; stroke: url(#gaugeGrad); stroke-width: 11; stroke-linecap: round; transition: stroke-dashoffset .9s cubic-bezier(.4, 0, .2, 1); }
.gauge .g-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.gauge .g-num { font-size: 21px; font-weight: 800; color: var(--navy-2); line-height: 1.05; font-variant-numeric: tabular-nums; }
.gauge .g-num small { font-size: 11px; color: var(--muted); font-weight: 700; }
.gauge .g-cap { font-size: 9.3px; font-weight: 800; text-transform: uppercase; letter-spacing: .7px; color: var(--faint); margin-top: 2px; }
.gauge-meta b { display: block; font-size: 15.5px; color: var(--navy-2); }
.gauge-meta span { font-size: 12.8px; color: var(--muted); }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 11px;
}
.stat {
  background: #f8faff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat .stat-ico {
  width: 30px;
  height: 30px;
  margin: 0 auto;
  border-radius: 9px;
  background: #fff;
  color: var(--navy-3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.stat .stat-ico .ic { width: 16px; height: 16px; }
.stat b { display: block; font-size: 19.5px; color: var(--navy); font-variant-numeric: tabular-nums; }
.stat b small { font-size: 11.5px; color: var(--faint); font-weight: 700; }
.stat span.lbl { font-size: 10.3px; color: var(--muted); font-weight: 800; text-transform: uppercase; letter-spacing: .6px; }

.plan {
  background: linear-gradient(120deg, #fff9ec, #fffdf7);
  border: 1.5px solid #f3e0b2;
  border-radius: 15px;
  padding: 16px 18px;
}
.plan-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.plan-head .plan-ico {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-2));
  color: #4a3000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-head .plan-ico .ic { width: 18px; height: 18px; }
.plan-head h3 { margin: 0; font-size: 15.5px; color: #7a5300; }
.plan-head p { margin: 1px 0 0; font-size: 12px; color: #a3803d; font-weight: 600; }
.plan-steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.plan-steps li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: start;
  background: #fff;
  border: 1px solid #f3e6c8;
  border-radius: 11px;
  padding: 10px 12px;
}
.plan-num {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.plan-body b { font-size: 13.8px; color: var(--navy-2); }
.plan-body .gap { font-size: 11.5px; font-weight: 800; color: var(--amber); margin-left: 7px; }
.plan-body p { margin: 3px 0 0; font-size: 12.8px; color: var(--muted); line-height: 1.45; }
.plan-score { font-size: 15px; font-weight: 800; color: var(--navy); white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-score small { font-size: 10.5px; color: var(--faint); }

.remark {
  background: #f6f8ff;
  border: 1px solid var(--line-2);
  border-left: 4px solid var(--navy-3);
  border-radius: 13px;
  padding: 14px 16px;
  font-size: 14.3px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.remark .rem-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #fff;
  color: var(--navy-3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  box-shadow: var(--shadow-sm);
}
.remark .rem-ico .ic { width: 17px; height: 17px; }
.remark b { color: var(--navy-2); }
.remark .muted { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 2px 13px;
}
.section-head h2 { margin: 0; font-size: 17.5px; color: var(--navy-2); }
.section-head p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 15px;
}
.metric-card {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 17px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  transition: transform .15s ease, box-shadow .15s ease;
}
.metric-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.metric-card.focus { border-color: var(--gold); box-shadow: 0 0 0 3.5px var(--gold-soft), var(--shadow-sm); }
.metric-card.strong { border-color: #7fd4b5; }
.mc-top { display: flex; align-items: center; gap: 11px; }
.mc-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--navy-soft);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.metric-card.focus .mc-ico { background: var(--gold-soft); color: var(--gold-deep); }
.metric-card.strong .mc-ico { background: var(--green-soft); color: var(--green); }
.mc-title { font-size: 15.3px; font-weight: 800; color: var(--navy-2); flex: 1; min-width: 0; }
.mc-score { font-size: 21px; font-weight: 800; color: var(--navy-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mc-score small { font-size: 11px; color: var(--muted); font-weight: 700; }
.mc-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
  font-size: 10.3px;
  font-weight: 800;
  padding: 3.5px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .45px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge .ic { width: 11px; height: 11px; }
.badge-focus { background: var(--gold-soft); color: #96690a; border: 1px solid #f0d9a4; }
.badge-strong { background: var(--green-soft); color: #0b7a55; border: 1px solid #bfe9d8; }
.badge-none { background: #f1f4fb; color: var(--muted); border: 1px solid var(--line); }
.badge-vs { background: #eef2ff; color: #33509e; border: 1px solid #d3ddf7; }
.badge-vs.down { background: #fff3e4; color: #a05f0e; border-color: #f5d6a8; }
.badge-trend { background: #f1f4fb; color: var(--muted); border: 1px solid var(--line); }

.mc-bar { height: 10px; background: #edf0f8; border-radius: 999px; overflow: visible; position: relative; }
.mc-bar i.bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--navy), #4b74e0 65%, var(--gold));
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
  position: relative;
  z-index: 1;
}
.mc-bar .class-mark {
  position: absolute;
  top: -3px;
  width: 3px;
  height: 16px;
  border-radius: 3px;
  background: var(--navy-3);
  z-index: 2;
  box-shadow: 0 0 0 1.5px #fff;
}
.mc-bar .class-mark::after {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  border: 3.5px solid transparent;
  border-top-color: var(--navy-3);
}
.mc-level { font-size: 12.3px; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.mc-level .latest { color: var(--faint); font-weight: 600; }
.mc-desc { font-size: 13.4px; color: #45506b; margin: 0; line-height: 1.5; }
.mc-tipintro {
  font-size: 12.8px;
  font-weight: 700;
  color: var(--navy);
  background: #f2f5fd;
  border: 1px dashed #ccd7f4;
  border-radius: 9px;
  padding: 8px 11px;
  margin: 0;
}
.mc-tipintro.hot { background: var(--gold-soft); border-color: #f0d9a4; color: #8a6100; }
.mc-tipintro.cool { background: var(--green-soft); border-color: #bfe9d8; color: #0b7a55; }
.mc-tips { margin: 0; padding: 11px 13px 11px 15px; background: #f8faff; border-radius: 11px; border: 1px solid #e8edfa; }
.mc-tips .tips-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.3px;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--navy);
  font-weight: 800;
}
.mc-tips .tips-head .ic { width: 14px; height: 14px; color: var(--gold-deep); }
.mc-tips ol { margin: 8px 0 0; padding-left: 20px; }
.mc-tips li { font-size: 13.2px; color: #3d4761; margin: 6px 0; line-height: 1.5; }
.mc-tips li::marker { color: var(--navy-3); font-weight: 800; }

/* ---------- contact ---------- */
.contact-card {
  max-width: 620px;
  margin: 6px auto 0;
  padding: 36px 28px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.contact-deco {
  position: absolute;
  top: -16px;
  right: -30px;
  width: 250px;
  opacity: .12;
  transform: rotate(-4deg);
  pointer-events: none;
}
.contact-avatar {
  width: 80px;
  height: 80px;
  margin: 0 auto 13px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--navy), #3d63c9);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 28px rgba(22, 53, 126, .35);
}
img.contact-avatar.contact-photo {
  width: 104px;
  height: 104px;
  display: block;
  object-fit: cover;
  object-position: center 28%;
  border-radius: 50%;
  background: #fff;
  padding: 0;
  border: 3px solid #fff;
  box-shadow: 0 14px 32px rgba(22, 53, 126, .38), 0 0 0 3.5px rgba(22, 53, 126, .16);
}
.contact-card h2 { margin: 0; font-size: 24px; }
.contact-role { margin: 5px 0 22px; color: var(--muted); font-size: 14.3px; }
.contact-actions { display: flex; flex-direction: column; gap: 12px; max-width: 400px; margin: 0 auto; }
.contact-actions .btn { padding: 14px 17px; gap: 13px; justify-content: flex-start; }
.contact-actions .btn > span:nth-child(2) { display: flex; flex-direction: column; align-items: flex-start; flex: 1; }
.contact-actions .btn small { font-weight: 600; opacity: .85; font-size: 12.6px; }
.contact-actions .btn strong { font-size: 15px; }
.btn-ico {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: rgba(255, 255, 255, .18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.btn-ico .ic { width: 22px; height: 22px; }
.btn-arrow { opacity: .7; display: flex; margin-left: auto; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 18px;
  font-size: 14.5px;
  font-weight: 700;
  border-radius: 14px;
  border: 1.5px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform .13s, filter .13s, box-shadow .13s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.btn:active { transform: translateY(0); }
.btn-whatsapp { background: linear-gradient(135deg, #1fb954, #12a348); color: #fff; box-shadow: 0 8px 20px rgba(31, 185, 84, .32); }
.btn-email { background: linear-gradient(120deg, var(--navy-2), var(--navy)); color: #fff; box-shadow: 0 8px 20px rgba(22, 53, 126, .3); }
.btn-call { background: var(--gold-soft); color: #7a5300; border-color: #f0d9a4; }
.btn-call .btn-ico { background: rgba(245, 166, 35, .2); }
.contact-note {
  margin: 22px auto 0;
  font-size: 13.3px;
  color: var(--muted);
  background: #f7f9ff;
  border: 1px dashed #d9e1f7;
  border-radius: 12px;
  padding: 12px 15px;
  max-width: 450px;
  line-height: 1.55;
}

/* ---------- footer ---------- */
.site-footer {
  margin-top: auto;
  background: var(--navy-2);
  color: #c6d2f4;
  text-align: center;
  padding: 20px 16px 24px;
  font-size: 13.3px;
  border-top: 3px solid var(--gold);
}
.site-footer p { margin: 5px 0 0; }
.site-footer .muted { color: #8fa1d6; font-size: 11.8px; }
.footer-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  padding: 2px;
  object-fit: contain;
}

/* ---------- login (teacher) ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 400px at 15% -10%, #dfe7fb, transparent),
    radial-gradient(800px 420px at 110% 110%, #ffeed1, transparent),
    var(--bg);
}
.login-card { width: 100%; max-width: 420px; padding: 32px 30px 24px; text-align: center; }
.login-logo { width: 74px; height: 74px; margin-bottom: 8px; }
.login-card h1 { margin: 0; font-size: 25px; color: var(--navy-2); }
.login-sub { margin: 4px 0 20px; color: var(--muted); font-size: 14px; }
.fld { display: flex; flex-direction: column; gap: 5px; text-align: left; margin-bottom: 13px; }
.fld > span {
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
}
.fld input { width: 100%; }
.form-error {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid #f5c6c6;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13px;
  margin: 0 0 12px;
}
.login-hint {
  font-size: 12px;
  color: var(--muted);
  background: #f7f9ff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 11px;
  margin: 12px 0 0;
  text-align: left;
  line-height: 1.55;
}
.login-back { display: inline-block; margin-top: 14px; font-size: 13.5px; font-weight: 700; }
.link-btn {
  background: none;
  border: none;
  color: var(--navy);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
  padding: 9px 0;
  text-decoration: underline;
}

/* ---------- inputs & buttons ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
  font-family: var(--font);
  font-size: 14.5px;
  padding: 9px 11px;
  border: 1.5px solid var(--line-2);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: border-color .13s, box-shadow .13s;
}
input:focus, textarea:focus, select:focus { border-color: var(--navy); box-shadow: 0 0 0 3.5px rgba(22, 53, 126, .12); }
textarea { width: 100%; resize: vertical; line-height: 1.55; }
select { cursor: pointer; min-width: 190px; }
.btn-primary {
  background: linear-gradient(120deg, var(--navy-2), var(--navy));
  color: #fff;
  box-shadow: 0 5px 16px rgba(22, 53, 126, .3);
}
.btn-primary:hover { box-shadow: 0 8px 22px rgba(22, 53, 126, .4); }
.btn-danger-ghost { background: #fff; color: var(--red); border-color: #f2c4c4; }
.btn-danger-ghost:hover { background: var(--red-soft); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.inline-input { min-width: 230px; }

/* ---------- setup card (teacher) ---------- */
.setup-card {
  max-width: 1240px;
  width: calc(100% - 36px);
  margin: 18px auto 0;
  padding: 20px 24px;
  border-left: 5px solid var(--navy);
}
.setup-card h2 { margin: 0 0 8px; font-size: 18px; }
.setup-card ol { margin: 0 0 14px; padding-left: 20px; }
.setup-card li { margin: 6px 0; font-size: 14.5px; }
.setup-card code { background: var(--navy-soft); padding: 2px 6px; border-radius: 6px; font-size: 13px; }

/* ---------- score entry (teacher) ---------- */
.score-table td { padding: 6px 5px; }
.score-table th, .score-table td { border-bottom: 1px solid #edf0f8; text-align: center; font-size: 14px; white-space: nowrap; }
.score-table thead th {
  background: #f6f8fd;
  font-size: 10.8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .6px;
  color: var(--navy);
  border-bottom: 2px solid var(--navy-soft);
  padding: 12px 8px;
}
.score-table th.th-student { text-align: left; }
.score-table .st-name { text-align: left; font-weight: 700; }
.score-table .st-name .no { color: var(--faint); font-size: 11.5px; margin-right: 7px; }
.score-table input[type="number"] {
  width: 64px;
  padding: 7px 4px;
  text-align: center;
  font-weight: 700;
  border-radius: 9px;
}
.score-table input.invalid { border-color: var(--red); background: var(--red-soft); }
.score-table input.dirty { background: var(--gold-soft); border-color: var(--gold); }
.score-table .row-total { font-weight: 800; background: #f4f7ff; }
.score-table .row-total.low { color: var(--red); }

/* ---------- evaluations / students (teacher) ---------- */
.eval-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 15px; }
.eval-write, .eval-history { padding: 19px; }
.eval-grid h3 { margin: 0 0 11px; font-size: 16px; color: var(--navy-2); }
.eval-actions { display: flex; gap: 12px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.small { font-size: 12.5px; }
.muted { color: var(--muted); }
.eval-list { display: flex; flex-direction: column; gap: 10px; max-height: 420px; overflow-y: auto; }
.eval-item {
  background: #f7f9ff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--navy-3);
  border-radius: 11px;
  padding: 11px 13px;
  font-size: 13.8px;
}
.eval-item b { font-size: 11.8px; color: var(--navy); text-transform: uppercase; letter-spacing: .4px; }
.eval-item p { margin: 5px 0 0; white-space: pre-wrap; line-height: 1.5; }

.student-table th, .student-table td { padding: 10px 13px; border-bottom: 1px solid #edf0f8; text-align: left; font-size: 14.5px; }
.student-table th {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  letter-spacing: .6px;
  background: #f6f8fd;
}
.right { text-align: right !important; }
.danger-link {
  background: none;
  border: none;
  color: var(--red);
  font-weight: 700;
  cursor: pointer;
  font-size: 13.5px;
}
.danger-link:hover { text-decoration: underline; }
.ctl-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ctl { display: flex; flex-direction: column; gap: 5px; min-width: 200px; }
.ctl > span {
  font-size: 11.3px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--muted);
}
.toolbar .ctl select { width: 100%; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  background: var(--navy-2);
  color: #fff;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 700;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .3);
  z-index: 100;
  animation: toast-in .25s ease;
}
.toast.err { background: var(--red); }
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- responsive ---------- */
@media (max-width: 1020px) {
  .ctl-hint { order: 5; max-width: none; width: 100%; margin-left: 0; }
  .pme-key { order: 6; margin-left: 0; width: 100%; }
}
@media (max-width: 860px) {
  .main-menu { grid-template-columns: 1fr; }
  .eval-grid { grid-template-columns: 1fr; }
  .header-meta { margin-left: 0; width: 100%; }
  .dd-btn { min-width: 0; width: 100%; }
  .dd { flex: 1 1 240px; }
  .podium { flex-wrap: wrap; }
  .pod { width: min(215px, 46%); }
  .intro-card { flex-direction: column; text-align: center; align-items: center; }
  .intro-card p { text-align: center; }
  .pme-id { justify-content: center; text-align: center; }
  .pme-name h2 { justify-content: center; }
}
@media (max-width: 560px) {
  .toolbar { gap: 10px; }
  .dd { flex: 1 1 100%; }
  .phrase-banner p { font-size: 13.5px; }
  .metric-grid { grid-template-columns: 1fr; }
  .pod { width: 100%; }
  .podium { gap: 22px; padding-top: 30px; }
  .profile-stats { grid-template-columns: repeat(2, 1fr); }
  .lb-card-head { padding: 14px; }
}
