:root {
    --primary: #539D95;
    --primary-dark: #478780;
    --secondary: #E41704;
    --secondary-dark: #B81203;
    --light-bg: #F8FAFA;
    --text-dark: #1F2937;
}

body { font-family: 'Inter', sans-serif; }

.bg-primary { background-color: var(--primary) !important; }
.bg-primary-dark { background-color: var(--primary-dark) !important; }
.bg-secondary { background-color: var(--secondary) !important; }
.bg-secondary-dark { background-color: var(--secondary-dark) !important; }
.text-primary { color: var(--primary) !important; }
.text-secondary { color: var(--secondary) !important; }
.border-primary { border-color: var(--primary) !important; }
.border-secondary { border-color: var(--secondary) !important; }
.hover\:bg-primary-dark:hover { background-color: var(--primary-dark) !important; }
.hover\:bg-secondary-dark:hover { background-color: var(--secondary-dark) !important; }

.btn-primary {
    background-color: var(--primary);
    color: white;
    transition: all 0.2s;
}
.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(83, 157, 149, 0.4);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    transition: all 0.2s;
}
.btn-secondary:hover {
    background-color: var(--secondary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(228, 23, 4, 0.4);
}

.glass {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
}

.card-hover {
    transition: all 0.3s ease;
}
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.header-dark {
    background: rgba(31, 41, 55, 0.92) !important;
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
.header-dark .text-gray-700 {
    color: rgba(255, 255, 255, 0.75) !important;
}
.header-dark .text-gray-700:hover {
    color: #539D95 !important;
}

.help-tooltip { position: relative; display: inline-flex; align-items: center; }
.help-tooltip .help-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(83,157,149,0.15); color: #539D95;
    font-size: 10px; font-weight: 700; cursor: pointer;
    margin-left: 6px; transition: all 0.2s; border: none; outline: none; flex-shrink: 0;
}
.help-tooltip .help-icon:hover { background: #539D95; color: white; transform: scale(1.15); }
.help-tooltip .tooltip-box {
    position: absolute; bottom: calc(100% + 10px); left: 50%;
    transform: translateX(-50%); background: #1F2937; color: white;
    padding: 14px 16px; border-radius: 12px; font-size: 12.5px;
    line-height: 1.6; width: 300px; max-width: 90vw; z-index: 9999;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25); pointer-events: none;
    opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    transform: translateX(-50%) translateY(6px); text-align: left;
}
.help-tooltip .tooltip-box::after {
    content: ''; position: absolute; top: 100%; left: 50%;
    transform: translateX(-50%); border: 6px solid transparent;
    border-top-color: #1F2937;
}
.help-tooltip:hover .tooltip-box, .help-tooltip:focus-within .tooltip-box {
    opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0);
}
.tooltip-title { font-weight: 700; margin-bottom: 6px; color: #539D95; font-size: 12px;
    text-transform: uppercase; letter-spacing: 0.5px; display: flex; align-items: center; gap: 4px; }
