@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700&display=swap");

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

:root {
  --brand: #25d366;
  --brand-dark: #128c7e;
  --brand-deep: #075e54;
  --brand-light: #dcfce7;
  --brand-mid: #bbf7d0;
  --bg-page: #f4f6f8;
  --bg-card: #ffffff;
  --bg-surface: #f0f2f5;
  --text-1: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --border: rgba(0, 0, 0, 0.09);
  --border-mid: rgba(0, 0, 0, 0.16);
  --radius-sm: 6px;
  --radius-md: 6px;
  --radius-lg: 6px;
  --mono: "Courier New", Courier, monospace;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --danger: #ef4444;
  --danger-light: #fef2f2;
  /* admin sidebar */
  --sidebar-bg: #ffffff;
  --sidebar-border: rgba(0, 0, 0, 0.09);
  --sidebar-nav-color: rgba(0, 0, 0, 0.5);
  --sidebar-nav-hover-color: rgba(0, 0, 0, 0.8);
  --sidebar-nav-active-color: #111827;
  --sidebar-nav-hover-bg: rgba(0, 0, 0, 0.04);
  --sidebar-nav-active-bg: rgba(37, 211, 102, 0.12);
  --sidebar-profile-name: #111827;
  --sidebar-footer-link: rgba(0, 0, 0, 0.4);
  --sidebar-footer-link-hover: rgba(0, 0, 0, 0.7);
}

/* Dark vars shared by both media query and explicit toggle */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --brand-light: #052e16;
    --brand-mid: #14532d;
    --bg-page: #0f1117;
    --bg-card: #1a1d23;
    --bg-surface: #23272f;
    --text-1: #f9fafb;
    --text-2: #9ca3af;
    --text-3: #6b7280;
    --border: rgba(255, 255, 255, 0.08);
    --border-mid: rgba(255, 255, 255, 0.14);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --danger-light: #2d1515;
    --sidebar-bg: #161b22;
    --sidebar-border: rgba(255, 255, 255, 0.07);
    --sidebar-nav-color: rgba(255, 255, 255, 0.55);
    --sidebar-nav-hover-color: rgba(255, 255, 255, 0.85);
    --sidebar-nav-active-color: #fff;
    --sidebar-nav-hover-bg: rgba(255, 255, 255, 0.05);
    --sidebar-nav-active-bg: rgba(37, 211, 102, 0.08);
    --sidebar-profile-name: #fff;
    --sidebar-footer-link: rgba(255, 255, 255, 0.35);
    --sidebar-footer-link-hover: rgba(255, 255, 255, 0.65);
  }
}

html[data-theme="dark"] {
  --brand-light: #052e16;
  --brand-mid: #14532d;
  --bg-page: #0f1117;
  --bg-card: #1a1d23;
  --bg-surface: #23272f;
  --text-1: #f9fafb;
  --text-2: #9ca3af;
  --text-3: #6b7280;
  --border: rgba(255, 255, 255, 0.08);
  --border-mid: rgba(255, 255, 255, 0.14);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --danger-light: #2d1515;
  --sidebar-bg: #161b22;
  --sidebar-border: rgba(255, 255, 255, 0.07);
  --sidebar-nav-color: rgba(255, 255, 255, 0.55);
  --sidebar-nav-hover-color: rgba(255, 255, 255, 0.85);
  --sidebar-nav-active-color: #fff;
  --sidebar-nav-hover-bg: rgba(255, 255, 255, 0.05);
  --sidebar-nav-active-bg: rgba(37, 211, 102, 0.08);
  --sidebar-profile-name: #fff;
  --sidebar-footer-link: rgba(255, 255, 255, 0.35);
  --sidebar-footer-link-hover: rgba(255, 255, 255, 0.65);
}

html[data-theme="light"] {
  --brand-light: #dcfce7;
  --brand-mid: #bbf7d0;
  --bg-page: #f4f6f8;
  --bg-card: #ffffff;
  --bg-surface: #f0f2f5;
  --text-1: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --border: rgba(0, 0, 0, 0.09);
  --border-mid: rgba(0, 0, 0, 0.16);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --danger-light: #fef2f2;
}

/* Smooth transition only while switching themes */
html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: background-color 0.25s ease, color 0.2s ease,
              border-color 0.25s ease, box-shadow 0.25s ease !important;
}

/* THEME TOGGLE BUTTON */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  background: var(--bg-card);
  color: var(--brand);
  border-color: var(--brand);
}

body {
  font-family: "Poppins", sans-serif;
  background: var(--bg-page);
  color: var(--text-1);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
}

/* ── HEADER ─────────────────────────────────── */
.header {
  height: 72px;
  background: var(--bg-card);
  border-bottom: 0.5px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: 80%;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}
.logo {
  display: flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}
.header-logo {
  height: 42px;
  width: auto;
  display: block;
}
.header-logo-icon {
  height: 26px;
  width: auto;
  display: none;
}
.header-divider {
  width: 0.5px;
  height: 22px;
  background: var(--border-mid);
}
.header-label {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.prog-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
}
.prog-track {
  width: 72px;
  height: 5px;
  background: var(--border-mid);
  border-radius: 3px;
}
.prog-fill {
  height: 5px;
  background: var(--brand);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.prog-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-dark);
  min-width: 34px;
}

/* User menu */
.user-menu {
  position: relative;
}
.user-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  user-select: none;
}
.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  min-width: 180px;
  padding: 8px 0;
  display: none;
  z-index: 200;
}
.user-dropdown.open {
  display: block;
}
.user-dropdown-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  padding: 6px 14px 2px;
}
.user-dropdown-email {
  font-size: 11px;
  color: var(--text-3);
  padding: 0 14px 8px;
}
.user-dropdown-divider {
  height: 0.5px;
  background: var(--border);
  margin: 4px 0;
}
.user-dropdown-item {
  display: block;
  width: 100%;
  font-size: 13px;
  color: var(--text-2);
  padding: 7px 14px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  font-family: inherit;
  transition: background 0.1s;
}
.user-dropdown-item:hover {
  background: var(--bg-surface);
  color: var(--text-1);
}
.user-dropdown-logout {
  color: var(--danger);
}
.user-dropdown-logout:hover {
  background: var(--danger-light);
}

/* ── LAYOUT ──────────────────────────────────── */
.layout {
  display: flex;
  height: calc(100vh - 72px);
}

