@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============================================
   ConcursoStudy - Sistema de Estudo para Concursos
   Estilos Principais (Modern SaaS Dashboard)
   ============================================ */

/* Reset e Base */
.logo-jp {
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin-left: 6px;
    opacity: 0.9;
    font-weight: 800;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores Principais - Soft Indigo */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #eef2ff;

    /* Cores de Status */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    /* Cores Neutras */
    --gray-50: #f8fafc;
    --gray-100: #f4f6f8; /* Soft blueish gray for canvas */
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a; /* Used for active pill */

    /* Extreme Cloud Shadows */
    --shadow-sm: 0 4px 12px rgba(0,0,0,0.02);
    --shadow: 0 8px 30px rgba(0,0,0,0.04);
    --shadow-md: 0 12px 40px -12px rgba(0,0,0,0.06);
    --shadow-lg: 0 20px 50px -12px rgba(0,0,0,0.08);
    --shadow-xl: 0 30px 60px -15px rgba(0,0,0,0.12);
    
    /* Subtle border */
    --border-subtle: none; /* No borders in this design */
    --border-strong: none;

    /* Transições muito macias */
    --transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);

    /* Border Radius - Muito Arredondado */
    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-xl: 32px;
    --radius-full: 9999px;

    /* Sidebar */
    --sidebar-width: 280px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--gray-100);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ============================================
   Página de Autenticação
   ============================================ */
.auth-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    display: flex;
    gap: 40px;
    max-width: 900px;
    width: 100%;
    align-items: stretch;
}

.auth-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    flex: 1;
    box-shadow: var(--shadow-xl);
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.auth-header .logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.auth-header .logo img {
    height: 80px;
    width: auto;
}

.auth-header h1 {
    font-size: 1.75rem;
    color: var(--gray-900);
    margin-bottom: 8px;
    display: none;
    /* Hide text title in auth pages if we want just logo */
}

.auth-header p {
    color: var(--gray-500);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
    text-align: center;
}

.auth-footer p {
    color: var(--gray-500);
    margin-bottom: 15px;
}

.auth-features {
    background: transparent;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-features img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 500px;
}

/* ============================================
   Layout Principal - App Container
   ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background: transparent; /* Seamless blend */
    color: var(--gray-800);
    border-right: none;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: var(--transition);
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 32px 24px 24px 24px;
    border-bottom: none;
    background: transparent;
    color: var(--gray-900);
}

.sidebar-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo i {
    font-size: 28px;
    color: var(--gray-900); /* Image 1 has a black logo icon */
}

.sidebar-header .logo span {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.sidebar-nav {
    flex: 1;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    margin: 0 12px;
    border-radius: var(--radius-full);
    color: var(--gray-500);
    font-weight: 600;
    transition: var(--transition);
    border-left: none;
}

.nav-item:hover {
    background: white;
    color: var(--gray-900);
    box-shadow: var(--shadow-sm);
    transform: none;
}

.nav-item.active {
    background: var(--gray-900);
    color: white;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.2em;
}

.sidebar-footer {
    padding: 24px 20px;
    border-top: none;
    background: transparent;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.user-avatar i {
    font-size: 18px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--gray-900);
}

.user-role {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}

.btn-logout {
    width: 100%;
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    justify-content: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.btn-logout:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 20px 30px;
    min-height: 100vh;
    transition: var(--transition);
}

.sidebar.collapsed+.main-content {
    margin-left: 0;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-left h1 {
    font-size: 1.5rem;
    color: var(--gray-900);
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-600);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius);
}

.sidebar-toggle:hover {
    background: var(--gray-200);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--gray-500);
    transition: var(--transition);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb i {
    font-size: 0.7rem;
    color: var(--gray-400);
}

.breadcrumb span {
    color: var(--gray-800);
    font-weight: 500;
}

.header-right {
    display: flex;
    gap: 10px;
}

/* ============================================
   Botões
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.btn-outline {
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
    box-shadow: var(--shadow-sm);
}

.btn-outline:hover {
    background: var(--gray-50);
    color: var(--gray-900);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #b91c1c);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.4);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1rem;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-full);
    background: white;
    border: 1px solid var(--gray-200);
    color: var(--gray-600);
    box-shadow: var(--shadow-sm);
}

.btn-icon:hover {
    background: var(--gray-50);
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-icon-danger:hover {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

/* ============================================
   Formulários
   ============================================ */
.form-container {
    display: flex;
    gap: 30px;
    max-width: 900px;
}

.form-card {
    flex: 1;
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.form-icon i {
    font-size: 28px;
    color: white;
}

.form-header h2 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 5px;
}

.form-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-700);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group label i {
    color: var(--gray-400);
    font-size: 0.85rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 12px 15px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
    background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--gray-400);
}

.form-hint {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.password-input {
    position: relative;
}

.password-input input {
    width: 100%;
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
}

.toggle-password:hover {
    color: var(--gray-600);
}

.form-tips {
    width: 280px;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 25px;
    height: fit-content;
}

.form-tips h3 {
    font-size: 1rem;
    color: var(--gray-800);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-tips h3 i {
    color: var(--warning);
}

.form-tips ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-tips li {
    font-size: 0.85rem;
    color: var(--gray-600);
    padding-left: 20px;
    position: relative;
}

.form-tips li::before {
    content: '•';
    position: absolute;
    left: 5px;
    color: var(--primary);
}

/* ============================================
   Alertas
   ============================================ */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.alert i {
    font-size: 1.1rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #ecfdf5;
    color: var(--success);
    border: 1px solid #a7f3d0;
}

.alert-warning {
    background: #fffbeb;
    color: #d97706;
    border: 1px solid #fde68a;
}

/* ============================================
   Cards de Estatísticas
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    display: flex;
    align-items: center;
    gap: 20px;
    border: none;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--primary);
    background: var(--primary-light);
    border: none;
    box-shadow: none;
}

.bg-primary {
    background: var(--primary);
}

.bg-success {
    background: var(--success);
}

.bg-warning {
    background: var(--warning);
}

.bg-info {
    background: var(--info);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ============================================
   Welcome Card
   ============================================ */
.welcome-card {
    background: white;
    border-radius: var(--radius-xl);
    padding: 50px;
    text-align: center;
    box-shadow: var(--shadow);
}

.welcome-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 25px;
}

.welcome-icon i {
    font-size: 36px;
    color: white;
}

.welcome-card h2 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.welcome-card>p {
    color: var(--gray-500);
    margin-bottom: 40px;
}

.welcome-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
    text-align: left;
}

