/* ============================================
   Doutor ECU - Premium Light Theme (Purple)
   ============================================ */

/* --- Reset & Base --- */

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

:root {
  /* Core palette */
  --bg-primary: #f5f0ff;
  --bg-secondary: #ede5ff;
  --bg-card: #ffffff;
  --bg-card-hover: #faf8ff;
  --bg-glass: rgba(255, 255, 255, 0.75);
  --bg-glass-hover: rgba(255, 255, 255, 0.9);

  /* Accent - Purple */
  --accent: #9333ea;
  --accent-hover: #a855f7;
  --accent-dark: #7e22ce;
  --accent-glow: rgba(147, 51, 234, 0.25);
  --accent-subtle: rgba(147, 51, 234, 0.08);
  --accent-gradient: linear-gradient(135deg, #9333ea 0%, #a855f7 50%, #c084fc 100%);
  --accent-gradient-bg: linear-gradient(135deg, #7c3aed 0%, #9333ea 40%, #a855f7 100%);

  /* Status */
  --success: #16a34a;
  --success-bg: rgba(22, 163, 74, 0.08);
  --danger: #dc2626;
  --danger-bg: rgba(220, 38, 38, 0.08);
  --warning: #d97706;

  /* Text */
  --text-primary: #1e1b2e;
  --text-secondary: #6b6485;
  --text-muted: #a09cb5;

  /* Borders */
  --border: rgba(147, 51, 234, 0.1);
  --border-hover: rgba(147, 51, 234, 0.2);
  --border-accent: rgba(147, 51, 234, 0.3);

  /* Glass */
  --glass-blur: 20px;
  --glass-border: rgba(147, 51, 234, 0.08);
  --glass-shadow: 0 4px 24px rgba(147, 51, 234, 0.08);

  /* Sizing */
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(147, 51, 234, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 24px rgba(147, 51, 234, 0.1), 0 4px 8px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 16px 40px rgba(147, 51, 234, 0.12), 0 8px 16px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 30px rgba(147, 51, 234, 0.12);
  --shadow-glow-hover: 0 0 50px rgba(147, 51, 234, 0.18);

  /* Transitions */
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* Input */
  --input-bg: #ffffff;
  --input-border: rgba(147, 51, 234, 0.15);
  --input-focus: rgba(147, 51, 234, 0.4);

  /* Navbar */
  --navbar-height: 64px;
  --navbar-height-mobile: 56px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-dark);
}

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

h1, h2, h3, h4, h5, h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* --- Scrollbar --- */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: rgba(147, 51, 234, 0.2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(147, 51, 234, 0.35);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(147, 51, 234, 0.2) var(--bg-primary);
}

/* --- Animations --- */

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

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

@keyframes floatIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

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

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

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

/* ============================================
   1. LOGIN PAGE
   ============================================ */

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--accent-gradient-bg);
  position: relative;
}

.login-container {
  width: 100%;
  max-width: 440px;
  position: relative;
  z-index: 1;
  animation: floatIn 0.6s ease;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  padding: 48px 36px;
  box-shadow: var(--shadow-xl), 0 0 60px rgba(0, 0, 0, 0.1);
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo img {
  max-height: 70px;
  margin: 0 auto 16px;
}

.login-logo h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.login-logo p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.login-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.login-footer a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.login-footer a:hover {
  text-decoration: underline;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 8px;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
  color: var(--text-muted);
}

.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 20px;
  border: 1px solid;
}

.alert-error {
  background: var(--danger-bg);
  border-color: rgba(220, 38, 38, 0.2);
  color: var(--danger);
}

.alert-success {
  background: var(--success-bg);
  border-color: rgba(22, 163, 74, 0.2);
  color: var(--success);
}

/* ============================================
   2. NAVIGATION BAR
   ============================================ */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--navbar-height);
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-bottom: 1px solid var(--border);
  transition: all var(--transition);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--accent-dark);
  letter-spacing: -0.02em;
  transition: opacity var(--transition);
}

.navbar-brand a:hover {
  opacity: 0.8;
}

.navbar-brand img,
.navbar-logo {
  height: 36px;
  width: auto;
}

.navbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar-user span {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.navbar-user strong {
  color: var(--text-primary);
}

.navbar .nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.navbar .user-info {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.navbar .user-info strong {
  color: var(--text-primary);
}

.btn-logout {
  padding: 8px 18px;
  background: var(--accent-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-bg);
}

.has-navbar {
  padding-top: var(--navbar-height);
}

/* ============================================
   3. DASHBOARD
   ============================================ */

.dashboard {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px;
  animation: fadeInUp 0.5s ease;
}

.dashboard h1 {
  text-align: center;
  margin-bottom: 10px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-dark);
}

.dashboard .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-size: 0.95rem;
}

