﻿/* ====================================================
   ROBOTIC CARDIAC SURGERY — Design System
   ==================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --primary:       #0c3566;
  --primary-light: #154f8a;
  --accent:        #06b6d4;
  --accent-dark:   #0891b2;
  --accent-light:  #e0f7fa;
  --bg:            #f0f5fb;
  --white:         #ffffff;
  --sidebar-w:     265px;
  --text:          #1e293b;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --info:          #3b82f6;
  --radius:        10px;
  --shadow:        0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:     0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:     0 10px 30px rgba(0,0,0,.12);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.6;
}

/* ==============================
   LAYOUT PRINCIPAL
   ============================== */
.layout-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ==============================
   SIDEBAR
   ============================== */
.sidebar {
  width: var(--sidebar-w);
  background: var(--primary);
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 2px; }

.sidebar-brand {
  padding: 22px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
  flex-shrink: 0;
}

.sidebar-brand img { max-width: 100%; height: auto; }

.sidebar-nav { flex: 1; padding: 10px 0; }

.nav-section-title {
  padding: 14px 20px 5px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 20px;
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all .15s ease;
}

.nav-item:hover {
  background: rgba(255,255,255,.05);
  color: rgba(255,255,255,.9);
}

.nav-item.active {
  background: rgba(6,182,212,.12);
  color: var(--accent);
  border-left-color: var(--accent);
}

.nav-item i { width: 18px; text-align: center; font-size: 14px; }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}

.user-name {
  font-size: 13px; font-weight: 600; color: white;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role-badge {
  font-size: 10px; color: rgba(255,255,255,.45);
  text-transform: capitalize;
}

.btn-logout {
  color: rgba(255,255,255,.4);
  font-size: 16px;
  text-decoration: none;
  flex-shrink: 0;
  transition: color .15s;
  padding: 4px;
}

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

/* ==============================
   CONTEÚDO PRINCIPAL
   ============================== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.page-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 100;
}

.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.page-body {
  padding: 28px 32px;
  flex: 1;
}

/* ==============================
   MOBILE NAV
   ============================== */
#mobileTopNav {
  background: var(--primary) !important;
  border-bottom: 1px solid rgba(255,255,255,.08);
  padding: 0 16px;
  height: 56px;
}

.offcanvas.offcanvas-start {
  width: var(--sidebar-w) !important;
  background: var(--primary) !important;
  border-right: none !important;
}

.offcanvas-header {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.offcanvas-body { padding: 0; }

/* ==============================
   CARDS
   ============================== */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-body { padding: 20px; }

/* ==============================
   STAT CARDS
   ============================== */
.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow .2s;
}

.stat-card:hover { box-shadow: var(--shadow-md); }

