/* ------------------------------------------------------------------
   Base
------------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:root {
  --brand: #0f766e;
  --brand-2: #0d9488;
  --brand-dark: #0b3b3a;
  --accent: #0f766e;
  --accent-soft: #ecfdf9;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e5ecef;
  --bg: #f6f8fa;
  --surface: #ffffff;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --radius: 20px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -18px rgba(15, 23, 42, 0.3);
  --shadow-md: 0 18px 40px -24px rgba(15, 23, 42, 0.45);
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Cairo', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  line-height: 1.65;
  background-color: var(--bg);
  background-image: radial-gradient(circle at 10% -5%, rgba(13, 148, 136, 0.12), transparent 40%),
    radial-gradient(circle at 92% 4%, rgba(245, 158, 11, 0.1), transparent 36%);
  background-attachment: fixed;
}

h1,
h2,
h3,
p {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 3px solid rgba(13, 148, 136, 0.45);
  outline-offset: 2px;
}

body.modal-open {
  overflow: hidden;
}

.shell {
  width: min(1180px, 100%);
  margin-inline: auto;
  padding-inline: 22px;
}

.muted {
  color: var(--muted);
}

.ltr {
  direction: ltr;
  unicode-bidi: embed;
}

/* ------------------------------------------------------------------
   Branch accents
------------------------------------------------------------------ */

.b-PC {
  --accent: #0284c7;
  --accent-soft: #e0f2fe;
}

.b-SVT {
  --accent: #15803d;
  --accent-soft: #dcfce7;
}

.b-ADAB {
  --accent: #7c3aed;
  --accent-soft: #ede9fe;
}

.b-MATH {
  --accent: #6d28d9;
  --accent-soft: #ede9fe;
}

/* Classes from eleve 20 aout.pdf */
.b-TCLSH-1,
.b-TCSF-1,
.b-TCSF-2,
.b-TCSF-3,
.b-TCSF-4 {
  --accent: #0284c7;
  --accent-soft: #e0f2fe;
}

.b-1BACSEF-1,
.b-1BACSEF-2,
.b-1BACSMF-1 {
  --accent: #15803d;
  --accent-soft: #dcfce7;
}

.b-1BACSH-1,
.b-2BACSH-1 {
  --accent: #7c3aed;
  --accent-soft: #ede9fe;
}

.b-2BACSPCF-1 {
  --accent: #6d28d9;
  --accent-soft: #ede9fe;
}

/* ------------------------------------------------------------------
   Buttons
------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.68rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #eef3f5;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease,
    border-color 0.15s ease, opacity 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  box-shadow: 0 12px 26px -14px rgba(15, 118, 110, 0.9);
}

.btn.primary:hover {
  box-shadow: 0 16px 30px -12px rgba(15, 118, 110, 0.8);
}

.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: #334155;
}

.btn.ghost:hover {
  border-color: #c8d6da;
  background: #fff;
}

.btn.on-dark {
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
  background: transparent;
}

.btn.on-dark:hover {
  background: rgba(255, 255, 255, 0.14);
}

.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #fecaca;
}

.btn.danger:hover {
  background: #fee2e2;
}

.btn.small {
  padding: 0.42rem 0.85rem;
  font-size: 0.82rem;
}

.btn.block {
  width: 100%;
}

.icon-btn {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 10px;
  background: #f1f5f7;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: #e4ebee;
  color: var(--ink);
}

/* ------------------------------------------------------------------
   Avatars & badges
------------------------------------------------------------------ */

.avatar {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #0f766e, #0d9488);
  color: #fff;
  font-weight: 800;
  font-size: 0.82rem;
  line-height: 1;
  letter-spacing: 0.02em;
  user-select: none;
}

.avatar.sm {
  width: 32px;
  height: 32px;
  font-size: 0.72rem;
}

.avatar.xs {
  width: 30px;
  height: 30px;
  font-size: 0.7rem;
}

.avatar.lg {
  width: 64px;
  height: 64px;
  font-size: 1.15rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.72rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.5;
}

.badge.role-student {
  background: #e0f2fe;
  color: #0369a1;
}

.badge.role-teacher {
  background: #dcfce7;
  color: #15803d;
}

