/* =============================================
  TEAM LEGIONARIO — ÁREA DO ALUNO
  Italia Theme (Branco, Vermelho e Verde)
  Color Palette: #FFFFFF (white), #C62839 (red), #0F5A30 (green)
  ============================================= */

:root {
  /* Core Brand Colors */
  --white: #FFFFFF;
  --silver: #E8F4EC;
  --silver-light: #F2FAF5;
  --silver-pale: #FFFFFF;
  --blue: #C62839;
  --blue-dark: #9E1D2A;
  --blue-light: #E45C6B;
  --blue-mid: #1E6B3A;
  --navy: #0F5A30;
  --navy-2: #0A3F21;

  /* Neutral */
  --dark: #13251B;
  --dark-2: #1F382A;
  --gray: #6B7F73;
  --gray-light: #F7FBF8;
  --gray-border: #D7E6DD;

  /* Status */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #2E7D32;

  /* Layout */
  --sidebar-width: 260px;
  --header-height: 64px;
  --transition: all 0.3s ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(19,37,27,0.1);
  --shadow: 0 4px 12px rgba(19,37,27,0.08), 0 1px 3px rgba(19,37,27,0.05);
  --shadow-lg: 0 10px 30px rgba(19,37,27,0.14);
  --shadow-blue: 0 4px 20px rgba(198,40,57,0.3);

  /* Radius */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

/* ---- RESET & BASE ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--silver-pale);
  color: var(--dark);
  line-height: 1.6;
  font-size: 14px;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: inherit;
  outline: none;
}

/* =============================================
   LAYOUT: SIDEBAR + MAIN
   ============================================= */

.app-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  width: 100%;
}

/* ---- SIDEBAR ---- */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 1000;
  transition: var(--transition);
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid rgba(198,40,57,0.15);
}

/* Subtle sidebar shimmer line */
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, rgba(198,40,57,0.4), transparent);
  pointer-events: none;
}

.sidebar-header {
  padding: 20px 16px;
  border-bottom: 1px solid rgba(198,40,57,0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(198,40,57,0.06);
  min-height: var(--header-height);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: contain;
  background: var(--dark-2);
  padding: 4px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(15,90,48,0.25);
}

.sidebar-brand {
  flex: 1;
  overflow: hidden;
}

.sidebar-brand h2 {
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-brand span {
  color: var(--silver);
  font-size: 11px;
  font-weight: 400;
  opacity: 0.7;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--white);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
  flex-shrink: 0;
}

.sidebar-close:hover { background: rgba(198,40,57,0.2); }

/* User Profile in Sidebar */
.sidebar-user {
  padding: 16px;
  border-bottom: 1px solid rgba(198,40,57,0.12);
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(198,40,57,0.4);
  border: 2px solid rgba(198,40,57,0.3);
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-info strong {
  color: var(--white);
  font-size: 13px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info small {
  color: var(--silver);
  font-size: 11px;
  opacity: 0.7;
}

/* Nav Menu */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-section {
  margin-bottom: 4px;
}

.nav-section-title {
  color: rgba(232,244,236,0.5);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: rgba(232,244,236,0.7);
  font-size: 13.5px;
  font-weight: 500;
  transition: var(--transition);
  border-left: 3px solid transparent;
  position: relative;
  cursor: pointer;
}

.nav-item:hover {
  color: var(--white);
  background: rgba(198,40,57,0.08);
  border-left-color: rgba(198,40,57,0.5);
}

.nav-item.active {
  color: var(--white);
  background: rgba(198,40,57,0.18);
  border-left-color: var(--blue);
}

.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.nav-item .nav-badge {
  margin-left: auto;
  background: var(--blue);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(198,40,57,0.12);
}

.btn-logout {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(239,68,68,0.08);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  border: 1px solid rgba(239,68,68,0.15);
}

.btn-logout:hover {
  background: rgba(239,68,68,0.18);
  color: #fca5a5;
}

/* ---- MAIN CONTENT ---- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  transition: var(--transition);
  min-width: 0;
  overflow-x: hidden;
  width: calc(100% - var(--sidebar-width));
}

/* ---- TOPBAR ---- */
.topbar {
  height: var(--header-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  color: var(--dark);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: var(--transition);
}

.menu-toggle:hover { background: var(--gray-light); }

.topbar-title h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
}

.topbar-title p {
  font-size: 12px;
  color: var(--gray);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-btn {
  background: none;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 17px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.topbar-btn:hover {
  background: var(--gray-light);
  color: var(--dark);
}

.topbar-btn .notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--blue);
  border-radius: 50%;
  border: 2px solid var(--white);
}

.topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: 2px solid var(--silver);
  box-shadow: 0 2px 8px rgba(198,40,57,0.3);
}

/* ---- PAGE CONTENT ---- */
.page-content {
  flex: 1;
  padding: 24px 24px 40px;
  max-width: 1100px;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow-x: hidden;
}

/* =============================================
   COMPONENTS
   ============================================= */

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid rgba(208,220,233,0.5);
}

.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--gray-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-header h3 i {
  color: var(--blue);
}

.card-body {
  padding: 22px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  transition: var(--transition);
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: var(--white);
  border-color: transparent;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--blue-light), var(--blue));
  transform: translateY(-1px);
  box-shadow: var(--shadow-blue);
}