.stat-icon {
  width: 50px; height: 50px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.si-teal   { background: #e0f7fa; color: var(--accent-dark); }
.si-blue   { background: #dbeafe; color: #2563eb; }
.si-green  { background: #d1fae5; color: #059669; }
.si-purple { background: #ede9fe; color: #7c3aed; }
.si-orange { background: #fef3c7; color: #d97706; }

.stat-value { font-size: 26px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

/* ==============================
   COURSE CARDS
   ============================== */
.course-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
}

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

.course-thumb {
  width: 100%; height: 150px;
  object-fit: cover;
}

.course-thumb-default {
  width: 100%; height: 150px;
  background: linear-gradient(135deg, var(--primary) 0%, #0891b2 100%);
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; color: rgba(255,255,255,.6);
}

.course-info { padding: 16px; flex: 1; display: flex; flex-direction: column; }

.course-title {
  font-size: 14.5px; font-weight: 600;
  margin-bottom: 6px; line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.course-description {
  font-size: 12.5px; color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.course-meta {
  font-size: 11.5px; color: var(--text-muted);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 14px;
  align-items: center;
}

/* ==============================
   TABELAS
   ============================== */
.table-wrapper {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.table-responsive { overflow-x: auto; }

.table { margin: 0; font-size: 13.5px; }

.table thead th {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: .6px;
  text-transform: uppercase;
  padding: 11px 16px;
  white-space: nowrap;
}

.table tbody td {
  padding: 12px 16px;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #f8fafc; }

/* ==============================
   BADGES
   ============================== */
.badge-role {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11px; font-weight: 600;
}

.badge-admin     { background: #fff3cd; color: #856404; }
.badge-professor { background: #dbeafe; color: #1d4ed8; }
.badge-aluno     { background: #d1fae5; color: #065f46; }
.badge-ativo     { background: #d1fae5; color: #065f46; }
.badge-inativo   { background: #fee2e2; color: #991b1b; }

/* ==============================
   FORMULÁRIOS
   ============================== */
.form-control, .form-select {
  font-size: 13.5px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 13px;
  transition: border-color .15s, box-shadow .15s;
  background: white;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(6,182,212,.15);
  outline: none;
}

.form-label {
  font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 5px;
}

.form-text { font-size: 11.5px; color: var(--text-muted); }

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

/* ==============================
   BOTÕES
   ============================== */
.btn {
  font-size: 13.5px; font-weight: 600;
  border-radius: 8px; padding: 8px 18px;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s; cursor: pointer; border: none;
  text-decoration: none;
}

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

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

.btn-secondary { background: var(--border); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #cbd5e1; color: var(--text); }

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; color: white; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #dc2626; color: white; }

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

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }

/* ==============================
   ALERTAS / FLASH
   ============================== */
.alert {
  border-radius: var(--radius); border: none;
  padding: 13px 16px; font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
}

.alert-success { background: #d1fae5; color: #065f46; }
.alert-danger   { background: #fee2e2; color: #991b1b; }
.alert-warning  { background: #fef3c7; color: #856404; }
.alert-info     { background: #dbeafe; color: #1d4ed8; }

/* ==============================
   ESTRUTURA DE CURSO (módulos/aulas)
   ============================== */
.module-block {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.module-head {
  padding: 13px 16px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.module-number {
  width: 26px; height: 26px;
  background: var(--accent); color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.module-title-text {
  flex: 1; font-weight: 600; font-size: 14px;
}

.lesson-list { padding: 0; }

.lesson-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px 10px 48px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  transition: background .15s;
}

.lesson-row:last-child { border-bottom: none; }
.lesson-row:hover { background: #f8fafc; }

.lesson-icon {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; flex-shrink: 0;
}

.lesson-icon.li-video  { background: #ede9fe; color: #7c3aed; }
.lesson-icon.li-file   { background: #dbeafe; color: #2563eb; }
.lesson-icon.li-lesson { background: var(--accent-light); color: var(--accent-dark); }

.lesson-title-text { flex: 1; }

/* ==============================
   BLOCO DE TEXTO (aula view)
   ============================== */
.aula-texto-content {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ==============================
   PLAYER DE VÍDEO
   ============================== */
.video-wrap {
  position: relative;
  width: 100%; padding-bottom: 56.25%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow: var(--shadow-md);
}

.video-wrap iframe,
.video-wrap video {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

/* Overlay de play para vídeos de upload */
.video-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px;
  background: linear-gradient(160deg, #0c3566 0%, #0a5c8a 60%, #0891b2 100%);
  cursor: pointer;
  z-index: 5;
  transition: opacity .3s ease;
}

.video-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.video-play-circle {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: rgba(6,182,212,.85);
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; color: #fff;
  /* Pulso duplo de anel ao redor do botão */
  box-shadow:
    0 0 0 14px rgba(6,182,212,.14),
    0 0 0 28px rgba(6,182,212,.06),
    0 8px 32px rgba(0,0,0,.5);
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
}

.video-overlay:hover .video-play-circle {
  transform: scale(1.1);
  background: var(--accent);
  box-shadow:
    0 0 0 16px rgba(6,182,212,.2),
    0 0 0 32px rgba(6,182,212,.08),
    0 8px 32px rgba(0,0,0,.5);
}

.video-overlay-hint {
  color: rgba(255,255,255,.5);
  font-size: 11.5px;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.video-error-msg {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 12px;
  background: #0c3566;
  color: rgba(255,255,255,.6);
  font-size: 13px;
  text-align: center;
  padding: 20px;
  z-index: 6;
}

/* ==============================
   OVERLAY DE UPLOAD
   ============================== */
.upload-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.upload-overlay-box {
  background: white;
  border-radius: var(--radius);
  padding: 40px 44px;
  max-width: 430px; width: 100%;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.upload-overlay-icon {
  font-size: 42px; color: var(--accent);
  margin-bottom: 16px;
  display: block;
  animation: upl-float 1.4s ease-in-out infinite;
}

@keyframes upl-float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-9px); }
}

.upload-overlay-title {
  font-size: 17px; font-weight: 700;
  color: var(--text); margin-bottom: 6px;
}

.upload-overlay-filename {
  font-size: 12.5px; color: var(--text-muted);
  margin-bottom: 22px;
  word-break: break-all;
}

.upload-overlay-track {
  height: 10px;
  background: var(--border);
  border-radius: 99px; overflow: hidden;
  margin-bottom: 10px;
}

.upload-overlay-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dark) 0%, var(--accent) 100%);
  border-radius: 99px;
  width: 0%;
  transition: width .25s ease;
}

.upload-overlay-pct {
  font-size: 26px; font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 20px;
  line-height: 1;
}

.upload-overlay-warn {
  font-size: 12px; color: #92400e;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 11px 14px;
  display: flex; align-items: flex-start; gap: 8px;
  text-align: left; line-height: 1.5;
}

.upload-overlay-warn i { margin-top: 1px; flex-shrink: 0; }

/* ==============================
   ARQUIVOS
   ============================== */
.file-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 8px;
  background: white; margin-bottom: 8px;
  text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s;
}

.file-item:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--text);
}

.file-item-icon { font-size: 22px; flex-shrink: 0; color: var(--accent-dark); }
.file-item-name { font-weight: 600; font-size: 13.5px; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-item-size { font-size: 11.5px; color: var(--text-muted); white-space: nowrap; }

/* ==============================
   UPLOAD ZONE
   ============================== */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all .2s;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.upload-zone i { font-size: 36px; color: var(--text-muted); display: block; margin-bottom: 10px; }
.upload-zone p { margin: 0; font-size: 13.5px; color: var(--text-muted); }
.upload-zone span { font-size: 12px; color: var(--accent-dark); font-weight: 600; }

/* ==============================
   PÁGINA DE LOGIN
   ============================== */
body.login-body {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
}

.login-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

.login-brand-panel {
  flex: 0 0 44%;
  background:
    linear-gradient(150deg, rgba(10,15,30,.96) 0%, rgba(12,45,82,.93) 55%, rgba(26,74,122,.88) 100%),
    url('../img/hero-login.jpg') center / cover no-repeat;
  background-color: #0c2d52;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
  border-right: 1px solid rgba(201,169,110,.15);
}

.login-brand-panel::before {
  content: '';
  position: absolute; top: -80px; right: -80px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(201,169,110,.10) 0%, transparent 65%);
  pointer-events: none;
}

.login-brand-panel::after {
  content: '';
  position: absolute; bottom: -80px; left: -80px;
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(201,169,110,.07) 0%, transparent 65%);
  pointer-events: none;
}

.login-brand-content {
  position: relative; z-index: 1;
  text-align: center;
}

.login-brand-content img { max-width: 220px; margin-bottom: 36px; }

.login-brand-content h2 {
  color: #e2c99a; font-size: 20px; font-weight: 600;
  margin-bottom: 12px; line-height: 1.4;
}

.login-brand-content p {
  color: rgba(255,255,255,.50);
  font-size: 13.5px; line-height: 1.8;
  max-width: 300px;
}

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

.login-features li {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,.7);
  font-size: 13px; margin-bottom: 10px;
}

.login-features li i { color: #c9a96e; width: 16px; }

.login-form-panel {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background: white;
}

.login-form-box {
  width: 100%; max-width: 380px;
}

.login-form-box h3 {
  font-size: 22px; font-weight: 700;
  margin-bottom: 4px; color: var(--text);
}

.login-form-box .subtitle {
  font-size: 13.5px; color: var(--text-muted);
  margin-bottom: 30px;
}

/* ==============================
   BREADCRUMB
   ============================== */
.breadcrumb {
  background: none; padding: 0;
  margin-bottom: 18px; font-size: 12.5px;
}

.breadcrumb-item + .breadcrumb-item::before { color: var(--text-muted); }
.breadcrumb-item a { color: var(--accent); text-decoration: none; }
.breadcrumb-item.active { color: var(--text-muted); }

/* ==============================
   ESTADO VAZIO
   ============================== */
.empty-state {
  text-align: center; padding: 50px 20px;
}

.empty-state i { font-size: 44px; color: #cbd5e1; display: block; margin-bottom: 14px; }
.empty-state h5 { font-size: 15px; color: var(--text-muted); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* ==============================
   PRIMEIRO ACESSO BANNER
   ============================== */
.first-access-banner {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
  font-size: 13.5px;
}

/* ==============================
   BARRA DE CONTEÚDO (aula view)
   ============================== */
.lesson-sidebar {
  width: 300px; flex-shrink: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  align-self: flex-start;
  position: sticky;
  top: 80px;
}

.lesson-sidebar-title {
  padding: 14px 16px;
  font-weight: 700; font-size: 13.5px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.lesson-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  font-size: 13px; color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}

.lesson-nav-item:hover { background: var(--accent-light); }
.lesson-nav-item.active { background: var(--accent-light); color: var(--accent-dark); font-weight: 600; }
.lesson-nav-item:last-child { border-bottom: none; }

.lesson-nav-mod {
  padding: 8px 16px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--text-muted); background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

/* ==============================
   UTILITÁRIOS
   ============================== */
.gap-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.text-truncate-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.section-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

/* ==============================
   SIDEBAR DO CALENDÁRIO
   ============================== */
.cal-sidebar {
  width: 230px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  align-self: flex-start;
}

.cal-sidebar-header {
  padding: 12px 14px;
  font-weight: 700; font-size: 12.5px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.cal-sidebar-link {
  font-size: 11px; color: var(--accent);
  font-weight: 600; text-decoration: none;
}

.cal-sidebar-link:hover { text-decoration: underline; }

.cal-sidebar-event {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.cal-sidebar-event:last-child { border-bottom: none; }

.cal-sidebar-date {
  width: 34px; height: 34px;
  border-radius: 6px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  font-weight: 700; font-size: 9px;
  line-height: 1.2; text-align: center;
}

.cal-sidebar-date span:first-child { font-size: 15px; }

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

.cal-sidebar-titulo {
  font-size: 12.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text); margin-bottom: 3px;
}

.cal-sidebar-tag {
  font-size: 10px; padding: 1px 6px;
  border-radius: 20px; font-weight: 600;
  display: inline-block;
}

.cal-sidebar-range {
  font-size: 10.5px; color: var(--text-muted); margin-top: 2px;
}

.cal-sidebar-empty {
  padding: 28px 16px; text-align: center;
  font-size: 12px; color: var(--text-muted);
  display: flex; flex-direction: column;
  align-items: center; gap: 10px;
}

.cal-sidebar-empty i { font-size: 26px; color: var(--border); }

/* Wrappers de layout com sidebar de calendário */
.aula-flex-layout,
.curso-with-cal {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.aula-main-col,
.curso-cal-main {
  flex: 1;
  min-width: 0;
}

/* ==============================
   LAYOUT DOIS PAINÉIS (curso.php)
   ============================== */
.curso-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.curso-modulos-col {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.curso-aulas-col {
  flex: 1;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
  min-height: 260px;
}

.curso-modulo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: white;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
  box-shadow: var(--shadow);
  user-select: none;
}

.curso-modulo-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.curso-modulo-item.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.curso-modulo-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
  transition: background .15s;
}

.curso-modulo-item.active .curso-modulo-num { background: var(--accent-dark); }

.curso-modulo-thumb {
  width: 40px; height: 40px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

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

.curso-modulo-titulo {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  color: var(--text);
}

.curso-modulo-meta {
  font-size: 12px; color: var(--text-muted); margin-top: 3px;
}

.curso-modulo-progress {
  height: 3px;
  background: rgba(6,182,212,.15);
  border-radius: 2px;
  margin-top: 7px;
  overflow: hidden;
}

.curso-modulo-progress-bar {
  height: 100%;
  background: var(--success);
  border-radius: 2px;
}

.curso-modulo-arrow {
  font-size: 11px; color: var(--text-muted);
  flex-shrink: 0;
  transition: transform .2s, color .15s;
}

.curso-modulo-item.active .curso-modulo-arrow {
  color: var(--accent-dark);
  transform: rotate(90deg);
}

.curso-aulas-header {
  padding: 16px 20px;
  font-weight: 700; font-size: 14.5px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.curso-aulas-list { display: flex; flex-direction: column; }

.curso-aula-item {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none; color: var(--text);
  transition: background .15s;
  font-size: 13.5px;
}

.curso-aula-item:last-child { border-bottom: none; }
.curso-aula-item:hover { background: var(--accent-light); color: var(--text); }
.curso-aula-item.concluida { color: var(--text-muted); }

.curso-aula-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--border); color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}

.curso-aula-titulo { flex: 1; min-width: 0; }

.curso-aulas-placeholder {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted); text-align: center;
  min-height: 200px;
}

.curso-aulas-placeholder i {
  font-size: 32px; margin-bottom: 12px; color: var(--border);
}

.curso-aulas-placeholder p { font-size: 13px; margin: 0; }

.curso-aulas-empty {
  padding: 40px 20px; text-align: center;
  font-size: 13px; color: var(--text-muted);
}

/* ==============================
   BLOCO DE NOTAS FLUTUANTE
   ============================== */
.notes-fab {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent); color: white;
  border: none; font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(6,182,212,.45);
  transition: transform .2s, background .2s, box-shadow .2s;
  z-index: 500;
}

.notes-fab:hover {
  background: var(--accent-dark);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(6,182,212,.55);
}

.notes-panel {
  position: fixed;
  top: 0; right: 0;
  width: 360px; height: 100vh;
  background: white;
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,.12);
  z-index: 600;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}

.notes-panel.open { transform: translateX(0); }

.notes-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.22);
  z-index: 590;
  opacity: 0; pointer-events: none;
  transition: opacity .3s;
}

.notes-backdrop.open { opacity: 1; pointer-events: auto; }

.notes-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 700; font-size: 14px;
  flex-shrink: 0; background: #f8fafc;
}

.notes-close-btn {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 16px; padding: 4px 6px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}

.notes-close-btn:hover { background: var(--border); color: var(--text); }

.notes-panel-body {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}

.notes-textarea {
  flex: 1; border: none; outline: none;
  resize: none; padding: 20px;
  font-size: 13.5px; line-height: 1.75;
  color: var(--text); font-family: inherit;
  background: white;
}

.notes-panel-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  background: #f8fafc; flex-shrink: 0;
}

.notes-save-status { font-size: 11.5px; color: var(--text-muted); }

/* ==============================
   RESPONSIVO
   ============================== */
@media (max-width: 991.98px) {
  .layout-wrapper { padding-top: 56px; }
  .main-content { margin-left: 0; }
  .page-header { padding: 14px 16px; top: 56px; }
  .page-body { padding: 20px 16px; }
  .login-brand-panel { display: none; }
  .login-form-panel { padding: 32px 16px; background: var(--bg); }
  .login-form-box { max-width: 420px; }

  .lesson-sidebar { width: 100%; position: static; }

  .curso-layout { flex-direction: column; }
  .curso-modulos-col { width: 100%; flex: none; }
  .curso-aulas-col { width: 100%; position: static; }

  .cal-sidebar { display: none; }
  .aula-flex-layout, .curso-with-cal { display: block; }
}

@media (max-width: 575.98px) {
  .stat-card { padding: 14px 16px; gap: 12px; }
  .stat-icon { width: 42px; height: 42px; font-size: 17px; }
  .stat-value { font-size: 22px; }
  .page-title { font-size: 16px; }
  .btn { padding: 7px 14px; }
  .notes-panel { width: 100%; }
  .notes-fab { bottom: 20px; right: 20px; width: 48px; height: 48px; font-size: 18px; }
}