.dashboard-banner {
  color: var(--banner-text, #fff);
  padding: 16px 24px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 28px;
  animation: fadeInUp 0.4s ease;
}
.banner-solid {
  background: var(--banner-bg, #7c3aed);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.banner-gradient {
  background: linear-gradient(135deg, var(--banner-bg, #7c3aed), #1e1b2e);
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.banner-outline {
  background: transparent;
  border: 2px solid var(--banner-bg, #7c3aed);
}
.banner-glass {
  background: rgba(124,58,234,.12);
  border: 1px solid var(--banner-bg, #7c3aed);
  backdrop-filter: blur(8px);
}
.banner-pill {
  background: var(--banner-bg, #7c3aed);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  padding: 12px 32px;
  display: inline-block;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.dashboard-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl), var(--shadow-glow-hover);
  border-color: var(--border-accent);
}

/* Dashboard card with cover image */
.dashboard-card.has-cover {
  padding: 0;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
}

.dashboard-card .card-cover {
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--bg-secondary);
}

.dashboard-card .card-cover img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  transition: transform var(--transition-slow);
}

.dashboard-card:hover .card-cover img {
  transform: scale(1.04);
}

.dashboard-card .card-content {
  padding: 20px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-card .card-content h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.dashboard-card .card-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.5;
}

.dashboard-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.dashboard-card .card-action {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--transition);
}

.dashboard-card:hover .card-action {
  color: var(--accent);
}

.dashboard-card .card-arrow {
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: all var(--transition);
}

.dashboard-card:hover .card-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Legacy icon-based cards */
.dashboard-card .card-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
}

.dashboard-card .card-badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.dashboard-card .card-stats {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* ============================================
   4. PAGE HEADER & BREADCRUMB
   ============================================ */

.page-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 12px;
  animation: fadeInUp 0.4s ease;
}

.page-header h1 {
  font-size: 1.8rem;
  margin-bottom: 4px;
  font-weight: 800;
  color: var(--text-primary);
}

.page-header p,
.page-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 24px 0;
  font-size: 0.85rem;
  max-width: 1200px;
  margin: 0 auto;
  animation: fadeIn 0.3s ease;
}

.breadcrumb a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.breadcrumb a:hover {
  color: var(--accent);
}

.breadcrumb .separator,
.breadcrumb .breadcrumb-sep {
  color: var(--text-muted);
  margin: 0 2px;
  font-size: 0.9em;
}

.breadcrumb .current,
.breadcrumb span:last-child:not(.separator):not(.breadcrumb-sep) {
  color: var(--text-primary);
  font-weight: 600;
}

/* ============================================
   5. FILTER / SEARCH BAR
   ============================================ */

.filter-bar {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 24px 20px;
}

.filter-bar .search-filter,
.search-input {
  width: 100%;
  max-width: 420px;
  padding: 12px 18px 12px 44px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23a09cb5' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='8' cy='8' r='5'/%3E%3Cline x1='12' y1='12' x2='16' y2='16'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 14px center;
  box-shadow: var(--shadow-sm);
}

.filter-bar .search-filter:focus,
.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.filter-bar .search-filter::placeholder,
.search-input::placeholder {
  color: var(--text-muted);
}

/* ============================================
   6. BRAND GRID
   ============================================ */

.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 24px;
  animation: fadeInUp 0.5s ease;
}

.brand-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
  text-decoration: none;
  color: inherit;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.brand-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-accent);
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
  background: #ffffff;
  border: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.brand-card:hover .brand-logo {
  transform: scale(1.08);
  border-color: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}

.brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  padding: 8px;
}

.brand-logo-fallback {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4px;
}

.brand-info h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.brand-model-count {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ============================================
   7. MODEL GRID
   ============================================ */

.model-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 24px;
  animation: fadeInUp 0.5s ease;
}

.model-grid .card .model-cover {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.model-grid .card:hover .model-cover {
  transform: scale(1.04);
}

.model-grid .card .model-info {
  padding: 14px 16px;
}

.model-grid .card .model-info h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 3px;
}

.model-grid .card .model-info p {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

/* ============================================
   7B. MODEL LIST VIEW
   ============================================ */

.model-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 24px;
  animation: fadeInUp 0.5s ease;
}

.model-list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.model-list-item:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

.model-list-icon {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 10px;
  font-size: 1.2rem;
  color: var(--accent);
  transition: all var(--transition);
}

.model-list-item:hover .model-list-icon {
  background: rgba(147, 51, 234, 0.15);
  box-shadow: 0 0 12px var(--accent-glow);
}

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

.model-list-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-list-info p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.model-list-arrow {
  flex-shrink: 0;
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: all var(--transition);
}

.model-list-item:hover .model-list-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ============================================
   8. CARDS (generic)
   ============================================ */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-accent);
}

/* ============================================
   9. MANUAL VIEWER
   ============================================ */

.viewer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  animation: fadeInUp 0.5s ease;
}

/* Viewer navbar - purple gradient */
.viewer-navbar {
  background: var(--accent-gradient-bg) !important;
  border-bottom: none !important;
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.25) !important;
}

.viewer-navbar .nav-back {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #ffffff;
}

.viewer-navbar .nav-back:hover {
  color: rgba(255, 255, 255, 0.85);
}

.nav-back-arrow {
  font-size: 1.3rem;
  line-height: 1;
  color: #ffffff;
}

.nav-back-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.nav-back-brand {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.nav-back-model {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
}

.viewer-navbar .user-info {
  color: rgba(255, 255, 255, 0.7);
}

.viewer-navbar .user-info strong {
  color: #ffffff;
}

.viewer-navbar .btn-logout {
  border-color: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
}

.viewer-navbar .btn-logout:hover {
  border-color: #ffffff;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

/* Accordion */
.accordion {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.accordion-item {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: box-shadow var(--transition), border-color var(--transition);
}

.accordion-item.open {
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.08);
  border-color: rgba(147, 51, 234, 0.2);
}

.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border: none;
  border-radius: var(--radius);
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
  border-left: 3px solid transparent;
}

.accordion-header::before {
  display: none;
}

.accordion-item.open .accordion-header {
  border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.04) 0%, rgba(168, 85, 247, 0.02) 100%);
  border-left-color: #9333ea;
}