.btn-secondary {
  background: var(--silver-light);
  color: var(--blue-mid);
  border-color: var(--gray-border);
}

.btn-secondary:hover {
  background: var(--silver);
  color: var(--navy);
  border-color: var(--silver);
}

.btn-outline {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}

.btn-outline:hover {
  background: var(--blue);
  color: var(--white);
}

.btn-ghost {
  background: var(--gray-light);
  color: var(--gray);
  border-color: var(--gray-border);
}

.btn-ghost:hover {
  background: var(--gray-border);
  color: var(--dark);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 15px;
}

.btn-block { width: 100%; justify-content: center; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef9c3; color: #a16207; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-info { background: #dbeafe; color: #1d4ed8; }
.badge-gray { background: var(--gray-light); color: var(--gray); }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-blue { background: #dbeafe; color: var(--blue-dark); }
.badge-silver { background: var(--silver-light); color: var(--blue-mid); }

/* Forms */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}

.form-label span.req { color: var(--blue); margin-left: 2px; }

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--dark);
  background: var(--white);
  transition: var(--transition);
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(198,40,57,0.12);
}

.form-control::placeholder { color: #adb5bd; }

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

.form-hint {
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}

/* Divider */
.divider {
  height: 1px;
  background: var(--gray-border);
  margin: 20px 0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray);
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.3;
  display: block;
}

.empty-state h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}

.empty-state p { font-size: 13px; }

/* Loading Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2.5px solid var(--gray-border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}

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

/* Overlay / Backdrop */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.55);
  z-index: 999;
  backdrop-filter: blur(2px);
}

.overlay.active { display: block; }

/* =============================================
   MODAL
   ============================================= */
.modal-wrapper {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-wrapper.active { display: flex; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10,22,40,0.6);
  backdrop-filter: blur(3px);
}

.modal {
  position: relative;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  z-index: 1;
  animation: modalIn 0.25s ease;
  border: 1px solid var(--gray-border);
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--gray-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-header h3 i { color: var(--blue); }

.modal-close {
  background: var(--gray-light);
  border: none;
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 16px;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:hover { background: var(--gray-border); color: var(--dark); }

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* =============================================
   UPLOAD AREA
   ============================================= */
.upload-area {
  border: 2px dashed var(--gray-border);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: var(--silver-pale);
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--blue);
  background: rgba(30,107,58,0.06);
}

.upload-area i {
  font-size: 40px;
  color: var(--blue);
  margin-bottom: 12px;
  display: block;
}

.upload-area h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 6px;
}

.upload-area p {
  font-size: 12.5px;
  color: var(--gray);
}

.upload-area .btn { margin-top: 14px; }

/* =============================================
   TIMELINE / STATUS BAR
   ============================================= */
.status-timeline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  padding: 8px 0;
  overflow-x: auto;
}

.status-timeline::before {
  content: '';
  position: absolute;
  top: 28px;
  left: 24px;
  right: 24px;
  height: 3px;
  background: var(--gray-border);
  z-index: 0;
}

.timeline-progress {
  position: absolute;
  top: 28px;
  left: 24px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue-light));
  z-index: 1;
  transition: width 0.8s ease;
  border-radius: 2px;
}

