/* ==========================================================================
   Portal Studenți Master - Minimalism discret
   Accent unic, simetrie, multa respiratie.
   ========================================================================== */

:root {
  --bg:          #0A1214;
  --bg-2:        #0E181B;
  --surface:     #121F22;
  --surface-hi:  #17272B;
  --border:      rgba(255, 255, 255, 0.08);
  --border-hi:   rgba(255, 255, 255, 0.14);
  --fg:          #E6ECEC;
  --muted:       #A2B2B4;
  --muted-2:     #8898A0;
  --accent:      #7BB5AD;
  --accent-hi:   #9ACEC6;
  --danger:      #E07A82;
  --focus:       #9ACEC6;

  --radius:      12px;
  --radius-lg:   16px;

  --ease:        cubic-bezier(0.22, 1, 0.36, 1);

  --f-sans:      'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono:      'JetBrains Mono', ui-monospace, 'Courier New', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
/* Rezerva mereu loc pentru scrollbar: evita shift-ul la navigare intre pagini cu/fara scroll */
html { scrollbar-gutter: stable; overflow-y: scroll; }

/* Scrollbar discret global — Firefox + WebKit */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(123,181,173,.18) transparent;
}
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(123,181,173,.12);
  border-radius: 10px;
  transition: background .2s;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(123,181,173,.28); }
*::-webkit-scrollbar-corner { background: transparent; }
/* In interiorul cardurilor si modalelor — si mai subtil */
.m-thread::-webkit-scrollbar,
.stud-thread::-webkit-scrollbar,
.sm-files-list::-webkit-scrollbar,
.notif-list::-webkit-scrollbar,
.c-select-menu::-webkit-scrollbar,
.files-table-wrap::-webkit-scrollbar { width: 3px; }
.m-thread::-webkit-scrollbar-thumb,
.stud-thread::-webkit-scrollbar-thumb,
.sm-files-list::-webkit-scrollbar-thumb,
.notif-list::-webkit-scrollbar-thumb,
.c-select-menu::-webkit-scrollbar-thumb,
.files-table-wrap::-webkit-scrollbar-thumb { background: rgba(123,181,173,.1); }
.m-thread::-webkit-scrollbar-thumb:hover,
.stud-thread::-webkit-scrollbar-thumb:hover,
.sm-files-list::-webkit-scrollbar-thumb:hover,
.notif-list::-webkit-scrollbar-thumb:hover,
.c-select-menu::-webkit-scrollbar-thumb:hover,
.files-table-wrap::-webkit-scrollbar-thumb:hover { background: rgba(123,181,173,.25); }

/* Landing si login: fara scroll, continutul se incadreaza in viewport. */
body.page-landing, body.page-login, body.page-loading {
  height: 100vh;
  overflow: hidden;
}
/* Login: fundal mare cu imaginea de landing */
body.page-login {
  background-image: url('../assets/landing.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
body.page-login::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background: linear-gradient(135deg, rgba(10,18,20,.55) 0%, rgba(10,18,20,.78) 100%);
  pointer-events: none;
}
body.page-login > * { position: relative; z-index: 1; }

/* ============================================================
   Lessons V5 — dashboard cu paletă pastel inspirată din lectii_mate_v5.tex
   ============================================================ */
.lessons-main {
  --ds-lec1: #B388EB;
  --ds-lec2: #F4A261;
  --ds-lec3: #4DA6A0;
  --ds-lec4: #E76F51;

  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 28px 60px;
  display: flex; flex-direction: column;
  gap: 26px;
}

.lc-hero { animation: lcFadeUp .55s var(--ease) both; }
.lc-hero h1 { margin: 0; }
.lc-lede {
  margin: 8px 0 0;
  font-size: .94rem;
  color: var(--muted);
  max-width: 60ch;
  line-height: 1.55;
}

/* ── Banner organizare ── */
.lc-organize {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(123, 181, 173, .10), rgba(123, 181, 173, .03));
  border: 1px solid rgba(123, 181, 173, .26);
  border-radius: 14px;
  align-items: start;
  animation: lcFadeUp .55s var(--ease) 80ms both;
}
.lc-organize-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: rgba(123, 181, 173, .16);
  color: var(--accent-hi);
  display: grid; place-items: center;
}
.lc-organize-body h3 {
  margin: 1px 0 5px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent-hi);
  text-transform: uppercase;
}
.lc-organize-body p {
  margin: 0;
  font-size: .92rem;
  line-height: 1.7;
  color: var(--muted);
}
.lc-organize-body p + p { margin-top: 6px; }
.lc-organize-body b { color: var(--fg); font-weight: 600; }
.lc-organize-foot { font-size: .82rem !important; color: var(--muted-2) !important; font-style: italic; }
.lc-peer-chip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 3px 10px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--fg);
  background: rgba(123, 181, 173, .14);
  border: 1px solid rgba(123, 181, 173, .30);
  border-radius: 999px;
  letter-spacing: .01em;
  transition: transform .2s var(--ease), background .2s, border-color .2s;
}
.lc-peer-chip:hover {
  transform: translateY(-1px);
  background: rgba(123, 181, 173, .22);
  border-color: rgba(123, 181, 173, .50);
}

/* ── Section heading cu filet gradient ── */
.lc-section { animation: lcFadeUp .55s var(--ease) 120ms both; }
.lc-section-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  position: relative;
  padding-bottom: 10px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.lc-section-head::after {
  content: '';
  position: absolute;
  left: 0; bottom: -1px;
  width: 88px; height: 1px;
  background: linear-gradient(90deg, var(--accent-hi), transparent);
}
.lc-section-head h2 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -.005em;
}
.lc-section-meta {
  font-size: .76rem;
  color: var(--muted-2);
  font-style: italic;
}

/* ── Lesson cards (stack vertical, full-width în container) ── */
.lc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.lc-card {
  --lc-color: var(--accent-hi);
  position: relative;
  padding: 16px 22px 16px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  isolation: isolate;
  overflow: hidden;
  min-height: 110px;
  opacity: 0;
  transform: translateY(10px);
  animation: lcCardIn .55s var(--ease) var(--lc-delay, 0ms) forwards;
  transition: transform .35s var(--ease), border-color .25s, box-shadow .35s;
}
.lc-card--lec1 { --lc-color: var(--ds-lec1); }
.lc-card--lec2 { --lc-color: var(--ds-lec2); }
.lc-card--lec3 { --lc-color: var(--ds-lec3); }
.lc-card--lec4 { --lc-color: var(--ds-lec4); }

/* Bara colorată — flush la muchia stângă, în interior, full-height (clipped la rounded corners) */
.lc-card-bar {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 4px;
  background: var(--lc-color);
  pointer-events: none;
  z-index: 1;
}

/* Pată radială gauss-blur — clipped la card prin border-radius pe background. */
.lc-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(160px 140px at 92% 14%, color-mix(in srgb, var(--lc-color) 28%, transparent), transparent 65%),
    radial-gradient(240px 90px at 0% 100%, color-mix(in srgb, var(--lc-color) 10%, transparent), transparent 70%);
  pointer-events: none;
  z-index: -1;
  opacity: .55;
  transition: opacity .35s var(--ease);
}
.lc-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--lc-color) 60%, var(--border));
  box-shadow: 0 16px 36px -18px color-mix(in srgb, var(--lc-color) 60%, transparent);
}
.lc-card:hover::after { opacity: 1; }

/* Literă mare P/M (10% mai mică) */
.lc-card-bigletter {
  position: absolute;
  top: 4px; right: 14px;
  font-family: var(--f-sans);
  font-weight: 800;
  font-size: 86px;
  line-height: 1;
  color: var(--lc-color);
  opacity: .14;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  letter-spacing: -.04em;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.lc-card:hover .lc-card-bigletter {
  opacity: .26;
  transform: scale(1.05) rotate(-2deg);
}
.lc-card.is-empty .lc-card-bigletter { opacity: .07; }

.lc-card-head {
  position: relative; z-index: 1;
  display: flex; align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.lc-num {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--lc-color);
  color: #0E181B;
  font-weight: 800;
  font-size: .92rem;
  display: grid; place-items: center;
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--lc-color) 90%, transparent);
  flex: 0 0 auto;
}
.lc-tag {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-2);
}
.lc-tag-pred,
.lc-tag-mix,
.lc-tag-proba {
  color: var(--lc-color);
  border-color: color-mix(in srgb, var(--lc-color) 55%, var(--border));
  background: color-mix(in srgb, var(--lc-color) 10%, var(--bg-2));
}
.lc-tag-class {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--lc-color) 35%, var(--border));
  background: color-mix(in srgb, var(--lc-color) 6%, var(--bg-2));
}
.lc-tag-fac {
  display: inline-flex; align-items: center; gap: 5px;
  color: #FFD27A;
  border-color: rgba(255, 196, 89, .4);
  background: linear-gradient(135deg, rgba(255, 196, 89, .14), rgba(255, 196, 89, .04));
  text-transform: none;
  letter-spacing: .04em;
  font-weight: 600;
}
.lc-tag-fac svg { color: #FFD27A; }

.lc-card-title {
  position: relative; z-index: 1;
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--fg);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.lc-card.is-empty .lc-card-title {
  color: var(--muted-2);
  font-style: italic;
  font-weight: 500;
}

.lc-card-meta {
  position: relative; z-index: 1;
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  color: var(--muted-2);
}
.lc-card-meta svg { color: var(--lc-color); opacity: .9; flex: 0 0 auto; }

.lc-foot-hint {
  margin: 14px 2px 0;
  font-size: .76rem;
  color: var(--muted-2);
  font-style: italic;
}
.lc-foot-hint a { color: var(--accent-hi); }
.lc-foot-hint a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── Project type cards (4) ── */
.lc-proj-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.lc-proj {
  --lc-color: var(--accent-hi);
  position: relative;
  padding: 14px 16px 14px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: start;
  gap: 12px 14px;
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  animation: lcCardIn .5s var(--ease) var(--lc-delay, 0ms) forwards;
  transition: transform .25s var(--ease), border-color .25s, box-shadow .3s;
}
/* Bara colorată — flush la muchia stângă, identică cu cele de la lecții */
.lc-proj::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--lc-color);
}
.lc-proj:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--lc-color) 50%, var(--border));
  box-shadow: 0 10px 26px -16px color-mix(in srgb, var(--lc-color) 55%, transparent);
}
.lc-proj-icon {
  grid-column: 1; grid-row: 1 / span 2;
  width: 40px; height: 40px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--lc-color) 16%, var(--bg-2));
  color: var(--lc-color);
  align-self: start;
}
.lc-proj h3 {
  grid-column: 2;
  margin: 4px 0 4px;
  font-size: .96rem;
  font-weight: 600;
  color: var(--fg);
}
.lc-proj p {
  grid-column: 2;
  margin: 0;
  font-size: .82rem;
  line-height: 1.55;
  color: var(--muted);
}
.lc-proj p b { color: var(--fg); font-weight: 600; }

/* ── Criteria grid (12) ── */
.lc-crit-grid {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 28px;
}
.lc-crit {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 12px;
  padding: 11px 6px 11px 4px;
  font-size: .9rem;
  color: var(--fg);
  border-bottom: 1px dashed var(--border);
  opacity: 0;
  transform: translateX(-8px);
  animation: lcCritIn .5s var(--ease) var(--lc-delay, 0ms) forwards;
  transition: color .2s, background .2s;
}
.lc-crit:hover {
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 8%, transparent), transparent);
}
.lc-crit:hover .lc-crit-icon { color: var(--accent-hi); transform: scale(1.08); }
.lc-crit-icon {
  width: 28px; height: 28px;
  border-radius: 7px;
  display: grid; place-items: center;
  background: rgba(123, 181, 173, .10);
  color: var(--accent);
  transition: color .2s var(--ease), transform .25s var(--ease), background .2s;
}
.lc-crit-txt { line-height: 1.4; }

/* ── Animații ── */
@keyframes lcCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes lcCritIn {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes lcFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .lc-card, .lc-proj, .lc-crit, .lc-organize, .lc-section, .lc-hero {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .lc-card:hover, .lc-proj:hover { transform: none; }
}

/* Previne orice scroll orizontal cauzat de bara care iese în afara cardului */
body.page-lessons { overflow-x: clip; }

/* ── Responsive ── */
@media (max-width: 820px) {
  .lessons-main { padding: 22px 18px 50px; gap: 22px; }
  .lc-card-bigletter { font-size: 72px; }
}
@media (max-width: 640px) {
  .lc-proj-grid, .lc-crit-grid { grid-template-columns: 1fr; gap: 10px; }
  .lc-section-head { gap: 4px; }
  .lc-card { min-height: 0; padding: 14px 16px 14px 22px; }
  .lc-card-bigletter { font-size: 63px; right: 8px; top: 6px; }
  .lc-organize { grid-template-columns: 36px 1fr; padding: 14px 16px; }
  .lc-organize-icon { width: 36px; height: 36px; }
  .lc-proj { padding: 12px 14px 12px 20px; gap: 10px 12px; }
  .lc-proj-icon { width: 36px; height: 36px; }
}

/* Dashboard: scroll natural (mesaje + fisiere pot creste) */
body.page-dash .dash {
  padding: 22px 28px 32px;
  display: flex; flex-direction: column;
  gap: 16px;
  max-width: 1100px;
  margin: 0 auto;
}
body.page-dash .dash-grid {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) 1.5fr;
  gap: 18px;
}
body.page-dash .upload-zone {
  display: flex; flex-direction: column;
  justify-content: center;
}
body.page-dash .files-card {
  display: flex;
  flex-direction: column;
}
body.page-dash .files-card .files-table-wrap { max-height: 400px; }
@media (max-width: 820px) {
  body.page-dash .dash { padding: 16px; }
  body.page-dash .dash-grid { grid-template-columns: 1fr; }
}
body.page-dash .files-card .files-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}
body.page-dash .files-card .files-table-wrap::-webkit-scrollbar { width: 6px; }
body.page-dash .files-card .files-table-wrap::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }

.fn-btn {
  background: none; border: 0; padding: 0;
  color: var(--fg); font: inherit; font-size: inherit;
  cursor: pointer;
  text-align: left;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 100%;
}
.fn-btn:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 2px; }

/* -- Preview modal -- */
.pv-modal { position: fixed; inset: 0; z-index: 9500; display: flex; flex-direction: column; }
.pv-modal[hidden] { display: none; }
.pv-backdrop {
  position: absolute; inset: 0;
  background: rgba(5,10,11,.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.pv-modal.is-open .pv-backdrop { opacity: 1; }
.pv-card {
  position: relative;
  z-index: 2;
  margin: 32px auto;
  width: min(1100px, calc(100vw - 48px));
  height: calc(100vh - 64px);
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  transform: scale(.96);
  opacity: 0;
  transition: transform .22s var(--ease), opacity .22s var(--ease);
}
.pv-modal.is-open .pv-card { transform: scale(1); opacity: 1; }
/* Header bar varianta clasica (legacy — folosit daca .pv-noheader nu e setat) */
.pv-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
  background: linear-gradient(to bottom, rgba(255,255,255,.02), transparent);
}
.pv-noheader .pv-head { display: none; }

/* Floating actions (X + Download) — peste imagine, fara title bar */
.pv-actions {
  position: absolute;
  top: 12px; right: 12px;
  display: flex;
  gap: 6px;
  z-index: 10;
}
.pv-act {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: rgba(15, 25, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pv-act:hover {
  background: rgba(15, 25, 28, 0.92);
  border-color: rgba(255, 255, 255, 0.28);
  transform: scale(1.06);
}
.pv-act-close:hover {
  background: rgba(224, 122, 130, 0.85);
  border-color: rgba(224, 122, 130, 0.95);
}
.pv-act-dl:hover {
  background: rgba(123, 181, 173, 0.82);
  border-color: rgba(123, 181, 173, 0.95);
  color: #0A1214;
}

/* Floating badge ext (colt jos-stanga) — discret, optional */
.pv-noheader .pv-ext-floating {
  position: absolute;
  bottom: 12px; left: 14px;
  z-index: 10;
  background: rgba(15, 25, 28, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.pv-noheader .pv-ext-floating[data-kind="pdf"] {
  color: #FFD0E5;
  background: rgba(232, 154, 200, 0.22);
  border-color: rgba(232, 154, 200, 0.35);
}
/* Numele fisierului — pill translucid lipit lângă badge-ul ext, ca să rămână
   lizibil indiferent de fundalul documentului (alb PDF, gri PDF, imagine etc.).
   Accent rose, identic semantic cu badge-ul PDF de lângă, frame coerent. */
.pv-noheader .pv-name-floating {
  position: absolute;
  bottom: 12px; left: 60px;
  max-width: calc(100% - 180px);
  z-index: 10;
  padding: 6px 12px;
  border-radius: 999px;
  /* Roșu PDF mai intens — saturat ca să citească titlul pe fundal alb de PDF. */
  background: rgba(220, 90, 130, 0.65);
  border: 1px solid rgba(232, 120, 160, 0.85);
  color: #FFFFFF;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 14px -2px rgba(180, 60, 100, 0.45);
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .015em;
  text-shadow: 0 1px 2px rgba(120, 30, 60, 0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
}
/* Când badge-ul ext e PDF, schimbăm accentul pill-ului pe rose pentru pereche.
   Pentru alte tipuri (image/zip/etc.) folosim accent neutru teal. */
.pv-noheader .pv-ext-floating:not([data-kind="pdf"]) ~ .pv-name-floating,
.pv-noheader .pv-ext-floating[data-kind=""] ~ .pv-name-floating {
  background: rgba(15, 25, 28, 0.75);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
}
.pv-noheader .pv-name-floating:empty { display: none; }
.pv-noheader .pv-ext-floating:empty + .pv-name-floating { left: 14px; }

/* Pe mobil, butoanele si labelul mai mici */
@media (max-width: 600px) {
  .pv-actions { top: 10px; right: 10px; }
  .pv-act { width: 32px; height: 32px; }
  .pv-noheader .pv-ext-floating,
  .pv-noheader .pv-name-floating { bottom: 10px; }
  .pv-noheader .pv-name-floating {
    max-width: calc(100% - 150px);
    padding: 5px 10px;
    font-size: .68rem;
  }
}
/* Badge cu extensia (PDF / PNG / JPG) — vizual hierarchy */
.pv-ext-badge {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .08em;
  font-family: var(--f-mono);
  color: var(--accent-hi);
  background: rgba(123,181,173,.14);
  border: 1px solid rgba(123,181,173,.32);
  flex-shrink: 0;
}
.pv-ext-badge:empty { display: none; }
.pv-ext-badge[data-kind="pdf"] {
  color: #E89AC8;
  background: rgba(232,154,200,.14);
  border-color: rgba(232,154,200,.32);
}
.pv-name {
  flex: 1;
  font-size: .9rem;
  font-weight: 500;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -.005em;
}
.pv-head .icon-btn {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all .12s var(--ease);
}
.pv-head .icon-btn:hover {
  background: rgba(224,122,130,.14);
  color: var(--danger);
}
.pv-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0a1214;
  overflow: auto;
  position: relative;
  background-image:
    radial-gradient(circle at 1.5px 1.5px, rgba(154,206,198,.04) 1.5px, transparent 0);
  background-size: 22px 22px;
}
.pv-body { box-sizing: border-box; }
.pv-body iframe,
.pv-body embed,
.pv-body object {
  width: 100%; height: 100%;
  border: 0;
  display: block;
}
.pv-body img {
  /* Imagine se încadrează în container fără overflow indiferent de dimensiune naturală */
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.pv-body[data-kind="pdf"] {
  background: #1F1F22;
  padding: 0;
}
.pv-body[data-kind="image"] {
  padding: 24px;
}
.pv-body[data-kind="image"] img {
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.4);
}
body {
  font-family: var(--f-sans);
  color: var(--fg);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Nu mai sunt blob-uri — pastram nodul gol pentru compatibilitate HTML. */
.bg-blobs, .blob { display: none; }

/* -------- Typography -------- */
h1, h2, h3, h4 {
  font-family: var(--f-sans);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0;
}
h1 { font-size: clamp(1.9rem, 2vw + 1rem, 2.6rem); font-weight: 500; }
h2 { font-size: 1.25rem; font-weight: 600; }
h3 { font-size: 1rem; font-weight: 600; }
p  { margin: 0; line-height: 1.6; }
a  { color: var(--accent); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--accent-hi); }
.muted { color: var(--muted); font-size: .88rem; }
.mono  { font-family: var(--f-mono); letter-spacing: .04em; }

.eyebrow {
  display: inline-block;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1em;
}

.lede { color: var(--muted); max-width: 56ch; font-size: 1rem; }

/* -------- Primitive -------- */
.glass {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* Butoane rotunde (pill) — minimalist, contrast clar pe oricare fundal. */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  font-family: inherit; font-weight: 500; font-size: .9rem;
  padding: 11px 24px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease);
  text-decoration: none;
  letter-spacing: -.005em;
  line-height: 1;
}
.btn:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; }
.btn:active { transform: scale(.97); }

.btn-primary {
  color: #FFFFFF;
  background: #0A1214;
  border-color: #FFFFFF;
}
.btn-primary:hover {
  background: #FFFFFF;
  color: #0A1214;
  border-color: #FFFFFF;
}

.btn-ghost {
  color: var(--fg);
  background: transparent;
  border-color: rgba(255,255,255,.25);
}
.btn-ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.4); color: var(--fg); }
.btn-ghost.is-current {
  background: rgba(123,181,173,.14);
  border-color: var(--accent);
  color: var(--accent-hi);
  cursor: default;
}
.btn-ghost.is-current:hover { background: rgba(123,181,173,.18); }

/* ============ USER MENU (account card dropdown) ============ */
.user-menu-wrap { position: relative; display: inline-block; }
.user-menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px 3px 3px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.user-menu-btn:hover {
  border-color: var(--accent);
  background: rgba(123,181,173,.08);
}
.user-menu-btn[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(123,181,173,.12);
}
.user-menu-chev {
  color: var(--muted);
  transition: transform .2s var(--ease), color .15s var(--ease);
  margin-right: 2px;
}
.user-menu-btn[aria-expanded="true"] .user-menu-chev {
  transform: rotate(180deg);
  color: var(--accent-hi);
}
.user-menu-avatar-sm {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--f-mono);
  font-size: .72rem; font-weight: 700;
  letter-spacing: .04em;
  background: rgba(123,181,173,.15);
  color: var(--accent-hi);
  border: 1px solid rgba(123,181,173,.35);
}
.user-menu-avatar-sm.user-menu-avatar-chimie,
.user-menu-avatar-lg.user-menu-avatar-chimie {
  background: rgba(242,160,112,.16);
  color: #F2A070;
  border-color: rgba(242,160,112,.4);
}
.user-menu-avatar-sm.user-menu-avatar-fizica,
.user-menu-avatar-lg.user-menu-avatar-fizica {
  background: rgba(123,181,173,.16);
  color: var(--accent-hi);
  border-color: rgba(123,181,173,.35);
}
.user-menu-avatar-sm.user-menu-avatar-matematica,
.user-menu-avatar-lg.user-menu-avatar-matematica {
  background: rgba(183,155,224,.14);
  color: #B79BE0;
  border-color: rgba(183,155,224,.35);
}

.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  padding: 6px;
  background: rgba(14, 24, 27, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,.45), 0 2px 12px rgba(0,0,0,.3);
  z-index: 60;
  /* origin-aware: iese din avatarul din dreapta-sus */
  transform-origin: top right;
  animation: hero-sort-pop .18s var(--ease);
}
.user-menu[hidden] { display: none; }