.badge.role-admin {
  background: #fef3c7;
  color: #92400e;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: #f1f5f7;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

/* ------------------------------------------------------------------
   Topbar
------------------------------------------------------------------ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding-block: 6px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: start;
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 10px 22px -12px rgba(15, 118, 110, 0.9);
}

.logo-full-top {
  display: block;
  height: 38px;
  width: auto;
  max-width: 190px;
  flex: 0 0 auto;
  object-fit: contain;
}

.logo-full-top-dark {
  display: none;
}

[data-theme="dark"] .logo-full-top-light {
  display: none;
}

[data-theme="dark"] .logo-full-top-dark {
  display: block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 0.9rem;
  font-weight: 800;
}

.brand-text small {
  font-size: 0.66rem;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px 2px 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fbfdfd;
}

button.user-chip {
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

button.user-chip:hover {
  border-color: #a7d9d3;
  background: #f2fbf9;
}

[dir='ltr'] .user-chip {
  padding: 2px 2px 2px 9px;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-meta strong {
  font-size: 0.74rem;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta small {
  font-size: 0.62rem;
  color: var(--muted);
}

.topbar .avatar.sm {
  width: 26px;
  height: 26px;
  font-size: 0.64rem;
}

.topbar .btn.small {
  padding: 0.32rem 0.62rem;
  font-size: 0.75rem;
}

/* ------------------------------------------------------------------
   Auth / login
------------------------------------------------------------------ */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}

.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: clamp(32px, 5vw, 64px);
  color: #fff;
  background: linear-gradient(155deg, #082f2e 0%, #0f766e 55%, #0d9488 100%);
}

.auth-brand::before,
.auth-brand::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.auth-brand::before {
  width: 420px;
  height: 420px;
  top: -160px;
  inset-inline-end: -120px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), transparent 65%);
}

.auth-brand::after {
  width: 520px;
  height: 520px;
  bottom: -240px;
  inset-inline-start: -180px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.18), transparent 62%);
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-block: auto;
}

.auth-logo .logo-mark {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  font-size: 1.6rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: none;
  margin-bottom: 14px;
}

.auth-logo-full {
  margin: 0 0 12px;
  line-height: 0;
}

.auth-logo-full .logo-full {
  display: block;
  width: 100%;
  max-width: 620px;
  height: auto;
}

.auth-brand h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.auth-latin {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
}

.auth-tagline {
  font-size: 1rem;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.86);
  max-width: 46ch;
  margin-top: 6px;
}

.auth-points {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 18px;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.92);
}

.auth-points li span {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 1.05rem;
}

.auth-brand-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
}

.auth-panel {
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vw, 48px);
}

.auth-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: clamp(24px, 3vw, 36px);
  box-shadow: 0 30px 60px -40px rgba(15, 23, 42, 0.55);
}

.auth-card.auth-card-wide {
  width: min(760px, 100%);
}