/* ── SIDEBAR (portal removido) ───────────────── */
.sidebar {
  display: none;
  width: 272px;
  background: var(--bg-card);
  border-right: 0.5px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.layout.sidebar-collapsed .sidebar {
  width: 0;
  border-right: none;
}
.sb-search {
  padding: 12px 14px;
  border-bottom: 0.5px solid var(--border);
}
.sb-search input {
  width: 100%;
  padding: 7px 11px;
  font-size: 13px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: inherit;
  outline: none;
}
.sb-search input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.12);
}
.sb-search input::placeholder {
  color: var(--text-3);
}
.sb-filters {
  display: flex;
  gap: 6px;
  padding: 9px 14px;
  border-bottom: 0.5px solid var(--border);
  flex-wrap: wrap;
}
.f-pill {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  border: 0.5px solid var(--border-mid);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.f-pill:hover {
  color: var(--text-1);
  border-color: var(--brand);
}
.f-pill.on {
  background: var(--brand-light);
  color: var(--brand-dark);
  border-color: var(--brand-mid);
}
.topic-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0 16px;
}
.topic-list::-webkit-scrollbar {
  width: 4px;
}
.topic-list::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 4px;
}
.sb-loading,
.sb-empty {
  font-size: 13px;
  color: var(--text-3);
  padding: 16px 14px;
}
.group-lbl {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 12px 14px 4px;
}
.t-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  border-left: 2.5px solid transparent;
  transition: all 0.12s;
}
.t-row:hover {
  background: var(--bg-surface);
}
.t-row.active {
  border-left-color: var(--brand);
  background: var(--brand-light);
}
.t-circle {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-mid);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.t-circle.done {
  background: var(--brand);
  border-color: var(--brand);
}
.t-circle.done::after {
  content: "";
  width: 6px;
  height: 4px;
  border-left: 1.5px solid white;
  border-bottom: 1.5px solid white;
  transform: rotate(-45deg) translateY(-1px);
  display: block;
}
.t-info {
  flex: 1;
  min-width: 0;
}
.t-name {
  font-size: 13px;
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.t-row.active .t-name {
  font-weight: 600;
  color: var(--brand-deep);
}
.t-sub {
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 1px;
}

/* ── MAIN ────────────────────────────────────── */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px;
  background: var(--bg-page);
}
.main::-webkit-scrollbar {
  width: 5px;
}
.main::-webkit-scrollbar-thumb {
  background: var(--border-mid);
  border-radius: 4px;
}
.page {
  display: none;
}

/* HOME */
#pg-home,
#pg-profile,
#pg-category,
#pg-topic {
  max-width: 80%;
  margin: 0 auto;
}
.home-hero {
  margin-bottom: 28px;
  text-align: center;
}
.home-hero h1 {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 6px;
}
.home-hero p {
  font-size: 14px;
  color: var(--text-2);
  max-width: 540px;
  line-height: 1.65;
  margin: 0 auto;
}
.featured-video-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  max-width: 50%;
  margin-left: auto;
  margin-right: auto;
}
#topic-video .featured-video-card,
#topic-content .featured-video-card,
#ob-detail-video .featured-video-card {
  max-width: 60%;
}
.featured-video-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  padding: 16px 20px 12px;
}
.featured-video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}
.featured-video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
#fv-yt-target {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}
#fv-yt-target iframe {
  width: 100% !important;
  height: 100% !important;
  display: block;
}
.fv-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(transparent, rgba(0,0,0,0.72));
  z-index: 2;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  opacity: 0;
  transition: opacity .2s;
}
.featured-video-embed:hover .fv-controls { opacity: 1; }
.fv-play-btn,
.fv-vol-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #fff;
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  opacity: .9;
  transition: opacity .15s;
}
.fv-play-btn:hover,
.fv-vol-btn:hover { opacity: 1; }
.fv-vol-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.fv-vol-slider {
  width: 76px;
  accent-color: #fff;
  cursor: pointer;
  height: 3px;
}
.featured-video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 13px;
  background: var(--bg-surface);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stat-val {
  font-size: 26px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 3px;
}
.stat-lbl {
  font-size: 12px;
  color: var(--text-2);
}

.continue-btn {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.continue-btn:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
}
.cb-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: var(--brand-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cb-icon svg {
  width: 18px;
  height: 18px;
  fill: var(--brand-dark);
}
.cb-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
}
.cb-sub {
  font-size: 12px;
  color: var(--text-2);
}
.cb-arrow {
  margin-left: auto;
  font-size: 20px;
  color: var(--text-3);
}

.sec-lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 12px;
}
/* CATEGORY CARDS (home) */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 4px;
}
@media (max-width: 860px) {
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) {
  .categories-grid { grid-template-columns: 1fr; }
}
.cat-carousel-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  color: var(--text-1);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
  line-height: 1;
}
.cat-carousel-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.cat-carousel-btn:disabled { opacity: 0.3; cursor: default; }
.cat-carousel-dots { display: flex; gap: 6px; align-items: center; }
.cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.cat-dot.active { background: var(--brand); transform: scale(1.25); }
.cat-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.cat-card:hover { border-color: var(--brand); transform: translateY(-3px); box-shadow: 0 6px 20px rgba(37, 211, 102, 0.12); }
.cat-card-img   { width: 100%; height: auto; aspect-ratio: 20/9; object-fit: contain; display: block; flex-shrink: 0; background: var(--bg-surface); }
.cat-card-body  { padding: 18px 20px 20px; flex: 1; display: flex; flex-direction: column; }
.cat-card-name  { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 6px; }
.cat-card-count { font-size: 12px; color: var(--text-3); margin-bottom: 16px; }
.cat-card-bar   { height: 4px; background: var(--bg-surface); border-radius: 2px; margin-bottom: 10px; }
.cat-card-bar-fill { height: 100%; background: var(--brand); border-radius: 2px; transition: width .3s; }
.cat-card-footer { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-3); margin-top: auto; }
.cat-card-arrow { display: none; }

/* CATEGORY PAGE */
.cat-hero {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  margin-top: 20px;
  margin-bottom: 24px;
  display: block;
}
.topic-hero {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-top: 20px;
  margin-bottom: 24px;
  display: block;
}
.cat-page-header { margin: 0 0 24px; }
.cat-page-title  { font-size: 22px; font-weight: 700; color: var(--text-1); margin-bottom: 4px; }
.cat-page-meta   { font-size: 12px; color: var(--text-3); }