.user-menu-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px 14px 14px;
  margin-bottom: 4px;
  background: linear-gradient(180deg, rgba(123,181,173,.06), rgba(123,181,173,.02));
  border-radius: 10px;
}
.user-menu-avatar-lg {
  flex-shrink: 0;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-family: var(--f-mono);
  font-size: .9rem; font-weight: 700;
  letter-spacing: .04em;
}
.user-menu-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.user-menu-name {
  font-size: .92rem; font-weight: 600;
  color: var(--fg);
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-fac {
  display: inline-flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
}
.user-menu-fac-badge {
  font-size: .66rem; font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-hi);
  color: var(--muted);
}
.user-menu-fac-badge.user-menu-fac-chimie    { color: #F2A070; border-color: rgba(242,160,112,.4); background: rgba(242,160,112,.1); }
.user-menu-fac-badge.user-menu-fac-fizica    { color: var(--accent-hi); border-color: rgba(123,181,173,.35); background: rgba(123,181,173,.08); }
.user-menu-fac-badge.user-menu-fac-matematica { color: #B79BE0; border-color: rgba(183,155,224,.35); background: rgba(183,155,224,.08); }
.user-menu-spec {
  font-family: var(--f-mono);
  font-size: .64rem; font-weight: 700;
  letter-spacing: .06em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--muted);
}
.user-menu-email {
  font-size: .72rem;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

.user-menu-nav {
  display: flex; flex-direction: column;
  gap: 1px;
  padding: 2px;
}
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--fg);
  font-size: .86rem;
  transition: background .1s var(--ease), color .1s var(--ease);
}
.user-menu-item:hover {
  background: rgba(123,181,173,.12);
  color: var(--accent-hi);
}
.user-menu-item:hover .umi-ico { color: var(--accent-hi); }
.user-menu-item.is-current {
  background: rgba(123,181,173,.14);
  color: var(--accent-hi);
  font-weight: 600;
}
.user-menu-item.is-current .umi-ico { color: var(--accent-hi); }
.umi-ico {
  flex-shrink: 0;
  color: var(--muted);
  transition: color .1s var(--ease);
}
.user-menu-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--border);
}
.user-menu-item-danger { color: var(--danger); }
.user-menu-item-danger .umi-ico { color: var(--danger); }
.user-menu-item-danger:hover {
  background: rgba(224,122,130,.12);
  color: var(--danger);
}
.user-menu-item-danger:hover .umi-ico { color: var(--danger); }

/* Link extern (Implica-te CB) — accent rose/coral discret pentru diferentiere */
.user-menu-item-ext {
  color: #E89AC8;
}
.user-menu-item-ext .umi-ico { color: #E89AC8; }
.user-menu-item-ext .umi-ext { margin-left: auto; opacity: .55; }
.user-menu-item-ext:hover {
  background: rgba(232,154,200,.12);
  color: #F2B3D5;
}
.user-menu-item-ext:hover .umi-ico,
.user-menu-item-ext:hover .umi-ext { color: #F2B3D5; opacity: 1; }

/* Varianta Implica-te din sidebar admin — pastreaza structura .f-biletele dar accent rose */
.f-biletele.f-implica {
  color: #E89AC8;
  background: rgba(232,154,200,.06);
  border-color: rgba(232,154,200,.22);
}
.f-biletele.f-implica:hover {
  background: rgba(232,154,200,.14);
  border-color: rgba(232,154,200,.45);
  color: #F2B3D5;
}
.f-biletele.f-implica svg { color: #E89AC8; }
.f-biletele.f-implica:hover svg { color: #F2B3D5; }

/* Ieșire ca icon minimalist — folosit doar pe paginile admin acum */
.btn-logout {
  width: 34px; height: 34px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--accent-hi);
  border: 1px solid rgba(123,181,173,.4);
  background: rgba(123,181,173,.08);
  gap: 0;
}
.btn-logout svg {
  width: 16px;
  height: 16px;
  display: block;
  stroke: currentColor;
  color: var(--accent-hi);
  flex-shrink: 0;
}
.btn-logout:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(123,181,173,.18);
}
.btn-logout:hover svg { color: var(--accent); }

/* Buton primar pe fundaluri light (ex. dashboard cards) */
.btn-accent {
  color: #0A1214;
  background: var(--accent-hi);
  font-weight: 600;
}
.btn-accent:hover { background: #B5DFD8; }

.btn-full { width: 100%; }
.btn-sm   { padding: 8px 16px; font-size: .82rem; }
.btn[disabled] { opacity: .35; cursor: not-allowed; transform: none; }

/* Toast stack: confirmări minimaliste în colțul dreapta-jos */
.toast-stack {
  position: fixed;
  right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 2000;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  background: rgba(10, 18, 20, .94);
  color: var(--fg);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: .86rem; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(8px) scale(.95);
  transition: opacity .24s var(--ease), transform .24s cubic-bezier(.34,1.56,.64,1);
  pointer-events: auto;
  max-width: 340px;
}
.toast.is-in { opacity: 1; transform: translateY(0) scale(1); }
.toast.is-out { opacity: 0; transform: translateY(-6px) scale(.96); }
.toast-check {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #0A1214;
  font-size: .72rem; font-weight: 700;
  flex-shrink: 0;
}
.toast-err { border-color: var(--danger); }
.toast-err .toast-dot {
  display: grid; place-items: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #0A1214;
  font-size: .74rem; font-weight: 700;
  flex-shrink: 0;
}
.toast-err .toast-dot::before { content: '!'; }
.toast-msg { line-height: 1.3; }

/* Flash / alert */
.flash {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 100;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: .88rem; font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  animation: flashIn .25s var(--ease), flashOut .3s 5s forwards var(--ease);
  max-width: 90vw;
}
.flash-ok   { border-color: rgba(123,181,173,.4); color: var(--accent-hi); }
.flash-err  { border-color: rgba(224,122,130,.4); color: var(--danger); }
.flash-warn { border-color: rgba(200,170,110,.4); color: #D5B877; }
@keyframes flashIn  { from { opacity: 0; transform: translate(-50%,-10px); } }
@keyframes flashOut { to   { opacity: 0; transform: translate(-50%,-10px); } }

.alert { padding: 10px 14px; border-radius: 8px; font-size: .88rem; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--border); }
.alert-err { border-color: rgba(224,122,130,.4); color: var(--danger); }

/* ============ LANDING ============ */
.landing {
  height: 100vh;
  display: block;
  padding: 0;
  max-width: none;
}
.landing-hero {
  position: relative;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  overflow: hidden;
  height: 100vh;
}
.landing-hero-image {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
}
.landing-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,18,20,.55) 0%, rgba(10,18,20,.85) 100%);
}
.landing-canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  pointer-events: auto;
  z-index: 0;
}
.landing-hero-content {
  position: relative; z-index: 1;
  max-width: 640px;
  background: transparent;
  border: 0;
  padding: 0;
}
.landing-hero-content h1 {
  font-size: clamp(2.4rem, 3vw + 1rem, 3.6rem);
  font-weight: 400;
  line-height: 1.08;
  margin-bottom: 18px;
}
.landing-hero-content .lede {
  margin-left: auto; margin-right: auto;
  color: rgba(230,236,236,.78);
}
.cta-row {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin-top: 32px;
}

/* Grid-ul de features era prea incarcat — il inlocuim cu o lista simpla simetrica. */
.landing-grid { display: none; }

.landing-subjects {
  padding: 56px 24px 80px;
  text-align: center;
}
.landing-subjects h2 {
  font-size: .78rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 22px;
}
.subject-row {
  display: flex; gap: 42px;
  justify-content: center; align-items: center;
  flex-wrap: wrap;
}
.subj-pill {
  font-weight: 500; font-size: 1rem;
  color: var(--fg);
  padding: 0; border: 0; background: none;
  letter-spacing: -.01em;
  opacity: .9;
}

/* ============ LOGIN ============ */
.auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
  max-width: 960px;
  min-height: 560px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.1);
  background: var(--bg-2);
  box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 4px 18px rgba(0,0,0,.4);
}
@media (max-width: 820px) { .auth-split { grid-template-columns: 1fr; min-height: auto; } }

