/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #7C3AED;
  --primary-light: #A78BFA;
  --primary-dark: #5B21B6;
  --blue: #3B82F6;
  --blue-light: #60A5FA;
  --green: #16A34A;
  --orange: #EA580C;
  --orange-light: #FB923C;

  --bg: #F9FAFB;
  --bg-card: #FFFFFF;
  --bg-muted: #F3F4F6;
  --text: #1F2937;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;

  --sidebar-width: 280px;
  --sidebar-bg: #1E1B2E;
  --sidebar-text: #E5E7EB;
  --sidebar-hover: rgba(124, 58, 237, 0.15);
  --sidebar-active: rgba(124, 58, 237, 0.25);

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 20px -4px rgba(124, 58, 237, 0.15);
  --shadow-hover: 0 8px 30px -6px rgba(124, 58, 237, 0.25);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --gold: #F9B800;
  --gold-lt: #FFF6CC;
  --ok: #16a34a;
  --ok-lt: #dcfce7;
  --ok-bg: #f0fdf4;
  --warn: #d97706;
  --warn-lt: #fef3c7;
  --info: #2563eb;
  --info-lt: #dbeafe;
  --danger: #dc2626;
  --danger-lt: #fee2e2;
}

/* ===== DARK MODE ===== */
body.dark {
  --bg: #0F0D1A;
  --bg-card: #1A1726;
  --bg-muted: #231F33;
  --text: #E5E7EB;
  --text-muted: #9CA3AF;
  --text-light: #6B7280;
  --border: #2D2A3E;
  --primary: #A78BFA;
  --primary-dark: #7C3AED;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ===== LAYOUT ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.3s ease;
}

.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  padding: 32px;
}

/* ===== SIDEBAR ===== */
.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
}

.sidebar-title {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-light), var(--blue-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  min-height: 0;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-align: left;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--primary-light);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--primary-light);
  font-weight: 600;
}

.nav-item svg {
  flex-shrink: 0;
}

/* Jogos Group - always visible */
.nav-group-header {
  cursor: default;
  opacity: 0.7;
  font-size: 0.85rem;
}

.nav-group-header:hover {
  background: transparent;
  color: var(--sidebar-text);
}

/* Dropdown */
.nav-dropdown-trigger {
  position: relative;
}

.dropdown-arrow {
  margin-left: auto;
  transition: transform 0.3s ease;
}

.nav-dropdown-trigger.open .dropdown-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.nav-dropdown-menu.open {
  max-height: 200px;
}

.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 10px 48px;
  border: none;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
  text-align: left;
  opacity: 0.85;
}

#especialistaPinned .nav-sub-item {
  opacity: 1;
}

.nav-sub-item:hover {
  background: var(--sidebar-hover);
  color: var(--primary-light);
  opacity: 1;
}

.nav-sub-item.active {
  background: var(--sidebar-active);
  color: var(--primary-light);
  opacity: 1;
  font-weight: 600;
}

.specialist-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.specialist-dot.sid {
  background: var(--primary-light);
}

.specialist-dot.tito {
  background: var(--orange-light);
}

.specialist-dot.clara {
  background: #ec4899;
}

.specialist-dot.novo {
  background: #10b981;
}

.specialist-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
}

/* ===== THEME TOGGLE ===== */
.sidebar-theme {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: none;
  background: rgba(255, 255, 255, 0.05);
  color: var(--sidebar-text);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  width: 100%;
}

.theme-toggle:hover {
  background: var(--sidebar-hover);
}

.theme-label {
  font-weight: 500;
}

/* Show/hide sun/moon icons */
.icon-moon {
  display: none;
}

.icon-sun {
  display: block;
}

body.dark .icon-moon {
  display: block;
}

body.dark .icon-sun {
  display: none;
}

body.dark .theme-label::after {
  content: '';
}

.theme-toggle-mobile {
  margin-left: auto;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ===== CONTENT SECTIONS ===== */
.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-hover);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg-muted);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.link-btn:hover {
  color: var(--text);
}

/* ===== SPECIALIST PAGES ===== */
.specialist-page {
  max-width: 800px;
  margin: 0 auto;
}

.specialist-header {
  text-align: center;
  padding: 48px 32px;
  border-radius: var(--radius);
  color: white;
  margin-bottom: 32px;
}

.sid-gradient {
  background: linear-gradient(135deg, #5B21B6, #7C3AED 50%, #D4A017);
}

.tito-gradient {
  background: linear-gradient(135deg, #1a5c6b, #2a7f8f 50%, #e8762a);
}

.clara-gradient {
  background: linear-gradient(135deg, #1e5a7a, #2d6f8e 50%, #6b4f2d);
}

.novo-gradient {
  background: linear-gradient(135deg, #10b981, #7C3AED);
}

/* Em breve badge no sidebar */
.nav-badge-soon {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(249, 184, 0, .12);
  color: #b45309;
  border: 1px solid rgba(249, 184, 0, .25);
  padding: 2px 10px;
  border-radius: 99px;
  margin-left: auto;
  white-space: nowrap;
}

body.dark .nav-badge-soon {
  background: rgba(249, 184, 0, .10);
  color: var(--gold);
  border-color: rgba(249, 184, 0, .22);
}

/* Badge "Novo" verde no sidebar */
.nav-badge-new {
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(16, 185, 129, .12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, .25);
  padding: 2px 10px;
  border-radius: 99px;
  margin-left: auto;
  white-space: nowrap;
}

body.dark .nav-badge-new {
  background: rgba(16, 185, 129, .10);
  color: #34d399;
  border-color: rgba(16, 185, 129, .22);
}

.nav-em-breve {
  opacity: .55;
  cursor: default !important;
}

/* Em breve badge na pagina do especialista */
.specialist-em-breve-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 12px;
  padding: 6px 20px;
  background: rgba(249, 184, 0, .15);
  border: 1px solid rgba(249, 184, 0, .35);
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: #fbbf24;
}

.specialist-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  margin: 0 auto 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
}

.specialist-avatar-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  border: 4px solid rgba(255, 255, 255, 0.4);
  display: block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.specialist-header h1 {
  font-size: 2rem;
  margin-bottom: 8px;
}

.specialist-role {
  font-size: 1.1rem;
  opacity: 0.9;
}

.specialist-body {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.specialist-description h2,
.specialist-suggestions h2 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text);
}

.specialist-description p {
  color: var(--text-muted);
  line-height: 1.7;
}

.suggestion-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.suggestion-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}

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