.accordion-header:hover {
  background: rgba(147, 51, 234, 0.03);
  filter: none;
}

.accordion-title {
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.accordion-item.open .accordion-title {
  color: #7e22ce;
}

.accordion-desc-bar {
  padding: 10px 22px 10px 25px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-left: none;
  border-right: none;
  line-height: 1.5;
}

.accordion-item.open .accordion-desc-bar {
  border-bottom: 1px solid var(--border);
}

.accordion-item:not(.open) .accordion-desc-bar {
  border-bottom: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

.accordion-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  position: relative;
  margin-left: 16px;
  transition: transform 0.3s ease;
  z-index: 1;
}

.accordion-chevron::before,
.accordion-chevron::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 10px;
  height: 2px;
  background: #9333ea;
  border-radius: 1px;
  transition: transform 0.3s ease;
  opacity: 0.6;
}

.accordion-item.open .accordion-chevron::before,
.accordion-item.open .accordion-chevron::after {
  opacity: 1;
}

.accordion-chevron::before {
  left: 1px;
  transform: translateY(-50%) rotate(45deg);
}

.accordion-chevron::after {
  right: 1px;
  transform: translateY(-50%) rotate(-45deg);
}

.accordion-item.open .accordion-chevron::before {
  transform: translateY(-50%) rotate(-45deg);
}

.accordion-item.open .accordion-chevron::after {
  transform: translateY(-50%) rotate(45deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
}

.accordion-item.open .accordion-body {
  max-height: none;
  overflow: visible;
}

.accordion-body-inner {
  padding: 20px 24px;
}

/* Veiculos compativeis list */
.veiculos-lista {
  padding: 8px 0;
}

.veiculos-lista p {
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.5;
  border-bottom: 1px solid var(--border);
  border-radius: 6px;
  transition: background var(--transition-fast);
}

.veiculos-lista p:hover {
  background: var(--accent-subtle);
}

.veiculos-lista p:last-child {
  border-bottom: none;
}

/* Viewer image display */
.viewer-image {
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.viewer > .viewer-image {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 300px;
  box-shadow: var(--shadow-md);
}

.viewer-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Single manual image (models with no separate sections) */
.viewer-single-manual {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.viewer-single-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  padding: 20px 24px 4px;
  letter-spacing: -0.01em;
}

.viewer-single-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 0 24px 16px;
}

.viewer-single-manual .viewer-image {
  border-top: 1px solid var(--border);
}

.viewer-single-manual .viewer-image img {
  cursor: zoom-in;
}

/* Analysis gallery */
.analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.analysis-grid .thumbnail {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  background: var(--bg-card);
}

.analysis-grid .thumbnail:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.analysis-grid .thumbnail img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.analysis-grid .thumbnail:hover img {
  transform: scale(1.04);
}

.analysis-grid .thumbnail .caption {
  padding: 10px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
}

/* Reader mode (continuous scroll like PDF) */
.analysis-reader {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 900px;
  margin: 0 auto;
}

.analysis-reader .reader-page {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.analysis-reader .reader-page-number {
  background: var(--primary);
  color: #fff;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.analysis-reader .reader-page img {
  width: 100%;
  display: block;
  cursor: zoom-in;
}

/* View toggle buttons */
.view-toggle {
  display: inline-flex;
  gap: 6px;
}

.btn-view-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
}

.btn-view-mode:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-view-mode.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.hidden { display: none !important; }

/* ============================================
   10. LIGHTBOX
   ============================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: fadeIn 0.25s ease;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 48px rgba(0, 0, 0, 0.5);
  cursor: grab;
  transition: transform 0.15s ease;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox img.zoomed {
  cursor: grab;
  max-width: none;
  max-height: none;
}

.lightbox img.dragging {
  cursor: grabbing;
  transition: none;
}

.lightbox .zoom-controls {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.lightbox .zoom-btn {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  line-height: 1;
}

.lightbox .zoom-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.08);
}

.lightbox .zoom-level {
  height: 44px;
  padding: 0 14px;
  border: none;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
}

.lightbox .close-btn {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.lightbox .close-btn:hover {
  background: var(--danger);
  transform: scale(1.1);
}

.lightbox.hidden {
  display: none;
}

/* ============================================
   11. BUTTONS
   ============================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  width: 100%;
  padding: 14px 24px;
  background: var(--accent-gradient);
  color: #ffffff;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
  filter: brightness(1.05);
}

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

.btn-back {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 10px 22px;
  box-shadow: var(--shadow-sm);
}

.btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

/* ============================================
   12. LOADING SPINNER
   ============================================ */

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 60px auto;
}

/* ============================================
   13. EMPTY STATE
   ============================================ */

.empty-state {
  text-align: center;
  padding: 60px 24px;
  color: var(--text-secondary);
}

.empty-state a {
  color: var(--accent);
}

