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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    min-height: 100vh;
}

/* ===== BACKUP WARNING ===== */
.backup-warning {
    background: linear-gradient(90deg, #92400e, #78350f);
    color: #fef3c7;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.backup-warning-btns { display: flex; gap: 8px; }

.backup-warning-btns button {
    background: #fbbf24;
    color: #78350f;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
}

.backup-warning-btns button:last-child {
    background: transparent;
    color: #fef3c7;
    border: 1px solid #fef3c7;
}

/* ===== HEADER ===== */
header {
    background: linear-gradient(135deg, #020617 0%, #1e1b4b 100%);
    padding: 20px 20px 12px;
    text-align: center;
    border-bottom: 2px solid #334155;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content h1 {
    font-size: 1.8rem;
    background: linear-gradient(90deg, #60a5fa, #a78bfa, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.header-search {
    max-width: 400px;
    margin: 0 auto 12px;
}

.header-search input {
    width: 100%;
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

.header-search input:focus {
    outline: none;
    border-color: #6366f1;
}

/* ===== NAVEGACAO ===== */
nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-bottom: 4px;
    overflow: visible;
}

.nav-group {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}
.nav-group-btn {
    background: #0f172a;
    color: #a78bfa;
    border: 1px solid #334155;
    padding: 6px 14px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.nav-group-btn:hover { background: #1e293b; color: #c4b5fd; }
.nav-group-btn.group-active { border-color: #6366f1; color: #818cf8; }
.nav-arrow { font-size: 0.6rem; transition: transform 0.2s; }
.nav-group.open .nav-arrow { transform: rotate(180deg); }

.nav-group-items {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 6px;
    z-index: 200;
    min-width: 140px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    flex-direction: column;
    gap: 3px;
}
.nav-group.open .nav-group-items { display: flex; }
.nav-group-items .nav-btn {
    width: 100%;
    text-align: left;
    border-radius: 8px;
}

.nav-btn {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 6px 14px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-btn:hover { background: #334155; color: #e2e8f0; }

.nav-btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.nav-sep {
    width: 1px;
    background: #334155;
    flex-shrink: 0;
    margin: 4px 2px;
    display: none;
}

/* ===== SECOES ===== */
.secao {
    display: none;
    padding: 25px 20px;
    max-width: 1200px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

.secao.ativa { display: block; }

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

.secao-titulo {
    text-align: center;
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #f1f5f9;
}

/* ===== FILTROS ===== */
.filtros {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filtro {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 6px 14px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.filtro:hover { background: #334155; }
.filtro.active { background: #6366f1; color: white; border-color: #6366f1; }

/* ===== CARDS DE IA ===== */
.ia-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: 16px 16px 0 0;
}

.card:hover {
    transform: translateY(-4px);
    border-color: #6366f1;
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.card-icon { font-size: 2rem; margin-bottom: 10px; }
.card h3 { font-size: 1.1rem; margin-bottom: 6px; color: #f1f5f9; }
.card p { font-size: 0.8rem; color: #94a3b8; line-height: 1.4; }

.card-tag {
    display: inline-block;
    background: #334155;
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    margin-top: 8px;
}

.card-fav {
    position: absolute;
    top: 12px; right: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.4;
    transition: all 0.3s;
}

.card-fav:hover, .card-fav.ativo { opacity: 1; transform: scale(1.2); }

.card[data-cat="estudo"]::before { background: #3b82f6; }
.card[data-cat="pesquisa"]::before { background: #10b981; }
.card[data-cat="escrita"]::before { background: #f59e0b; }
.card[data-cat="codigo"]::before { background: #ef4444; }
.card[data-cat="visual"]::before { background: #a855f7; }

/* ===== FORM ELEMENTS ===== */
input[type="text"],
input[type="date"],
input[type="number"],
select,
textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #6366f1;
}

textarea { min-height: 120px; resize: vertical; }

label {
    display: block;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 6px;
    margin-top: 12px;
}

label:first-child { margin-top: 0; }

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 15px;
    width: 100%;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: #334155;
    color: #e2e8f0;
    border: 1px solid #475569;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.btn-secondary:hover { background: #475569; }

.btn-small {
    background: #334155;
    color: #94a3b8;
    border: none;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.btn-small:hover { background: #475569; color: #e2e8f0; }
.btn-small.danger:hover { background: #dc2626; color: white; }

/* ===== PROMPT GENERATOR ===== */
.prompt-generator {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) { .prompt-generator { grid-template-columns: 1fr; } }

.prompt-input-area, .prompt-output-area {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
}

.prompt-actions { display: flex; gap: 10px; margin-top: 10px; }

.prompts-salvos {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
}

.prompts-salvos h3 { margin-bottom: 15px; color: #f1f5f9; }

.prompt-item {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.prompt-item p { font-size: 0.85rem; color: #cbd5e1; white-space: pre-wrap; word-break: break-word; }
.prompt-item-date { font-size: 0.7rem; color: #64748b; margin-top: 6px; display: block; }
.prompt-item-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ===== HISTORICO ===== */
.historico-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.historico-icon { font-size: 1.3rem; }
.historico-info { flex: 1; }
.historico-info strong { display: block; font-size: 0.9rem; color: #f1f5f9; }
.historico-info span { font-size: 0.75rem; color: #64748b; }

/* ===== DICAS ===== */
.dicas-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.dica-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
}

.dica-card h3 { color: #a78bfa; margin-bottom: 10px; font-size: 1rem; }
.dica-card p, .dica-card li { font-size: 0.85rem; color: #cbd5e1; line-height: 1.6; }
.dica-card ul, .dica-card ol { padding-left: 20px; margin-top: 8px; }
.dica-card li { margin-bottom: 4px; }

.dica-card code {
    display: block;
    background: #0f172a;
    padding: 10px;
    border-radius: 8px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #60a5fa;
    word-break: break-word;
}

/* ===== BUSCA GLOBAL ===== */
.busca-grupo { margin-bottom: 20px; }
.busca-grupo h3 { color: #a78bfa; font-size: 0.9rem; margin-bottom: 10px; text-transform: uppercase; letter-spacing: 1px; }

.busca-item {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: border-color 0.3s;
}

.busca-item:hover { border-color: #6366f1; }
.busca-item h4 { color: #f1f5f9; font-size: 0.9rem; margin-bottom: 3px; }
.busca-item p { color: #94a3b8; font-size: 0.8rem; }
.busca-item-tipo { background: #334155; color: #94a3b8; padding: 1px 8px; border-radius: 8px; font-size: 0.68rem; margin-left: 8px; }

/* ===== STATS ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.stats-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 20px;
    text-align: center;
}

.stats-card.stats-destaque {
    border-color: #f59e0b;
    background: linear-gradient(145deg, #1e293b, #292524);
}

.stats-card-num {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #6366f1;
}

.stats-destaque .stats-card-num { color: #f59e0b; }

.stats-card-label {
    display: block;
    font-size: 0.72rem;
    color: #64748b;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-secao {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.stats-secao h3 { color: #f1f5f9; margin-bottom: 15px; font-size: 1rem; }

.stats-ia-item { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.stats-ia-item span:first-child { font-size: 1.2rem; width: 30px; text-align: center; }
.stats-ia-nome { width: 110px; font-size: 0.85rem; color: #cbd5e1; }
.stats-ia-barra-bg { flex: 1; background: #0f172a; height: 10px; border-radius: 5px; overflow: hidden; }
.stats-ia-barra { height: 100%; border-radius: 5px; background: linear-gradient(90deg, #6366f1, #a78bfa); transition: width 0.5s; }
.stats-ia-count { width: 30px; text-align: right; font-size: 0.8rem; color: #94a3b8; }

.stats-semana {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    align-items: flex-end;
    height: 140px;
    padding-top: 10px;
}

.stats-dia { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }

.stats-dia-barra {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, #6366f1, #4f46e5);
    border-radius: 6px 6px 0 0;
    min-height: 4px;
    transition: height 0.5s;
}

.stats-dia-label { font-size: 0.7rem; color: #64748b; margin-top: 6px; }
.stats-dia-val { font-size: 0.7rem; color: #94a3b8; margin-bottom: 4px; }

/* ===== BACKUP ===== */
.backup-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
    max-width: 900px;
    margin: 0 auto;
}

.backup-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
}

.backup-card h3 { color: #f1f5f9; margin-bottom: 10px; font-size: 1.05rem; }
.backup-card p { color: #94a3b8; font-size: 0.85rem; line-height: 1.5; margin-bottom: 15px; }

.backup-resumo-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #334155;
    font-size: 0.85rem;
}

.backup-resumo-item:last-child { border-bottom: none; }
.backup-resumo-item span:first-child { color: #94a3b8; }
.backup-resumo-item span:last-child { color: #f1f5f9; font-weight: 600; }

.backup-extra {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 15px;
    max-width: 900px;
    margin: 20px auto 0;
}

.backup-secao-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.backup-secao-btns button { font-size: 0.78rem; padding: 5px 12px; }

/* ===== TEMPLATES ===== */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 12px;
}

.template-card {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s;
}

.template-card:hover {
    border-color: #6366f1;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
}

.template-card-icon { font-size: 2rem; margin-bottom: 10px; }
.template-card h4 { color: #f1f5f9; font-size: 0.95rem; margin-bottom: 6px; }
.template-card p { color: #94a3b8; font-size: 0.8rem; line-height: 1.4; }

.template-input {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.template-input h3 { color: #f1f5f9; margin-bottom: 4px; }

/* ===== PLANO DE ESTUDOS ===== */
.plano-form {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.plano-form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.plano-form-row input { flex: 1; min-width: 140px; }

.plano-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
}

.plano-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.plano-card-header h3 { color: #f1f5f9; font-size: 1.1rem; }

.plano-card-prazo {
    font-size: 0.78rem;
    color: #94a3b8;
    background: #334155;
    padding: 3px 10px;
    border-radius: 8px;
}

.plano-card-prazo.urgente { background: #dc2626; color: white; }
.plano-card-prazo.proximo { background: #f59e0b; color: #1e293b; }

.plano-barra-container {
    background: #0f172a;
    border-radius: 8px;
    height: 12px;
    margin-bottom: 12px;
    overflow: hidden;
}

.plano-barra {
    height: 100%;
    border-radius: 8px;
    background: linear-gradient(90deg, #6366f1, #10b981);
    transition: width 0.5s ease;
}

.plano-progresso-text { font-size: 0.8rem; color: #94a3b8; margin-bottom: 12px; }
.plano-topicos { margin-bottom: 12px; }

.plano-topico {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #334155;
}

.plano-topico:last-child { border-bottom: none; }

.plano-topico input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #6366f1;
    cursor: pointer;
    flex-shrink: 0;
}

.plano-topico span { font-size: 0.88rem; color: #cbd5e1; flex: 1; }
.plano-topico span.feito { text-decoration: line-through; color: #64748b; }

.plano-topico-add { display: flex; gap: 8px; margin-top: 8px; }
.plano-topico-add input { flex: 1; }
.plano-card-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ===== FLASHCARDS ===== */
.fc-topo { margin-bottom: 20px; }

.fc-form {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fc-form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.fc-form-row select { min-width: 120px; }

.fc-modo { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }

.fc-modo-btn {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.fc-modo-btn.active { background: #6366f1; color: white; border-color: #6366f1; }

.fc-estudo { display: flex; flex-direction: column; align-items: center; gap: 20px; }
.fc-estudo-info { font-size: 0.85rem; color: #94a3b8; text-align: center; }

.fc-card-wrapper { perspective: 800px; width: 100%; max-width: 500px; min-height: 250px; }

.fc-card {
    width: 100%;
    min-height: 250px;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.fc-card.virado { transform: rotateY(180deg); }

.fc-card-frente, .fc-card-verso {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    min-height: 250px;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.fc-card-frente {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 2px solid #6366f1;
    color: #f1f5f9;
}

.fc-card-verso {
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border: 2px solid #10b981;
    color: #10b981;
    transform: rotateY(180deg);
}

.fc-estudo-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.fc-resp-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s;
}

.fc-errei { background: #dc2626; }
.fc-errei:hover { background: #b91c1c; }
.fc-dificil { background: #f59e0b; }
.fc-dificil:hover { background: #d97706; }
.fc-facil { background: #10b981; }
.fc-facil:hover { background: #059669; }

.fc-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }

.fc-lista-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
}

.fc-lista-card h4 { color: #f1f5f9; font-size: 0.9rem; margin-bottom: 8px; }
.fc-lista-card p { color: #94a3b8; font-size: 0.8rem; margin-bottom: 8px; white-space: pre-wrap; }
.fc-lista-card-footer { display: flex; justify-content: space-between; align-items: center; gap: 6px; }

.fc-deck-tag {
    background: #334155;
    color: #94a3b8;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.68rem;
}

.fc-empty { text-align: center; color: #64748b; padding: 50px 20px; font-size: 1rem; }

/* ===== BIBLIOTECA DE LINKS ===== */
.links-form {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.links-form-row { display: flex; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.links-form-row input { flex: 1; min-width: 140px; }

.links-filtros { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.links-filtros input { flex: 1; min-width: 150px; }
.links-filtros select { min-width: 160px; }

.link-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: border-color 0.3s;
}

.link-card:hover { border-color: #6366f1; }
.link-card-icon { font-size: 1.6rem; flex-shrink: 0; }
.link-card-info { flex: 1; min-width: 0; }
.link-card-info h4 { color: #f1f5f9; font-size: 0.95rem; margin-bottom: 3px; }
.link-card-info h4 a { color: #60a5fa; text-decoration: none; }
.link-card-info h4 a:hover { text-decoration: underline; }
.link-card-desc { font-size: 0.8rem; color: #94a3b8; margin-bottom: 4px; }
.link-card-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.link-card-tag { background: #10b981; color: white; padding: 1px 8px; border-radius: 8px; font-size: 0.68rem; }
.link-card-date { font-size: 0.7rem; color: #64748b; }
.link-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ===== CADERNO ===== */
.caderno-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 0;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    min-height: 550px;
}

@media (max-width: 768px) {
    .caderno-layout { grid-template-columns: 1fr; min-height: auto; }
}

.caderno-sidebar {
    background: #161b22;
    border-right: 1px solid #334155;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    max-height: 600px;
}

.caderno-nova-materia {
    display: flex;
    gap: 6px;
    padding: 12px;
    border-bottom: 1px solid #21262d;
}

.caderno-nova-materia input { flex: 1; font-size: 0.82rem; padding: 7px 10px; }
.caderno-nova-materia button { padding: 7px 12px; }

.caderno-materias-list { flex: 1; overflow-y: auto; }

.caderno-materia-item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #21262d;
    transition: background 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.caderno-materia-item:hover { background: #1e293b; }
.caderno-materia-item.active { background: #1e293b; border-left: 3px solid #6366f1; }

.caderno-materia-nome {
    font-size: 0.88rem;
    color: #e2e8f0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.caderno-materia-count {
    font-size: 0.68rem;
    color: #64748b;
    background: #0f172a;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 8px;
}

.caderno-materia-del {
    background: none;
    border: none;
    color: #64748b;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}

.caderno-materia-item:hover .caderno-materia-del { opacity: 1; }
.caderno-materia-del:hover { color: #f87171; background: #1e293b; }

.caderno-editor {
    background: #0f172a;
    display: flex;
    flex-direction: column;
}

.caderno-vazio {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 40px;
    text-align: center;
    color: #64748b;
    font-size: 1rem;
}

.caderno-ativo { display: flex; flex-direction: column; flex: 1; }

.caderno-page-header {
    padding: 12px 16px;
    border-bottom: 1px solid #21262d;
    background: #161b22;
}

.caderno-page-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.caderno-page-nav select { width: auto; flex: 1; min-width: 120px; }

.caderno-page-title {
    font-size: 1.1rem !important;
    font-weight: 600;
    background: transparent !important;
    border: none !important;
    border-bottom: 1px solid #334155 !important;
    border-radius: 0 !important;
    padding: 6px 0 !important;
    color: #f1f5f9 !important;
}

.caderno-page-title:focus { border-bottom-color: #6366f1 !important; }

.caderno-toolbar {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: #161b22;
    border-bottom: 1px solid #21262d;
    flex-wrap: wrap;
    align-items: center;
}

.caderno-fmt {
    background: #0f172a;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.2s;
}

.caderno-fmt:hover { background: #334155; color: #e2e8f0; }

.caderno-textarea {
    flex: 1;
    background: #0d1117 !important;
    color: #e6edf3 !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 16px !important;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.88rem;
    line-height: 1.7;
    resize: none;
    min-height: 350px;
    tab-size: 4;
}

.caderno-preview-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #161b22;
    border-top: 1px solid #21262d;
}

.caderno-preview {
    padding: 20px;
    background: #1e293b;
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.7;
    overflow-y: auto;
    max-height: 400px;
    border-top: 1px solid #334155;
}

.caderno-preview h2 { color: #a78bfa; font-size: 1.2rem; margin: 16px 0 8px; border-bottom: 1px solid #334155; padding-bottom: 4px; }
.caderno-preview h3 { color: #60a5fa; font-size: 1.05rem; margin: 12px 0 6px; }
.caderno-preview strong { color: #f1f5f9; }
.caderno-preview em { color: #fbbf24; }
.caderno-preview code { background: #0f172a; color: #10b981; padding: 2px 6px; border-radius: 4px; font-size: 0.85em; }
.caderno-preview blockquote { border-left: 3px solid #6366f1; padding-left: 12px; margin: 10px 0; color: #94a3b8; }
.caderno-preview ul, .caderno-preview ol { padding-left: 20px; margin: 8px 0; }
.caderno-preview li { margin-bottom: 4px; }
.caderno-preview hr { border: none; border-top: 1px solid #334155; margin: 16px 0; }
.caderno-preview pre { background: #0f172a; padding: 12px; border-radius: 8px; overflow-x: auto; }
.caderno-preview pre code { background: none; padding: 0; }

/* ===== NOTAS ===== */
.notas-topo {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.notas-novo { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.notas-novo input[type="text"] { flex: 1; min-width: 150px; }
.notas-novo select { min-width: 140px; }

.notas-filtros { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.notas-filtros input { flex: 1; min-width: 150px; }
.notas-filtros select { min-width: 160px; }

.nota-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
}

.nota-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.nota-card-header h4 { color: #f1f5f9; font-size: 1rem; flex: 1; }

.nota-card-materia {
    background: #6366f1;
    color: white;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: 10px;
    white-space: nowrap;
}

.nota-card-body {
    font-size: 0.85rem;
    color: #cbd5e1;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
    max-height: 150px;
    overflow: hidden;
}

.nota-card-body.expandida { max-height: none; }

.nota-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.nota-card-date { font-size: 0.72rem; color: #64748b; }
.nota-card-actions { display: flex; gap: 6px; }

/* ===== POMODORO ===== */
.pomodoro-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

@media (max-width: 768px) { .pomodoro-container { grid-template-columns: 1fr; } }

.pomodoro-display { display: flex; flex-direction: column; align-items: center; gap: 20px; }

.pomodoro-ring { position: relative; width: 220px; height: 220px; }

.pomodoro-svg { width: 100%; height: 100%; transform: rotate(-90deg); }

.pomodoro-track { fill: none; stroke: #1e293b; stroke-width: 8; }

.pomodoro-progress {
    fill: none;
    stroke: #6366f1;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 565.48;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear, stroke 0.3s;
}

.pomodoro-progress.pausa { stroke: #10b981; }

.pomodoro-timer-text { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }

#pomodoroTime { display: block; font-size: 3rem; font-weight: 700; color: #f1f5f9; font-variant-numeric: tabular-nums; }
.pomodoro-label { font-size: 0.85rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 2px; }
.pomodoro-controls { display: flex; gap: 10px; }
.pomodoro-btn { min-width: 100px; }

.pomodoro-modes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.pomodoro-mode {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 6px 12px;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.78rem;
    transition: all 0.3s;
}

.pomodoro-mode:hover { background: #334155; }
.pomodoro-mode.active { background: #6366f1; color: white; border-color: #6366f1; }

.pomodoro-stats {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
}

.pomodoro-stats h3 { color: #f1f5f9; margin-bottom: 15px; font-size: 1rem; }

.pomodoro-stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }

.pomodoro-stat-card {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 15px 10px;
    text-align: center;
}

.pomodoro-stat-num { display: block; font-size: 1.8rem; font-weight: 700; color: #6366f1; }
.pomodoro-stat-label { font-size: 0.72rem; color: #64748b; text-transform: uppercase; letter-spacing: 1px; }
.pomodoro-historico { max-height: 200px; overflow-y: auto; }

.pomodoro-hist-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-bottom: 1px solid #334155;
    font-size: 0.8rem;
}

.pomodoro-hist-item:last-child { border-bottom: none; }
.pomodoro-hist-item span:first-child { color: #cbd5e1; }
.pomodoro-hist-item span:last-child { color: #64748b; }

/* ===== CALCULADORA ===== */
.calc-container { display: grid; grid-template-columns: 1.2fr 1fr; gap: 20px; }
@media (max-width: 768px) { .calc-container { grid-template-columns: 1fr; } }

.calc-main, .calc-sidebar {
    background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 20px;
}

.calc-display {
    font-family: 'Cascadia Code', 'Consolas', monospace !important;
    font-size: 1.2rem !important;
    padding: 14px !important;
    text-align: right;
}

.calc-resultado {
    margin-top: 12px; padding: 14px; background: #0f172a; border-radius: 8px;
    font-family: 'Cascadia Code', monospace; font-size: 1.3rem; color: #10b981;
    text-align: right; min-height: 50px; display: flex; align-items: center; justify-content: flex-end;
}

.calc-historico { margin-top: 12px; max-height: 200px; overflow-y: auto; }
.calc-historico-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid #334155; font-size: 0.8rem; font-family: monospace; }
.calc-historico-item span:first-child { color: #94a3b8; } .calc-historico-item span:last-child { color: #10b981; }

.calc-section { margin-bottom: 20px; }
.calc-section h3 { color: #f1f5f9; font-size: 0.95rem; margin-bottom: 10px; }

.calc-ref { display: flex; flex-wrap: wrap; gap: 6px; }
.calc-ref code { background: #0f172a; color: #60a5fa; padding: 3px 8px; border-radius: 6px; font-size: 0.75rem; cursor: pointer; transition: background 0.2s; }
.calc-ref code:hover { background: #334155; }

.calc-base-result { margin-top: 10px; }
.calc-base-item { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.82rem; font-family: monospace; border-bottom: 1px solid #334155; }
.calc-base-item span:first-child { color: #94a3b8; } .calc-base-item span:last-child { color: #f1f5f9; word-break: break-all; }

/* ===== REFERENCIAS ===== */
.refs-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .refs-container { grid-template-columns: 1fr; } }

.refs-form, .refs-output {
    background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 20px;
}

.refs-output h3 { color: #f1f5f9; font-size: 0.95rem; margin-bottom: 10px; }

.ref-resultado {
    background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 16px;
    font-size: 0.88rem; color: #cbd5e1; line-height: 1.6; word-break: break-word;
}

.ref-item { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.ref-item p { font-size: 0.82rem; color: #cbd5e1; line-height: 1.5; }
.ref-item-actions { display: flex; gap: 6px; margin-top: 8px; }
.ref-item-tipo { font-size: 0.68rem; color: #94a3b8; background: #334155; padding: 1px 6px; border-radius: 4px; }

/* ===== CRONOMETRO LEITURA ===== */
.leitura-container { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 900px; margin: 0 auto; }
@media (max-width: 768px) { .leitura-container { grid-template-columns: 1fr; } }

.leitura-timer, .leitura-historico {
    background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 20px;
}

.leitura-display {
    font-size: 3.5rem; font-weight: 700; color: #f1f5f9; text-align: center;
    font-family: 'Cascadia Code', monospace; font-variant-numeric: tabular-nums; margin-bottom: 20px;
}

.leitura-controls { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }

.leitura-paginas { display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 15px; }

.leitura-stats { text-align: center; color: #94a3b8; font-size: 0.85rem; }
.leitura-stats span { color: #6366f1; font-weight: 600; }

.leitura-historico h3 { color: #f1f5f9; font-size: 0.95rem; margin-bottom: 10px; }

.leitura-hist-item { background: #0f172a; border: 1px solid #334155; border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 0.82rem; }
.leitura-hist-item span { color: #94a3b8; }
.leitura-hist-item strong { color: #f1f5f9; }

/* ===== CHEAT SHEETS ===== */
.cheat-tabs { display: flex; gap: 4px; margin-bottom: 12px; flex-wrap: wrap; }

.cheat-tab {
    background: #1e293b; color: #94a3b8; border: 1px solid #334155;
    padding: 7px 16px; border-radius: 8px; cursor: pointer; font-size: 0.82rem; transition: all 0.3s;
}

.cheat-tab.active { background: #6366f1; color: white; border-color: #6366f1; }

.cheat-search { margin-bottom: 15px; }

.cheat-content {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px;
}

.cheat-item {
    background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 12px 16px;
    display: flex; gap: 12px; align-items: flex-start; transition: border-color 0.3s;
}

.cheat-item:hover { border-color: #6366f1; }

.cheat-cmd {
    background: #0f172a; color: #f59e0b; padding: 4px 10px; border-radius: 6px;
    font-family: 'Cascadia Code', monospace; font-size: 0.8rem; white-space: nowrap; flex-shrink: 0;
}

.cheat-desc { color: #cbd5e1; font-size: 0.82rem; line-height: 1.4; }

@media (max-width: 600px) {
    .cheat-content { grid-template-columns: 1fr; }
}

/* ===== EDITOR DE CODIGO ===== */
.editor-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.editor-langs { display: flex; gap: 4px; }

.editor-lang {
    background: #1e293b;
    color: #94a3b8;
    border: 1px solid #334155;
    padding: 6px 16px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.3s;
}

.editor-lang:first-child { border-radius: 8px 0 0 8px; }
.editor-lang:last-child { border-radius: 0 8px 8px 0; }
.editor-lang.active { background: #6366f1; color: white; border-color: #6366f1; }

.editor-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.editor-actions select { width: auto; min-width: 160px; }

.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    min-height: 450px;
}

@media (max-width: 768px) {
    .editor-container { grid-template-columns: 1fr; min-height: auto; }
}

.editor-panel {
    background: #0d1117;
    display: flex;
    flex-direction: column;
}

.editor-wrapper {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-lines {
    background: #161b22;
    color: #484f58;
    padding: 14px 8px 14px 12px;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.65;
    text-align: right;
    user-select: none;
    min-width: 42px;
    overflow: hidden;
    border-right: 1px solid #21262d;
    white-space: pre-wrap;
}

.editor-code {
    flex: 1;
    background: #0d1117 !important;
    color: #e6edf3 !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 14px 16px;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.65;
    resize: none;
    min-height: 400px;
    outline: none;
    tab-size: 4;
    -moz-tab-size: 4;
    white-space: pre;
    overflow-wrap: normal;
    overflow-x: auto;
}

.editor-output-panel {
    background: #1e293b;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #334155;
}

.editor-output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #161b22;
    border-bottom: 1px solid #21262d;
    font-size: 0.82rem;
    color: #94a3b8;
}

.editor-output {
    flex: 1;
    position: relative;
    min-height: 400px;
}

.editor-preview {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
    position: absolute;
    top: 0; left: 0;
}

.editor-console {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 14px;
    background: #0d1117;
    color: #e6edf3;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', 'Courier New', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
    position: absolute;
    top: 0; left: 0;
}

.editor-console .log-error { color: #f87171; }
.editor-console .log-warn { color: #fbbf24; }
.editor-console .log-info { color: #60a5fa; }
.editor-console .log-result { color: #10b981; }

@media (max-width: 768px) {
    .editor-output { min-height: 250px; }
    .editor-code { min-height: 250px; }
    .editor-output-panel { border-left: none; border-top: 1px solid #334155; }
}

/* ===== CONFIRM DIALOG ===== */
.confirm-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-box {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 14px;
    padding: 24px;
    max-width: 380px;
    width: 90%;
    text-align: center;
}

.confirm-box p { color: #f1f5f9; font-size: 1rem; margin-bottom: 20px; line-height: 1.4; }
.confirm-btns { display: flex; gap: 10px; justify-content: center; }
.confirm-btns button { margin-top: 0; width: auto; min-width: 100px; }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #6366f1;
    color: white;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    z-index: 3000;
    opacity: 0;
    transition: all 0.4s ease;
    pointer-events: none;
    max-width: 90%;
    text-align: center;
}

.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ===== EMPTY MSG ===== */
.empty-msg { text-align: center; color: #64748b; padding: 40px; font-size: 0.9rem; }

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 20px;
    color: #475569;
    font-size: 0.8rem;
    margin-top: 40px;
    border-top: 1px solid #1e293b;
}

/* ===== CHAT IA ===== */
.chatia-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #1e293b;
    border-radius: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.chatia-status { color: #10b981; font-size: 0.82rem; font-weight: 600; }
.chatia-ctx-toggle { font-size: 0.78rem; color: #94a3b8; margin-left: auto; cursor: pointer; display: flex; align-items: center; gap: 4px; }
.chatia-ctx-toggle input { cursor: pointer; }

.chatia-messages {
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    min-height: 400px;
    max-height: 60vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scroll-behavior: smooth;
}
.chatia-msg { display: flex; max-width: 85%; }
.chatia-msg.chatia-user { align-self: flex-end; }
.chatia-msg.chatia-bot { align-self: flex-start; }
.chatia-msg-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}
.chatia-user .chatia-msg-content {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chatia-bot .chatia-msg-content {
    background: #1e293b;
    color: #e2e8f0;
    border-bottom-left-radius: 4px;
}
.chatia-bot .chatia-msg-content code {
    background: #334155;
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.82rem;
}
.chatia-bot .chatia-msg-content pre {
    background: #020617;
    padding: 10px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 8px 0;
    font-size: 0.8rem;
}
.chatia-bot .chatia-msg-content pre code {
    background: none;
    padding: 0;
}
.chatia-typing { color: #94a3b8; font-style: italic; font-size: 0.82rem; padding: 8px 14px; }

.chatia-input-area {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    align-items: flex-end;
}
.chatia-input {
    flex: 1;
    background: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    min-height: 44px;
    max-height: 120px;
    transition: border-color 0.3s;
}
.chatia-input:focus { border-color: #6366f1; outline: none; }
.chatia-send {
    margin-top: 0 !important;
    width: auto !important;
    padding: 10px 24px !important;
    min-height: 44px;
    border-radius: 12px !important;
}

/* ===== POS-GRADUACAO ===== */
.pos-topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}
.pos-link-fmu {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.pos-stats-mini {
    display: flex;
    gap: 15px;
    font-size: 0.82rem;
    color: #94a3b8;
}
.pos-stats-mini span { background: #1e293b; padding: 4px 12px; border-radius: 8px; }

.pos-progress-bar {
    width: 100%;
    height: 8px;
    background: #1e293b;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}
.pos-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #10b981);
    border-radius: 8px;
    transition: width 0.5s ease;
}

.pos-form { margin-bottom: 20px; }
.pos-form-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.pos-form-row input, .pos-form-row select { flex: 1; min-width: 140px; }

.pos-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.3s, transform 0.2s;
    display: flex;
    align-items: center;
    gap: 14px;
}
.pos-card:hover { border-color: #6366f1; transform: translateY(-1px); }
.pos-card-icon { font-size: 1.8rem; flex-shrink: 0; }
.pos-card-info { flex: 1; }
.pos-card-info h4 { color: #e2e8f0; font-size: 0.95rem; margin-bottom: 2px; }
.pos-card-info span { color: #64748b; font-size: 0.78rem; }
.pos-card-badge {
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    flex-shrink: 0;
}
.pos-badge-cursando { background: #1e3a5f; color: #60a5fa; }
.pos-badge-concluida { background: #14532d; color: #4ade80; }
.pos-badge-pendente { background: #422006; color: #fbbf24; }
.pos-card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Detalhe da disciplina */
.pos-detalhe {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}
.pos-detalhe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.pos-detalhe-header h3 { color: #a78bfa; font-size: 1.1rem; }
.pos-detalhe-secao { margin-bottom: 20px; }
.pos-detalhe-secao h4 { color: #60a5fa; font-size: 0.9rem; margin-bottom: 10px; border-bottom: 1px solid #334155; padding-bottom: 6px; }
.pos-detalhe-secao textarea {
    width: 100%;
    background: #0f172a;
    border: 1px solid #334155;
    color: #e2e8f0;
    padding: 10px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
}

.pos-pdf-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.pos-pdf-info { font-size: 0.72rem; color: #64748b; }
.pos-pdf-lista { display: flex; flex-direction: column; gap: 6px; }
.pos-pdf-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #0f172a;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.82rem;
}
.pos-pdf-item span { flex: 1; color: #e2e8f0; }
.pos-pdf-item .pos-pdf-size { color: #64748b; font-size: 0.72rem; }

.pos-links-form {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.pos-links-form input { flex: 1; }
.pos-link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #1e293b;
    font-size: 0.82rem;
}
.pos-link-item a { color: #60a5fa; text-decoration: none; flex: 1; }
.pos-link-item a:hover { text-decoration: underline; }

/* ===== THEME TOGGLE BUTTON ===== */
.theme-toggle {
    background: none;
    border: 1px solid #334155;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.3s;
    line-height: 1;
}
.theme-toggle:hover { background: #334155; color: #e2e8f0; }

/* ===== LIGHT MODE ===== */
[data-theme="light"] body { background: #f1f5f9; color: #1e293b; }

[data-theme="light"] header { background: linear-gradient(135deg, #e0e7ff 0%, #ede9fe 100%); border-bottom-color: #cbd5e1; }
[data-theme="light"] .header-content h1 { background: linear-gradient(90deg, #4f46e5, #7c3aed, #db2777); -webkit-background-clip: text; background-clip: text; }
[data-theme="light"] .header-search input { background: #fff; border-color: #cbd5e1; color: #1e293b; }

[data-theme="light"] .theme-toggle { border-color: #cbd5e1; color: #64748b; }
[data-theme="light"] .theme-toggle:hover { background: #e2e8f0; color: #1e293b; }

/* Nav */
[data-theme="light"] .nav-btn { background: #fff; color: #475569; border-color: #cbd5e1; }
[data-theme="light"] .nav-btn:hover { background: #e2e8f0; color: #1e293b; }
[data-theme="light"] .nav-btn.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }
[data-theme="light"] .nav-group-btn { background: #fff; color: #6d28d9; border-color: #cbd5e1; }
[data-theme="light"] .nav-group-btn:hover { background: #ede9fe; color: #5b21b6; }
[data-theme="light"] .nav-group-btn.group-active { border-color: #6366f1; }
[data-theme="light"] .nav-group-items { background: #fff; border-color: #cbd5e1; box-shadow: 0 8px 24px rgba(0,0,0,0.1); }

/* Sections */
[data-theme="light"] .secao-titulo { color: #1e293b; }
[data-theme="light"] .filtro { background: #fff; color: #475569; border-color: #cbd5e1; }
[data-theme="light"] .filtro:hover { background: #e2e8f0; }
[data-theme="light"] .filtro.active { background: #6366f1; color: #fff; border-color: #6366f1; }

/* Inputs */
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="date"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] select,
[data-theme="light"] textarea { background: #fff; border-color: #cbd5e1; color: #1e293b; }
[data-theme="light"] label { color: #475569; }

/* Cards */
[data-theme="light"] .card { background: linear-gradient(145deg, #fff, #f8fafc); border-color: #e2e8f0; }
[data-theme="light"] .card:hover { border-color: #6366f1; box-shadow: 0 4px 12px rgba(99,102,241,0.15); }
[data-theme="light"] .card h3 { color: #1e293b; }
[data-theme="light"] .card p { color: #64748b; }
[data-theme="light"] .card-tag { background: #e2e8f0; color: #475569; }

/* Buttons */
[data-theme="light"] .btn-secondary { background: #e2e8f0; color: #1e293b; border-color: #cbd5e1; }
[data-theme="light"] .btn-secondary:hover { background: #cbd5e1; }
[data-theme="light"] .btn-small { background: #e2e8f0; color: #475569; }
[data-theme="light"] .btn-small:hover { background: #cbd5e1; color: #1e293b; }

/* Prompts, historico, busca items */
[data-theme="light"] .prompt-item { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .prompt-item p { color: #334155; }
[data-theme="light"] .historico-item { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .historico-item .historico-info strong { color: #1e293b; }
[data-theme="light"] .busca-item { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .busca-item h4 { color: #1e293b; }
[data-theme="light"] .busca-item-tipo { background: #e2e8f0; color: #475569; }

/* Stats */
[data-theme="light"] .stats-card { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .stats-card.stats-destaque { background: linear-gradient(145deg, #fff, #fffbeb); }
[data-theme="light"] .stats-card-label { color: #64748b; }

/* Flashcards */
[data-theme="light"] .fc-card { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .fc-card-frente, [data-theme="light"] .fc-card-verso { color: #1e293b; }
[data-theme="light"] .fc-lista-item { background: #fff; border-color: #e2e8f0; }

/* Plano */
[data-theme="light"] .plano-form { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .plano-card { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .plano-topico { color: #334155; }

/* Pomodoro */
[data-theme="light"] .pomodoro-stat-card { background: #fff; border-color: #e2e8f0; }

/* Caderno */
[data-theme="light"] .caderno-sidebar { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .caderno-textarea { background: #fff; color: #1e293b; border-color: #e2e8f0; }
[data-theme="light"] .caderno-preview { background: #fff; color: #1e293b; border-color: #e2e8f0; }
[data-theme="light"] .caderno-materia-item { color: #475569; }
[data-theme="light"] .caderno-materia-item.ativo { color: #4f46e5; background: #ede9fe; }

/* Notas, links */
[data-theme="light"] .nota-card { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .nota-card h4 { color: #1e293b; }
[data-theme="light"] .nota-card p { color: #475569; }

/* Dicas */
[data-theme="light"] .dica-card { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .dica-card p, [data-theme="light"] .dica-card li { color: #334155; }
[data-theme="light"] .dica-card code { background: #f1f5f9; color: #4f46e5; }

/* Editor */
[data-theme="light"] .editor-code { background: #1e293b; color: #e2e8f0; }
[data-theme="light"] .editor-output { background: #fff; border-color: #e2e8f0; }

/* Backup / Sync cards */
[data-theme="light"] .backup-card { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .backup-card h3 { color: #1e293b; }
[data-theme="light"] .backup-card p { color: #475569; }

/* Cheat sheets */
[data-theme="light"] .cheat-tab { background: #fff; color: #475569; border-color: #cbd5e1; }
[data-theme="light"] .cheat-tab.active { background: #4f46e5; color: #fff; }
[data-theme="light"] .cheat-item { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .cheat-item code { background: #f1f5f9; color: #4f46e5; }

/* Refs */
[data-theme="light"] .ref-resultado { background: #fff; border-color: #e2e8f0; color: #1e293b; }
[data-theme="light"] .calc-resultado { background: #fff; border-color: #e2e8f0; color: #1e293b; }

/* Chat IA */
[data-theme="light"] .chatia-toolbar { background: #fff; }
[data-theme="light"] .chatia-messages { background: #f8fafc; border-color: #e2e8f0; }
[data-theme="light"] .chatia-bot .chatia-msg-content { background: #fff; color: #1e293b; }
[data-theme="light"] .chatia-bot .chatia-msg-content code { background: #f1f5f9; }
[data-theme="light"] .chatia-bot .chatia-msg-content pre { background: #1e293b; color: #e2e8f0; }
[data-theme="light"] .chatia-input { background: #fff; border-color: #cbd5e1; color: #1e293b; }
[data-theme="light"] .chatia-typing { color: #64748b; }

/* Pos-graduacao */
[data-theme="light"] .pos-stats-mini span { background: #fff; color: #475569; }
[data-theme="light"] .pos-progress-bar { background: #e2e8f0; }
[data-theme="light"] .pos-card { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .pos-card-info h4 { color: #1e293b; }
[data-theme="light"] .pos-card-info span { color: #64748b; }
[data-theme="light"] .pos-badge-cursando { background: #dbeafe; color: #2563eb; }
[data-theme="light"] .pos-badge-concluida { background: #dcfce7; color: #16a34a; }
[data-theme="light"] .pos-badge-pendente { background: #fef3c7; color: #d97706; }
[data-theme="light"] .pos-detalhe { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .pos-detalhe-secao textarea { background: #f8fafc; border-color: #e2e8f0; color: #1e293b; }
[data-theme="light"] .pos-detalhe-secao h4 { border-bottom-color: #e2e8f0; }
[data-theme="light"] .pos-pdf-item { background: #f8fafc; }
[data-theme="light"] .pos-link-item { border-bottom-color: #e2e8f0; }

/* Confirm dialog */
[data-theme="light"] .confirm-box { background: #fff; border-color: #e2e8f0; }
[data-theme="light"] .confirm-box p { color: #1e293b; }

/* Toast (fica escuro mesmo em light mode para contraste) */

/* Empty msg */
[data-theme="light"] .empty-msg { color: #94a3b8; }

/* Footer */
[data-theme="light"] footer { color: #94a3b8; border-top-color: #e2e8f0; }

/* ===== RESPONSIVE ===== */
@media (max-width: 600px) {
    .header-content h1 { font-size: 1.4rem; }
    .ia-container { grid-template-columns: 1fr 1fr; }
    .card { padding: 14px; }
    .card-icon { font-size: 1.5rem; }
    .dicas-container { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .chatia-msg { max-width: 95%; }
    .pos-form-row { flex-direction: column; }
    .pos-topo { flex-direction: column; align-items: stretch; }
}

@media (max-width: 400px) {
    .ia-container { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}
