/* =========================================
   DESIGN SYSTEM - CORES MODERNAS E VARIÁVEIS
   ========================================= */
:root {
    /* Paleta Clara (SaaS Style) */
    --primary: #0f172a;       /* Slate 900 */
    --secondary: #3b82f6;     /* Blue 500 */
    --secondary-hover: #2563eb;
    --accent: #ef4444;        /* Red 500 */
    --success: #10b981;       /* Emerald 500 */
    
    --bg: #f1f5f9;            /* Slate 100 - Fundo da página */
    --container-bg: #ffffff;  /* Branco puro para o container principal */
    --text: #334155;          /* Slate 700 */
    --text-muted: #64748b;    /* Slate 500 */
    --border: #e2e8f0;        /* Slate 200 */
    
    --input-bg: #f8fafc;
    --input-border: #cbd5e1;
    --input-focus-ring: rgba(59, 130, 246, 0.3);
    
    --highlight-bg: #f8fafc;  /* Fundo para headers de tabela e stats */
    --nav-bg: #ffffff;
    --card-bg: #ffffff;
    --row-hover: #f1f5f9;
    --modal-overlay: rgba(15, 23, 42, 0.6);
    --progress-track: #e2e8f0;
    
    /* Sombras e Bordas */
    --radius-lg: 24px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --shadow-sm: 0 2px 4px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 8px 16px -4px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, 0.12);
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.dark-mode {
    /* Paleta Escura Elegante (Chumbo, não preto puro) */
    --primary: #f8fafc;
    --secondary: #3b82f6;
    --secondary-hover: #60a5fa;
    --accent: #f87171;
    --success: #34d399;
    
    --bg: #0f172a;            /* Slate 900 */
    --container-bg: #1e293b;  /* Slate 800 */
    --text: #cbd5e1;          /* Slate 300 */
    --text-muted: #94a3b8;    /* Slate 400 */
    --border: #334155;        /* Slate 700 */
    
    --input-bg: #0f172a;
    --input-border: #475569;
    --input-focus-ring: rgba(59, 130, 246, 0.4);
    
    --highlight-bg: #0f172a;
    --nav-bg: #1e293b;
    --card-bg: #0f172a;
    --row-hover: #334155;
    --modal-overlay: rgba(0, 0, 0, 0.8);
    --progress-track: #334155;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 8px 16px -4px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, 0.5);
}

/* =========================================
   ESTILOS GERAIS
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box;
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; 
    background-color: var(--bg); 
    background-image: radial-gradient(circle at top right, rgba(59, 130, 246, 0.08), transparent 400px), radial-gradient(circle at bottom left, rgba(16, 185, 129, 0.05), transparent 400px);
    background-attachment: fixed;
    color: var(--text); 
    margin: 0; 
    padding: 30px 20px; 
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
}

/* Scrollbar Moderna */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

h1 { 
    text-align: center; 
    color: var(--primary); 
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 25px;
}

.container { 
    max-width: 1400px; 
    margin: 0 auto; 
    background: var(--container-bg); 
    padding: 30px; 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-lg); 
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease; 
}

/* Ações do Topo */
.header-actions { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 25px; 
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 20px;
}
.status-msg { color: var(--success); font-weight: 600; font-size: 0.95em; display: flex; align-items: center; gap: 5px; min-height: 20px; margin-top: 5px;}

/* =========================================
   SIDEBAR DE NAVEGAÇÃO
   ========================================= */
body.has-sidebar {
    padding-right: 95px; /* Compensa a sidebar colapsada no desktop */
}

.app-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 75px;
    height: 100vh;
    background: var(--container-bg);
    border-left: 1px solid var(--border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    white-space: nowrap;
}

.app-sidebar:hover, .app-sidebar.expanded {
    width: 280px;
    box-shadow: var(--shadow-lg);
}

.sidebar-header {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border);
    color: var(--primary);
}
.sidebar-header .icon { width: 75px; text-align: center; font-size: 1.6em; color: var(--secondary); flex-shrink: 0; }
.sidebar-header .text { font-weight: 900; font-size: 1.2em; letter-spacing: -0.5px; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.app-sidebar:hover .sidebar-header .text, .app-sidebar.expanded .sidebar-header .text { opacity: 1; }

.sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: 20px;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: transparent; border-radius: 4px; }
.app-sidebar:hover .sidebar-scroll::-webkit-scrollbar-thumb, .app-sidebar.expanded .sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border); }

.sidebar-group {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-bottom: 1px dashed var(--border);
}
.sidebar-group:last-child { border-bottom: none; }

.group-title {
    font-size: 0.75em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 800;
    text-align: right;
    margin: 15px 25px 5px 0;
    opacity: 0;
    transition: opacity 0.3s;
    letter-spacing: 0.5px;
}
.app-sidebar:hover .group-title, .app-sidebar.expanded .group-title { opacity: 1; }

.app-sidebar button {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    background: transparent;
    color: var(--text);
    border: none;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
    transition: background 0.2s, color 0.2s;
    text-align: right;
    width: 100%;
}
.app-sidebar button:hover {
    background: var(--row-hover);
    color: var(--secondary);
    transform: none;
    box-shadow: inset -4px 0 0 var(--secondary);
}
.app-sidebar .btn-sair:hover { color: var(--accent); box-shadow: inset -4px 0 0 var(--accent); }

