/* =====================================================
   PUBLICARGA PORTAL — style.css
   ===================================================== */

:root {
  --primary:      #E67E22;   /* Laranja */
  --primary-dark: #D35400;   /* Laranja Escuro */
  --primary-light:#FEF3C7;   /* Laranja Claro */
  --sidebar-bg:   #0F172A;   /* Preto */
  --success:      #16A34A;   /* Verde */
  --sidebar-hover:rgba(59,130,246,0.15);
  --sidebar-active:rgba(59,130,246,0.25);
}

/* =====================================================
   RESET & BASE
   ===================================================== */
* { box-sizing: border-box; }
body { font-family: 'Segoe UI', system-ui, -apple-system, sans-serif; }

/* =====================================================
   SIDEBAR
   ===================================================== */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  flex-shrink: 0;
  transition: all 0.3s;
  overflow-y: auto;
  z-index: 100;
}

.sidebar .nav-link {
  border-radius: 8px;
  margin-bottom: 3px;
  padding: 10px 12px;
  transition: background 0.2s, color 0.2s;
  color: #94A3B8 !important;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
}
.sidebar .nav-link:hover {
  background: var(--sidebar-hover);
  color: #93C5FD !important;
}
.sidebar .nav-link.active {
  background: var(--sidebar-active);
  color: #60A5FA !important;
  border-left: 3px solid #E67E22;
  font-weight: 600;
}

/* =====================================================
   MOBILE SIDEBAR
   ===================================================== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  z-index: 999;
}
.sidebar-overlay.show { display: block; }

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
  }
  .sidebar.show-mobile { left: 0; }
  .custom-mobile-header { display: flex !important; }
}
@media (min-width: 769px) {
  .custom-mobile-header { display: none !important; }
}

/* =====================================================
   LOGIN
   ===================================================== */
.login-bg {
  background: linear-gradient(135deg, #0F172A 0%, #E67E22 50%, #0F172A 100%);
  min-height: 100vh;
}
.login-card {
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}

/* =====================================================
   CARDS & KPIs
   ===================================================== */
.kpi-card {
  border: none;
  border-radius: 10px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.07);
  transition: box-shadow 0.2s;
}
.kpi-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); }

/* =====================================================
   TIMELINE
   ===================================================== */