.suggestion-icon {
  font-size: 1.5rem;
  display: block;
  margin-bottom: 8px;
}

.suggestion-card strong {
  display: block;
  font-size: .92rem;
  margin-bottom: 4px;
  color: var(--text);
}

.suggestion-card p {
  color: var(--text-muted);
  font-size: 0.82rem;
  margin: 0;
}

.suggestion-card-link {
  cursor: pointer;
}

.suggestion-card-link:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary), var(--shadow);
}

.suggestion-card-disabled {
  opacity: .45;
  cursor: default;
  pointer-events: none;
}

.sid-turma-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: rgba(124, 58, 237, .06);
  border: 1px solid rgba(124, 58, 237, .15);
  border-radius: 10px;
  font-size: .82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.sid-turma-notice svg {
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 1px;
}

.sid-turma-notice strong {
  color: var(--text);
}

.sid-turma-notice a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 600;
}

/* Inline prompt form inside specialist page */
.sp-inline-prompt {
  margin-top: 16px;
}

.sp-inline-prompt-header {
  margin-bottom: 16px;
}

.sp-inline-prompt .card {
  margin-bottom: 16px;
}

.sp-inline-prompt .prompt-wrap {
  margin-top: 8px;
}

.sp-turma-select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .88rem;
}

.specialist-cta {
  align-self: center;
  padding: 14px 32px;
  font-size: 1rem;
}

/* ===== ACERVO COMPLETO ===== */
.acervo-page {
  max-width: 1000px;
  margin: 0 auto;
}

.acervo-header {
  margin-bottom: 24px;
}

.acervo-notice {
  background: var(--bg-card);
  border: 2px dashed #FACC15;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  margin-bottom: 24px;
}

.acervo-notice p {
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.acervo-search-wrapper {
  position: relative;
  max-width: 500px;
  margin: 0 auto 24px;
}

.acervo-search-wrapper .search-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  pointer-events: none;
}

.acervo-search-wrapper .search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--bg-card);
  color: var(--text);
}

.acervo-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 24px;
}

.acervo-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.acervo-tab:hover {
  background: var(--bg-muted);
}

.acervo-tab.active {
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

body.dark .acervo-tab.active {
  background: var(--bg-muted);
}

.acervo-tab svg {
  flex-shrink: 0;
}

.acervo-content {
  background: rgba(124, 58, 237, 0.03);
  border: 2px dashed rgba(124, 58, 237, 0.25);
  border-radius: var(--radius);
  padding: 24px;
}

.acervo-content-header {
  text-align: center;
  margin-bottom: 20px;
}

.acervo-content-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.acervo-content-header p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.acervo-games-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 70vh;
  overflow-y: auto;
}

.acervo-game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  transition: var(--transition);
}

.acervo-game-card:hover {
  background: var(--bg-muted);
}

.acervo-game-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.acervo-game-name {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.acervo-game-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  color: var(--primary);
  background: rgba(124, 58, 237, 0.08);
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.acervo-game-link:hover {
  background: rgba(124, 58, 237, 0.15);
}

.acervo-game-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.acervo-tag {
  padding: 2px 8px;
  background: var(--primary);
  color: white;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 500;
}

/* Acervo Card (link from search to acervo) */
.acervo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  text-align: center;
  margin-top: 32px;
}

.acervo-card h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.acervo-card p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 20px;
  line-height: 1.7;
}

.sync-again {
  text-align: center;
  padding-top: 24px;
}

/* ===== MOBILE ===== */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--sidebar-bg);
  color: white;
  align-items: center;
  padding: 0 16px;
  z-index: 90;
  gap: 12px;
}

.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: white;
  border-radius: 2px;
  transition: var(--transition);
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
}

.mobile-logo-img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 95;
}

.sidebar-overlay.visible {
  display: block;
}

/* ===== SYNC AREA ===== */
.sync-area {
  max-width: 600px;
  margin: 32px auto;
}

.sync-card {
  background: var(--bg-card);
  border: 2px dashed rgba(124, 58, 237, 0.3);
  border-radius: var(--radius);
  padding: 48px 32px;
  text-align: center;
  transition: var(--transition);
}

.sync-card:hover {
  border-color: rgba(124, 58, 237, 0.5);
}

.sync-icon {
  color: var(--primary);
  margin-bottom: 16px;
}

.sync-icon.spinning svg {
  animation: spin 1s linear infinite;
}

.sync-icon.success {
  color: var(--green);
}

.sync-title {
  font-size: 1.25rem;
  margin-bottom: 8px;
}

.sync-description {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

.sync-btn {
  width: 100%;
  max-width: 400px;
  padding: 14px 24px;
}

.sync-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .mobile-header {
    display: flex;
  }

  .sidebar {
    transform: translateX(-100%);
  }

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

  .main-content {
    margin-left: 0;
    padding: 72px 16px 24px;
  }

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

  .specialist-header {
    padding: 32px 20px;
  }

  .specialist-header h1 {
    font-size: 1.5rem;
  }

  .filter-results-grid {
    grid-template-columns: 1fr !important;
  }

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

  .acervo-game-header {
    flex-direction: column;
    gap: 8px;
  }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-muted);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: rgba(124, 58, 237, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ===== ADMIN PANEL ===== */

.admin-panel {
  max-width: 960px;
  margin: 0 auto;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.admin-panel-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.admin-panel-header h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}

.admin-panel-header p {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  background: var(--bg-muted);
  border-radius: 14px;
  padding: 5px;
  margin-bottom: 24px;
  gap: 4px;
  border: 1px solid var(--border);
}

.admin-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.admin-tab svg {
  flex-shrink: 0;
  opacity: .6;
  transition: opacity .2s;
}

.admin-tab.active {
  background: var(--bg-card);
  color: var(--primary-dark);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.admin-tab.active svg {
  opacity: 1;
  color: var(--primary);
}

body.dark .admin-tab.active {
  background: #2D2A3E;
  color: var(--primary-light);
}

body.dark .admin-tab.active svg {
  color: var(--primary-light);
}

.admin-tab:hover:not(.active) {
  color: var(--text);
  background: rgba(124, 58, 237, .04);
}

.admin-tab:hover:not(.active) svg {
  opacity: .85;
}

/* Admin Sections */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
  transition: background .25s, border-color .25s;
}

.admin-section.coming-soon {
  opacity: .5;
  pointer-events: none;
  position: relative;
}

.admin-section.coming-soon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 10px,
    rgba(124, 58, 237, .03) 10px,
    rgba(124, 58, 237, .03) 20px
  );
  border-radius: var(--radius);
  pointer-events: none;
}