.app-sidebar .icon {
    width: 75px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.3em;
}
.app-sidebar .text {
    font-size: 0.95em;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.app-sidebar:hover .text, .app-sidebar.expanded .text { opacity: 1; }

/* Botões Modernos */
button { 
    padding: 10px 18px; 
    font-size: 0.95em; 
    font-weight: 600; 
    cursor: pointer; 
    background: linear-gradient(135deg, var(--secondary), var(--secondary-hover)); 
    color: white; 
    border: none; 
    border-radius: var(--radius-md); 
    transition: var(--transition-smooth);
    box-shadow: var(--shadow-sm);
}
button:hover { filter: brightness(1.05); transform: translateY(-2px); box-shadow: var(--shadow-md); }
button:active { transform: translateY(0); }
button:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; box-shadow: none; transform: none; }

.btn-dashboard { background: linear-gradient(135deg, var(--success), #059669); } 
.btn-dashboard:hover { filter: brightness(1.05); }
.btn-theme { background: var(--bg); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn-theme:hover { background: var(--border); }
.btn-config { background: var(--bg); color: var(--text); border: 1px solid var(--border); box-shadow: none;}
.btn-config:hover { background: var(--border); }
.btn-icon { padding: 8px 14px; font-size: 0.85em; width: 100%; border-radius: var(--radius-sm); }
.has-note { background: var(--success); }

/* Sistema de Níveis e XP (RPG) */
.xp-container { margin-top: 12px; width: 260px; cursor: pointer; transition: var(--transition-smooth); padding: 8px; border-radius: var(--radius-md); border: 1px solid transparent; }
.xp-container:hover { background: var(--bg); border-color: var(--border); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.xp-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.level-badge { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; padding: 3px 10px; border-radius: 12px; font-weight: 800; font-size: 0.8em; box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3); text-shadow: 0 1px 2px rgba(0,0,0,0.2);}
.rank-name { font-size: 0.9em; font-weight: 800; color: var(--primary); letter-spacing: -0.5px;}
.xp-bar { width: 100%; height: 10px; background: var(--progress-track); border-radius: 5px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);}
.xp-fill { height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); width: 0%; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); box-shadow: inset 0 -2px 4px rgba(0,0,0,0.15);}
.xp-text { font-size: 0.75em; color: var(--text-muted); text-align: right; margin-top: 4px; font-weight: 700; }

/* Barra de Progresso */
.progress-wrapper { 
    margin-bottom: 25px; 
    background: var(--card-bg); 
    padding: 20px; 
    border-radius: var(--radius-md); 
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.progress-info { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 12px; color: var(--primary); font-size: 1.05em;}
.progress-track { width: 100%; height: 12px; background-color: var(--progress-track); border-radius: 20px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--secondary), var(--success)); width: 0%; transition: width 1s cubic-bezier(0.4, 0, 0.2, 1); border-radius: 20px; box-shadow: inset 0 -2px 4px rgba(0,0,0,0.15);}

