/* ==========================================================================
   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;
}

/* Lessons page — pagina dedicata; rail uniform cu dashboard (1100) */
.lessons-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 28px 40px;
  display: flex; flex-direction: column; gap: 16px;
}
/* Cardul efectiv ramane citibil — centrat si narrow */
.lessons-main .lessons-box { max-width: 820px; width: 100%; align-self: center; }
.lessons-main .dash-hero   { max-width: 820px; width: 100%; align-self: center; }
.lessons-main .lessons-note{ max-width: 820px; width: 100%; align-self: center; }
.lessons-note {
  margin-top: 14px;
  font-size: .76rem;
  color: var(--muted-2);
  line-height: 1.5;
}
.lessons-note a { color: var(--accent-hi); }

/* Lecțiile mele — card */
.lessons-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 22px 16px;
}
.lessons-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 12px;
}
.lessons-head h2 {
  font-size: .8rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent-hi);
  margin: 0;
}
.lessons-hint {
  font-size: .76rem; color: var(--muted-2); font-style: italic;
}
.lessons-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 6px;
}
.lesson-item {
  display: grid; grid-template-columns: 90px 1fr;
  align-items: center; gap: 14px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.lesson-item.is-empty { opacity: .65; border-style: dashed; }
.lesson-lbl {
  font-family: var(--f-mono);
  font-size: .78rem; font-weight: 700;
  color: var(--accent-hi);
  letter-spacing: .04em;
}
.lesson-item.is-empty .lesson-lbl { color: var(--muted-2); }
.lesson-title {
  font-size: .92rem;
  color: var(--fg);
  line-height: 1.4;
}
.lesson-item.is-empty .lesson-title {
  font-style: italic;
  color: var(--muted-2);
}
@media (max-width: 560px) {
  .lesson-item { grid-template-columns: 1fr; gap: 4px; }
}

/* 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: 1000; display: flex; flex-direction: column; }
.pv-modal[hidden] { display: none; }
.pv-backdrop { position: absolute; inset: 0; background: rgba(5,10,11,.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.pv-card {
  position: relative;
  z-index: 2;
  margin: 32px auto;
  width: min(1000px, calc(100vw - 64px));
  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);
}
.pv-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.pv-name {
  flex: 1; font-size: .88rem; color: var(--fg);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex; align-items: center; justify-content: center;
  background: #0a1214;
  overflow: auto;
}
.pv-body iframe,
.pv-body img {
  width: 100%; height: 100%;
  border: 0; object-fit: contain;
  display: block;
}
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;
  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 var(--border);
  background: var(--bg-2);
}
@media (max-width: 820px) { .auth-split { grid-template-columns: 1fr; min-height: auto; } }

.auth-art { position: relative; min-height: 300px; overflow: hidden; }
.auth-art-image { position: absolute; inset: 0; background-size: cover; background-position: center; }
.auth-art-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,18,20,.3) 0%, rgba(10,18,20,.75) 100%);
}
.auth-art-copy { position: absolute; bottom: 32px; left: 32px; right: 32px; z-index: 2; }
.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;
}
.auth-tabs .tab {
  padding: 10px 0;
  font-size: .9rem; font-weight: 500;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
  border-radius: 0;
  background: none !important;
  box-shadow: none !important;
}
.auth-tabs .tab:hover { color: var(--fg); }
.auth-tabs .tab.is-active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}

.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); }
.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; }

/* Buton mail per row */
.ut-creds {
  width: 28px; height: 28px;
  display: inline-grid; place-items: center;
  border-radius: 7px;
  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: 56px; }
.users-tbl col.col-name  { width: auto; }
.users-tbl col.col-email { width: 28%; }
.users-tbl col.col-mat   { width: 60px; }
.users-tbl col.col-spec  { width: 80px; }
.users-tbl col.col-code  { width: 150px; }
.users-tbl col.col-act   { width: 100px; }
.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 {
  text-align: center;
  white-space: nowrap;
  padding-left: 0 !important;
  padding-right: 0 !important;
}
.ut-act > button { margin-left: 6px; }
.ut-act > button:first-child { margin-left: 0; }
.ut-edit,
.ut-del {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center;
  background: transparent;
  border: 1px solid transparent;
  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);
}

/* 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; }
.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;
}

.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;
  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; }

.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;
  animation: hero-sort-pop .16s var(--ease);
}
.hero-sort-menu[hidden] { display: none; }
@keyframes hero-sort-pop {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.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);
}
.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); }

@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;
}
.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);
}
.m-modal-card {
  position: relative; z-index: 2;
  width: min(640px, calc(100vw - 48px));
  max-height: 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;
}
.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;
}

/* 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;
  max-height: 140px;
  overflow-y: hidden; /* ascuns default — autogrow JS ridica inaltimea pana la max */
  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 {
  max-height: 420px;
  min-height: 160px;
  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;
}
