:root {
  color-scheme: light;
  --brand: #082032;
  --theme-chrome: #082032;
  --coral: #c4921c;
  --coral-dark: #8a6910;
  --coral-soft: #e0b33a;
  --btn: #c4921c;
  --btn-hover: #a87a14;
  --btn-text: #1a1304;
  --register-btn: #c4921c;
  --register-btn-text: #1a1304;
  --link: #082032;
  --bg-from: #f3eee4;
  --bg-to: #fbf8f2;
  --accent-rgb: 196, 146, 28;
  --teal: #1b7a4a;
  --amber: #e0b33a;
  --sky: #0e334c;
  --ink: #0d1b28;
  --muted: #5c6b78;
  --line: #d9d0c0;
  --panel: #fffdf8;
  --bg: #f3eee4;
  --sidebar: #082032;
  --sidebar-from: #0d1b28;
  --sidebar-to: #0e334c;
  --sidebar-text: #efe6d2;
  --sidebar-w: 280px;
  --radius: 12px;
  --shadow: 0 18px 50px rgba(8, 32, 50, 0.12);
  --font: "Outfit", "Alegreya Sans", "Manrope", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, rgba(var(--accent-rgb), 0.12), transparent 55%),
    radial-gradient(900px 500px at -10% 20%, rgba(31, 157, 138, 0.1), transparent 50%),
    linear-gradient(180deg, var(--bg-from) 0%, var(--bg) 40%, var(--bg-to) 100%);
  min-height: 100vh;
}

a {
  color: var(--link);
}

img {
  max-width: 100%;
  display: block;
}

button,
input,
select {
  font: inherit;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* ——— Sidebar ——— */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--sidebar-from) 0%, var(--sidebar) 55%, var(--sidebar-to) 100%);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1.35rem 1.2rem 1rem;
  position: relative;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.35);
}

.brand-name {
  display: block;
  font-family: var(--display);
  color: #fff;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
}

.brand-tag {
  font-size: 0.72rem;
  opacity: 0.65;
}

.sidebar-close {
  display: none;
  margin-left: auto;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
}

.sidebar-profile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.4rem 1rem 1rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-profile img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(var(--accent-rgb), 0.5);
}

.sidebar-profile strong {
  display: block;
  color: #fff;
  font-size: 0.92rem;
}

.sidebar-profile span {
  font-size: 0.75rem;
  opacity: 0.65;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0 0.85rem 1.5rem;
}

.nav-label {
  margin: 1rem 0.65rem 0.45rem;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.45;
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.72rem 0.85rem;
  border-radius: 12px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  position: relative;
}

.nav-link i {
  width: 1.15rem;
  text-align: center;
  opacity: 0.85;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  transform: translateX(2px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent-rgb), 0.05));
  color: #fff;
  box-shadow: inset 3px 0 0 var(--coral);
}

.nav-link .badge {
  margin-left: auto;
  background: var(--coral);
  color: #fff;
  font-style: normal;
  font-size: 0.7rem;
  min-width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 24, 0.45);
  z-index: 35;
}

/* ——— Main ——— */
.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
  background: rgba(243, 246, 249, 0.82);
  border-bottom: 1px solid rgba(231, 235, 240, 0.8);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  cursor: pointer;
  color: var(--ink);
}

.search-box {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  box-shadow: 0 4px 14px rgba(16, 24, 32, 0.04);
}

.search-box i {
  color: var(--muted);
}

.search-box input {
  border: 0;
  outline: 0;
  width: 100%;
  background: transparent;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: auto;
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  color: var(--ink);
  transition: transform 0.2s, box-shadow 0.2s;
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.icon-btn .dot {
  position: absolute;
  top: 10px;
  right: 11px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px #fff;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--btn);
  border-radius: 999px;
  padding: 0.7rem 1.15rem;
  background: linear-gradient(180deg, #efc45a, var(--btn));
  color: var(--btn-text);
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  text-shadow: none;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.cta-btn:hover {
  transform: none;
  filter: brightness(1.05);
  background: linear-gradient(180deg, #efc45a, var(--btn-hover));
  border-color: var(--btn-hover);
  color: var(--btn-text);
}

#topAuthBtn.cta-btn,
a.cta-btn[href*="register"] {
  background: linear-gradient(180deg, #efc45a, var(--register-btn));
  border-color: var(--register-btn);
  color: var(--register-btn-text);
}

.content {
  padding: 1.25rem 1.5rem 2.5rem;
}

.page {
  display: none;
  animation: fadeUp 0.35s ease;
}

.page.active {
  display: block;
}

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

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1.35rem;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--coral);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 2.4vw, 2.15rem);
  letter-spacing: -0.03em;
}

.lede {
  margin: 0.4rem 0 0;
  color: var(--muted);
  max-width: 40rem;
}

.head-meta {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Stats */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  opacity: 0.12;
  background: currentColor;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.accent-coral {
  color: var(--coral);
}
.accent-coral .stat-icon {
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
}
.accent-teal {
  color: var(--teal);
}
.accent-teal .stat-icon {
  background: linear-gradient(135deg, #1f9d8a, #2fc4ad);
}
.accent-amber {
  color: var(--amber);
}
.accent-amber .stat-icon {
  background: linear-gradient(135deg, #f0a202, #f6c043);
}
.accent-sky {
  color: var(--sky);
}
.accent-sky .stat-icon {
  background: linear-gradient(135deg, #2f80ed, #56a0ff);
}

.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.stat-card strong {
  font-family: var(--display);
  font-size: 1.55rem;
  letter-spacing: -0.03em;
}

.panel {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid rgba(231, 235, 240, 0.9);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
}

.text-link {
  border: 0;
  background: transparent;
  color: var(--coral);
  font-weight: 700;
  cursor: pointer;
}

.split {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.course-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.course-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.55rem;
  border-radius: 14px;
  transition: background 0.2s;
}

.course-row:hover {
  background: #f7f9fb;
}

.course-row img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
}

.course-row h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.course-row p {
  margin: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.tag {
  display: inline-flex;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #fff0eb;
  color: var(--coral-dark);
}

.feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.feed li {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 0.75rem;
  align-items: start;
}

.feed li::before {
  content: "";
  width: 10px;
  height: 10px;
  margin-top: 0.35rem;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
}

.feed strong {
  display: block;
  font-size: 0.92rem;
}

.feed span {
  color: var(--muted);
  font-size: 0.8rem;
}

.schedule-mini {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sch-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0.9rem;
  border-radius: 12px;
  background: linear-gradient(90deg, #f8fafc, #fff);
  border: 1px solid var(--line);
}

.sch-item b {
  display: block;
}

.sch-item span {
  color: var(--muted);
  font-size: 0.8rem;
}

.progress-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
}

.bar {
  height: 8px;
  border-radius: 999px;
  background: #eef2f6;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--coral), var(--coral-soft));
}

/* Courses page */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.1rem;
}

.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 0.5rem 0.95rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--muted);
  transition: 0.2s;
}

.chip.active,
.chip:hover {
  background: #fff0eb;
  border-color: #ffd2c4;
  color: var(--coral-dark);
}

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.course-card {
  background: var(--panel);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s, box-shadow 0.25s;
}

.course-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 36px rgba(16, 24, 32, 0.12);
}

.course-card .thumb {
  height: 150px;
  background-size: cover;
  background-position: center;
  position: relative;
}

.course-card .thumb .cat {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  background: rgba(16, 24, 32, 0.75);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.6rem;
  border-radius: 8px;
}

.course-card .body {
  padding: 1rem 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.course-card h3 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--display);
  letter-spacing: -0.02em;
}

.course-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: auto;
}

.teacher-mini {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.teacher-mini img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}

/* Tables */
.table-tools {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.admin-doc-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 0.75rem;
  align-items: center;
}