/* ADMIN — category image upload */
.cat-img-upload-area {
  display: block;
  position: relative;
  width: 100%;
  height: 148px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px dashed var(--border-mid);
  cursor: pointer;
  transition: border-color .15s;
}
.cat-img-upload-area:hover { border-color: var(--brand); }
.cat-img-preview {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 12px;
  background: var(--bg-surface);
}
.cat-img-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .15s;
}
.cat-img-upload-area:hover .cat-img-overlay { opacity: 1; }
.cat-img-hint {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 6px;
}
.cat-img-hint strong {
  color: var(--text-2);
  font-weight: 600;
}
.cat-img-remove-btn {
  font-size: 12px;
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0 0;
  display: block;
}
.cat-topics-list { display: flex; flex-direction: column; }
.cat-topic-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  margin-bottom: 8px;
}
.cat-topic-row:hover { border-color: var(--brand); background: rgba(18,188,190,.04); }
.cat-topic-check {
  flex-shrink: 0;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: #fff; transition: background .15s, border-color .15s;
}
.cat-topic-check.done { background: var(--brand); border-color: var(--brand); }
.cat-topic-info  { flex: 1; min-width: 0; }
.cat-topic-name  { font-size: 14px; font-weight: 500; color: var(--text-1); margin-bottom: 5px; }
.cat-topic-meta  { display: flex; gap: 6px; align-items: center; }
.cat-topic-arrow { color: var(--text-3); flex-shrink: 0; transition: color .15s; }
.cat-topic-row:hover .cat-topic-arrow { color: var(--brand); }
.breadcrumb-cat  { cursor: pointer; transition: color .12s; }
.breadcrumb-cat:hover { color: var(--brand); }

/* BADGES */
.badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
}
.badge-video {
  background: var(--brand-light);
  color: var(--brand-dark);
}
.badge-article {
  background: #eff6ff;
  color: #1d4ed8;
}
.badge-dur {
  background: var(--bg-surface);
  color: var(--text-2);
  border: 0.5px solid var(--border);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .badge-article {
    background: #1e3a5f;
    color: #93c5fd;
  }
}
html[data-theme="dark"] .badge-article {
  background: #1e3a5f;
  color: #93c5fd;
}

/* CONTENT PAGE */
.breadcrumb {
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 14px;
  margin-top: 16px;
}
.breadcrumb span {
  color: var(--text-2);
}
.content-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.content-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-1);
  line-height: 1.25;
}
.content-badges {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.mark-btn {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 7px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-1);
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 4px;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, box-shadow 0.15s;
}
.mark-btn:hover {
  background: var(--bg-surface);
  border-color: var(--text-3);
}
.mark-btn.done {
  background: linear-gradient(135deg, #0e6f7a 0%, #12bcbe 50%, #0e6f7a 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(18, 188, 190, 0.35);
}
.mark-btn.done:hover {
  opacity: 0.88;
  box-shadow: 0 6px 20px rgba(18, 188, 190, 0.5);
}

/* VIDEO */
.video-block {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  margin-bottom: 22px;
  transition: border-color 0.12s;
}
.video-block:hover {
  border-color: var(--brand);
}
.video-block:hover .vplay {
  background: var(--brand);
}
.vplay {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--brand-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.vplay svg {
  width: 22px;
  height: 22px;
  fill: white;
  margin-left: 3px;
}
.vdur {
  position: absolute;
  bottom: 14px;
  left: 18px;
  font-size: 12px;
  color: var(--text-2);
}

.video-embed {
  position: relative; padding-bottom: 56.25%;
  height: 0; overflow: hidden;
  border-radius: var(--radius-lg); margin-bottom: 22px;
}
.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
}

/* ARTICLE */
.article {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.8;
  max-width: 700px;
}
.article h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
  margin: 24px 0 10px;
}
.article p {
  margin-bottom: 14px;
}
.article ul {
  padding-left: 20px;
  margin-bottom: 14px;
}
.article ul li {
  margin-bottom: 6px;
}
.article strong {
  color: var(--text-1);
  font-weight: 600;
}
.article code {
  font-family: var(--mono);
  font-size: 12px;
  background: var(--bg-surface);
  padding: 2px 5px;
  border-radius: 4px;
  color: var(--text-1);
  border: 0.5px solid var(--border);
}
.code-block {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-1);
  line-height: 1.65;
  margin: 14px 0;
  overflow-x: auto;
  white-space: pre;
}
.info-box {
  background: var(--brand-light);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--brand-deep);
  margin: 16px 0;
  line-height: 1.6;
}
@media (prefers-color-scheme: dark) {
  .info-box {
    color: var(--brand-mid);
  }
}

/* CONTENT NAV */
.content-nav {
  display: flex;
  gap: 10px;
  margin-top: 36px;
  padding-top: 22px;
  border-top: 0.5px solid var(--border);
}