.admin-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(124, 58, 237, .02);
}

body.dark .admin-section-head {
  background: rgba(167, 139, 250, .03);
}

.admin-section-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
}

.admin-section-icon.purple {
  background: rgba(124, 58, 237, .1);
  color: var(--primary);
}

body.dark .admin-section-icon.purple {
  background: rgba(167, 139, 250, .12);
  color: var(--primary-light);
}

.admin-section-icon.orange {
  background: rgba(234, 88, 12, .1);
  color: var(--orange);
}

body.dark .admin-section-icon.orange {
  background: rgba(251, 146, 60, .12);
  color: var(--orange-light);
}

.admin-section-icon.blue {
  background: rgba(59, 130, 246, .1);
  color: var(--blue);
}

body.dark .admin-section-icon.blue {
  background: rgba(96, 165, 250, .12);
  color: var(--blue-light);
}

.admin-section-icon.green {
  background: rgba(22, 163, 74, .1);
  color: var(--green);
}

body.dark .admin-section-icon.green {
  background: rgba(34, 197, 94, .12);
  color: #4ade80;
}

.admin-section-icon.gold {
  background: rgba(249, 184, 0, .1);
  color: #b45309;
}

body.dark .admin-section-icon.gold {
  background: rgba(249, 184, 0, .12);
  color: var(--gold);
}

.admin-section-head h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.admin-section-head .badge-coming {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(249, 184, 0, .12);
  color: #b45309;
  border: 1px solid rgba(249, 184, 0, .25);
}

body.dark .admin-section-head .badge-coming {
  background: rgba(249, 184, 0, .08);
  color: var(--gold);
  border-color: rgba(249, 184, 0, .2);
}

.admin-section-head .badge-new {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(16, 185, 129, .12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, .25);
}

body.dark .admin-section-head .badge-new {
  background: rgba(16, 185, 129, .08);
  color: #34d399;
  border-color: rgba(16, 185, 129, .2);
}

.admin-section-body {
  padding: 20px 22px;
}

/* Admin Fields Grid */
.admin-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

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

.admin-field.full {
  grid-column: 1 / -1;
}

.admin-field label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.admin-field label .field-hint {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: .65;
  font-size: .68rem;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: .87rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s, background .25s;
  outline: none;
  font-family: inherit;
  width: 100%;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .1);
}

.admin-field textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* Cards grid inside specialist section */
.admin-cards-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-card-row {
  display: grid;
  grid-template-columns: 28px 80px 1fr 1fr 36px;
  gap: 10px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 8px;
  align-items: start;
  transition: border-color .15s;
}

.admin-card-row:hover {
  border-color: rgba(124, 58, 237, .25);
}

.admin-card-row label {
  font-size: .68rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: .3px;
  margin-bottom: 3px;
}

.admin-card-row input,
.admin-card-row textarea {
  padding: 7px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .82rem;
  color: var(--text);
  background: var(--bg-card);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
  font-family: inherit;
  width: 100%;
}

.admin-card-row input:focus,
.admin-card-row textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, .08);
}

.admin-card-row textarea {
  resize: vertical;
  min-height: 50px;
  line-height: 1.5;
}

.admin-card-emoji-col {
  display: flex;
  flex-direction: column;
}

/* Emoji Picker */
.emoji-picker-wrap {
  display: inline-block;
}

.emoji-picker-btn {
  width: 52px;
  height: 52px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}

.emoji-picker-btn:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, .1);
  transform: scale(1.05);
}

.emoji-picker-preview {
  font-size: 1.5rem;
  line-height: 1;
}

.emoji-picker-popup {
  position: fixed;
  z-index: 9999;
  width: 300px;
  max-height: 310px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  display: flex;
  flex-direction: column;
}

.emoji-opt {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .1s, transform .1s;
}

.emoji-opt:hover {
  background: rgba(124, 58, 237, .12);
  transform: scale(1.2);
}

/* Accordion for specialist sections */
.admin-accordion .admin-accordion-head {
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}

.admin-accordion .admin-accordion-head:hover {
  background: rgba(124, 58, 237, .04);
}

.admin-accordion-chevron {
  margin-left: auto;
  transition: transform .25s ease;
  flex-shrink: 0;
  color: var(--text-muted);
}

.admin-accordion.collapsed .admin-accordion-chevron {
  transform: rotate(-90deg);
}

.admin-accordion-body {
  overflow: hidden;
  max-height: 3000px;
  transition: max-height .35s ease;
}

.admin-accordion.collapsed .admin-accordion-body {
  max-height: 0;
}

/* Card action buttons */
.admin-card-actions {
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
  align-items: center;
}

.card-action-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  padding: 0;
}

.card-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(124, 58, 237, .06);
}

.card-action-delete:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, .06);
}

.card-action-spacer {
  width: 28px;
  height: 28px;
}

/* Drag handle */
.admin-card-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: var(--text-light);
  opacity: .4;
  transition: opacity .15s, color .15s;
  padding-top: 20px;
}

.admin-card-drag-handle:hover {
  opacity: .8;
  color: var(--primary);
}

.admin-card-drag-handle:active {
  cursor: grabbing;
}

