/* ===================================================================
   AVA & DASHBOARD PAINEL TEMPLÁRIOS - CENTRO DE FORMAÇÃO PROFISSIONAL
   Design System Oficial baseado na Logo:
   - Azul Real / Marinho do Escudo (#0a1931 / #132a52)
   - Ouro Imperial e Livro Aberto (#ffd700 / #d4af37 / #b8860b)
   - Vermelho Carmesim da Cruz Templária (#c8102e / #ef233c)
   - Aço Cromo Metálico & Branco Radiante (#ffffff / #f4f6fa)
   =================================================================== */

:root {
  /* Fundo e Superfícies Claras e Lúmidas (Conforme a Logo Oficial) */
  --bg-body: #f4f6fa;
  --bg-sidebar: #0a1931;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-light: #f8fafc;
  --bg-input: #ffffff;
  --border-color: rgba(212, 175, 55, 0.32);
  --border-focus: #d4af37;
  
  /* Cores Ouro Imperial da Logo */
  --gold-light: #b8860b;
  --gold-lighter: #ffe57f;
  --gold-primary: #d4af37;
  --gold-dark: #8c6209;
  --gold-gradient: linear-gradient(135deg, #ffd700 0%, #d4af37 60%, #b8860b 100%);
  --gold-glow: rgba(212, 175, 55, 0.35);

  /* Carmesim da Cruz Templária Radiante */
  --crimson-primary: #c8102e;
  --crimson-light: #ef233c;
  --crimson-dark: #8b0000;
  --crimson-glow: rgba(200, 16, 46, 0.25);
  --crimson-gradient: linear-gradient(135deg, #ef233c 0%, #c8102e 50%, #8b0000 100%);
  
  /* Escudo Azul Marinho Profundo */
  --navy-primary: #0a1931;
  --navy-secondary: #132a52;
  --navy-light: #1e3a6c;
  
  --chrome-gradient: linear-gradient(180deg, #ffffff 0%, #f1f5f9 35%, #d4af37 100%);
  --text-pure: #0a1931;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-dark: #94a3b8;

  --success: #16a34a;
  --warning: #d97706;
  --info: #0284c7;
  --danger: #dc2626;

  --font-heading: 'Cinzel', serif, system-ui;
  --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.22s ease-in-out;
  --shadow-card: 0 4px 20px rgba(10, 25, 49, 0.07);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
}

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

/* ===================================================================
   LAYOUT PRINCIPAL (SIDEBAR + MAIN CONTENT)
   =================================================================== */
.dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Azul Real (Escudo Templários) */
.dashboard-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #0a1931 0%, #0e2246 55%, #071325 100%);
  border-right: 2px solid rgba(212, 175, 55, 0.45);
  box-shadow: 4px 0 20px rgba(10, 25, 49, 0.12);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 100;
  overflow: hidden;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(212, 175, 55, 0.3);
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.sidebar-logo-img {
  height: 44px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.sidebar-brand-name {
  font-family: var(--font-heading);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  color: #ffffff;
  background: var(--chrome-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
}

.sidebar-brand-sub {
  font-size: 0.65rem;
  text-transform: uppercase;
  color: #ffd700;
  letter-spacing: 1px;
  font-weight: 800;
}

.sidebar-nav {
  padding: 1.25rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.35) rgba(10, 25, 49, 0.5);
}

.sidebar-nav::-webkit-scrollbar {
  width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: rgba(10, 25, 49, 0.6);
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(212, 175, 55, 0.35);
  border-radius: 999px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

.sidebar-section-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0.75rem 0.75rem 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-md);
  color: #cbd5e1;
  font-size: 0.92rem;
  font-weight: 500;
  transition: var(--transition);
}

.sidebar-link i {
  font-size: 1.1rem;
  width: 22px;
  text-align: center;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.sidebar-link.active {
  background: var(--crimson-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(200, 16, 46, 0.45);
  font-weight: 700;
  border-left: 3px solid #ffd700;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid rgba(212, 175, 55, 0.25);
  background: rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}

.user-badge-mini {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--crimson-primary);
  border: 1px solid rgba(255, 215, 0, 0.5);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.user-mini-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.user-mini-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-mini-role {
  font-size: 0.72rem;
  color: #ffd700;
  text-transform: uppercase;
  font-weight: 800;
}

/* Conteúdo Principal */
.dashboard-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-body);
  min-width: 0;
}

.dashboard-topbar {
  background: #ffffff;
  border-bottom: 2px solid rgba(212, 175, 55, 0.35);
  box-shadow: 0 2px 12px rgba(10, 25, 49, 0.05);
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
}

.topbar-page-title h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0a1931;
  font-family: var(--font-heading);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.main-body {
  padding: 2rem;
  flex: 1;
}

/* ===================================================================
   ALERTS E FLASH MESSAGES
   =================================================================== */
.alert-container {
  margin-bottom: 1.5rem;
}

.alert {
  padding: 0.9rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.alert-success {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
  font-weight: 600;
}

.alert-danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
  font-weight: 600;
}

.alert-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
  font-weight: 600;
}

.alert-info {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #075985;
  font-weight: 600;
}

.alert-close {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0 0.25rem;
  line-height: 1;
}

/* ===================================================================
   CARDS E STATS
   =================================================================== */
.stats-grid-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card-dash {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-top: 4px solid #d4af37;
  border-radius: var(--radius-lg);
  padding: 1.35rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.stat-card-dash:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px -5px rgba(10, 25, 49, 0.12);
  border-color: #d4af37;
}

.stat-card-info h3 {
  font-size: 0.8rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.stat-card-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 800;
  color: #0a1931;
  line-height: 1;
}

.stat-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(200, 16, 46, 0.1);
  border: 1px solid rgba(200, 16, 46, 0.25);
  color: #c8102e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
}

/* ===================================================================
   TABELAS E LISTAS
   =================================================================== */
.card-table-wrapper,
.card-table-container,
.table-container {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-card);
}