.admin-doc-filters select,
.admin-doc-filters .ghost-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  background: #fff;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: inherit;
  min-height: 36px;
}

.admin-doc-filters select {
  max-width: 140px;
}

.adf-search {
  position: relative;
  flex: 1 1 180px;
  min-width: 160px;
  margin: 0;
}

.adf-search i {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.8rem;
  pointer-events: none;
}

.adf-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.7rem 0.45rem 2rem;
  font: inherit;
  font-size: 0.85rem;
  outline: 0;
  background: #fff;
  min-height: 36px;
}

.adf-search input:focus,
.admin-doc-filters select:focus {
  border-color: #ffc4b3;
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.12);
}

.admin-doc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}

.admin-doc-chips .chip em {
  font-style: normal;
  opacity: 0.7;
  margin-left: 0.2rem;
}

@media (max-width: 700px) {
  .admin-doc-filters select {
    max-width: none;
    flex: 1 1 calc(50% - 0.5rem);
  }
}

.table-tools input,
.table-tools select,
.settings-form input,
.settings-form select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  outline: 0;
  background: #fff;
}

.table-tools input {
  min-width: 220px;
}

.schedule-table-wrap,
.table-panel {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  text-align: left;
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.person {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
}

.person img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.status {
  display: inline-flex;
  padding: 0.28rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.status.ok {
  background: #e8f8f4;
  color: #0f7668;
}
.status.warn {
  background: #fff7e6;
  color: #b45309;
}
.status.off {
  background: #f3f4f6;
  color: #6b7280;
}

.slot {
  background: #fff5f1;
  border: 1px solid #ffd9cc;
  border-radius: 10px;
  padding: 0.45rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--coral-dark);
}

.slot small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.15rem;
}

/* Staff */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.staff-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform 0.25s;
}

.staff-card:hover {
  transform: translateY(-3px);
}

.staff-top {
  display: flex;
  gap: 0.9rem;
  align-items: center;
}

.staff-top img {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  object-fit: cover;
}

.staff-top h3 {
  margin: 0 0 0.2rem;
  font-family: var(--display);
  font-size: 1.05rem;
}

.staff-top p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.staff-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.pill {
  background: #f3f6f9;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
}

.staff-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

.ghost-btn {
  flex: 1;
  border: 1px solid #cfd8e3;
  background: #fff;
  border-radius: 8px;
  padding: 0.55rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ghost-btn:hover {
  border-color: #09253b;
  color: #09253b;
  background: #f4f7fa;
}

.profile-hero {
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1.25rem;
  align-items: center;
  margin-bottom: 1rem;
  background:
    linear-gradient(120deg, rgba(var(--accent-rgb), 0.08), transparent 45%),
    var(--panel);
}

.profile-hero img {
  width: 140px;
  height: 140px;
  border-radius: 24px;
  object-fit: cover;
}

.profile-hero h2 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: 1.5rem;
}

.profile-hero p {
  margin: 0;
  color: var(--muted);
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-top: 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.feature-list {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  color: var(--muted);
}

.feature-list li::marker {
  color: var(--coral);
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: center;
}

.mini-stats strong {
  display: block;
  font-family: var(--display);
  font-size: 1.4rem;
}

.mini-stats span {
  color: var(--muted);
  font-size: 0.85rem;
}

.grade-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.grade-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.grade-card h3 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
}

.grade-row {
  display: flex;
  justify-content: space-between;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.9rem;
}

.grade-row:last-child {
  border-bottom: 0;
}

.score {
  font-weight: 800;
  color: var(--teal);
}

.announce-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.announce-item {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--coral);
}

.announce-item h3 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
}

.announce-item p {
  margin: 0;
  color: var(--muted);
}

.announce-item .when {
  display: block;
  margin-top: 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--coral);
}

.messages-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 420px;
  padding: 0;
  overflow: hidden;
}

.msg-list {
  border-right: 1px solid var(--line);
  overflow-y: auto;
}

.msg-item {
  display: flex;
  gap: 0.7rem;
  padding: 0.9rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background 0.2s;
}

.msg-item:hover,
.msg-item.active {
  background: #fff7f4;
}

.msg-item img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.msg-item strong {
  display: block;
  font-size: 0.9rem;
}

.msg-item span {
  color: var(--muted);
  font-size: 0.78rem;
}

.msg-thread {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.bubble {
  max-width: 70%;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  background: #f3f6f9;
  font-size: 0.9rem;
}

.bubble.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
  color: #fff;
}

.empty-hint {
  margin: auto;
  color: var(--muted);
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.report-card h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.big-metric {
  font-family: var(--display);
  font-size: 2.2rem;
  margin: 0.5rem 0;
  letter-spacing: -0.04em;
  color: var(--ink);
}

.report-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.settings-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 820px;
}

.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.88rem;
}

.settings-form .check {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}

.settings-form .cta-btn {
  grid-column: 1 / -1;
  justify-self: start;
}

/* Modal & toast */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 24, 0.5);
  display: grid;
  place-items: center;
  z-index: 60;
  padding: 1rem;
}

.modal[hidden] {
  display: none;
}

.modal-card {
  width: min(520px, 100%);
  background: #fff;
  border-radius: 18px;
  padding: 1.4rem 1.4rem 1.5rem;
  position: relative;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.2);
  animation: fadeUp 0.3s ease;
}

.modal-card.modal-card--viewer {
  width: min(980px, 100%);
  max-height: min(92vh, 920px);
  height: min(92vh, 920px);
  display: flex;
  flex-direction: column;
  padding: 1.1rem 1.15rem 1.15rem;
}

.modal-card--viewer h2 {
  margin: 0 0 0.65rem;
  padding-right: 2.5rem;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.3;
}

.modal-card--viewer #modalBody {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.doc-viewer {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  height: 100%;
  min-height: 0;
}

.doc-viewer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.doc-viewer-stage {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #eef2f6;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.doc-viewer-stage--image {
  background: #101820;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
}

.doc-viewer-frame {
  width: 100%;
  height: 100%;
  min-height: min(62vh, 640px);
  border: 0;
  background: #fff;
}

.doc-viewer-img {
  max-width: 100%;
  max-height: min(68vh, 720px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.doc-viewer-text {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow: auto;
  height: 100%;
  min-height: min(52vh, 520px);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  background: #fff;
  color: #1f2937;
}

.doc-viewer-fallback {
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.doc-sheet {
  width: min(420px, 100%);
  background: #fff;
  border-radius: 12px;
  padding: 1.5rem 1.35rem 1.35rem;
  text-align: center;
  box-shadow: 0 12px 28px rgba(16, 24, 32, 0.1);
  position: relative;
}

.doc-sheet-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 12px 12px 0 0;
  background: linear-gradient(90deg, var(--coral), var(--coral-soft));
}

.doc-sheet i {
  font-size: 2.4rem;
  color: var(--coral);
  margin-bottom: 0.65rem;
}

.doc-sheet h3 {
  margin: 0 0 0.5rem;
  font-family: var(--display);
  font-size: 1.05rem;
}

.doc-sheet p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.doc-sheet-hint {
  margin-top: 0.75rem !important;
  font-size: 0.75rem !important;
  font-weight: 600;
}

.cat-html-content {
  line-height: 1.55;
}

.cat-html-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}

.cat-html-content h1,
.cat-html-content h2,
.cat-html-content h3 {
  font-family: var(--display);
  margin-top: 0;
}

.data-table code {
  font-size: 0.78rem;
  background: #f3f6f9;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.doc-viewer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .modal-card.modal-card--viewer {
    width: 100%;
    height: min(94vh, 100%);
    max-height: 94vh;
    border-radius: 14px;
    padding: 0.95rem;
  }

  .doc-viewer-frame,
  .doc-viewer-text {
    min-height: 48vh;
  }
}

.modal-card h2 {
  margin: 0 0 0.85rem;
  font-family: var(--display);
}