/* TOPIC REVIEWS */
.reviews-section { margin-top: 32px; }
.reviews-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-3);
  margin-bottom: 14px;
}
.review-item {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.review-item:last-child { padding-bottom: 0; }
.review-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.review-av {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(18,188,190,.12);
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.review-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-name  { font-size: 13px; font-weight: 600; color: var(--text-1); }
.review-stars { font-size: 14px; line-height: 1; }
.review-label { font-size: 12px; color: var(--text-3); }
.review-comment {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
  padding-left: 42px;
}

/* TOPIC FEEDBACK CARD */
.topic-feedback-card {
  margin-top: 40px;
  padding: 28px 28px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.topic-feedback-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--text-1);
}
.topic-feedback-question {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
}
.topic-stars-wrap { margin-bottom: 20px; }
.topic-stars {
  display: flex;
  gap: 8px;
}
.topic-star-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 12px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  transition: border-color .15s, background .15s, transform .1s;
  user-select: none;
}
.topic-star-item:hover,
.topic-star-item.hover {
  border-color: #f59e0b;
  background: rgba(245,158,11,.06);
  transform: translateY(-2px);
}
.topic-star-item.active {
  border-color: #f59e0b;
  background: rgba(245,158,11,.1);
}
.topic-star {
  font-size: 26px;
  color: var(--border-mid);
  line-height: 1;
  transition: color .12s;
}
.topic-star-item.active .topic-star,
.topic-star-item.hover  .topic-star { color: #f59e0b; }
.topic-star-lbl {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
  transition: color .12s;
}
.topic-star-item.active .topic-star-lbl,
.topic-star-item.hover  .topic-star-lbl { color: #f59e0b; }
.topic-feedback-comment {
  width: 100%;
  min-height: 80px;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 16px;
  box-sizing: border-box;
  transition: border-color .15s;
}
.topic-feedback-comment:focus { outline: none; border-color: var(--brand); }
.topic-feedback-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.topic-feedback-msg {
  font-size: 13px;
  min-height: 16px;
}
.topic-feedback-msg.ok  { color: var(--brand); }
.topic-feedback-msg.err { color: #ef4444; }
.nav-btn {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-1);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
  flex: 1;
}
.nav-btn:hover {
  background: var(--bg-surface);
  border-color: var(--text-3);
}
.nav-btn.primary {
  background: linear-gradient(135deg, #0e6f7a 0%, #12bcbe 50%, #0e6f7a 100%);
  color: #fff;
  border: none;
  box-shadow: 0 4px 14px rgba(18, 188, 190, 0.35);
}
.nav-btn.primary:hover {
  opacity: 0.88;
  box-shadow: 0 6px 20px rgba(18, 188, 190, 0.5);
  background: linear-gradient(135deg, #0e6f7a 0%, #12bcbe 50%, #0e6f7a 100%);
}
.nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

/* ── LOGIN PAGE ──────────────────────────────── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(
    ellipse at center,
    #12bcbe 0%,
    #0fa4a6 11%,
    #0b8b8d 22%,
    #087274 33%,
    #055a5c 44%,
    #034047 55%,
    #022733 66%,
    #011520 77%,
    #010a12 88%,
    #010509 100%
  );
}
.login-wrap {
  width: 100%;
  max-width: 400px;
  padding: 16px;
}
.login-card {
  background: rgba(4, 18, 28, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(18, 188, 190, 0.2);
  border-radius: 20px;
  padding: 44px 40px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.login-brand {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo {
  max-width: 160px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
}
.login-brand-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 4px;
  letter-spacing: 0.02em;
}
.login-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #0e6f7a 0%, #12bcbe 50%, #0e6f7a 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(18, 188, 190, 0.35);
  transition: opacity 0.15s, box-shadow 0.15s;
}
.login-btn:hover:not(:disabled) {
  opacity: 0.88;
  box-shadow: 0 6px 20px rgba(18, 188, 190, 0.5);
}
.login-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.login-error {
  font-size: 13px;
  color: #f87171;
  min-height: 18px;
}

/* ── FORM FIELDS (shared) ─────────────────────── */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.field-input {
  padding: 10px 13px;
  font-size: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: inherit;
  outline: none;
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}
.field-input::placeholder {
  color: var(--text-3);
}
/* Login card is always dark — restore white palette for its fields */
.login-body .field-label { color: rgba(255, 255, 255, 0.7); }
.login-body .field-input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.login-body .field-input::placeholder { color: rgba(255, 255, 255, 0.25); }
/* ── CUSTOM SELECT ───────────────────────────── */
.cs-wrap {
  position: relative;
}
.cs-box {
  padding: 10px 13px;
  font-size: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
  transition:
    border-color 0.15s,
    background 0.15s,
    box-shadow 0.15s;
}
.cs-box:hover {
  border-color: #12bcbe;
  background: rgba(18, 188, 190, 0.12);
  box-shadow: 0 0 0 2px rgba(18, 188, 190, 0.14);
}
.cs-box.open {
  border-color: #12bcbe;
  background: rgba(18, 188, 190, 0.08);
  box-shadow: 0 0 0 3px rgba(18, 188, 190, 0.18);
}
.cs-arrow {
  font-size: 10px;
  opacity: 0.55;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.cs-box.open .cs-arrow {
  transform: rotate(180deg);
}
.cs-drop {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 300;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: none;
}
.cs-box.open ~ .cs-drop {
  display: block;
}
.cs-opt {
  padding: 9px 13px;
  font-size: 14px;
  color: var(--text-1);
  cursor: pointer;
  transition:
    background 0.1s,
    color 0.1s;
}
.cs-opt:hover {
  background: rgba(18, 188, 190, 0.18);
  color: var(--text-1);
}
.cs-opt.sel {
  background: rgba(18, 188, 190, 0.14);
  color: #12bcbe;
  font-weight: 600;
}
.field-input:focus {
  border-color: #12bcbe;
  background: rgba(18, 188, 190, 0.08);
  box-shadow: 0 0 0 3px rgba(18, 188, 190, 0.18);
}
.field-textarea {
  min-height: 160px;
  resize: vertical;
}
.field-textarea {
  min-height: 160px;
  resize: vertical;
}
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* ── ADMIN LAYOUT ─────────────────────────────── */
.admin-body {
  background: var(--bg-page);
}
.admin-layout {
  display: flex;
  height: 100vh;
}

.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 0.5px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
}
.admin-sidebar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 72px;
  box-sizing: border-box;
  padding: 0 16px;
  border-bottom: 0.5px solid var(--sidebar-border);
  flex-shrink: 0;
}
.admin-sidebar-logo {
  height: 36px;
  width: auto;
  display: block;
}
.admin-sidebar-icon {
  height: 28px;
  width: auto;
  display: none;
}
.admin-sidebar-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 14px;
}
.admin-profile-av {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0e6f7a, #12bcbe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.admin-profile-info {
  min-width: 0;
}
.admin-profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-profile-name);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-profile-role {
  font-size: 10px;
  color: #12bcbe;
  margin-top: 1px;
  font-weight: 500;
}

.admin-nav {
  flex: 1;
  padding: 10px 0;
}
.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--sidebar-nav-color);
  text-decoration: none;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all 0.12s;
}
.admin-nav-item svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}
.admin-nav-item:hover {
  color: var(--sidebar-nav-hover-color);
  background: var(--sidebar-nav-hover-bg);
}
.admin-nav-item.active {
  color: var(--sidebar-nav-active-color);
  border-left-color: var(--brand);
  background: var(--sidebar-nav-active-bg);
}
.admin-sidebar-footer {
  padding: 14px 16px;
  border-top: 0.5px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-footer-link {
  font-size: 12px;
  color: var(--sidebar-footer-link);
  text-decoration: none;
  transition: color 0.12s;
}
.admin-footer-link:hover {
  color: var(--sidebar-footer-link-hover);
}
.admin-logout-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #0e6f7a 0%, #12bcbe 50%, #0e6f7a 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  cursor: pointer;
  font-family: inherit;
  margin-top: 4px;
  box-shadow: 0 4px 14px rgba(18, 188, 190, 0.35);
  transition:
    opacity 0.15s,
    box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.admin-logout-btn:hover {
  opacity: 0.88;
  box-shadow: 0 6px 20px rgba(18, 188, 190, 0.5);
}
.logout-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.admin-sidebar {
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

/* ── COLLAPSED ── */
.admin-layout.sidebar-collapsed .admin-sidebar {
  width: 56px;
  overflow: visible;
}
.admin-layout.sidebar-collapsed .admin-sidebar-brand {
  padding: 0;
  justify-content: center;
}
.admin-layout.sidebar-collapsed .admin-sidebar-logo {
  display: none;
}
.admin-layout.sidebar-collapsed .admin-sidebar-icon {
  display: block;
}
.admin-layout.sidebar-collapsed .admin-nav-item {
  justify-content: center;
  padding: 11px 0;
  gap: 0;
  border-left: 2px solid transparent;
}
.admin-layout.sidebar-collapsed .nav-label {
  display: none;
}
.admin-layout.sidebar-collapsed .admin-sidebar-profile {
  justify-content: center;
  padding: 10px 0;
  border-bottom: none;
  margin-bottom: 0;
}
.admin-layout.sidebar-collapsed .admin-profile-info {
  display: none;
}
.admin-layout.sidebar-collapsed .admin-logout-btn {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  margin-top: 6px;
  position: relative;
}
.admin-layout.sidebar-collapsed .logout-label {
  display: none;
}
.admin-layout.sidebar-collapsed .admin-sidebar-footer {
  padding: 14px 8px;
  align-items: center;
}

/* tooltip nav + logout */
.admin-layout.sidebar-collapsed .admin-nav-item,
.admin-layout.sidebar-collapsed .admin-logout-btn {
  position: relative;
}
.admin-layout.sidebar-collapsed .admin-nav-item::after,
.admin-layout.sidebar-collapsed .admin-logout-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: #1a2535;
  color: #fff;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid rgba(18, 188, 190, 0.25);
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.15s,
    transform 0.15s;
  z-index: 200;
}
.admin-layout.sidebar-collapsed .admin-nav-item:hover::after,
.admin-layout.sidebar-collapsed .admin-logout-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.sidebar-toggle {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-2);
  padding: 7px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.12s,
    color 0.12s;
  flex-shrink: 0;
}
.sidebar-toggle:hover {
  background: rgba(18, 188, 190, 0.12);
  color: #12bcbe;
}