.step {
    display: flex;
    gap: 15px;
}

.step-number {
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 0.95rem;
    color: var(--gray-800);
    margin-bottom: 5px;
}

.step-content p {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ============================================
   Seções
   ============================================ */
.section {
    margin-bottom: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 1.1rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary);
}

/* ============================================
   Grid de Concursos
   ============================================ */
.concursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.concurso-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    border: none;
}

.concurso-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

.concurso-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.concurso-status {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-ativo {
    background: #ecfdf5;
    color: var(--success);
}

.status-pausado {
    background: #fffbeb;
    color: #d97706;
}

.status-concluido {
    background: #eff6ff;
    color: var(--info);
}

.concurso-actions {
    display: flex;
    gap: 5px;
}

.concurso-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.concurso-title a {
    color: var(--gray-900);
    transition: var(--transition);
}

.concurso-title a:hover {
    color: var(--primary);
}

.concurso-date {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.concurso-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.concurso-stats span {
    font-size: 0.85rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 5px;
}

.progress-container {
    margin-bottom: 15px;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.progress-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.add-card {
    border: 2px dashed var(--gray-300);
    background: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    cursor: pointer;
    color: var(--gray-500);
}

.add-card:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.add-icon {
    width: 50px;
    height: 50px;
    border: 2px dashed currentColor;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* ============================================
   Detalhes do Concurso
   ============================================ */
.concurso-detail-header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.concurso-info h1 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-top: 10px;
    margin-bottom: 10px;
}

.concurso-descricao {
    color: var(--gray-600);
    max-width: 600px;
}

.concurso-progress-card {
    text-align: center;
}

.progress-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
}

.progress-circle svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-bg {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 8;
}

.progress-bar-circle {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    transition: stroke-dashoffset 0.5s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

.progress-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.countdown {
    padding: 10px 20px;
    background: var(--gray-100);
    border-radius: var(--radius);
    display: inline-block;
}

.countdown-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.countdown-label {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-500);
}

.countdown.urgent {
    background: #fef2f2;
}

.countdown.urgent .countdown-value {
    color: var(--danger);
}

.countdown.passed {
    background: var(--gray-200);
}

.countdown.passed .countdown-value {
    color: var(--gray-500);
    font-size: 0.9rem;
}

/* ============================================
   Grid de Matérias
   ============================================ */
.materias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.materia-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-top: 4px solid var(--materia-color, var(--primary));
}

.materia-card:hover {
    box-shadow: var(--shadow-lg);
}

.materia-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.materia-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.materia-title {
    font-size: 1.1rem;
    color: var(--gray-900);
    margin-bottom: 10px;
}

.materia-stats {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-bottom: 15px;
}

.materia-stats i {
    margin-right: 5px;
}

.progress-text-small {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-left: 10px;
}

.materia-card.add-card {
    border-top-color: transparent;
}

/* ============================================
   Estado Vazio
   ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.empty-icon {
    width: 80px;
    height: 80px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.empty-icon i {
    font-size: 32px;
    color: var(--gray-400);
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--gray-800);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 25px;
}

/* ============================================
   Modal
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-lg {
    max-width: 600px;
}

.modal-sm {
    max-width: 400px;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header h3 i {
    color: var(--primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--gray-400);
    cursor: pointer;
    padding: 5px;
}

.modal-close:hover {
    color: var(--gray-600);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px;
    border-top: 1px solid var(--gray-200);
}

/* Color Picker */
.color-picker {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-option {
    cursor: pointer;
}

.color-option input {
    display: none;
}

.color-swatch {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: var(--radius);
    border: 3px solid transparent;
    transition: var(--transition);
}

.color-option input:checked+.color-swatch {
    border-color: var(--gray-800);
    transform: scale(1.1);
}

.color-option:hover .color-swatch {
    transform: scale(1.1);
}

/* ============================================
   Matéria Detail Header
   ============================================ */
.materia-detail-header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 5px solid var(--materia-color, var(--primary));
}

.materia-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.materia-badge {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.materia-badge i {
    font-size: 28px;
    color: white;
}

.materia-info h1 {
    font-size: 1.4rem;
    color: var(--gray-900);
    margin-bottom: 5px;
}

.materia-info p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.materia-progress-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-circle-small {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background: conic-gradient(var(--color, var(--primary)) calc(var(--progress, 0) * 1%),
            var(--gray-200) 0%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.progress-circle-small::before {
    content: '';
    position: absolute;
    width: 48px;
    height: 48px;
    background: white;
    border-radius: var(--radius-full);
}

.progress-circle-small span {
    position: relative;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-800);
}

.materia-progress-info>span {
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* ============================================
   Instruction Card
   ============================================ */
.instruction-card {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.instruction-icon {
    width: 45px;
    height: 45px;
    background: white;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.instruction-icon i {
    font-size: 20px;
    color: var(--warning);
}

.instruction-content h4 {
    font-size: 0.95rem;
    color: var(--gray-800);
    margin-bottom: 3px;
}

.instruction-content p {
    font-size: 0.85rem;
    color: var(--gray-600);
}

/* ============================================
   Lista de Aulas
   ============================================ */
.aulas-legend {
    display: flex;
    gap: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-sm);
}

.legend-color.pending {
    background: var(--gray-300);
}

.legend-color.completed {
    background: var(--success);
}

.aulas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aula-item {
    background: white;
    border-radius: var(--radius-lg);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: var(--transition);
    border-left: 4px solid var(--gray-300);
}

.aula-item:hover {
    box-shadow: var(--shadow);
    transform: translateX(5px);
}

.aula-item.completed {
    border-left-color: var(--success);
    background: #f0fdf4;
}

.aula-checkbox {
    flex-shrink: 0;
}

.checkbox-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--gray-300);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-btn:hover {
    color: var(--success);
    transform: scale(1.1);
}

.checkbox-btn.checked {
    color: var(--success);
}

.aula-info {
    flex: 1;
    min-width: 0;
}

.aula-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 5px;
}

.aula-numero {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.aula-data {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 5px;
}

.aula-assunto {
    color: var(--gray-800);
    line-height: 1.5;
}

/* Modal Form Styles */
.form-input,
.form-textarea,
.form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

font-size: 1rem;
color: var(--gray-800);
font-weight: 500;
margin-bottom: 3px;
}

.aula-assunto .text-muted {
    color: var(--gray-400);
    font-weight: 400;
    font-style: italic;
}

.aula-anotacoes-preview {
    font-size: 0.8rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 8px;
}

.aula-anotacoes-preview i {
    color: var(--warning);
}

.aula-actions {
    flex-shrink: 0;
    color: var(--gray-400);
}

/* ============================================
   Utilitários
   ============================================ */
.text-muted {
    color: var(--gray-400) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-success {
    color: var(--success) !important;
}

/* ============================================
   Responsividade
   ============================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .welcome-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-container {
        flex-direction: column;
    }

    .form-tips {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 15px;
    }

    .sidebar-toggle {
        display: block;
    }

    .auth-container {
        flex-direction: column;
    }

    .auth-features {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .welcome-steps {
        grid-template-columns: 1fr;
    }

    .concurso-detail-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .materia-detail-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .materia-info {
        flex-direction: column;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .header-right {
        flex-direction: column;
        gap: 8px;
    }

    .header-right .btn {
        width: 100%;
        justify-content: center;
    }

    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .concursos-grid,
    .materias-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 25px;
    }

    .aulas-legend {
        flex-direction: column;
        gap: 10px;
    }
}

/* ============================================
   Overlay para Mobile
   ============================================ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}

.sidebar-overlay.active {
    display: block;
}

/* ============================================
   Ciclos de Estudo
   ============================================ */
.ciclos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.ciclo-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.ciclo-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.ciclo-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.ciclo-status {
    font-size: 0.8rem;
    font-weight: 500;
}

.ciclo-title {
    font-size: 1.15rem;
    margin-bottom: 12px;
}

.ciclo-title a {
    color: var(--gray-900);
    transition: var(--transition);
}

.ciclo-title a:hover {
    color: var(--primary);
}

.ciclo-config {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--gray-500);
}

.ciclo-config span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.ciclo-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.ciclo-stats .stat-item {
    flex: 1;
    text-align: center;
}

.ciclo-stats .stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-800);
}

.ciclo-stats .stat-label {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Ciclo Detail Header */
.ciclo-detail-header {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ciclo-info h1 {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin: 10px 0;
}

.ciclo-config-info {
    display: flex;
    gap: 20px;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.ciclo-config-info span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ciclo-stats-summary {
    display: flex;
    gap: 30px;
}

.stat-box {
    text-align: center;
    padding: 15px 25px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.stat-box .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-box .stat-label {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* Próxima Sessão Card */
.proxima-sessao-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: 30px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.proxima-label {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    margin-bottom: 10px;
}

.proxima-info h3 {
    font-size: 1.25rem;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.materia-dot {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    display: inline-block;
}

.proxima-info p {
    opacity: 0.9;
}

/* Ciclo Content Grid */
.ciclo-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

/* Ciclo Materias List */
.ciclo-materias-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ciclo-materia-item {
    background: white;
    border-radius: var(--radius);
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.ciclo-materia-item:hover {
    box-shadow: var(--shadow);
}

.ciclo-materia-item.proxima {
    border: 2px solid var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.materia-ordem {
    width: 32px;
    height: 32px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--gray-600);
    flex-shrink: 0;
}

.ciclo-materia-item.proxima .materia-ordem {
    background: var(--primary);
    color: white;
}

.materia-info-ciclo {
    flex: 1;
    min-width: 0;
}

.materia-header-ciclo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.materia-color-dot {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.materia-header-ciclo h4 {
    font-size: 0.95rem;
    color: var(--gray-800);
}

.badge-proxima {
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: var(--radius-full);
}

.materia-details {
    display: flex;
    gap: 15px;
    font-size: 0.8rem;
    color: var(--gray-500);
    margin-bottom: 8px;
}

.materia-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.concurso-name {
    color: var(--gray-400);
}

.progress-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-mini .progress-bar {
    flex: 1;
    height: 6px;
}

.progress-mini span {
    font-size: 0.75rem;
    color: var(--gray-500);
    min-width: 35px;
}

/* Sessões List */
.sessoes-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sessao-item {
    background: white;
    border-radius: var(--radius);
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow-sm);
}

.sessao-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.sessao-info {
    flex: 1;
    min-width: 0;
}

.sessao-info h4 {
    font-size: 0.9rem;
    color: var(--gray-800);
    margin-bottom: 3px;
}

.sessao-info p {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.sessao-parou {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--warning);
    background: #fffbeb;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    margin-top: 5px;
}

.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: #ecfdf5;
    color: var(--success);
}

.badge-warning {
    background: #fffbeb;
    color: #d97706;
}

.empty-state-small {
    text-align: center;
    padding: 40px;
    color: var(--gray-400);
    background: white;
    border-radius: var(--radius);
}

.empty-state-small i {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Form Container Full */
.form-container-full {
    max-width: 900px;
}

.form-card-large {
    background: white;
    border-radius: var(--radius-lg);
    padding: 35px;
    box-shadow: var(--shadow);
}

.form-section {
    margin-bottom: 35px;
    padding-bottom: 35px;
    border-bottom: 1px solid var(--gray-200);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 25px;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 1.1rem;
    color: var(--gray-800);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-badge {
    width: 28px;
    height: 28px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
}

.form-section-desc {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* Materias Selector */
.materias-selector {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.concurso-group {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.concurso-group-title {
    font-size: 0.95rem;
    color: var(--gray-700);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.concurso-group-title i {
    color: var(--warning);
}

.materias-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.materia-option {
    cursor: pointer;
}

.materia-option input {
    display: none;
}

.materia-option-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: white;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: var(--transition);
}

.materia-option input:checked+.materia-option-content {
    border-color: var(--color, var(--primary));
    background: rgba(99, 102, 241, 0.05);
}

.materia-option:hover .materia-option-content {
    border-color: var(--gray-300);
}

.materia-option .materia-color {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.materia-option .materia-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--gray-800);
}

.materia-option .materia-aulas {
    font-size: 0.75rem;
    color: var(--gray-400);
}

.materia-option .materia-order {
    width: 22px;
    height: 22px;
    background: var(--primary);
    color: white;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Ordem List */
.ordem-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ordem-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    cursor: grab;
    transition: var(--transition);
}

.ordem-item:active {
    cursor: grabbing;
}

.ordem-item.dragging {
    opacity: 0.5;
    border-style: dashed;
}

.ordem-handle {
    color: var(--gray-400);
    cursor: grab;
}

.ordem-number {
    width: 24px;
    height: 24px;
    background: var(--gray-100);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-600);
}

.ordem-color {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
}

.ordem-name {
    flex: 1;
    font-size: 0.9rem;
    color: var(--gray-800);
}

/* Responsivo para Ciclos */
@media (max-width: 1024px) {
    .ciclo-content-grid {
        grid-template-columns: 1fr;
    }
}

/* Consistency Widget (Timeline Style) */
.consistency-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 15px;
    padding: 0 10px;
}

.btn-icon-small {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-small:hover:not(:disabled) {
    background: var(--gray-100);
    color: var(--primary);
}

.btn-icon-small:disabled {
    cursor: not-allowed;
    opacity: 0.3;
}

.consistency-title h2 {
    font-size: 0.75rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.streak-subtitle {
    font-size: 1.1rem;
    color: var(--gray-800);
}

.streak-subtitle strong {
    color: var(--primary);
    font-weight: 800;
}

.consistency-date-range {
    font-size: 0.8rem;
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    gap: 10px;
}

.timeline-card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 30px;
}

.streak-timeline {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    /* Scrollbar spacing */
    scrollbar-width: thin;
}

.timeline-day {
    flex: 1;
    min-width: 28px;
    height: 38px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: all 0.2s ease;
    cursor: default;
    position: relative;
}

.timeline-day:hover {
    transform: translateY(-2px);
}

.timeline-day.studied {
    background: #10b981;
    /* Emerald 500 */
    color: white;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.timeline-day.missed {
    background: #fee2e2;
    /* Red 100 */
    color: #ef4444;
    /* Red 500 */
}

.timeline-day.missed::after {
    content: '×';
    font-weight: bold;
    font-size: 1rem;
    opacity: 0.5;
}

.streak-ai-feedback-mini {
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--gray-600);
    background: var(--gray-50);
    padding: 8px 12px;
    border-radius: var(--radius);
    display: inline-block;
    border-left: 3px solid #fbbf24;
    /* Amber */
}

.streak-ai-feedback-mini i {
    color: #fbbf24;
    margin-right: 5px;
}



@media (max-width: 768px) {
    .ciclos-grid {
        grid-template-columns: 1fr;
    }

    .materias-options {
        grid-template-columns: 1fr;
    }

    .ciclo-config-info {
        flex-direction: column;
        gap: 8px;
    }

    .materia-details {
        flex-wrap: wrap;
    }
}

/* ============================================
   Estatísticas de Estudo - Concurso Ver
   ============================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-time .stat-icon {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

.stat-hours .stat-icon {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.stat-sessions .stat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: var(--info);
}

.stat-lessons .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-800);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--gray-500);
}

/* ============================================
   Sistema de Premiação / Conquistas
   ============================================ */

.achievements-container {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
}

.achievements-progress {
    position: relative;
    margin-bottom: 40px;
    padding: 20px 0;
}

.achievements-bar {
    height: 12px;
    background: var(--gray-200);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.achievements-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success), #f1c40f, #e74c3c, #9b59b6);
    border-radius: 6px;
    transition: width 1s ease;
}

.achievements-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.achievement-marker {
    position: absolute;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
}

.marker-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--gray-300);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    margin: 0 auto -8px;
    border: 3px solid white;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.achievement-marker.achieved .marker-icon {
    transform: scale(1.1);
    animation: achievePulse 2s infinite;
}

@keyframes achievePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
    }
}

.marker-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-top: 25px;
}

.achievement-marker.achieved .marker-label {
    color: var(--gray-800);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
}

.achievement-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border-radius: var(--radius);
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    transition: var(--transition);
}

.achievement-badge.achieved {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(16, 185, 129, 0.05));
    border-color: var(--primary-light);
}

.achievement-badge.locked {
    opacity: 0.6;
}

.badge-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--gray-300);
    color: var(--gray-500);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.achievement-badge.achieved .badge-icon {
    animation: badgeGlow 2s infinite alternate;
}

@keyframes badgeGlow {
    from {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.3);
    }

    to {
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
    }
}

.badge-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.badge-hours {
    font-weight: 700;
    font-size: 1rem;
    color: var(--gray-800);
}

.badge-status {
    font-size: 0.75rem;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 5px;
}

.achievement-badge.achieved .badge-status {
    color: var(--success);
}

/* ============================================
   Tempo de Estudo nas Matérias
   ============================================ */

.materia-time-study {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 12px;
    margin: 15px 0;
}

.time-study-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.time-study-values {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.time-part {
    font-size: 0.9rem;
    color: var(--gray-700);
}

.time-part strong {
    font-size: 1.1rem;
    color: var(--gray-800);
}

.no-study {
    font-size: 0.85rem;
    color: var(--gray-400);
    font-style: italic;
}

/* ============================================
   Ciclos no Concurso Ver - Detalhado
   ============================================ */

.ciclo-stats-detailed {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 15px 0;
}

.ciclo-stat {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
}

.ciclo-stat i {
    color: var(--primary);
}

.ciclo-time-breakdown {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius);
    padding: 15px;
    margin: 15px 0;
    color: white;
}

.time-title {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.time-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.time-unit {
    text-align: center;
}

.time-number {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.time-label {
    font-size: 0.7rem;
    opacity: 0.8;
    text-transform: uppercase;
}

.time-separator {
    font-size: 1.5rem;
    font-weight: 700;
    opacity: 0.5;
    margin-bottom: 15px;
}

.ciclo-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

/* Responsivo para estatísticas e conquistas */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .achievements-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .achievement-marker .marker-label {
        font-size: 0.6rem;
    }

    .marker-icon {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }

    .achievements-markers {
        display: none;
    }

    .time-number {
        font-size: 1.4rem;
    }
}

/* ============================================
   Sistema de Revisões - Estilos para estudar.php
   ============================================ */

/* Campos obrigatórios */
.campo-obrigatorio label::after {
    content: ' *';
    color: var(--danger);
    font-weight: bold;
}

.obrigatorio {
    color: var(--danger);
    font-weight: bold;
}

/* Caixa de informação sobre revisões */
.revisao-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--radius);
    padding: 20px;
    margin-top: 20px;
}