.timeline-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 90px;
}

.step-icon {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: var(--white);
  border: 3px solid var(--gray-border);
  color: var(--gray);
  transition: var(--transition);
  position: relative;
}

.timeline-step.done .step-icon {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

.timeline-step.active .step-icon {
  background: var(--white);
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 0 0 4px rgba(198,40,57,0.15);
}

.step-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--gray);
  text-align: center;
  line-height: 1.3;
  max-width: 82px;
}

.timeline-step.done .step-label,
.timeline-step.active .step-label {
  color: var(--dark);
}

.timeline-step.active .step-label {
  color: var(--blue);
}

/* =============================================
   FEED POSTS
   ============================================= */
.feed-post {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
  border-left: 4px solid transparent;
  transition: var(--transition);
  border: 1px solid rgba(208,220,233,0.6);
  border-left: 4px solid transparent;
}

.feed-post:hover { box-shadow: var(--shadow-lg); }
.feed-post.type-update { border-left-color: var(--blue); }
.feed-post.type-alert { border-left-color: var(--warning); }
.feed-post.type-success { border-left-color: var(--success); }
.feed-post.type-tip { border-left-color: var(--silver); }

.feed-post-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.feed-post-avatar {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}

.feed-post-meta { flex: 1; }

.feed-post-meta strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  display: block;
}

.feed-post-meta span {
  font-size: 12px;
  color: var(--gray);
}

.feed-post-content {
  font-size: 14px;
  color: var(--dark-2);
  line-height: 1.7;
}

.feed-post-footer {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =============================================
   PROGRESS BAR
   ============================================= */
.progress-bar-wrap {
  background: var(--gray-border);
  border-radius: 8px;
  height: 8px;
  overflow: hidden;
  flex: 1;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--blue-dark), var(--blue-light));
  transition: width 0.6s ease;
}

.progress-bar-fill.green {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

.progress-bar-fill.yellow {
  background: linear-gradient(90deg, #f59e0b, #fcd34d);
}

.progress-bar-fill.red {
  background: linear-gradient(90deg, var(--danger), #fca5a5);
}

/* =============================================
   EXAM LIST ITEM
   ============================================= */
.exam-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--white);
  transition: var(--transition);
}

.exam-item:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }

.exam-icon {
  width: 40px; height: 40px;
  background: rgba(198,40,57,0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 18px;
  flex-shrink: 0;
}

.exam-info { flex: 1; }

.exam-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark);
}

.exam-info small {
  font-size: 12px;
  color: var(--gray);
}

.exam-sla {
  flex: 1;
  max-width: 160px;
}

.exam-sla span {
  display: block;
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 4px;
}

/* =============================================
   FILE LIST ITEM
   ============================================= */
.file-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  transition: var(--transition);
  background: var(--white);
}

.file-item:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }

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

.file-icon.pdf { background: #fee2e2; color: #ef4444; }
.file-icon.doc { background: #dbeafe; color: var(--blue); }
.file-icon.img { background: #dcfce7; color: #22c55e; }
.file-icon.other { background: var(--gray-light); color: var(--gray); }

.file-info { flex: 1; }

.file-info strong {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dark);
}

.file-info p {
  font-size: 12px;
  color: var(--gray);
  margin: 2px 0;
}

.file-info small {
  font-size: 11.5px;
  color: #9ca3af;
}

/* =============================================
   DOUBT / SOLICITAÇÃO ITEM
   ============================================= */
.doubt-item {
  padding: 16px 18px;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  background: var(--white);
  transition: var(--transition);
}

.doubt-item:hover { border-color: var(--blue); box-shadow: var(--shadow-sm); }

.doubt-item-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.doubt-item-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  flex: 1;
}

.doubt-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.doubt-meta span {
  font-size: 12px;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 4px;
}

.doubt-message {
  font-size: 13.5px;
  color: #4b5563;
  line-height: 1.6;
}

.doubt-answer {
  margin-top: 12px;
  padding: 12px 14px;
  background: #f0fdf4;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--success);
}

.doubt-answer strong {
  font-size: 12px;
  color: #15803d;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.doubt-answer p {
  font-size: 13px;
  color: #374151;
  line-height: 1.6;
}

/* =============================================
   FAQ ACCORDION
   ============================================= */
.faq-item {
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  transition: var(--transition);
}

.faq-item.open { border-color: var(--blue); }

.faq-question {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  background: var(--white);
  transition: var(--transition);
  gap: 12px;
}

.faq-question:hover { background: var(--silver-pale); }
.faq-item.open .faq-question { background: rgba(198,40,57,0.05); }

.faq-question h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--dark);
  flex: 1;
  line-height: 1.4;
}