.modal-close {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  border: 0;
  background: #f3f6f9;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  cursor: pointer;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.88rem;
}

.modal-form input,
.modal-form textarea,
.modal-form select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  outline: 0;
}

.toast {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  background: var(--ink);
  color: #fff;
  padding: 0.85rem 1.1rem;
  border-radius: 12px;
  z-index: 70;
  box-shadow: var(--shadow);
  animation: fadeUp 0.3s ease;
}

.toast[hidden] {
  display: none;
}

/* Admin profile card (Dreams LMS style) */
.sidebar-profile-card {
  margin: 0.25rem 1rem 1.1rem;
  padding: 1.35rem 1rem 1.1rem;
  border-radius: 18px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.sidebar-profile-card .profile-bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: 58px;
  background: linear-gradient(120deg, var(--coral) 0%, var(--coral-soft) 55%, #1f9d8a 120%);
  opacity: 0.9;
}

.sidebar-profile-card .profile-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #15202b;
  margin: 0.35rem auto 0.65rem;
  position: relative;
  z-index: 1;
}

.sidebar-profile-card strong {
  display: block;
  color: #fff;
  font-family: var(--display);
  font-size: 1rem;
}

.sidebar-profile-card > span {
  display: block;
  font-size: 0.78rem;
  opacity: 0.65;
  margin-bottom: 0.85rem;
}

.profile-btns {
  display: flex;
  gap: 0.45rem;
  justify-content: center;
}

.mini-cta,
.mini-ghost {
  border: 0;
  border-radius: 10px;
  padding: 0.45rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.mini-cta {
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
  color: #fff;
}

.mini-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.nav-logout:hover {
  color: #ff8d78 !important;
}

.breadcrumb {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}

.welcome-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem 1.6rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(16, 24, 32, 0.55), rgba(16, 24, 32, 0.25)),
    linear-gradient(135deg, var(--coral) 0%, var(--coral-soft) 45%, #1f9d8a 100%);
  box-shadow: 0 16px 36px rgba(var(--accent-rgb), 0.22);
  position: relative;
  overflow: hidden;
}

.welcome-banner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.welcome-banner .eyebrow {
  color: rgba(255, 255, 255, 0.85);
}

.welcome-banner h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  letter-spacing: -0.03em;
}

.welcome-banner .lede {
  color: rgba(255, 255, 255, 0.88);
  margin-top: 0.4rem;
}

.welcome-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.ghost-btn.light {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  flex: initial;
  padding: 0.75rem 1rem;
}

.stat-grid.six {
  grid-template-columns: repeat(6, 1fr);
}

.inline-select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.65rem;
  background: #fff;
  font-weight: 600;
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 0.65rem;
  height: 220px;
  padding: 0.5rem 0.25rem 0;
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar .fill {
  width: 100%;
  max-width: 36px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--coral-soft), var(--coral) 60%, #1f9d8a);
  transition: height 0.6s ease;
  min-height: 8px;
}

.chart-bar span {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--muted);
}

.quick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.quick-grid button {
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 12px;
  padding: 0.9rem 0.75rem;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  transition: 0.2s;
  text-align: left;
}

.quick-grid button i {
  color: var(--coral);
  width: 1rem;
}

.quick-grid button:hover {
  background: #fff5f1;
  border-color: #ffd2c4;
  transform: translateY(-1px);
}

.table-wrap {
  overflow-x: auto;
}

.course-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
}

.course-cell img {
  width: 52px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
}

.settings-form .full {
  grid-column: 1 / -1;
}

.settings-form textarea {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  outline: 0;
  resize: vertical;
  font: inherit;
}

.quiz-card,
.cert-card {
  background: var(--panel);
  border-radius: var(--radius);
  padding: 1.15rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.quiz-card h3,
.cert-card h3 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
}

.quiz-card p,
.cert-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.priority-high {
  background: #fee2e2;
  color: #b91c1c;
}
.priority-mid {
  background: #fef3c7;
  color: #b45309;
}
.priority-low {
  background: #e0f2fe;
  color: #0369a1;
}

/* ——— Landing & Auth ——— */
.landing-body,
.auth-body {
  background:
    radial-gradient(900px 420px at 10% -10%, rgba(224, 179, 58, 0.18), transparent 55%),
    radial-gradient(700px 400px at 100% 0%, rgba(14, 51, 76, 0.12), transparent 50%),
    var(--bg, #f3eee4);
}

.auth-body .site-header {
  background: rgba(8, 32, 50, 0.94);
  color: #f6f0e4;
  border-bottom: 1px solid rgba(224, 179, 58, 0.25);
  backdrop-filter: blur(12px);
}

.auth-body .site-logo strong,
.auth-body .ghost-link {
  color: #f6f0e4;
}

.auth-body .site-logo small {
  color: rgba(246, 240, 228, 0.65);
}

.auth-body .ghost-link:hover {
  color: #e0b33a;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.75rem;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(14px);
  background: rgba(243, 246, 249, 0.88);
  border-bottom: 1px solid rgba(231, 235, 240, 0.9);
}

.site-header.compact {
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
}

.site-logo .brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
  color: #fff;
}

.site-logo strong {
  display: block;
  font-family: var(--display);
}

.site-logo small {
  color: var(--muted);
  font-size: 0.72rem;
}

.site-nav {
  display: flex;
  gap: 1.1rem;
  margin-left: 1rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.92rem;
}

.site-nav a:hover {
  color: var(--coral-dark);
}

.site-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.ghost-link {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
}

.ghost-link:hover {
  background: #fff;
}

.top-reg {
  display: none;
}

.landing-menu {
  display: none;
}

.land-drawer {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.land-drawer a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
}

.land-drawer a:hover {
  background: #fff5f1;
  color: var(--coral-dark);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 1.75rem 3rem;
  max-width: 1180px;
  margin: 0 auto;
}

.hero-copy h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2rem, 4.2vw, 3.2rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.25rem;
}

.hero-cta .ghost-btn.light {
  background: #1b2430;
  color: #fff;
  border: 0;
  padding: 0.75rem 1.1rem;
  flex: initial;
}