.auth-art {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  background: linear-gradient(135deg, #0A1214 0%, #0E181B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Card-ul cu video — imaginea landing.jpg nu se mai incarca aici (e pe body) */
.auth-art-image { display: none; }
.auth-art-overlay {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(123,181,173,.10) 0%, transparent 70%),
    linear-gradient(180deg, rgba(10,18,20,0) 0%, rgba(10,18,20,.45) 100%);
  z-index: 1;
  pointer-events: none;
}
/* Video — centrat, prominent, cu mix-blend-mode: screen pixelii negri "dispar".
   Plasat in inima cardului. */
.auth-art-video {
  position: relative;
  z-index: 2;
  width: 78%;
  max-width: 360px;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  mix-blend-mode: screen;
  pointer-events: none;
  filter: contrast(1.1) brightness(1.18) saturate(1.12);
  border-radius: 14px;
  /* Edge-fade radial — se topeste in fundalul cardului fara margini taiate */
  -webkit-mask-image: radial-gradient(ellipse at center, #000 55%, transparent 100%);
          mask-image: radial-gradient(ellipse at center, #000 55%, transparent 100%);
}
.auth-art-copy {
  position: absolute;
  bottom: 32px; left: 32px; right: 32px;
  z-index: 3;
}
.auth-art-copy .eyebrow { color: rgba(230,236,236,.7); }
.auth-art-copy h2 { font-size: 1.5rem; font-weight: 400; line-height: 1.2; }

.auth-form-wrap { padding: 40px; display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 400px; padding: 0; background: none; border: 0; }
.auth-card h1 { font-size: 1.5rem; font-weight: 500; margin-bottom: 6px; }
.auth-card .subtitle { color: var(--muted); font-size: .88rem; margin-bottom: 28px; }

.auth-tabs {
  display: flex; gap: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  padding: 0;
  background: none;
  border-radius: 0;
  position: relative;
}
.auth-tabs .tab {
  padding: 10px 0;
  font-size: .9rem; font-weight: 500;
  color: var(--muted);
  border: 0;
  background: none;
  cursor: pointer;
  font-family: inherit;
  position: relative;
  transition: color .25s var(--ease);
}
.auth-tabs .tab:hover { color: var(--fg); }
.auth-tabs .tab.is-active { color: var(--fg); }
/* Pill animat sub tab-uri (înlocuiește border-bottom static) */
.auth-tabs-pill {
  position: absolute;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform .35s cubic-bezier(.4, .0, .2, 1), width .35s cubic-bezier(.4, .0, .2, 1);
  pointer-events: none;
}
/* Pozitia pill-ului e setata din JS prin masurarea tab-ului activ.
   Pana ruleaza JS, default 0 (invizibil). */

/* Panourile — cross-fade smooth la switch */
.auth-panes { position: relative; }
.auth-pane {
  display: none;
  transition: opacity .32s cubic-bezier(.4, 0, .2, 1),
              transform .32s cubic-bezier(.4, 0, .2, 1);
  will-change: opacity, transform;
}
.auth-pane.is-active {
  display: block;
}
.auth-pane.is-leaving {
  display: block;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-hint { font-size: .78rem; color: var(--muted-2); margin-top: 24px; text-align: center; }

/* -------- Forms -------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 460px) { .field-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span {
  font-size: .78rem; color: var(--muted);
  font-weight: 500; letter-spacing: .01em;
}
.field input {
  font-family: inherit; font-size: .94rem;
  padding: 11px 13px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  color: var(--fg);
  transition: border-color .15s var(--ease);
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
}
.field input.mono { font-family: var(--f-mono); letter-spacing: .1em; text-transform: uppercase; }

/* ============ LOADING ============ */
.page-loading .site-footer { display: none; }
.loading-screen {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 24px;
}
.loading-art {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
.loading-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,18,20,.6) 0%, rgba(10,18,20,.92) 100%);
}
.loading-content {
  position: relative; z-index: 1;
  text-align: center;
  padding: 0;
  background: none;
  border: 0;
  min-width: 260px;
}
.pulse-ring { display: none; }
.loading-content h1 { font-size: 1.3rem; font-weight: 500; margin-bottom: 4px; }
.loading-sub { color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.loading-bar {
  width: 180px; margin: 0 auto;
  height: 2px; background: var(--border-hi); border-radius: 2px; overflow: hidden;
}
.loading-bar-fill {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  animation: fillIn 1.4s var(--ease) forwards;
}
@keyframes fillIn { to { width: 100%; } }

/* ============ TOP BAR ============ */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0;
  position: sticky; top: 0;
  z-index: 55; /* peste sticky thead (25) si orice drop-down de pe pagina */
  margin: 0;
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; color: var(--fg); font-size: .95rem; }
.brand svg { opacity: .9; }
.topbar-right { display: flex; align-items: center; gap: 14px; }

/* Topbar content aliniat cu containerul principal — SINGUR rail de 1100px / 28px pentru toate paginile studentului */
body.page-dash .topbar,
body.page-lessons .topbar,
body.page-peer .topbar,
body.page-grades-student .topbar,
body.page-steps .topbar {
  padding-left: max(28px, calc((100% - 1100px) / 2 + 28px));
  padding-right: max(28px, calc((100% - 1100px) / 2 + 28px));
}
body.page-fisa .topbar {
  padding-left: max(28px, calc((100% - 1200px) / 2 + 28px));
  padding-right: max(28px, calc((100% - 1200px) / 2 + 28px));
}

/* ============ PAGINA FIȘA DISCIPLINEI ============ */
body.page-fisa { height: auto; }
.fisa-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 28px 60px;
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 40px;
  align-items: start;
}
/* TOC fixed dreapta — pinuit complet, zero scroll effect, fara chenar */
.fisa-toc {
  position: fixed;
  top: 100px;
  right: max(28px, calc((100vw - 1200px) / 2 + 28px));
  width: 220px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding: 4px 0;
  z-index: 20;
}
/* Placeholder in grid pentru a pastra coloana rezervata cu latime 220px */
.fisa-main > .fisa-toc { grid-column: 2; order: 2; }
.fisa-toc-title {
  margin: 0 0 10px 12px;
  font-size: .62rem; font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted-2);
}
.fisa-toc-list {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column;
}
.fisa-toc-link {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 8px 7px 14px;
  font-size: .82rem;
  color: var(--muted);
  text-decoration: none;
  /* Linie accent-fadă continuă pe toate item-urile */
  border-left: 2px solid rgba(123,181,173,.18);
  transition: all .15s var(--ease);
  line-height: 1.3;
}
.fisa-toc-n {
  flex-shrink: 0;
  width: 18px;
  font-size: .7rem;
  font-family: var(--f-mono); font-weight: 600;
  color: var(--muted-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.fisa-toc-t { flex: 1; min-width: 0; }
.fisa-toc-link:hover {
  color: var(--fg);
  border-left-color: rgba(123,181,173,.45);
}
.fisa-toc-link:hover .fisa-toc-n { color: var(--muted); }
.fisa-toc-link.is-active {
  color: var(--accent-hi);
  border-left-color: var(--accent);
  font-weight: 600;
}
.fisa-toc-link.is-active .fisa-toc-n { color: var(--accent-hi); font-weight: 700; }

/* Content */
.fisa-content { min-width: 0; order: 1; }
.fisa-hero {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.fisa-hero .eyebrow {
  display: inline-block;
  font-size: .66rem; font-weight: 700;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-hi);
  margin-bottom: 12px;
  padding: 4px 12px;
  background: rgba(123,181,173,.1);
  border: 1px solid rgba(123,181,173,.3);
  border-radius: 999px;
}
.fisa-hero h1 {
  font-size: clamp(1.5rem, 2.4vw + 1rem, 2.1rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 10px;
  color: var(--fg);
}
.fisa-hero .lede {
  margin: 0;
  font-size: .95rem;
  color: var(--muted);
  line-height: 1.55;
  max-width: 700px;
}

/* Sections */
.fisa-section {
  padding: 22px 0 26px;
  scroll-margin-top: 100px;
}
.fisa-section + .fisa-section { border-top: 1px solid var(--border); }
.fisa-section h2 {
  position: relative;
  font-size: 1.2rem; font-weight: 600;
  letter-spacing: -.015em;
  margin: 0 0 16px;
  color: var(--fg);
  padding-left: 14px;
}
.fisa-section h2::before {
  content: '';
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 3px;
  background: var(--accent);
  border-radius: 3px;
}
.fisa-section h3 {
  font-size: .92rem; font-weight: 600;
  margin: 20px 0 8px;
  color: var(--accent-hi);
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: .68rem;
  letter-spacing: .14em;
}
.fisa-section h4 {
  font-size: .72rem; font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin: 16px 0 6px;
  color: var(--muted-2);
}
.fisa-section p {
  font-size: .94rem;
  color: var(--muted);
  line-height: 1.65;
  margin: 0 0 12px;
  text-align: justify;
}
.fisa-section p b { color: var(--fg); font-weight: 600; }

/* Definition list — 2 coloane cu separator CONTINUU intre randuri */
.fisa-dl {
  display: grid;
  grid-template-columns: minmax(180px, 220px) 1fr;
  gap: 0;
  margin: 0;
}
.fisa-dl dt,
.fisa-dl dd {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.fisa-dl dt { padding-right: 24px; }
.fisa-dl dd { padding-left: 0; margin: 0; }
.fisa-dl > *:nth-last-child(-n+2) { border-bottom: 0; }
.fisa-dl dt {
  font-size: .72rem; font-weight: 600;
  color: var(--muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.fisa-dl dd {
  font-size: .9rem;
  color: var(--fg);
  line-height: 1.5;
}

/* KPI-uri (timpul total, evaluare) */
.fisa-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 20px;
}
.fisa-kpi {
  display: flex; flex-direction: column; gap: 2px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.fisa-kpi b {
  font-size: 1.3rem; font-weight: 700;
  color: var(--fg);
  letter-spacing: -.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fisa-kpi span {
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .04em;
}
.fisa-kpi-hi {
  background: rgba(123,181,173,.08);
  border-color: rgba(123,181,173,.3);
}
.fisa-kpi-hi b { color: var(--accent-hi); }

.fisa-ul {
  margin: 0 0 14px;
  padding-left: 20px;
}
.fisa-ul li {
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 6px;
}
.fisa-ul li b { color: var(--fg); font-weight: 600; }

.fisa-note {
  padding: 10px 14px;
  background: var(--bg-2);
  border-left: 3px solid var(--border-hi);
  border-radius: 0 8px 8px 0;
  font-size: .86rem;
  color: var(--muted);
  margin: 0 0 14px;
}
.fisa-note b { color: var(--danger); }

/* Tabel conținut */
.fisa-tbl {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0 18px;
  font-size: .85rem;
}
.fisa-tbl thead th {
  padding: 10px 12px;
  text-align: left;
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-hi);
  color: var(--muted);
  font-size: .66rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.fisa-tbl tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  line-height: 1.45;
  vertical-align: top;
}
.fisa-tbl tbody td:first-child {
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  width: 48px;
}
.fisa-tbl tbody td:nth-child(3) { color: var(--muted); font-size: .82rem; }
.fisa-tbl tbody td:last-child {
  color: var(--accent-hi);
  white-space: nowrap;
  width: 56px;
  font-variant-numeric: tabular-nums;
}

/* Tabele Evaluare — 10.1 / 10.2 / 10.3 (format fișă disciplinei) */
.fisa-evl {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: .82rem;
  table-layout: fixed;
  border: 1px solid var(--border-hi);
  background: var(--bg-1);
}
.fisa-evl td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  vertical-align: middle;
  color: var(--fg);
  line-height: 1.4;
}
.fisa-evl .fisa-evl-title td {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border-hi);
  color: var(--fg);
  font-size: .84rem;
  padding: 12px 14px;
}
.fisa-evl .fisa-evl-title td b {
  font-weight: 700;
  color: var(--fg);
}
.fisa-evl .fisa-evl-tip {
  background: var(--bg-2);
  color: var(--fg);
  font-weight: 600;
  font-size: .84rem;
  width: 22%;
}
.fisa-evl .fisa-evl-lbl {
  color: var(--muted);
  width: 26%;
  font-size: .8rem;
}
.fisa-evl .fisa-evl-val {
  color: var(--fg);
}
.fisa-evl .fisa-evl-num {
  color: var(--accent-hi);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.fisa-evl .fisa-evl-subhead td {
  background: var(--bg-2);
  color: var(--muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
  padding: 8px 10px;
}
.fisa-evl .fisa-evl-subhead td.fisa-evl-lbl {
  text-align: left;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 600;
  font-size: .8rem;
  color: var(--fg);
  background: var(--bg-2);
}
.fisa-evl .fisa-evl-empty {
  height: 70px;
  background: var(--bg-1);
}

/* Bibliografie */
.fisa-biblio {
  margin: 0 0 14px;
  padding-left: 22px;
}
.fisa-biblio li {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 5px;
}
.fisa-biblio li em { color: var(--fg); font-style: italic; }

.fisa-foot {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px dashed var(--border);
  color: var(--muted-2);
  font-size: .82rem;
  line-height: 1.6;
}
.fisa-foot p { margin: 0 0 8px; }
.fisa-foot b { color: var(--muted); font-weight: 600; }

@media (max-width: 860px) {
  .fisa-main { grid-template-columns: 1fr; gap: 24px; }
  .fisa-toc {
    position: relative; top: 0; right: auto;
    width: auto;
    order: 0;
    max-height: none;
    grid-column: auto;
  }
  .fisa-dl { grid-template-columns: 1fr; gap: 2px 0; }
  .fisa-dl dt { margin-top: 10px; }
}

/* ============ PAGINA PAȘI DE URMAT (Chrome-style onboarding) ============ */
body.page-steps { height: auto; overflow: auto; }
.steps-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 28px 56px;
  display: flex; flex-direction: column; gap: 36px;
}

/* Hero — mare, aerisit, în stil onboarding */
.steps-hero {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
}
.steps-hero .eyebrow {
  display: inline-block;
  font-size: .68rem; font-weight: 700;
  letter-spacing: .22em; text-transform: uppercase;
  color: var(--accent-hi);
  margin-bottom: 14px;
  padding: 5px 12px;
  background: rgba(123,181,173,.1);
  border: 1px solid rgba(123,181,173,.3);
  border-radius: 999px;
}
.steps-hero h1 {
  font-size: clamp(1.8rem, 3.2vw + 1rem, 2.8rem);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.025em;
  margin: 0 0 16px;
  color: var(--fg);
}
.steps-hero .lede {
  font-size: 1rem;
  color: var(--muted);
  line-height: 1.6;
  margin: 0 auto;
  max-width: 580px;
}

/* Lista pașilor — 3 carduri side-by-side (Chrome next-steps pattern) */
.steps-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.step-item {
  position: relative;
  border: 0;
  border-radius: 16px;
  padding: 38px 24px 24px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease);
  display: flex;
  flex-direction: column;
}
/* Fiecare card preia nuanta butonului de head (1 teal / 2 amber / 3 mov) — fara border */
.step-item-1 { background: linear-gradient(160deg, rgba(123,181,173,.12) 0%, rgba(123,181,173,.04) 55%, rgba(18,31,34,.6) 100%); }
.step-item-2 { background: linear-gradient(160deg, rgba(247,185,85,.12)   0%, rgba(247,185,85,.04)   55%, rgba(18,31,34,.6) 100%); }
.step-item-3 { background: linear-gradient(160deg, rgba(183,155,224,.12) 0%, rgba(183,155,224,.04) 55%, rgba(18,31,34,.6) 100%); }

.step-item:hover { transform: translateY(-2px); }
.step-item-1:hover { box-shadow: 0 8px 22px rgba(123,181,173,.08), 0 1px 3px rgba(123,181,173,.05); }
.step-item-2:hover { box-shadow: 0 8px 22px rgba(247,185,85,.08),   0 1px 3px rgba(247,185,85,.05); }
.step-item-3:hover { box-shadow: 0 8px 22px rgba(183,155,224,.08), 0 1px 3px rgba(183,155,224,.05); }

/* Head pill = număr + tag, plutind peste marginea cardului borderless */
.step-head {
  position: absolute;
  top: -16px; left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid;
  z-index: 2;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.step-item:hover .step-head { transform: translateY(-1px); }

.step-num {
  font-size: .92rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
}
/* Gradient mai intens + glow colorat subtil — fara shadow negru, identitate cromatica completa */
.step-item-1 .step-head {
  background: linear-gradient(135deg, rgba(123,181,173,.32), rgba(123,181,173,.14));
  border-color: rgba(123,181,173,.5);
  box-shadow: 0 3px 10px rgba(123,181,173,.18), 0 1px 2px rgba(0,0,0,.2);
}
.step-item-2 .step-head {
  background: linear-gradient(135deg, rgba(247,185,85,.32), rgba(247,185,85,.14));
  border-color: rgba(247,185,85,.5);
  box-shadow: 0 3px 10px rgba(247,185,85,.18), 0 1px 2px rgba(0,0,0,.2);
}
.step-item-3 .step-head {
  background: linear-gradient(135deg, rgba(183,155,224,.32), rgba(183,155,224,.14));
  border-color: rgba(183,155,224,.5);
  box-shadow: 0 3px 10px rgba(183,155,224,.18), 0 1px 2px rgba(0,0,0,.2);
}
.step-item-1 .step-num { color: var(--accent-hi); }
.step-item-2 .step-num { color: #F7B955; }
.step-item-3 .step-num { color: #B79BE0; }
.step-item:hover .step-item-1 .step-head,
.step-item-1:hover .step-head { box-shadow: 0 5px 14px rgba(123,181,173,.28), 0 1px 2px rgba(0,0,0,.25); }
.step-item-2:hover .step-head { box-shadow: 0 5px 14px rgba(247,185,85,.28),   0 1px 2px rgba(0,0,0,.25); }
.step-item-3:hover .step-head { box-shadow: 0 5px 14px rgba(183,155,224,.28), 0 1px 2px rgba(0,0,0,.25); }

.step-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
}

.step-tag {
  font-family: var(--f-sans);
  font-size: .82rem; font-weight: 600;
  letter-spacing: .02em;
  line-height: 1;
  white-space: nowrap;
}
.step-item-1 .step-tag { color: var(--accent-hi); }
.step-item-2 .step-tag { color: #F7B955; }
.step-item-3 .step-tag { color: #B79BE0; }

.step-title {
  font-size: 1.08rem; font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.02em;
  margin: 0 0 10px;
  color: var(--fg);
}
.step-desc {
  font-size: .86rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 14px;
  flex: 1;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.step-desc b { color: var(--fg); font-weight: 600; }
.step-desc a { color: var(--accent-hi); text-decoration: none; border-bottom: 1px dashed rgba(154,206,198,.4); }
.step-desc a:hover { border-bottom-style: solid; }

.step-checklist {
  list-style: none;
  margin: 0 0 14px;
  padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.step-checklist li {
  position: relative;
  padding: 7px 10px 7px 30px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.45;
}
.step-checklist li::before {
  content: '';
  position: absolute;
  left: 10px; top: 12px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(183,155,224,.4);
  border: 2px solid rgba(183,155,224,.7);
}
.step-checklist b { color: var(--fg); font-weight: 600; }

.step-meta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  font-size: .82rem;
  color: var(--fg);
  font-weight: 500;
  align-self: flex-start;
}
.step-meta svg { flex-shrink: 0; }
.step-meta a { text-decoration: none; border-bottom: 1px dashed currentColor; font-weight: 600; }
.step-meta a:hover { border-bottom-style: solid; }

/* Tint per step — matching culoarea etapei */
.step-item-1 .step-meta { background: rgba(123,181,173,.1); border-color: rgba(123,181,173,.35); }
.step-item-2 .step-meta { background: rgba(247,185,85,.1);   border-color: rgba(247,185,85,.35); }
.step-item-3 .step-meta { background: rgba(183,155,224,.1); border-color: rgba(183,155,224,.35); }
.step-item-1 .step-meta svg, .step-item-1 .step-meta a { color: var(--accent-hi); }
.step-item-2 .step-meta svg, .step-item-2 .step-meta a { color: #F7B955; }
.step-item-3 .step-meta svg, .step-item-3 .step-meta a { color: #B79BE0; }
/* S14 — doar accentul, restul textului rămâne neutru */
.step-meta-hi {
  color: var(--danger);
  font-weight: 700;
  font-family: var(--f-mono);
  letter-spacing: .04em;
}

.step-deadline {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 14px;
  padding: 11px 13px;
  background: linear-gradient(135deg, rgba(224,122,130,.08), rgba(224,122,130,.03));
  border: 1px solid rgba(224,122,130,.3);
  border-left: 3px solid var(--danger);
  border-radius: 9px;
  font-size: .8rem;
  color: var(--fg);
  line-height: 1.45;
}
.step-deadline svg { color: var(--danger); flex-shrink: 0; margin-top: 2px; }
.step-deadline b { color: var(--danger); font-weight: 700; }
.step-deadline-sub {
  font-size: .78rem;
  color: var(--muted);
  font-style: italic;
}

/* Resurse bottom section (Chrome next-steps — feature cards cu imagini) */
.steps-resources {
  display: flex; flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.steps-res-title {
  font-size: 1.35rem; font-weight: 600;
  letter-spacing: -.02em;
  margin: 0;
  color: var(--fg);
  text-align: center;
}
.steps-res-sub {
  font-size: .88rem;
  color: var(--muted);
  margin: 0 0 24px;
  text-align: center;
}
.steps-res-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
}
.steps-res-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.steps-res-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-hi);
  box-shadow: 0 10px 28px rgba(0,0,0,.22);
}
.steps-res-img {
  aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  position: relative;
  overflow: hidden;
}
.steps-res-img svg {
  color: #fff;
  opacity: .92;
  z-index: 2;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,.25));
}
.steps-res-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.18), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(0,0,0,.25), transparent 50%);
  pointer-events: none;
}
/* Placeholder-uri colorate — inlocuieste cu poze user-provided later */
.steps-res-img-1 { background: linear-gradient(135deg, #7BB5AD 0%, #5D8A85 100%); }
.steps-res-img-2 { background: linear-gradient(135deg, #F7B955 0%, #D49A3E 100%); }
.steps-res-img-3 { background: linear-gradient(135deg, #B79BE0 0%, #8669B3 100%); }

.steps-res-body {
  padding: 18px 20px 20px;
  flex: 1;
  display: flex; flex-direction: column;
  gap: 6px;
}
.steps-res-body h3 {
  font-size: 1.02rem; font-weight: 600;
  letter-spacing: -.01em;
  margin: 0;
  color: var(--fg);
}
.steps-res-body p {
  margin: 0;
  font-size: .84rem;
  color: var(--muted);
  line-height: 1.55;
  text-align: justify;
  hyphens: auto;
  -webkit-hyphens: auto;
}
@media (max-width: 960px) {
  .steps-res-grid { grid-template-columns: 1fr; max-width: 480px; margin: 0 auto; }
}

.steps-foot {
  text-align: center;
  padding: 20px 0;
  border-top: 1px dashed var(--border);
  margin-top: 10px;
}
.steps-foot p { margin: 0; font-size: .86rem; color: var(--muted-2); }

/* Step link în lista de portofoliu (3.) */
.step-link {
  color: var(--accent-hi);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color .15s var(--ease);
}
.step-link:hover { color: #C5E2DD; }

/* ============================================================
   STEPS-PRODUCTS — tab-uri rotative cu imagini (înlocuiește grid-ul vechi)
   Inspirat din: Inference / Compute / Model shaping
   ============================================================ */
.steps-products {
  display: flex; flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  padding-top: 36px;
  border-top: 1px solid var(--border);
}
.steps-products .steps-res-title,
.steps-products .steps-res-sub { text-align: center; align-self: center; }
.steps-products .steps-res-sub { margin-bottom: 24px; }

.sp-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  /* Match exact gap-ul de la .steps-list (3 carduri side-by-side) — aceeași lățime per box */
  gap: 20px;
  margin-bottom: 22px;
}
/* Pauză animație când userul a apăsat Space */
.sp-tabs.is-paused .sp-tab.is-active .sp-tab-progress-bar {
  animation-play-state: paused;
}

/* Hint discret sub poze (după panele) */
.sp-hint {
  margin: 18px 0 0;
  text-align: center;
  font-size: .72rem;
  color: var(--muted-2);
  letter-spacing: .04em;
  opacity: .55;
  transition: opacity .25s var(--ease), color .2s var(--ease);
}
.sp-hint:hover { opacity: 1; }
.sp-hint kbd {
  display: inline-block;
  padding: 1px 7px;
  margin: 0 2px;
  font-family: var(--f-mono);
  font-size: .68rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--fg);
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 5px;
  vertical-align: 1px;
}
.sp-tabs.is-paused ~ .sp-hint {
  /* Când e pausat, hint-ul devine ușor mai vizibil + se schimbă mesajul via ::after */
  opacity: .9;
  color: var(--accent-hi);
}
.sp-tabs.is-paused ~ .sp-hint kbd {
  border-color: rgba(154, 206, 198, .35);
  color: var(--accent-hi);
}
/* Indicator vizual al pauzei (icon mic sub tab-ul activ) */
.sp-tab.is-active::after {
  content: '';
  position: absolute;
  bottom: 6px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--sp-c);
  opacity: 0;
  transition: opacity .2s var(--ease);
  z-index: 2;
}
.sp-tabs.is-paused .sp-tab.is-active::after {
  opacity: .85;
  /* Două puncte = simbol pauză micro */
  box-shadow: 6px 0 0 0 var(--sp-c);
  margin-left: -3px;
}
.sp-tab {
  --sp-c: var(--accent);
  --sp-c-bg: rgba(123, 181, 173, .14);
  --sp-c-bar: rgba(123, 181, 173, .28);
  position: relative;
  padding: 16px 22px;
  font-size: clamp(.95rem, 1.4vw, 1.1rem);
  font-weight: 600;
  font-family: inherit;
  color: var(--muted);
  /* Resting background — cutia se vede mereu, ca un container care se umple cu culoare */
  background: rgba(255, 255, 255, .045);
  border: 0;
  border-radius: 11px;
  cursor: pointer;
  text-align: center;
  letter-spacing: -.005em;
  overflow: hidden;
  z-index: 1;
  transition: color .2s var(--ease), background .35s var(--ease), transform .14s var(--ease);
  outline: none;
}
.sp-tab:hover {
  color: var(--fg);
  background: rgba(255, 255, 255, .075);
}
.sp-tab:active { transform: scale(.97); }
.sp-tab:focus-visible {
  /* Single ring teal-pe-culoare, fără border duplicat */
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--sp-c) 55%, transparent);
}
.sp-tab.is-active { color: var(--fg); }

.sp-tab[data-tab="materiale"]   { --sp-c: #7BB5AD; --sp-c-bg: rgba(123, 181, 173, .16); --sp-c-bar: rgba(123, 181, 173, .35); }
.sp-tab[data-tab="evaluare"]    { --sp-c: #F7B955; --sp-c-bg: rgba(247, 185, 85, .14);  --sp-c-bar: rgba(247, 185, 85, .32); }
.sp-tab[data-tab="comunicare"]  { --sp-c: #B79BE0; --sp-c-bg: rgba(183, 155, 224, .14); --sp-c-bar: rgba(183, 155, 224, .32); }
.sp-tab.is-active[data-tab="materiale"]   { background: color-mix(in srgb, #7BB5AD 13%, transparent); }
.sp-tab.is-active[data-tab="evaluare"]    { background: color-mix(in srgb, #F7B955 11%, transparent); }
.sp-tab.is-active[data-tab="comunicare"]  { background: color-mix(in srgb, #B79BE0 11%, transparent); }
.sp-tab-text { position: relative; z-index: 2; }

.sp-tab-progress {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  border-radius: 11px;
  pointer-events: none;
}
.sp-tab-progress-bar {
  height: 100%;
  width: 0;
  background: var(--sp-c-bar);
  transition: none;
}
.sp-tab.is-active .sp-tab-progress-bar {
  animation: spTabFill 7s linear forwards;
}
@keyframes spTabFill {
  from { width: 0; }
  to   { width: 100%; }
}

.sp-panels {
  position: relative;
  display: grid;
}
.sp-panel {
  grid-area: 1 / 1;
  background: var(--surface);
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  /* shadow definește edge-ul în loc de border — Kowalski style, mai blând */
  box-shadow: 0 14px 44px rgba(0, 0, 0, .28), 0 1px 2px rgba(0, 0, 0, .35);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  /* Exit ~70% din enter — sistem răspunde repede la dispariție */
  transition: opacity .26s var(--ease), visibility 0s linear .26s;
}
.sp-panel.is-active {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity .4s var(--ease), visibility 0s linear 0s;
}
.sp-panel[hidden] { display: grid; }   /* override default `hidden` ca să rămână în grid */
.sp-panel-inner {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  min-height: 380px;
}
.sp-panel-left {
  padding: 36px 38px;
  display: flex; flex-direction: column;
  gap: 14px;
  border-right: 1px solid var(--border);
}
.sp-panel-title {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--fg);
}
.sp-panel-lede {
  margin: 0;
  font-size: .94rem;
  color: var(--muted);
  line-height: 1.6;
}
.sp-panel-list {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: flex; flex-direction: column;
  gap: 10px;
}
.sp-panel-list li {
  position: relative;
  padding-left: 22px;
  font-size: .88rem;
  color: var(--muted);
  line-height: 1.5;
}
.sp-panel-list li::before {
  content: '';
  position: absolute;
  left: 4px; top: .6em;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .85;
}
.sp-panel.is-active .sp-panel-list li b { color: var(--fg); font-weight: 600; }

#sp-panel-materiale  .sp-panel-list li::before { background: #7BB5AD; }
#sp-panel-evaluare   .sp-panel-list li::before { background: #F7B955; }
#sp-panel-comunicare .sp-panel-list li::before { background: #B79BE0; }

/* CTA modern minimalist per panel — culoarea derivă din contextul fiecărui panel */
.sp-cta {
  display: inline-flex; align-items: center;
  gap: 10px;
  margin-top: 6px;
  align-self: flex-start;
  padding: 11px 18px;
  border: 1px solid var(--sp-cta-border, rgba(123, 181, 173, .35));
  background: var(--sp-cta-bg, rgba(123, 181, 173, .1));
  color: var(--sp-cta-fg, #E5F2EF);
  border-radius: 10px;
  font: inherit;
  font-size: .86rem; font-weight: 600;
  letter-spacing: .005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .22s var(--ease), border-color .22s var(--ease),
              transform .12s var(--ease), box-shadow .22s var(--ease);
  user-select: none;
  white-space: nowrap;
}
.sp-cta-ico {
  display: inline-grid; place-items: center;
  transition: transform .25s var(--ease);
}
.sp-cta:hover .sp-cta-ico { transform: translateX(2px); }
.sp-cta:active { transform: scale(.97); }
.sp-cta:focus-visible {
  outline: 2px solid var(--sp-cta-fg-focus, var(--accent));
  outline-offset: 2px;
}

/* Resting + hover explicite per panel — fără variabile, ca să eliminăm orice
   ambiguitate de cascade la stările hover. */
#sp-panel-materiale .sp-cta {
  background: rgba(123, 181, 173, .12);
  border-color: rgba(123, 181, 173, .35);
  color: #E5F2EF;
  --sp-cta-fg-focus: #7BB5AD;
}
#sp-panel-materiale .sp-cta:hover {
  background: rgba(123, 181, 173, .22);
  border-color: rgba(123, 181, 173, .65);
  box-shadow: 0 8px 22px rgba(123, 181, 173, .2);
}

#sp-panel-evaluare .sp-cta {
  background: rgba(247, 185, 85, .12);
  border-color: rgba(247, 185, 85, .35);
  color: #FBE5BD;
  --sp-cta-fg-focus: #F7B955;
}
#sp-panel-evaluare .sp-cta:hover {
  background: rgba(247, 185, 85, .22);
  border-color: rgba(247, 185, 85, .65);
  box-shadow: 0 8px 22px rgba(247, 185, 85, .2);
}

#sp-panel-comunicare .sp-cta {
  background: rgba(183, 155, 224, .12);
  border-color: rgba(183, 155, 224, .35);
  color: #E2D6F3;
  --sp-cta-fg-focus: #B79BE0;
}
#sp-panel-comunicare .sp-cta:hover {
  background: rgba(183, 155, 224, .22);
  border-color: rgba(183, 155, 224, .65);
  box-shadow: 0 8px 22px rgba(183, 155, 224, .2);
}
@media (prefers-reduced-motion: reduce) {
  .sp-cta, .sp-cta-ico { transition: none; }
}

.sp-panel-right {
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
  background: linear-gradient(135deg, rgba(123, 181, 173, .08), rgba(183, 155, 224, .06) 50%, rgba(247, 185, 85, .06));
  overflow: hidden;
}
#sp-panel-materiale  .sp-panel-right { background: linear-gradient(135deg, rgba(123, 181, 173, .15) 0%, rgba(123, 181, 173, .04) 60%, rgba(0,0,0,.2) 100%); }
#sp-panel-evaluare   .sp-panel-right { background: linear-gradient(135deg, rgba(247, 185, 85, .15)  0%, rgba(247, 185, 85, .04)  60%, rgba(0,0,0,.2) 100%); }
#sp-panel-comunicare .sp-panel-right { background: linear-gradient(135deg, rgba(183, 155, 224, .15) 0%, rgba(183, 155, 224, .04) 60%, rgba(0,0,0,.2) 100%); }
.sp-panel-right img {
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35), 0 2px 10px rgba(0, 0, 0, .25);
  object-fit: contain;
  transition: transform .55s var(--ease);
}
.sp-panel.is-active .sp-panel-right img { transform: scale(1); }
.sp-panel:not(.is-active) .sp-panel-right img { transform: scale(.985); }

@media (max-width: 960px) {
  .sp-tabs { grid-template-columns: 1fr; }
  .sp-panel-inner { grid-template-columns: 1fr; min-height: 0; }
  .sp-panel-left { padding: 28px 24px; border-right: 0; border-bottom: 1px solid var(--border); }
  .sp-panel-right { padding: 22px; }
  .sp-panel-right img { max-height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .sp-panel { transition: opacity .15s ease; }
  .sp-tab.is-active .sp-tab-progress-bar { animation: none; width: 100%; }
}
.steps-foot a { color: var(--accent-hi); text-decoration: none; font-weight: 500; }
.steps-foot a:hover { border-bottom: 1px solid var(--accent-hi); }

@media (max-width: 960px) {
  .steps-list { grid-template-columns: 1fr; max-width: 600px; margin: 0 auto; gap: 28px; }
  .step-item { padding: 48px 22px 22px; }
}
@media (max-width: 620px) {
  .steps-main { padding: 28px 20px 40px; gap: 30px; }
  .step-item { padding: 44px 18px 20px; }
  .step-num { width: 40px; height: 40px; font-size: 1rem; top: -20px; left: 18px; }
  .step-title { font-size: 1rem; }
  .step-desc { font-size: .84rem; }
}
body.page-admin .topbar {
  padding-left: max(32px, calc((100% - 1280px) / 2 + 32px));
  padding-right: max(32px, calc((100% - 1280px) / 2 + 32px));
}
body.page-grades-admin .topbar {
  padding-left: max(24px, calc((100% - 1440px) / 2 + 24px));
  padding-right: max(24px, calc((100% - 1440px) / 2 + 24px));
}
body.page-users .topbar {
  padding-left: max(24px, calc((100% - 1200px) / 2 + 24px));
  padding-right: max(24px, calc((100% - 1200px) / 2 + 24px));
}

/* ============ PAGINA UTILIZATORI (admin) ============ */
body.page-users { height: auto; overflow: auto; }
.users-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: flex; flex-direction: column; gap: 18px;
}

/* Adauga student — buton icon-only compact cu pictograma user-plus */
.btn-add-user {
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #0A1214;
  border: 0;
  cursor: pointer;
  transition: all .15s var(--ease);
  box-shadow: 0 0 0 0 rgba(123,181,173,0);
}
.btn-add-user:hover {
  background: var(--accent-hi);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(123,181,173,.3);
}
.btn-add-user:active { transform: translateY(0) scale(.97); }
.btn-add-user svg { color: #0A1214; flex-shrink: 0; }

/* Buton bulk: trimite coduri */
.btn-creds-bulk {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 14px;
  height: 40px;
  background: rgba(123,181,173,.08);
  color: var(--accent-hi);
  border: 1px solid rgba(123,181,173,.32);
  border-radius: 10px;
  font-size: .82rem; font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -.005em;
  transition: all .15s var(--ease);
}
.btn-creds-bulk:hover {
  background: rgba(123,181,173,.16);
  border-color: var(--accent);
  color: var(--accent-hi);
  transform: translateY(-1px);
}
.btn-creds-bulk:active { transform: translateY(0) scale(.97); }
.btn-creds-bulk:disabled { opacity: .55; cursor: wait; }
.btn-creds-bulk svg { flex-shrink: 0; }

/* Link discret „Rezultate TM" sub lede din admin.php — accent teal subtle,
   nu compete cu butoanele topbar dar suficient de prezent. */
.btn-tm-link {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 10px;
  padding: 5px 11px;
  background: rgba(123,181,173,.08);
  color: var(--accent-hi);
  border: 1px solid rgba(123,181,173,.28);
  border-radius: 8px;
  font-size: .76rem; font-weight: 600;
  letter-spacing: -.003em;
  text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.btn-tm-link:hover {
  background: rgba(123,181,173,.16);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.btn-tm-link:active { transform: translateY(0) scale(.97); }
.btn-tm-link svg { flex-shrink: 0; }

/* Buton mail per row — dimensiune unificată cu edit/del pentru aliniere */
.ut-creds {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  border-radius: 8px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted-2);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.ut-creds:hover {
  background: rgba(123,181,173,.10);
  border-color: var(--accent);
  color: var(--accent-hi);
}
.ut-creds.is-sent {
  background: rgba(123,181,173,.12);
  border-color: rgba(123,181,173,.45);
  color: var(--accent-hi);
}
.ut-creds.is-sent:hover {
  background: rgba(123,181,173,.20);
  border-color: var(--accent);
}
.ut-creds:disabled { opacity: .6; cursor: wait; }

/* Stats inline discret — un rand langa butonul Adauga */
.users-stats-inline {
  display: inline-flex; align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-family: var(--f-mono);
}
.usi {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-size: .7rem;
  color: var(--muted);
  letter-spacing: .04em;
}
.usi b {
  font-size: .9rem; font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.usi i {
  font-style: normal;
  font-size: .64rem;
  color: var(--muted-2);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.usi-total b        { color: var(--accent-hi); }
.usi-chimie b       { color: #F2A070; }
.usi-fizica b       { color: var(--accent-hi); }
.usi-matematica b   { color: #B79BE0; }
.usi-volume b       { color: #F7B955; }
.usi-sep {
  width: 1px; height: 14px;
  background: var(--border);
}
@media (max-width: 560px) {
  .users-stats-inline { gap: 8px; padding: 5px 10px; }
  .usi i { display: none; }
}

/* Toolbar — search + filter + count */
.users-toolbar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.users-search { flex: 1; min-width: 240px; }
.users-count {
  font-size: .76rem;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  margin-left: auto;
}
.users-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.users-tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
  table-layout: fixed;
}
/* Latimi fixe pe coloane — nu se mai modifica la filtrare */
.users-tbl col.col-id    { width: 38px; }
.users-tbl col.col-name  { width: auto; }
.users-tbl col.col-email { width: 22%; }
.users-tbl col.col-code  { width: 138px; }
.users-tbl col.col-activ { width: 230px; }
.users-tbl col.col-act   { width: 122px; }
.users-tbl thead th {
  padding: 13px 16px;
  text-align: left;
  font-size: .68rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 2;
}
.users-tbl thead th.ut-act { text-align: center; padding-left: 0; padding-right: 0; }
.users-tbl thead th.ut-mat,
.users-tbl thead th.ut-spec { text-align: center; }
.users-tbl tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--fg);
}
.users-tbl tbody td.ut-mat,
.users-tbl tbody td.ut-spec { text-align: center; }
.users-tbl tbody tr:last-child td { border-bottom: 0; }
.users-tbl tbody tr:hover td { background: rgba(123,181,173,.04); }

.ut-id { color: var(--muted-2); font-variant-numeric: tabular-nums; font-size: .82rem; }
.ut-name { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ut-avatar {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  font-family: var(--f-mono);
  font-size: .74rem; font-weight: 700;
  letter-spacing: .04em;
  border: 1px solid var(--border);
}
.ut-avatar-chimie     { background: rgba(242,160,112,.14); color: #F2A070; border-color: rgba(242,160,112,.35); }
.ut-avatar-fizica     { background: rgba(123,181,173,.14); color: var(--accent-hi); border-color: rgba(123,181,173,.35); }
.ut-avatar-matematica { background: rgba(183,155,224,.12); color: #B79BE0; border-color: rgba(183,155,224,.3); }
.ut-name-text { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.ut-nume { font-weight: 600; color: var(--fg); line-height: 1.2; white-space: nowrap; }
.ut-master {
  font-size: .72rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}
.ut-email { min-width: 220px; }
.ut-email a { color: var(--accent-hi); text-decoration: none; }
.ut-email a:hover { text-decoration: underline; }
.ut-mat { width: 50px; text-align: center; }
.ut-mat-badge {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 8px;
  font-family: var(--f-mono); font-size: .76rem; font-weight: 700;
  border: 1px solid var(--border);
}
.ut-mat-chimie     { background: rgba(242,160,112,.16); color: #F2A070; border-color: rgba(242,160,112,.45); }
.ut-mat-fizica     { background: rgba(123,181,173,.14); color: var(--accent-hi); border-color: rgba(123,181,173,.4); }
.ut-mat-matematica { background: rgba(183,155,224,.14); color: #B79BE0; border-color: rgba(183,155,224,.4); }
.ut-spec { width: 80px; }
.ut-spec-badge {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--f-mono); font-size: .72rem; font-weight: 700;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  letter-spacing: .04em;
}
.ut-code { width: 160px; white-space: nowrap; }
.ut-code-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  font-family: var(--f-mono); font-size: .78rem; font-weight: 700;
  color: var(--accent-hi);
  background: rgba(123,181,173,.08);
  border: 1px solid rgba(123,181,173,.2);
  border-radius: 8px;
  letter-spacing: .08em;
  cursor: pointer;
  transition: all .12s var(--ease);
}
.ut-code-pill:hover {
  background: rgba(123,181,173,.16);
  border-color: var(--accent);
  color: var(--accent-hi);
}
.ut-code-pill:active { transform: scale(.97); }
.ut-code-pill.is-copied {
  background: rgba(123,181,173,.22);
  border-color: var(--accent-hi);
}
.ut-code-pill svg { opacity: .7; flex-shrink: 0; }
.ut-code-pill:hover svg { opacity: 1; }
.ut-code-val { background: none; border: 0; padding: 0; }
.ut-act {
  white-space: nowrap;
  padding-left: 6px !important;
  padding-right: 12px !important;
}
/* Flex container — toate butoanele aliniate uniform (gap consistent, nu margin-left) */
.ut-act-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
.ut-edit,
.ut-del {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted-2);
  cursor: pointer;
  transition: all .12s var(--ease);
  vertical-align: middle;
}
.ut-edit:hover {
  color: var(--accent-hi);
  border-color: rgba(123,181,173,.4);
  background: rgba(123,181,173,.1);
}
.ut-del:hover {
  color: var(--danger);
  border-color: rgba(224,110,110,.4);
  background: rgba(224,110,110,.1);
}
.ut-creds:active,
.ut-edit:active,
.ut-del:active { transform: scale(.94); }

/* ===========================================================
   Coloana Activitate — login + upload + dot live cu glow
   =========================================================== */
.users-tbl thead th.ut-activ { padding-left: 12px; padding-right: 12px; }
.users-tbl tbody td.ut-activ { padding: 10px 12px; vertical-align: middle; }
.ut-activ-wrap {
  display: flex; align-items: center; gap: 10px;
  min-width: 0;
}
.ut-activ-rows {
  display: flex; flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}
.ut-activ-row {
  display: flex; align-items: center;
  gap: 6px;
  font-size: .72rem;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
}
.ut-activ-ico {
  flex-shrink: 0;
  color: var(--muted-2);
  opacity: .65;
}
.ut-activ-lbl {
  font-family: var(--f-mono);
  font-size: .62rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
  opacity: .75;
}
.ut-activ-val {
  font-family: var(--f-mono);
  font-size: .72rem;
  color: var(--fg);
  letter-spacing: .01em;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; /* cifre cu lățime egală — fără layout shift */
}

/* Dot live — gri offline, teal cu glow pulsant când online */
.ut-dot {
  flex-shrink: 0;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .15);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
  position: relative;
  transition: background .25s var(--ease);
}
.ut-dot.is-online {
  background: #4ADE80;
  box-shadow:
    0 0 0 0 rgba(74, 222, 128, .55),
    0 0 8px 1px rgba(74, 222, 128, .55),
    inset 0 0 0 1px rgba(255, 255, 255, .25);
  animation: utDotPulse 2.2s ease-in-out infinite;
}
@keyframes utDotPulse {
  0%, 100% {
    box-shadow:
      0 0 0 0 rgba(74, 222, 128, .55),
      0 0 8px 1px rgba(74, 222, 128, .55),
      inset 0 0 0 1px rgba(255, 255, 255, .25);
  }
  50% {
    box-shadow:
      0 0 0 6px rgba(74, 222, 128, 0),
      0 0 14px 3px rgba(74, 222, 128, .65),
      inset 0 0 0 1px rgba(255, 255, 255, .35);
  }
}
@media (prefers-reduced-motion: reduce) {
  .ut-dot.is-online { animation: none; }
}

@media (max-width: 1100px) {
  .users-tbl col.col-activ { width: 140px; }
  .ut-activ-lbl { display: none; }
}

/* Confirm modal (reusable) — pentru stergeri etc. */
.confirm-card {
  width: 100%; max-width: 440px;
  padding: 24px 26px 20px;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  box-sizing: border-box;
  position: relative;
}
.confirm-card-head {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 16px;
}
.confirm-ico {
  flex-shrink: 0;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(224,110,110,.14);
  color: #E87878;
  border: 1px solid rgba(224,110,110,.35);
}
.confirm-text h3 {
  margin: 0 0 4px;
  font-size: 1.02rem; font-weight: 600;
  color: var(--fg);
  letter-spacing: -.01em;
}
.confirm-text p {
  margin: 0;
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.5;
}
.confirm-text b { color: var(--fg); font-weight: 600; }
.confirm-actions {
  display: flex; justify-content: flex-end; gap: 8px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.confirm-actions .btn { padding: 9px 18px; }

/* Variantă COMPACT — confirmari minore (stergere mesaj chat etc.) */
.m-modal.confirm-compact .m-modal-backdrop {
  background: rgba(10,18,20,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.m-modal.confirm-compact .confirm-card {
  width: min(360px, calc(100vw - 32px));
  max-width: 360px;
  padding: 18px 20px 16px;
  border-radius: 14px;
  box-shadow: 0 16px 48px rgba(0,0,0,.55);
}
.m-modal.confirm-compact .confirm-ico {
  width: 32px; height: 32px;
  border-radius: 8px;
}
.m-modal.confirm-compact .confirm-ico svg { width: 16px; height: 16px; }
.m-modal.confirm-compact .confirm-card-head {
  gap: 12px;
  margin-bottom: 14px;
  align-items: center;
}
.m-modal.confirm-compact .confirm-text h3 {
  font-size: .96rem;
  margin: 0;
  font-weight: 600;
  letter-spacing: -.005em;
}
.m-modal.confirm-compact .confirm-text p {
  font-size: .82rem;
  line-height: 1.45;
  color: var(--muted);
  margin: 4px 0 0;
}
.m-modal.confirm-compact .confirm-text p:empty {
  display: none;
}
.m-modal.confirm-compact .confirm-actions {
  padding-top: 12px;
  border-top: 0;
  gap: 8px;
  justify-content: flex-end;
}
.m-modal.confirm-compact .confirm-actions .btn {
  padding: 8px 16px;
  font-size: .85rem;
  border-radius: 8px;
  font-weight: 600;
  min-width: 80px;
}
.btn-danger {
  background: rgba(224,110,110,.14);
  color: #E87878;
  border: 1px solid rgba(224,110,110,.45);
  font-weight: 600;
}
.btn-danger:hover {
  background: #E07A82;
  color: #FFF;
  border-color: #E07A82;
}

/* Leading glyph (× ✓ → + …) în butoane — separat de text cu margin-right
   ca să nu se lipească vizual. Renderat din showConfirm() când label-ul
   are forma „× Șterge" / „✓ OK" / „→ Continuă" etc. */
.btn-leading-glyph {
  display: inline-block;
  margin-right: 6px;
  font-weight: 400;
  opacity: .92;
  /* Glif-ul × specific are bearing tight in multe fonturi — bumpăm un pic */
  transform: translateY(-0.5px);
}

.users-empty:not([hidden]) {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.users-empty[hidden] { display: none !important; }
.users-no-match[hidden] { display: none !important; }

/* Upload zone blocata — stare discreta cu CTA catre chat */
.upload-zone-locked {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 32px 26px;
  background: rgba(224,122,130,.06);
  border: 1px solid rgba(224,122,130,.28);
  border-radius: var(--radius-lg);
  text-align: center;
}
.dz-lock-badge {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(224,122,130,.14);
  color: #E87878;
  border: 1px solid rgba(224,122,130,.35);
  margin-bottom: 2px;
}
.upload-zone-locked h2 {
  margin: 0;
  font-size: 1.05rem; font-weight: 600;
  color: var(--fg);
  letter-spacing: -.01em;
}
.dz-lock-msg {
  max-width: 400px;
  margin: 0;
  font-size: .86rem;
  color: var(--muted);
  line-height: 1.5;
}
.dz-lock-msg b { color: var(--fg); font-weight: 600; }
.dz-lock-hint {
  margin: 4px 0 0;
  font-size: .8rem;
  color: var(--muted-2);
  font-style: italic;
}
.dz-lock-actions { margin-top: 12px; }
.dz-lock-actions .btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px;
}
.dz-lock-actions .btn svg { color: #0A1214; }

/* Buton delete dezactivat cand upload-ul e inchis */
.icon-btn-locked {
  opacity: .5;
  cursor: not-allowed;
  color: var(--muted-2);
  background: transparent;
  border: 1px solid var(--border);
}
.icon-btn-locked:hover { transform: none; color: var(--muted-2); }
.users-empty svg { color: var(--muted-2); margin-bottom: 4px; }
.users-empty h3 {
  margin: 0;
  font-size: .98rem; font-weight: 600;
  color: var(--fg);
  letter-spacing: -.01em;
}
.users-empty p { margin: 0; font-size: .84rem; color: var(--muted); }
.users-empty b { color: var(--accent-hi); font-weight: 600; }
.users-no-match {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: .86rem;
}

/* Modal adauga student */
.add-user-card {
  width: 100%; max-width: 620px;
  padding: 26px 28px 22px;
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 16px;
  box-sizing: border-box;
}
.add-user-head h2 {
  font-size: 1.15rem; font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -.01em;
}
.add-user-head p {
  font-size: .82rem;
  color: var(--muted);
  margin: 0 0 20px;
}
.auf-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 12px 14px;
}
.auf-fld-full { grid-column: 1 / -1; }
.auf-fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.auf-fld > span {
  font-size: .66rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.auf-fld input,
.auf-fld select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font: inherit; font-size: .9rem;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  transition: border-color .12s var(--ease);
  box-sizing: border-box;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.auf-fld input:focus,
.auf-fld select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(123,181,173,.06);
}
.auf-fld select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%238898A0' stroke-width='2.2' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.auf-fld select option {
  background: var(--bg);
  color: var(--fg);
  padding: 4px;
}

/* Custom select — stylizat in tema site-ului (dark/teal) pt a inlocui nativul */
.c-select { position: relative; }
.c-select-native {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: -1;
}
.c-select-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  font: inherit; font-size: .9rem;
  cursor: pointer;
  text-align: left;
  transition: border-color .12s var(--ease), background .12s var(--ease);
}
.c-select-btn:hover { border-color: var(--border-hi); }
.c-select-btn[aria-expanded="true"] {
  border-color: var(--accent);
  background: rgba(123,181,173,.06);
}
.c-select-lbl {
  flex: 1; min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--fg);
}
.c-select-lbl:empty::before {
  content: 'Alege...';
  color: var(--muted-2);
}
.c-select-chev {
  color: var(--muted);
  flex-shrink: 0;
  transition: transform .2s var(--ease), color .15s var(--ease);
}
.c-select-btn[aria-expanded="true"] .c-select-chev {
  transform: rotate(180deg);
  color: var(--accent-hi);
}
.c-select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0; right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(14, 24, 27, 0.98);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0,0,0,.4), 0 2px 10px rgba(0,0,0,.25);
  z-index: 50;
  scrollbar-width: thin;
  scrollbar-color: rgba(123,181,173,.2) transparent;
  /* origin-aware: select-menu cade direct sub trigger (full-width) */
  transform-origin: top center;
  animation: hero-sort-pop .16s var(--ease);
}
.c-select-menu::-webkit-scrollbar { width: 4px; }
.c-select-menu::-webkit-scrollbar-thumb { background: rgba(123,181,173,.25); border-radius: 4px; }
.c-select-menu[hidden] { display: none; }
.c-select-menu li {
  padding: 8px 12px;
  font-size: .84rem;
  color: var(--fg);
  cursor: pointer;
  border-radius: 6px;
  transition: background .1s var(--ease), color .1s var(--ease);
  display: flex; align-items: center; gap: 8px;
  white-space: normal;
  line-height: 1.35;
}
.c-select-menu li:hover {
  background: rgba(123,181,173,.14);
  color: var(--accent-hi);
}
.c-select-menu li.is-on {
  background: rgba(123,181,173,.18);
  color: var(--accent-hi);
  font-weight: 600;
}
.c-select-menu li.is-on::before {
  content: '';
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent-hi);
  flex-shrink: 0;
}
.c-select-menu li:not(.is-on)::before {
  content: '';
  width: 4px; flex-shrink: 0;
}

.auf-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.auf-actions .btn {
  min-width: 130px;
  padding: 10px 18px;
  justify-content: center;
}
.auf-actions .btn-accent {
  min-width: 200px;
  font-weight: 600;
}
.auf-edit-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: .76rem;
  color: var(--muted-2);
  font-style: italic;
}

.auf-success[hidden] { display: none !important; }
.auf-success:not([hidden]) {
  padding: 20px 0 0;
  display: flex; flex-direction: column; gap: 14px;
  align-items: center;
  text-align: center;
}
.auf-success h3 {
  color: var(--accent-hi);
  font-size: 1.1rem; font-weight: 600;
  margin: 0;
}
.auf-success p { margin: 0; font-size: .86rem; color: var(--muted); }
.auf-code-box {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  background: rgba(123,181,173,.1);
  border: 1px solid rgba(123,181,173,.35);
  border-radius: 12px;
}
.auf-code-box code {
  font-family: var(--f-mono);
  font-size: 1.4rem; font-weight: 700;
  letter-spacing: .18em;
  color: var(--accent-hi);
}

@media (max-width: 600px) {
  .auf-grid { grid-template-columns: 1fr; }
  .ut-email { min-width: 140px; word-break: break-all; }
}

/* ============ IAB Banner (suspiciune conținut IA) ============ */
.iab-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(224, 110, 110, 0.14), rgba(224, 110, 110, 0.06));
  border: 1px solid rgba(224, 110, 110, 0.4);
  border-left: 3px solid #E06E6E;
  border-radius: 12px;
  color: #F4D9D9;
}
.iab-banner-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(224, 110, 110, 0.18);
  color: #E06E6E;
}
.iab-banner-body { flex: 1; min-width: 0; }
.iab-banner-body h3 {
  margin: 0 0 4px;
  font-size: .92rem; font-weight: 600;
  color: #F4D9D9;
  letter-spacing: -.01em;
}
.iab-banner-body p {
  margin: 0;
  font-size: .84rem;
  line-height: 1.5;
  color: rgba(244, 217, 217, 0.85);
}
.iab-banner-body b { color: #F4D9D9; font-weight: 600; }

/* PV Banner (Portofoliu nevalidat) — amber, distinct vizual de IAB (rosu) */
.pv-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(247, 185, 85, 0.14), rgba(247, 185, 85, 0.06));
  border: 1px solid rgba(247, 185, 85, 0.4);
  border-left: 3px solid #F7B955;
  border-radius: 12px;
  color: #F3E2B8;
}
.pv-banner-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(247, 185, 85, 0.18);
  color: #F7B955;
}
.pv-banner-body { flex: 1; min-width: 0; }
.pv-banner-body h3 {
  margin: 0 0 4px;
  font-size: .92rem; font-weight: 600;
  color: #F3E2B8;
  letter-spacing: -.01em;
}
.pv-banner-body p {
  margin: 0;
  font-size: .84rem;
  line-height: 1.5;
  color: rgba(243, 226, 184, 0.9);
}
.pv-banner-body b { color: #F3E2B8; font-weight: 600; }
.pv-banner-body a {
  color: #F7B955;
  text-decoration: none;
  border-bottom: 1px dashed rgba(247,185,85,.5);
  font-weight: 600;
}
.pv-banner-body a:hover { border-bottom-style: solid; }

/* Banner "Nu ești integralist" — același stil cu .iab-banner dar culoare violet (status, nu warning) */
.int-banner {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(183, 155, 224, 0.16), rgba(183, 155, 224, 0.06));
  border: 1px solid rgba(183, 155, 224, 0.45);
  border-left: 3px solid #B79BE0;
  border-radius: 12px;
  color: #E1D6F2;
}
.int-banner-icon {
  flex-shrink: 0;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(183, 155, 224, 0.20);
  color: #B79BE0;
}
.int-banner-body { flex: 1; min-width: 0; }
.int-banner-body h3 {
  margin: 0 0 4px;
  font-size: .92rem; font-weight: 600;
  color: #E1D6F2;
  letter-spacing: -.01em;
}
.int-banner-body p {
  margin: 0;
  font-size: .84rem;
  line-height: 1.5;
  color: rgba(225, 214, 242, .9);
}
.int-banner-body b { color: #F0E8FA; font-weight: 600; }

/* Broadcast banners — anunțuri portal de la admin (in-page) — același container ca .dash */
.bc-banners {
  display: flex; flex-direction: column;
  gap: 10px;
  max-width: 1100px;
  width: 100%;
  margin: 14px auto 4px;       /* top margin: 14px ≈ 3.7mm — nu mai e lipit de topbar */
  padding: 0 32px;             /* identic cu .dash padding orizontal */
  box-sizing: border-box;
}
.bc-banner {
  display: flex; align-items: flex-start;
  gap: 14px;
  padding: 16px 20px;          /* identic cu iab/pv */
  background: linear-gradient(135deg, rgba(123, 181, 173, 0.20), rgba(123, 181, 173, 0.08));
  border: 1px solid rgba(123, 181, 173, 0.5);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  color: #DAEDE9;
  font-size: .88rem;
  line-height: 1.55;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity .42s var(--ease), transform .42s var(--ease);
}
.bc-banner:nth-child(2) { transition-delay: 60ms; }
.bc-banner:nth-child(3) { transition-delay: 120ms; }
.bc-banner:nth-child(4) { transition-delay: 180ms; }
.bc-banner:nth-child(n+5) { transition-delay: 220ms; }
@starting-style {
  .bc-banner {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
}
.bc-banner-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(123, 181, 173, 0.18);
  color: var(--accent-hi);
}
.bc-banner-body { flex: 1; min-width: 0; }
@media (max-width: 720px) {
  .bc-banners { padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .bc-banner {
    transition: opacity .2s ease;
  }
  @starting-style {
    .bc-banner { opacity: 0; transform: none; }
  }
}

/* PV success — același banner, doar culorile/icon/text se schimbă (.is-success modifier) */
.pv-banner.is-success {
  background: linear-gradient(135deg, rgba(123, 181, 173, 0.18), rgba(123, 181, 173, 0.06));
  border-color: rgba(123, 181, 173, 0.5);
  border-left-color: var(--accent);
  color: #DAEDE9;
}
.pv-banner.is-success .pv-banner-icon {
  background: rgba(123, 181, 173, 0.22);
  color: var(--accent-hi);
}
.pv-banner.is-success .pv-banner-body h3 { color: var(--accent-hi); }
.pv-banner.is-success .pv-banner-body p {
  color: rgba(218, 237, 233, 0.95);
}
.pv-banner.is-success .pv-banner-body b { color: #EAF6F3; }
.pv-banner.is-success .pv-banner-body a {
  color: var(--accent-hi);
  border-bottom-color: rgba(123, 181, 173, 0.5);
}
.pv-banner-quote {
  margin: 8px 0 0 !important;
  padding-left: 12px;
  border-left: 2px solid rgba(123, 181, 173, 0.45);
  font-style: italic;
  font-size: .82rem !important;
  color: rgba(218, 237, 233, 0.82) !important;
}
.pv-banner-quote-author {
  display: block;
  margin-top: 4px;
  font-size: .7rem;
  font-style: normal;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-hi);
  font-weight: 600;
}

/* IAB activ → PV blocat (vizual neutru, fără overlay) */
.sm-pv.is-iab-locked { cursor: not-allowed; }
.sm-pv.is-iab-locked .toggle-container { cursor: not-allowed; }

.badge-subj {
  font-size: .68rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--border);
}

.user-chip {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0;
  max-width: 240px;
  min-width: 0;
  background: none; border: 0;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  color: var(--accent);
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 600;
  flex-shrink: 0;
}
.user-name {
  font-size: .88rem; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0; max-width: 200px;
}

/* ============ DASHBOARD ============ */
.dash, .admin {
  padding: 32px 32px 36px;
  max-width: 1100px;
  margin: 0 auto;
}
.dash > section, .admin > section { margin-bottom: 24px; }
.dash > section:last-child, .admin > section:last-child { margin-bottom: 0; }

/* Hero comun — folosit în admin.php, admin_grades.php, dashboard, grades */
.dash-hero, .admin-hero, .grades-hero, .dash-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 20px;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0;
}
.dash-hero .eyebrow, .admin-hero .eyebrow, .grades-hero .eyebrow {
  margin-bottom: .5em;
  font-size: .66rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--accent-hi);
  display: block;
}
.dash-hero h1, .admin-hero h1, .grades-hero h1 {
  font-size: 1.6rem; font-weight: 500;
  margin: 0 0 4px;
  letter-spacing: -.02em;
  line-height: 1.15;
}
.dash-hero .lede, .admin-hero .lede, .grades-hero .lede {
  font-size: .86rem;
  color: var(--muted);
  margin: 0;
}
.dash-stats, .admin-stats { display: flex; gap: 28px; flex-shrink: 0; }
.admin-hero-right {
  display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap;
}

/* Sortare compacta in hero — dropdown custom, complet stilizat */
.hero-sort { position: relative; display: inline-block; }
.hero-sort-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px;
  padding: 0 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg);
  font: inherit; font-size: .8rem; font-weight: 500;
  cursor: pointer;
  transition: all .15s var(--ease);
  white-space: nowrap;
  line-height: 1;
}
.hero-sort-btn:hover { border-color: var(--accent); background: rgba(123,181,173,.08); }
.hero-sort-btn[aria-expanded="true"] { border-color: var(--accent); background: rgba(123,181,173,.12); }
.hero-sort-ico {
  display: inline-grid; place-items: center;
  color: var(--accent-hi);
  flex-shrink: 0;
}
.hero-sort-lbl { color: var(--fg); }
.hero-sort-chev {
  color: var(--muted);
  transition: transform .2s var(--ease);
  flex-shrink: 0;
}
.hero-sort-btn[aria-expanded="true"] .hero-sort-chev { transform: rotate(180deg); color: var(--accent-hi); }

.hero-sort-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 220px;
  margin: 0; padding: 4px;
  list-style: none;
  background: rgba(14, 24, 27, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 2px 8px rgba(0,0,0,.2);
  z-index: 40;
  display: flex; flex-direction: column; gap: 1px;
  /* origin-aware: popover-ul iese de sub trigger-ul din dreapta-sus */
  transform-origin: top right;
  animation: hero-sort-pop .18s var(--ease);
}
.hero-sort-menu[hidden] { display: none; }
@keyframes hero-sort-pop {
  from { opacity: 0; transform: translateY(-4px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.hero-sort-menu li {
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--fg);
  font-size: .82rem;
  cursor: pointer;
  transition: background .1s var(--ease), color .1s var(--ease);
  display: flex; align-items: center; gap: 8px;
}
.hero-sort-menu li:hover {
  background: rgba(123,181,173,.14);
  color: var(--accent-hi);
}
.hero-sort-menu li.is-on {
  background: rgba(123,181,173,.18);
  color: var(--accent-hi);
  font-weight: 600;
}
.hero-sort-menu li.is-on::before {
  content: '';
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent-hi);
  flex-shrink: 0;
}
.hero-sort-menu li:not(.is-on)::before {
  content: '';
  width: 4px; height: 4px;
  flex-shrink: 0;
}

.stat {
  min-width: 0;
  padding: 0;
  background: none;
  border: 0;
  text-align: left;
}
.stat-val { display: block; font-size: 1.3rem; font-weight: 500; letter-spacing: -.02em; color: var(--fg); }
.stat-lbl { display: block; font-size: .72rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; margin-top: 2px; }

/* Dropzone — zona ampla de primire fisiere */
.upload-zone {
  padding: 40px 40px;
  min-height: 180px;
  text-align: center;
  border: 1px dashed var(--border-hi);
  background: var(--bg-2);
  border-radius: var(--radius);
  transition: border-color .2s var(--ease), background .2s var(--ease);
  display: flex; flex-direction: column; justify-content: center; align-items: center;
}
.upload-zone form { width: 100%; max-width: 720px; }
.upload-zone.is-drag { border-color: var(--accent); background: var(--surface); }
.upload-zone h2 { font-size: 1.02rem; font-weight: 500; margin: 0 0 4px; }
.upload-zone p { color: var(--muted); font-size: .88rem; margin: 0 0 4px; }
.dz-visual, .dz-ring, .dz-ring-inner { display: none; }
.dz-rules { font-size: .78rem; color: var(--muted-2); margin-top: 6px !important; }
.dz-actions { margin-top: 18px !important; }

.link-btn {
  color: var(--accent); cursor: pointer;
  border-bottom: 1px dotted currentColor;
  padding-bottom: 1px;
}

.dz-list {
  list-style: none; padding: 0; margin: 22px auto 0;
  max-width: 520px; text-align: left;
  display: flex; flex-direction: column; gap: 6px;
}
.dz-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .88rem;
}
.dz-list .file-ico {
  width: 36px; height: 24px;
  display: grid; place-items: center;
  color: var(--muted);
  font-family: var(--f-mono);
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .08em;
  background: var(--surface-hi);
  border-radius: 4px;
  flex-shrink: 0;
}
.dz-list .file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-list .file-size { color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.dz-list .file-rm {
  background: none; border: 0;
  color: var(--muted-2); cursor: pointer;
  padding: 4px;
  line-height: 0;
}
.dz-list .file-rm:hover { color: var(--danger); }

.dz-progress {
  margin: 18px auto 0; max-width: 520px;
  display: flex; align-items: center; gap: 12px;
}
.dz-progress-bar { flex: 1; height: 2px; background: var(--border-hi); border-radius: 2px; overflow: hidden; }
.dz-progress-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s var(--ease); }
#progressLabel { font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--muted); min-width: 36px; text-align: right; }

.dz-actions { margin-top: 22px; display: flex; gap: 10px; justify-content: center; }

/* Files table */
.files-card {
  padding: 0;
  background: none;
  border: 0;
}
.files-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; padding: 0 4px; }
.files-head h2 { font-size: .9rem; font-weight: 600; letter-spacing: -.01em; }
.files-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  border-top: 1px solid var(--border);
}
.files-table th {
  text-align: left;
  font-weight: 500;
  padding: 10px 6px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  text-transform: none;
  font-size: .78rem;
  letter-spacing: 0;
}
.files-table td {
  padding: 14px 6px;
  border-bottom: 1px solid var(--border);
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}
.files-table tr:last-child td { border-bottom: 0; }
.files-table tr:hover td { background: rgba(255,255,255,.015); }
.files-table .fn { font-weight: 400; color: var(--fg); font-variant-numeric: normal; }
.row-act { text-align: right; white-space: nowrap; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
  margin-left: 4px;
  text-decoration: none;
}
.icon-btn:hover { color: var(--fg); border-color: var(--border-hi); }
.icon-btn-danger:hover { color: var(--danger); border-color: rgba(224,122,130,.5); }

.empty {
  text-align: center; padding: 20px 16px;
  color: var(--muted-2);
  font-size: .86rem;
}
.empty p { margin: 0; }
.empty svg { display: none; }

/* ============ ADMIN ============ */
.admin { max-width: 1280px; }
.admin > section { margin-bottom: 28px; }

/* -- Filtre ca sidebar fixed la marginea dreapta a ferestrei -- */
body.page-admin { padding-right: 240px; }
@media (max-width: 900px) { body.page-admin { padding-right: 0; } }

.admin-filters {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: 240px;
  display: flex; flex-direction: column;
  gap: 22px;
  padding: 32px 22px;
  background: rgba(14, 24, 27, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  z-index: 50;
  scrollbar-width: thin;
}
.admin-filters::-webkit-scrollbar { width: 4px; }
.admin-filters::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 2px; }

.admin-filters > .f-section {
  display: flex; flex-direction: column; gap: 10px;
}
.admin-filters .f-label {
  font-size: .66rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted-2);
}