.card-table-header {
  padding: 1.25rem 1.5rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.card-table-header h2 {
  font-size: 1.18rem;
  font-weight: 800;
  color: #0a1931;
  font-family: var(--font-heading);
}

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

.data-table th {
  background: #0a1931;
  color: #ffffff;
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.74rem;
  letter-spacing: 0.5px;
  padding: 0.95rem 1.25rem;
  border-bottom: 2px solid rgba(212, 175, 55, 0.4);
}

.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  color: #1e293b;
  vertical-align: middle;
  background: #ffffff;
}

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

.data-table tr:hover td {
  background: #f8fafc;
}

/* Badges */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-admin {
  background: #0a1931;
  color: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.5);
}

.badge-aluno {
  background: rgba(56, 189, 248, 0.15);
  color: #0369a1;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-active,
.badge-success {
  background: #ecfdf5;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-inactive {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

/* ===================================================================
   BOTÕES E AÇÕES
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: var(--gold-gradient);
  color: #0a1931;
  font-weight: 800;
  border: 1px solid rgba(184, 134, 11, 0.45);
  box-shadow: 0 4px 14px var(--gold-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fff2a3 0%, #ffd700 35%, #d4af37 75%, #aa7c11 100%);
  transform: translateY(-2px);
  color: #000;
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.btn-secondary {
  background: #ffffff;
  color: #0a1931;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0a1931;
}

.btn-danger {
  background: var(--crimson-gradient);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(200, 16, 46, 0.25);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ff3b53 0%, #dc2626 100%);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-sm);
}

/* ===================================================================
   FORMULÁRIOS
   =================================================================== */
.form-card {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-top: 4px solid #d4af37;
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 850px;
  box-shadow: var(--shadow-card);
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  margin-bottom: 1.35rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: #0a1931;
}

.form-control {
  width: 100%;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 0.92rem;
  color: #0a1931;
  outline: none;
  transition: var(--transition);
  font-family: inherit;
}

.form-control:focus {
  border-color: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25);
}

textarea.form-control {
  min-height: 110px;
  resize: vertical;
}

.form-hint {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.35rem;
}

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

/* ===================================================================
   LOGIN CARD (OTIMIZADO PARA DESKTOP, MOBILE E IPHONE / IOS SAFARI)
   =================================================================== */
.login-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: #060e1c;
  background-image: radial-gradient(circle at 50% 18%, #10254a 0%, #060e1c 80%);
  background-attachment: scroll;
  padding: max(1.5rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1.75rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  -webkit-tap-highlight-color: transparent;
}

.login-card {
  width: 100%;
  max-width: 460px;
  margin: auto 0;
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.45);
  border-top: 5px solid #d4af37;
  border-radius: var(--radius-lg);
  padding: 2.5rem 2.25rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.2);
  flex-shrink: 0;
}