/* Drag & drop states */
.admin-card-row.dragging {
  opacity: .35;
  border-color: var(--primary);
}

.admin-card-row.drop-above {
  border-top: 2.5px solid var(--primary);
  margin-top: -1px;
}

.admin-card-row.drop-below {
  border-bottom: 2.5px solid var(--primary);
  margin-bottom: -1px;
}

/* Delete specialist button */
.admin-delete-specialist-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-light);
  cursor: pointer;
  transition: all .15s;
  flex-shrink: 0;
}

.admin-delete-specialist-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
  background: rgba(239, 68, 68, .08);
}

/* Add card button */
.admin-card-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 16px;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  justify-content: center;
}

.admin-card-add-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(124, 58, 237, .04);
}

/* Add specialist button */
.admin-add-specialist-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 16px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.admin-add-specialist-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(124, 58, 237, .04);
}

/* Prompt management in admin */
.admin-prompt-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(124, 58, 237, .04);
  border-radius: 8px;
}

.admin-prompt-summary strong {
  color: var(--text);
}

.admin-prompt-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-prompt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  transition: all .15s;
}

.admin-prompt-row:hover {
  border-color: rgba(124, 58, 237, .2);
}

.admin-prompt-row.archived {
  opacity: .45;
}

.admin-prompt-row.archived:hover {
  opacity: .7;
}

.admin-prompt-row.dragging {
  opacity: .35;
  border-color: var(--primary);
}

.admin-prompt-row.drop-above {
  border-top: 2.5px solid var(--primary);
}

.admin-prompt-row.drop-below {
  border-bottom: 2.5px solid var(--primary);
}

.admin-prompt-drag {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  color: var(--text-light);
  opacity: .35;
  transition: opacity .15s;
  flex-shrink: 0;
}

.admin-prompt-drag:hover {
  opacity: .8;
  color: var(--primary);
}

.admin-prompt-drag:active {
  cursor: grabbing;
}

.admin-prompt-emoji-col {
  flex-shrink: 0;
}

.admin-prompt-emoji-col .emoji-picker-btn {
  width: 44px;
  height: 44px;
}

.admin-prompt-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.admin-prompt-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-prompt-fields input {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .82rem;
  width: 100%;
  transition: border-color .15s;
}

.admin-prompt-fields input:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, .08);
}

.prompt-field-name {
  font-weight: 600;
}

.prompt-field-desc {
  font-size: .78rem !important;
  color: var(--text-muted);
}

.prompt-field-status {
  width: 110px;
  flex-shrink: 0;
  padding: 6px 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .78rem;
  cursor: pointer;
}

/* Model card badges (user-facing) */
.mc-badge {
  display: inline-block;
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.mc-badge-novo {
  background: rgba(16, 185, 129, .15);
  color: #10b981;
}

.mc-badge-breve {
  background: rgba(249, 184, 0, .15);
  color: #f9b800;
}

.mc-em-breve {
  opacity: .55;
  cursor: default !important;
  pointer-events: none;
}

/* Toggle switch */
.admin-toggle {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  cursor: pointer;
}

.admin-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.admin-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--border);
  border-radius: 24px;
  transition: background .2s;
}

.admin-toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.admin-toggle input:checked + .admin-toggle-slider {
  background: var(--primary);
}

.admin-toggle input:checked + .admin-toggle-slider::before {
  transform: translateX(18px);
}

/* Visibility toggle for specialist fields */
.admin-vis-toggle {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  cursor: pointer;
  vertical-align: middle;
  color: var(--gold);
  transition: color .2s;
}
.admin-vis-toggle input[type="checkbox"] {
  display: none;
}
.admin-vis-toggle .vis-icon-on { display: inline; }
.admin-vis-toggle .vis-icon-off { display: none; }
.admin-vis-toggle.vis-off { color: var(--text-muted, #888); opacity: .5; }
.admin-vis-toggle.vis-off .vis-icon-on { display: none; }
.admin-vis-toggle.vis-off .vis-icon-off { display: inline; }
.admin-field.field-hidden {
  opacity: .4;
  position: relative;
}
.admin-field.field-hidden::after {
  content: 'Oculto';
  position: absolute;
  top: 4px;
  right: 8px;
  font-size: .7rem;
  color: var(--text-muted, #888);
  background: rgba(0,0,0,.2);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Emoji picker tabs */
.emoji-tabs {
  display: flex;
  gap: 2px;
  padding: 6px 6px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  overflow-x: auto;
}

.emoji-tab {
  padding: 4px 8px;
  border: none;
  background: transparent;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  font-size: 1rem;
  opacity: .5;
  transition: all .15s;
  flex-shrink: 0;
}

.emoji-tab:hover { opacity: .8; }
.emoji-tab.active { opacity: 1; background: rgba(124, 58, 237, .1); }

.emoji-grids-wrap {
  overflow-y: auto;
  max-height: 220px;
  padding: 4px;
}

.emoji-grid {
  display: none;
  grid-template-columns: repeat(8, 1fr);
  gap: 3px;
}

.emoji-grid.active {
  display: grid;
}

/* Save Bar */
.admin-save-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 4px;
  position: sticky;
  bottom: 16px;
  z-index: 10;
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
}

body.dark .admin-save-bar {
  box-shadow: 0 -4px 24px rgba(0,0,0,.3);
}

.admin-save-bar .save-hint {
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-save-bar .save-hint svg {
  flex-shrink: 0;
  color: var(--text-light);
}

.admin-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s ease;
  font-family: inherit;
  white-space: nowrap;
}

.admin-save-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, .35);
}

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

.admin-save-btn svg {
  flex-shrink: 0;
}

/* Access code special */
.admin-access-code-wrap {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  max-width: 400px;
}

.admin-access-code-wrap .admin-field {
  flex: 1;
}

.admin-access-code-wrap input {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 6px;
  text-align: center;
  padding: 14px;
  font-family: 'Menlo', 'Courier New', monospace;
}

.admin-access-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(124, 58, 237, .04);
  border: 1px solid rgba(124, 58, 237, .12);
  border-radius: 10px;
  margin-top: 16px;
}