.faq-question i {
  color: var(--blue);
  font-size: 16px;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item.open .faq-question i { transform: rotate(180deg); }

.faq-answer {
  display: none;
  padding: 0 18px 16px;
  background: rgba(30,107,58,0.04);
}

.faq-answer p {
  font-size: 13.5px;
  color: #4b5563;
  line-height: 1.7;
  padding-top: 12px;
  border-top: 1px solid rgba(198,40,57,0.1);
}

/* =============================================
   PENDÊNCIAS
   ============================================= */
.pendencia-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  border: 1.5px solid var(--gray-border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  background: var(--white);
  transition: var(--transition);
}

.pendencia-item:hover { border-color: var(--blue); }

.pendencia-item.urgente { border-left: 4px solid var(--danger); }
.pendencia-item.normal { border-left: 4px solid var(--warning); }

.pendencia-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: rgba(198,40,57,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 18px;
  flex-shrink: 0;
}

.pendencia-icon.danger {
  background: #fee2e2;
  color: var(--danger);
}

.pendencia-info { flex: 1; }

.pendencia-info strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 4px;
}

.pendencia-info p {
  font-size: 13px;
  color: var(--gray);
  line-height: 1.5;
}

/* =============================================
   CONTA / PROFILE
   ============================================= */
.profile-banner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 50%, var(--blue-mid) 100%);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.profile-banner::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(198,40,57,0.18) 0%, transparent 70%);
  border-radius: 50%;
}

.profile-banner-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
  border: 3px solid rgba(232,244,236,0.45);
  flex-shrink: 0;
}

.profile-banner-info h2 {
  color: var(--white);
  font-size: 20px;
  font-weight: 700;
}

.profile-banner-info p {
  color: var(--silver);
  font-size: 13px;
  margin-top: 4px;
  opacity: 0.85;
}

.profile-banner-info .badges { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* =============================================
   CONVITES
   ============================================= */
.invite-card {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue-mid) 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  text-align: center;
  color: var(--white);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.invite-card::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(198,40,57,0.22) 0%, transparent 70%);
  border-radius: 50%;
}

.invite-code-box {
  background: rgba(255,255,255,0.1);
  border: 1px dashed rgba(232,244,236,0.5);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  margin: 16px auto;
  max-width: 320px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.invite-code-box span {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--silver);
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-align: center;
  border-top: 3px solid var(--gray-border);
  transition: var(--transition);
  border: 1px solid rgba(208,220,233,0.6);
  border-top: 3px solid var(--gray-border);
}

.stat-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.stat-card.orange { border-top-color: var(--blue); }
.stat-card.green { border-top-color: var(--success); }
.stat-card.blue { border-top-color: var(--blue); }
.stat-card.yellow { border-top-color: var(--warning); }

.stat-card .stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--dark);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--gray);
  margin-top: 4px;
}

/* =============================================
   LOGIN PAGE
   ============================================= */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  background: var(--white);
}

.login-left {
  flex: 1;
  background: linear-gradient(145deg, var(--navy) 0%, var(--navy-2) 50%, var(--blue-mid) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(198,40,57,0.12) 0%, transparent 70%);
  border-radius: 50%;
}