.revisao-info h4 {
    font-size: 1rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.revisao-info p {
    font-size: 0.85rem;
    opacity: 0.95;
    margin-bottom: 8px;
}

.revisao-info ul {
    font-size: 0.85rem;
    margin-left: 20px;
    opacity: 0.9;
}

.revisao-info li {
    margin-bottom: 4px;
}

/* Badge para revisões pendentes na navegação */
.nav-badge {
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

.nav-item .nav-badge.warning {
    background: var(--warning);
}

.nav-item .nav-badge.success {
    background: var(--success);
}

/* Texto de ajuda nos campos */
.text-muted {
    color: var(--gray-500);
    font-size: 0.85rem;
}

/* Classes utilitárias para textos coloridos */
.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.text-warning {
    color: var(--warning);
}

.text-info {
    color: var(--info);
}

/* ============================================
   Alerta de Revisões na Dashboard
   ============================================ */

.revisoes-alert {
    display: block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 25px;
    color: white;
    text-decoration: none;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
}

.revisoes-alert:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.revisoes-alert-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.revisoes-alert-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.revisoes-alert-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.revisoes-alert-text strong {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.revisoes-alert-text strong.text-danger {
    color: #ffc9c9;
}

.revisoes-alert-text span {
    font-size: 0.9rem;
    opacity: 0.9;
}

.revisoes-alert-action .btn {
    background: white;
    color: var(--primary);
    border: none;
}

.revisoes-alert-action .btn:hover {
    background: rgba(255, 255, 255, 0.9);
}

@media (max-width: 600px) {
    .revisoes-alert-content {
        flex-direction: column;
        text-align: center;
    }

    .revisoes-alert-text {
        align-items: center;
    }
}

/* ============================================
   Revisões no Concurso Ver
   ============================================ */

.revisoes-section-concurso .section-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.revisoes-resumo {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.revisoes-resumo-stats {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--gray-200);
}

.revisao-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border-right: 1px solid var(--gray-200);
}

.revisao-stat:last-child {
    border-right: none;
}

.revisao-stat i {
    font-size: 1.2rem;
    margin-bottom: 8px;
    opacity: 0.7;
}

.revisao-stat .numero {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.revisao-stat .label {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.revisao-stat.atrasada {
    background: #fef2f2;
}

.revisao-stat.atrasada i,
.revisao-stat.atrasada .numero {
    color: var(--danger);
}

.revisao-stat.hoje {
    background: #fffbeb;
}

.revisao-stat.hoje i,
.revisao-stat.hoje .numero {
    color: var(--warning);
}

.revisao-stat.total i,
.revisao-stat.total .numero {
    color: var(--primary);
}

.revisoes-lista-compacta {
    max-height: 320px;
    overflow-y: auto;
}

.revisao-item-compacto {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}

.revisao-item-compacto:last-child {
    border-bottom: none;
}

.revisao-item-compacto:hover {
    background: var(--gray-50);
}

.revisao-item-compacto.atrasada {
    background: #fef2f2;
}

.revisao-item-compacto.atrasada:hover {
    background: #fee2e2;
}

.revisao-item-compacto.hoje {
    background: #fffbeb;
}

.revisao-item-compacto.hoje:hover {
    background: #fef3c7;
}

.revisao-cor {
    width: 4px;
    height: 40px;
    border-radius: 4px;
    flex-shrink: 0;
}

.revisao-info-compacta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.revisao-info-compacta .revisao-materia {
    font-size: 0.75rem;
    color: var(--gray-500);
    font-weight: 500;
}

.revisao-info-compacta .revisao-assunto {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray-800);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.revisao-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}

.revisao-tipo {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: var(--gray-100);
    color: var(--gray-600);
}

.revisao-tipo.tipo-mesmo_dia {
    background: #fef3c7;
    color: #92400e;
}

.revisao-tipo.tipo-24h {
    background: #dbeafe;
    color: #1e40af;
}

.revisao-tipo.tipo-48h {
    background: #e0e7ff;
    color: #3730a3;
}

.revisao-tipo.tipo-7d {
    background: #d1fae5;
    color: #065f46;
}

.revisao-tipo.tipo-15d {
    background: #fce7f3;
    color: #9d174d;
}

.revisao-atraso {
    font-size: 0.7rem;
    color: var(--danger);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.revisao-hoje-badge {
    font-size: 0.7rem;
    color: var(--warning);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.revisao-data {
    font-size: 0.75rem;
    color: var(--gray-500);
}

@media (max-width: 600px) {
    .revisoes-resumo-stats {
        flex-wrap: wrap;
    }

    .revisao-stat {
        min-width: 50%;
    }

    .revisao-stat:nth-child(2) {
        border-right: none;
    }

    .revisao-info-compacta .revisao-assunto {
        font-size: 0.8rem;
    }
}

/* ============================================
   Widget de Revisões Compacto (concurso_ver)
   ============================================ */

.revisoes-widget {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.revisoes-alerta-atrasadas {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.revisoes-alerta-atrasadas:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.revisoes-alerta-atrasadas i:first-child {
    font-size: 1.1rem;
}

.revisoes-alerta-atrasadas span {
    flex: 1;
}

.revisoes-alerta-atrasadas i:last-child {
    opacity: 0.7;
}

.revisoes-grid-compacta {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.revisao-bloco {
    padding: 16px;
    border-right: 1px solid var(--gray-100);
}

.revisao-bloco:last-child {
    border-right: none;
}

.revisao-bloco-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--gray-100);
}

.revisao-bloco.ativo .revisao-bloco-header {
    border-bottom-color: var(--primary);
}

.revisao-bloco-dia {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
}

.revisao-bloco-count {
    background: var(--gray-100);
    color: var(--gray-600);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
}

.revisao-bloco.ativo .revisao-bloco-count {
    background: var(--primary);
    color: white;
}

.revisao-bloco-lista {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.revisao-mini {
    padding: 8px 10px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gray-300);
}

.revisao-mini-materia {
    display: block;
    font-size: 0.65rem;
    color: var(--gray-500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}

.revisao-mini-assunto {
    display: block;
    font-size: 0.8rem;
    color: var(--gray-700);
    font-weight: 500;
    line-height: 1.3;
}

.revisao-ver-mais {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    padding: 6px;
    margin-top: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.revisao-ver-mais:hover {
    background: var(--gray-100);
}

.revisao-bloco-vazio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    color: var(--gray-400);
    text-align: center;
}

.revisao-bloco-vazio i {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--success);
    opacity: 0.6;
}

.revisao-bloco-vazio span {
    font-size: 0.8rem;
}

/* Mini calendário da semana */
.revisao-calendario-mini {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.calendario-dia-mini {
    flex: 1;
    min-width: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 4px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.calendario-dia-mini:hover {
    background: var(--primary-light);
    color: white;
}

.calendario-dia-mini:hover .dia-nome,
.calendario-dia-mini:hover .dia-num,
.calendario-dia-mini:hover .dia-qtd {
    color: white;
}

.calendario-dia-mini .dia-nome {
    font-size: 0.6rem;
    color: var(--gray-500);
    text-transform: uppercase;
    font-weight: 500;
}

.calendario-dia-mini .dia-num {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-700);
    line-height: 1.2;
}

.calendario-dia-mini .dia-qtd {
    font-size: 0.65rem;
    background: var(--primary);
    color: white;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 3px;
}

@media (max-width: 500px) {
    .revisoes-grid-compacta {
        grid-template-columns: 1fr;
    }

    .revisao-bloco {
        border-right: none;
        border-bottom: 1px solid var(--gray-100);
    }

    .revisao-bloco:last-child {
        border-bottom: none;
    }

    .revisao-calendario-mini {
        justify-content: space-between;
    }

    .calendario-dia-mini {
        min-width: 45px;
    }
}

/* ============================================
   Banner de Sessão Ativa (Cronômetro Persistente)
   ============================================ */

.sessao-ativa-banner {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: var(--radius);
    padding: 15px 20px;
    margin-bottom: 25px;
    color: white;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.sessao-ativa-pulse {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--success);
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 5px var(--success), 0 0 10px var(--success);
        opacity: 1;
    }

    50% {
        box-shadow: 0 0 20px var(--success), 0 0 30px var(--success);
        opacity: 0.7;
    }
}

.sessao-ativa-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    animation: pulse-scale 2s ease-in-out infinite;
}

@keyframes pulse-scale {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.sessao-ativa-info {
    flex: 1;
    min-width: 0;
}

.sessao-ativa-info strong {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
    margin-bottom: 2px;
}

.sessao-ativa-info span {
    font-size: 1rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.sessao-ativa-timer {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: var(--radius);
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 700;
}

.sessao-ativa-timer i {
    color: var(--success);
    animation: blink 1s step-end infinite;
}

@keyframes blink {
    50% {
        opacity: 0.5;
    }
}

.sessao-ativa-banner .btn-success {
    flex-shrink: 0;
}

.sessao-ativa-banner .btn-outline-danger {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #fca5a5;
    padding: 8px 12px;
    flex-shrink: 0;
}

.sessao-ativa-banner .btn-outline-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: white;
}

@media (max-width: 768px) {
    .sessao-ativa-banner {
        flex-wrap: wrap;
        gap: 12px;
    }

    .sessao-ativa-info {
        flex: 1 1 100%;
        order: -1;
        margin-left: 55px;
    }

    .sessao-ativa-icon {
        position: absolute;
        left: 20px;
    }

    .sessao-ativa-timer {
        flex: 1;
    }
}

@media (max-width: 480px) {
    .sessao-ativa-banner {
        padding: 12px 15px;
    }

    .sessao-ativa-timer {
        font-size: 1rem;
        padding: 6px 10px;
    }

    .sessao-ativa-banner .btn-success {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}

/* Timer esgotado no estudar.php */
.timer-display.tempo-esgotado {
    animation: tempo-esgotado-pulse 1s ease-in-out infinite;
}

@keyframes tempo-esgotado-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 15px rgba(239, 68, 68, 0);
    }
}

.timer-display.tempo-esgotado .timer-time {
    color: var(--danger) !important;
}

/* ============================================
   Constância nos Estudos Widget
   ============================================ */
.consistency-section {
    margin-bottom: 30px;
}

.consistency-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.consistency-title h2 {
    font-size: 1.25rem;
    color: var(--gray-900);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.streak-subtitle {
    font-size: 0.9rem;
    color: var(--gray-600);
}

.consistency-date-range {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 8px 15px;
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-sm);
}

.btn-icon-small {
    background: none;
    border: none;
    color: var(--gray-500);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 5px;
    border-radius: 50%;
    transition: var(--transition);
}

.btn-icon-small:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.btn-icon-small:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.consistency-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow);
}

.streak-timeline {
    display: flex;
    justify-content: space-between;
    gap: 3px;
    margin-bottom: 20px;
}

.timeline-day {
    flex: 1;
    height: 30px;
    background: var(--gray-100);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: var(--transition);
}

.timeline-day.studied {
    background: var(--success);
    color: white;
}

.timeline-day.missed {
    background: var(--gray-200);
}

.timeline-day.future {
    opacity: 0.5;
    background: transparent;
    border: 1px dashed var(--gray-300);
}

.timeline-day i {
    font-size: 0.7rem;
}

/* Tooltip for day label */
.timeline-day:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--gray-800);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    white-space: nowrap;
    margin-bottom: 5px;
    z-index: 10;
}

.streak-ai-feedback-mini {
    background: #f8f9fa;
    border-radius: var(--radius);
    padding: 15px;
    border-left: 3px solid var(--primary);
    font-size: 0.9rem;
}

.ai-loading-mini,
.ai-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--gray-700);
}