.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-page);
}
.admin-topbar {
  height: 72px;
  background: var(--bg-card);
  border-bottom: 0.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}
.admin-topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.admin-topbar-portal-link {
  font-size: 13px;
  color: var(--text-3);
  text-decoration: none;
  transition: color 0.12s;
}
.admin-topbar-portal-link:hover {
  color: #12bcbe;
}
.admin-topbar-user {
  font-size: 13px;
  color: var(--text-3);
}

/* NOTIFICATIONS */
.notif-wrap { position: relative; }
.notif-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.notif-btn:hover {
  background: var(--bg-card);
  color: var(--brand);
  border-color: var(--brand);
}
.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}
.notif-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.28);
  z-index: 1000;
  overflow: hidden;
}
.notif-dropdown.open { display: block; }
.notif-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border);
}
.notif-dropdown-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
}
.notif-mark-all {
  font-size: 11px;
  color: var(--brand);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity .15s;
}
.notif-mark-all:hover { opacity: .75; }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 0.5px solid var(--border);
  transition: background .12s;
  position: relative;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--bg-surface); }
.notif-item.unread { background: rgba(18,188,190,.05); }
.notif-item.unread:hover { background: rgba(18,188,190,.09); }
.notif-item-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(18,188,190,.12);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-msg {
  font-size: 12.5px;
  color: var(--text-1);
  line-height: 1.45;
  margin-bottom: 3px;
}
.notif-item-comment {
  font-size: 11.5px;
  color: var(--text-2);
  font-style: italic;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notif-item-time {
  font-size: 11px;
  color: var(--text-3);
}
.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  flex-shrink: 0;
  margin-top: 5px;
}
.notif-empty {
  padding: 28px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-3);
}

/* NOTIF DETAIL MODAL */
.notif-detail { display: flex; flex-direction: column; gap: 18px; }
.notif-detail-user {
  display: flex;
  align-items: center;
  gap: 12px;
}
.notif-detail-av {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(18,188,190,.15);
  color: var(--brand);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-detail-info { display: flex; flex-direction: column; gap: 2px; }
.notif-detail-user-name { font-size: 15px; font-weight: 600; color: var(--text-1); }
.notif-detail-topic { font-size: 12px; color: var(--text-3); }
.notif-detail-history {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.notif-detail-entry {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.notif-detail-entry-header {
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-detail-entry-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}
.notif-detail-entry-date {
  font-size: 11px;
  color: var(--text-3);
  margin-left: auto;
}
.notif-detail-comment {
  font-size: 13px;
  color: var(--text-1);
  line-height: 1.6;
}

.admin-section {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.admin-section.active {
  display: block;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.admin-stat {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.admin-stat-val {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.admin-stat-lbl {
  font-size: 12px;
  color: var(--text-2);
}

.admin-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* CHARTS */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  margin-top: 16px;
}
.chart-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.chart-card-full {
  margin-top: 16px;
}
.chart-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: 2px;
}
.chart-card-sub {
  font-size: 12px;
  color: var(--text-3);
  opacity: 0.7;
  margin-bottom: 4px;
}
.admin-search {
  width: 280px;
  padding: 7px 12px;
  font-size: 13px;
}
.users-card {
  margin-bottom: 24px;
}
.users-card-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  padding: 0 2px 8px;
}
.users-empty {
  text-align: center;
  color: var(--text-3);
  padding: 20px 0 !important;
  font-size: 13px;
}

/* Colunas fixas nos cards de usuários */
.users-card .admin-table {
  table-layout: fixed;
}
.users-card .admin-table th:nth-child(1),
.users-card .admin-table td:nth-child(1) {
  width: 20%;
}
.users-card .admin-table th:nth-child(2),
.users-card .admin-table td:nth-child(2) {
  width: 26%;
}
.users-card .admin-table th:nth-child(3),
.users-card .admin-table td:nth-child(3) {
  width: 21%;
}
.users-card .admin-table th:nth-child(4),
.users-card .admin-table td:nth-child(4) {
  width: 12%;
}
.users-card .admin-table th:nth-child(5),
.users-card .admin-table td:nth-child(5) {
  width: 10%;
}
.users-card .admin-table th:nth-child(6) {
  width: 56px;
}
.users-card .admin-table td:last-child {
  width: 56px;
}
.users-card .admin-table td:not(:last-child) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 0;
}

/* TABLES */
.admin-table-wrap {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.admin-table thead {
  background: var(--bg-surface);
}
.admin-table th {
  padding: 10px 14px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
  border-bottom: 0.5px solid var(--border);
}
.admin-table td {
  padding: 11px 14px;
  border-bottom: 0.5px solid var(--border);
  color: var(--text-1);
}
.admin-table tr:last-child td {
  border-bottom: none;
}
.admin-table tr:hover td {
  background: var(--bg-surface);
}
.td-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.th-actions {
  text-align: right !important;
}
.th-sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.th-sortable:hover {
  color: var(--text-1);
}
.th-sortable::after {
  content: " ⇅";
  opacity: 0.3;
  font-size: 10px;
}
.th-sortable.sort-asc::after {
  content: " ↑";
  opacity: 1;
  color: #12bcbe;
}
.th-sortable.sort-desc::after {
  content: " ↓";
  opacity: 1;
  color: #12bcbe;
}

.row-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-surface);
  color: var(--text-2);
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.row-menu-btn:hover,
.row-menu-btn.open {
  color: var(--text-1);
  border-color: var(--brand);
  background: rgba(18, 188, 190, 0.07);
}

.row-menu-popup {
  position: fixed;
  z-index: 999;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  padding: 4px;
  min-width: 130px;
}
.row-menu-item {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  font-weight: 400;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-1);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.1s;
}
.row-menu-item:hover {
  background: var(--bg-surface);
}
.row-menu-item.row-menu-danger {
  color: var(--danger);
}
.row-menu-item.row-menu-danger:hover {
  background: var(--danger-light);
}

/* BUTTONS */
.btn-primary {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #0e6f7a 0%, #12bcbe 50%, #0e6f7a 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(18, 188, 190, 0.35);
  transition: opacity 0.15s, box-shadow 0.15s;
}
.btn-primary:hover:not(:disabled) {
  opacity: 0.88;
  box-shadow: 0 6px 20px rgba(18, 188, 190, 0.5);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: default;
}
.btn-secondary {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: transparent;
  color: var(--text-1);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover {
  background: var(--bg-surface);
  border-color: var(--text-3);
}
.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-surface);
  color: var(--text-2);
  border: 0.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s;
}
.btn-sm:hover {
  color: var(--text-1);
  border-color: var(--brand);
}
.btn-danger {
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

/* ROLE / STATUS BADGES */
.role-badge,
.status-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
}
.role-admin {
  background: #fef3c7;
  color: #92400e;
}
.role-user {
  background: var(--bg-surface);
  color: var(--text-2);
  border: 0.5px solid var(--border);
}
.status-badge.active {
  background: var(--brand-light);
  color: var(--brand-dark);
}
.status-badge.inactive {
  background: var(--danger-light);
  color: var(--danger);
}
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .role-admin {
    background: #3d2a00;
    color: #fbbf24;
  }
}
html[data-theme="dark"] .role-admin {
  background: #3d2a00;
  color: #fbbf24;
}