/* Floating orbs for premium feel */
.login-left::after {
  content: '';
  position: absolute;
  bottom: -60px; right: -60px;
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(30,107,58,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

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

.login-logo {
  width: 140px;
  height: 140px;
  object-fit: contain;
  background: var(--dark-2);
  border-radius: var(--radius-lg);
  padding: 10px;
  margin-bottom: 28px;
  filter: drop-shadow(0 8px 24px rgba(198,40,57,0.3));
}

.login-left-content h1 {
  color: var(--white);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.2;
}

.login-left-content h1 span { color: var(--blue-light); }

.login-left-content p {
  color: var(--silver);
  font-size: 15px;
  opacity: 0.8;
  line-height: 1.6;
  max-width: 340px;
}

.login-features {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  width: 100%;
  max-width: 320px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(232,244,236,0.8);
  font-size: 13.5px;
}

.login-feature i {
  width: 32px; height: 32px;
  background: rgba(198,40,57,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-light);
  font-size: 14px;
  flex-shrink: 0;
}

.login-right {
  width: 440px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: var(--white);
}

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

.login-form-box .login-mobile-logo {
  display: none;
  text-align: center;
  margin-bottom: 28px;
}

.login-mobile-logo img {
  width: 90px;
  height: 90px;
  object-fit: contain;
  background: var(--dark-2);
  border-radius: var(--radius);
  padding: 8px;
}

.login-form-box h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--dark);
  margin-bottom: 6px;
}

.login-form-box p.subtitle {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 32px;
}

.input-icon-wrap {
  position: relative;
}

.input-icon-wrap i.icon-left {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: 15px;
}

.input-icon-wrap .form-control {
  padding-left: 40px;
}

.input-icon-wrap .toggle-password {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 15px;
  padding: 2px;
}

.forgot-link {
  text-align: right;
  margin-top: -10px;
  margin-bottom: 20px;
}

.forgot-link a {
  font-size: 12.5px;
  color: var(--blue);
  font-weight: 500;
}

.forgot-link a:hover { text-decoration: underline; }

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--gray);
  font-size: 12px;
}

.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-border);
}

.login-footer-text {
  text-align: center;
  margin-top: 24px;
  font-size: 12.5px;
  color: var(--gray);
}

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

/* =============================================
   SECTION HEADERS
   ============================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-header h2 i { color: var(--blue); }

.section-header .actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* =============================================
   INFO BOX
   ============================================= */
.info-box {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.info-box i { font-size: 16px; flex-shrink: 0; margin-top: 1px; }

.info-box.info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.info-box.warning {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.info-box.success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #14532d;
}

.info-box ul {
  margin-top: 6px;
  padding-left: 16px;
}

.info-box ul li {
  list-style: disc;
  margin-bottom: 3px;
  font-size: 12.5px;
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--navy);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 250px;
  max-width: 360px;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  border: 1px solid rgba(198,40,57,0.2);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.info { border-left: 4px solid var(--blue); }

.toast i { font-size: 16px; }
.toast.success i { color: var(--success); }
.toast.error i { color: var(--danger); }
.toast.warning i { color: var(--warning); }
.toast.info i { color: var(--blue); }

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

/* =============================================
   PREMIUM DECORATIVE ELEMENTS
   ============================================= */

/* Glossy card header accent */
.card-header-accent {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue-mid) 100%);
  padding: 24px;
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.card-header-accent::after {
  content: '';
  position: absolute;
  right: -30px; top: -30px;
  width: 150px; height: 150px;
  background: radial-gradient(circle, rgba(198,40,57,0.2) 0%, transparent 70%);
  border-radius: 50%;
}

/* Silver shimmer background for special sections */
.silver-bg {
  background: linear-gradient(135deg, var(--silver-pale) 0%, var(--silver-light) 100%);
}

/* Premium badge */
.premium-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--navy), var(--blue-mid));
  color: var(--silver);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* =============================================
   RESPONSIVE — MOBILE FIRST
   ============================================= */

/* ---- TABLET: ≤ 1024px ---- */
@media (max-width: 1024px) {
  .page-content { padding: 20px 18px 36px; }
  .login-left { display: none; }
  .login-right { width: 100%; }
  .login-form-box .login-mobile-logo { display: block; }
}