.ai-message i {
    color: var(--primary);
}

@media (max-width: 768px) {
    .consistency-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .consistency-date-range {
        width: 100%;
        justify-content: space-between;
    }
}

/* ============================================================
   FOCUS OS  —  Temas claro/escuro (camada de redesign)
   Claro (padrao do CSS original) = branco com destaques coloridos.
   Escuro = escopado em [data-theme="dark"], ativado pelo toggle.
   ============================================================ */

/* Acentos compartilhados pelos dois temas */
:root {
    --brand-grad: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --accent-cyan: #06b6d4;
    --accent-pink: #ec4899;
    --accent-violet: #8b5cf6;
}

/* Botao de alternancia de tema (funciona nos dois temas via tokens) */
.theme-toggle-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 16px;
    margin-bottom: 12px;
    border: none;
    cursor: pointer;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 500;
    font-family: inherit;
    background: var(--gray-100);
    color: var(--gray-600);
    transition: var(--transition);
}
.theme-toggle-btn:hover {
    background: var(--primary);
    color: #fff;
}

/* Brand gradient no botao primario (vale para os dois temas) */
.btn-primary {
    background: var(--brand-grad);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

/* Constancia: heatmap positivo (remove os X vermelhos) nos dois temas */
.timeline-day.missed::after { content: ''; }

/* ============================================================
   TEMA ESCURO
   ============================================================ */
[data-theme="dark"] {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;

    --canvas: #12161f;
    --surface: #1e2634;
    --surface-2: #27303f;
    --surface-3: #323c4d;
    --border-soft: rgba(255, 255, 255, 0.08);
    --border-mid: rgba(255, 255, 255, 0.14);

    --gray-50: #1c2431;
    --gray-100: #151a24;
    --gray-200: #283143;
    --gray-300: #3c465b;
    --gray-400: #7b8398;
    --gray-500: #99a1b3;
    --gray-600: #b5bccb;
    --gray-700: #ced3de;
    --gray-800: #e3e7ee;
    --gray-900: #f4f6fb;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
    --shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.50);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.55);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.60);

    --radius-lg: 0.9rem;
    --radius-xl: 1.25rem;
}