/* MODAL */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 300;
  display: none;
}
.modal-backdrop.open {
  display: block;
}
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: 540px;
  max-width: calc(100vw - 32px);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  z-index: 400;
  display: none;
  opacity: 0;
  transition:
    transform 0.15s ease,
    opacity 0.15s ease;
}
.modal.open {
  display: block;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 0.5px solid var(--border);
}
.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.modal-close {
  font-size: 16px;
  color: var(--text-3);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 4px;
}
.modal-close:hover {
  background: var(--bg-surface);
  color: var(--text-1);
}
.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-avatar-wrap {
  display: flex;
  justify-content: center;
  cursor: pointer;
  position: relative;
  width: fit-content;
  margin: 0 auto 4px;
}
.modal-avatar-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  color: var(--brand);
  overflow: hidden;
  transition: opacity 0.15s;
}
.modal-avatar-wrap:hover .modal-avatar-circle { opacity: 0.7; }
.modal-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.modal-avatar-wrap:hover .modal-avatar-overlay { opacity: 1; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 0.5px solid var(--border);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-1);
  color: var(--bg-card);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 500;
  transform: translateY(10px);
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.toast-error {
  background: var(--danger);
  color: white;
}

/* ── PROFILE PAGE ────────────────────────────── */
.profile-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 0 32px;
}

.profile-av-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 32px;
  gap: 4px;
}

.profile-av-wrap {
  position: relative;
  cursor: pointer;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  margin-bottom: 10px;
}

.profile-av-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.profile-av-lg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-av-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0;
  transition: opacity 0.2s;
}
.profile-av-wrap:hover .profile-av-overlay {
  opacity: 1;
}

.profile-av-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.profile-av-email-lbl {
  font-size: 13px;
  color: var(--muted);
}

.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
}

.profile-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
}

.profile-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.profile-msg {
  margin-top: 10px;
  font-size: 13px;
  text-align: right;
  min-height: 18px;
}
.profile-msg.ok {
  color: var(--accent);
}
.profile-msg.err {
  color: var(--danger);
}

button.user-dropdown-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

/* ── ONBOARDING ──────────────────────────────── */
.onboard-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  align-items: center;
  justify-content: flex-end;
}
.onboard-overlay.open {
  display: flex;
  animation: onboard-fade-in 0.3s ease;
}
.onboard-overlay.collapsing {
  animation: onboard-fade-out 0.35s ease forwards;
}

@keyframes onboard-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes onboard-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.onboard-modal {
  position: relative;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 20px;
  padding: 0;
  width: 25%;
  min-width: 280px;
  height: 80vh;
  overflow-y: auto;
  margin: auto 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  animation: onboard-slide-in 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: flex;
  flex-direction: column;
}
.onboard-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 60px;
  min-height: 60px;
  border-bottom: 0.5px solid var(--border);
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  position: sticky;
  top: 0;
  z-index: 2;
}
.onboard-modal-logo {
  height: 32px;
  width: auto;
  display: block;
}
.onboard-modal-body {
  padding: 28px 28px 32px;
  flex: 1;
}
.onboard-overlay.collapsing .onboard-modal {
  animation: onboard-slide-out 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}
@keyframes onboard-slide-in {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@keyframes onboard-slide-out {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: translateX(60px);
  }
}

.onboard-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.15s,
    background 0.15s;
  flex-shrink: 0;
}
.onboard-close:hover {
  color: var(--text-1);
  background: var(--bg-surface);
}

.onboard-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(18, 188, 190, 0.12);
  color: #12bcbe;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.onboard-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 6px;
}
.onboard-subtitle {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 28px;
  line-height: 1.5;
}

.onboard-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 28px;
}
.onboard-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s;
  user-select: none;
}
.onboard-card:hover {
  background: rgba(18, 188, 190, 0.06);
  border-color: rgba(18, 188, 190, 0.35);
}
.onboard-card.done {
  background: rgba(18, 188, 190, 0.08);
  border-color: rgba(18, 188, 190, 0.5);
}
.onboard-card-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(18, 188, 190, 0.15);
  color: #12bcbe;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.onboard-card.done .onboard-card-num {
  background: #12bcbe;
  color: #fff;
}
.onboard-card-body {
  flex: 1;
  min-width: 0;
}
.onboard-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
}
.onboard-card-desc {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.5;
}
.onboard-card-arrow {
  flex-shrink: 0;
  color: var(--text-3);
  display: flex;
  align-items: center;
  transition:
    color 0.15s,
    transform 0.15s;
}
.onboard-card:hover .onboard-card-arrow {
  color: #12bcbe;
  transform: translateX(2px);
}
.onboard-card.done .onboard-card-arrow {
  color: #12bcbe;
}

.onboard-cta {
  width: 100%;
  padding: 11px;
  background: #12bcbe;
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}
.onboard-cta:hover {
  opacity: 0.88;
}