/* ============================================
   14. BACK BAR
   ============================================ */

.back-bar {
  max-width: 1200px;
  margin: 24px auto;
  padding: 0 24px;
}

/* ============================================
   15. FOOTER
   ============================================ */

.footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 60px;
  background: rgba(255, 255, 255, 0.5);
}

/* ============================================
   16. ADMIN STYLES
   ============================================ */

.admin-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 24px;
  animation: fadeInUp 0.5s ease;
}

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

.admin-header h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.admin-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.admin-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Admin Stats Grid */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.stat-detail {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Admin Menu Grid */
.admin-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.admin-menu-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 28px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
}

.admin-menu-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-accent);
}

.admin-menu-icon {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.admin-menu-card h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.admin-menu-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Admin Section */
.admin-section {
  margin-bottom: 32px;
}

.admin-section h2 {
  font-size: 1.15rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Admin Form */
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.admin-form-grid .form-group select {
  width: 100%;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.admin-form-grid .form-group select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.admin-form-grid .form-group input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all var(--transition);
  outline: none;
}

.admin-form-grid .form-group input[type="number"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Admin Table */
.admin-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
}

.admin-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.admin-table td {
  padding: 12px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--accent-subtle);
}

/* Badges */
.role-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.role-admin {
  background: rgba(147, 51, 234, 0.12);
  color: var(--accent);
}

.role-user {
  background: var(--accent-subtle);
  color: var(--text-secondary);
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-active {
  background: var(--success-bg);
  color: var(--success);
}

.status-inactive {
  background: var(--danger-bg);
  color: var(--danger);
}

/* Action Buttons */
.btn-action {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
}

.btn-action:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-action.btn-success {
  border-color: var(--success);
  color: var(--success);
}

.btn-action.btn-success:hover {
  background: var(--success-bg);
}

.btn-action.btn-warning {
  border-color: var(--warning);
  color: var(--warning);
}

.btn-action.btn-warning:hover {
  background: rgba(217, 119, 6, 0.08);
}

.btn-action.btn-danger {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-action.btn-danger:hover {
  background: var(--danger-bg);
}

.btn-action.btn-sm {
  padding: 3px 8px;
  font-size: 0.72rem;
}

.actions-cell {
  white-space: nowrap;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-xl);
}

.modal-card h3 {
  margin-bottom: 20px;
  font-size: 1.15rem;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* ============================================
   16b. ADMIN SIDEBAR LAYOUT (Pro)
   ============================================ */

.admin-layout {
  background: #f8f7fc;
}

.admin-layout .admin-wrapper {
  display: flex;
  min-height: calc(100vh - var(--navbar-height));
}

/* --- Sidebar --- */
.admin-sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, #1e1b2e 0%, #2a2545 100%);
  padding: 28px 0 20px;
  position: sticky;
  top: var(--navbar-height);
  height: calc(100vh - var(--navbar-height));
  overflow-y: auto;
  z-index: 10;
}

.admin-sidebar-section {
  margin-bottom: 6px;
}

.admin-sidebar-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.35);
  padding: 14px 24px 8px;
}

.admin-sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px;
  font-size: 0.875rem;
  font-weight: 450;
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
  margin: 1px 0;
}

.admin-sidebar-link:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}

.admin-sidebar-link.active {
  background: rgba(147,51,234,0.15);
  color: #c4b5fd;
  border-left-color: #a855f7;
  font-weight: 600;
}

.sidebar-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  stroke-width: 1.8;
}

/* --- Admin main content --- */
.admin-main {
  flex: 1;
  padding: 32px 40px;
  max-width: 1200px;
  animation: fadeInUp 0.35s ease;
}

.admin-header {
  margin-bottom: 28px;
}

.admin-header h1 {
  font-size: 1.65rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.admin-header p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* --- Admin badge --- */
.admin-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: linear-gradient(135deg, #9333ea, #a855f7);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-radius: 6px;
  margin-left: 10px;
}

/* --- Section headers --- */
.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-section-header h2 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
  font-size: 1.05rem;
  font-weight: 650;
}

/* --- Two col grid --- */
.admin-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* --- Table sub text --- */
.table-sub {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* --- Admin sections --- */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.admin-section h2 {
  font-size: 1.05rem;
  font-weight: 650;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.admin-section .admin-section-header + .admin-table-wrap,
.admin-section .admin-section-header + .empty-state {
  margin-top: 0;
}

/* --- Stat cards pro --- */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  transition: background var(--transition);
}

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

.stat-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.3rem;
  background: var(--accent-subtle);
  flex-shrink: 0;
}

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

.stat-number {
  font-size: 1.5rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 2px;
}

.stat-detail {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.stat-card-accent::after {
  background: var(--accent-gradient);
}

.stat-card-accent .stat-icon {
  background: rgba(147,51,234,0.1);
  color: var(--accent);
}

.stat-card-success::after {
  background: linear-gradient(90deg, #16a34a, #22c55e);
}

.stat-card-success .stat-icon {
  background: var(--success-bg);
  color: var(--success);
}

/* --- Status badges pro --- */
.status-pending {
  background: rgba(217,119,6,0.1);
  color: var(--warning);
}

/* --- Filter pills --- */
.filter-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-pill {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 550;
  text-decoration: none;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(147,51,234,0.04);
}

.filter-pill.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(147,51,234,0.25);
}

/* --- Admin form grid --- */
.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

/* --- Admin table pro --- */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
}

