/* =========================================================
   STYLE - DISCURSIVAS SENSITIVA (V4 - BRANDING OFICIAL)
   Design Premium Dark Glassmorphism com Branding Corporativo
   ========================================================= */

:root {
    /* Paleta de Cores do Brand (Discursivas.com) */
    --brand-dark: #07040d; /* Fundo Ultra-Escuro */
    --brand-orange: #e85d04; /* Laranja Corporativo */
    --brand-orange-glow: rgba(232, 93, 4, 0.35);
    --brand-orange-light: #ff7d26;

    /* Estilo de Vidro Foscado (Glassmorphism) */
    --bg-card: rgba(15, 9, 28, 0.65);
    --border-color: rgba(255, 255, 255, 0.06);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    /* Cores das Disciplinas */
    --green: #10b981;
    --green-glow: rgba(16, 185, 129, 0.25);
    --blue: #06b6d4;
    --blue-glow: rgba(6, 182, 212, 0.25);
    --fisica: #a855f7;
    --fisica-glow: rgba(168, 85, 247, 0.25);
    --geografia: #2dd4bf;
    --geografia-glow: rgba(45, 212, 191, 0.25);

    /* Cores das Categorias do Oráculo */
    --color-sacred: #10b981;
    --color-hot: #f43f5e;
    --color-gangorra: #e85d04; /* Laranja para a Gangorra/Alternância */
    --color-fenix: #f59e0b;

    /* Tipografia e Bordas */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    background-color: var(--brand-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Efeitos Luminosos de Fundo (Neon Glows) - fixos para não somarem altura à página */
.bg-glow {
    position: fixed;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    opacity: 0.12;
    pointer-events: none;
}

.bg-glow-purple {
    top: -10%;
    left: -5%;
    background: #7c3aed;
}

.bg-glow-orange {
    bottom: -10%;
    right: -5%;
    background: var(--brand-orange);
}

/* Layout Container */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.app-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Glassmorphism Card Utility */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

.glass {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Typography Utilities */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
}

.accent-text {
    background: linear-gradient(135deg, var(--brand-orange-light), var(--brand-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-orange { color: var(--brand-orange-light); }
.text-green { color: var(--green); }
.text-blue { color: var(--blue); }
.text-fisica { color: var(--fisica); }
.text-geografia { color: var(--geografia); }

/* HEADER (Branding Corporativo Oficial) */
.app-header {
    position: relative;
    margin-bottom: 0.5rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border-color);
}

.app-header::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -1px;
    width: 130px;
    height: 2px;
    background: linear-gradient(90deg, var(--brand-orange), transparent);
    border-radius: 2px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.logo-discursivas {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
}

/* Logo em imagem (marca discreta no topo do header) */
.logo-discursivas-img {
    height: 1.6rem;
    width: auto;
    display: block;
    margin-bottom: 0.6rem;
}

.logo-dot {
    color: var(--brand-orange);
}

.brand-badge-sensitiva {
    background: linear-gradient(135deg, rgba(232, 93, 4, 0.2), rgba(232, 93, 4, 0.06));
    border: 1px solid rgba(232, 93, 4, 0.35);
    color: var(--brand-orange-light);
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    letter-spacing: 1.5px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.6rem;
    box-shadow: 0 0 18px rgba(232, 93, 4, 0.18);
}

.brand-badge-sensitiva i {
    font-size: 0.68rem;
    animation: pulse 2.4s infinite;
}

.brand h1 {
    font-size: 2.85rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.05;
}

/* Logo "Discursivas Sensitiva" em imagem — altura equivalente ao texto */
.brand-title {
    line-height: 1;
}

.logo-sensitiva-img {
    height: 2.85rem;
    width: auto;
    display: block;
}

.brand .subtitle {
    color: var(--text-secondary);
    font-size: 1.02rem;
    margin-top: 0.5rem;
    white-space: nowrap;
}

/* Course & Company Badge */
.course-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--brand-orange);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: var(--transition);
}

.course-info:hover {
    border-color: rgba(232, 93, 4, 0.35);
}

.course-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
}

.logo-10x {
    color: var(--text-primary);
}

.logo-10x-bold {
    color: var(--brand-orange-light);
    font-weight: 800;
}

.company-name {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

/* Botões de Matrícula (CTA do card UERJ10x) */
.enroll-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    width: 100%;
}

.btn-enroll {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.82rem;
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-enroll-primary {
    background: linear-gradient(135deg, var(--brand-orange), #b33600);
    color: #fff;
    box-shadow: 0 4px 14px rgba(232, 93, 4, 0.25);
}

.btn-enroll-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-enroll-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    border: 1px solid rgba(232, 93, 4, 0.35);
}

.btn-enroll-secondary:hover {
    background: rgba(232, 93, 4, 0.12);
    border-color: var(--brand-orange);
    color: var(--brand-orange-light);
}

/* CONTROLS PANEL */
.controls-panel {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    border-left: 4px solid var(--brand-orange);
}

.download-info {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.download-title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.download-free {
    font-size: 0.85rem;
    color: var(--green);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.data-status-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--brand-orange);
}

.status-dot.active {
    background: var(--green);
    box-shadow: 0 0 10px var(--green);
}

.pulsing {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.file-info-badge {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* BUTTONS */
.btn {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-orange), #b33600);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    filter: brightness(1.15);
}

.btn-primary:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-glow {
    box-shadow: 0 0 20px var(--brand-orange-glow);
}

.btn-glow:disabled {
    box-shadow: none;
}

/* STATS OVERVIEW */
.stats-overview {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
}

.stat-card {
    flex: 1 1 200px;
    min-width: 200px;
    max-width: 360px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.icon-orange {
    background: rgba(232, 93, 4, 0.1);
    color: var(--brand-orange-light);
    border: 1px solid rgba(232, 93, 4, 0.2);
}

.icon-green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--green);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.icon-blue {
    background: rgba(6, 182, 212, 0.1);
    color: var(--blue);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.icon-fisica {
    background: rgba(168, 85, 247, 0.1);
    color: var(--fisica);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.icon-geografia {
    background: rgba(45, 212, 191, 0.1);
    color: var(--geografia);
    border: 1px solid rgba(45, 212, 191, 0.2);
}

.stat-data {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* SELETOR DE VESTIBULAR (UERJ / Fuvest) */
.vestibular-switch-card {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.vestibular-switch-label {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.vestibular-switch {
    display: flex;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 0.4rem;
    border-radius: var(--radius-md);
    gap: 0.35rem;
}

.vest-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.7rem 2rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    transition: var(--transition);
}

.vest-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.vest-btn.active {
    background: linear-gradient(135deg, var(--brand-orange-light), var(--brand-orange));
    color: white;
    box-shadow: 0 6px 16px var(--brand-orange-glow);
}

@media (max-width: 640px) {
    .vestibular-switch { width: 100%; }
    .vest-btn { flex: 1; justify-content: center; padding: 0.7rem 1rem; }
}

/* TABS NAVIGATION */
.tabs-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tabs-nav {
    display: flex;
    padding: 0.5rem;
    gap: 0.5rem;
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 1rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    transition: var(--transition);
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-primary);
}

.tab-btn.active {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tab-btn[data-color="green"].active     { border-bottom: 3px solid var(--green);     color: var(--green); }
.tab-btn[data-color="blue"].active       { border-bottom: 3px solid var(--blue);      color: var(--blue); }
.tab-btn[data-color="fisica"].active     { border-bottom: 3px solid var(--fisica);    color: var(--fisica); }
.tab-btn[data-color="geografia"].active  { border-bottom: 3px solid var(--geografia); color: var(--geografia); }

.tab-content {
    display: none;
    flex-direction: column;
    gap: 2rem;
}

.tab-content.active {
    display: flex;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* UX REFINED - VIEW SELECTOR CARD (Aula vs Módulo) */
.view-selector-card {
    padding: 1.25rem 1.5rem;
}

.view-selector-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-selector-label {
    font-family: var(--font-heading);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-selector-buttons {
    display: flex;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    padding: 0.3rem;
    border-radius: var(--radius-md);
    gap: 0.25rem;
}

.selector-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.selector-btn:hover {
    color: var(--text-primary);
}

.selector-btn.active {
    background: var(--brand-orange);
    color: white;
    box-shadow: 0 4px 10px var(--brand-orange-glow);
}

/* PREDICTIONS GRID */
.predictions-grid {
    display: none;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

.predictions-grid.active {
    display: grid;
    animation: fadeIn 0.4s ease;
}

.prediction-category-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    border-top: 5px solid transparent;
    transition: var(--transition);
}

.prediction-category-card:hover {
    transform: translateY(-5px);
}

.border-sacred { border-top-color: var(--color-sacred); }
.border-hot { border-top-color: var(--color-hot); }
.border-gangorra { border-top-color: var(--color-gangorra); }
.border-fenix { border-top-color: var(--color-fenix); }

.category-header h3 {
    font-size: 1.35rem;
    margin-top: 0.4rem;
}

.category-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.2rem;
    line-height: 1.4;
}

/* Badges */
.badge {
    font-size: 0.7rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    width: fit-content;
}

.badge-sacred { background: rgba(16, 185, 129, 0.15); color: var(--color-sacred); }
.badge-hot { background: rgba(244, 63, 94, 0.15); color: var(--color-hot); }
.badge-gangorra { background: rgba(232, 93, 4, 0.15); color: var(--color-gangorra); }
.badge-fenix { background: rgba(245, 158, 11, 0.15); color: var(--color-fenix); }

/* LIST OF PREDICTION ITEMS */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.loading-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
}

.empty-placeholder {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1.5rem 0;
}

/* Recado quando nenhum tema atinge o corte de "sagrado" */
.sacred-note {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
    padding: 0.75rem 0.85rem;
    margin-bottom: 0.85rem;
    border-left: 3px solid var(--color-sacred);
    background: rgba(16, 185, 129, 0.06);
    border-radius: var(--radius-sm);
}

.sacred-note strong {
    color: var(--text-primary);
}

/* Assunto / Aula item card */
.item-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: var(--radius-sm);
    padding: 0.8rem;
    transition: var(--transition);
}

.item-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.08);
}

.item-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
}

.item-module {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.2rem;
    font-weight: 500;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
}

.item-freq {
    color: var(--text-secondary);
}

.item-chance {
    font-weight: 700;
}

.color-sacred .item-chance { color: var(--color-sacred); }
.color-hot .item-chance { color: var(--color-hot); }
.color-gangorra .item-chance { color: var(--color-gangorra); }
.color-fenix .item-chance { color: var(--color-fenix); }

.item-justification {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.03);
    padding: 0.4rem 0.6rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    line-height: 1.4;
}

/* CHARTS SECTION */
.charts-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.chart-card {
    padding: 2rem;
}

.chart-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Dynamic Modules Bar Chart */
.modules-chart-container {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.chart-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.chart-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    font-weight: 500;
}

.chart-row-title {
    color: var(--text-primary);
}

.chart-row-value {
    color: var(--text-secondary);
    font-weight: 600;
}

.chart-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50px;
    overflow: hidden;
    width: 100%;
}

.chart-bar-fill {
    height: 100%;
    border-radius: 50px;
    width: 0; /* Animado dinamicamente */
    transition: width 1s cubic-bezier(0.1, 0.8, 0.3, 1);
}

/* Barras do Gráfico em cores neons (por disciplina, via data-color) */
.tab-content[data-color="green"] .chart-bar-fill {
    background: linear-gradient(90deg, var(--green), #059669);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.tab-content[data-color="blue"] .chart-bar-fill {
    background: linear-gradient(90deg, var(--blue), #0891b2);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

.tab-content[data-color="fisica"] .chart-bar-fill {
    background: linear-gradient(90deg, var(--fisica), #7c3aed);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.tab-content[data-color="geografia"] .chart-bar-fill {
    background: linear-gradient(90deg, var(--geografia), #0d9488);
    box-shadow: 0 0 10px rgba(45, 212, 191, 0.3);
}

/* FOOTER */
.app-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* =========================================================
   PRINT LAYOUT - PDF PREMIUM COM BRANDING DISCURSIVAS.COM
   ========================================================= */
.print-only {
    display: none;
}

@page {
    size: A4;
    /* Topo e base com margem (respiro em TODA página, inclusive após quebras;
       a base também reserva espaço para o rodapé fixo). Laterais zeradas — o
       respiro lateral vem do padding de .print-only, evitando corte na direita. */
    margin: 14mm 0;
}

@media print {
    /* Garante que fundos e cores dos badges sejam impressos (Chrome/Safari/Firefox) */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    /* Ocultar interface normal */
    .app-container, .bg-glow {
        display: none !important;
    }

    body {
        background-color: white !important;
        color: #111827 !important;
        font-family: 'Inter', sans-serif;
        font-size: 10pt;
        line-height: 1.45;
        margin: 0;
        padding: 0;
    }

    .print-only {
        display: block !important;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0 12mm;
        overflow-wrap: break-word;
        word-break: break-word;
    }

    /* Trava de segurança: nada dentro do relatório pode exceder a largura da página */
    .print-only * {
        max-width: 100%;
    }

    /* Rodapé fixo — repete no fim de cada página impressa (dentro da margem inferior do @page) */
    .print-running-footer {
        position: fixed;
        bottom: 4mm;
        left: 12mm;
        right: 12mm;
        text-align: center;
        font-family: 'Outfit', sans-serif;
        font-size: 7pt;
        font-weight: 600;
        letter-spacing: 0.5px;
        color: #9ca3af;
    }

    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 3px solid var(--brand-orange);
        padding-bottom: 12px;
        margin-bottom: 18px;
    }

    .print-brand {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    /* Logo real (branca) sobre chip escuro para aparecer no fundo branco do PDF */
    .print-logo-chip {
        display: inline-flex;
        background-color: var(--brand-dark);
        padding: 9px 14px;
        border-radius: 6px;
    }

    .print-logo-img {
        height: 30px;
        width: auto;
        display: block;
    }

    .print-sub-brand {
        font-size: 8.5pt;
        color: #4b5563;
        margin-top: 2px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        font-weight: 500;
    }

    .print-badge-tag {
        font-family: 'Outfit', sans-serif;
        font-size: 11pt;
        font-weight: 800;
        color: var(--brand-orange);
        border: 1.5px solid var(--brand-orange);
        padding: 3px 10px;
        border-radius: 4px;
    }

    .print-meta-info {
        display: flex;
        flex-wrap: wrap;
        justify-content: space-between;
        gap: 4px 16px;
        background-color: #f3f4f6;
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 8pt;
        color: #374151;
        margin-bottom: 20px;
        font-weight: 500;
    }

    /* Legenda Metodológica */
    .print-methodology-card {
        background-color: #fafafa;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 15px;
        margin-bottom: 22px;
        page-break-inside: avoid;
    }

    .print-methodology-card h3 {
        font-family: 'Outfit', sans-serif;
        font-size: 11pt;
        color: var(--brand-dark);
        margin-bottom: 8px;
        border-bottom: 1px solid #e5e7eb;
        padding-bottom: 4px;
    }

    .methodology-intro {
        font-size: 8pt;
        color: #4b5563;
        margin-bottom: 12px;
    }

    .methodology-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .method-item {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .method-item p {
        font-size: 7.5pt;
        color: #4b5563;
        line-height: 1.3;
        margin: 0;
    }

    .print-tag-badge {
        font-size: 7pt;
        font-weight: 800;
        color: white;
        padding: 1px 5px;
        border-radius: 3px;
        width: fit-content;
        text-transform: uppercase;
    }

    .bg-green { background-color: #059669; }
    .bg-rose { background-color: #e11d48; }
    .bg-violet { background-color: #6d28d9; }
    .bg-amber { background-color: #d97706; }

    .print-divider {
        height: 1px;
        background: #e5e7eb;
        margin: 18px 0;
    }

    .print-subject-section {
        margin-bottom: 25px;
    }

    .print-subject-header {
        font-family: 'Outfit', sans-serif;
        font-size: 15pt;
        color: var(--brand-dark);
        border-bottom: 1.5px solid var(--brand-dark);
        padding-bottom: 4px;
        margin-bottom: 15px;
    }

    .print-level-section {
        margin-bottom: 20px;
    }

    .print-level-section h3 {
        font-family: 'Outfit', sans-serif;
        font-size: 11pt;
        color: #374151;
        background-color: #f3f4f6;
        padding: 5px 10px;
        border-radius: 4px;
        margin-bottom: 12px;
    }

    .print-category-group {
        margin-bottom: 15px;
        page-break-inside: avoid;
    }

    .print-category-group h4 {
        font-family: 'Outfit', sans-serif;
        font-size: 9.5pt;
        color: #111827;
        margin-bottom: 6px;
        border-left: 3px solid var(--brand-orange);
        padding-left: 8px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    /* Borda de cada categoria cor-coordenada com a legenda metodológica */
    .print-level-section .print-category-group:nth-of-type(1) h4 { border-left-color: #059669; }
    .print-level-section .print-category-group:nth-of-type(2) h4 { border-left-color: #e11d48; }
    .print-level-section .print-category-group:nth-of-type(3) h4 { border-left-color: #6d28d9; }
    .print-level-section .print-category-group:nth-of-type(4) h4 { border-left-color: #d97706; }

    .print-item-list {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    .print-item-card {
        background-color: #f9fafb;
        border: 1px solid #e5e7eb;
        border-left: 3px solid #9ca3af;
        border-radius: 5px;
        padding: 8px 10px;
        page-break-inside: avoid;
    }

    /* Borda lateral do card cor-coordenada com a categoria/legenda */
    .print-level-section .print-category-group:nth-of-type(1) .print-item-card { border-left-color: #059669; }
    .print-level-section .print-category-group:nth-of-type(2) .print-item-card { border-left-color: #e11d48; }
    .print-level-section .print-category-group:nth-of-type(3) .print-item-card { border-left-color: #6d28d9; }
    .print-level-section .print-category-group:nth-of-type(4) .print-item-card { border-left-color: #d97706; }

    .print-item-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 8px;
        font-size: 9pt;
        font-weight: 700;
        color: #111827;
    }

    .print-item-chance {
        color: #fff;
        background-color: var(--brand-orange);
        padding: 2px 8px;
        border-radius: 20px;
        font-size: 7.5pt;
        font-weight: 800;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .print-item-sub {
        font-size: 7.5pt;
        color: #6b7280;
        margin: 1px 0 4px 0;
        text-transform: uppercase;
        font-weight: 600;
    }

    .print-item-desc {
        font-size: 8pt;
        color: #374151;
        line-height: 1.35;
        background-color: white;
        padding: 4px 8px;
        border: 1px solid #f3f4f6;
        border-radius: 3px;
    }

    .print-footer {
        margin-top: 30px;
        border-top: 1px solid #e5e7eb;
        padding-top: 12px;
        font-size: 7.5pt;
        color: #6b7280;
        text-align: center;
        line-height: 1.35;
        page-break-inside: avoid;
    }

    .print-url {
        margin-top: 4px;
        font-weight: 700;
        color: var(--brand-orange);
    }

    .print-url a {
        color: var(--brand-orange);
        text-decoration: underline;
    }

    .page-break {
        page-break-before: always;
    }
}

/* Responsividade Mobile */
@media (max-width: 768px) {
    .app-header .header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .course-info {
        align-items: flex-start;
        width: 100%;
    }
    
    .controls-panel {
        flex-direction: column;
        align-items: stretch;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .brand h1 {
        font-size: 2.2rem;
    }

    .brand .subtitle {
        white-space: normal;
        font-size: 0.95rem;
    }

    .tabs-nav {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 40%;
        font-size: 0.95rem;
        padding: 0.75rem 0.5rem;
    }

    .view-selector-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .view-selector-buttons {
        width: 100%;
    }

    .selector-btn {
        flex: 1;
        justify-content: center;
    }
}