/* Navegação e Stats */
.day-navigation { 
    display: flex; justify-content: space-between; align-items: center; 
    background: var(--highlight-bg); padding: 15px 20px; 
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border); border-bottom: none;
}
.date-selector { 
    position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; 
    cursor: pointer; padding: 8px 20px; border-radius: var(--radius-md); transition: background 0.2s; 
}
.date-selector:hover { background: var(--border); }
.date-selector h2 { margin: 0; color: var(--primary); font-size: 1.4em; font-weight: 700; text-transform: capitalize; letter-spacing: -0.5px;}
.date-selector input[type="date"] { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 50; }
.date-selector input[type="date"]::-webkit-calendar-picker-indicator { position: absolute; top: 0; left: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

.daily-stats { 
    display: flex; justify-content: space-around; 
    background: var(--highlight-bg); padding: 20px; 
    border-radius: 0 0 var(--radius-md) var(--radius-md); 
    margin-bottom: 25px; border: 1px solid var(--border); border-top: 1px dashed var(--border);
}
.stat-box { text-align: center; font-size: 0.9em; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;} 
.stat-value { font-size: 2em; color: var(--primary); display: block; margin-top: 5px; font-weight: 800; letter-spacing: -1px;}
.stat-value.good { color: var(--success); }

/* =========================================
   TABELA CLEAN (SaaS Design)
   ========================================= */
table { width: 100%; border-collapse: collapse; margin-top: 10px; }
th, td { padding: 14px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
th { 
    background-color: var(--container-bg); 
    color: var(--text-muted); 
    font-size: 0.75em; 
    text-transform: uppercase; 
    letter-spacing: 1px;
    font-weight: 700; 
    border-bottom: 2px solid var(--border);
}
tr:hover td { background-color: var(--row-hover); }
tr:last-child td { border-bottom: none; }

/* Inputs Modernos */
select, input[type="text"], input[type="number"], input[type="date"], textarea { 
    width: 100%; box-sizing: border-box; padding: 10px 12px; 
    border: 1px solid var(--input-border); border-radius: var(--radius-sm); 
    font-family: inherit; font-size: 0.95em; background-color: var(--input-bg); color: var(--text); 
    transition: var(--transition-smooth);
}
input:focus, select:focus, textarea:focus { 
    outline: none; border-color: var(--secondary); 
    box-shadow: 0 0 0 3px var(--input-focus-ring); 
    background-color: var(--container-bg);
}
textarea { resize: vertical; line-height: 1.5; min-height: 80px; }
input[type="checkbox"] { 
    width: 20px; height: 20px; cursor: pointer; accent-color: var(--secondary); 
    border-radius: 4px;
}
.text-center { text-align: center; }

/* =========================================
   MODAIS / OVERLAYS
   ========================================= */
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: var(--modal-overlay); backdrop-filter: blur(6px); animation: fadeInOverlay 0.3s ease-out forwards;}
@keyframes fadeInOverlay { from { opacity: 0; backdrop-filter: blur(0px); } to { opacity: 1; backdrop-filter: blur(6px); } }
@keyframes contentFade { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }
.modal-content { 
    background-color: var(--container-bg); margin: 3% auto; padding: 35px; 
    border-radius: var(--radius-lg); width: 92%; max-width: 1100px; max-height: 90vh; 
    overflow-y: auto; color: var(--text); box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    animation: modalEnter 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-content.full-screen {
    margin: 0;
    width: 100%;
    max-width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
    padding: 40px 5%;
}
.modal-content.small-modal { max-width: 600px; }
@keyframes modalEnter { from { opacity: 0; transform: translateY(30px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }

.modal-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; color: var(--primary); font-weight: 800; font-size: 1.8em; letter-spacing: -0.5px; }

/* Grid de Estatísticas */
.dashboard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 25px; margin-bottom: 30px; }
.dash-card { background: var(--card-bg); border: 1px solid var(--border); padding: 25px; border-radius: var(--radius-md); text-align: center; box-shadow: var(--shadow-sm); transition: var(--transition-smooth); border-top: 4px solid var(--secondary); }
.dash-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.dash-card h3 { margin-top: 0; color: var(--text-muted); font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.5px;}
.dash-number { font-size: 3em; font-weight: 800; color: var(--primary); margin: 5px 0; letter-spacing: -1px;}

.area-table { margin-top: 10px; border-radius: var(--radius-md); overflow: hidden; border: 1px solid var(--border); } 
.area-table th { background-color: var(--highlight-bg); color: var(--text-muted); padding: 15px;} 
.area-table td { font-weight: 600; color: var(--text); padding: 15px;}
.area-table tr:last-child td { border-bottom: none; }

.area-name-cell { cursor: pointer; color: var(--secondary); text-decoration: underline; transition: color 0.2s; }
.area-name-cell:hover { color: var(--secondary-hover); }

.theme-detail-item { padding: 15px; border-bottom: 1px solid var(--border); cursor: pointer; display: flex; justify-content: space-between; align-items: center; transition: background 0.2s; }
.theme-detail-item:hover { background: var(--row-hover); }
.theme-detail-item:last-child { border-bottom: none; }
.theme-detail-date { font-size: 0.85em; color: var(--text-muted); margin-bottom: 4px; }
.highlight-score { color: var(--success) !important; } .warning-score { color: var(--accent) !important; }

/* Configurações */
.config-section { margin-bottom: 25px; background: var(--bg); padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--border);}
.config-section label { display: block; font-weight: 600; margin-bottom: 15px; color: var(--primary); }
.days-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; }
.day-option { display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--container-bg); padding: 12px; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; transition: 0.2s; font-weight: 600;}
.day-option:hover { border-color: var(--secondary); }
.day-option input { width: auto; margin: 0; }

/* Modal de Notas */
.note-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 20px; }

/* Flashcards Styles */
.flashcards-section { background: var(--bg); padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--border); display: flex; flex-direction: column; height: 100%; }
.flashcard-form { background: var(--container-bg); padding: 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 15px; }
.flashcard-form input, .flashcard-form textarea { margin-bottom: 8px; font-size: 0.9em; }
.flashcard-form textarea { height: 60px; resize: vertical; }

.flashcard-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-right: 5px; max-height: 400px; }
.flashcard-item { background: var(--container-bg); border: 1px solid var(--border); padding: 12px; border-radius: var(--radius-sm); position: relative; transition: var(--transition-smooth); cursor: pointer; border-left: 4px solid var(--secondary); }
.flashcard-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--secondary); }
.flashcard-theme { font-size: 0.75em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; letter-spacing: 0.5px; margin-bottom: 4px; display: block;}
.flashcard-question { font-weight: 600; color: var(--primary); font-size: 0.95em; }
.flashcard-answer { display: none; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); color: var(--text); font-size: 0.9em; line-height: 1.4; background: var(--highlight-bg); padding: 10px; border-radius: 4px; }
.flashcard-item.revealed .flashcard-answer { display: block; animation: fadeIn 0.3s; }

.editor-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; background: var(--highlight-bg); padding: 10px; border-radius: var(--radius-md); border: 1px solid var(--border); align-items: center; }
.editor-toolbar button { background: var(--container-bg); color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: var(--radius-sm); font-weight: 600; box-shadow: var(--shadow-sm); transition: var(--transition-smooth); display: flex; align-items: center; justify-content: center; min-width: 32px; font-size: 0.95em;}
.editor-toolbar button:hover { background: var(--row-hover); border-color: var(--secondary); color: var(--secondary); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.editor-toolbar select { width: auto; padding: 4px 8px; height: 32px; margin: 0; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--container-bg); color: var(--text); font-weight: 600; cursor: pointer; font-size: 0.9em; box-shadow: var(--shadow-sm); transition: var(--transition-smooth); }
.editor-toolbar select:hover { border-color: var(--secondary); }
.toolbar-group { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; border-right: 1px solid var(--border); padding-right: 10px; }
.toolbar-group:last-child { border-right: none; padding-right: 0; }
.color-picker-wrapper { display: flex; align-items: center; gap: 5px; font-size: 0.85em; color: var(--text-muted); font-weight: 700; cursor: pointer; padding: 2px; }
.color-picker-wrapper input[type="color"] { width: 28px; height: 28px; padding: 0; border: 1px solid var(--border); border-radius: 4px; cursor: pointer; background: var(--container-bg); }
.editor-content { min-height: 400px; border: 1px solid var(--input-border); border-radius: var(--radius-md); padding: 20px; background-color: var(--input-bg); outline: none; overflow-y: auto; transition: 0.2s;}
.editor-content:focus { border-color: var(--secondary); box-shadow: 0 0 0 3px var(--input-focus-ring); background: var(--container-bg);}