.hero-stats {
  display: flex;
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.hero-stats strong {
  display: block;
  font-family: var(--display);
  font-size: 1.4rem;
}

.hero-stats span {
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-card {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 50px rgba(16, 24, 32, 0.18);
}

.hero-card img {
  width: 100%;
  height: 420px;
  object-fit: cover;
}

.hero-float {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: rgba(255, 255, 255, 0.95);
  padding: 0.75rem 1rem;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.hero-float i {
  color: var(--coral);
  font-size: 1.25rem;
}

.hero-float b {
  display: block;
  font-family: var(--display);
}

.hero-float span {
  font-size: 0.75rem;
  color: var(--muted);
}

.land-section {
  padding: 2.5rem 1.75rem;
  max-width: 1180px;
  margin: 0 auto;
}

.land-section.alt {
  background: rgba(255, 255, 255, 0.55);
  border-radius: 24px;
  max-width: 1140px;
}

.section-head {
  margin-bottom: 1.5rem;
  max-width: 40rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  letter-spacing: -0.03em;
}

.section-head p:last-child {
  color: var(--muted);
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.feature-cards article {
  background: #fff;
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.feature-cards h3 {
  margin: 0.9rem 0 0.4rem;
  font-family: var(--display);
}

.feature-cards p {
  color: var(--muted);
  margin: 0 0 0.85rem;
}

.feature-cards .stat-icon {
  color: #fff;
}

.role-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.role-pills a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  color: var(--ink);
  box-shadow: 0 6px 16px rgba(16, 24, 32, 0.04);
  transition: 0.2s;
}

.role-pills a:hover {
  border-color: #ffd2c4;
  color: var(--coral-dark);
  transform: translateY(-2px);
}

.role-pills i {
  color: var(--coral);
}

.land-courses {
  margin-top: 0.5rem;
}

.cta-band {
  margin: 1rem 1.75rem 2.5rem;
  padding: 1.75rem 1.75rem;
  border-radius: 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  color: #fff;
  background: linear-gradient(135deg, var(--coral) 0%, var(--coral-soft) 45%, #1f9d8a 100%);
  box-shadow: 0 16px 36px rgba(var(--accent-rgb), 0.22);
}

.cta-band h2 {
  margin: 0;
  font-family: var(--display);
}

.cta-band p {
  margin: 0.35rem 0 0;
  opacity: 0.9;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.5rem 1.75rem 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.auth-wrap {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.auth-card {
  width: min(460px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--panel, #fffdf8);
  border: 1px solid var(--line, #d9d0c0);
  border-radius: 24px;
  padding: 1.5rem 1.55rem 1.35rem;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-family: var(--display);
}

.auth-card label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.88rem;
}

.auth-card input,
.auth-card select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  outline: 0;
}

.full-btn {
  width: 100%;
  justify-content: center;
  margin-top: 0.35rem;
}

.auth-switch {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--coral-dark);
  font-weight: 700;
  text-decoration: none;
}

/* Documents / portal */
.upload-panel {
  max-width: 820px;
}

.dropzone {
  border: 2px dashed #ffc7b8;
  background: #fff8f5;
  border-radius: 18px;
  padding: 2.2rem 1.25rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: 0.2s;
}

.dropzone.drag,
.dropzone:hover {
  border-color: var(--coral);
  background: #fff1eb;
}

.dropzone i {
  font-size: 2rem;
  color: var(--coral);
  margin-bottom: 0.5rem;
}

.dropzone strong {
  display: block;
  font-family: var(--display);
}

.dropzone span {
  color: var(--muted);
  font-size: 0.85rem;
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-queue {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.file-queue li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.8rem;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px solid var(--line);
}

.file-queue em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
  font-size: 0.8rem;
}

.file-queue button {
  border: 0;
  background: transparent;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--muted);
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.doc-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fafbfc;
}

.doc-row i {
  color: var(--coral);
  width: 1.2rem;
  text-align: center;
}

.doc-row strong {
  display: block;
  font-size: 0.92rem;
}

.doc-row span {
  color: var(--muted);
  font-size: 0.78rem;
}

.doc-row .ghost-btn {
  margin-left: auto;
  flex: 0;
  padding: 0.4rem 0.7rem;
}

.doc-name {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.doc-name i {
  color: var(--coral);
  font-size: 1.15rem;
}

.doc-name small {
  display: block;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.75rem;
}

.doc-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.doc-actions .ghost-btn {
  flex: 0;
  padding: 0.4rem 0.55rem;
}

.ghost-btn.danger:hover {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.doc-preview {
  text-align: center;
}

.doc-preview p {
  margin: 0.35rem 0;
  text-align: left;
}

@media (max-width: 1400px) {
  .stat-grid.six {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 980px) {
  .hero,
  .feature-cards {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }

  .landing-menu {
    display: grid;
    place-items: center;
  }

  .top-reg {
    display: inline-flex;
  }
}

/* Responsive */
@media (max-width: 1100px) {
  .stat-grid,
  .report-grid,
  .course-grid,
  .staff-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .split,
  .grade-grid,
  .settings-form,
  .messages-layout,
  .profile-hero {
    grid-template-columns: 1fr;
  }

  .profile-hero {
    justify-items: start;
  }
}

@media (max-width: 860px) {
  .welcome-banner {
    flex-direction: column;
    align-items: flex-start;
  }

  .stat-grid.six {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar-close,
  .menu-toggle {
    display: grid;
    place-items: center;
  }

  .overlay.show {
    display: block;
  }

  .cta-btn span,
  .topbar .cta-btn {
    padding-inline: 0.85rem;
  }
}

@media (max-width: 640px) {
  .stat-grid,
  .course-grid,
  .staff-grid,
  .report-grid,
  .mini-stats {
    grid-template-columns: 1fr;
  }

  .content {
    padding: 1rem;
  }

  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-box {
    display: none;
  }
}

/* ========== PORTAL (hamburger + bottom nav) ========== */
.portal-app {
  min-height: 100vh;
}

@media (max-width: 859px) {
  .portal-app {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

.portal-app.no-scroll {
  overflow: hidden;
}

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(320px, 88vw);
  background: linear-gradient(180deg, var(--sidebar-from) 0%, var(--sidebar) 55%, var(--sidebar-to) 100%) !important;
  color: #e8eef5 !important;
  z-index: 80;
  transform: translateX(-105%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  box-shadow: 12px 0 40px rgba(0, 0, 0, 0.35);
}

.drawer .nav-label {
  color: rgba(232, 238, 245, 0.55);
  opacity: 1;
}

.drawer .nav-link {
  color: #d7e0ea !important;
}

.drawer .nav-link i {
  color: #f0f4f8;
  opacity: 0.9;
}

.drawer .nav-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff !important;
}

.drawer .nav-link.active {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.35), rgba(var(--accent-rgb), 0.08)) !important;
  color: #fff !important;
  box-shadow: inset 3px 0 0 var(--coral);
}

.drawer #drawerAuthLinks .nav-link,
.drawer #drawerAuthLinks button.nav-link {
  color: #e8eef5 !important;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 24, 0.5);
  z-index: 70;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}

.drawer-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem 0.5rem;
}

.drawer-head .site-logo {
  color: #fff;
}

.drawer-head .icon-btn {
  background: rgba(255, 255, 255, 0.08);
  border-color: transparent;
  color: #fff;
}

.drawer-user {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin: 0.75rem 1rem 1rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.drawer-user img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid rgba(var(--accent-rgb), 0.45);
}

.drawer-user strong {
  display: block;
  color: #fff;
}

.drawer-user span {
  font-size: 0.75rem;
  opacity: 0.65;
}

.drawer-nav {
  padding: 0 0.85rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.portal-top {
  --pt-h: 44px;
  --pt-r: 12px;
  --pt-gap: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: calc(var(--pt-h) + 0.85rem + env(safe-area-inset-top, 0px));
  padding: calc(0.45rem + env(safe-area-inset-top, 0px)) 0.85rem 0.45rem;
  backdrop-filter: blur(16px) saturate(1.15);
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  box-shadow: 0 8px 24px rgba(16, 24, 32, 0.04);
}

.portal-brand-bar {
  display: flex;
  align-items: center;
  gap: var(--pt-gap);
  min-width: 0;
  flex: 1 1 auto;
  height: var(--pt-h);
  max-width: calc(100% - 9rem);
}

.portal-top .hamburger {
  width: var(--pt-h);
  height: var(--pt-h);
  border: 1px solid var(--line);
  border-radius: var(--pt-r);
  background: #fff;
  box-shadow: none;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transform: none;
}

.portal-top .hamburger:hover {
  transform: none;
  box-shadow: none;
}

.portal-top .hamburger span {
  display: block;
  width: 14px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: 0.2s;
}

.portal-top .portal-logo {
  flex: 0 1 auto;
  min-width: 0;
  max-width: min(200px, 52vw);
  height: var(--pt-h);
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  padding: 0 0.1rem;
  line-height: 1;
}

.portal-top .portal-logo img {
  display: block;
  height: 28px;
  width: auto;
  max-width: min(160px, 48vw);
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
}

.portal-top .portal-logo-fallback {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.portal-logo.has-image:not(.logo-broken) .portal-logo-fallback {
  display: none !important;
}

.portal-logo.has-image.logo-broken img {
  display: none !important;
}

.portal-logo.has-image.logo-broken .portal-logo-fallback {
  display: inline !important;
}

.portal-top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--pt-gap);
  flex-shrink: 0;
  margin-left: auto;
  height: var(--pt-h);
}

.portal-top-actions .icon-btn {
  width: var(--pt-h);
  height: var(--pt-h);
  min-width: var(--pt-h);
  min-height: var(--pt-h);
  border-radius: var(--pt-r);
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: none;
  transform: none;
}

.portal-top-actions .icon-btn:hover {
  transform: none;
  box-shadow: none;
}

.portal-top #topAuthBtn.cta-btn {
  margin: 0;
  height: var(--pt-h);
  min-height: var(--pt-h);
  max-height: var(--pt-h);
  padding: 0 0.7rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  border-radius: var(--pt-r);
  box-shadow: none;
  gap: 0.35rem;
  white-space: nowrap;
  transform: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.portal-top #topAuthBtn.cta-btn:hover {
  transform: none;
}

.portal-top #topAuthBtn.user-chip {
  background: linear-gradient(135deg, #1f2937, #334155);
  box-shadow: none;
  padding: 0 0.6rem;
  font-size: 0.76rem;
  max-width: 108px;
  border-radius: var(--pt-r);
}

.portal-top #topAuthBtn.user-chip i {
  font-size: 0.72rem;
}

.portal-top #topAuthBtn.user-chip .user-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 4.2rem;
}

@media (max-width: 859px) {
  .portal-top {
    gap: 0.35rem;
    padding: 0.5rem 0.55rem;
  }
  .portal-brand-bar {
    max-width: calc(100% - 7.25rem);
  }
  .portal-top .portal-logo {
    max-width: min(132px, 40vw);
  }
  .portal-top .portal-logo img {
    height: 26px;
    max-width: min(112px, 36vw);
  }
  .portal-top .portal-logo-fallback {
    font-size: 0.92rem;
  }
  .portal-top #topAuthBtn.user-chip {
    max-width: 84px;
    padding: 0 0.45rem;
    font-size: 0.72rem;
  }
  .portal-top #topAuthBtn.user-chip .user-chip-name {
    max-width: 3rem;
  }
  .portal-top #topAuthBtn:not(.user-chip) {
    padding: 0 0.5rem;
    font-size: 0.72rem;
  }
  .portal-top #topAuthBtn:not(.user-chip) i {
    display: none;
  }
}