/* #f-search stilizat via .hero-search input (regula comuna) */

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: .78rem; font-weight: 500;
  padding: 5px 12px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.chip:hover { color: var(--fg); border-color: var(--border-hi); }
.chip.is-on {
  background: var(--accent);
  color: #0A1214;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(123,181,173,.22);
}

/* Chip-uri cu inițiale — pătrate, compacte, mai vizibile */
.chip-row-initials { gap: 8px; }
.chip-ini {
  width: 32px; height: 32px;
  padding: 0;
  display: inline-grid; place-items: center;
  font-family: var(--f-mono);
  font-size: .82rem; font-weight: 700;
  letter-spacing: .04em;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  border: 1px solid var(--border);
}
.chip-ini:hover {
  color: var(--accent-hi);
  border-color: var(--accent);
  background: rgba(123,181,173,.1);
}
.chip-ini.is-on {
  background: var(--accent);
  color: #0A1214;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(123,181,173,.25);
}

/* Chip abbrev (2-4 litere) — inaltime fixa, latime auto */
.chip-abbr {
  height: 30px;
  min-width: 30px;
  padding: 0 10px;
  display: inline-grid; place-items: center;
  font-family: var(--f-mono);
  font-size: .74rem; font-weight: 700;
  letter-spacing: .06em;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.chip-abbr[hidden] { display: none; }
.chip-abbr:hover {
  color: var(--accent-hi);
  border-color: var(--accent);
  background: rgba(123,181,173,.1);
}
.chip-abbr.is-on {
  background: var(--accent);
  color: #0A1214;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(123,181,173,.22);
}

.field-inline { display: flex; flex-direction: column; gap: 4px; }
.field-inline > span { display: none; } /* label vine din f-label */
.field-inline > select {
  width: 100%;
  font: inherit; font-size: .84rem;
  padding: 8px 22px 8px 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%2394A4A6' d='M5 6L0 0h10z'/%3E%3C/svg%3E") no-repeat right 2px center;
  color: var(--fg);
  border: 0;
  border-bottom: 1px solid var(--border-hi);
  border-radius: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.field-inline > select:focus { outline: none; border-bottom-color: var(--accent); }
.field-inline > select option { background: var(--bg-2); color: var(--fg); }

.filter-result {
  margin-top: auto;
  font-size: .74rem;
  color: var(--muted-2);
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.filter-result[hidden] { display: none; }

/* Bilețele + Ghid evaluare — link-uri la final in sidebar */
.f-biletele {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  background: rgba(123,181,173,.06);
  border: 1px solid rgba(123,181,173,.22);
  border-radius: 10px;
  color: var(--accent-hi);
  font-size: .82rem; font-weight: 500;
  text-decoration: none;
  transition: all .15s var(--ease);
  letter-spacing: -.01em;
}
/* Primul din stackul bottom primeste push-ul (flex gap mai mic intre ele) */
.admin-filters > .f-biletele:first-of-type { margin-top: auto; }
.admin-filters > .f-biletele + .f-biletele { margin-top: -14px; }
.f-biletele:hover {
  background: rgba(123,181,173,.14);
  border-color: var(--accent);
  color: var(--accent-hi);
  transform: translateY(-1px);
}
.f-biletele svg { color: var(--accent-hi); flex-shrink: 0; }
.f-biletele span { flex: 1; }
.f-biletele-ext { opacity: .6; }
.f-biletele:hover .f-biletele-ext { opacity: 1; }

/* -- Grid de carduri -- */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
}
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border-hi);
  border-radius: 14px;
}