.admin-table thead th {
  background: #f8f7fc;
  padding: 10px 14px;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.admin-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(147,51,234,0.06);
  vertical-align: middle;
}

.admin-table tbody tr {
  transition: background 0.15s ease;
}

.admin-table tbody tr:hover {
  background: rgba(147,51,234,0.02);
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

/* --- Actions cell --- */
.actions-cell {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

/* --- Role badges --- */
.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.role-admin {
  background: linear-gradient(135deg, rgba(147,51,234,0.1), rgba(168,85,247,0.15));
  color: var(--accent);
}

.role-user {
  background: rgba(107,100,133,0.08);
  color: var(--text-secondary);
}

/* --- Alerts pro --- */
.alert {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-success {
  background: rgba(22,163,74,0.08);
  border: 1px solid rgba(22,163,74,0.2);
  color: #15803d;
}

.alert-error {
  background: rgba(220,38,38,0.06);
  border: 1px solid rgba(220,38,38,0.15);
  color: #b91c1c;
}

/* --- Btn action pro --- */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  text-decoration: none;
}

.btn-action:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(147,51,234,0.04);
}

.btn-action.btn-success {
  background: rgba(22,163,74,0.08);
  border-color: rgba(22,163,74,0.2);
  color: #15803d;
}

.btn-action.btn-success:hover {
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}

.btn-action.btn-danger {
  background: rgba(220,38,38,0.06);
  border-color: rgba(220,38,38,0.15);
  color: #dc2626;
}

.btn-action.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
  color: #fff;
}

.btn-action.btn-warning {
  background: rgba(217,119,6,0.08);
  border-color: rgba(217,119,6,0.2);
  color: #b45309;
}

.btn-action.btn-warning:hover {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}

/* --- Empty state --- */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- Modal pro --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,27,46,0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 32px;
  width: 90%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
}

.modal-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
}

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

/* ============================================
   16c. GATEWAY & PAYMENT STYLES
   ============================================ */

.gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.gateway-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
}

.gateway-card-active {
  border-color: var(--success);
  box-shadow: 0 0 0 1px var(--success), 0 4px 12px rgba(22,163,74,0.12);
}

.gateway-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
}

.gateway-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gateway-card-title h3 {
  font-size: 1rem;
  margin: 0;
}

.gateway-icon {
  font-size: 1.4rem;
}

.gateway-form {
  padding: 20px;
}

.gateway-form .form-group {
  margin-bottom: 14px;
}

.gateway-form .form-check label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  cursor: pointer;
}

.gateway-card-actions {
  margin-top: 8px;
}

.gateway-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  text-align: center;
}

/* Gateway status on dashboard */
.gateway-status-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.gateway-status-card.gateway-active {
  background: var(--success-bg);
  border-color: var(--success);
}

.gateway-status-card.gateway-inactive {
  background: rgba(217,119,6,0.06);
  border-color: var(--warning);
}

.gateway-status-icon {
  font-size: 1.4rem;
}

.gateway-mode {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: var(--accent-subtle);
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
}

/* Webhook URLs */
.webhook-url-item label {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  display: block;
}

.webhook-url-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  overflow-x: auto;
}

.webhook-url-box code {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  color: var(--accent-dark);
  word-break: break-all;
}

/* Plans grid */
.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.plan-edit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.plan-edit-card.plan-inactive {
  opacity: 0.6;
}

.plan-edit-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.plan-edit-actions {
  margin-top: 12px;
}

/* ============================================
   16d. CHECKOUT STYLES
   ============================================ */

.checkout-header {
  text-align: center;
  margin-bottom: 32px;
}

.checkout-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.checkout-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.checkout-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.checkout-plan-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}

.checkout-plan-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-4px);
}

.checkout-plan-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.checkout-plan-price {
  margin-bottom: 4px;
}

.checkout-currency {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  vertical-align: top;
  line-height: 1.6;
}

.checkout-amount {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-primary);
}

.checkout-plan-duration {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.checkout-plan-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.checkout-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
}

.checkout-features li {
  padding: 6px 0;
  font-size: 0.88rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
}

.checkout-features li:last-child {
  border-bottom: none;
}

.checkout-payment-methods {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkout-btn {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.checkout-btn-pix {
  background: #32bcad;
  border-color: #32bcad;
}
.checkout-btn-pix:hover {
  background: #2aa89b;
}

.checkout-btn-card {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  cursor: pointer;
  font-weight: 600;
  transition: all .2s;
}
.checkout-btn-card:hover {
  background: var(--primary);
  color: #fff;
}

.checkout-no-gateway {
  padding: 12px;
  background: rgba(217,119,6,0.08);
  border-radius: 8px;
  color: var(--warning);
  font-size: 0.85rem;
}

/* Active subscription */
.checkout-active-sub {
  text-align: center;
  background: var(--bg-card);
  border: 2px solid var(--success);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  max-width: 500px;
  margin: 0 auto;
  box-shadow: var(--shadow-md);
}

.checkout-active-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.checkout-active-sub h1 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--success);
}

.checkout-active-detail {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--success-bg);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text-primary);
}