/* pill flutuante */
.onboard-pill {
  display: none;
  position: fixed;
  bottom: 28px;
  right: 32px;
  z-index: 999;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  overflow: visible;
}
.onboard-pill.visible {
  display: flex;
  animation: pill-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.onboard-pill-label {
  white-space: nowrap;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  position: relative;
  margin-bottom: 8px;
}
.onboard-pill-label::after {
  content: "";
  position: absolute;
  bottom: -6px;
  right: 18px;
  left: auto;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid var(--bg-card);
}
.onboard-pill-label::before {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 17px;
  left: auto;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--border);
}
.onboard-pill-ico-wrap {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  margin: 8px;
  animation: pill-pulse 2s ease-in-out infinite;
}
.onboard-pill-ico {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

@keyframes pill-pop {
  from {
    opacity: 0;
    transform: scale(0.7) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes pill-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
}
@keyframes pill-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 740px) {
  .main {
    padding: 20px 16px;
  }
  .ob-page-main {
    padding: 20px 16px 60px;
  }
  .ob-page-content {
    max-width: 100%;
  }
  #pg-home,
  #pg-profile,
  #pg-category,
  #pg-topic {
    max-width: 100%;
  }
  .header-inner {
    max-width: 100%;
    padding: 0 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .admin-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 560px) {
  .field-row {
    grid-template-columns: 1fr;
  }
}

/* ── SETTINGS ─────────────────────────────────────── */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 20px;
}
.settings-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.settings-card-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
}
.settings-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  background: rgba(18, 188, 190, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-card-icon svg {
  width: 20px;
  height: 20px;
  fill: #12bcbe;
}
.settings-card-meta {
  flex: 1;
  min-width: 0;
}
.settings-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 3px;
}
.settings-card-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.4;
}

/* toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--border-mid);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-track::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-track {
  background: #12bcbe;
}
.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(18px);
}

/* card body */
.settings-card-body {
  display: none;
  padding: 0 20px 20px;
  border-top: 0.5px solid var(--border);
}
.settings-card-body.open {
  display: block;
}

.settings-field-group {
  margin-bottom: 4px;
}
.settings-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  margin-bottom: 8px;
  margin-top: 16px;
}
.settings-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.settings-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-1);
  cursor: pointer;
}
.settings-radio input[type="radio"] {
  accent-color: #12bcbe;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.settings-save-btn {
  margin-top: 20px;
}
.settings-card-save-off {
  padding: 12px 20px;
  border-top: 0.5px solid var(--border);
}

/* ── TOPIC CATEGORIES GRID ───────────────────── */
#topic-cats-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.topic-cat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.topic-cat-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(37, 211, 102, 0.1);
}

.topic-cat-card-body {
  flex: 1;
}

.topic-cat-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-1);
  margin-bottom: 2px;
}

.topic-cat-card-meta {
  font-size: 12px;
  color: var(--text-3);
}

.topic-cat-card-arrow {
  color: var(--text-3);
  flex-shrink: 0;
  transition: color 0.15s, transform 0.15s;
}

.topic-cat-card:hover .topic-cat-card-arrow {
  color: var(--brand);
  transform: translateX(3px);
}

.topic-cats-empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-3);
  font-size: 14px;
}

/* ── INNER PAGE (tela de cadastro/edição) ─────── */
.inner-page {
  animation: inner-fade-in 0.2s ease;
}
@keyframes inner-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.inner-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
}
.inner-page-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.inner-page-back:hover {
  color: var(--text-1);
  border-color: var(--text-3);
  background: var(--bg-surface);
}
.inner-page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-1);
  margin: 0;
}