.s-card {
  position: relative;
  padding: 20px 22px 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
  min-height: 210px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
/* Accent bar stanga tinted per materie — consistenta cu users stats */
.s-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.s-card[data-subj="Chimie"]::before     { background: #F2A070; }
.s-card[data-subj="Fizica"]::before     { background: var(--accent-hi); }
.s-card[data-subj="Matematica"]::before { background: #B79BE0; }
.s-card:hover::before { opacity: 1; }
.s-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}
/* Sidebar Restrictii - lock-uri per materie (sus, in admin-filters) */
.f-restr { display: flex; flex-direction: column; gap: 4px; }
.f-restr .f-label {
  display: inline-flex; align-items: center; gap: 6px;
  margin-bottom: 4px;
}
.f-restr-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #F7B955;
  box-shadow: 0 0 5px rgba(247,185,85,.7);
  animation: pulse-dot 1.8s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50%      { opacity: .5; }
}
/* Mini-table discret: nume materie + 2 coloane Upload/Eval */
.f-restr-head,
.f-restr-row {
  display: grid;
  grid-template-columns: 1fr 44px 44px;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}
.f-restr-head { padding-bottom: 3px; margin-bottom: 1px; }
.f-restr-col {
  font-size: .58rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted-2);
  text-align: center;
}
.f-restr-mat {
  font-size: .76rem;
  color: var(--fg);
  text-align: left;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Toggle fara label — doar toggle-container centrat in celula */
.f-restr-toggle {
  padding: 3px 0;
  background: transparent;
  border: 0;
  justify-content: center;
  cursor: pointer;
}
.f-restr-toggle .toggle-container { height: 1.3em; }

/* Hero search — in hero, langa stats */
.hero-search {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px;
  padding: 0 12px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 220px;
  transition: border-color .15s var(--ease);
}
.hero-search:focus-within { border-color: var(--accent); background: rgba(123,181,173,.06); }
.hero-search svg { color: var(--muted); flex-shrink: 0; }
.hero-search input {
  flex: 1; min-width: 0;
  font: inherit; font-size: .84rem;
  padding: 0;
  background: transparent;
  border: 0;
  color: var(--fg);
  outline: none;
}
.hero-search input::placeholder { color: var(--muted-2); }
.hero-search-kbd {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--f-mono);
  font-size: .66rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted-2);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 5px;
  line-height: 1.4;
}
.hero-search:focus-within .hero-search-kbd {
  color: var(--accent-hi);
  border-color: rgba(123,181,173,.35);
  background: rgba(123,181,173,.08);
}

/* Notificari mesaje admin — buton bell cu badge si popover */
.notif-wrap { position: relative; display: inline-block; }
.notif-btn {
  position: relative;
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s var(--ease);
  font: inherit;
}
.notif-btn:hover { color: var(--accent-hi); border-color: var(--accent); background: rgba(123,181,173,.08); }
.notif-btn.has-unread { color: var(--accent-hi); border-color: rgba(123,181,173,.5); background: rgba(123,181,173,.12); }
.notif-btn.has-unread svg { color: var(--accent-hi); }
.notif-btn.is-pinging { animation: notif-shake .6s var(--ease); }
@keyframes notif-shake {
  0%,100% { transform: rotate(0); }
  15% { transform: rotate(-8deg); }
  30% { transform: rotate(8deg); }
  45% { transform: rotate(-6deg); }
  60% { transform: rotate(6deg); }
  75% { transform: rotate(-3deg); }
}
.notif-item.is-new {
  animation: notif-slide-in .35s var(--ease);
  background: rgba(123,181,173,.12);
}
@keyframes notif-slide-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.notif-count {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 17px; height: 17px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: #E87878;
  color: #FFF;
  font-size: .62rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg);
  animation: pulse-dot 2.2s infinite;
}
.notif-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 420px; max-width: calc(100vw - 20px);
  max-height: 460px;
  background: rgba(14, 24, 27, 0.97);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border: 1px solid var(--border-hi);
  border-radius: 14px;
  box-shadow: 0 12px 36px rgba(0,0,0,.4), 0 2px 10px rgba(0,0,0,.2);
  z-index: 60;
  overflow: hidden;
  display: flex; flex-direction: column;
  animation: hero-sort-pop .18s var(--ease);
}
.notif-popover[hidden] { display: none; }
.notif-head {
  padding: 12px 16px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: rgba(123,181,173,.04);
}
.notif-head h3 {
  margin: 0;
  font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--accent-hi);
  flex: 1;
}
.notif-head-cnt {
  font-size: .72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}
.notif-clear {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-2);
  font: inherit; font-size: .7rem;
  cursor: pointer;
  transition: all .12s var(--ease);
}
.notif-clear[hidden] { display: none; }
.notif-clear:hover {
  color: var(--danger);
  border-color: rgba(224,122,130,.4);
  background: rgba(224,122,130,.08);
}
.notif-clear:disabled { opacity: .4; cursor: not-allowed; }

/* X pe fiecare item — permanent vizibil (discret), stergere directa fara confirm */
.notif-item { position: relative; }
.notif-item-x {
  position: absolute;
  top: 8px; right: 8px;
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--muted-2);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: scale(.85);
  transition: opacity .15s var(--ease), background .12s var(--ease), color .12s var(--ease), transform .15s var(--ease);
  z-index: 2;
}
.notif-item:hover .notif-item-x { opacity: .75; transform: scale(1); }
.notif-item-x:hover {
  background: rgba(224,122,130,.18);
  color: var(--danger);
  opacity: 1 !important;
}
.notif-list {
  margin: 0; padding: 4px;
  list-style: none;
  overflow-y: auto;
  scrollbar-width: thin;
  flex: 1;
}
.notif-list::-webkit-scrollbar { width: 4px; }
.notif-list::-webkit-scrollbar-thumb { background: rgba(123,181,173,.2); border-radius: 4px; }
.notif-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted-2);
  font-size: .82rem;
}
.notif-item {
  padding: 11px 14px 11px 14px;
  padding-right: 36px; /* spatiu pentru X (top-right) */
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s var(--ease);
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "from    from"
    "preview date";
  column-gap: 12px;
  row-gap: 4px;
}
.notif-item:hover { background: rgba(123,181,173,.1); }
.notif-from {
  grid-area: from;
  font-size: .84rem; font-weight: 600;
  color: var(--fg);
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
}
.notif-mat {
  display: inline-grid; place-items: center;
  width: 18px; height: 18px;
  border-radius: 6px;
  background: rgba(123,181,173,.15);
  border: 1px solid rgba(123,181,173,.3);
  font-family: var(--f-mono);
  font-size: .66rem; font-weight: 700;
  color: var(--accent-hi);
  flex-shrink: 0;
}
.notif-preview {
  grid-area: preview;
  min-width: 0;
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}
.notif-date {
  grid-area: date;
  align-self: end;
  font-size: .65rem;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  white-space: nowrap;
  opacity: .7;
}
.notif-item:hover .notif-date { opacity: 1; }
.s-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-hi);
  background: var(--surface-hi);
}
.s-card:hover .s-name { color: var(--accent-hi); }