body.dark .admin-access-info {
  background: rgba(167, 139, 250, .05);
  border-color: rgba(167, 139, 250, .12);
}

.admin-access-info svg {
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 1px;
}

body.dark .admin-access-info svg {
  color: var(--primary-light);
}

.admin-access-info p {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Responsive */
@media (max-width: 768px) {
  .admin-tabs {
    flex-direction: column;
  }

  .admin-fields {
    grid-template-columns: 1fr;
  }

  .admin-card-row {
    grid-template-columns: 1fr;
  }

  .admin-card-drag-handle {
    display: none;
  }

  .admin-save-bar {
    flex-direction: column;
    gap: 10px;
    position: static;
    box-shadow: none;
  }

  .admin-save-btn {
    width: 100%;
    justify-content: center;
  }

  .admin-access-code-wrap {
    max-width: 100%;
  }
}

/* ===== AUTH SCREEN ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #3B82F6 100%);
  animation: authGradient 8s ease infinite;
  background-size: 200% 200%;
}

@keyframes authGradient {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.auth-card {
  background: #fff;
  border-radius: 24px;
  padding: 48px 40px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .35);
  animation: authSlideUp 0.6s ease;
}

@keyframes authSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.dark .auth-card {
  background: #1A1726;
  border: 1px solid var(--border);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(124, 58, 237, 0.3);
}

.auth-logo h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-dark);
}

body.dark .auth-logo h1 {
  color: var(--primary-light);
}

.auth-logo p {
  font-size: .82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.auth-tabs {
  display: flex;
  background: var(--bg-muted);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 8px;
}

.auth-tab {
  flex: 1;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: .9rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.auth-tab.active {
  background: var(--bg-card);
  color: var(--primary-dark);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body.dark .auth-tab.active {
  background: #2D2A3E;
  color: var(--primary-light);
}

.auth-tab:hover:not(.active) {
  color: var(--text);
}

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

/* Hotmart info box */
.auth-hotmart-info {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: rgba(124, 58, 237, 0.06);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 12px;
  padding: 16px;
}

.auth-hotmart-info svg {
  flex-shrink: 0;
  color: var(--primary);
  margin-top: 2px;
}

.auth-hotmart-info p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

body.dark .auth-hotmart-info {
  background: rgba(167, 139, 250, 0.08);
  border-color: rgba(167, 139, 250, 0.2);
}

/* Input group */
.auth-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-input-group label {
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.auth-input-group input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: all .2s ease;
  font-family: inherit;
}

.auth-input-group input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(124, 58, 237, .12);
}

.auth-input-group input::placeholder {
  color: var(--text-light);
}

/* Auth button */
.auth-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--primary), #3B82F6);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s ease;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.auth-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(124, 58, 237, .4);
}

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

.auth-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.auth-hotmart-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.auth-hotmart-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Spinner inside button */
.btn-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes btnSpin {
  to {
    transform: rotate(360deg);
  }
}

/* Help text */
.auth-help-text {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-muted);
  border-radius: 10px;
}

.auth-help-text svg {
  flex-shrink: 0;
  color: var(--text-light);
  margin-top: 1px;
}

.auth-help-text span {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Auth messages */
.auth-error {
  background: var(--danger-lt);
  color: var(--danger);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .85rem;
  display: none;
  line-height: 1.5;
}

.auth-success {
  background: var(--ok-lt);
  color: var(--ok);
  padding: 12px 16px;
  border-radius: 10px;
  font-size: .85rem;
  display: none;
  line-height: 1.5;
}

/* Divider line */
.auth-divider-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-divider-line span {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.auth-divider-line small {
  font-size: 0.75rem;
  color: var(--text-light);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

/* ===== SIDEBAR USER ===== */
.sidebar-user {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  font-size: .72rem;
  color: rgba(255, 255, 255, .6);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.user-badge-mobile {
  font-size: .7rem;
  color: rgba(255, 255, 255, .6);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: none;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .15);
  color: rgba(255, 255, 255, .7);
  border-radius: 6px;
  font-size: .72rem;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.logout-btn:hover {
  background: rgba(255, 255, 255, .15);
  color: #fff;
}

.mobile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ===== MODAL / OVERLAY ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13, 8, 32, .65);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}

.overlay.open {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 28px;
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  border: 1px solid var(--border);
  transition: background .25s;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--border);
}

.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ===== FORMS ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.form-group label {
  font-size: .74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .87rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .15s, background .25s;
  outline: none;
  font-family: inherit;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .1);
}

.form-group input[readonly] {
  opacity: .6;
  cursor: default;
}

.form-group textarea {
  resize: vertical;
  min-height: 88px;
}

.form-group select {
  cursor: pointer;
}

/* ===== PLANOS DE AULA (folder view) ===== */

/* Escola-level folder */
.plano-escola-folder {
  background: var(--bg-card);
  border: 1px solid rgba(124, 58, 237, .2);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}

.plano-escola-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(124, 58, 237, .06) 0%, rgba(124, 58, 237, .02) 100%);
  border-bottom: 2px solid rgba(124, 58, 237, .15);
  transition: background .15s;
  user-select: none;
}

.plano-escola-head:hover {
  background: linear-gradient(135deg, rgba(124, 58, 237, .1) 0%, rgba(124, 58, 237, .04) 100%);
}

.plano-escola-icon {
  color: var(--primary);
  flex-shrink: 0;
}

body.dark .plano-escola-icon {
  color: var(--primary-light);
}

.plano-escola-body {
  padding: 12px 16px 16px;
}

.plano-folder-meta {
  font-size: .72rem;
  color: var(--text-muted);
}

/* Turma folder inside escola */
.plano-escola-body .plano-folder {
  margin-left: 8px;
  border-left: 3px solid rgba(124, 58, 237, .12);
}

.plano-folder {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  transition: background .25s, border-color .25s;
}

.plano-folder-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  transition: background .15s;
  user-select: none;
}

.plano-folder-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
  min-width: 0;
}

.plano-folder-left:hover {
  opacity: .85;
}

.plano-folder-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-turma-export {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}