.editor-content:empty::before {
    content: attr(placeholder);
    color: var(--text-muted);
    pointer-events: none;
}

.editor-content table, #libReadContent table, #tsStudyContent table, #anReadContent table { width: 100%; border-collapse: collapse; margin: 15px 0; table-layout: fixed; }
.editor-content th, .editor-content td, #libReadContent th, #libReadContent td, #tsStudyContent th, #tsStudyContent td, #anReadContent th, #anReadContent td { border: 1px solid var(--border); padding: 10px; text-align: left; position: relative; word-break: break-word; min-width: 30px; }
.editor-content th, #libReadContent th, #tsStudyContent th, #anReadContent th { background-color: var(--highlight-bg); font-weight: 700; color: var(--text-muted); text-transform: uppercase; font-size: 0.8em; }

/* Resizer Handle da Tabela */
.table-resizer {
    position: absolute; top: 0; right: -3px; width: 7px; bottom: 0; cursor: col-resize; user-select: none; z-index: 10; background-color: transparent; transition: background-color 0.2s;
}
.table-resizer:hover, .table-resizer.resizing { background-color: var(--secondary); }

/* Tooltips no Editor (Balõezinhos) */
.tooltip-word { position: relative; border-bottom: 2px dashed var(--secondary); background-color: rgba(59, 130, 246, 0.1); border-radius: 2px; cursor: help; color: inherit; padding: 0 2px; font-weight: 600; transition: background 0.2s;}
.tooltip-word:hover { background-color: rgba(59, 130, 246, 0.2); }
.tooltip-word::after { content: attr(data-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background-color: var(--primary); color: var(--bg); padding: 8px 12px; border-radius: var(--radius-sm); font-size: 0.85em; font-weight: 500; white-space: normal; width: max-content; max-width: 250px; text-align: center; line-height: 1.4; opacity: 0; visibility: hidden; transition: all 0.2s; box-shadow: var(--shadow-md); z-index: 100; pointer-events: none; }
.tooltip-word::before { content: ''; position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); border-width: 6px; border-style: solid; border-color: var(--primary) transparent transparent transparent; opacity: 0; visibility: hidden; transition: all 0.2s; z-index: 100; pointer-events: none; }
.tooltip-word:hover::after, .tooltip-word:hover::before { opacity: 1; visibility: visible; }

/* Tópicos Importantes */
.topics-section { background: var(--bg); padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--border); display: flex; flex-direction: column;}
.topics-section h3 { margin-top: 0; color: var(--primary); font-size: 1.2em; display: flex; align-items: center; gap: 8px; font-weight: 700;}
.add-topic-container { display: flex; gap: 10px; margin-bottom: 20px; }
.add-topic-container input { flex: 1; }
.topic-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 12px;}

.topic-item { background: var(--container-bg); padding: 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 10px; transition: 0.2s;}
.topic-item:hover { border-color: var(--input-border); }
.topic-header { display: flex; align-items: center; gap: 12px; }
.topic-header span { flex: 1; font-weight: 600; font-size: 0.95em; color: var(--primary); }
.topic-item.checked .topic-header span { text-decoration: line-through; color: var(--text-muted); }

.btn-del-topic { background: none; color: var(--text-muted); padding: 4px; font-size: 1.2em; border: none; cursor:pointer; box-shadow: none;}
.btn-del-topic:hover { color: var(--accent); background: none; transform: scale(1.1); box-shadow: none;}

/* Gavetas (Drawers) de Revisão */
.drawer-group { border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 12px; background: var(--bg); overflow: hidden; box-shadow: var(--shadow-sm); transition: var(--transition-smooth); }
.drawer-header { padding: 14px 18px; cursor: pointer; font-weight: 700; color: var(--primary); display: flex; justify-content: space-between; align-items: center; background: var(--container-bg); transition: var(--transition-smooth); }
.drawer-header:hover { background: var(--row-hover); }
.drawer-header::after { content: '▼'; font-size: 0.8em; transition: transform 0.3s; }
.drawer-group.open > .drawer-header::after { transform: rotate(180deg); }
.drawer-group.open > .drawer-header { border-bottom: 1px solid var(--border); }
.drawer-content { display: none; padding: 12px; }
.drawer-group.open > .drawer-content { display: block; }