.login-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo {
  max-height: 118px;
  width: auto;
  max-width: min(240px, 78%);
  margin: 0 auto 1rem;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.22));
}

.login-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 2px;
  color: #0a1931;
  line-height: 1.15;
}

.login-sub {
  font-size: 0.82rem;
  color: #b8860b;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 800;
  margin-top: 0.25rem;
}

.login-slogan {
  font-size: 0.76rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 0.55rem;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  line-height: 1.35;
}

.login-alert {
  font-size: 0.88rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1.15rem;
}

.login-input {
  /* 16px evita zoom automatico do Safari no iPhone ao focar no campo */
  font-size: 16px !important;
  line-height: 1.4;
  min-height: 48px;
  padding: 0.75rem 1rem;
  -webkit-appearance: none;
  appearance: none;
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: #0a1931;
}

.password-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.login-password-input {
  padding-right: 3.1rem !important;
}

.password-toggle-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border: none;
  background: transparent;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  touch-action: manipulation;
  -webkit-appearance: none;
  appearance: none;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus-visible {
  color: #0a1931;
  background: rgba(10, 25, 49, 0.06);
  outline: none;
}

.login-options-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-bottom: 1.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.login-remember-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  min-height: 36px;
  user-select: none;
  -webkit-user-select: none;
}

.login-checkbox {
  width: 18px;
  height: 18px;
  accent-color: #d4af37;
  cursor: pointer;
  flex-shrink: 0;
}

.login-ssl-badge {
  color: #64748b;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.login-submit-btn {
  width: 100%;
  min-height: 50px;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  border-radius: var(--radius-md);
}

.login-back-wrap {
  text-align: center;
  margin-top: 1.35rem;
}

.login-back-link {
  font-size: 0.88rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  touch-action: manipulation;
}

.login-back-link:hover {
  color: #0a1931;
}