/* PIX payment */
.pix-payment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 500px;
  margin: 0 auto;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.pix-header {
  background: var(--accent-gradient);
  padding: 24px;
  text-align: center;
  color: #fff;
}

.pix-header h1 {
  font-size: 1.4rem;
  color: #fff;
  margin-bottom: 4px;
}

.pix-header p {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.85);
}

.pix-amount {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 16px;
  font-size: 1.1rem;
  border-bottom: 1px solid var(--border);
}

.pix-qr {
  text-align: center;
  padding: 24px;
}

.pix-qr img {
  max-width: 220px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pix-copy-section {
  padding: 0 24px 24px;
}

.pix-copy-section label {
  font-size: 0.85rem;
  font-weight: 600;
  display: block;
  margin-bottom: 8px;
}

.pix-code-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
  word-break: break-all;
  font-size: 0.8rem;
}

.pix-status {
  text-align: center;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}

/* Admin sidebar responsive */
@media (max-width: 900px) {
  .admin-layout .admin-wrapper {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
    top: 0;
    display: flex;
    overflow-x: auto;
    padding: 10px 14px;
    gap: 4px;
    background: #1e1b2e;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }

  .admin-sidebar::-webkit-scrollbar {
    display: none;
  }

  .admin-sidebar-section {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
  }

  .admin-sidebar-title {
    display: none;
  }

  .admin-sidebar-link {
    padding: 8px 14px;
    border-left: none;
    border-radius: 20px;
    white-space: nowrap;
    font-size: 0.78rem;
    border: 1px solid rgba(255,255,255,0.1);
    gap: 6px;
  }

  .admin-sidebar-link .sidebar-icon {
    width: 16px;
    height: 16px;
  }

  .admin-sidebar-link.active {
    border-left: none;
    border-color: #a855f7;
    background: rgba(147,51,234,0.2);
  }

  .admin-main {
    padding: 20px 16px;
  }

  .admin-header h1 {
    font-size: 1.35rem;
  }

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

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

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

  .checkout-plans-grid {
    grid-template-columns: 1fr;
  }

  .admin-section {
    padding: 18px 16px;
  }
}

@media (max-width: 500px) {
  .admin-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Forum Category Edit Card */
.forum-cat-edit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.forum-cat-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
}

/* Original admin model edit cards */
.model-edit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.model-edit-card:hover {
  border-color: var(--border-hover);
}

.model-edit-card.has-data {
  border-left: 3px solid var(--success);
}

.model-edit-card h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.model-edit-card .cat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.model-edit-card textarea,
.forum-new-form-card textarea,
.forum-reply-form textarea,
.comment-form-card textarea {
  width: 100%;
  min-height: 80px;
  padding: 12px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
  outline: none;
  transition: border-color var(--transition);
}

.model-edit-card textarea:focus,
.forum-new-form-card textarea:focus,
.forum-reply-form textarea:focus,
.comment-form-card textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.model-edit-card .btn-save {
  margin-top: 10px;
  padding: 10px 24px;
  background: var(--accent-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}

.model-edit-card .btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.admin-main .filter-bar,
.admin-container .filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  padding: 0;
  max-width: none;
}

.admin-main .filter-bar select,
.admin-container .filter-bar select {
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
  cursor: pointer;
}

.admin-main .filter-bar select:focus,
.admin-container .filter-bar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.stats {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 16px;
  margin-bottom: 16px;
}

/* ============================================
   17. FORUM STYLES
   ============================================ */

/* Forum Categories List */
.forum-categories-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forum-category-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.forum-category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateX(4px);
  box-shadow: var(--shadow-md), 0 0 20px var(--accent-glow);
}

.forum-cat-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 12px;
  font-size: 1.4rem;
}

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

.forum-cat-info h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.forum-cat-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.forum-cat-stats {
  display: flex;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Forum Topics List */
.forum-topics-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.forum-topic-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}

.forum-topic-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-md);
}

.forum-topic-main {
  flex: 1;
  min-width: 0;
}

.forum-topic-main h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.forum-topic-meta {
  display: flex;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.forum-topic-stats {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

.forum-stat {
  text-align: center;
}

.forum-stat-num {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--accent);
}

.forum-stat-label {
  display: block;
  font-size: 0.7rem;
  color: var(--text-muted);
}

.forum-pin-badge {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(147, 51, 234, 0.12);
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  margin-bottom: 4px;
}

.forum-lock-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 4px;
  margin-bottom: 4px;
  margin-left: 6px;
}

.forum-actions-bar {
  margin-bottom: 20px;
}

/* Forum Topic Detail */
.forum-topic-detail {
  margin-bottom: 32px;
}

.forum-topic-header {
  margin-bottom: 20px;
}

.forum-topic-header h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.forum-topic-badges {
  display: flex;
  gap: 8px;
}

/* Forum Posts */
.forum-post {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.forum-post-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.forum-post-avatar {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
}

.forum-post-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.forum-post-meta strong {
  font-size: 0.9rem;
}

.forum-post-meta span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.forum-post-body {
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.forum-reply {
  border-left: 3px solid var(--accent-subtle);
}

/* Forum Admin Controls */
.forum-admin-controls {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* Forum Replies Section */
.forum-replies-section {
  margin-top: 32px;
}

.forum-replies-section h2 {
  font-size: 1.15rem;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Forum Reply Form */
.forum-reply-form,
.comment-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 20px;
  box-shadow: var(--shadow-sm);
}

.forum-reply-form h3 {
  font-size: 1rem;
  margin-bottom: 12px;
}

/* Forum New Topic Form */
.forum-new-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow-md);
}

.forum-new-form-card textarea {
  min-height: 160px;
}

.forum-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 16px;
}