.drawer-theme { margin-bottom: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--container-bg); }
.drawer-theme:last-child { margin-bottom: 0; }
.drawer-theme-header { padding: 12px 15px; cursor: pointer; font-weight: 600; color: var(--secondary); display: flex; justify-content: space-between; align-items: center; background: var(--bg); font-size: 0.95em; transition: var(--transition-smooth); }
.drawer-theme-header:hover { filter: brightness(0.95); }
.drawer-theme-header::after { content: '▼'; font-size: 0.8em; transition: transform 0.3s; }
.drawer-theme.open > .drawer-theme-header::after { transform: rotate(180deg); }
.drawer-theme.open > .drawer-theme-header { border-bottom: 1px solid var(--border); }
.drawer-theme-content { display: none; padding: 10px; }
.drawer-theme.open > .drawer-theme-content { display: block; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Central de Revisões */
.pending-reviews-section { margin-top: 40px; border-top: 1px solid var(--border); padding-top: 30px; }
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
.reviews-column h3 { margin-top: 0; padding-bottom: 15px; border-bottom: 2px solid var(--border); font-weight: 800;}

.pending-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 12px; padding-right: 5px;}
.pending-card { background: var(--bg); border-left: 4px solid var(--accent); padding: 18px; border-radius: var(--radius-md); display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--border); border-left-width: 4px; box-shadow: var(--shadow-sm); transition: var(--transition-smooth);}
.pending-card:hover { transform: translateX(5px); box-shadow: var(--shadow-md); }
.pending-card.card-reviewed { border-left-color: var(--success); opacity: 0.7; }
.pending-info { flex: 1; }
.pending-info strong { display: block; color: var(--primary); margin-bottom: 6px; font-size: 1.05em;}
.pending-info small { color: var(--text-muted); display: block; margin-bottom: 8px; font-weight: 600; text-transform: uppercase; font-size: 0.75em; letter-spacing: 0.5px;}

.dashboard-topic-note { margin-top: 10px; padding: 12px; background: var(--container-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 0.9em; color: var(--text); white-space: pre-wrap; font-style: italic;}
.empty-msg { color: var(--text-muted); font-weight: 600; padding: 25px; text-align: center; background: var(--bg); border-radius: var(--radius-md); border: 2px dashed var(--border);}

/* =========================================
   RESPONSIVIDADE (MOBILE / APK)
   ========================================= */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* Rolagem suave em mobile */
    margin-top: 15px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

@media (max-width: 768px) {
    body { padding: 10px; }
    body.has-sidebar { padding-right: 70px; }
    .app-sidebar { width: 60px; }
    .app-sidebar:hover, .app-sidebar.expanded { width: 260px; }
    .app-sidebar .icon, .sidebar-header .icon { width: 60px; }
    .group-title { margin-right: 20px; }
    .container { padding: 15px; }
    
    #cronogramaTable { min-width: 950px; } /* Força largura para não espremer colunas */
    
    .header-actions { flex-direction: row; flex-wrap: nowrap; justify-content: space-between; align-items: flex-start; gap: 10px; }
    .header-actions > div:first-child { flex: 1; min-width: 0; }
    #welcomeUser { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.85em !important; }
    .xp-container { width: 100%; box-sizing: border-box; }
    .rank-name { font-size: 0.8em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
    .level-badge { font-size: 0.75em; padding: 2px 6px; }
    
    .day-navigation { flex-direction: column; gap: 12px; }
    .daily-stats { flex-direction: column; gap: 15px; }
    
    .modal-content { padding: 20px; width: 95%; }
    .modal-content.full-screen { padding: 25px 15px; }
    
    .achievements-layout { grid-template-columns: 1fr !important; }
}
/* Central de Flashcards (Flip Animation) */
.flash-filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border); justify-content: center; }
.flash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 25px; }
.flash-scene { height: 260px; perspective: 1000px; cursor: pointer; }
.flash-card { width: 100%; height: 100%; position: relative; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); transform-style: preserve-3d; }
.flash-card.flipped { transform: rotateY(180deg); }
.flash-face { position: absolute; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden; border-radius: var(--radius-md); padding: 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; box-shadow: var(--shadow-md); border: 1px solid var(--border); }
.flash-front { background: var(--card-bg); }
.flash-back { background: linear-gradient(135deg, var(--secondary), var(--secondary-hover)); color: white; transform: rotateY(180deg); overflow-y: auto;}
.flash-tag { position: absolute; top: 15px; font-size: 0.7em; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); font-weight: 700; background: var(--bg); padding: 4px 8px; border-radius: 4px; }
.flash-q { font-weight: 800; font-size: 1.1em; color: var(--primary); margin-top: 15px; }
.flash-a { font-size: 1em; line-height: 1.5; font-weight: 500; }
.flash-hint { position: absolute; bottom: 15px; font-size: 0.75em; color: var(--text-muted); opacity: 0.7; }

.flash-stats-container { display: flex; gap: 15px; margin-bottom: 20px; justify-content: center; flex-wrap: wrap; }
.stat-badge { background: var(--container-bg); border: 1px solid var(--border); padding: 8px 15px; border-radius: 20px; font-weight: 800; font-size: 0.9em; box-shadow: var(--shadow-sm); color: var(--primary); display: flex; align-items: center; gap: 6px;}
.fc-create-box { display: none; background: var(--card-bg); padding: 25px; border-radius: var(--radius-md); border: 2px dashed var(--secondary); margin-bottom: 25px; box-shadow: var(--shadow-md); animation: contentFade 0.3s ease; }
.fc-create-box h3 { margin-top: 0; color: var(--secondary); font-weight: 800; margin-bottom: 15px;}

/* =========================================
   BIBLIOTECA DE RESUMOS E MACETES
   ========================================= */