@media (max-width: 576px) {
  .login-body {
    padding: max(1rem, env(safe-area-inset-top)) max(0.85rem, env(safe-area-inset-right)) max(1.25rem, env(safe-area-inset-bottom)) max(0.85rem, env(safe-area-inset-left));
  }

  .login-card {
    padding: 1.75rem 1.25rem;
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 0 20px rgba(212, 175, 55, 0.16);
  }

  .login-header {
    margin-bottom: 1.35rem;
  }

  .login-logo {
    max-height: 86px;
    max-width: 195px;
    margin-bottom: 0.75rem;
  }

  .login-title {
    font-size: 1.35rem;
    letter-spacing: 1.4px;
  }

  .login-sub {
    font-size: 0.74rem;
    letter-spacing: 1.1px;
  }

  .login-slogan {
    font-size: 0.74rem;
    margin-top: 0.45rem;
  }

  .login-body .form-group {
    margin-bottom: 1.05rem;
  }

  .login-options-row {
    margin-bottom: 1.2rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 380px) {
  .login-body {
    padding: max(0.75rem, env(safe-area-inset-top)) max(0.65rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(0.65rem, env(safe-area-inset-left));
  }

  .login-card {
    padding: 1.4rem 1rem;
  }

  .login-logo {
    max-height: 74px;
    max-width: 170px;
  }

  .login-title {
    font-size: 1.22rem;
    letter-spacing: 1px;
  }

  .login-options-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

@media (max-height: 540px) and (orientation: landscape) {
  .login-body {
    padding-top: 0.75rem;
    padding-bottom: 1rem;
  }

  .login-card {
    padding: 1.25rem 1.5rem;
    max-width: 500px;
  }

  .login-logo {
    max-height: 62px;
    margin-bottom: 0.5rem;
  }

  .login-header {
    margin-bottom: 1rem;
  }
}

/* ===================================================================
   STUDENT AREA (AVA)
   =================================================================== */
.course-card-student {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-top: 4px solid #d4af37;
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  transition: var(--transition);
}

.course-card-student:hover {
  transform: translateY(-4px);
  border-color: #d4af37;
  box-shadow: 0 12px 30px rgba(10, 25, 49, 0.12);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin: 1rem 0 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd700 0%, #d4af37 60%, #b8860b 100%);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

/* Responsividade */
@media (max-width: 868px) {
  .dashboard-wrapper {
    flex-direction: column;
  }
  .dashboard-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }
  .form-row-2, .form-row-3 {
    grid-template-columns: 1fr;
  }
  .main-body {
    padding: 1.25rem;
  }
}

/* ===================================================================
   MODAIS & DIALOGS (ACESSIBILIDADE & POPUPS)
   =================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 25, 49, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-container {
  background: #ffffff;
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-top: 4px solid #d4af37;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 60px rgba(10, 25, 49, 0.35);
  width: 100%;
  max-width: 660px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.modal-container > form,
.modal-form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  max-height: 90vh;
  overflow: hidden;
}

.modal-header {
  flex-shrink: 0;
  padding: 1.15rem 1.6rem;
  background: #0a1931;
  color: #ffffff;
  border-bottom: 2px solid rgba(212, 175, 55, 0.4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.22rem;
  color: #ffffff;
  font-weight: 800;
  font-family: var(--font-heading);
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: #fff;
  background: rgba(200, 16, 46, 0.4);
}

.modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1.5rem 1.6rem;
  background: #ffffff;
  color: #1e293b;
}

.modal-footer {
  flex-shrink: 0;
  padding: 1rem 1.6rem;
  border-top: 1px solid rgba(212, 175, 55, 0.35);
  background: #ffffff;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 10;
}

/* Suporte nativo para tag HTML5 <dialog> */
dialog.modal-dialog {
  padding: 0;
  border: none;
  background: transparent;
  max-width: 95vw;
  max-height: 95vh;
  margin: auto;
  overflow: visible;
}

dialog.modal-dialog::backdrop {
  background: rgba(10, 25, 49, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Utilitários Visuais da Marca Templários */
.text-gold {
  color: #b8860b !important;
}

.text-crimson {
  color: #c8102e !important;
}

.text-navy {
  color: #0a1931 !important;
}

/* Proteção de contraste para títulos e textos no tema claro da marca */
.dashboard-content h1,
.dashboard-content h2:not(.modal-header *),
.dashboard-content h3:not(.modal-header *),
.dashboard-content h4:not(.modal-header *),
.dashboard-content h5,
.dashboard-content h6 {
  color: #0a1931;
}

/* Títulos de Aulas: Preto absoluto com alto contraste em qualquer card */
.aula-title,
h4.aula-title,
.dashboard-content .aula-title {
  color: #000000 !important;
  font-weight: 800 !important;
}

/* Caixa de Descrição e Roteiro da Aula: fundo branco puro e texto preto absoluto */
.aula-description-box,
.aula-description-container,
div.aula-description-box {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #000000 !important;
  border: 1px solid rgba(212, 175, 55, 0.4) !important;
  border-left: 4px solid #d4af37 !important;
  box-shadow: none !important;
}

.aula-description-box *,
.aula-description-container *,
div.aula-description-box * {
  background-color: #ffffff !important;
  background: #ffffff !important;
  color: #000000 !important;
  box-shadow: none !important;
}

.aula-description-box i.text-gold,
.aula-description-box .text-gold,
.aula-description-container i.text-gold,
.aula-description-container .text-gold {
  color: #b8860b !important;
  background: transparent !important;
}

/* Garante que títulos e textos em containers claros nunca fiquem invisíveis em branco */
.dashboard-content [style*="color: #fff"]:not(.btn):not(.btn *):not(.badge):not(.badge *):not(.badge-status):not(.badge-status *):not(.modal-header *):not(.dashboard-sidebar *):not(.sidebar-link):not(.sidebar-link *):not([style*="background: #0a1931"] *):not([style*="background: linear-gradient(135deg, #0a1931"] *) {
  color: #0a1931 !important;
}