.tooltip-body { color: rgba(255,255,255,0.85); }
.tooltip-required { margin-top: 8px; padding-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); font-size: 11px; font-weight: 600; }
.tooltip-required.obrigatorio { color: #F87171; }
.tooltip-required.opcional { color: #6EE7B7; }

/* ── Admin Form Styles (curso-form-secoes, curso-editar, gerenciar) ── */

/* Accordion Sections */
.section-accordion {
  background: white;
  border-radius: 1.25rem;
  border: 1px solid #eef2f6;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03), 0 4px 12px rgba(0,0,0,0.03);
  transition: box-shadow 0.25s;
}
.section-accordion:hover { box-shadow: 0 2px 6px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.04); }
.section-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
  border-radius: 1.25rem;
}
.section-accordion-header:hover { background: #FAFBFC; }
.section-accordion.open .section-accordion-header { border-radius: 1.25rem 1.25rem 0 0; }
.section-accordion-header .h-left { display: flex; align-items: center; gap: 0.875rem; min-width: 0; }
.section-accordion-header .h-icon {
  width: 2.25rem; height: 2.25rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: rgba(83,157,149,0.08);
  color: #539D95;
  font-size: 0.9375rem;
}
.section-accordion-header .h-text { min-width: 0; }
.section-accordion-header .h-text h3 { font-size: 0.9375rem; font-weight: 700; color: #0f172a; margin: 0; line-height: 1.3; }
.section-accordion-header .h-text p { font-size: 0.75rem; color: #94a3b8; margin: 0.0625rem 0 0 0; line-height: 1.3; }
.section-accordion-header .h-chevron {
  width: 1.75rem; height: 1.75rem;
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  transition: all 0.3s;
  flex-shrink: 0;
  font-size: 0.75rem;
}
.section-accordion-header:hover .h-chevron { background: #eef2f6; color: #64748b; }
.section-accordion.open .h-chevron { transform: rotate(180deg); }
.section-accordion-body { max-height: 0; overflow: hidden; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
.section-accordion.open .section-accordion-body { max-height: 4000px; }
.section-accordion-content { padding: 0 1.5rem 1.5rem; border-top: 1px solid #f1f5f9; padding-top: 1.25rem; }

/* Form Elements */
.form-label { display: block; font-size: 0.8125rem; font-weight: 600; color: #334155; margin-bottom: 0.375rem; letter-spacing: 0.01em; }
.form-label .required { color: #ef4444; margin-left: 2px; }
.form-label .hint { font-weight: 400; color: #94a3b8; font-size: 0.75rem; margin-left: 0.375rem; }
.form-input, .form-select {
  width: 100%; height: 2.75rem; padding: 0 0.875rem;
  border: 1.5px solid #e2e8f0; border-radius: 0.75rem;
  transition: all 0.2s; font-size: 0.875rem;
  background: white; color: #0f172a;
  appearance: none; -webkit-appearance: none;
}
.form-input:hover, .form-select:hover { border-color: #cbd5e1; }
.form-input:focus, .form-select:focus { outline: none; border-color: #539D95; box-shadow: 0 0 0 3px rgba(83,157,149,0.15); }
.form-input.error, .form-select.error { border-color: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,0.1); }
.form-input::placeholder { color: #94a3b8; font-weight: 400; }
textarea.form-input { height: auto; padding: 0.625rem 0.875rem; resize: vertical; min-height: 2.75rem; }
select.form-select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2.25rem; }

/* Buttons */
.btn-add { height: 2.375rem; padding: 0 1rem; background: #f1f5f9; color: #334155; border-radius: 0.75rem; font-size: 0.8125rem; font-weight: 600; transition: all 0.15s; display: inline-flex; align-items: center; gap: 0.375rem; border: none; cursor: pointer; }
.btn-add:hover { background: #e2e8f0; }
.btn-add:active { transform: scale(0.97); }
.btn-danger { height: 2.125rem; padding: 0 0.625rem; color: #ef4444; border-radius: 0.5rem; transition: all 0.15s; font-size: 0.875rem; border: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn-danger:hover { background: #fef2f2; }
.btn-ghost { height: 2.125rem; padding: 0 0.75rem; color: #64748b; border-radius: 0.5rem; transition: all 0.15s; font-size: 0.8125rem; font-weight: 500; border: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.375rem; }
.btn-ghost:hover { background: #f1f5f9; color: #334155; }

/* Grid Helpers */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.field-grid-full { grid-column: 1 / -1; }
.field-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 768px) { .field-grid, .field-grid-3 { grid-template-columns: 1fr; } }

/* Radio Group */
.radio-group { display: flex; gap: 1.25rem; padding: 0.5rem 0; }
.radio-group label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; font-size: 0.8125rem; color: #334155; font-weight: 500; }
.radio-group input[type="radio"] { width: 1.125rem; height: 1.125rem; accent-color: #539D95; margin: 0; }

/* Upload Zone */
.upload-zone { border: 2px dashed #e2e8f0; border-radius: 0.875rem; padding: 1.5rem; text-align: center; transition: all 0.2s; cursor: pointer; background: #fafbfc; }
.upload-zone:hover, .upload-zone.dragover { border-color: #539D95; background: rgba(83,157,149,0.08); }
.upload-zone.has-image { padding: 0.5rem; border-style: solid; background: white; }
.upload-preview { position: relative; display: inline-block; border-radius: 0.75rem; overflow: hidden; max-width: 100%; }
.upload-preview img, .upload-preview video { max-height: 160px; border-radius: 0.75rem; object-fit: cover; display: block; }
.upload-preview .overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: center; justify-content: center; gap: 0.75rem; opacity: 0; transition: opacity 0.2s; border-radius: 0.75rem; }
.upload-preview:hover .overlay { opacity: 1; }
.upload-preview .overlay button { width: 2.25rem; height: 2.25rem; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.8125rem; transition: all 0.15s; border: none; cursor: pointer; }

/* Module / Aula Cards */
.module-card { background: #fafbfc; border: 1.5px solid #eef2f6; border-radius: 1rem; margin-bottom: 0.875rem; transition: border-color 0.2s; overflow: hidden; }
.module-card:hover { border-color: #d1d9e6; }
.module-card .module-header { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; cursor: pointer; user-select: none; transition: background 0.2s; }
.module-card .module-header:hover { background: #f8f9fa; }
.module-card .module-body { padding: 0 1.25rem 1.25rem; }
.aula-item { background: white; border: 1.5px solid #eef2f6; border-radius: 0.875rem; padding: 1rem; margin-bottom: 0.625rem; transition: border-color 0.2s; }
.aula-item:hover { border-color: #cbd5e1; }
.aula-item:last-child { margin-bottom: 0; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 0.25rem; padding: 0.125rem 0.5rem; border-radius: 9999px; font-size: 0.6875rem; font-weight: 600; line-height: 1.4; }
.badge-green { background: #dcfce7; color: #166534; }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-purple { background: #f3e8ff; color: #6b21a8; }
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-rose { background: #ffe4e6; color: #9f1239; }
.badge-gray { background: #f1f5f9; color: #475569; }

/* SEO Preview */
.seo-preview { background: #fff; border-radius: 0.75rem; padding: 0; }
.seo-preview-url { font-size: 0.8125rem; color: #006621; line-height: 1.3; margin-bottom: 0.125rem; }
.seo-preview-title { font-size: 1.125rem; color: #1a0dab; font-weight: 400; line-height: 1.3; margin-bottom: 0.125rem; cursor: pointer; }
.seo-preview-title:hover { text-decoration: underline; }
.seo-preview-desc { font-size: 0.8125rem; color: #545454; line-height: 1.4; }
.seo-counter { transition: color 0.2s; }
.seo-counter.over { color: #dc2626 !important; }

/* Smart Category Select */
.category-select-wrapper { position: relative; }
.category-select-container { position: relative; }
.category-search-input { padding-right: 2.5rem !important; }
.category-search-input:focus + .category-dropdown,
.category-search-input:focus-within ~ .category-dropdown,
.category-dropdown.show { display: block; }
.category-dropdown { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: white; border: 1px solid #e2e8f0; border-radius: 0.75rem; box-shadow: 0 4px 16px rgba(0,0,0,0.08); max-height: 220px; overflow-y: auto; z-index: 50; padding: 0.25rem; }
.category-option { padding: 0.5rem 0.75rem; font-size: 0.8125rem; color: #334155; cursor: pointer; border-radius: 0.5rem; transition: background 0.15s; }
.category-option:hover { background: rgba(83,157,149,0.08); color: #539D95; }
.category-option.highlighted { background: rgba(83,157,149,0.08); color: #539D95; }
.category-create-option { border-top: 1px solid #f1f5f9; margin-top: 0.125rem; padding-top: 0.5rem; color: #539D95; font-weight: 500; }
.cat-create-name { font-weight: 600; }

/* Tags Chips */
.tags-wrapper { background: white; border: 1px solid #e2e8f0; border-radius: 0.75rem; padding: 0.375rem 0.5rem; transition: border-color 0.2s, box-shadow 0.2s; min-height: 2.75rem; display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.tags-wrapper:focus-within { border-color: #539D95; box-shadow: 0 0 0 2px rgba(83,157,149,0.15); }
.tags-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.tag-chip { display: inline-flex; align-items: center; gap: 0.25rem; background: rgba(83,157,149,0.08); color: #478780; font-size: 0.75rem; font-weight: 500; padding: 0.1875rem 0.5rem; border-radius: 0.5rem; animation: fadeIn 0.15s ease; line-height: 1.4; }
.tag-chip .tag-remove { display: inline-flex; align-items: center; justify-content: center; width: 1rem; height: 1rem; border-radius: 50%; cursor: pointer; font-size: 0.625rem; color: #478780; transition: background 0.15s; margin-left: 0.125rem; }
.tag-chip .tag-remove:hover { background: rgba(83,157,149,0.2); }
.tags-input { border: none !important; outline: none !important; box-shadow: none !important; padding: 0 !important; min-width: 100px; flex: 1; font-size: 0.8125rem; height: 1.75rem; background: transparent; }
.tags-input::placeholder { color: #94a3b8; }

/* Animations */
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.slide-in { animation: slideDown 0.25s ease; }
.fade-in { animation: fadeIn 0.3s ease; }

/* ── Page Layout ── */
.page-content { background-color: var(--light-bg); min-height: 100vh; }

/* ── Dashboard / Stat Cards ── */
.stat-card { transition: all 0.3s ease; }
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(0,0,0,0.08); }
.stat-card-compact { height: 110px; padding: 20px; border-radius: 16px; }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-icon-sm { width: 36px; height: 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* ── Table Styles ── */
.table-row:hover { background-color: rgba(83, 157, 149, 0.03); }
.table-wrap table thead th { padding: 12px 20px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6B7280; background-color: var(--light-bg); }
.table-wrap table tbody td { padding: 14px 20px; font-size: 13px; }
.table-wrap-rounded { border-radius: 16px; }
.chart-wrap { max-height: 320px; }
.btn-action { transition: all 0.2s; }
.btn-action:hover { transform: translateY(-1px); }

/* ── Course Type Badges ── */
.badge-online { background: rgba(83, 157, 149, 0.1); color: var(--primary); }
.badge-presencial { background: rgba(228, 23, 4, 0.1); color: var(--secondary); }

/* ── Status Badges (Certificados, Aprovação, etc) ── */
.badge-success { background: rgba(16,185,129,0.1); color: #059669; }
.badge-warning { background: rgba(245,158,11,0.1); color: #D97706; }
.badge-danger { background: rgba(228,23,4,0.1); color: var(--secondary); }
.badge-info { background: rgba(59,130,246,0.1); color: #2563EB; }
.badge-disponivel { background: rgba(16,185,129,0.12); color: #059669; }
.badge-pendente { background: rgba(245,158,11,0.12); color: #D97706; }
.badge-bloqueado { background: rgba(107,114,128,0.12); color: #6B7280; }
.badge-expirado { background: rgba(228,23,4,0.12); color: var(--secondary); }
.badge-revogado { background: rgba(228,23,4,0.12); color: var(--secondary); }

/* ── Progress Bars ── */
.progress-primary { background: var(--primary); }
.progress-warning { background: #f59e0b; }
.progress-danger { background: #ef4444; }

/* ── Cards & Sections ── */
.premium-card { background: white; border-radius: 16px; border: 1px solid rgba(0,0,0,0.05); box-shadow: 0 4px 20px rgba(0,0,0,0.04); }
.premium-card:hover { transform: translateY(-4px); box-shadow: 0 16px 50px rgba(0,0,0,0.1); }
.card-section { background: white; border-radius: 20px; border: 1px solid rgba(0,0,0,0.06); box-shadow: 0 4px 20px rgba(0,0,0,0.06); }

/* ── Hero Sections ── */
.hero-section { background: linear-gradient(135deg, #1F2937 0%, #111827 100%); padding: 60px 0 80px; }
.page-hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); position: relative; overflow: hidden; }

/* ── Breadcrumbs ── */
.page-breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 13px; color: rgba(255,255,255,0.5); margin-bottom: 16px; }
.page-breadcrumb a { color: rgba(255,255,255,0.5); text-decoration: none; }
.page-breadcrumb a:hover { color: var(--primary); }
.page-breadcrumb i { font-size: 10px; }

/* ── Toast / Notification ── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 16px 20px; border-radius: 12px; font-weight: 600; font-size: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.15); display: flex; align-items: center; gap: 10px; animation: slideIn 0.3s ease; max-width: 400px; }
.toast-success { background: #D1FAE5; color: #065F46; border-left: 4px solid #059669; }
.toast-error { background: #FEE2E2; color: #991B1B; border-left: 4px solid #DC2626; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.save-indicator { position: fixed; bottom: 1.5rem; right: 1.5rem; padding: 0.75rem 1.25rem; border-radius: 0.75rem; font-size: 0.875rem; font-weight: 500; transition: all 0.3s; z-index: 50; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.save-indicator.saving { background: #FEF3C7; color: #92400E; }
.save-indicator.saved { background: #D1FAE5; color: #065F46; }
.save-indicator.error { background: #FEE2E2; color: #991B1B; }

/* ── Drop Zone ── */
.drop-zone { border: 2px dashed #D1D5DB; border-radius: 12px; padding: 32px; text-align: center; transition: all 0.3s ease; cursor: pointer; }
.drop-zone:hover, .drop-zone.dragover { border-color: var(--primary); background: rgba(83,157,149,0.05); }

/* ── Tabs ── */
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-btn.active i { color: var(--primary); }

/* ── Icon Box ── */
.icon-box { width: 64px; height: 64px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background-color: rgba(83, 157, 149, 0.1); color: var(--primary); }
.icon-box-secondary { background-color: rgba(228, 23, 4, 0.1); color: var(--secondary); }

/* ── Sidebar Item ── */
.sidebar-item { transition: all 0.2s ease; }
.sidebar-item:hover { background-color: rgba(83, 157, 149, 0.05); color: var(--primary); }
.sidebar-item.active { background-color: var(--primary); color: white; }
.sidebar-item.active:hover { background-color: var(--primary-dark); }