.library-container { display: flex; gap: 25px; margin-top: 20px; align-items: flex-start; }
.library-sidebar { width: 260px; flex-shrink: 0; background: var(--bg); padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--border); }
.library-areas { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.library-areas li { padding: 12px 15px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; font-weight: 600; color: var(--text-muted); border: 1px solid transparent; }
.library-areas li:hover { background: var(--container-bg); border-color: var(--border); }
.library-areas li.active { background: var(--secondary); color: white; border-color: var(--secondary); box-shadow: var(--shadow-sm); }

.library-main { flex: 1; background: var(--container-bg); min-height: 400px; border-radius: var(--radius-md); }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.lib-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; cursor: pointer; transition: var(--transition-smooth); box-shadow: var(--shadow-sm); display: flex; flex-direction: column; height: 180px; position: relative;}
.lib-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--secondary); }
.lib-card-area { font-size: 0.75em; text-transform: uppercase; font-weight: 800; color: var(--secondary); margin-bottom: 8px; letter-spacing: 0.5px; }
.lib-card-title { font-size: 1.1em; font-weight: 700; color: var(--primary); margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lib-card-preview { font-size: 0.9em; color: var(--text-muted); flex: 1; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

#libReadContent img, #tsStudyContent img, #anReadContent img { max-width: 100%; height: auto; border-radius: var(--radius-sm); }

@media (max-width: 768px) {
    .library-container { flex-direction: column; }
    .library-sidebar { width: 100%; box-sizing: border-box; }
    .library-areas { flex-direction: row; overflow-x: auto; white-space: nowrap; padding-bottom: 10px; }
    .library-areas li { padding: 8px 12px; font-size: 0.9em; }
}

/* =========================================
   MODO VERSUS (PvP Arena)
   ========================================= */
.vs-search-box { display: flex; gap: 10px; background: var(--bg); padding: 20px; border-radius: var(--radius-md); border: 1px solid var(--border); margin-bottom: 25px; }
.vs-search-box input { flex: 1; font-size: 1.1em; padding: 12px 15px; }
.vs-search-box button { font-size: 1.1em; padding: 0 25px; background: linear-gradient(135deg, #f59e0b, #d97706); }
.vs-search-box button:hover { filter: brightness(1.1); transform: scale(1.02); }

.versus-grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: stretch; margin-top: 20px; }
.vs-card { background: var(--card-bg); border-radius: var(--radius-md); padding: 30px 20px; text-align: center; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; border: 2px solid var(--border); }
.vs-card.my-card { border-color: var(--secondary); background: linear-gradient(to bottom, rgba(59, 130, 246, 0.05), var(--card-bg)); }
.vs-card.opp-card { border-color: var(--accent); background: linear-gradient(to bottom, rgba(239, 68, 68, 0.05), var(--card-bg)); }

.vs-avatar { width: 90px; height: 90px; border-radius: 50%; color: white; display: flex; align-items: center; justify-content: center; font-size: 2.5em; font-weight: 900; margin: 0 auto 15px auto; box-shadow: var(--shadow-md); border: 4px solid white;}
.my-card .vs-avatar { background: linear-gradient(135deg, var(--secondary), var(--secondary-hover)); }
.opp-card .vs-avatar { background: linear-gradient(135deg, var(--accent), #be123c); }

.vs-card h3 { margin: 0 0 5px 0; color: var(--primary); font-size: 1.3em; font-weight: 800;}
.vs-rank { font-weight: 800; color: var(--text-muted); font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.5px; }

.vs-badge { display: flex; align-items: center; justify-content: center; font-size: 2em; font-weight: 900; color: var(--text-muted); font-style: italic; opacity: 0.3; }

.vs-stats-container { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 20px; display: flex; flex-direction: column; gap: 12px; margin-top: 25px; box-shadow: inset var(--shadow-sm);}
.vs-stat-row { display: grid; grid-template-columns: 1fr 2fr 1fr; text-align: center; padding: 15px; background: var(--container-bg); border-radius: var(--radius-sm); align-items: center; box-shadow: var(--shadow-sm); border: 1px solid var(--border); transition: var(--transition-smooth); }
.vs-stat-row:hover { transform: scale(1.01); }
.vs-label { font-weight: 800; color: var(--primary); font-size: 0.95em; text-transform: uppercase; letter-spacing: 0.5px;}
.vs-val { font-size: 1.6em; font-weight: 900; color: var(--text-muted); }
.vs-val.winner { color: var(--success); text-shadow: 0 0 10px rgba(16, 185, 129, 0.2); transform: scale(1.1); }
.vs-val.loser { color: var(--accent); opacity: 0.5; }
.vs-val.tie { color: #f59e0b; }

.vs-achievements { display: flex; flex-direction: column; gap: 8px; margin-top: 15px; }
.vs-ach-badge { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.05); padding: 5px 10px; border-radius: var(--radius-sm); font-size: 0.85em; text-align: left; }
.dark-mode .vs-ach-badge { background: rgba(255,255,255,0.05); }
.vs-ach-title { font-weight: 600; white-space: normal; word-break: break-word; flex: 1; line-height: 1.2; font-size: 0.9em; }

.vs-history-chip { background: var(--container-bg); border: 1px solid var(--border); padding: 8px 15px; border-radius: 20px; font-size: 0.9em; cursor: pointer; transition: var(--transition-smooth); color: var(--text); display: flex; align-items: center; gap: 8px; font-weight: 600; box-shadow: var(--shadow-sm); }
.vs-history-chip:hover { border-color: var(--secondary); color: var(--secondary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.vs-history-del { color: var(--text-muted); cursor: pointer; font-size: 1.2em; display: flex; align-items: center; justify-content: center; transition: 0.2s; border-radius: 50%; line-height: 0.8;}
.vs-history-del:hover { color: var(--accent); transform: scale(1.2);}

@media (max-width: 768px) {
    .versus-grid { grid-template-columns: 1fr; gap: 10px; }
    .vs-badge { display: none; }
    .vs-search-box { flex-direction: column; }
    .vs-stat-row { padding: 12px 5px; }
    .vs-label { font-size: 0.75em; }
    .vs-val { font-size: 1.2em; }
}

/* =========================================
   MODO FOCO (POMODORO & INTENSO)
   ========================================= */
.focus-setup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px; }
.focus-mode-card { border: 2px solid var(--border); border-radius: var(--radius-md); padding: 25px 20px; cursor: pointer; transition: 0.2s; background: var(--container-bg); text-align: center; box-shadow: var(--shadow-sm); }
.focus-mode-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--secondary); }
.focus-mode-card.active { border-color: var(--secondary); background: rgba(59, 130, 246, 0.05); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2); }
.focus-mode-card h3 { margin: 0 0 10px 0; color: var(--primary); font-weight: 800; font-size: 1.2em;}
.focus-mode-card p { font-size: 0.85em; color: var(--text-muted); margin: 0; line-height: 1.4; }

.focus-active-bg {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    z-index: 99999; opacity: 0; visibility: hidden; transition: opacity 0.5s ease, visibility 0.5s;
}
.focus-active-bg.active { opacity: 1; visibility: visible; }
.focus-active-bg::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(59,130,246,0.08) 0%, transparent 50%);
    animation: pulseFocus 10s ease-in-out infinite alternate; z-index: -1;
}
@keyframes pulseFocus { 0% { transform: scale(0.8); opacity: 0.5; } 100% { transform: scale(1.2); opacity: 1; } }
.focus-active-bg.break-phase::before { background: radial-gradient(circle at center, rgba(16,185,129,0.08) 0%, transparent 50%); }

.focus-timer { font-size: clamp(5rem, 15vw, 12rem); font-weight: 900; color: white; font-variant-numeric: tabular-nums; line-height: 1; margin: 20px 0; text-shadow: 0 15px 35px rgba(0,0,0,0.6); }
.focus-phase { font-size: 1.5rem; font-weight: 800; text-transform: uppercase; letter-spacing: 5px; color: var(--secondary); transition: color 0.3s; text-shadow: 0 2px 10px rgba(0,0,0,0.5);}
.focus-active-bg.break-phase .focus-phase { color: var(--success); }

.focus-cycles { display: flex; gap: 15px; margin-bottom: 50px; }
.focus-dot { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,0.15); transition: 0.3s; }
.focus-dot.active { background: var(--secondary); box-shadow: 0 0 20px var(--secondary); transform: scale(1.3); }
.focus-dot.done { background: var(--success); box-shadow: 0 0 10px var(--success); }