.brand-preview-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: calc(34px + 1.1rem);
  padding: 0.55rem 0.75rem;
  margin: 0 0 1.25rem;
  border-radius: 12px;
  background: rgba(243, 246, 249, 0.92);
  border: 1px solid var(--line);
}
.brand-preview-bar .bp-menu {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  flex-shrink: 0;
  font-size: 0.8rem;
}
.brand-preview-bar img {
  height: 28px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
}
.brand-preview-bar .bp-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1;
  white-space: nowrap;
}

.profile-avatar-edit {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.profile-avatar-edit img {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  background: #e5e7eb;
  border: 3px solid rgba(var(--accent-rgb), 0.35);
}

.portal-search {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.75rem 1rem 0;
  padding: 0.7rem 0.9rem;
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.portal-search input {
  border: 0;
  outline: 0;
  flex: 1;
  background: transparent;
}

.portal-search button {
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--muted);
}

.portal-main {
  padding: 1rem 1rem 1.5rem;
  flex: 1;
}

.portal-welcome h1 {
  font-size: clamp(1.35rem, 4vw, 1.85rem);
}

.portal-stats {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 900px) {
  .portal-stats {
    grid-template-columns: repeat(4, 1fr);
  }

  .portal-main {
    padding: 1.25rem 1.75rem 2rem;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
  }
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

@media (min-width: 700px) {
  .type-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.type-tile {
  text-align: left;
  border: 1px solid var(--line);
  background-color: var(--tile-bg, #f8fafc);
  background-image: none;
  background-size: cover;
  background-position: center;
  border-radius: 14px;
  padding: 0.95rem;
  cursor: pointer;
  transition: 0.2s;
  position: relative;
  overflow: hidden;
  min-height: 108px;
  color: var(--tile-text, var(--ink));
}

.type-tile.has-photo {
  background-image: linear-gradient(180deg, rgba(16, 24, 40, 0.45), rgba(16, 24, 40, 0.62)), var(--tile-image);
  border-color: transparent;
  color: #fff;
}

.type-tile:hover {
  border-color: color-mix(in srgb, var(--coral) 45%, var(--line));
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(30, 42, 68, 0.08);
}

.type-tile strong {
  display: block;
  font-family: var(--display);
  font-size: 1.05rem;
  color: inherit;
  position: relative;
  z-index: 1;
}

.type-tile span {
  display: block;
  color: var(--tile-muted, var(--muted));
  font-size: 0.75rem;
  margin: 0.25rem 0;
  position: relative;
  z-index: 1;
}

.type-tile.has-photo span {
  color: rgba(255, 255, 255, 0.85);
}

.type-tile em {
  font-style: normal;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--coral);
  position: relative;
  z-index: 1;
}

.type-tile.has-photo em {
  color: #fff;
}

.doc-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.doc-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 0.75rem 0.9rem;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0.95rem;
  box-shadow: 0 8px 20px rgba(16, 24, 32, 0.05);
}

.doc-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: #fff0eb;
  color: var(--coral);
  font-size: 1.2rem;
}

.doc-card-body h3 {
  margin: 0.35rem 0 0.2rem;
  font-size: 0.98rem;
  font-family: var(--display);
}

.doc-card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.doc-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.doc-card-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 0.5rem;
}

.doc-card-actions .ghost-btn,
.doc-card-actions .cta-btn {
  flex: 1;
  justify-content: center;
}

.cta-btn.compact {
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
}

.pill.muted {
  background: #f3f6f9;
  color: var(--muted);
}

.pill.type-bsq {
  background: #fff0eb;
  color: var(--coral-dark);
}
.pill.type-ksq {
  background: #e8f8f4;
  color: #0f7668;
}
.pill.type-annual {
  background: #fff7e6;
  color: #b45309;
}
.pill.type-normative {
  background: #e0f2fe;
  color: #0369a1;
}

.filter-bar,
.type-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.filter-bar select {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  background: #fff;
  flex: 1;
  min-width: 140px;
}

.type-detail-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.profile-actions .ghost-btn {
  flex: initial;
  padding: 0.75rem 1rem;
}

/* Bottom nav */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: flex-end;
  gap: 0.15rem;
  padding: 0.45rem 0.5rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 28px rgba(16, 24, 32, 0.08);
}

.bn-item {
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.35rem 0.2rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.bn-item i {
  font-size: 1.15rem;
}

.bn-item.active {
  color: var(--coral-dark);
}

.bn-plus {
  width: 58px;
  height: 58px;
  margin-bottom: 0.55rem;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
  color: #fff;
  font-size: 1.45rem;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(var(--accent-rgb), 0.4);
  display: grid;
  place-items: center;
  transform: translateY(-12px);
  transition: transform 0.2s, filter 0.2s;
}

.bn-plus:active {
  transform: translateY(-10px) scale(0.96);
}

/* Action sheet */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 24, 0.45);
  z-index: 90;
  opacity: 0;
  transition: opacity 0.2s;
}

.sheet-overlay.show {
  opacity: 1;
}

.action-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: #fff;
  border-radius: 22px 22px 0 0;
  padding: 0.75rem 1.1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  transform: translateY(110%);
  transition: transform 0.25s ease;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.15);
}

.action-sheet.show {
  transform: translateY(0);
}

.sheet-handle {
  width: 42px;
  height: 4px;
  border-radius: 4px;
  background: #d0d5dd;
  margin: 0.2rem auto 0.85rem;
}

.action-sheet h3 {
  margin: 0;
  font-family: var(--display);
}

.action-sheet > p {
  margin: 0.25rem 0 0.85rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.sheet-actions button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: left;
  border: 1px solid var(--line);
  background: #f8fafc;
  border-radius: 14px;
  padding: 0.85rem 0.95rem;
  cursor: pointer;
  font-weight: 700;
}