.btn-turma-export:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.plano-folder-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  display: flex;
}

.plano-folder-icon {
  color: var(--primary);
  flex-shrink: 0;
}

body.dark .plano-folder-icon {
  color: var(--primary-light);
}

.plano-folder-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.plano-folder-info strong {
  font-size: .9rem;
  color: var(--text);
}

.plano-folder-escola {
  font-size: .72rem;
  color: var(--text-muted);
}

.plano-folder-tema {
  font-size: .7rem;
  font-weight: 600;
  color: #f59e0b;
  background: rgba(245, 158, 11, .12);
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.plano-folder-count {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-muted);
  padding: 3px 10px;
  border-radius: 99px;
  white-space: nowrap;
}

.plano-folder-body {
  padding: 4px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid var(--border);
}

.plano-card {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}

.plano-card:hover {
  border-color: rgba(124, 58, 237, .2);
}

.plano-card.selected {
  border-color: var(--primary);
  background: rgba(124, 58, 237, .04);
}

body.dark .plano-card.selected {
  background: rgba(167, 139, 250, .06);
}

.plano-card-check {
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}

.plano-card-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.plano-card-content {
  flex: 1;
  min-width: 0;
}

.plano-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.plano-card-title {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.plano-card-date {
  font-size: .72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.plano-card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.plano-card-preview {
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 60px;
  overflow: hidden;
}

.plano-card-obs {
  font-size: .75rem;
  color: var(--warn);
  margin-top: 6px;
  padding: 6px 10px;
  background: var(--warn-lt);
  border-radius: 6px;
  cursor: pointer;
  transition: all .25s ease;
}
.plano-card-obs .obs-summary {
  display: block;
}
.plano-card-obs .obs-full {
  display: none;
}
.plano-card-obs.expanded .obs-summary {
  display: none;
}
.plano-card-obs.expanded .obs-full {
  display: block;
}
.plano-card-obs .obs-expand-hint {
  font-size: .65rem;
  opacity: .6;
  margin-left: 6px;
  font-style: italic;
}
.plano-card-obs.expanded {
  padding: 12px 14px;
}
.obs-full-text {
  white-space: pre-wrap;
  word-wrap: break-word;
  font-family: inherit;
  font-size: .75rem;
  line-height: 1.6;
  margin: 0 0 8px;
  color: inherit;
}

body.dark .plano-card-obs {
  background: rgba(245, 158, 11, .08);
}

.obs-summary {
  display: flex;
  align-items: center;
}
.obs-summary .btn-copy-prompt {
  margin-left: auto;
  flex-shrink: 0;
}
.btn-copy-prompt {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  font-size: .7rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  vertical-align: middle;
  transition: background .2s;
  white-space: nowrap;
}
.obs-full .btn-copy-prompt {
  margin: 8px 0 0;
  padding: 6px 16px;
  font-size: .75rem;
}
.btn-copy-prompt:hover {
  background: var(--primary-dark);
}

@media (max-width: 768px) {
  .plano-card-header {
    flex-direction: column;
    gap: 8px;
  }

  .plano-card-actions {
    justify-content: flex-start;
  }
}

/* ===== TABLE ===== */
.table-wrap {
  overflow-x: auto;
}

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

th {
  background: rgba(124, 58, 237, .06);
  color: var(--primary);
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid rgba(124, 58, 237, .15);
  white-space: nowrap;
}

body.dark th {
  background: rgba(167, 139, 250, .07);
  color: var(--primary-light);
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

tr:hover td {
  background: rgba(124, 58, 237, .03);
}

/* ===== BADGES ===== */
.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
}

.badge-purple {
  background: rgba(124, 58, 237, .1);
  color: var(--primary);
}

body.dark .badge-purple {
  background: rgba(167, 139, 250, .15);
  color: var(--primary-light);
}

.badge-gold {
  background: var(--gold-lt);
  color: #92400e;
}

body.dark .badge-gold {
  background: rgba(249, 184, 0, .12);
  color: var(--gold);
}

.badge-ok {
  background: var(--ok-lt);
  color: var(--ok);
}

.badge-blue {
  background: var(--info-lt);
  color: var(--info);
}

body.dark .badge-blue {
  background: rgba(96, 165, 250, .12);
}

.badge-gray {
  background: var(--bg-muted);
  color: var(--text-muted);
}

/* ===== CARD ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
  transition: background .25s, border-color .25s;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.gold-stripe {
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--primary));
  border-radius: 2px;
  margin-bottom: 20px;
}

/* ===== SECTION HEADER ===== */
.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-desc {
  font-size: .81rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== INFO BOX ===== */
.info-box {
  background: rgba(124, 58, 237, .05);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: .82rem;
  color: var(--primary);
  margin-bottom: 18px;
}

body.dark .info-box {
  background: rgba(167, 139, 250, .07);
  color: var(--primary-light);
}

/* ===== PROMPT BOX ===== */
/* Sticky planos header */
.planos-sticky-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-color, #0a0a1a);
  padding-top: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  margin-bottom: 12px;
}

/* Plano card in editing mode */
.plano-card.plano-editing {
  border-color: rgba(124,58,237,.35);
  background: rgba(124,58,237,.06);
  padding: 0;
  display: block;
}
body.dark .plano-card.plano-editing {
  background: rgba(124,58,237,.08);
}

/* Inline expanded plano editor */
.plano-expanded {
  padding: 20px;
  animation: expandIn .2s ease;
}
@keyframes expandIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.plano-expanded-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.plano-expanded-title {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.2);
  color: var(--text-color, #fff);
}
.plano-expanded-date {
  font-size: .78rem;
  color: var(--text-muted, #aaa);
  white-space: nowrap;
}
.plano-expanded-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--primary, #7C3AED);
  margin-bottom: 6px;
}
.plano-expanded-textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.2);
  color: var(--text-color, #fff);
  font-size: .88rem;
  line-height: 1.6;
  resize: vertical;
  margin-bottom: 12px;
  font-family: inherit;
}
.plano-expanded-textarea:focus {
  outline: none;
  border-color: var(--primary, #7C3AED);
  box-shadow: 0 0 0 2px rgba(124,58,237,.2);
}
.plano-expanded-textarea.pe-obs { min-height: 60px; }
.plano-expanded-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* Batch import lote */
.import-lote-desc {
  font-size: .88rem;
  color: var(--text-muted, #aaa);
  margin-bottom: 16px;
  line-height: 1.5;
}
.import-lote-desc code {
  background: rgba(124,58,237,.15);
  color: var(--primary, #7C3AED);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .82rem;
}
.import-lote-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: rgba(124,58,237,.1);
  border-radius: 8px;
  border: 1px solid rgba(124,58,237,.25);
}
.import-lote-count {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--gold, #FFD600);
}
.import-lote-turma {
  font-size: .85rem;
  color: var(--text-muted, #aaa);
}
.import-lote-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
}
.import-lote-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.import-lote-num {
  background: var(--primary, #7C3AED);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.import-lote-card-preview {
  font-size: .8rem;
  color: var(--text-muted, #aaa);
  line-height: 1.4;
  margin: 0;
}
.import-lote-result {
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 4px;
}

/* Turma prompt header */
.turma-prompt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.turma-prompt-header .section-title { margin: 0; }

/* Copy toast */
.turma-copy-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--gold, #FFD600);
  color: #1a1a2e;
  font-weight: 700;
  font-size: .9rem;
  padding: 10px 24px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 9999;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  box-shadow: 0 4px 20px rgba(0,0,0,.3);
}
.turma-copy-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Escola collapsible headers */
.escola-header-row {
  cursor: pointer;
  user-select: none;
  transition: background .2s;
}
.escola-header-cell {
  background: rgba(124,58,237,.08) !important;
  font-weight: 700;
  font-size: .82rem;
  color: var(--primary);
  padding: 10px 14px !important;
  border-bottom: 2px solid rgba(124,58,237,.15);
}
.escola-header-row:hover .escola-header-cell {
  background: rgba(124,58,237,.18) !important;
}
.escola-header-row.collapsed .escola-header-cell {
  opacity: .75;
  border-bottom-color: rgba(124,58,237,.08);
}
.escola-chevron {
  vertical-align: -3px;
  margin-right: 6px;
  transition: transform .2s;
}
.escola-turma-row {
  animation: escolaRowIn .2s ease;
}
@keyframes escolaRowIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.prompt-wrap {
  background: #100828;
  border-radius: var(--radius);
  padding: 20px 22px;
  border: 1px solid #2E1F5A;
}

body.dark .prompt-wrap {
  background: #08041A;
  border-color: #1E1440;
}

.prompt-label {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 12px;
}

.prompt-box {
  font-family: 'Menlo', 'Courier New', monospace;
  font-size: .82rem;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  color: #D4C8F0;
  min-height: 60px;
}

.prompt-empty {
  color: #4A3868;
  font-style: italic;
  font-family: inherit;
}

.prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #2E1F5A;
}

.prompt-actions .btn-outline {
  color: #E0D6F0;
  border-color: #5A4A80;
}

.prompt-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* ===== MODEL CARDS ===== */
.model-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.model-card {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
  background: var(--bg-card);
}

.model-card:hover {
  border-color: var(--primary);
  background: rgba(124, 58, 237, .04);
  transform: translateY(-1px);
}

.model-card.selected {
  border-color: var(--primary);
  background: rgba(124, 58, 237, .08);
}

body.dark .model-card.selected {
  background: rgba(167, 139, 250, .1);
}

.mc-icon {
  font-size: 1.3rem;
  margin-bottom: 5px;
}

.mc-name {
  font-weight: 800;
  font-size: .85rem;
  color: var(--text);
}

.mc-desc {
  color: var(--text-muted);
  margin-top: 3px;
  font-size: .76rem;
  line-height: 1.4;
}

/* ===== SPECIALIST SELECTOR ===== */
.specialist-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
}

.specialist-sel-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}

.specialist-sel-btn:hover {
  border-color: var(--primary);
}

.specialist-sel-btn.active {
  border-color: var(--primary);
  background: rgba(124, 58, 237, .08);
  color: var(--primary);
}

.specialist-sel-btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.specialist-sel-img {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

/* ===== DIARY CARDS ===== */
.diary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  transition: background .25s;
}

.diary-date {
  font-size: .72rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: .5px;
}

body.dark .diary-date {
  color: var(--primary-light);
}

.diary-note {
  margin-top: 10px;
  padding: 10px 13px;
  border-radius: 8px;
  font-size: .81rem;
  line-height: 1.5;
}

.diary-note-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.diary-note-warn {
  background: var(--warn-lt);
  color: var(--warn);
}

body.dark .diary-note-ok {
  background: rgba(34, 197, 94, .08);
}

body.dark .diary-note-warn {
  background: rgba(245, 158, 11, .08);
}

/* ===== STARS ===== */
.stars {
  display: flex;
  gap: 4px;
}

.star-btn {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 2px;
  line-height: 1;
  filter: grayscale(1);
  opacity: .35;
  transition: filter .1s, opacity .1s;
}

.star-btn.active {
  filter: none;
  opacity: 1;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 52px 20px;
  color: var(--text-muted);
}

.empty-state .es-icon {
  font-size: 3rem;
  margin-bottom: 12px;
  opacity: .5;
}

.empty-state p {
  font-size: .88rem;
  line-height: 1.6;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: var(--primary-dark);
  color: #fff;
  padding: 11px 22px;
  border-radius: 999px;
  font-size: .84rem;
  font-weight: 600;
  box-shadow: var(--shadow-hover);
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
  z-index: 9999;
  white-space: nowrap;
  border: 1.5px solid rgba(167, 139, 250, .3);
}

body.dark .toast {
  background: #1A1726;
  border-color: var(--primary-light);
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* ===== EXTRA BUTTONS ===== */
.btn-gold {
  background: var(--gold);
  color: #1C1212;
  box-shadow: 0 2px 8px rgba(249, 184, 0, .3);
}

.btn-gold:hover {
  opacity: .88;
}

.btn-info {
  background: var(--info-lt);
  color: var(--info);
}

body.dark .btn-info {
  background: rgba(96, 165, 250, .12);
}

.btn-danger {
  background: var(--danger-lt);
  color: var(--danger);
}

body.dark .btn-danger {
  background: rgba(248, 113, 113, .1);
}

/* ===== RESPONSIVE EXTRAS ===== */
@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 20px 16px;
  }

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

  .user-badge-mobile {
    display: block;
  }
}