.timeline {
  list-style: none;
  padding: 0;
  position: relative;
  margin: 0;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 15px; top: 0; bottom: 0;
  width: 2px;
  background: #E2E8F0;
}
.timeline li {
  padding: 0 0 20px 45px;
  position: relative;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: 8px; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid white;
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline li .tl-time {
  font-size: 0.75rem;
  color: #94A3B8;
  font-weight: 600;
}
.timeline li .tl-autor {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
}
.timeline li .tl-texto {
  font-size: 0.9rem;
  color: #374151;
  margin-top: 4px;
  white-space: pre-wrap;
}
.timeline li .tl-arquivo {
  margin-top: 6px;
}

/* =====================================================
   KANBAN
   ===================================================== */
.kanban-column {
  min-width: 280px;
  background: #F8FAFC;
  border-radius: 12px;
  flex-shrink: 0;
}
.kanban-header {
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 12px 12px 0 0;
  background: #E2E8F0;
  color: #374151;
}
.kanban-col {
  min-height: 200px;
  transition: background 0.2s;
  border-radius: 0 0 12px 12px;
  padding: 8px;
}
.kanban-col.drag-over {
  background: rgba(37,99,235,0.08);
  border: 2px dashed var(--primary);
}
.kanban-card {
  background: white;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  border: 1px solid #E5E7EB;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
}
.kanban-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37,99,235,0.1);
  transform: translateY(-1px);
}
.kanban-card .kc-empresa { font-weight: 700; font-size: 0.9rem; color: #111827; }
.kanban-card .kc-responsavel { font-size: 0.78rem; color: #6B7280; }
.kanban-card .kc-valor { font-size: 0.8rem; font-weight: 700; color: #059669; }
.kanban-card .kc-data { font-size: 0.72rem; color: #9CA3AF; }

/* =====================================================
   ANÚNCIOS — CARDS
   ===================================================== */
.anuncio-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #E5E7EB;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.anuncio-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(37,99,235,0.12);
  border-color: var(--primary);
}
.anuncio-card .ac-bar {
  height: 5px;
  width: 100%;
}
.anuncio-card .ac-body { padding: 16px; }
.anuncio-card .ac-cliente { font-weight: 700; font-size: 1rem; color: #111827; }
.anuncio-card .ac-totem { font-size: 0.8rem; color: #6B7280; margin-top: 2px; }
.anuncio-card .ac-spot { font-size: 0.82rem; font-weight: 600; color: #374151; }
.anuncio-card .ac-periodo { font-size: 0.78rem; color: #9CA3AF; }
.anuncio-card .ac-valor { font-size: 1.1rem; font-weight: 700; color: #059669; }

/* =====================================================
   STATUS BADGES DOS ANÚNCIOS
   ===================================================== */
.badge-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
}
.badge-em-analise    { background:#FEF3C7; color:#92400E; }
.badge-aguardando    { background:#EDE9FE; color:#5B21B6; }
.badge-aprovado      { background:#FEF3C7; color:#D35400; }
.badge-veiculando    { background:#D1FAE5; color:#065F46; }
.badge-encerrado     { background:#F3F4F6; color:#374151; }
.badge-cancelado     { background:#FEE2E2; color:#991B1B; }
.badge-rejeitado     { background:#450a0a; color:#fca5a5; }

/* Barras coloridas (topo do card) */
.bar-em-analise  { background: #F59E0B; }
.bar-aguardando  { background: #8B5CF6; }
.bar-aprovado    { background: #16A34A; }
.bar-veiculando  { background: #10B981; }
.bar-encerrado   { background: #9CA3AF; }
.bar-cancelado   { background: #EF4444; }

/* =====================================================
   TOTEM STATUS (online/offline)
   ===================================================== */
.dot-online {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #10B981;
  animation: pulse-dot 2s infinite;
  margin-right: 5px;
  vertical-align: middle;
}
.dot-offline {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #EF4444;
  margin-right: 5px;
  vertical-align: middle;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.6; transform: scale(0.88); }
}

/* =====================================================
   EAD — DARK THEME
   ===================================================== */
.ead-bg {
  background-color: #0F172A;
  min-height: 100vh;
  color: white;
  padding-bottom: 60px;
}
.card-modulo {
  background: #1E293B;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
  border: 1px solid #334155;
  overflow: hidden;
}
.card-modulo:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: 0 10px 20px rgba(37,99,235,0.15);
}
.modulo-icon { font-size: 45px; color: #E67E22; }

.aula-item {
  display: flex;
  align-items: center;
  background: #1E293B;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: background 0.2s, border-left-color 0.2s;
  border-left: 4px solid transparent;
}
.aula-item:hover {
  background: #263247;
  border-left-color: var(--primary);
}
.aula-thumb {
  width: 140px; height: 79px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 15px;
  border: 1px solid #334155;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #E67E22;
  flex-shrink: 0;
}
.aula-opaca { opacity: 0.55; }

.btn-ead-voltar {
  background: transparent;
  border: none;
  color: #94A3B8;
  cursor: pointer;
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  transition: color 0.2s;
  padding: 0;
  font-size: 1.05rem;
}
.btn-ead-voltar:hover { color: white; }

.manuais-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
}
.card-manual {
  background: #1E293B;
  padding: 15px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 15px;
  color: white;
  text-decoration: none;
  border: 1px solid #334155;
  transition: background 0.2s, border-color 0.2s;
  cursor: pointer;
}
.card-manual:hover {
  background: #263247;
  color: white;
  border-color: var(--primary);
}

/* =====================================================
   UPLOAD PROGRESS BAR
   ===================================================== */
.upload-bar {
  height: 6px;
  border-radius: 3px;
  background: #E5E7EB;
  overflow: hidden;
  margin-top: 6px;
}
.upload-bar-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
  border-radius: 3px;
}

/* =====================================================
   RELATÓRIO DE EXIBIÇÕES (Play Chart)
   ===================================================== */
.plays-stat-box {
  background: #F8FAFC;
  border-radius: 10px;
  padding: 16px;
  text-align: center;
  border: 1px solid #E5E7EB;
}
.plays-stat-box .plays-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.plays-stat-box .plays-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* =====================================================
   COMUNICADOS
   ===================================================== */
.comunicado-card {
  transition: transform 0.2s, box-shadow 0.2s;
  border-left: 4px solid var(--primary) !important;
  cursor: pointer;
}
.comunicado-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 .5rem 1rem rgba(0,0,0,.1) !important;
}

/* =====================================================
   TABELA — LINHA CLICÁVEL
   ===================================================== */
.row-clicavel {
  cursor: pointer;
  transition: background-color 0.15s;
}
.row-clicavel:hover { background-color: #F8FAFC; }

/* =====================================================
   SLA BADGE
   ===================================================== */
.badge-sla {
  background: #FEE2E2;
  color: #991B1B;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

/* =====================================================
   QUIZ EAD
   ===================================================== */
.quiz-option {
  display: block;
  margin-bottom: 10px;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: 8px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.93rem;
}
.quiz-option:hover {
  border-color: var(--primary);
  background: #EFF6FF;
}
.quiz-option input { margin-right: 10px; accent-color: var(--primary); }

.quiz-header {
  text-align: center;
  margin-bottom: 28px;
  background: #EFF6FF;
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 20px 15px;
}
.quiz-header h2 { color: var(--primary-dark); font-weight: 800; font-size: 1.5em; margin: 0; text-transform: uppercase; }

.quiz-submit-btn {
  width: 100%;
  padding: 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1.1em;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
  box-shadow: 0 4px 0 var(--primary-dark);
  margin-top: 20px;
  transition: background 0.2s, transform 0.1s, box-shadow 0.1s;
}
.quiz-submit-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 #D35400;
}
.quiz-submit-btn:disabled {
  background: #9CA3AF;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.quiz-results {
  display: none;
  text-align: center;
  padding: 40px;
  background: #F0FDF4;
  border: 2px solid #22C55E;
  border-radius: 15px;
  margin-top: 30px;
}
.quiz-loading {
  display: none;
  text-align: center;
  margin-top: 20px;
  color: var(--primary);
  font-weight: bold;
}

/* =====================================================
   MODAL HELPERS
   ===================================================== */
.modal-content { border-radius: 12px; }
.modal-header  { border-radius: 12px 12px 0 0; }

/* =====================================================
   GRID MÓDULOS (responsivo)
   ===================================================== */
.grid-modulos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.modulo-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #F3F4F6;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid #E5E7EB;
  transition: border-color 0.2s, background 0.2s;
}
.modulo-checkbox:hover { border-color: var(--primary); background: #EFF6FF; }
.modulo-checkbox input { accent-color: var(--primary); }

/* =====================================================
   UTILITY
   ===================================================== */
.cursor-pointer { cursor: pointer; }
.font-monospace { font-family: 'Courier New', monospace; letter-spacing: 1px; }
.text-primary-pub { color: var(--primary) !important; }
.bg-primary-pub   { background: var(--primary) !important; }
.border-primary-pub { border-color: var(--primary) !important; }

.shadow-sm-hover { transition: box-shadow 0.2s; }
.shadow-sm-hover:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.12) !important; }

/* Scrollbar personalizada (webkit) */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #F1F5F9; }
::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94A3B8; }