.sheet-actions button i {
  color: var(--coral);
  width: 1.2rem;
  text-align: center;
}

.sheet-actions small {
  display: block;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.75rem;
}

.sheet-cancel {
  width: 100%;
  margin-top: 0.75rem;
  justify-content: center;
}

@media (min-width: 860px) {
  .sm-hide {
    display: inline-flex !important;
  }

  /* Aşağı naviqasiya yalnız mobildə */
  .bottom-nav,
  .sheet-overlay,
  .action-sheet {
    display: none !important;
  }

  .portal-app {
    padding-bottom: 0;
  }
}

@media (max-width: 859px) {
  .sm-hide {
    display: none !important;
  }

  .bottom-nav {
    display: grid;
  }
}

/* Admin alət paneli (yalnız admin girişində) */
.admin-float-bar {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.55rem 1rem;
  background: #101820;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-float-bar a,
.admin-float-bar button {
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.admin-float-bar .cta-mini {
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
  border-color: transparent;
}

.admin-float-bar[hidden] {
  display: none !important;
}

/* Fənn kabinetləri */
.level-block {
  margin-bottom: 1rem;
}

.teachers-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.teachers-mode-tabs .chip i {
  margin-right: 0.35rem;
}

.teachers-grade-chips {
  margin-bottom: 1rem;
}

.grades-disclosure {
  padding: 0;
  overflow: hidden;
}

.grades-disclosure-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: inherit;
}

.grades-disclosure-btn small {
  font-weight: 600;
  color: var(--muted);
  margin-left: 0.35rem;
}

.grades-disclosure-body {
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--line);
}

.grades-disclosure-body[hidden] {
  display: none;
}

.cabinet-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

@media (min-width: 700px) {
  .cabinet-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1000px) {
  .cabinet-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.cabinet-card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f7f9fb 100%);
  border-radius: 16px;
  padding: 1rem 0.85rem;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  font: inherit;
  color: inherit;
}

.cabinet-card:hover {
  transform: translateY(-3px);
  border-color: #ffd2c4;
  box-shadow: 0 12px 28px rgba(16, 24, 32, 0.1);
}

.cabinet-door {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.65rem;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
  color: #fff;
  font-size: 1.2rem;
  box-shadow: 0 8px 18px rgba(var(--accent-rgb), 0.28);
}

.cabinet-door.large {
  width: 64px;
  height: 64px;
  font-size: 1.45rem;
  margin: 0;
}

.cabinet-card strong {
  display: block;
  font-family: var(--display);
  font-size: 0.9rem;
  line-height: 1.25;
  margin-bottom: 0.25rem;
}

.cabinet-card span {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.cabinet-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.25rem;
}

.cabinet-hero h2 {
  margin: 0;
  font-family: var(--display);
}

.cabinet-card .cab-count {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--coral-dark);
  font-style: normal;
}

.cabinet-card.active-cab {
  border-color: var(--coral);
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.2);
  background: #fff8f5;
}