/* ===== SIDEBAR DIVIDER ===== */
.sidebar-divider {
  height: 1px;
  background: rgba(255, 255, 255, .08);
  margin: 4px 16px;
}

/* ===== MEU PERFIL ===== */
.perfil-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(124, 58, 237, .08), rgba(59, 130, 246, .06));
  border: 1px solid rgba(124, 58, 237, .15);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

body.dark .perfil-card {
  background: linear-gradient(135deg, rgba(167, 139, 250, .08), rgba(96, 165, 250, .06));
  border-color: rgba(167, 139, 250, .15);
}

.perfil-avatar {
  width: 72px;
  height: 72px;
  background: rgba(124, 58, 237, .1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}

body.dark .perfil-avatar {
  background: rgba(167, 139, 250, .12);
  color: var(--primary-light);
}

.perfil-info {
  flex: 1;
  min-width: 0;
}

.perfil-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
}

.perfil-email {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0;
}

.perfil-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 18px;
  transition: background .25s, border-color .25s;
}

.perfil-section-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.perfil-section-header h4 {
  font-size: .92rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.perfil-count {
  font-weight: 400;
  color: var(--text-muted);
  font-size: .82rem;
}

.perfil-form {
  max-width: 400px;
}

.perfil-escolas-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.perfil-escola-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: rgba(124, 58, 237, .08);
  border: 1px solid rgba(124, 58, 237, .15);
  border-radius: 99px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--primary);
  transition: all .15s;
}