.s-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 16px;
  position: relative; z-index: 2;
}
.s-badge {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: .82rem; font-weight: 600;
  color: #fff;
  background: var(--p-color, var(--accent));
  box-shadow: 0 2px 10px rgba(0,0,0,.25);
  flex-shrink: 0;
}
.s-badge[data-subj="Chimie"]     { background: #7BB5AD; color: #0A1214; }
.s-badge[data-subj="Fizica"]     { background: #A9B5D6; color: #0A1214; }
.s-badge[data-subj="Matematica"] { background: #C9B677; color: #0A1214; }

.s-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.s-subj-label {
  font-size: .62rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}
.s-pts-big {
  font-family: var(--f-sans);
  font-size: 1.2rem;
  font-weight: 600;
  color: #F7B955;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.s-pts-big .s-pts-unit {
  font-size: .62rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.s-main {
  position: relative; z-index: 2;
  flex: 1; min-height: 0;
  padding-right: 10px; /* evita suprapunerea cu pattern-ul */
}
.s-name {
  font-size: 1.1rem; font-weight: 700;
  margin: 0 0 2px; line-height: 1.2;
  overflow-wrap: break-word;
  color: #FFFFFF;
  letter-spacing: -.015em;
  transition: color .15s var(--ease);
}
.s-prenume {
  display: block;
  font-weight: 400;
  color: rgba(255,255,255,.72);
  letter-spacing: -.01em;
  font-size: .98rem;
  margin-top: 2px;
}
.s-email {
  font-size: .78rem; color: var(--muted);
  margin: 8px 0 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.s-master {
  font-size: .74rem; color: var(--muted-2);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
}

.s-card-foot {
  display: flex; align-items: center;
  gap: 8px; flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: .72rem;
  position: relative; z-index: 2;
}
.s-tag {
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--muted);
  border: 1px solid var(--border);
  font-family: var(--f-mono);
  font-size: .7rem;
  letter-spacing: .04em;
  font-weight: 600;
}
.s-files { color: var(--muted); font-variant-numeric: tabular-nums; }
.s-last  { color: var(--muted-2); font-variant-numeric: tabular-nums; }
.s-open { display: none; }
.s-card.is-hidden { display: none; }

/* Badges pe focus card */
.badge-subj[data-subj="Chimie"]     { color: #7BB5AD; border-color: rgba(123,181,173,.4); }
.badge-subj[data-subj="Fizica"]     { color: #A9B5D6; border-color: rgba(169,181,214,.4); }
.badge-subj[data-subj="Matematica"] { color: #C9B677; border-color: rgba(201,182,119,.4); }

/* ============ STUDENT MODAL (admin) ============ */
body.is-modal-open { overflow: hidden; }

.s-modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: grid; place-items: center;
  padding: 24px;
}
.s-modal[hidden] { display: none; }

.s-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 10, 11, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .24s var(--ease);
}
.s-modal.is-open .s-modal-backdrop { opacity: 1; }

.s-modal-card {
  position: relative;
  width: min(880px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  transform: scale(.96) translateY(6px);
  opacity: 0;
  transition: transform .24s var(--ease), opacity .24s var(--ease);
  isolation: isolate;
}
.s-modal.is-open .s-modal-card {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.s-modal-topbar {
  position: absolute; top: 14px; right: 14px;
  display: flex; gap: 10px; align-items: center;
  z-index: 5;
}
.s-modal-actions {
  display: flex; flex-direction: row; align-items: center; gap: 8px;
}
.s-modal-score {
  height: 52px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 0 22px;
  background: rgba(247,185,85,.12);
  border: 1px solid rgba(247,185,85,.35);
  border-radius: 999px;
  font-size: 1.32rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  cursor: help;
  box-sizing: border-box;
}
.s-modal-score-val { color: #F7B955; font-weight: 700; font-size: 1.48rem; }
.s-modal.is-fail .s-modal-score-val { color: var(--danger); }
.s-modal-score-max { color: var(--muted); font-size: 1.25rem; }
/* Toate 3 butoanele din topbar-ul modal (Editează / Mesaje / ×) — dimensiuni uniforme */
.s-modal-close,
.s-modal-edit,
.s-modal-msgbtn {
  height: 36px;
  min-height: 36px;
  max-height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s var(--ease);
  box-sizing: border-box;
  line-height: 1;
  font-size: .82rem;
  font-weight: 500;
  gap: 7px;
  padding: 0 16px;
  font-family: inherit;
  vertical-align: middle;
}
.s-modal-close svg,
.s-modal-edit svg,
.s-modal-msgbtn svg {
  width: 15px; height: 15px;
  flex-shrink: 0;
}
.s-modal-close {
  width: 36px;
  min-width: 36px;
  padding: 0;
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}
.s-modal-close:hover { color: var(--fg); border-color: var(--border-hi); }
.s-modal-edit {
  background: rgba(123,181,173,.12);
  border-color: rgba(123,181,173,.4);
  color: var(--accent-hi);
}
.s-modal-edit:hover { background: var(--accent); color: #0A1214; border-color: var(--accent); }
@media (max-width: 520px) {
  .s-modal-edit span,
  .s-modal-msgbtn span:not(.s-modal-msgbtn-cnt) { display: none; }
  .s-modal-edit,
  .s-modal-msgbtn { width: 36px; min-width: 36px; padding: 0; gap: 0; }
}

.s-modal-blob {
  position: absolute; z-index: 1;
  top: 50%; left: 50%;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .4;
  filter: blur(36px);
  animation: smBlob 16s ease-in-out infinite;
  transition: background .4s var(--ease);
}
.s-modal.is-fail .s-modal-blob { background: var(--danger); }
/* Translate-uri mari ca bila sa ajunga spre colturile cardului lat */
@keyframes smBlob {
  0%, 100% { transform: translate(-150%, -150%); }  /* colt stanga-sus */
  25%      { transform: translate( 50%, -150%); }   /* colt dreapta-sus */
  50%      { transform: translate( 50%,  50%); }    /* colt dreapta-jos */
  75%      { transform: translate(-150%,  50%); }   /* colt stanga-jos */
}

.s-modal-body {
  position: relative;
  z-index: 2;
  padding: 28px 32px 22px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: rgba(14, 24, 27, 0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  scrollbar-width: thin;
}

/* Stats strip full-width, apoi chart+files in 2 col, apoi peer full, apoi compose */
.s-modal-body > .sm-stats { margin: 18px 0 16px; }

.sm-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.sm-col-left, .sm-col-right {
  display: flex; flex-direction: column; gap: 16px;
  min-width: 0;
}
.sm-col-right .sm-files { flex: 1; display: flex; flex-direction: column; }
.sm-col-right .sm-files-list { flex: 1; max-height: none; }

@media (max-width: 720px) {
  .sm-grid { grid-template-columns: 1fr; gap: 14px; }
}
.s-modal-body::-webkit-scrollbar { width: 6px; }
.s-modal-body::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }

.sm-head {
  display: flex; gap: 16px; align-items: flex-start;
  padding: 0 340px 18px 0;
  border-bottom: 1px solid var(--border);
}
@media (max-width: 720px) {
  .sm-head { padding-right: 60px; }
}
.sm-head-text { min-width: 0; flex: 1; }
.sm-head-actions {
  display: flex; gap: 6px;
  flex-shrink: 0;
  align-items: center;
  padding-top: 4px;
}
.sm-action {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  color: var(--fg);
  font: inherit; font-size: .82rem; font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s var(--ease);
}
.sm-action:hover { background: var(--surface); border-color: var(--accent); color: var(--accent-hi); }
.sm-action-msg[aria-expanded="true"] {
  background: rgba(123,181,173,.14);
  border-color: var(--accent);
  color: var(--accent-hi);
}
.sm-action svg { color: var(--accent-hi); }
@media (max-width: 520px) {
  .sm-head-actions .sm-action span { display: none; }
  .sm-action { padding: 7px; }
}
.sm-badge {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-size: .92rem; font-weight: 600;
  color: #0A1214;
  background: var(--accent);
  flex-shrink: 0;
}
.sm-badge[data-subj="Chimie"]     { background: #7BB5AD; }
.sm-badge[data-subj="Fizica"]     { background: #A9B5D6; }
.sm-badge[data-subj="Matematica"] { background: #C9B677; }

.sm-head h2 {
  font-size: 1.3rem; font-weight: 500;
  margin: 0 0 4px; line-height: 1.2;
  letter-spacing: -.01em;
}
.sm-meta { font-size: .76rem; color: var(--muted); letter-spacing: .04em; margin: 0 0 2px; text-transform: uppercase; }
.sm-email { font-size: .84rem; color: var(--fg); margin: 4px 0 2px; word-break: break-all; }
.sm-master { font-size: .78rem; color: var(--muted); margin: 0; }

/* Prezenta — rand discret sub header */
.sm-presence {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  padding: 10px 0;
  margin: 14px 0;
  border-top: 1px dashed var(--border);
  border-bottom: 1px dashed var(--border);
}
/* Compactare lock-item-sm în .sm-presence — ca cele 4 toggle-uri (IAB, I, PV, Ev)
   să încapă pe aceeași linie cu prezența, fără wrap.
   Fiecare toggle: ~85px (label scurt + switch 1.55em). 4 × 85 = ~340px → sub limita modal-ului. */
.sm-presence .lock-item-sm {
  padding: 5px 9px 5px 11px;
  gap: 7px;
}
.sm-presence .lock-item-sm .lock-label { font-size: .68rem; letter-spacing: .12em; }
.sm-presence .lock-item-sm .toggle-container { height: 1.4em; }
.sm-presence-key {
  font-size: .62rem;
  color: var(--muted-2);
  letter-spacing: .18em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.sm-pdots { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; min-width: 0; }
.sm-pdot {
  width: 9px; height: 9px; border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-hi);
}
.sm-pdot.is-on { background: var(--accent); border-color: var(--accent); }
.sm-pdot.is-ex { background: rgba(183,155,224,.3); border-color: #B79BE0; }
.sm-presence-count {
  font-size: .82rem; font-weight: 600; color: var(--fg);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.sm-presence-sub { color: var(--muted-2); font-weight: 400; margin-left: 1px; font-size: .7rem; }

/* Toggle IAB — acelasi stil ca lock-item din centralizator, cu accent rosu */
.sm-iab {
  margin-left: auto;
  cursor: help;
  flex-shrink: 0;
  padding: 6px 12px 6px 14px;
  gap: 10px;
  font-size: .76rem;
}
.sm-iab .lock-label {
  font-family: var(--f-mono);
  font-size: .76rem; font-weight: 700;
  letter-spacing: .14em;
  color: var(--muted);
}
.sm-iab .toggle-container {
  --active-color: var(--danger, #E07A82);
  height: 1.55em;
}
.sm-iab:has(.toggle-input:checked) {
  background: rgba(224,122,130,.14);
  border-color: rgba(224,122,130,.55);
  box-shadow: 0 0 0 1px rgba(224,122,130,.2);
}
.sm-iab:has(.toggle-input:checked) .lock-label { color: var(--danger); }

/* PV Toggle — verde teal cand e validat (semantic pozitiv) */
.sm-pv {
  cursor: help;
  flex-shrink: 0;
  padding: 6px 12px 6px 14px;
  gap: 10px;
  font-size: .76rem;
}
.sm-pv .lock-label {
  font-family: var(--f-mono);
  font-size: .76rem; font-weight: 700;
  letter-spacing: .14em;
  color: var(--muted);
}
.sm-pv .toggle-container {
  --active-color: var(--accent, #7BB5AD);
  height: 1.55em;
}
.sm-pv:has(.toggle-input:checked) {
  background: rgba(123,181,173,.14);
  border-color: rgba(123,181,173,.55);
  box-shadow: 0 0 0 1px rgba(123,181,173,.2);
}
.sm-pv:has(.toggle-input:checked) .lock-label { color: var(--accent-hi); }

/* Integralist Toggle — galben accent (status, nu warning) */
.sm-int {
  cursor: help;
  flex-shrink: 0;
  padding: 6px 12px 6px 14px;
  gap: 10px;
  font-size: .76rem;
}
.sm-int .lock-label {
  font-family: var(--f-mono);
  font-size: .76rem; font-weight: 700;
  letter-spacing: .14em;
  color: var(--muted);
}
.sm-int .toggle-container {
  --active-color: #F7B955;
  height: 1.55em;
}
.sm-int:has(.toggle-input:checked) {
  background: rgba(247,185,85,.14);
  border-color: rgba(247,185,85,.55);
  box-shadow: 0 0 0 1px rgba(247,185,85,.2);
}
.sm-int:has(.toggle-input:checked) .lock-label { color: #F7B955; }

/* Ev Toggle (Evaluator activ) — clasa .sm-ev pentru a evita coliziunea cu .sm-peer
   (care exista deja pentru cards-urile de evaluatori, cu padding mult mai mare). */
.sm-ev .toggle-container { --active-color: #6BB6E0; }
.sm-ev:has(.toggle-input:checked) {
  background: rgba(107, 182, 224, .14);
  border-color: rgba(107, 182, 224, .55);
  box-shadow: 0 0 0 1px rgba(107, 182, 224, .2);
}
.sm-ev:has(.toggle-input:checked) .lock-label { color: #6BB6E0; }

@media (max-width: 560px) {
  .sm-summary { grid-template-columns: 1fr; gap: 12px; }
  .sm-score-val { font-size: 1.6rem; }
}

/* Notes: tabel (stanga) + disc punctaj (dreapta) */
.sm-notes {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px 14px;
  margin-bottom: 14px;
}

/* Panou Colocviu — separat de notele care se adună la NPP */
.sm-coloc-panel {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(229, 160, 204, .10), rgba(229, 160, 204, .03));
  border: 1px solid rgba(229, 160, 204, .30);
  border-radius: 10px;
}
.sm-coloc-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.sm-coloc-title {
  font-size: .88rem; font-weight: 600;
  color: var(--fg);
}
.sm-coloc-hint {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--muted-2);
  text-transform: uppercase;
  font-style: italic;
}
.sm-coloc-val {
  font-family: var(--f-mono);
  font-size: 1.45rem;
  font-weight: 700;
  color: #E5A0CC;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
}
.sm-notes-wrap {
  display: flex; align-items: center; gap: 18px;
}
.sm-notes-tbl { flex: 1; min-width: 0; }

/* Disc circular cu punctaj final */
.sm-final-disc {
  flex-shrink: 0;
  width: 120px; height: 120px;
  border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(247,185,85,.28), rgba(247,185,85,.08) 70%);
  border: 2px solid rgba(247,185,85,.4);
  box-shadow: 0 4px 20px rgba(247,185,85,.18);
  cursor: help;
}
.s-modal.is-fail .sm-final-disc {
  background: radial-gradient(circle at 30% 30%, rgba(224,122,130,.28), rgba(224,122,130,.08) 70%);
  border-color: rgba(224,122,130,.4);
  box-shadow: 0 4px 20px rgba(224,122,130,.18);
}
.sm-final-disc-lbl {
  font-size: .6rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted);
}
.sm-final-disc-val {
  font-size: 1.9rem; font-weight: 700;
  color: #F7B955;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
  margin: 4px 0 3px;
}
.s-modal.is-fail .sm-final-disc-val { color: var(--danger); }
.sm-final-disc-max {
  font-size: .66rem;
  color: var(--muted-2);
  letter-spacing: .08em;
}
@media (max-width: 560px) {
  .sm-notes-wrap { flex-direction: column; }
  .sm-final-disc { width: 100px; height: 100px; }
  .sm-final-disc-val { font-size: 1.55rem; }
}
.sm-notes-tbl {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.sm-notes-tbl th,
.sm-notes-tbl td {
  padding: 9px 6px;
  text-align: center;
  font-size: .96rem;
  font-weight: 600;
  color: var(--fg);
  border-bottom: 1px solid var(--border);
}
.sm-notes-tbl thead th {
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 6px 4px;
  border-bottom: 1px solid var(--border);
}
.sm-notes-tbl th.sm-nt-src {
  text-align: left;
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 4px;
  width: 80px;
}
.sm-notes-tbl .sm-nt-avg {
  color: var(--accent-hi);
  font-weight: 700;
  font-size: 1.05rem;
  background: rgba(123,181,173,.05);
  border-left: 1px solid var(--border);
  width: 60px;
}
.sm-notes-tbl thead .sm-nt-avg {
  color: var(--accent-hi);
  font-size: .64rem;
  font-weight: 600;
  background: rgba(123,181,173,.08);
}
.sm-notes-tbl th.sm-nt-title {
  color: var(--accent-hi);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
}
.sm-notes-tbl td.is-ex   { color: #B79BE0; font-style: italic; }
.sm-notes-tbl td.is-zero { color: var(--muted-2); font-weight: 500; }
.sm-notes-tbl td.is-na   { color: var(--muted-2); font-weight: 400; }
.sm-nt-row-peer td { color: #C9B677; }
.sm-nt-row-peer td.is-ex   { color: #B79BE0; }
.sm-nt-row-peer td.is-zero { color: var(--muted-2); }
.sm-nt-row-peer td.is-na   { color: var(--muted-2); }
.sm-nt-row-peer .sm-nt-avg { color: #C9B677 !important; }
.sm-nt-row-port th.sm-nt-src { color: #B79BE0; }
.sm-nt-row-port .sm-nt-avg { color: #B79BE0 !important; }

/* Rand Profil (Creativitate + Specialitate) */
.sm-nt-row-profil th.sm-nt-src { color: #F7B955; }
.sm-nt-row-profil .sm-nt-avg { color: #F7B955 !important; }
.sm-nt-profil-cell {
  padding: 6px 10px !important;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.sm-nt-profil-lbl {
  display: block;
  font-size: .58rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 2px;
}
.sm-nt-profil-val {
  display: block;
  font-size: 1.08rem; font-weight: 700;
  color: #F7B955;
  font-variant-numeric: tabular-nums;
}

.sm-nt-port-note {
  font-size: .66rem;
  color: var(--muted-2);
  font-style: italic;
  letter-spacing: .02em;
}

/* Sectiuni - heading comun */
.sm-section-head {
  font-size: .68rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

/* Portofoliu + Punctaj final — pe acelasi rand */
.sm-result-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 12px;
  margin: 14px 0;
}
@media (max-width: 560px) {
  .sm-result-row { grid-template-columns: 1fr; }
}

/* Portofoliu — card centrat */
.sm-port-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(183,155,224,.12), rgba(183,155,224,.03));
  border: 1px solid rgba(183,155,224,.3);
  border-radius: 12px;
}
.sm-port-lbl {
  font-size: .64rem; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}
.sm-port-val {
  font-size: 2rem; font-weight: 700;
  color: #B79BE0;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  line-height: 1;
}
.sm-port-max { font-size: .72rem; color: var(--muted-2); font-variant-numeric: tabular-nums; margin-top: 2px; }

/* Punctaj final — hero central langa Portofoliu */
.sm-final-box {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(247,185,85,.15), rgba(247,185,85,.03));
  border: 1px solid rgba(247,185,85,.35);
  border-radius: 14px;
  text-align: center;
}
.sm-final-lbl {
  font-size: .66rem; font-weight: 600;
  letter-spacing: .2em; text-transform: uppercase;
  color: var(--muted);
}
.sm-final-line {
  display: flex; align-items: baseline; gap: 8px;
  line-height: 1;
  margin-top: 4px;
}
.sm-final-val {
  font-size: 2.8rem; font-weight: 700;
  color: #F7B955;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.s-modal.is-fail .sm-final-val { color: var(--danger); }
.sm-final-sep { color: var(--muted-2); font-size: 1.6rem; font-weight: 400; }
.sm-final-max { color: var(--muted); font-size: 1.2rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.sm-final-formula {
  font-size: .64rem;
  color: var(--muted-2);
  font-style: italic;
  margin-top: 6px;
  letter-spacing: .02em;
}
.sm-stats > div { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.sm-v { font-size: 1.1rem; font-weight: 500; font-variant-numeric: tabular-nums; color: var(--fg); }
.sm-v-own  { color: var(--accent-hi); }
.sm-v-peer { color: #C9B677; }
.sm-v-port { color: #B79BE0; }
.sm-sub { font-size: .68rem; color: var(--muted); font-weight: 400; margin-left: 1px; }
.sm-l { font-size: .62rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin-top: 3px; }

.sm-chart {
  display: flex; flex-direction: column; gap: 18px;
  padding: 18px 18px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.sm-presence-dots {
  display: flex; justify-content: center; gap: 8px;
}
.sm-pdot {
  width: 14px; height: 14px; border-radius: 50%;
  background: transparent;
  border: 1px solid var(--border-hi);
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.sm-pdot.is-on {
  background: var(--accent);
  border-color: var(--accent);
}
.sm-bars {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 16px;
  height: 110px;
  padding-top: 24px;
}
.sm-bar {
  position: relative;
  width: 32px;
  background: var(--accent-hi);
  opacity: .85;
  border-radius: 3px 3px 0 0;
  transition: opacity .15s var(--ease);
  min-height: 2px;
}
.sm-bar:hover { opacity: 1; }
.sm-bar-l {
  position: absolute; top: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  font-size: .66rem; color: var(--muted-2);
  white-space: nowrap;
}

.sm-final {
  text-align: center;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(247,185,85,.08), rgba(247,185,85,.02));
  border: 1px solid rgba(247,185,85,.25);
  border-radius: 12px;
  display: flex; flex-direction: column; align-items: center;
}
.sm-final-v {
  font-size: 1.9rem; font-weight: 500;
  color: var(--accent-hi);
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.s-modal.is-fail .sm-final-v { color: var(--danger); }
.sm-final-l { font-size: .7rem; color: var(--muted); letter-spacing: .14em; text-transform: uppercase; margin-top: 2px; }

.sm-actions {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* Peer evaluatori — bara compacta cu 3 avatare si tooltip */
.sm-peer {
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 16px;
}
.sm-peer h4 {
  font-size: .68rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 10px;
}
.sm-peer-bar {
  display: flex; gap: 14px; flex-wrap: wrap;
}
.sm-ev {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 12px 6px 6px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: default;
}
.sm-ev-av {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff;
  display: grid; place-items: center;
  font-size: .7rem; font-weight: 700;
  box-shadow: 0 2px 4px rgba(0,0,0,.3);
  flex-shrink: 0;
}
.sm-ev-info { display: flex; flex-direction: column; min-width: 0; }
.sm-ev-name {
  font-size: .78rem; font-weight: 600; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 140px;
}
.sm-ev-avg {
  font-size: .7rem; color: var(--accent-hi);
  font-variant-numeric: tabular-nums;
}
.sm-ev-tip {
  position: absolute;
  bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px) scale(.95);
  padding: 10px 14px;
  background: #0a1214;
  color: #fff;
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s var(--ease);
  z-index: 10;
  min-width: 180px;
  box-shadow: 0 8px 22px rgba(0,0,0,.5);
  text-align: center;
}
.sm-ev-tip::after {
  content: '';
  position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0a1214;
}
.sm-ev-tip b { color: var(--accent-hi); font-weight: 600; font-size: .8rem; display: block; margin-bottom: 6px; }
.sm-ev-tip-notes {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.sm-ev-n {
  display: flex; flex-direction: column; gap: 2px;
  font-size: .78rem; font-variant-numeric: tabular-nums;
}
.sm-ev-n b {
  display: block; margin: 0;
  font-size: .6rem; color: var(--muted); letter-spacing: .06em;
  font-family: var(--f-mono); font-weight: 500;
}
.sm-ev:hover .sm-ev-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}
.sm-peer-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.sm-peer-head h3 { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.sm-peer-hint { font-size: .7rem; color: var(--muted-2); }
.sm-peer-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.sm-peer-card {
  padding: 12px 14px;
  background: rgba(255,255,255,.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.sm-pc-head { display: flex; align-items: center; gap: 10px; }
.sm-pc-av {
  width: 36px; height: 36px; border-radius: 50%;
  border: 2px solid #fff;
  display: grid; place-items: center;
  font-size: .72rem; font-weight: 700;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  flex-shrink: 0;
}
.sm-pc-meta { display: flex; flex-direction: column; min-width: 0; }
.sm-pc-name {
  font-size: .84rem; font-weight: 600; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sm-pc-avg {
  font-size: .7rem; color: var(--accent-hi);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.sm-pc-notes {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}
.sm-pc-note {
  display: flex; flex-direction: column; align-items: center;
  padding: 5px 2px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 0;
}
.sm-pc-l {
  font-family: var(--f-mono);
  font-size: .6rem; color: var(--muted-2);
  letter-spacing: .04em;
}
.sm-pc-v {
  font-size: .86rem; font-weight: 700;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}
.sm-pc-ex   .sm-pc-v { color: #B79BE0; font-style: italic; }
.sm-pc-zero .sm-pc-v { color: var(--muted-2); }
.sm-pc-na   .sm-pc-v { color: var(--muted-2); }

/* Message modal — fereastra separata pentru conversatie */
body.is-mmodal-open { overflow: hidden; }
.m-modal {
  position: fixed; inset: 0; z-index: 1100;
  display: grid; place-items: center;
  padding: 24px;
}
.m-modal[hidden] { display: none; }
.m-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(5, 10, 11, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  /* exit (default) — mai rapid decât enter */
  opacity: 0;
  transition: opacity .18s var(--ease);
}
.m-modal-card {
  position: relative; z-index: 2;
  width: min(640px, calc(100vw - 48px));
  /* Înălțimea se adaptează la conținut — modalele mici (confirm, edit) nu se mai întind degeaba */
  max-height: min(880px, calc(100vh - 48px));
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-hi);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0,0,0,.55);
  overflow: hidden;
  /* exit (default) — mai rapid decât enter */
  opacity: 0;
  transform: scale(.96) translateY(6px);
  transform-origin: center;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
/* enter — durată mai lungă, transform-origin centrat (modalul nu e ancorat de trigger) */
.m-modal.is-open .m-modal-backdrop {
  opacity: 1;
  transition-duration: .28s;
}
.m-modal.is-open .m-modal-card {
  opacity: 1;
  transform: scale(1) translateY(0);
  transition-duration: .3s;
}
@media (prefers-reduced-motion: reduce) {
  .m-modal-card,
  .m-modal-backdrop {
    transition: opacity .15s ease;
    transform: none !important;
  }
}
/* msgModal e mai lat — chat zone larga, height fix pentru lista scrollable */
#msgModal .m-modal-card {
  width: min(720px, calc(100vw - 48px));
  height: calc(100vh - 48px);
}
.m-modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  z-index: 3;
}
.m-modal-close:hover { color: var(--fg); border-color: var(--border-hi); }

.m-modal-head {
  padding: 20px 24px 14px;
  border-bottom: 1px solid var(--border);
}
.m-modal-stud { display: flex; flex-direction: column; gap: 2px; margin-right: 44px; }
.m-modal-name { font-size: 1.1rem; font-weight: 600; color: var(--fg); letter-spacing: -.01em; }
.m-modal-meta { font-size: .72rem; color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
.m-modal-summary {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 10px;
}
.m-sum-pill {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 4px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .72rem;
}
.m-sum-pill b {
  font-size: .88rem; color: var(--fg); font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.m-sum-pill span { color: var(--muted-2); }
.m-sum-final {
  background: rgba(247,185,85,.1);
  border-color: rgba(247,185,85,.35);
}
.m-sum-final b { color: #F7B955; }

.m-thread {
  flex: 1; min-height: 0;
  padding: 18px 22px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 10px;
  scrollbar-width: thin;
  background-color: #0C1618;
  background-image:
    radial-gradient(circle at 1.5px 1.5px, rgba(154,206,198,.06) 1.5px, transparent 0),
    radial-gradient(circle at 20% 10%, rgba(123,181,173,.05), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(183,155,224,.04), transparent 60%);
  background-size: 22px 22px, auto, auto;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03), inset 0 -1px 0 rgba(0,0,0,.3);
}
.m-thread::-webkit-scrollbar { width: 5px; }
.m-thread::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
.m-thread-empty {
  margin: auto; color: var(--muted-2); font-size: .86rem; text-align: center; max-width: 280px;
}

/* === Reactii pe bubble (pill-uri inline sub mesaj) === */
.m-reactions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 4px 0 0;
  position: relative;
}
/* Aliniere pill-uri pe partea bubble-ului (admin = right, student = left etc.) */
.m-bubble-admin   > .m-reactions { align-self: flex-end; }
.m-bubble-student > .m-reactions { align-self: flex-start; }
.stud-thread .m-bubble-admin   > .m-reactions { align-self: flex-start; }
.stud-thread .m-bubble-student > .m-reactions { align-self: flex-end; }

.m-react-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px 2px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  font-size: .72rem;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: transform .12s var(--ease), background .12s var(--ease), border-color .12s var(--ease);
  line-height: 1.4;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
  height: 22px;
}
.m-react-pill:hover {
  background: var(--surface-hi, var(--bg-2));
  border-color: var(--border);
  transform: scale(1.06);
}
.m-react-pill.is-mine {
  background: rgba(123,181,173,.22);
  border-color: rgba(123,181,173,.55);
  color: var(--accent-hi);
}
.m-react-pill .m-react-em { font-size: .92rem; line-height: 1; }
.m-react-pill .m-react-cnt { font-variant-numeric: tabular-nums; font-weight: 700; font-size: .68rem; }
/* Cand pill-ul are doar 1, ascundem count-ul (mai curat) */
.m-react-pill[data-cnt="1"] .m-react-cnt { display: none; }

/* .m-bubble must be relative pentru ca .m-react-picker (absolute) si pill-urile sa fie pozitionate corect */
.m-bubble { position: relative; }
.m-react-picker {
  position: absolute;
  top: -42px;
  display: flex;
  gap: 2px;
  padding: 4px 6px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px) scale(.92);
  transition: all .15s var(--ease);
  z-index: 10;
}
/* Bridge invizibil între picker și bubble — păstrează hover-ul continuu */
.m-react-picker::before {
  content: '';
  position: absolute;
  left: -8px; right: -8px;
  bottom: -14px;
  height: 14px;
}
.m-bubble-admin .m-react-picker { right: 0; }
.m-bubble-student .m-react-picker { left: 0; }
.stud-thread .m-bubble-admin .m-react-picker { right: auto; left: 0; }
.stud-thread .m-bubble-student .m-react-picker { left: auto; right: 0; }
.m-bubble:hover > .m-react-picker,
.m-bubble.is-react-open > .m-react-picker,
.m-react-picker:hover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}
.m-react-pick {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform .12s var(--ease), background .12s var(--ease);
}
.m-react-pick:hover {
  background: rgba(123,181,173,.18);
  transform: scale(1.18);
}

/* Pe mobil — picker se desface mai jos sa nu iasa din ecran */
@media (max-width: 520px) {
  .m-react-picker { top: auto; bottom: -34px; }
}

/* (picker extins eliminat — singur rand cu 10 emoji) */

/* === Attachment in bubble (imagine inline) === */
.m-bubble-att {
  display: block;
  margin: 0 0 6px;
  border-radius: 10px;
  overflow: hidden;
  max-width: 280px;
  background: rgba(0,0,0,.18);
  cursor: zoom-in;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.06);
  line-height: 0;
}
.m-bubble-att img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
}
.m-bubble-att:hover { border-color: rgba(255,255,255,.18); }
/* Daca bubble-ul are doar imagine (fara text), eliminam padding suplimentar */
.m-bubble:has(> .m-bubble-att):not(:has(> .m-bubble-text)) {
  padding: 4px;
}
.m-bubble:has(> .m-bubble-att):not(:has(> .m-bubble-text)) .m-bubble-att {
  margin: 0;
}

/* === Attachment chip in compose (preview inainte de send) === */
.m-att-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  margin: 0 0 8px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
}
.m-att-chip[hidden] { display: none; }
.m-att-chip-img {
  width: 40px; height: 40px;
  border-radius: 7px;
  object-fit: cover;
  background: rgba(255,255,255,.05);
  flex-shrink: 0;
  border: 1px solid var(--border);
}
.m-att-chip-info {
  flex: 1; min-width: 0;
}
.m-att-chip-name {
  font-size: .8rem;
  color: var(--fg);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.m-att-chip-size {
  font-size: .7rem;
  color: var(--muted);
  margin-top: 1px;
}
.m-att-chip-x {
  flex-shrink: 0;
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted-2);
  cursor: pointer;
  transition: all .12s var(--ease);
}
.m-att-chip-x:hover {
  background: rgba(224,122,130,.15);
  color: var(--danger);
}

/* === Buton paperclip atasare imagine === */
.msg-attach {
  flex-shrink: 0;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 999px;
  cursor: pointer;
  color: var(--muted);
  transition: all .12s var(--ease);
}
.msg-attach:hover {
  background: rgba(123,181,173,.12);
  color: var(--accent-hi);
}

/* === Reply quote (in bubble) — citat compact la mesajul la care raspunzi === */
.m-reply-quote {
  display: flex;
  align-items: stretch;
  gap: 7px;
  margin: 0 0 8px; /* ~2mm spatiu pana la mesaj */
  padding: 4px 8px 4px 6px;
  background: rgba(255,255,255,.05);
  border-radius: 7px;
  cursor: pointer;
  max-width: 100%;
  overflow: hidden;
  transition: background .12s var(--ease);
}
.m-reply-quote:hover { background: rgba(255,255,255,.09); }
.m-reply-quote-bar {
  flex-shrink: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
  min-height: 22px;
}
.m-reply-quote-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.m-reply-quote-who {
  font-size: .62rem;
  font-weight: 700;
  color: var(--accent-hi);
  letter-spacing: .03em;
  line-height: 1.2;
}
.m-reply-quote-text {
  font-size: .72rem;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Highlight cand utilizatorul scrolleaza la mesajul citat */
.m-bubble.is-flash {
  animation: bubbleFlash 1s ease-out;
}
@keyframes bubbleFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(123,181,173,0); }
  30%      { box-shadow: 0 0 0 4px rgba(123,181,173,.45); }
}

/* Reply chip (deasupra zonei de input) */
.m-reply-chip {
  display: none;
  align-items: stretch;
  gap: 8px;
  padding: 8px 10px;
  margin: 0 0 8px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
  position: relative;
}
.m-reply-chip.is-on { display: flex; animation: replyChipIn .2s var(--ease); }
@keyframes replyChipIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.m-reply-chip-bar {
  flex-shrink: 0;
  width: 3px;
  border-radius: 2px;
  background: var(--accent);
}
.m-reply-chip-body {
  flex: 1; min-width: 0;
}
.m-reply-chip-who {
  font-size: .68rem;
  font-weight: 700;
  color: var(--accent-hi);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.m-reply-chip-text {
  font-size: .78rem;
  color: var(--muted);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}
.m-reply-chip-x {
  flex-shrink: 0;
  width: 24px; height: 24px;
  display: grid; place-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted-2);
  cursor: pointer;
  transition: all .12s var(--ease);
}
.m-reply-chip-x:hover {
  background: rgba(224,122,130,.15);
  color: var(--danger);
}

/* === Context menu (click dreapta pe bubble) === */
.cm-menu {
  position: fixed;
  z-index: 9000;
  min-width: 180px;
  padding: 6px;
  background: var(--surface, #14202380);
  border: 1px solid var(--border-hi);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 1px;
  opacity: 0;
  transform: scale(.96) translateY(-4px);
  transform-origin: top left;
  transition: opacity .12s var(--ease), transform .12s var(--ease);
  pointer-events: none;
}
.cm-menu.is-open { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }
.cm-menu[hidden] { display: none !important; }

.cm-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--fg);
  font-family: inherit;
  font-size: .85rem;
  text-align: left;
  cursor: pointer;
  transition: background .1s var(--ease), color .1s var(--ease);
  width: 100%;
}
.cm-item svg { flex-shrink: 0; color: var(--muted); }
.cm-item:hover {
  background: rgba(123,181,173,.14);
  color: var(--accent-hi);
}
.cm-item:hover svg { color: var(--accent-hi); }
.cm-item.cm-item-danger:hover {
  background: rgba(224,122,130,.14);
  color: var(--danger);
}
.cm-item.cm-item-danger:hover svg { color: var(--danger); }

/* Separator de zi intre mesaje (Astazi / Ieri / 12 apr) */
.m-thread-date {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 14px 0 6px;
  position: relative;
}
.m-thread-date::before,
.m-thread-date::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,.08), transparent);
  max-width: 100px;
}
.m-thread-date span {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: rgba(255,255,255,.04);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.05);
}
.m-thread-date:first-child { margin-top: 4px; }
.m-bubble {
  display: flex; flex-direction: column;
  padding: 9px 13px 6px;
  border-radius: 14px;
  max-width: 78%;
  word-break: break-word;
  white-space: pre-wrap;
  font-size: .9rem;
  line-height: 1.45;
  font-family: var(--f-sans), "Apple Color Emoji","Segoe UI Emoji",emoji,sans-serif;
  position: relative;
  transition: box-shadow .15s var(--ease);
}
.m-bubble-text { margin: 0; }
.m-bubble-admin {
  align-self: flex-end;
  background: rgba(123,181,173,.18);
  border: 1px solid rgba(123,181,173,.35);
  color: var(--fg);
}
.m-bubble-student {
  align-self: flex-start;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  color: var(--fg);
}
.m-bubble-date {
  align-self: flex-end;
  margin-top: 3px;
  font-size: .65rem;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  opacity: .55;
  letter-spacing: .02em;
  transition: opacity .15s var(--ease);
}
.m-bubble:hover .m-bubble-date { opacity: .9; }

.m-compose {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.m-emoji-row { display: flex; gap: 3px; flex-wrap: wrap; }
.m-compose-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 4px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  transition: border-color .15s var(--ease);
}
.m-compose-row:focus-within { border-color: var(--accent); }
.m-compose-row svg { color: var(--muted); flex-shrink: 0; }
.m-compose-row input[type="text"] {
  flex: 1; min-width: 0;
  font: inherit; font-size: .9rem;
  padding: 7px 0;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-family: var(--f-sans), "Apple Color Emoji","Segoe UI Emoji",emoji,sans-serif;
}
.m-compose-row input[type="text"]:focus { outline: none; }
.m-compose-row textarea {
  flex: 1; min-width: 0;
  font: inherit; font-size: .9rem;
  padding: 8px 0;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-family: var(--f-sans), "Apple Color Emoji","Segoe UI Emoji",emoji,sans-serif;
  resize: none;
  line-height: 1.4;
  /* Inaltime fixa initiala (1 rand vizibil), JS o creste cand user-ul tasteaza */
  height: 36px;
  min-height: 36px;
  max-height: 140px;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(123,181,173,.2) transparent;
}
/* Scroll activat doar daca JS detecteaza ca depaseste max-height */
.m-compose-row textarea.is-scrolling { overflow-y: auto; }
.m-compose-row textarea::-webkit-scrollbar { width: 3px; }
.m-compose-row textarea::-webkit-scrollbar-thumb { background: rgba(123,181,173,.25); border-radius: 3px; }
.m-compose-row textarea:focus { outline: none; }
.m-compose-row-area {
  align-items: center;
  padding: 4px 4px 4px 14px;
  border-radius: 20px;
}
.m-compose-row-area > svg { align-self: center; }
.m-compose-row-area > .msg-send { align-self: center; }

@media (max-width: 520px) {
  .m-modal { padding: 0; }
  .m-modal-card { width: 100%; max-height: 100vh; height: 100vh; border-radius: 0; border: 0; }
  .m-modal-head { padding: 20px 20px 12px; }
  .m-compose { padding: 10px 14px 14px; }
  .m-thread { padding: 12px 16px; }
}

/* Buton Mesaje cu contor */
.s-modal-msgbtn {
  background: rgba(123,181,173,.1);
  border-color: var(--border-hi);
  color: var(--fg);
}
.s-modal-msgbtn:hover { background: rgba(123,181,173,.2); border-color: var(--accent); color: var(--accent-hi); }
.s-modal-msgbtn svg { color: var(--accent-hi); }
.s-modal-msgbtn-cnt {
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #0A1214;
  font-size: .66rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Thread mesaje (admin <-> student) — lista scrollabila */
.sm-thread {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.sm-thread-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
  max-height: 200px; overflow-y: auto;
  scrollbar-width: thin;
}
.sm-thread-list::-webkit-scrollbar { width: 4px; }
.sm-thread-list::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 2px; }
.sm-tm {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .84rem;
}
.sm-tm-admin  { background: rgba(123,181,173,.08); }
.sm-tm-student { background: rgba(247,185,85,.06); }
.sm-tm-who {
  font-size: .68rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap;
}
.sm-tm-admin .sm-tm-who { color: var(--accent-hi); }
.sm-tm-student .sm-tm-who { color: #F7B955; }
.sm-tm-txt {
  color: var(--fg);
  line-height: 1.4;
  word-break: break-word;
  white-space: pre-wrap;
  font-family: var(--f-sans), "Apple Color Emoji","Segoe UI Emoji",emoji,sans-serif;
}
.sm-tm-date {
  font-size: .66rem; color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Compose admin modal — pill inline, stil dashboard */
.sm-compose {
  margin-top: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.sm-compose .sm-msg-emoji {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 0 4px;
}
.sm-compose .sm-emoji {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 1rem;
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",emoji,sans-serif;
  cursor: pointer;
  line-height: 1.2;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), background .15s, border-color .15s;
}
.sm-compose .sm-emoji:hover {
  background: var(--bg-2);
  border-color: var(--accent);
  transform: scale(1.15);
}
.sm-msg-form {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 4px 4px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  transition: border-color .15s var(--ease);
}
.sm-msg-form:focus-within { border-color: var(--accent); }
.sm-msg-ico { color: var(--muted); flex-shrink: 0; }
.sm-msg-form input[type="text"] {
  flex: 1; min-width: 0;
  font: inherit; font-size: .88rem;
  padding: 7px 0;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-family: var(--f-sans), "Apple Color Emoji","Segoe UI Emoji",emoji,sans-serif;
}
.sm-msg-form input[type="text"]:focus { outline: none; }
.sm-msg-send {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #0A1214;
  border: 0;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.sm-msg-send:hover { background: var(--accent-hi); }
@keyframes envOpen {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sm-emoji-row { display: flex; gap: 4px; flex-wrap: wrap; }
.sm-emoji {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 1.15rem;
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Twemoji Mozilla","EmojiOne Color",emoji,system-ui,sans-serif;
  cursor: pointer;
  line-height: 1;
  transition: all .15s var(--ease);
}
.sm-emoji:hover { background: var(--surface); border-color: var(--accent); transform: scale(1.15); }
#sm-msg {
  width: 100%;
  font: inherit; font-size: .9rem;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  resize: vertical;
  min-height: 72px;
}
#sm-msg:focus { outline: none; border-color: var(--accent); }
.sm-compose-foot {
  display: flex; align-items: center;
  gap: 8px;
}
.sm-msg-state { font-size: .74rem; color: var(--muted); flex: 1; }

/* Delete in files list (admin) */
.sm-f-del { margin: 0; line-height: 0; }
.sm-f-del-btn {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 6px;
  color: var(--muted); background: transparent;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.sm-f-del-btn:hover { color: var(--danger); border-color: rgba(224,122,130,.5); }

/* Inbox pe dashboard student — grid 3 col pe laptop, responsive */
.msg-inbox {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.msg-inbox-head {
  grid-column: 1 / -1;
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0 4px;
  margin-bottom: 0;
}

/* Chat trigger button in topbar (student) */
.chat-trigger {
  position: relative;
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  border-radius: 999px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.chat-trigger:hover { color: var(--accent-hi); border-color: var(--accent); background: rgba(123,181,173,.08); }
.chat-trigger.has-unread { color: var(--accent-hi); border-color: rgba(123,181,173,.5); background: rgba(123,181,173,.12); }
.chat-trigger.is-pinging { animation: notif-shake .6s var(--ease); }
.chat-trigger-dot {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: #FFF;
  font-size: .58rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 0 0 2px var(--bg);
  animation: pulse-dot 1.8s infinite;
}
.chat-trigger-dot[hidden] { display: none; }

/* Chat floating (deschis DOAR din butonul topbar, nu mai e inline pe dashboard) */
.stud-chat.is-floating { display: none; } /* ascuns default */
.stud-chat.is-floating[hidden] { display: none; }
.stud-chat.is-floating.is-open { display: flex; }

/* Chat WhatsApp-style pentru student — foloseste m-* din msgModal, aceeasi paleta */
.stud-chat {
  display: flex; flex-direction: column;
  grid-template-columns: none;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all .25s var(--ease);
}
.stud-chat .msg-inbox-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
  position: relative;
}

/* Buton expand in header */
.stud-chat-expand {
  position: absolute;
  top: 50%; right: 14px;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.stud-chat-expand:hover { color: var(--accent-hi); border-color: var(--accent); background: rgba(123,181,173,.1); }
.stud-chat-expand .sce-ico-close { display: none; }
.stud-chat.is-focus .stud-chat-expand .sce-ico-open { display: none; }
.stud-chat.is-focus .stud-chat-expand .sce-ico-close { display: block; }

/* Mod focus: dialog centrat cu coltuir rotunjite + backdrop */
body.is-chat-focus { overflow: hidden; }
body.is-chat-focus::before {
  content: '';
  position: fixed; inset: 0;
  background: rgba(5, 10, 12, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 79;
  animation: fade-in .2s var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.stud-chat.is-focus {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(900px, calc(100vw - 40px));
  height: min(86vh, 820px);
  z-index: 80;
  margin: 0;
  border-radius: 16px;
  border: 1px solid var(--border-hi);
  background: var(--surface);
  box-shadow: 0 20px 60px rgba(0,0,0,.5), 0 4px 20px rgba(0,0,0,.3);
  overflow: hidden;
  animation: focus-pop .22s var(--ease);
}
@keyframes focus-pop {
  from { opacity: 0; transform: translate(-50%, -48%) scale(.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.stud-chat.is-focus .stud-thread {
  max-height: none;
  flex: 1;
  min-height: 0;
}
.stud-chat.is-focus .stud-compose {
  border-top: 1px solid var(--border);
}
.msg-head-cnt {
  font-size: .64rem;
  font-weight: 500;
  color: var(--muted-2);
  letter-spacing: .06em;
  margin-left: 4px;
  padding: 2px 6px;
  background: rgba(123,181,173,.08);
  border: 1px solid var(--border);
  border-radius: 999px;
  vertical-align: middle;
}

.stud-thread {
  /* Implicit chat-ul e deschis in focus mode → flex: 1 din regula .is-focus preia spatiul */
  padding: 20px 22px;
  gap: 10px;
}
/* Perspectiva student: admin = incoming (stanga), student = outgoing (dreapta) */
.stud-thread .m-bubble-admin .m-bubble-text { font-weight: 500; }
.stud-thread .m-bubble-admin {
  align-self: flex-start;
  background: rgba(255,255,255,.07);
  border-color: var(--border-hi);
}
.stud-thread .m-bubble-student {
  align-self: flex-end;
  background: rgba(123,181,173,.18);
  border-color: rgba(123,181,173,.35);
}
.stud-thread .m-bubble-admin.is-unread {
  box-shadow: 0 0 0 2px rgba(123,181,173,.3);
  animation: bubble-ping .6s var(--ease);
}
@keyframes bubble-ping {
  0%   { transform: scale(.96); opacity: .6; }
  60%  { transform: scale(1.01); opacity: 1; }
  100% { transform: scale(1); }
}
.stud-compose { padding: 10px 14px 14px; }
.stud-compose .m-emoji-row,
.m-modal-card .m-emoji-row {
  padding: 0 4px;
  gap: 4px;
}
.stud-compose .stud-emoji,
.m-modal-card .mm-emoji {
  width: 30px !important; height: 30px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center !important;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 1.05rem !important;
  line-height: 1 !important;
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Twemoji Mozilla","EmojiOne Color",emoji,system-ui,sans-serif;
  transition: background .12s var(--ease), border-color .12s var(--ease), transform .12s var(--ease);
}
.stud-compose .stud-emoji:hover,
.m-modal-card .mm-emoji:hover {
  background: var(--bg-2);
  border-color: var(--border-hi);
  transform: scale(1.12);
}
.msg-inbox-head h2 {
  font-size: .72rem; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0;
}
/* Cand un mesaj e deschis -> span pe tot randul ca sa aiba loc pt panou */
.msg.is-open { grid-column: 1 / -1; }
.msg {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: border-color .15s var(--ease);
  min-height: 4cm;  /* spatiu consistent per card */
  display: flex; flex-direction: column;
}
.msg.is-unread { border-color: rgba(123,181,173,.4); }
.msg:hover { border-color: var(--border-hi); }
.msg-row {
  display: grid;
  grid-template-columns: 16px 1fr auto auto;
  align-items: flex-start;
  gap: 8px;
  padding: 14px 12px;
  cursor: pointer;
  min-width: 0;
  flex: 1;
}
.msg-text {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal !important;
  line-height: 1.45;
}
/* Cand e deschis - layout mai larg */
.msg.is-open .msg-row {
  grid-template-columns: 18px 1fr auto auto auto;
  padding: 12px 14px;
  gap: 10px;
}
.msg-icon {
  color: var(--muted);
  flex-shrink: 0;
}
.msg.is-unread .msg-icon { color: var(--accent); }
.msg-text {
  font-size: .88rem;
  color: var(--fg);
  margin: 0;
  overflow: hidden;
  font-family: var(--f-sans), "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",emoji,sans-serif;
}
.msg-date {
  font-size: .72rem;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.msg-chev {
  color: var(--muted-2);
  font-size: .7rem;
  transition: transform .2s var(--ease);
  width: 12px; text-align: center;
  display: none; /* ascuns in grid 3-col, apar doar cand deschis */
}
.msg.is-open .msg-chev { display: inline; }
.msg.is-open .msg-chev { transform: rotate(180deg); color: var(--accent-hi); }
.msg-x {
  background: transparent;
  border: 0;
  color: var(--muted-2);
  font-size: 1.05rem; line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.msg-x:hover { color: var(--danger); background: rgba(224,122,130,.1); }

/* Panel expand */
.msg-panel {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
  animation: fadeIn .18s var(--ease);
}
.msg-reacts {
  display: flex; gap: 4px; flex-wrap: wrap;
}
.msg-react {
  font-size: 1rem;
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",emoji,sans-serif;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 10px;
  cursor: pointer;
  line-height: 1.2;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), background .15s, border-color .15s;
}
.msg-react:hover { background: var(--bg-2); border-color: var(--accent); transform: scale(1.15); }
.msg-react.is-sent { background: rgba(123,181,173,.2); border-color: var(--accent); }

.msg-reply-form {
  display: flex; align-items: center; gap: 6px;
}
.msg-reply-form input[type="text"] {
  flex: 1; min-width: 0;
  font: inherit; font-size: .86rem;
  padding: 7px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 999px;
  color: var(--fg);
  font-family: var(--f-sans), "Apple Color Emoji","Segoe UI Emoji",emoji,sans-serif;
}
.msg-reply-form input[type="text"]:focus { outline: none; border-color: var(--accent); }
.msg-send {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  border: 0;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.msg-send svg { color: #FFFFFF; stroke: #FFFFFF; }
.msg-send:hover { background: var(--accent-hi); }
.msg-send:hover svg { color: #0A1214; stroke: #0A1214; }

@media (max-width: 540px) {
  .msg-row { grid-template-columns: 16px 1fr auto auto; gap: 8px; padding: 8px 10px; }
  .msg-chev { display: none; }
  .msg-date { font-size: .66rem; }
}
.msg-item:hover { border-color: var(--border-hi); }
.msg-item.is-unread {
  border-color: rgba(123,181,173,.45);
  background: rgba(123,181,173,.06);
  box-shadow: 0 0 0 1px rgba(123,181,173,.12);
}
.msg-ico {
  flex-shrink: 0;
  color: var(--accent-hi);
  margin-top: 2px;
}
.msg-item.is-unread .msg-ico { color: var(--accent); }
.msg-body { flex: 1; min-width: 0; }
.msg-text {
  font-size: .88rem;
  line-height: 1.45;
  color: var(--fg);
  word-break: break-word;
  white-space: pre-wrap;
  font-family: var(--f-sans), "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Twemoji Mozilla","EmojiOne Color",emoji,sans-serif;
}
.msg-meta {
  font-size: .7rem;
  color: var(--muted-2);
  margin-top: 2px;
  display: flex; align-items: center; gap: 10px;
}
.msg-reply-btn {
  background: transparent; border: 0; padding: 0;
  color: var(--muted); font: inherit; font-size: inherit;
  cursor: pointer;
  opacity: .7;
  transition: color .15s var(--ease), opacity .15s var(--ease);
}
.msg-item:hover .msg-reply-btn { opacity: 1; color: var(--accent-hi); }
.msg-reply-btn:hover { color: var(--accent-hi) !important; opacity: 1 !important; }

/* Reacții rapide — ascunse implicit, apar la hover pe msg-item */
.msg-reactions {
  display: flex; gap: 2px;
  align-items: center;
  max-height: 0; overflow: hidden;
  opacity: 0;
  transition: max-height .2s var(--ease), opacity .15s var(--ease), margin-top .2s var(--ease);
}
.msg-item:hover .msg-reactions,
.msg-item:focus-within .msg-reactions {
  max-height: 40px;
  opacity: 1;
  margin-top: 4px;
}
.msg-react {
  font-size: .92rem;
  font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",emoji,sans-serif;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 7px;
  cursor: pointer;
  line-height: 1.2;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), background .15s, border-color .15s;
}
.msg-react:hover {
  background: var(--surface);
  border-color: var(--accent);
  transform: scale(1.25);
}
.msg-react.is-firing { transform: scale(1.4) rotate(-6deg); }
.msg-react.is-sent {
  background: rgba(123,181,173,.18);
  border-color: var(--accent);
}
.msg-react-state {
  color: var(--accent-hi);
  font-weight: 500;
  font-size: .7rem;
}

/* Reply form — ascuns până la click, apoi expand subtil sub mesaj */
.msg-reply {
  margin-top: 8px;
  display: flex; flex-direction: column; gap: 6px;
  animation: fadeIn .2s var(--ease);
}
.msg-reply textarea {
  font: inherit; font-size: .85rem;
  width: 100%;
  padding: 7px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border-hi);
  border-radius: 8px;
  color: var(--fg);
  resize: vertical;
  min-height: 36px;
}
.msg-reply textarea:focus { outline: none; border-color: var(--accent); }
.msg-reply-foot { display: flex; gap: 4px; justify-content: flex-end; }
.msg-reply-foot .btn-sm { padding: 5px 12px; font-size: .76rem; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.msg-dismiss {
  flex-shrink: 0;
  align-self: center;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 26px; height: 26px;
  border-radius: 6px;
  cursor: pointer;
  display: grid; place-items: center;
  transition: color .15s var(--ease), border-color .15s var(--ease);
}
.msg-dismiss:hover { color: var(--danger); border-color: rgba(224,122,130,.5); }

/* Lista de fisiere in modal */
.sm-files {
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex; flex-direction: column;
  min-height: 180px;
}
.sm-files-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.sm-files-head h3 { font-size: .76rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0; }
.sm-files-cnt { margin-left: 6px; color: var(--muted-2); font-weight: 400; letter-spacing: 0; }
.sm-files-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; scrollbar-width: thin; }
.sm-files-list::-webkit-scrollbar { width: 4px; }
.sm-files-list::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 2px; }
.sm-files-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sm-f-ico {
  font-family: var(--f-mono);
  font-size: .64rem; font-weight: 600;
  padding: 4px 6px;
  background: var(--surface-hi);
  color: var(--accent-hi);
  border-radius: 4px;
  letter-spacing: .04em;
  min-width: 34px;
  text-align: center;
  flex-shrink: 0;
}
.sm-f-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sm-f-name {
  font-size: .84rem; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  text-decoration: none;
}
.sm-f-name:hover { color: var(--accent-hi); text-decoration: underline; text-underline-offset: 2px; }
.sm-f-meta { font-size: .7rem; color: var(--muted); }
.sm-f-dl {
  display: grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 6px;
  color: var(--muted);
  border: 1px solid var(--border);
  transition: color .15s var(--ease), border-color .15s var(--ease);
  flex-shrink: 0;
}
.sm-f-dl:hover { color: var(--fg); border-color: var(--border-hi); }
.sm-files-empty {
  color: var(--muted-2);
  font-size: .84rem;
  text-align: center;
  flex: 1;
  align-items: center; justify-content: center;
  padding: 20px 12px;
}
.sm-files-empty:not([hidden]) { display: flex; }
.sm-files-empty[hidden] { display: none !important; }

/* Buton icon-only */
.btn.icon-only {
  padding: 0;
  width: 34px; height: 34px;
  display: none;
  align-items: center; justify-content: center;
}
@media (max-width: 900px) {
  .btn.icon-only { display: inline-flex; }
}

.focus-card {
  padding: 32px 0 0;
  background: none;
  border: 0;
  border-top: 1px solid var(--border);
}
.focus-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; flex-wrap: wrap; margin-bottom: 20px;
}
.focus-head h2 { font-size: 1.1rem; font-weight: 500; margin: 6px 0 4px; }
.focus-head p { margin: 0 0 2px; font-size: .88rem; color: var(--muted); }
.path-line {
  font-family: var(--f-mono); font-size: .76rem;
  color: var(--muted-2); margin: 6px 0 0 !important;
}
.focus-meta { display: flex; gap: 28px; }

/* ============ Footer ============ */
.site-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  color: var(--muted-2);
  font-size: .8rem;
  border-top: 1px solid var(--border);
  margin-top: 32px;
  letter-spacing: .02em;
}
.site-footer .f-text { line-height: 1; }
.site-footer .f-dot {
  color: var(--muted-2);
  opacity: .6;
  font-size: .9rem;
  line-height: 1;
}
.site-footer .f-mid {
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--accent-hi);
  text-decoration: none;
  transition: color .15s var(--ease), letter-spacing .15s var(--ease);
  line-height: 1;
}
.site-footer .f-mid:hover {
  color: #B5DFD8;
  letter-spacing: .12em;
}
@media (max-width: 500px) {
  .site-footer { padding: 14px 16px; font-size: .74rem; gap: 10px; }
}

/* ============ Trimite Email — buton in sidebar admin ============ */
.f-mail-btn {
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  margin-top: -14px;
}
button.f-biletele {
  /* normalizare buton vs link */
  text-align: left;
}

/* ============ Announce modal — Trimite email ============ */
.ann-card {
  width: min(840px, 94vw);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}
.ann-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.ann-head-text h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--fg);
  letter-spacing: -.01em;
}
.ann-sub {
  margin: 2px 0 0;
  font-size: .78rem;
  color: var(--muted);
}
.ann-close {
  background: transparent; border: 0; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2);
  transition: all .15s var(--ease);
}
.ann-close:hover { background: var(--bg-2); color: var(--fg); }

/* Body în 2 coloane */
.ann-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}
.ann-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 22px;
  overflow-y: auto;
  min-height: 0;
}
.ann-col-recipients {
  background: var(--bg-2);
  border-right: 1px solid var(--border);
}
.ann-col-message {
  background: var(--bg-1);
}

.ann-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ann-block-grow { flex-shrink: 0; }
.ann-block-body { flex: 1; min-height: 0; }
.ann-block-title {
  margin: 0;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--muted);
}

/* Rândul "Toți studenții" — mai prominent */
.ann-grp-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--fg);
  transition: all .15s var(--ease);
  user-select: none;
}
.ann-grp-row input { margin: 0; cursor: pointer; accent-color: var(--accent); }
.ann-grp-row:hover { border-color: var(--accent); }
.ann-grp-row:has(input:checked) {
  background: rgba(123,181,173,.12);
  border-color: var(--accent);
}
.ann-grp-name { font-weight: 500; }
.ann-grp-count {
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.ann-grp-row:has(input:checked) .ann-grp-count {
  background: rgba(123,181,173,.22);
  color: var(--accent-hi);
}

/* Chips pe materie (Chimie / Fizică / Matematică) */
.ann-grp-mat {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.ann-grp-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 6px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 9px;
  cursor: pointer;
  font-size: .76rem;
  color: var(--fg);
  transition: all .15s var(--ease);
  user-select: none;
  position: relative;
}
.ann-grp-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ann-grp-chip .ann-grp-name {
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: -.01em;
}
.ann-grp-chip .ann-grp-count {
  background: transparent;
  padding: 0;
  font-size: .68rem;
  letter-spacing: .04em;
}
.ann-grp-chip:hover { border-color: var(--border-hi); transform: translateY(-1px); }
/* Materie-specific colors (selected state) */
.ann-mat-chimie:has(input:checked) {
  background: rgba(242,160,112,.16);
  border-color: rgba(242,160,112,.55);
  color: #F2A070;
}
.ann-mat-chimie:has(input:checked) .ann-grp-count { color: #F2A070; }

.ann-mat-fizica:has(input:checked) {
  background: rgba(123,181,173,.16);
  border-color: rgba(123,181,173,.55);
  color: var(--accent-hi);
}
.ann-mat-fizica:has(input:checked) .ann-grp-count { color: var(--accent-hi); }

.ann-mat-matematica:has(input:checked) {
  background: rgba(183,155,224,.16);
  border-color: rgba(183,155,224,.5);
  color: #B79BE0;
}
.ann-mat-matematica:has(input:checked) .ann-grp-count { color: #B79BE0; }

/* Toggle pentru lista studenti individuali */
.ann-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-family: inherit;
  font-size: .82rem;
  color: var(--fg);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.ann-toggle:hover { border-color: var(--accent); }
.ann-toggle .ann-toggle-ico { transition: transform .2s var(--ease); flex-shrink: 0; color: var(--muted-2); }
.ann-toggle[aria-expanded="true"] .ann-toggle-ico { transform: rotate(180deg); }
.ann-toggle span:nth-child(2) { flex: 1; text-align: left; font-weight: 500; }
.ann-toggle-count {
  font-size: .7rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: var(--bg-2);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.ann-toggle-count:not(:empty):not([data-zero]) { background: rgba(123,181,173,.18); color: var(--accent-hi); }

/* Panou expandabil cu studenti */
.ann-stud-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.ann-stud-panel[hidden] { display: none; }

.ann-stud-panel input[type="search"] {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .82rem;
  font-family: inherit;
  color: var(--fg);
  transition: border-color .15s var(--ease);
}
.ann-stud-panel input[type="search"]:focus {
  outline: 0;
  border-color: var(--accent);
}

.ann-stud-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-1);
}
.ann-stud-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .12s var(--ease);
}
.ann-stud-row:last-child { border-bottom: 0; }
.ann-stud-row:hover { background: var(--bg-2); }
.ann-stud-row[hidden] { display: none; }
.ann-stud-row input { margin: 0; cursor: pointer; accent-color: var(--accent); }
.ann-stud-row:has(input:checked) { background: rgba(123,181,173,.10); }
.ann-stud-info { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ann-stud-name { font-weight: 500; color: var(--fg); font-size: .8rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-stud-mail {
  color: var(--muted);
  font-size: .68rem;
  font-family: "JetBrains Mono", Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ann-stud-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700;
  letter-spacing: .02em;
  flex-shrink: 0;
  border: 1px solid transparent;
}
.ann-stud-avatar.ann-mat-chimie     { background: rgba(242,160,112,.14); color: #F2A070; border-color: rgba(242,160,112,.32); }
.ann-stud-avatar.ann-mat-fizica     { background: rgba(123,181,173,.14); color: var(--accent-hi); border-color: rgba(123,181,173,.32); }
.ann-stud-avatar.ann-mat-matematica { background: rgba(183,155,224,.12); color: #B79BE0; border-color: rgba(183,155,224,.28); }

/* Email-uri custom + inputs */
.ann-col textarea,
.ann-col input[type="text"] {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: .85rem;
  font-family: inherit;
  color: var(--fg);
  resize: none;
  transition: border-color .15s var(--ease);
}
.ann-col textarea:focus,
.ann-col input[type="text"]:focus {
  outline: 0;
  border-color: var(--accent);
}
#annCustomEmails {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .76rem;
}
#annBody {
  flex: 1;
  min-height: 200px;
  resize: vertical;
  line-height: 1.55;
}
.ann-hint {
  margin: 0;
  font-size: .7rem;
  color: var(--muted-2);
  font-style: italic;
}

/* Sumar destinatari (compact, sticky in stanga) */
.ann-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 12px 14px;
  background: rgba(123,181,173,.06);
  border: 1px solid rgba(123,181,173,.22);
  border-radius: 10px;
  margin-top: auto;
}
.ann-summary-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--accent-hi);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.ann-summary-label {
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .02em;
}

/* Actiuni footer */
.ann-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--bg-1);
  grid-column: 1 / -1;
  flex-shrink: 0;
}
.ann-actions .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ann-actions .btn-primary svg { flex-shrink: 0; }

/* Succes panel */
.ann-success[hidden] { display: none !important; }
.ann-success:not([hidden]) {
  padding: 56px 30px 44px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.ann-success-ico {
  width: 78px; height: 78px;
  border-radius: 50%;
  background: rgba(107,174,126,.14);
  display: flex; align-items: center; justify-content: center;
  color: var(--ok, #6BAE7E);
  animation: annPop .35s var(--ease) both;
}
@keyframes annPop {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.ann-success h3 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--fg);
}
.ann-success p {
  margin: 0 0 8px;
  color: var(--muted);
  max-width: 360px;
  line-height: 1.5;
}
.ann-success .btn { margin-top: 6px; min-width: 120px; }
.ann-form[hidden] { display: none !important; }

/* Responsive — sub 800px stack pe vertical */
@media (max-width: 800px) {
  .ann-card { width: min(96vw, 600px); max-height: 92vh; }
  .ann-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .ann-col-recipients {
    border-right: 0;
    border-bottom: 1px solid var(--border);
    max-height: 45vh;
  }
  #annBody { min-height: 140px; }
}

/* ============ View log page ============ */
.log-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 32px 60px;
}
.log-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 24px; flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.log-head h1 { margin: 4px 0 0; font-size: 1.6rem; letter-spacing: -.01em; }
.log-head .lede { margin: 6px 0 0; color: var(--muted); font-size: .88rem; }
.log-head code { background: var(--bg-2); padding: 1px 6px; border-radius: 4px; font-size: .82em; }

.log-filters {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
}
.log-filters select,
.log-filters input[type="search"] {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
  font-size: .82rem;
  color: var(--fg);
  font-family: inherit;
}
.log-filters input[type="search"] { min-width: 220px; }
.log-filters select:focus,
.log-filters input[type="search"]:focus { outline: 0; border-color: var(--accent); }

.log-body { background: #0C1618; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.log-empty {
  padding: 40px 24px; text-align: center; color: var(--muted);
}
.log-empty .muted { color: var(--muted-2); font-size: .82rem; margin-top: 4px; }
.log-pre {
  margin: 0;
  padding: 18px 22px;
  font-family: "JetBrains Mono", Consolas, Menlo, monospace;
  font-size: .76rem;
  line-height: 1.55;
  color: var(--fg);
  max-height: calc(100vh - 280px);
  overflow: auto;
  white-space: pre;
  background:
    radial-gradient(circle at 1.5px 1.5px, rgba(154,206,198,.04) 1.5px, transparent 0);
  background-size: 22px 22px;
}
.log-pre::-webkit-scrollbar { width: 6px; height: 6px; }
.log-pre::-webkit-scrollbar-thumb { background: var(--border-hi); border-radius: 3px; }
.log-pre .log-err { color: #E07A82; }
.log-pre .log-warn { color: #E8B85C; }

/* ============ MOBILE / RESPONSIVE ============ */

/* Topbar se pliaza pe doua randuri cand nu mai incape */
@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 16px;
  }
  .topbar-right { gap: 6px; flex-wrap: wrap; }
  .brand { font-size: .88rem; }
  .user-name { display: none; }
  .badge-subj { font-size: .6rem; padding: 4px 8px; }
  .btn-sm { padding: 6px 12px; font-size: .78rem; }
}

/* Admin filtre: sidebar colaps + toggle */
@media (max-width: 900px) {
  body.page-admin { padding-right: 0; }
  .admin-filters {
    transform: translateX(100%);
    transition: transform .25s var(--ease);
    width: 80vw;
    max-width: 320px;
    box-shadow: -20px 0 40px rgba(0,0,0,.45);
  }
  body.filters-open .admin-filters { transform: translateX(0); }
  body.filters-open::before {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 40;
    backdrop-filter: blur(2px);
  }
}

/* Admin grid cards: mai strans pe mobil */
@media (max-width: 600px) {
  .student-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .admin { padding: 20px 16px 32px; }
  .admin-hero h1 { font-size: 1.35rem; }
  .admin-hero .lede { font-size: .82rem; }
  .admin-stats { gap: 20px; }
  .stat-val { font-size: 1.1rem; }
  .s-card { min-height: auto; padding: 16px 18px 18px; }
  .s-name { font-size: 1rem; }
  .s-master { -webkit-line-clamp: 1; min-height: auto; }
}

/* Modal fullscreen pe mobil */
@media (max-width: 600px) {
  .s-modal { padding: 0; }
  .s-modal-card {
    width: 100%;
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    border: 0;
  }
  .s-modal-body { padding: 24px 20px 20px; }
  .sm-head { flex-direction: column; gap: 10px; align-items: flex-start; }
  .sm-stats { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .sm-bars { gap: 10px; }
  .sm-bar { width: 28px; }
  .sm-final-v { font-size: 1.6rem; }
}

/* Dashboard mobile */
@media (max-width: 760px) {
  .dash { padding: 20px 16px 28px; }
  .dash-hero { gap: 14px; }
  .dash-hero h1 { font-size: 1.3rem; }
  .dash-stats { gap: 20px; }
  .upload-zone { padding: 28px 20px; min-height: 140px; }
  .files-table th, .files-table td { padding: 8px 4px; font-size: .82rem; }
  .files-table th:nth-child(3), .files-table td:nth-child(3) { display: none; }
  .pv-card { width: 100%; height: 100vh; margin: 0; border-radius: 0; }
}

/* Preview modal pe mobil */
@media (max-width: 600px) {
  .pv-head { padding: 10px 12px; }
  .pv-name { font-size: .8rem; }
}

/* Login pe mobil */
@media (max-width: 600px) {
  .auth-split { min-height: 100vh; border-radius: 0; border: 0; }
  .auth-art { min-height: 160px; }
  .auth-art-copy { bottom: 20px; left: 20px; right: 20px; }
  .auth-art-copy h2 { font-size: 1.2rem; }
  .auth-form-wrap { padding: 24px 20px; }
  body.page-login { overflow: auto; }
  .auth { padding: 0; align-items: stretch; }
}

/* Grades student (mobil): card mai mic */
@media (max-width: 600px) {
  .student-card { width: 100%; }
  .student-card-content { padding: 18px 18px 14px; }
  .sc-stats { padding: 10px 0; margin: 10px 0 6px; gap: 6px; }
  .sc-stat-val { font-size: 1rem; }
  .sc-bars-row { gap: 10px; }
  .sc-bar { width: 28px; }
  .sc-final-val { font-size: 1.6rem; }
}

/* Reduced motion — elimina parallax si anim. decorative, pastreaza tranzitiile functionale scurte */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  /* Pastram tranzitii scurte pt feedback (hover, focus) — doar anulam pe cele > 350ms */
  .stud-chat.is-focus,
  .m-modal-card,
  body.is-chat-focus::before {
    animation: none !important;
    transform: translate(-50%, -50%) !important;
  }
}

/* Focus ring global pentru keyboard users — aplicat oricarui element interactiv care sterge outline default */
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
label:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
/* Pentru inputuri/textarea care isi au propriul focus ring via border — pastram un halo teal extern */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  box-shadow: 0 0 0 3px rgba(154, 206, 198, 0.18);
}
/* Exceptie: inputuri in containere care deja semnaleaza focus via :focus-within
   (hero-search, m-compose-row, grades-search etc.) — container-ul e indicatorul, nu dublam. */
.hero-search input:focus,
.hero-search input:focus-visible,
.grades-search input:focus,
.grades-search input:focus-visible,
.m-compose-row input:focus,
.m-compose-row input:focus-visible,
.m-compose-row textarea:focus,
.m-compose-row textarea:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* Touch target minim — expand hit area pe butoanele icon-only mici (32px).
   Nu atingem .m-modal-close si .stud-chat-expand (au deja position: absolute in parinte). */
.s-modal-close,
.msg-send,
.icon-btn,
.ut-del,
.ut-code-copy {
  position: relative;
}
.s-modal-close::before,
.msg-send::before,
.icon-btn::before,
.ut-del::before,
.ut-code-copy::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: inherit;
}

/* ============================================================
   MOBILE FIXES — breakpoint 480px (telefoane mici/portrait)
   Adresa probleme de layout/overflow nereparate de breakpoint-urile
   existente (520/560/600/760/900px).
   ============================================================ */

/* Chat focus mode — fullscreen pe telefon (vs centrat 86vh pe desktop) */
@media (max-width: 480px) {
  .stud-chat.is-focus {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    top: 0; left: 0;
    transform: none;
    border-radius: 0;
    border: 0;
  }
  .stud-chat.is-focus .stud-thread { padding: 14px 14px; }
  .stud-chat.is-focus .stud-compose { padding: 8px 12px 12px; }
}

/* msgModal admin — fullscreen pe telefon, nu trunchia */
@media (max-width: 480px) {
  #msgModal .m-modal-card,
  .m-modal-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
  }
}

/* Lightbox preview — fullscreen, butoane mai aproape de margini */
@media (max-width: 480px) {
  .pv-card {
    margin: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    border-radius: 0;
    border: 0;
  }
  .pv-actions { top: 8px; right: 8px; }
  .pv-act { width: 34px; height: 34px; }
  .pv-noheader .pv-name-floating { right: 92px; font-size: .68rem; }
  .pv-noheader .pv-ext-floating { padding: 3px 6px; font-size: .58rem; }
}

/* Topbar — butoane mai compacte pe telefon, evit suprapunere */
@media (max-width: 480px) {
  .topbar { padding: 10px 12px; gap: 6px; }
  .topbar-right { gap: 4px; flex-wrap: wrap; }
  .topbar-right .btn-sm { padding: 6px 9px; font-size: .72rem; }
  .brand {
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
  }
}

/* Bubble attachment — se incadreaza in viewport pe telefon */
@media (max-width: 480px) {
  .m-bubble-att {
    max-width: 100%;
  }
  .m-bubble-att img {
    max-width: 100%;
    max-height: 240px;
  }
  .m-bubble {
    max-width: 88%;
  }
}

/* Chat compose pe telefon — atasament chip + emoji row mai compact */
@media (max-width: 480px) {
  .m-emoji-row { gap: 2px; padding: 0 2px; }
  .m-emoji-row .sm-emoji,
  .m-emoji-row .stud-emoji,
  .m-emoji-row .mm-emoji {
    width: 26px !important;
    height: 26px !important;
    font-size: .9rem;
  }
  .m-att-chip { padding: 5px 7px; gap: 8px; }
  .m-att-chip-img { width: 34px; height: 34px; }
  .m-att-chip-name { font-size: .76rem; }
}

/* Reaction picker — clamp la marginile bubble-ului ca să nu iasă */
@media (max-width: 480px) {
  .m-react-picker {
    flex-wrap: wrap;
    max-width: calc(100vw - 40px);
    justify-content: center;
  }
  .m-react-pick {
    width: 30px;
    height: 30px;
    font-size: 1.05rem;
  }
}

/* Centralizator (admin_grades) — scroll orizontal pe tabel */
@media (max-width: 760px) {
  .grid-scroll, .grades-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .grid-scroll table,
  .grades-scroll table {
    min-width: max-content;
  }
}

/* Users table — ascund coloane mai puțin esentiale pe telefon (păstrăm Nume + Cod + Acțiuni) */
@media (max-width: 600px) {
  .users-tbl { font-size: .8rem; }
  .users-tbl .ut-id,
  .users-tbl .ut-mat,
  .users-tbl .ut-spec { display: none; }
  .users-tbl col.col-id,
  .users-tbl col.col-mat,
  .users-tbl col.col-spec { display: none; }
  .users-tbl .ut-email a {
    display: inline-block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
  }
}
/* =================================================================
   MOBILE — Users page (≤ 640px) → carduri stivuite, fără tabel orizontal
   Țintă: Samsung S22 / 6.2" (~360 px CSS, dpr 3). Fiecare card are info
   esențială stivuită: name+dot · email · meta (FAC/spec/code) · activitate · acțiuni.
   ================================================================= */

@media (max-width: 640px) {
  /* Container — fără overflow orizontal */
  .users-table-wrap { overflow-x: visible; }

  .users-tbl {
    display: block;
    background: transparent;
    border: 0;
    box-shadow: none;
    width: 100%;
  }
  .users-tbl thead,
  .users-tbl colgroup { display: none; }
  .users-tbl tbody {
    display: flex; flex-direction: column;
    gap: 9px;
  }

  /* Fiecare rând devine un card grid */
  .users-tbl tbody tr {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "name    name"
      "email   email"
      "activ   activ"
      "code    actions";
    gap: 9px 10px;
    padding: 13px 14px 11px;
    background: rgba(255, 255, 255, .025);
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: background .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
  }
  .users-tbl tbody tr:hover { background: rgba(255, 255, 255, .04); }
  .users-tbl tbody tr:active { transform: scale(.997); }
  .users-tbl tbody tr:last-child td { border-bottom: 0; }

  .users-tbl tbody td {
    padding: 0 !important;
    border: 0 !important;
    background: transparent;
    text-align: left !important;
    display: block;
    vertical-align: top;
    width: auto;
    min-width: 0;
  }

  /* Hide id, restore email visibility (acum e parte din card) */
  .users-tbl td.ut-id { display: none; }
  .users-tbl col.col-email,
  .users-tbl .ut-email { display: revert; }

  /* Plasare grid */
  .users-tbl td.ut-name  { grid-area: name; }
  .users-tbl td.ut-email { grid-area: email; }
  .users-tbl td.ut-code  { grid-area: code; text-align: left !important; align-self: center; }
  .users-tbl td.ut-activ { grid-area: activ; padding-top: 2px !important; }
  .users-tbl td.ut-act   { grid-area: actions; align-self: center; }

  /* Numele — păstrează avatar+text inline; lasă spațiu de 36px sus-dreapta pentru dot */
  .ut-name { padding-right: 28px; }
  .ut-avatar { width: 36px; height: 36px; font-size: .76rem; }
  .ut-nume { font-size: .94rem; }
  .ut-master {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Email — link mai mic, full width */
  .ut-email a {
    font-size: .8rem;
    color: var(--muted);
    text-decoration: none;
    word-break: break-all;
  }

  /* Meta row: badge mat + badge spec + cod pill (la dreapta) */
  .ut-mat-badge,
  .ut-spec-badge { vertical-align: middle; }
  .ut-code { white-space: nowrap; }
  .ut-code-pill { padding: 4px 9px; font-size: .72rem; }
  .ut-code-val { font-size: .7rem; }

  /* Activitate — dot extras în colțul card-ului, rândurile rămân inline */
  .ut-activ-wrap {
    gap: 0;
    flex-wrap: wrap;
  }
  .ut-dot {
    /* Pop afară din wrap și plasează în colțul drept-sus al cardului */
    position: absolute;
    top: 13px; right: 13px;
    z-index: 2;
    width: 10px; height: 10px;
  }
  .ut-activ-rows {
    flex-direction: row;
    gap: 12px;
    width: 100%;
  }
  .ut-activ-row { font-size: .7rem; gap: 5px; }
  .ut-activ-lbl { display: inline; }
  .ut-activ-val { font-size: .7rem; }

  /* Acțiuni — wrap aliniat la dreapta */
  .ut-act-wrap {
    justify-content: flex-end;
    gap: 8px;
  }

  /* Toolbar — search full-width pe linie nouă */
  .users-main { padding: 18px 12px 32px; }
  .admin-hero { gap: 14px; }
  .admin-hero h1 { font-size: 1.5rem; }
  .admin-hero-right { flex-wrap: wrap; gap: 8px; row-gap: 10px; }
  .users-toolbar { flex-wrap: wrap; gap: 8px; }
  .users-search { flex: 1 1 100%; min-width: 0; }
  .users-search .hero-search-kbd { display: none; }
  .users-filter { flex: 0 0 auto; }
  .users-count { margin-left: auto; font-size: .76rem; }

  /* Empty/no-match state — aerisit */
  .users-empty { padding: 36px 18px; }
  .users-no-match { padding: 24px 14px; text-align: center; }
}

/* Samsung S22 / 360 px — tighter packing */
@media (max-width: 400px) {
  .users-tbl tbody tr {
    padding: 11px 11px 10px;
    gap: 8px;
  }
  .ut-name { padding-right: 24px; }
  .ut-avatar { width: 32px; height: 32px; font-size: .7rem; }
  .ut-nume { font-size: .9rem; }
  .ut-master { font-size: .68rem; }
  .ut-code-pill { padding: 3px 7px; }
  .ut-creds, .ut-edit, .ut-del { width: 28px; height: 28px; }
  .ut-act-wrap { gap: 6px; }
  .ut-activ-rows { gap: 9px; }
  .ut-dot { top: 11px; right: 11px; width: 9px; height: 9px; }

  /* Hero — ascund descrierea „Gestionează studenții..." pentru a câștiga spațiu */
  .admin-hero .lede { display: none; }
  .admin-hero h1 { font-size: 1.3rem; margin-bottom: 4px; }
  .users-stats-inline { font-size: .76rem; padding: 5px 10px; }
}

/* Admin filters drawer — full-width pe telefon */
@media (max-width: 480px) {
  body.page-admin .admin-filters {
    width: 100%;
    max-width: 100%;
  }
}

/* Login mobile — sub 760px: ascund cardul cu video, las doar formularul
   ca o casetă glass deasupra fundalului mare cu poza de landing.
   Mai curat, focusat, fără banner mare deasupra inutil pe portrait. */
@media (max-width: 760px) {
  body.page-login {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
  body.page-login::before {
    position: fixed;
    background: linear-gradient(140deg, rgba(10,18,20,.55) 0%, rgba(10,18,20,.82) 100%);
  }
  .auth {
    padding: 28px 18px;
    place-items: center;
    min-height: 100dvh;
  }
  .auth-split {
    grid-template-columns: 1fr;
    min-height: auto;
    max-width: 420px;
    background: rgba(14, 24, 27, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
  }
  .auth-art { display: none; }
  .auth-form-wrap { padding: 30px 22px 24px; }
  .auth-card h1 {
    font-size: 1.32rem;
    letter-spacing: -.01em;
  }
  .auth-card .subtitle { font-size: .82rem; margin-bottom: 22px; }
  .auth-tabs { gap: 18px; margin-bottom: 22px; }
  .auth-tabs .tab { font-size: .88rem; }
  .form { gap: 12px; }
  .auth-hint { margin-top: 18px; font-size: .74rem; }
}
@media (max-width: 380px) {
  .auth-split { max-width: 100%; border-radius: 14px; }
  .auth-form-wrap { padding: 26px 18px 20px; }
  .auth-card h1 { font-size: 1.22rem; }
  .auth { padding: 20px 12px; }
}

/* Confirm modal — ramane in viewport pe ecrane minuscule */
@media (max-width: 380px) {
  .m-modal.confirm-compact .confirm-card {
    width: calc(100vw - 24px);
    padding: 14px 16px 12px;
  }
  .m-modal.confirm-compact .confirm-actions .btn {
    padding: 7px 12px;
    min-width: 68px;
  }
}

/* Announce modal — fullscreen pe telefon */
@media (max-width: 480px) {
  .ann-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh;
    height: 100dvh;
    max-height: none !important;
    border-radius: 0;
  }
}

/* Student modal (admin → card click) — full pe telefon */
@media (max-width: 480px) {
  .s-modal-card,
  .add-user-card {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh;
    height: 100dvh;
    max-height: none !important;
    border-radius: 0;
    margin: 0;
  }
  .s-modal-card .sm-grid { grid-template-columns: 1fr !important; }
}

/* Touch targets — ridic minim 40×40 pe telefon pentru butoane mici */
@media (max-width: 480px) {
  .icon-btn,
  .pv-act,
  .ann-close,
  .m-modal-close,
  .stud-chat-expand {
    min-width: 40px;
    min-height: 40px;
  }
}