.cabinet-door.type-bsq {
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
}
.cabinet-door.type-ksq {
  background: linear-gradient(135deg, #14b8a6, #2dd4bf);
  box-shadow: 0 8px 18px rgba(20, 184, 166, 0.28);
}
.cabinet-door.type-annual {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.28);
}
.cabinet-door.type-normative {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  box-shadow: 0 8px 18px rgba(2, 132, 199, 0.28);
}
.cabinet-door.type-other {
  background: linear-gradient(135deg, #64748b, #94a3b8);
  box-shadow: 0 8px 18px rgba(100, 116, 139, 0.28);
}

.docs-compact {
  align-items: stretch;
}

.doc-tile {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fff 0%, #f7f9fb 100%);
  border-radius: 16px;
  padding: 0.85rem 0.7rem 0.75rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.doc-tile:hover {
  transform: translateY(-2px);
  border-color: #ffd2c4;
  box-shadow: 0 10px 22px rgba(16, 24, 32, 0.08);
}

.doc-tile-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.4rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
  color: #fff;
  font-size: 1rem;
}

.doc-tile-icon.type-bsq {
  background: linear-gradient(135deg, var(--coral), var(--coral-soft));
}
.doc-tile-icon.type-ksq {
  background: linear-gradient(135deg, #14b8a6, #2dd4bf);
}
.doc-tile-icon.type-annual {
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
}
.doc-tile-icon.type-normative {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
}
.doc-tile-icon.type-other {
  background: linear-gradient(135deg, #64748b, #94a3b8);
}

.doc-tile strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-family: var(--display);
  font-size: 0.82rem;
  line-height: 1.3;
  min-height: 2.1em;
}

.doc-tile em {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.doc-tile-actions {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.doc-tile-actions .ghost-btn,
.doc-tile-actions .cta-btn {
  padding: 0.35rem 0.55rem;
  font-size: 0.75rem;
  min-height: 0;
}




.cta-btn.compact{padding:.4rem .65rem;font-size:.8rem;min-height:auto}

/* ——— Xəbərlər ——— */
.news-card {
  margin-bottom: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.news-card:hover {
  border-color: rgba(var(--accent-rgb), 0.35);
  box-shadow: 0 10px 24px rgba(16, 24, 32, 0.07);
}
.news-card-inner {
  display: grid;
  gap: 0.85rem;
  align-items: stretch;
}
.news-card-inner.has-media {
  grid-template-columns: 1fr;
}
.news-card-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 200px;
  border-radius: 12px;
  overflow: hidden;
  background: #e8eef3;
}
.news-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-card-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.news-card-meta {
  margin-bottom: 0.1rem;
}
.news-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.05rem;
  line-height: 1.3;
}
.news-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-more {
  margin-top: auto;
  padding-top: 0.35rem;
  color: var(--coral-dark);
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.news-empty {
  text-align: center;
  padding: 2rem 1.25rem;
}
.news-empty i {
  font-size: 2.2rem;
  color: var(--coral);
  margin-bottom: 0.75rem;
}
.news-empty h3 {
  margin: 0 0 0.4rem;
  font-family: var(--display);
}
.news-empty p {
  margin: 0;
  color: var(--muted);
}

.news-detail-wrap {
  margin-top: 0.25rem;
}
.news-detail-layout {
  display: grid;
  gap: 1rem;
  align-items: start;
}
.news-detail-layout.has-aside {
  grid-template-columns: 1fr;
}
.news-back {
  border: 0;
  background: transparent;
  color: var(--coral-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin: 0 0 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.news-detail-media {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #e8eef3;
  aspect-ratio: 16 / 9;
  max-height: 360px;
  margin-bottom: 0.85rem;
}
.news-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.news-detail-copy h1 {
  margin: 0.35rem 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  line-height: 1.25;
}
.news-detail-body {
  color: var(--ink);
  line-height: 1.7;
  font-size: 1rem;
}

.news-detail-aside {
  display: none;
}
.news-ad {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.news-ad--mobile {
  margin: 0 0 0.95rem;
}
.news-ad--side {
  position: sticky;
  top: 4.5rem;
}
.news-ad-item {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 8px 18px rgba(16, 24, 32, 0.06);
}
.news-ad-item img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 300 / 250;
  object-fit: cover;
}
.news-ad--mobile .news-ad-item img {
  aspect-ratio: 16 / 5;
  max-height: 120px;
  object-fit: cover;
}

@media (min-width: 860px) {
  .news-card-inner.has-media {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1rem;
    align-items: center;
  }
  .news-card-media {
    aspect-ratio: 4 / 3;
    max-height: none;
    height: 148px;
  }
  .news-card h3 {
    font-size: 1.15rem;
  }
  .news-detail-layout.has-aside {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.25rem;
  }
  .news-detail-aside {
    display: block;
  }
  .news-ad--mobile {
    display: none;
  }
  .news-detail-media {
    max-height: 380px;
  }
}

@media (max-width: 859px) {
  .news-detail-aside {
    display: none !important;
  }
}

/* Admin banner list */
.banner-admin-item {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  margin-bottom: 0.75rem;
}
.banner-admin-item img {
  width: 120px;
  height: 80px;
  object-fit: cover;
  border-radius: 10px;
  background: #eef2f6;
}
.banner-admin-item h3 {
  margin: 0 0 0.25rem;
  font-size: 0.98rem;
}
.banner-admin-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
@media (max-width: 640px) {
  .banner-admin-item {
    grid-template-columns: 1fr;
  }
  .banner-admin-item img {
    width: 100%;
    height: 120px;
  }
}

/* ——— Rəqəmsal mağaza ——— */
.shop-cat-bar {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.15rem 0 1rem;
  margin-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}
.shop-cat-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.shop-cat-chip.active {
  background: var(--btn);
  border-color: var(--btn);
  color: var(--btn-text);
}
.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.shop-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.shop-card-media {
  position: relative;
  aspect-ratio: 16 / 11;
  background: #1a2430;
  overflow: hidden;
}
.shop-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.shop-card-ph {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: #9aa8b8;
  font-size: 2rem;
  background: linear-gradient(145deg, #243041, #1a2430);
}
.shop-card-badge {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 1;
  background: rgba(16, 24, 32, 0.82);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.28rem 0.5rem;
  border-radius: 6px;
}
.shop-card-seller {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.85rem 0;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 600;
}
.shop-seller-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}
.shop-card-title {
  margin: 0.35rem 0.85rem 0;
  font-family: var(--display);
  font-size: 0.95rem;
  line-height: 1.35;
  color: var(--ink);
  min-height: 2.5em;
}
.shop-card-delivery {
  margin: 0.4rem 0.85rem 0;
  font-size: 0.78rem;
  color: var(--teal);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.shop-card-foot {
  margin-top: auto;
  padding: 0.75rem 0.85rem 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.shop-card-price {
  color: var(--teal);
  font-size: 1.05rem;
}
.shop-buy-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: var(--btn);
  color: var(--btn-text);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.shop-buy-btn:hover {
  background: var(--btn-hover);
}
.shop-admin-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.shop-admin-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.shop-admin-item img,
.shop-admin-ph {
  width: 88px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef2f6;
}
.shop-admin-ph {
  display: grid;
  place-items: center;
  color: var(--muted);
}
.shop-admin-item h3 {
  margin: 0;
  font-size: 0.95rem;
}
.shop-admin-item p {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}
.ghost-btn.compact,
.cta-btn.compact {
  padding: 0.4rem 0.7rem;
  font-size: 0.8rem;
  min-height: auto;
}
.pill.ok {
  background: rgba(31, 157, 138, 0.15);
  color: var(--teal);
}

/* ===== Onlayn imtahanlar ===== */
.exam-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.exam-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.1rem 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: 0 8px 24px rgba(16, 24, 32, 0.04);
}
.exam-card h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.15rem;
}
.exam-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  flex: 1;
}
.exam-card-top,
.exam-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.exam-card-badge {
  font-size: 0.78rem;
  background: rgba(16, 24, 32, 0.06);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  color: var(--ink);
}
.exam-card-meta {
  font-size: 0.82rem;
  color: var(--muted);
  justify-content: space-between;
}
.exam-card .cta-btn {
  width: 100%;
  justify-content: center;
}
.exam-empty {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
}
.exam-empty i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: var(--coral);
}
.exam-empty.compact {
  padding: 1rem;
}
.exam-mine-item {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}
.exam-mine-item:last-child {
  border-bottom: 0;
}
.exam-mine-title-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.exam-mine-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.exam-admin-note {
  margin: 0.35rem 0 0;
  color: #9a3412;
  font-size: 0.86rem;
}
.exam-share-line {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
}
.exam-share-line code {
  background: #f1f5f9;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  word-break: break-all;
}
.exam-status.amber {
  background: rgba(217, 119, 6, 0.15);
  color: #b45309;
}
.exam-status.teal {
  background: rgba(31, 157, 138, 0.15);
  color: var(--teal);
}
.exam-status.coral {
  background: rgba(var(--accent-rgb), 0.15);
  color: var(--coral);
}
.exam-meta-form .exam-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}
.exam-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
}
.exam-q-editor {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.9rem;
  margin-bottom: 0.85rem;
  background: linear-gradient(180deg, #fff, #f8fafc);
}
.exam-q-editor-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}
.exam-q-options {
  display: grid;
  gap: 0.45rem;
  margin: 0.65rem 0;
}
.exam-opt-row {
  display: grid;
  grid-template-columns: auto 1.5rem 1fr;
  gap: 0.45rem;
  align-items: center;
}
.exam-q-image-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}
.exam-q-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
}
.exam-file-btn {
  cursor: pointer;
}
.exam-builder-foot {
  margin-top: 0.75rem;
}
.exam-admin-filters {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.text-link.danger,
.ghost-btn.danger {
  color: #b91c1c;
}
.muted {
  color: var(--muted);
}

/* Take experience */
.exam-take-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(var(--accent-rgb), 0.12), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(31, 157, 138, 0.1), transparent 50%),
    linear-gradient(180deg, #eef3f7, #e8eef4 40%, #f3f6f9);
  font-family: var(--font, "Alegreya Sans", system-ui, sans-serif);
  color: var(--ink, #101820);
}
.exam-take-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
}
.exam-take-top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}
.exam-step-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.exam-step-pills span {
  font-size: 0.78rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(16, 24, 32, 0.06);
  color: var(--muted);
}
.exam-step-pills span.on {
  background: var(--btn, var(--coral));
  color: var(--btn-text, #fff);
}
.exam-boot {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}
.exam-panel {
  background: var(--panel, #fff);
  border-radius: 20px;
  padding: 1.5rem 1.4rem 1.6rem;
  border: 1px solid rgba(16, 24, 32, 0.06);
  box-shadow: 0 18px 40px rgba(16, 24, 32, 0.06);
  max-width: 720px;
}
.exam-panel h1 {
  margin: 0.2rem 0 0.6rem;
  font-family: var(--display, "Sora", sans-serif);
}
.exam-rules-box {
  background: #f8fafc;
  border-left: 4px solid var(--coral, var(--coral));
  border-radius: 0 12px 12px 0;
  padding: 1rem 1.1rem;
  margin: 1rem 0 1.25rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.exam-gate-form {
  display: grid;
  gap: 0.75rem;
  max-width: 420px;
}
.exam-gate-form label,
.exam-meta-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.9rem;
}
.exam-gate-form input,
.exam-meta-form input,
.exam-meta-form textarea,
.exam-q-editor textarea,
.exam-q-editor input[type="text"] {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line, #d8e0e8);
  border-radius: 10px;
  background: #fff;
}
.exam-live {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  align-items: start;
}
.exam-nav-rail {
  position: sticky;
  top: 0.75rem;
  background: var(--panel, #fff);
  border-radius: 16px;
  padding: 0.9rem;
  border: 1px solid rgba(16, 24, 32, 0.06);
  display: grid;
  gap: 0.75rem;
}
.exam-timer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-radius: 12px;
  background: #101820;
  color: #fff;
  justify-content: center;
}
.exam-timer.urgent {
  background: #b91c1c;
  animation: examPulse 1s ease-in-out infinite;
}
@keyframes examPulse {
  50% { transform: scale(1.03); }
}
.exam-nav-label {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.exam-num-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
}
.exam-num {
  aspect-ratio: 1;
  border: 1px solid var(--line, #d8e0e8);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
}
.exam-num.answered {
  background: rgba(31, 157, 138, 0.15);
  border-color: var(--teal);
  color: var(--teal);
}
.exam-num.current {
  outline: 2px solid var(--coral, var(--coral));
  outline-offset: 1px;
}
.exam-question-stage {
  background: var(--panel, #fff);
  border-radius: 18px;
  padding: 1.25rem 1.2rem 1.4rem;
  border: 1px solid rgba(16, 24, 32, 0.06);
  min-height: 420px;
}
.exam-q-progress {
  color: var(--muted);
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}
.exam-question-card h2 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  line-height: 1.4;
  font-family: var(--display, "Sora", sans-serif);
}
.exam-q-image {
  max-width: 100%;
  max-height: 280px;
  border-radius: 12px;
  margin-bottom: 1rem;
  object-fit: contain;
  background: #f1f5f9;
}
.exam-options {
  display: grid;
  gap: 0.55rem;
}
.exam-option {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "key text";
  gap: 0.65rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--line, #d8e0e8);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.exam-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.exam-option:hover {
  border-color: rgba(var(--accent-rgb), 0.45);
}
.exam-option.selected {
  border-color: var(--coral, var(--coral));
  background: rgba(var(--accent-rgb), 0.08);
  transform: translateY(-1px);
}
.exam-opt-key {
  grid-area: key;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #101820;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}
.exam-opt-text {
  grid-area: text;
}
.exam-q-nav-btns {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.exam-score-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  margin: 1rem 0 1.5rem;
}
.exam-score-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  border: 6px solid #d8e0e8;
}
.exam-score-ring.pass {
  border-color: var(--teal);
  background: rgba(31, 157, 138, 0.08);
}
.exam-score-ring.fail {
  border-color: var(--coral);
  background: rgba(var(--accent-rgb), 0.08);
}
.exam-score-ring strong {
  font-size: 2rem;
  font-family: var(--display, "Sora", sans-serif);
}
.exam-score-ring span {
  font-size: 0.85rem;
  color: var(--muted);
}
.exam-score-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.exam-score-facts li {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.exam-review-list {
  display: grid;
  gap: 0.85rem;
}
.exam-review-item {
  border: 1px solid var(--line, #d8e0e8);
  border-radius: 14px;
  padding: 0.9rem 1rem;
}
.exam-review-item.ok {
  border-color: rgba(31, 157, 138, 0.35);
}
.exam-review-item.bad {
  border-color: rgba(var(--accent-rgb), 0.35);
}
.exam-review-item header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}
.exam-review-item img {
  max-width: 100%;
  max-height: 180px;
  border-radius: 8px;
  margin: 0.4rem 0;
}
.exam-review-opt {
  display: flex;
  gap: 0.55rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  font-size: 0.9rem;
}
.exam-review-opt.correct {
  background: rgba(31, 157, 138, 0.12);
  font-weight: 600;
}
.exam-review-opt.wrong {
  background: rgba(185, 28, 28, 0.1);
  text-decoration: line-through;
}
.exam-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

@media (max-width: 820px) {
  .exam-live {
    grid-template-columns: 1fr;
  }
  .exam-nav-rail {
    position: static;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "timer finish"
      "label label"
      "nums nums";
  }
  .exam-timer { grid-area: timer; }
  #finishExamBtn { grid-area: finish; }
  .exam-nav-label { grid-area: label; }
  .exam-num-grid {
    grid-area: nums;
    grid-template-columns: repeat(6, 1fr);
  }
  .exam-meta-form .exam-meta-grid {
    grid-template-columns: 1fr;
  }
  .exam-mine-item {
    flex-direction: column;
  }
}



/* ===== Theme studio + polish 2026-08-11 ===== */
.theme-preview-bar {
  height: 56px;
  border-radius: 14px;
  margin-bottom: 0.85rem;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--sidebar-from), var(--sidebar), var(--sidebar-to));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  color: #e8eef5;
  font-size: 0.8rem;
  font-weight: 700;
  gap: 0.5rem;
}
.theme-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}
.theme-preview-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  background: var(--btn);
  color: var(--btn-text);
  font-size: 0.72rem;
}
.theme-primary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: end;
  margin-bottom: 0.85rem;
}
.theme-primary-label input[type="color"] {
  width: 64px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
}
.theme-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}
.theme-swatch {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  background: var(--sw);
  cursor: pointer;
}
.theme-swatch:hover { transform: scale(1.08); }
.theme-advanced {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem 0.85rem 0.85rem;
  background: color-mix(in srgb, var(--panel) 92%, var(--bg));
}
.theme-advanced summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
}