.focus-controls { display: flex; gap: 20px; z-index: 10; }
.btn-focus-action { background: transparent; border: 2px solid white; color: white; padding: 15px 40px; font-size: 1.2em; border-radius: 40px; transition: 0.3s; cursor: pointer; font-weight: 800; box-shadow: 0 4px 15px rgba(0,0,0,0.3);}
.btn-focus-giveup { border-color: #ef4444; color: #ef4444; }
.btn-focus-giveup:hover { background: #ef4444; color: white; transform: translateY(-3px);}
.btn-focus-finish { border-color: var(--secondary); color: var(--secondary); }
.btn-focus-finish:hover { background: var(--secondary); color: white; transform: translateY(-3px);}

.focus-history-list { display: flex; flex-direction: column; gap: 12px; max-height: 60vh; overflow-y: auto; padding-right: 10px;}
.focus-history-item { background: var(--container-bg); padding: 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; box-shadow: var(--shadow-sm);}
.focus-history-item.success { border-left: 4px solid var(--success); }
.focus-history-item.failed { border-left: 4px solid var(--accent); }

/* =========================================
   SIMULADOR OSCE
   ========================================= */
.osce-input-row { display: flex; gap: 10px; margin-bottom: 10px; align-items: flex-start; flex-wrap: wrap;}
.osce-input-row input { flex: 1; min-width: 150px;}
.osce-input-row input[type="number"] { width: 80px; flex: none; text-align: center; }
.btn-del-row { background: var(--accent); color: white; border: none; padding: 10px 15px; border-radius: var(--radius-sm); cursor: pointer; font-weight: bold; }

.osce-sim-header { display: flex; justify-content: space-between; align-items: center; background: var(--bg); padding: 15px 20px; border-radius: var(--radius-md); border: 1px solid var(--border); margin-bottom: 15px; flex-wrap: wrap; gap: 15px;}
.osce-sim-controls { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.osce-timer { font-size: 2.5em; font-weight: 900; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 2px; }
.osce-sim-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; flex: 1; overflow: hidden; }
.osce-panel { background: var(--container-bg); border: 1px solid var(--border); border-radius: var(--radius-md); display: flex; flex-direction: column; overflow: hidden; }
.osce-panel-header { padding: 15px; background: var(--highlight-bg); border-bottom: 1px solid var(--border); font-weight: bold; color: var(--primary); }
.osce-panel-content { padding: 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column;}

.sim-exam-card { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 15px; background: var(--container-bg); transition: 0.2s; }
.sim-exam-card.revealed { background: rgba(16, 185, 129, 0.1); border-color: var(--success); }

.sim-exam-btn { width: 100%; text-align: left; padding: 12px; background: var(--bg); border: 2px dashed var(--secondary); border-radius: 8px; cursor: pointer; font-weight: 800; color: var(--secondary); transition: 0.2s; }
.sim-exam-btn:hover { background: rgba(59, 130, 246, 0.1); transform: translateY(-2px);}
.sim-exam-btn:disabled { border-style: solid; cursor: default; transform: none; color: white; }

.sim-exam-result { display: none; margin-top: 15px; padding: 20px; background: var(--container-bg); border: 1px solid var(--border); border-radius: 8px; font-weight: 500; color: var(--text); box-shadow: var(--shadow-md); border-left: 5px solid var(--secondary); }
.sim-exam-card.revealed .sim-exam-result { display: block; animation: contentFade 0.4s ease; }

.sim-check-item { display: flex; align-items: stretch; gap: 15px; background: var(--container-bg); padding: 12px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; transition: 0.2s; user-select: none; }
.sim-check-item:hover { border-color: var(--secondary); }
.sim-check-item.checked { background: rgba(16, 185, 129, 0.05); border-color: var(--success); }
.sim-check-item input[type="checkbox"] { width: 24px; height: 24px; margin-top: 2px; cursor: pointer; pointer-events: none; accent-color: var(--success); }
.sim-check-item-text { flex: 1; font-size: 1.05em; font-weight: 500; line-height: 1.4; color: var(--text); }
.sim-check-item.checked .sim-check-item-text { color: var(--text-muted); text-decoration: line-through; }
.sim-check-item-score { font-weight: 800; color: var(--secondary); font-size: 1.1em; background: var(--bg); padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border); }

.room-pin-box { background: var(--bg); border: 2px dashed var(--border); padding: 8px 20px; border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; }

/* Estilos P.E.P (Checklist Categorizado) */
.pep-group-builder { background: var(--container-bg); border: 1px solid var(--border); padding: 15px; border-radius: var(--radius-md); position: relative; }
.pep-group-header-input { width: 100%; font-size: 1.1em; font-weight: bold; padding: 10px; margin-bottom: 15px; border: none; border-bottom: 2px solid var(--secondary); background: transparent; color: var(--primary); outline: none;}
.pep-group-display { background: transparent; display: flex; flex-direction: column; gap: 8px; margin-bottom: 5px; }
.pep-group-title { background: var(--border); color: var(--primary); padding: 8px 15px; border-radius: var(--radius-sm); font-weight: 800; font-size: 0.9em; text-transform: uppercase; letter-spacing: 0.5px; }

/* Botões Compactos para Notas P.E.P */
.pep-score-btn { cursor: pointer; display: inline-block; position: relative; }
.pep-score-btn input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.pep-score-btn span { display: flex; align-items: center; justify-content: center; min-width: 48px; height: 36px; padding: 0 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); font-weight: 700; font-size: 0.9em; color: var(--text-muted); transition: 0.2s; user-select: none; }
.pep-score-btn:hover span { border-color: var(--secondary); color: var(--secondary); }
.pep-score-btn.adq input[type="radio"]:checked + span { border-color: var(--success); background: var(--success); color: white; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.pep-score-btn.par input[type="radio"]:checked + span { border-color: #f59e0b; background: #f59e0b; color: white; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.pep-score-btn.ina input[type="radio"]:checked + span { border-color: var(--accent); background: var(--accent); color: white; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }

.card-avaliacao {
    background: var(--container-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0 20px;
    margin-bottom: 20px;
}
.bloco-pergunta {
    display: flex;
    gap: 20px;
    padding: 25px 0;
    border-bottom: 1px solid var(--border);
    align-items: flex-start;
}
.bloco-pergunta:last-child { border-bottom: none; }
.conteudo-flex { flex: 1; min-width: 200px; color: var(--text); font-size: 1.05em; line-height: 1.6; }
.coluna-pontos { display: flex; flex-direction: column; gap: 8px; min-width: 80px; flex-shrink: 0; }
.coluna-pontos label span { width: 100%; }
@media (max-width: 600px) {
    .bloco-pergunta { flex-direction: column; }
    .coluna-pontos { flex-direction: row; width: 100%; justify-content: flex-end; }
    .coluna-pontos label { flex: 1; }
}

.sim-exam-card.revealed { background: rgba(16, 185, 129, 0.1); border-color: var(--success); }
.sim-exam-result img { max-width: 100%; border-radius: 8px; margin-top: 10px; }

/* Estilos para os Tópicos Interativos do P.E.P */
.pep-item-desc.pep-highlighted {
    background-color: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--secondary);
    color: var(--secondary-hover);
    font-weight: 600;
}
.pep-item-desc.pep-strikethrough {
    text-decoration: line-through;
    color: var(--accent);
    opacity: 0.6;
    background-color: rgba(239, 68, 68, 0.05);
}

@media (max-width: 768px) { .osce-sim-layout { grid-template-columns: 1fr; overflow-y: auto; } .osce-panel { overflow: visible; } }