body.dark .perfil-escola-chip {
  background: rgba(167, 139, 250, .1);
  border-color: rgba(167, 139, 250, .2);
  color: var(--primary-light);
}

.perfil-escola-chip:hover {
  border-color: var(--primary);
}

.perfil-escola-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  transition: color .15s;
}

.perfil-escola-remove:hover {
  color: var(--danger);
}

.perfil-add-escola {
  display: flex;
  gap: 8px;
  align-items: center;
}

.perfil-add-escola input {
  flex: 1;
  max-width: 300px;
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: .87rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  font-family: inherit;
  transition: border-color .15s;
}

.perfil-add-escola input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, .1);
}

@media (max-width: 768px) {
  .perfil-card {
    flex-direction: column;
    text-align: center;
  }

  .perfil-add-escola {
    flex-direction: column;
  }

  .perfil-add-escola input {
    max-width: 100%;
  }
}

/* ===== TEMPLATE DE PLANO ===== */

.template-escola-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 12px;
}

.template-escola-name {
  font-weight: 700;
  font-size: .88rem;
  color: var(--primary);
  margin-bottom: 10px;
}

body.dark .template-escola-name {
  color: var(--primary-light);
}

.template-escola-block .template-active {
  margin-bottom: 10px;
}

.template-escola-block .template-upload-area {
  margin-top: 6px;
}

.template-active {
  background: linear-gradient(135deg, rgba(124,58,237,.08), rgba(16,185,129,.06));
  border: 1.5px solid rgba(124,58,237,.25);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.template-active-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.template-active-icon {
  font-size: 1.3rem;
}

.template-active-header strong {
  display: block;
  font-size: .9rem;
  color: var(--text);
}

.template-active-count {
  display: block;
  font-size: .78rem;
  color: var(--text-muted);
}

.template-sections-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.template-section-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(124,58,237,.1);
  border-radius: 16px;
  font-size: .78rem;
  color: var(--primary);
  font-weight: 500;
}

.template-chip-num {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.template-upload-area {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 2px dashed transparent;
  border-radius: 10px;
  transition: border-color .2s, background .2s;
}
.template-upload-area.drag-over {
  border-color: var(--primary, #7C3AED);
  background: rgba(124,58,237,.08);
}
.template-upload-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.template-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 2px dashed var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
  transition: all .2s;
}

.template-upload-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(124,58,237,.04);
}

.template-upload-hint {
  font-size: .75rem;
  color: var(--text-muted);
}

#template-processing {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  font-size: .85rem;
  color: var(--primary);
}

.template-processing-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(124,58,237,.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#template-editor {
  margin-top: 16px;
  padding: 16px;
  background: var(--card-bg, #fff);
  border: 1.5px solid var(--border);
  border-radius: 12px;
}

.template-editor-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  padding: 4px 0;
}

.template-editor-drag {
  cursor: grab;
  color: var(--text-muted);
  font-size: .85rem;
  user-select: none;
}

.template-editor-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: .7rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.template-editor-input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: .85rem;
  color: var(--text);
  background: var(--bg);
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
}

.template-editor-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(124,58,237,.1);
}

.template-editor-remove {
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(239,68,68,.1);
  color: #ef4444;
  border-radius: 50%;
  cursor: pointer;
  font-size: .9rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
  flex-shrink: 0;
}

.template-editor-remove:hover {
  background: #ef4444;
  color: #fff;
}

.template-editor-add {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px 0;
  padding-left: 30px;
}

.template-editor-add input {
  flex: 1;
  padding: 6px 10px;
  border: 1.5px dashed var(--border);
  border-radius: 6px;
  font-size: .85rem;
  color: var(--text);
  background: var(--bg);
  font-family: inherit;
  outline: none;
}

.template-editor-add input:focus {
  border-color: var(--primary);
}

.template-editor-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

body.dark .template-active {
  background: linear-gradient(135deg, rgba(124,58,237,.12), rgba(16,185,129,.08));
  border-color: rgba(124,58,237,.35);
}

body.dark .template-section-chip {
  background: rgba(124,58,237,.2);
}

body.dark #template-editor {
  background: var(--card-bg, #1e1e2e);
}