.inner-page-body {
  margin-bottom: 32px;
}
.inner-form-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.inner-form-grid .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inner-form-grid .field-row {
  display: flex;
  gap: 16px;
}
.inner-form-grid .field-row .field {
  flex: 1;
}
.inner-textarea {
  min-height: 240px;
  resize: vertical;
}
.field-hint {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 5px;
  line-height: 1.5;
}
.field-hint code {
  font-family: monospace;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── TWO-COLUMN FORM LAYOUT ──────────────────────── */
.inner-form-two-col {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  align-items: start;
}
.inner-form-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.inner-form-main .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inner-form-aside {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 0;
}
.inner-form-aside-card {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.inner-form-aside-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-3);
  margin-bottom: 4px;
  display: block;
}
.inner-form-aside .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.inner-form-single-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.inner-form-single-col .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ob-topics-section {
  border-top: 0.5px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.inner-page-footer {
  display: flex;
  gap: 10px;
  padding-top: 24px;
  border-top: 0.5px solid var(--border);
}

/* ── FEATURED VIDEO FULL-AREA LAYOUT ─────────── */
.fv-layout {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 24px;
  align-items: start;
}
.fv-fields {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.fv-fields .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.fv-fields-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 4px;
}
.fv-fields-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.fv-preview-panel {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

/* ── ONBOARD ADMIN LAYOUT ────────────────────── */
.ob-admin-layout {
  display: grid;
  grid-template-columns: 60% 40%;
  gap: 24px;
  align-items: start;
}
.ob-admin-fields {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.ob-admin-fields .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ob-admin-preview-area {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.ob-preview-modal {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: 20px;
  padding: 40px 28px 32px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

/* ── ONBOARD CARDS LIST ───────────────────────── */
.ob-cards-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.ob-add-btn {
  padding: 5px 12px;
  font-size: 12px;
}
.ob-card-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
}
.ob-card-row-num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(18, 188, 190, 0.15);
  color: #12bcbe;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ob-card-row-fields {
  flex: 1;
  min-width: 0;
}
.ob-card-row-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ob-card-row-desc {
  font-size: 11.5px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ob-card-row-url {
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.ob-card-row-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.ob-empty {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  padding: 20px 0;
}
.btn-icon-edit,
.btn-icon-danger {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 5px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.15s,
    background 0.15s;
}
.btn-icon-edit:hover {
  color: #12bcbe;
  background: rgba(18, 188, 190, 0.1);
}
.btn-icon-danger:hover {
  color: #f87171;
  background: rgba(248, 113, 113, 0.1);
}

.field-eye-wrap {
  position: relative;
}
.field-eye-wrap .field-input {
  display: block;
  width: 100%;
  padding-right: 40px;
}

/* ── QUILL EDITOR ────────────────────────────── */
.login-body .field-eye-btn {
  color: rgba(255, 255, 255, 0.45);
}
.login-body .field-eye-btn:hover {
  color: #ffffff;
}

.quill-editor-wrap {
  border-radius: var(--radius-md);
  overflow: hidden;
}
.quill-editor-wrap .ql-toolbar {
  background: var(--bg-surface);
  border: 0.5px solid var(--border) !important;
  border-bottom: none !important;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.quill-editor-wrap .ql-container {
  background: var(--bg-surface);
  border: 0.5px solid var(--border) !important;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-family: "Poppins", sans-serif;
  font-size: 13.5px;
  min-height: 220px;
}
.quill-editor-wrap .ql-editor {
  min-height: 220px;
  color: var(--text-1);
  line-height: 1.6;
  font-family: "Poppins", sans-serif;
}
.quill-editor-wrap .ql-editor.ql-blank::before {
  color: var(--text-3);
  font-style: normal;
}

/* toolbar icons e pickers — adapta ao tema escuro */
.ql-snow .ql-stroke {
  stroke: var(--text-2) !important;
}
.ql-snow .ql-fill {
  fill: var(--text-2) !important;
}
.ql-snow .ql-picker {
  color: var(--text-2) !important;
}
.ql-snow .ql-picker-options {
  background: var(--bg-card) !important;
  border: 0.5px solid var(--border) !important;
  border-radius: var(--radius-md);
}
.ql-snow .ql-picker-item:hover,
.ql-snow .ql-picker-item.ql-selected {
  color: #12bcbe !important;
}
.ql-snow .ql-toolbar button:hover .ql-stroke,
.ql-snow .ql-toolbar button.ql-active .ql-stroke {
  stroke: #12bcbe !important;
}
.ql-snow .ql-toolbar button:hover .ql-fill,
.ql-snow .ql-toolbar button.ql-active .ql-fill {
  fill: #12bcbe !important;
}
.ql-snow .ql-toolbar button:hover,
.ql-snow .ql-toolbar button.ql-active {
  color: #12bcbe !important;
}
.ql-snow a {
  color: #12bcbe !important;
}
.field-eye-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 2px;
  display: flex;
  align-items: center;
}
.field-eye-btn:hover {
  color: var(--text-1);
}

/* ── ONBOARD PAGE (onboard.html) ─────────────────── */
.ob-page-main {
  padding: 32px 40px 80px;
  background: var(--bg-page);
  min-height: calc(100vh - 72px);
}
.ob-page-content {
  max-width: 80%;
  margin: 0 auto;
}

.ob-card-hero {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  display: block;
}

/* ── MANAGER PERMISSIONS UI ──────────────────── */
.manager-perms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.manager-perm-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-1);
  transition: border-color .15s, background .15s;
}
.manager-perm-item:hover {
  border-color: var(--brand);
  background: var(--bg-surface);
}
.manager-perm-item input[type="checkbox"] {
  accent-color: var(--brand);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}
.manager-perm-item input:checked ~ span {
  color: var(--brand);
  font-weight: 500;
}
.perm-badges-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.perm-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  white-space: nowrap;
}
.ob-page-hero {
  margin-bottom: 32px;
}
.ob-page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 8px;
  line-height: 1.3;
}
.ob-page-subtitle {
  font-size: 15px;
  color: var(--text-2);
  line-height: 1.6;
}

.ob-topics-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ob-topic-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition:
    border-color 0.12s,
    box-shadow 0.12s;
}
.ob-topic-card:hover {
  border-color: #12bcbe;
  box-shadow: 0 0 0 2px rgba(18, 188, 190, 0.1);
}
.ob-topic-card-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(18, 188, 190, 0.12);
  color: #12bcbe;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ob-topic-card-body {
  flex: 1;
  min-width: 0;
}
.ob-topic-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}
.ob-topic-card-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 20px;
  margin-top: 4px;
  background: var(--brand-light);
  color: var(--brand-dark);
}
.ob-topic-card-arrow {
  font-size: 22px;
  color: var(--text-3);
  flex-shrink: 0;
  transition:
    color 0.15s,
    transform 0.15s;
}
.ob-topic-card:hover .ob-topic-card-arrow {
  color: #12bcbe;
  transform: translateX(3px);
}
.ob-empty-state {
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  padding: 40px 0;
}

/* Detail view */
.ob-detail-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 6px 12px;
  cursor: pointer;
  margin-bottom: 24px;
  font-family: inherit;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.ob-detail-back:hover {
  color: var(--text-1);
  border-color: var(--text-3);
  background: var(--bg-surface);
}
.ob-detail-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
  margin-bottom: 24px;
  line-height: 1.3;
}
.ob-detail-content {
  margin-bottom: 40px;
}

/* Feedback */
.ob-feedback-section {
  background: var(--bg-card);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin: 36px 0;
}
.ob-feedback-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
  margin-bottom: 14px;
}
.ob-stars {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
}
.ob-star {
  font-size: 30px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-3);
  padding: 2px;
  line-height: 1;
  transition:
    color 0.12s,
    transform 0.1s;
  font-family: inherit;
}
.ob-star:hover,
.ob-star.active {
  color: #f59e0b;
}
.ob-star:hover {
  transform: scale(1.15);
}
.ob-feedback-comment {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  padding: 10px 13px;
  font-size: 13.5px;
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: inherit;
  outline: none;
  margin-bottom: 14px;
  transition: border-color 0.15s;
}
.ob-feedback-comment:focus {
  border-color: #12bcbe;
}
.ob-feedback-comment::placeholder {
  color: var(--text-3);
}
.ob-feedback-btn {
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #0e6f7a 0%, #12bcbe 50%, #0e6f7a 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(18, 188, 190, 0.35);
  transition: opacity 0.15s, box-shadow 0.15s;
}
.ob-feedback-btn:hover:not(:disabled) {
  opacity: 0.88;
  box-shadow: 0 6px 20px rgba(18, 188, 190, 0.5);
}
.ob-feedback-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.ob-feedback-msg {
  font-size: 13px;
  margin-top: 10px;
  min-height: 18px;
}
.ob-feedback-ok {
  color: var(--brand-dark);
}
.ob-feedback-err {
  color: var(--danger);
}


/* ── 2FA LOGIN STEPS ──────────────────────────────── */
.tfa-header {
  text-align: center;
  margin-bottom: 20px;
}
.tfa-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(18, 188, 190, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.tfa-icon svg {
  width: 24px;
  height: 24px;
  fill: #12bcbe;
}
.tfa-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.tfa-desc {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}
.tfa-qr-wrap {
  display: flex;
  justify-content: center;
  margin: 16px 0;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px;
}
.tfa-qr-wrap img {
  width: 160px;
  height: 160px;
  display: block;
}
.tfa-manual {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 4px;
}
.tfa-manual code {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #12bcbe;
  word-break: break-all;
  background: rgba(18, 188, 190, 0.08);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
}
.tfa-code-input {
  text-align: center;
  letter-spacing: 0.25em;
  font-size: 18px;
}
.tfa-back-btn {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
  margin-top: 10px;
  padding: 6px;
  font-family: inherit;
  transition: color 0.12s;
}
.tfa-back-btn:hover {
  color: rgba(255, 255, 255, 0.85);
}