.bottom-nav {
  background: color-mix(in srgb, var(--panel) 92%, transparent) !important;
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.bn-item.active {
  color: var(--coral) !important;
}
.bn-item.active i {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--coral);
}

.portal-top .hamburger {
  background: var(--panel);
  border-color: var(--line);
}
.portal-top .hamburger span {
  background: var(--ink);
}
.portal-top-actions .icon-btn {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink);
}
.portal-top #topAuthBtn.cta-btn {
  background: #e85d04;
  color: #ffffff;
  border: 1px solid #e85d04;
  box-shadow: none;
}
.portal-top #topAuthBtn.user-chip {
  background: color-mix(in srgb, var(--coral) 12%, var(--panel));
  color: var(--ink);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
}

.drawer .icon-btn {
  color: #fff;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
}
.drawer .nav-link.active {
  background: rgba(var(--accent-rgb), 0.28) !important;
  box-shadow: inset 3px 0 0 var(--coral);
}

.exam-q-media {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}
.exam-url-row {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.exam-url-row input {
  flex: 1;
  min-width: 0;
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}
.exam-q-editor {
  background: color-mix(in srgb, var(--panel) 96%, var(--coral) 4%);
  border-color: color-mix(in srgb, var(--line) 80%, var(--coral) 20%);
}
.exam-card {
  border-color: color-mix(in srgb, var(--line) 75%, var(--coral) 25%);
  box-shadow: var(--shadow);
}
.exam-card .cta-btn,
.cta-btn {
  background: linear-gradient(180deg, #efc45a, var(--btn));
  color: var(--btn-text);
  box-shadow: none;
}
.cta-btn:hover {
  background: linear-gradient(180deg, #efc45a, var(--btn-hover));
}
.cta-btn[data-dl],
.doc-tile-actions .cta-btn,
.doc-card-actions .cta-btn {
  background: #1f6fbf;
  border-color: #1f6fbf;
}
.exam-home-actions .cta-btn,
.exam-card .cta-btn {
  background: #0f8b8d;
  border-color: #0f8b8d;
}
.home-tile-editors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.85rem;
}
.home-tile-editor label {
  font-size: 0.82rem;
}

.hub-panel {
  margin: 0 0 1.15rem;
}
.hub-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 720px) {
  .hub-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.hub-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  text-decoration: none;
  color: inherit;
  background: var(--panel, #fffdf8);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.15rem 1.2rem 1.05rem;
  min-height: 168px;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, border-color 0.18s ease;
}
.hub-card:hover {
  transform: translateY(-3px);
  border-color: #c9b48a;
}
.hub-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #082032;
  color: #e0b33a;
  font-size: 1.1rem;
  margin-bottom: 0.35rem;
}
.hub-card h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.22rem;
  color: var(--ink);
}
.hub-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  flex: 1;
}
.hub-go {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: #8a6910;
}
.hub-card--ixtisas .hub-icon { background: #082032; color: #e0b33a; }
.hub-card--cadvel .hub-icon { background: #0e334c; color: #efc45a; }
.hub-card--exam .hub-icon { background: #1b7a4a; color: #ecfccb; }

@media (max-width: 640px) {
  .portal-brand-bar {
    max-width: calc(100% - 6.5rem);
  }
  .portal-top #topAuthBtn.user-chip .user-chip-name {
    max-width: 4.5rem;
  }
  .theme-primary-row {
    align-items: stretch;
  }
}