.auth-card h2 {
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.auth-card > .muted {
  font-size: 0.9rem;
  margin-bottom: 22px;
}

.auth-card form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-note {
  margin-top: 20px;
  padding: 10px 12px;
  border: 1px dashed #dbe5e9;
  border-radius: 12px;
  background: #f8fbfb;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.7;
}

/* ------------------------------------------------------------------
   Forms
------------------------------------------------------------------ */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field > span {
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

.field > span em {
  color: #dc2626;
  font-style: normal;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.72rem 0.9rem;
  border: 1px solid #d7e2e7;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-size: 0.92rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.7;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.class-picker {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfd;
}

.class-picker legend {
  padding: 0 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #475569;
}

.class-picker .file-hint {
  margin-top: -4px;
}

.class-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.class-group > strong {
  font-size: 0.78rem;
  color: var(--muted);
}

.class-options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.class-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1.4;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.class-option input {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

.class-option:has(input:checked) {
  border-color: var(--brand);
  background: var(--accent-soft);
}

.field input::placeholder,
.field textarea::placeholder {
  color: #a8b6bd;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.14);
}

.field input[type='email'],
.field input[type='password'],
.field input[type='url'] {
  direction: ltr;
  text-align: start;
}

[dir='ltr'] .field input[type='email'],
[dir='ltr'] .field input[type='password'],
[dir='ltr'] .field input[type='url'] {
  text-align: left;
}

.form-error {
  margin: 0;
  padding: 0.65rem 0.9rem;
  border: 1px solid #fecaca;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 600;
}

/* ------------------------------------------------------------------
   Page & hero
------------------------------------------------------------------ */

.page {
  padding-block: 34px 84px;
}

.hero {
  margin-bottom: 30px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.1);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.page-title {
  font-size: clamp(1.75rem, 3.2vw, 2.55rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.015em;
  margin-top: 0.55rem;
}

.lede {
  max-width: 64ch;
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.9;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.profile-meta span {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.78rem;
}

.quick-link {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 18px;
  padding: 0.55rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: #fff;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.quick-link:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.quick-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.quick-arrow {
  font-size: 0.95rem;
}

/* ------------------------------------------------------------------
   Grids & cards
------------------------------------------------------------------ */

.grid {
  display: grid;
  gap: 18px;
}

.grid.levels {
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
}

.grid.branches {
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
}

.grid.cards {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.level-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 186px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: start;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.level-card:hover {
  transform: translateY(-4px);
  border-color: #a7d9d3;
  box-shadow: var(--shadow-md);
}

.level-code {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.15rem 0.6rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.level-name {
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.5;
}

.level-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.level-foot .arrow,
.branch-card .arrow {
  color: var(--brand);
  font-size: 1.05rem;
  transition: transform 0.18s ease;
}

.level-card:hover .arrow,
.branch-card:hover .arrow {
  transform: translateX(-5px);
}

[dir='ltr'] .level-card:hover .arrow,
[dir='ltr'] .branch-card:hover .arrow {
  transform: translateX(5px);
}

.branch-card {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: start;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.branch-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.branch-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.branch-icon span {
  display: block;
  line-height: 1.05;
}

.branch-icon.lg {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  font-size: 0.95rem;
}

.branch-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.branch-name {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
}

.branch-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ------------------------------------------------------------------
   Crumbs, branch head, tabs
------------------------------------------------------------------ */

.crumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  font-size: 0.84rem;
  color: var(--muted);
}

.crumb-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 700;
  font-size: inherit;
  cursor: pointer;
}

.crumb-link:hover {
  text-decoration: underline;
}

.crumb-sep {
  color: #c2cfd5;
}

.branch-head {
  position: relative;
  overflow: hidden;
  padding: 26px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(130deg, var(--accent-soft), #fff 62%);
  box-shadow: var(--shadow-sm);
}

.branch-head::after {
  content: '';
  position: absolute;
  width: 220px;
  height: 220px;
  inset-inline-end: -70px;
  top: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent), transparent 70%);
  opacity: 0.12;
  pointer-events: none;
}

.branch-head-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 18px;
}

.branch-head h1 {
  font-size: clamp(1.35rem, 2.8vw, 2rem);
  font-weight: 800;
  line-height: 1.4;
  margin-block: 0.45rem 0.2rem;
}

.branch-head .muted {
  font-size: 0.86rem;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-block: 22px 18px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdfd;
  overflow-x: auto;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.tab:hover {
  color: var(--ink);
  background: #eff4f6;
}

.tab.is-active {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(15, 118, 110, 0.9);
}

.tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: 999px;
  background: #eef3f5;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.tab.is-active .tab-count {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-head h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.12rem;
  font-weight: 800;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 26px;
  padding-inline: 8px;
  border-radius: 999px;
  background: #eef3f5;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

/* ------------------------------------------------------------------
   Lessons / teachers / announcements
------------------------------------------------------------------ */

.lesson-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.lesson-card:hover {
  transform: translateY(-2px);
  border-color: #cfe2e6;
  box-shadow: var(--shadow-md);
}

.lesson-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.lesson-index {
  flex: 0 0 auto;
  padding: 0.15rem 0.45rem;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--brand);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.lesson-top h3 {
  font-size: 1.03rem;
  font-weight: 800;
  line-height: 1.6;
}

.lesson-desc {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.8;
}

.lesson-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.teacher-inline {
  display: flex;
  align-items: center;
  gap: 9px;
}

.teacher-inline strong {
  display: block;
  font-size: 0.83rem;
  line-height: 1.4;
}

.teacher-inline small {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.4;
}

.date {
  font-size: 0.73rem;
  color: #94a3b8;
  white-space: nowrap;
}

.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lesson-gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.thumb {
  width: 76px;
  height: 76px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #f1f5f9;
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px -14px rgba(15, 23, 42, 0.55);
}

.thumb:focus-visible {
  outline: 2px solid var(--brand-2);
  outline-offset: 2px;
}

.teacher-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.teacher-card h3 {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 800;
}

.teacher-card .teacher-subject {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
}

.teacher-card .muted {
  font-size: 0.82rem;
}

.teacher-card .mail {
  margin-top: 4px;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: #f6f9fa;
  color: var(--brand);
  font-size: 0.76rem;
  text-decoration: none;
  direction: ltr;
  unicode-bidi: embed;
}

.teacher-card .mail:hover {
  background: var(--accent-soft);
}

.announcement-list {
  display: grid;
  gap: 14px;
}

.announcement-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.announce-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.scope {
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 700;
}

.announcement-card h3 {
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1.55;
}

.announcement-card p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.85;
}

.announce-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.announce-foot .muted {
  font-size: 0.78rem;
}

.empty {
  padding: 46px 22px;
  border: 1px dashed #cfdce1;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.65);
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.empty-icon {
  display: block;
  font-size: 1.8rem;
  margin-bottom: 8px;
  line-height: 1;
}

/* ------------------------------------------------------------------
   Admin dashboard
------------------------------------------------------------------ */

.admin-hero {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 26px;
  padding: 28px 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: radial-gradient(circle at 100% 0%, rgba(13, 148, 136, 0.16), transparent 46%), var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.admin-hero::after {
  content: '';
  position: absolute;
  inset-inline-end: -70px;
  inset-block-start: -90px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(13, 148, 136, 0.13), transparent 70%);
  pointer-events: none;
}

.admin-hero-copy {
  position: relative;
  z-index: 1;
  max-width: 64ch;
}

.admin-hero .page-title {
  margin-top: 0.5rem;
}

.admin-hero .lede {
  margin-top: 0.4rem;
}

.admin-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 1.1rem;
  background: rgba(13, 148, 136, 0.12);
}

.stat-card.blue .stat-icon { background: rgba(37, 99, 235, 0.12); }
.stat-card.amber .stat-icon { background: rgba(245, 158, 11, 0.14); }
.stat-card.violet .stat-icon { background: rgba(124, 58, 237, 0.13); }

.stat-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.3;
}

.stat-value {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.stat-label {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-page > .admin-block {
  margin-top: 26px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.admin-page > .admin-block .table-wrap {
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
}

.admin-page > .admin-block .table th {
  background: transparent;
  border-bottom: 1px solid var(--line);
}

/* ------------------------------------------------------------------
   Admin table
------------------------------------------------------------------ */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.table th {
  padding: 13px 16px;
  background: #f8fafb;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-align: start;
  white-space: nowrap;
}

.table td {
  padding: 13px 16px;
  border-top: 1px solid #eef2f4;
  vertical-align: middle;
}

.table tbody tr:hover {
  background: #fbfdfd;
}

.table .align-end {
  text-align: end;
}

.cell-user {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
}

.you {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(13, 148, 136, 0.12);
  color: var(--brand);
  font-size: 0.67rem;
  font-style: normal;
  font-weight: 700;
}

/* ------------------------------------------------------------------
   Modals & toasts
------------------------------------------------------------------ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
  animation: fade 0.18s ease;
}

.modal {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: 0 40px 80px -30px rgba(15, 23, 42, 0.6);
  animation: pop 0.2s ease;
}

.modal.wide {
  width: min(720px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 24px 0;
}

.modal-head h3 {
  font-size: 1.16rem;
  font-weight: 800;
  line-height: 1.5;
}

.modal-head p {
  margin-top: 4px;
  font-size: 0.82rem;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 24px 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.field input[type='file'] {
  padding: 0.62rem 0.9rem;
  border-style: dashed;
  background: #f8fafc;
  font-size: 0.85rem;
  cursor: pointer;
}

.field input[type='file']::file-selector-button {
  margin-inline-end: 10px;
  padding: 0.42rem 0.85rem;
  border: 0;
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--brand);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.file-hint {
  display: block;
  font-size: 0.73rem;
  line-height: 1.7;
  color: var(--muted);
}

.lightbox {
  display: flex;
  flex-direction: column;
}

.lightbox-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
  font-weight: 700;
}

.lightbox-bar span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lightbox-img {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #0f172a;
}

.lightbox .modal-actions {
  padding: 0 18px 16px;
}

.confirm-text {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #334155;
}

.toast-root {
  position: fixed;
  inset-inline: 0;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding-inline: 16px;
}

.toast {
  max-width: 92vw;
  padding: 0.72rem 1.2rem;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.86rem;
  font-weight: 600;
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.8);
  animation: rise 0.22s ease;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.error {
  background: var(--danger);
}

.toast.out {
  opacity: 0;
  transform: translateY(8px);
}

/* ------------------------------------------------------------------
   Skeleton & animations
------------------------------------------------------------------ */

.skeleton {
  height: 200px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #eef2f4 25%, #f9fbfc 37%, #eef2f4 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------------------------------------------
   Responsive
------------------------------------------------------------------ */

@media (max-width: 980px) {
  .auth {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    padding: 36px 28px;
    gap: 22px;
  }

  .auth-brand-inner {
    max-width: 620px;
    margin-block: 0;
  }

  .auth-points {
    display: none;
  }

  .auth-brand-foot {
    margin-top: 4px;
  }

  .auth-panel {
    padding-block: 34px 56px;
  }
}

@media (max-width: 760px) {
  .form-row {
    grid-template-columns: 1fr;
  }

  .logo-full-top {
    height: 32px;
  }

  .topbar-inner {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .topbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .user-chip {
    margin-inline-start: auto;
  }

  .user-meta {
    display: none;
  }

  .page {
    padding-block: 24px 64px;
  }

  .branch-head {
    padding: 22px;
  }

  .branch-head-main {
    gap: 13px;
  }

  .branch-icon.lg {
    width: 54px;
    height: 54px;
  }

  .grid.cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .shell {
    padding-inline: 16px;
  }

  .brand-text small {
    display: none;
  }

  .auth-card {
    padding: 22px 18px;
  }

  .modal-backdrop {
    padding: 10px;
  }

  .modal-head {
    padding: 18px 18px 0;
  }

  .modal-body {
    padding: 16px 18px 20px;
  }

  .panel-head {
    align-items: flex-start;
  }

  .level-card {
    min-height: 160px;
    padding: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f2fbf9;
  color: #0f766e;
  font-size: 0.82rem;
  font-weight: 700;
}
.chip-clear {
  border: 0;
  background: transparent;
  color: #0f766e;
  cursor: pointer;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0 2px;
}
.teacher-lessons-hint {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--muted);
}
.teacher-card {
  cursor: pointer;
}

.link-btn { border:0; background:transparent; color:var(--brand); cursor:pointer; font:inherit; padding:0; text-decoration:underline; }

.avatar-img { object-fit: cover; }


/* ------------------------------------------------------------------ */
/* Dark mode                                                           */
/* ------------------------------------------------------------------ */
[data-theme="dark"] {
  --brand: #2dd4bf;
  --brand-2: #14b8a6;
  --brand-dark: #0f766e;
  --accent: #2dd4bf;
  --accent-soft: #134e4a;
  --ink: #e2e8f0;
  --muted: #94a3b8;
  --line: #1e293b;
  --bg: #0b1120;
  --surface: #1e293b;
  --danger: #f87171;
  --danger-soft: #3f1d1d;
  color-scheme: dark;
}
[data-theme="dark"] body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 10% -5%, rgba(45, 212, 191, 0.08), transparent 40%),
    radial-gradient(circle at 92% 4%, rgba(245, 158, 11, 0.06), transparent 36%);
}
[data-theme="dark"] .auth-brand { background: linear-gradient(160deg, #0b3b3a, #0f766e); }
[data-theme="dark"] .modal { background: var(--surface); }
[data-theme="dark"] .toast { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
[data-theme="dark"] .auth-card { background: var(--surface); }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #1e293b, #334155, #1e293b); }

[data-theme="dark"] .topbar {
  background: rgba(15, 23, 42, 0.86);
}
[data-theme="dark"] .brand-text small,
[data-theme="dark"] .user-meta small {
  color: var(--muted);
}
[data-theme="dark"] .topbar .btn.ghost {
  color: var(--ink);
  border-color: var(--line);
}
[data-theme="dark"] .topbar .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .auth-note {
  background: #1e293b;
  border-color: var(--line);
  color: var(--muted);
}
[data-theme="dark"] .auth-card h2 { color: var(--ink); }
[data-theme="dark"] .field > span { color: var(--muted); }
[data-theme="dark"] .class-picker { background: #0f172a; }
[data-theme="dark"] .class-picker legend,
[data-theme="dark"] .class-group > strong { color: var(--muted); }
[data-theme="dark"] .class-option { background: #0f172a; }
[data-theme="dark"] .class-option:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--brand);
}
[data-theme="dark"] input, [data-theme="dark"] select, [data-theme="dark"] textarea {
  background: #0f172a;
  color: var(--ink);
  border-color: var(--line);
}
[data-theme="dark"] .modal { background: var(--surface); color: var(--ink); }
[data-theme="dark"] .modal-head h3 { color: var(--ink); }
[data-theme="dark"] .table { color: var(--ink); }
[data-theme="dark"] .table tbody tr { border-color: var(--line); }
[data-theme="dark"] .table tbody tr:hover { background: rgba(255,255,255,0.03); }
[data-theme="dark"] .lesson-card, [data-theme="dark"] .teacher-card { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .empty { color: var(--muted); }
[data-theme="dark"] .skeleton { background: linear-gradient(90deg, #1e293b, #334155, #1e293b); }

[data-theme="dark"] .b-PC { --accent: #38bdf8; --accent-soft: rgba(56, 189, 248, 0.14); }
[data-theme="dark"] .b-SVT { --accent: #4ade80; --accent-soft: rgba(74, 222, 128, 0.14); }
[data-theme="dark"] .b-ADAB { --accent: #a78bfa; --accent-soft: rgba(167, 139, 250, 0.14); }
[data-theme="dark"] .b-MATH { --accent: #c084fc; --accent-soft: rgba(192, 132, 252, 0.14); }
[data-theme="dark"] .b-TCLSH-1,
[data-theme="dark"] .b-TCSF-1,
[data-theme="dark"] .b-TCSF-2,
[data-theme="dark"] .b-TCSF-3,
[data-theme="dark"] .b-TCSF-4 { --accent: #38bdf8; --accent-soft: rgba(56, 189, 248, 0.14); }
[data-theme="dark"] .b-1BACSEF-1,
[data-theme="dark"] .b-1BACSEF-2,
[data-theme="dark"] .b-1BACSMF-1 { --accent: #4ade80; --accent-soft: rgba(74, 222, 128, 0.14); }
[data-theme="dark"] .b-1BACSH-1,
[data-theme="dark"] .b-2BACSH-1 { --accent: #a78bfa; --accent-soft: rgba(167, 139, 250, 0.14); }
[data-theme="dark"] .b-2BACSPCF-1 { --accent: #c084fc; --accent-soft: rgba(192, 132, 252, 0.14); }
/* branch cards / panels in dark mode */
[data-theme="dark"] .branch-card,
[data-theme="dark"] .lesson-card,
[data-theme="dark"] .announcement-card { background: var(--surface); border-color: var(--line); }
[data-theme="dark"] .quick-link { background: var(--surface); border-color: var(--line); color: var(--ink); }
[data-theme="dark"] .filter-chip { background: rgba(255,255,255,0.06); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .chip-clear { color: var(--ink); }

[data-theme="dark"] .btn { background: #1e293b; color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .btn:hover { background: #334155; }
[data-theme="dark"] .btn.primary { background: var(--brand); color: #0b1120; border-color: transparent; }
[data-theme="dark"] .btn.primary:hover { background: var(--brand-2); }
[data-theme="dark"] .btn.ghost { background: transparent; }
[data-theme="dark"] .btn.danger { background: #3f1d1d; color: #fca5a5; border-color: #7f1d1d; }
[data-theme="dark"] .tab { background: transparent; color: var(--muted); }
[data-theme="dark"] .tab.is-active { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .badge { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .pill { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .crumb-link { color: var(--muted); }
[data-theme="dark"] .crumb-link:hover { color: var(--ink); }
[data-theme="dark"] .level-card { background: var(--surface); border-color: var(--line); color: var(--ink); }
[data-theme="dark"] .branch-card { background: var(--surface); }
[data-theme="dark"] .modal-backdrop { background: rgba(0,0,0,0.7); }
[data-theme="dark"] .lightbox { background: #000; }
[data-theme="dark"] .table-wrap { background: var(--surface); }
[data-theme="dark"] .panel { background: transparent; }
[data-theme="dark"] .user-chip { background: transparent; }
[data-theme="dark"] .user-chip:hover { background: rgba(255,255,255,0.06); }
[data-theme="dark"] .avatar { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .avatar-img { background: transparent; }

[data-theme="dark"] .branch-head {
  background: linear-gradient(130deg, var(--accent-soft), var(--surface) 62%);
}
[data-theme="dark"] .table th {
  background: #1e293b;
  color: var(--muted);
}
[data-theme="dark"] .table tbody tr { background: transparent; }
[data-theme="dark"] .auth-brand { background: linear-gradient(160deg, #0b3b3a, #0f766e); }
[data-theme="dark"] .auth-brand-foot { color: rgba(255,255,255,0.7); }
[data-theme="dark"] .demo-box, [data-theme="dark"] .auth-note {
  background: #1e293b;
}

[data-theme="dark"] .btn.ghost:hover { background: rgba(255,255,255,0.06); border-color: var(--line); }
[data-theme="dark"] .field input, [data-theme="dark"] .field select, [data-theme="dark"] .field textarea { background: #0f172a; border-color: var(--line); }
[data-theme="dark"] .quick-link, [data-theme="dark"] .filter-chip { background: var(--surface); }

[data-theme="dark"] .tabs { background: #1e293b; border-color: var(--line); }
[data-theme="dark"] .tab { color: var(--muted); }
[data-theme="dark"] .tab:hover { background: rgba(255,255,255,0.06); color: var(--ink); }
[data-theme="dark"] .tab.is-active { background: var(--accent-soft); color: var(--accent); }
[data-theme="dark"] .tab-count { background: rgba(255,255,255,0.08); color: var(--ink); }
[data-theme="dark"] .panel-head h2 { color: var(--ink); }
[data-theme="dark"] .count { color: var(--muted); }
[data-theme="dark"] .crumbs { color: var(--muted); }
[data-theme="dark"] .crumb-link { color: var(--muted); }
[data-theme="dark"] .crumb-sep { color: var(--muted); }
[data-theme="dark"] .hero .page-title { color: var(--ink); }
[data-theme="dark"] .hero .lede { color: var(--muted); }
[data-theme="dark"] .eyebrow { background: var(--accent-soft); color: var(--accent); }

[data-theme="dark"] .tabs { background: #1e293b !important; }
[data-theme="dark"] .branch-head { background: linear-gradient(130deg, var(--accent-soft), #1e293b 62%) !important; }
[data-theme="dark"] .lesson-card, [data-theme="dark"] .teacher-card, [data-theme="dark"] .announcement-card { background: #1e293b !important; }
[data-theme="dark"] .panel { background: transparent !important; }
[data-theme="dark"] .topbar { background: rgba(15, 23, 42, 0.92) !important; }

[data-theme="dark"] .empty { background: rgba(255,255,255,0.04); border-color: var(--line); color: var(--muted); }
[data-theme="dark"] .empty-icon { color: var(--ink); }

.site-footer {
  margin-top: 40px;
  padding: 12px 0 24px;
  background: transparent;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-brand {
  font-weight: 800;
  color: var(--ink);
  font-size: 0.95rem;
}
.footer-socials {
  display: flex;
  flex-wrap: nowrap;
  gap: 14px;
}
.social-bar {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}
.social-bar-topbar {
  gap: 5px;
  padding-inline-end: 2px;
}
.social-bar-topbar .social-link {
  width: 26px;
  height: 26px;
  border-radius: 7px;
}
.social-float {
  position: fixed;
  bottom: 20px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.social-float-right { right: 16px; }
.social-float-left { left: 16px; }
.social-float-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transform-origin: bottom center;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.social-float.open .social-float-panel,
.social-float:hover .social-float-panel,
.social-float:focus-within .social-float-panel {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.social-float-left .social-float-panel {
  transform-origin: bottom left;
}
.social-float-caption {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}
.social-float-toggle {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 15px;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.38);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.social-float-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(15, 118, 110, 0.46);
}
.social-float-toggle img {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
}
.social-float .social-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.social-float .social-link {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
}
.social-float .social-link svg {
  width: 19px;
  height: 19px;
}
@media (max-width: 640px) {
  .social-bar-topbar { gap: 6px; }
  .social-float { bottom: 14px; }
  .social-float-right { right: 10px; }
  .social-float-left { left: 10px; }
  .social-float-toggle { width: 44px; height: 44px; }
  .social-float .social-link { width: 34px; height: 34px; }
}
.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.social-link:hover {
  transform: translateY(-2px);
  background: var(--accent);
  color: #fff;
}
[data-theme="dark"] .site-footer { background: transparent; border-color: transparent; }
[data-theme="dark"] .social-link { background: rgba(255,255,255,0.06); color: var(--ink); }
[data-theme="dark"] .social-link:hover { background: var(--accent); color: #0b1120; }
[data-theme="dark"] .social-float-panel {
  background: rgba(15, 23, 42, 0.94);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .social-float-caption { color: #cbd5e1; }

/* Brand-colored social icons */
.social-link.social-instagram { color: #E4405F; background: rgba(228, 64, 95, 0.12); }
.social-link.social-facebook { color: #1877F2; background: rgba(24, 119, 242, 0.12); }
.social-link.social-whatsapp { color: #25D366; background: rgba(37, 211, 102, 0.12); }
.social-link.social-discord { color: #5865F2; background: rgba(88, 101, 242, 0.12); }
.social-link.social-instagram:hover { background: #E4405F; color: #fff; }
.social-link.social-facebook:hover { background: #1877F2; color: #fff; }
.social-link.social-whatsapp:hover { background: #25D366; color: #fff; }
.social-link.social-discord:hover { background: #5865F2; color: #fff; }
/* smaller */
.social-link { width: 30px; height: 30px; border-radius: 8px; }
[data-theme="dark"] .social-link.social-instagram { color: #f472b6; background: rgba(228, 64, 95, 0.18); }
[data-theme="dark"] .social-link.social-facebook { color: #60a5fa; background: rgba(24, 119, 242, 0.18); }
[data-theme="dark"] .social-link.social-whatsapp { color: #4ade80; background: rgba(37, 211, 102, 0.18); }
[data-theme="dark"] .social-link.social-discord { color: #a5b4fc; background: rgba(88, 101, 242, 0.18); }

/* ------------------------------------------------------------------
   Report tickets
------------------------------------------------------------------ */
.report-btn {
  font-size: 0.95rem;
  line-height: 1;
  padding: 6px 9px;
}
.admin-block {
  margin-top: 34px;
  display: grid;
  gap: 14px;
}
.admin-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.admin-block-head h2 {
  margin: 0;
  font-size: 1.12rem;
  display: flex;
  align-items: center;
  gap: 8px;
}
.count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
}
.ticket-list {
  display: grid;
  gap: 12px;
}
.ticket {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  display: grid;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}
.ticket.is-done { opacity: 0.75; }
.ticket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ticket-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ticket-title strong { font-size: 0.98rem; color: var(--ink); }
.ticket-kind {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.kind-bug { background: rgba(220, 38, 38, 0.12); color: #dc2626; }
.kind-idea { background: rgba(37, 99, 235, 0.12); color: #2563eb; }
.kind-other { background: rgba(100, 116, 139, 0.16); color: #475569; }
.ticket-msg {
  margin: 0;
  color: var(--ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.ticket-shot {
  display: inline-block;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  cursor: zoom-in;
  width: fit-content;
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.ticket-shot:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}
.ticket-shot img {
  display: block;
  max-width: 220px;
  max-height: 140px;
  object-fit: cover;
}
.ticket-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.ticket-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}
.ticket-status {
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
}
.ticket-status.is-new { background: rgba(245, 158, 11, 0.16); color: #b45309; }
.ticket-status.is-done { background: rgba(22, 163, 74, 0.15); color: #15803d; }
.ticket-actions {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
[data-theme="dark"] .ticket {
  background: rgba(30, 41, 59, 0.55) !important;
  border-color: var(--line);
}
[data-theme="dark"] .kind-bug { color: #fca5a5; background: rgba(220, 38, 38, 0.22); }
[data-theme="dark"] .kind-idea { color: #93c5fd; background: rgba(37, 99, 235, 0.22); }
[data-theme="dark"] .kind-other { color: #cbd5e1; background: rgba(148, 163, 184, 0.18); }
[data-theme="dark"] .ticket-status.is-new { color: #fbbf24; background: rgba(245, 158, 11, 0.22); }
[data-theme="dark"] .ticket-status.is-done { color: #4ade80; background: rgba(22, 163, 74, 0.22); }

/* Admin dashboard — responsive */
@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-hero { padding: 22px; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr; }
  .admin-actions .btn { flex: 1 1 auto; }
  .admin-page > .admin-block { padding: 14px; }
}