/* ---- MOBILE: ≤ 768px ---- */
@media (max-width: 768px) {

  .sidebar {
    position: fixed;
    left: -100%;
    width: 82vw;
    max-width: 300px;
    height: 100dvh;
    z-index: 1100;
    box-shadow: 4px 0 24px rgba(10,22,40,0.4);
  }
  .sidebar.open { left: 0; }
  .sidebar-close { display: flex !important; }

  .main-content {
    margin-left: 0;
    width: 100%;
    min-width: 0;
  }

  .menu-toggle { display: flex; }
  .topbar { padding: 0 14px; height: 56px; }
  .topbar-title h1 { font-size: 16px; }
  .topbar-title p { display: none; }
  .topbar-btn { width: 34px; height: 34px; font-size: 15px; }
  .topbar-avatar { width: 32px; height: 32px; font-size: 13px; }

  .page-content {
    padding: 14px 12px 80px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .card { border-radius: 10px; }
  .card-body { padding: 14px; }
  .card-header { padding: 14px 16px; }

  .stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .stat-card { padding: 14px 10px; }
  .stat-card .stat-num { font-size: 22px; }
  .stat-card .stat-label { font-size: 11px; }

  .status-timeline-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }
  .status-timeline { min-width: 500px; }
  .step-label { font-size: 10px; max-width: 72px; }
  .step-icon { width: 30px; height: 30px; font-size: 12px; }

  .feed-post { padding: 14px; border-radius: 10px; }
  .feed-post-avatar { width: 34px; height: 34px; font-size: 14px; border-radius: 8px; }
  .feed-post-meta strong { font-size: 13px; }
  .feed-post-meta span { font-size: 11px; }
  .feed-post-content { font-size: 13px; }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .section-header h2 { font-size: 15px; }
  .section-header .actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .section-header .actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 12px;
    padding: 8px 10px;
  }

  .btn { font-size: 13px; padding: 8px 14px; }
  .btn-lg { padding: 11px 20px; font-size: 14px; }

  .modal-wrapper { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100%;
    width: 100%;
    margin: 0;
    border-radius: 18px 18px 0 0;
    max-height: 92dvh;
  }
  .modal-body { padding: 18px 16px; }
  .modal-header { padding: 16px 18px; }
  .modal-footer {
    padding: 14px 16px;
    flex-direction: column;
    gap: 8px;
  }
  .modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .upload-area { padding: 24px 16px; }
  .upload-area i { font-size: 28px; }
  .upload-area h4 { font-size: 13px; }

  .form-control { font-size: 16px; }
  select.form-control { font-size: 16px; }

  .doubt-item { padding: 12px 14px; }
  .doubt-item-header { flex-direction: column; gap: 8px; }
  .doubt-item-header h4 { font-size: 13.5px; }

  .file-item {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px 14px;
  }
  .file-item .btn { width: 100%; justify-content: center; margin-top: 4px; }
  .file-info { min-width: 0; }
  .file-info strong { font-size: 13px; white-space: normal; word-break: break-word; }

  .exam-item {
    flex-wrap: wrap;
    padding: 12px 14px;
    gap: 10px;
  }
  .exam-sla { max-width: 100%; width: 100%; order: 3; }

  .pendencia-item { flex-wrap: wrap; padding: 12px 14px; gap: 10px; }
  .pendencia-item > .btn { width: 100%; justify-content: center; }

  .profile-banner {
    flex-direction: column;
    text-align: center;
    padding: 22px 18px;
    gap: 14px;
  }
  .profile-banner-info .badges { justify-content: center; }
  .profile-banner > .btn { width: 100%; justify-content: center; }

  .invite-card { padding: 20px 16px; }
  .invite-code-box { padding: 10px 14px; }
  .invite-code-box span { font-size: 16px; letter-spacing: 0.06em; }

  .faq-question { padding: 13px 14px; }
  .faq-question h4 { font-size: 13px; }
  .faq-answer { padding: 0 14px 14px; }
  .faq-answer p { font-size: 13px; }

  .login-right { padding: 28px 20px; }
  .login-form-box h2 { font-size: 20px; }

  .info-box { font-size: 12.5px; padding: 12px 14px; }
  .badge { font-size: 11px; padding: 3px 8px; }
}

/* ---- SMALL MOBILE: ≤ 430px ---- */
@media (max-width: 430px) {
  body { font-size: 13.5px; }
  .topbar { padding: 0 12px; height: 52px; }
  .topbar-title h1 { font-size: 15px; }
  .page-content { padding: 12px 10px 80px; }
  .card-header { padding: 12px 14px; }
  .card-body { padding: 12px; }
  .stats-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-card { padding: 12px 8px; }
  .stat-card .stat-num { font-size: 20px; }
  .btn-lg { padding: 10px 18px; font-size: 13.5px; }
}