.forum-locked-notice {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-top: 16px;
}

/* ============================================
   18. COMMENTS STYLES
   ============================================ */

.comments-section {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.comments-section h2 {
  font-size: 1.15rem;
  margin-bottom: 16px;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

.comment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}

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

.comment-avatar {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
}

.comment-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.comment-meta strong {
  font-size: 0.85rem;
}

.comment-meta span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.comment-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-primary);
}

/* ============================================
   19. TREINAMENTOS (COURSE PAGE)
   ============================================ */

.curso-hero {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.5s ease;
}

.curso-hero.has-hero-img {
  display: flex;
  gap: 32px;
  padding: 0;
  overflow: hidden;
}

.curso-hero-img {
  flex-shrink: 0;
  width: 340px;
}

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

.curso-hero.has-hero-img .curso-hero-content {
  padding: 36px 32px 36px 0;
  flex: 1;
}

@media (max-width: 768px) {
  .curso-hero.has-hero-img {
    flex-direction: column;
  }
  .curso-hero-img {
    width: 100%;
    height: 220px;
  }
  .curso-hero.has-hero-img .curso-hero-content {
    padding: 24px 20px;
  }
}

.curso-badge {
  display: inline-block;
  padding: 4px 14px;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.curso-hero h1 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.curso-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 20px;
}

.curso-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 20px;
}

.curso-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.curso-meta-icon {
  font-size: 1rem;
}

.curso-stats-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.curso-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
}

.curso-stat-pill strong {
  color: var(--accent);
  font-weight: 700;
}

.curso-programa {
  margin-bottom: 32px;
  animation: fadeInUp 0.5s ease 0.1s backwards;
}

.curso-programa h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.curso-programa-sub {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.accordion-meta {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  margin-left: auto;
  margin-right: 8px;
  flex-shrink: 0;
}

.modulo-num {
  display: inline-block;
  padding: 2px 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-right: 8px;
  vertical-align: middle;
}

/* Aula list inside accordion */
.aula-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.aula-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}

.aula-item:last-child {
  border-bottom: none;
}

.aula-item:hover {
  background: var(--accent-subtle);
  border-radius: 6px;
}

.aula-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-subtle);
  border: 1px solid var(--border-accent);
  border-radius: 50%;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 700;
}