[data-theme="dark"] body {
    background-color: var(--canvas);
    background-image:
        radial-gradient(1100px 560px at 82% -12%, rgba(99, 102, 241, 0.12), transparent 60%),
        radial-gradient(900px 500px at -12% 112%, rgba(16, 185, 129, 0.08), transparent 60%);
    background-attachment: fixed;
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] * {
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
}
[data-theme="dark"] *::-webkit-scrollbar { width: 10px; height: 10px; }
[data-theme="dark"] *::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

[data-theme="dark"] .auth-card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .form-card-large,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .welcome-card,
[data-theme="dark"] .concurso-card,
[data-theme="dark"] .materia-card,
[data-theme="dark"] .empty-state,
[data-theme="dark"] .empty-state-small,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .aula-item,
[data-theme="dark"] .ciclo-card,
[data-theme="dark"] .ciclo-materia-item,
[data-theme="dark"] .sessao-item,
[data-theme="dark"] .materia-option-content,
[data-theme="dark"] .ordem-item,
[data-theme="dark"] .timeline-card,
[data-theme="dark"] .achievements-container,
[data-theme="dark"] .revisoes-resumo,
[data-theme="dark"] .revisoes-widget,
[data-theme="dark"] .consistency-card,
[data-theme="dark"] .consistency-date-range,
[data-theme="dark"] .concurso-detail-header,
[data-theme="dark"] .materia-detail-header,
[data-theme="dark"] .ciclo-detail-header {
    background: var(--surface);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .stat-card:hover,
[data-theme="dark"] .concurso-card:hover,
[data-theme="dark"] .ciclo-card:hover {
    border: none;
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
}

[data-theme="dark"] .form-tips,
[data-theme="dark"] .concurso-group,
[data-theme="dark"] .ciclo-stats,
[data-theme="dark"] .stat-box,
[data-theme="dark"] .achievement-badge,
[data-theme="dark"] .materia-time-study,
[data-theme="dark"] .calendario-dia-mini,
[data-theme="dark"] .revisao-mini,
[data-theme="dark"] .streak-ai-feedback-mini,
[data-theme="dark"] .ciclo-stat,
[data-theme="dark"] .revisao-tipo,
[data-theme="dark"] .revisao-bloco-count {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
}

[data-theme="dark"] .materia-ordem,
[data-theme="dark"] .ordem-number,
[data-theme="dark"] .btn-icon,
[data-theme="dark"] .countdown {
    background: var(--surface-2);
    color: var(--gray-700);
}

[data-theme="dark"] .sidebar {
    background: var(--surface);
    border-right: 1px solid var(--border-soft);
    box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .nav-item.active {
    background: var(--surface-2);
    box-shadow: inset 0 0 0 1px var(--primary-dark);
    color: var(--primary-light);
    border-left: none;
}
[data-theme="dark"] .btn-logout { background: var(--surface-2); }

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .form-group select,
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .form-control {
    background: var(--surface-2);
    border-color: var(--border-mid);
    color: var(--gray-900);
}
[data-theme="dark"] .form-group input::placeholder,
[data-theme="dark"] .form-group textarea::placeholder { color: var(--gray-400); }

[data-theme="dark"] .modal {
    background: rgba(6, 9, 15, 0.65);
    backdrop-filter: blur(4px);
}

[data-theme="dark"] .alert-error { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.30); color: #fca5a5; }
[data-theme="dark"] .alert-success { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.30); color: #6ee7b7; }
[data-theme="dark"] .alert-warning { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.30); color: #fcd34d; }

[data-theme="dark"] .status-ativo, [data-theme="dark"] .badge-success { background: rgba(16, 185, 129, 0.16); color: #6ee7b7; }
[data-theme="dark"] .status-pausado, [data-theme="dark"] .badge-warning { background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
[data-theme="dark"] .status-concluido { background: rgba(59, 130, 246, 0.16); color: #93c5fd; }

[data-theme="dark"] .aula-item.completed { background: rgba(16, 185, 129, 0.08); }
[data-theme="dark"] .countdown.urgent { background: rgba(239, 68, 68, 0.14); }
[data-theme="dark"] .countdown.passed { background: var(--surface-2); }

[data-theme="dark"] .revisao-stat.atrasada, [data-theme="dark"] .revisao-item-compacto.atrasada { background: rgba(239, 68, 68, 0.10); }
[data-theme="dark"] .revisao-item-compacto.atrasada:hover { background: rgba(239, 68, 68, 0.16); }
[data-theme="dark"] .revisao-stat.hoje, [data-theme="dark"] .revisao-item-compacto.hoje { background: rgba(245, 158, 11, 0.10); }
[data-theme="dark"] .revisao-item-compacto.hoje:hover { background: rgba(245, 158, 11, 0.16); }
[data-theme="dark"] .revisao-item-compacto:hover { background: var(--surface-2); }

[data-theme="dark"] .revisao-tipo.tipo-mesmo_dia { background: rgba(245, 158, 11, 0.18); color: #fcd34d; }
[data-theme="dark"] .revisao-tipo.tipo-24h { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
[data-theme="dark"] .revisao-tipo.tipo-48h { background: rgba(99, 102, 241, 0.20); color: #a5b4fc; }
[data-theme="dark"] .revisao-tipo.tipo-7d { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; }
[data-theme="dark"] .revisao-tipo.tipo-15d { background: rgba(236, 72, 153, 0.18); color: #f9a8d4; }

[data-theme="dark"] .sessao-parou { background: rgba(245, 158, 11, 0.12); }
[data-theme="dark"] .instruction-card { background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(16, 185, 129, 0.10)); }
[data-theme="dark"] .instruction-icon { background: var(--surface-2); }
[data-theme="dark"] .revisao-mini { border-left-color: var(--surface-3); }

[data-theme="dark"] .progress-circle-small::before { background: var(--surface); }

[data-theme="dark"] .timeline-day { background: var(--surface-2); }
[data-theme="dark"] .timeline-day.studied {
    background: #10b981;
    color: #fff;
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.35), 0 2px 6px rgba(16, 185, 129, 0.25);
}
[data-theme="dark"] .timeline-day.missed { background: var(--surface-2); color: var(--gray-500); }
[data-theme="dark"] .timeline-day.future { background: transparent; border: 1px dashed var(--gray-300); }
[data-theme="dark"] .timeline-day:hover::after {
    background: #0c111b;
    color: #fff;
    border: 0.5px solid var(--border-mid);
}

[data-theme="dark"] .nav-badge { color: #fff; }
[data-theme="dark"] .revisao-bloco-count { color: var(--gray-700); }

[data-theme="dark"] .content-header { border-bottom-color: var(--border-soft); }
[data-theme="dark"] .form-actions,
[data-theme="dark"] .modal-header,
[data-theme="dark"] .modal-footer { border-color: var(--border-soft); }