.aula-name {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.aula-link {
  font-size: 0.9rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.aula-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

/* Destaques grid */
.curso-destaques {
  margin-bottom: 32px;
  animation: fadeInUp 0.5s ease 0.2s backwards;
}

.curso-destaques h2 {
  font-size: 1.4rem;
  margin-bottom: 20px;
}

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

.destaque-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.destaque-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  border-color: var(--border-accent);
}

.destaque-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.destaque-card h3 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.destaque-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

@media (max-width: 768px) {
  .curso-hero { padding: 24px 20px; }
  .curso-hero h1 { font-size: 1.35rem; }
  .curso-meta { gap: 10px; }
  .curso-meta-item { font-size: 0.8rem; }
  .destaques-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .destaques-grid { grid-template-columns: 1fr; }
  .curso-stats-bar { flex-direction: column; }
  .accordion-meta { display: none; }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-center { text-align: center; }
.text-secondary { color: var(--text-secondary); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ============================================
   RESPONSIVE - LARGE (>1400px)
   ============================================ */

@media (min-width: 1400px) {
  .brand-grid, .model-grid {
    max-width: 1400px;
    grid-template-columns: repeat(5, 1fr);
  }
  .page-header, .breadcrumb, .back-bar, .filter-bar, .model-list {
    max-width: 1400px;
  }
}

/* ============================================
   RESPONSIVE - TABLET (768-1024px)
   ============================================ */

@media (max-width: 1024px) {
  .brand-grid, .model-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .navbar { padding: 0 20px; }
  .dashboard { padding: 36px 20px; }
  .dashboard-card.has-cover .card-content { padding: 16px 20px 18px; }
}

/* ============================================
   RESPONSIVE - MOBILE (< 768px)
   ============================================ */

@media (max-width: 768px) {
  :root {
    --navbar-height: var(--navbar-height-mobile);
  }

  .navbar {
    padding: 0 16px;
    height: var(--navbar-height-mobile);
  }

  .has-navbar { padding-top: var(--navbar-height-mobile); }

  .dashboard { padding: 28px 16px; }
  .dashboard h1 { font-size: 1.5rem; }
  .dashboard-grid { grid-template-columns: 1fr; gap: 16px; }

  .login-container { max-width: 100%; }
  .login-card { padding: 36px 24px; border-radius: var(--radius); }

  .brand-grid, .model-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 0 16px 16px;
    gap: 12px;
  }

  .brand-card { padding: 20px 14px; }
  .brand-logo { width: 60px; height: 60px; margin-bottom: 10px; }
  .brand-info h3 { font-size: 0.82rem; }

  .viewer { padding: 16px; }
  .accordion-header { padding: 14px 16px; }
  .accordion-title { font-size: 0.9rem; }
  .accordion-desc-bar { padding: 10px 16px; font-size: 0.8rem; }
  .accordion-body-inner { padding: 16px; }
  .analysis-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }

  .breadcrumb { padding: 16px 16px 0; font-size: 0.8rem; }
  .page-header { padding: 20px 16px 8px; }
  .page-header h1 { font-size: 1.35rem; }
  .filter-bar { padding: 8px 16px 16px; }
  .back-bar { padding: 0 16px; }

  .model-list { padding: 0 16px 16px; gap: 6px; }
  .model-list-item { padding: 14px 16px; gap: 12px; }
  .model-list-icon { width: 36px; height: 36px; font-size: 1rem; }
  .model-list-info h3 { font-size: 0.88rem; }
  .model-list-info p { font-size: 0.75rem; }
}

/* ============================================
   RESPONSIVE - SMALL MOBILE (< 480px)
   ============================================ */

@media (max-width: 480px) {
  .brand-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .model-grid { grid-template-columns: 1fr; }
  .brand-card { padding: 18px 10px; }
  .brand-logo { width: 52px; height: 52px; }
  .brand-info h3 { font-size: 0.78rem; }

  .navbar-user span { display: none; }
  .nav-right .user-info { display: none; }
  .viewer-navbar .nav-back-model { display: none; }

  .dashboard h1 { font-size: 1.3rem; }
  .login-card { padding: 28px 18px; }

  .navbar-brand img, .navbar-logo { height: 28px; }
}

/* ============================================
   STAGGER ANIMATION FOR GRIDS
   ============================================ */

.brand-grid > *,
.model-grid > *,
.model-list > *,
.dashboard-grid > *,
.accordion > * {
  animation: floatIn 0.4s ease backwards;
}

.brand-grid > *:nth-child(1), .model-grid > *:nth-child(1), .model-list > *:nth-child(1), .dashboard-grid > *:nth-child(1), .accordion > *:nth-child(1) { animation-delay: 0.05s; }
.brand-grid > *:nth-child(2), .model-grid > *:nth-child(2), .model-list > *:nth-child(2), .dashboard-grid > *:nth-child(2), .accordion > *:nth-child(2) { animation-delay: 0.1s; }
.brand-grid > *:nth-child(3), .model-grid > *:nth-child(3), .model-list > *:nth-child(3), .dashboard-grid > *:nth-child(3), .accordion > *:nth-child(3) { animation-delay: 0.15s; }
.brand-grid > *:nth-child(4), .model-grid > *:nth-child(4), .model-list > *:nth-child(4), .accordion > *:nth-child(4) { animation-delay: 0.2s; }
.brand-grid > *:nth-child(5), .model-grid > *:nth-child(5), .model-list > *:nth-child(5), .accordion > *:nth-child(5) { animation-delay: 0.25s; }
.brand-grid > *:nth-child(n+6), .model-grid > *:nth-child(n+6), .model-list > *:nth-child(n+6) { animation-delay: 0.3s; }

/* ============================================
   SELECTION & FOCUS
   ============================================ */

::selection {
  background: rgba(147, 51, 234, 0.2);
  color: var(--text-primary);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ============================================
   20. Aula Viewer (Treinamentos)
   ============================================ */

.aula-viewer {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  animation: fadeInUp 0.4s ease;
}

.aula-viewer-header {
  background: var(--accent-gradient);
  padding: 32px 28px 24px;
  color: #fff;
}

.aula-viewer-header .curso-badge {
  margin-bottom: 12px;
}

.aula-viewer-header h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 8px;
}

.aula-viewer-modulo {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.85);
}

.aula-viewer-modulo strong {
  color: #fff;
}

.aula-viewer-content {
  padding: 28px;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.aula-viewer-content p {
  margin-bottom: 16px;
}

.aula-viewer-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 28px 0 12px;
  color: var(--text-primary);
}

.aula-viewer-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--accent-dark);
}

.aula-viewer-content h4 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--text-primary);
}

.aula-viewer-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  margin: 16px 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.aula-viewer-content ul,
.aula-viewer-content ol {
  padding-left: 24px;
  margin-bottom: 16px;
}

.aula-viewer-content li {
  margin-bottom: 8px;
}

.aula-viewer-content hr {
  border: none;
  height: 1px;
  background: var(--border);
  margin: 24px 0;
}

.aula-viewer-content strong {
  color: var(--accent-dark);
}

.aula-viewer-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.9rem;
}

.aula-viewer-content th,
.aula-viewer-content td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
}

.aula-viewer-content th {
  background: var(--accent-subtle);
  font-weight: 600;
  color: var(--accent-dark);
}

.aula-viewer-content blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-subtle);
  padding: 12px 16px;
  margin: 16px 0;
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text-secondary);
}

/* Navegação entre aulas */
.aula-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  border-top: 1px solid var(--border);
  gap: 12px;
}

@media (max-width: 600px) {
  .aula-viewer-header {
    padding: 24px 18px 20px;
  }
  .aula-viewer-header h1 {
    font-size: 1.25rem;
  }
  .aula-viewer-content {
    padding: 20px 16px;
  }
  .aula-nav {
    flex-direction: column;
    padding: 16px;
  }
  .aula-nav a {
    width: 100%;
    text-align: center;
  }
}
