
* {
    box-sizing: border-box;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

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


.main-content {
    flex: 1;
    min-width: 0; 
    padding: 2rem;
    background: var(--gray-50);
    width: 100%;
}


.simulados-header {
    background: linear-gradient(135deg, #0f172a, #1e293b, #334155);
    padding: 3rem 2rem;
    border-radius: var(--radius-xl);
    margin-bottom: 2rem;
    color: white;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.simulados-header::before {
    content: '📝';
    position: absolute;
    font-size: 10rem;
    opacity: 0.1;
    top: 50%;
    right: 5%;
    transform: translateY(-50%);
}

.simulados-header h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.simulados-header p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 500px;
    position: relative;
    z-index: 1;
}


.grid-3 {
    display: grid;

    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    width: 100%;
    margin-bottom: 2rem;
}


.simulado-card {
    background: white;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.simulado-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}


.filters-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap; 
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    width: 100%;
}

.filter-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gray-100);
    padding: 0.5rem;
    border-radius: var(--radius-md);
}


.table-responsive {
    width: 100%;
    overflow-x: auto; 
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    -webkit-overflow-scrolling: touch; 
}

table {
    width: 100%;
    min-width: 800px; 
    border-collapse: collapse;
}

th, td {
    white-space: nowrap; 
    padding: 1rem;
    text-align: left;
}


@media (max-width: 1024px) {
    .main-content {
        padding: 1.5rem;
    }
}

@media (max-width: 900px) {
    .main-content {
        margin-left: 0 !important;
        width: 100%;
        padding: 4.5rem 1rem 1.5rem; /* top reserva espaço para o hamburger */
    }

    .simulados-header {
        padding: 2rem 1rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 4.5rem 1rem 1.5rem;
    }
}

.modern-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: stretch;
}

.search-wrapper {
    flex: 1;
    min-width: 220px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper i {
    position: absolute;
    left: 1rem;
    color: #94a3b8;
    pointer-events: none;
}

.search-wrapper input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.search-wrapper input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

.filter-wrapper {
    display: flex;
    align-items: center;
}

.clean-select {
    padding: 0.9rem 2.5rem 0.9rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: white;
    font-size: 1rem;
    color: #475569;
    cursor: pointer;
    height: 100%;
    width: 100%;
}


.history-section {
    margin-top: 3rem;
}

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

.history-header h2 {
    color: #334155;
    font-size: 1.5rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #475569;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    border-color: #0284c7;
    color: #0284c7;
}

.modern-table {
    border: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border-radius: 16px;
    background: white;
}

.modern-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.modern-table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    padding: 1.2rem 1rem;
    border-bottom: 2px solid #f1f5f9;
}

.modern-table th:first-child { border-top-left-radius: 16px; }
.modern-table th:last-child { border-top-right-radius: 16px; text-align: right; }

.modern-table td {
    padding: 1.2rem 1rem;
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.modern-table tbody tr {
    transition: background-color 0.2s ease;
}

.modern-table tbody tr:hover {
    background-color: #f8fafc;
}

.modern-table tbody tr:last-child td {
    border-bottom: none;
}

/* Badges de Status para a Tabela */
.badge-score {
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-block;
}
.score-high { background: #dcfce7; color: #166534; }
.score-medium { background: #fef08a; color: #854d0e; }
.score-low { background: #fee2e2; color: #b91c1c; }


@media (max-width: 640px) {
    .modern-controls {
        flex-direction: column;
    }

    .filter-wrapper {
        width: 100%;
    }

    .history-header h2 {
        font-size: 1.2rem;
    }

    .btn-outline {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .filter-group {
        min-width: 100%;
    }

    .simulado-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .simulados-header {
        padding: 1.5rem 1rem;
    }

    .simulados-header h1 {
        font-size: 1.4rem;
    }

    .simulados-header p {
        font-size: 0.95rem;
    }
}

/* ── Mini Simulado ──────────────────────────────────────────────────────── */
.mini-sim-section {
    background: white;
    border-radius: 16px;
    border: 1.5px solid #ccfbf1;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 12px rgba(20, 184, 166, 0.08);
}

.mini-sim-body {
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.mini-sim-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
    min-width: 160px;
}

.mini-sim-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #475569;
}

.mini-banca-wrap {
    position: relative;
    display: flex;
    align-items: center;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    transition: border-color 0.2s;
}

.mini-banca-wrap:focus-within { border-color: #14b8a6; }

.mini-banca-icon {
    position: absolute;
    left: 0.75rem;
    color: #94a3b8;
    font-size: 0.8rem;
    pointer-events: none;
}

.mini-banca-input {
    width: 100%;
    padding: 0.65rem 2.2rem 0.65rem 2.1rem;
    border: none;
    border-radius: 10px;
    font-size: 0.88rem;
    color: #1e293b;
    outline: none;
    background: transparent;
}

.mini-banca-arrow {
    position: absolute;
    right: 0.75rem;
    color: #94a3b8;
    font-size: 0.72rem;
    pointer-events: none;
    transition: transform 0.2s;
}

.mini-banca-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
    padding: 0.4rem 0;
}

.mini-dd-item {
    padding: 0.6rem 1rem;
    font-size: 0.88rem;
    color: #1e293b;
    cursor: pointer;
    transition: background 0.1s;
}

.mini-dd-item:hover { background: #f0fdf4; color: #0f766e; font-weight: 600; }

.mini-dd-empty {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    color: #94a3b8;
    text-align: center;
}

.mini-count-btns {
    display: flex;
    gap: 0.5rem;
}

.mini-count-btn {
    width: 46px;
    height: 40px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    color: #475569;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
}

.mini-count-btn:hover { border-color: #14b8a6; color: #14b8a6; }

.mini-count-btn.active {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(20, 184, 166, 0.35);
}

.mini-sim-start {
    background: linear-gradient(135deg, #14b8a6, #0f766e);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.75rem 1.75rem;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(20, 184, 166, 0.35);
    transition: opacity 0.15s;
    white-space: nowrap;
    height: 40px;
}

.mini-sim-start:hover { opacity: 0.88; }

/* ── Meu Desempenho melhorado ───────────────────────────────────────────── */
.desempenho-stats-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.desemp-stat-card {
    flex: 1;
    min-width: 140px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.9rem;
}

.desemp-stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.desemp-stat-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
}

.desemp-stat-lbl {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 600;
    margin-top: 0.15rem;
}

/* Disc análise */
.disc-analise-list { display: flex; flex-direction: column; gap: 0.6rem; }

.disc-analise-item {
    display: grid;
    grid-template-columns: 1.2fr 2fr 90px 80px;
    gap: 0.75rem;
    align-items: center;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.7rem 0.9rem;
    font-size: 0.82rem;
}

.disc-analise-nome { font-weight: 700; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.disc-analise-bar-wrap { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }

.disc-analise-bar { height: 100%; border-radius: 4px; transition: width 0.5s ease; }

.disc-analise-pct { font-weight: 700; text-align: right; }

.disc-analise-btn {
    background: linear-gradient(135deg, #0284c7, #0369a1);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: opacity 0.15s;
}

.disc-analise-btn:hover { opacity: 0.85; }

/* ── Filtros histórico ──────────────────────────────────────────────────── */
.hist-filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    flex-wrap: wrap;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.hist-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.hist-filter-label {
    font-size: 0.76rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.hist-filter-input {
    padding: 0.55rem 0.8rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #1e293b;
    outline: none;
    background: white;
    transition: border-color 0.2s;
    min-width: 140px;
}

.hist-filter-input:focus { border-color: #6366f1; }

.hist-filter-sep {
    font-size: 0.78rem;
    color: #94a3b8;
    font-weight: 600;
    padding-bottom: 0.55rem;
    align-self: flex-end;
}

.hist-filter-clear {
    background: #f1f5f9;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 0.55rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.15s;
    align-self: flex-end;
}

.hist-filter-clear:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }

.hist-info {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 0.75rem;
}

/* ── Paginação histórico ────────────────────────────────────────────────── */
.hist-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.hist-pg-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border-radius: 8px;
    border: 1.5px solid #e2e8f0;
    background: white;
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.hist-pg-btn:hover:not(:disabled) { border-color: #6366f1; color: #6366f1; }

.hist-pg-btn.active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.hist-pg-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.hist-pg-ellipsis { color: #94a3b8; padding: 0 0.2rem; font-size: 0.9rem; }

@media (max-width: 640px) {
    .mini-sim-body { gap: 1rem; }
    .mini-sim-field { min-width: 100%; }
    .mini-sim-start { width: 100%; justify-content: center; }
    .disc-analise-item { grid-template-columns: 1fr 1.5fr 70px; }
    .disc-analise-btn { display: none; }
    .desemp-stat-card { min-width: 100%; }
    .hist-filters-bar { gap: 0.75rem; }
    .hist-filter-input { min-width: 120px; }
    .hist-filter-sep { display: none; }
}

/* ── Dark Mode ──────────────────────────────────────────────────────────── */
[data-theme="dark"] .main-content {
    background: #0d1828;
}

[data-theme="dark"] .simulado-card {
    background: #111d2e;
    border-color: #1e3550;
}

[data-theme="dark"] .filters-bar {
    background: #111d2e;
    border-color: #1e3550;
}

[data-theme="dark"] .filter-group {
    background: #19273a;
}

[data-theme="dark"] .table-responsive {
    background: #111d2e;
    border-color: #1e3550;
}

[data-theme="dark"] .search-wrapper input {
    background: #0d1828;
    border-color: #1e3550;
    color: #e2e8f0;
}

[data-theme="dark"] .search-wrapper input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .clean-select {
    background: #0d1828;
    border-color: #1e3550;
    color: #e2e8f0;
}

[data-theme="dark"] .history-header h2 {
    color: #e2e8f0;
}

[data-theme="dark"] .btn-outline {
    border-color: #1e3550;
    color: #94a3b8;
}

[data-theme="dark"] .btn-outline:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

[data-theme="dark"] .modern-table {
    background: #111d2e;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

[data-theme="dark"] .modern-table th {
    background: #19273a;
    color: #64748b;
    border-bottom-color: #1e3550;
}

[data-theme="dark"] .modern-table td {
    color: #e2e8f0;
    border-bottom-color: #1e3550;
}

[data-theme="dark"] .modern-table tbody tr:hover {
    background-color: #1f3145;
}

[data-theme="dark"] .score-high { background: #14532d; color: #4ade80; }
[data-theme="dark"] .score-medium { background: #713f12; color: #fde047; }
[data-theme="dark"] .score-low { background: #7f1d1d; color: #f87171; }

[data-theme="dark"] .mini-sim-section {
    background: #111d2e;
    border-color: #1e3550;
}

[data-theme="dark"] .mini-banca-wrap {
    background: #0d1828;
    border-color: #1e3550;
}

[data-theme="dark"] .mini-banca-input {
    color: #e2e8f0;
}

[data-theme="dark"] .mini-banca-dropdown {
    background: #111d2e;
    border-color: #1e3550;
}

[data-theme="dark"] .mini-dd-item {
    color: #e2e8f0;
}

[data-theme="dark"] .mini-dd-item:hover {
    background: #19273a;
    color: #22c55e;
}

[data-theme="dark"] .mini-dd-empty {
    color: #64748b;
}

[data-theme="dark"] .mini-count-btn {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}

[data-theme="dark"] .mini-count-btn:hover {
    border-color: #14b8a6;
    color: #14b8a6;
}

[data-theme="dark"] .desemp-stat-card {
    background: #19273a;
    border-color: #1e3550;
}

[data-theme="dark"] .desemp-stat-val {
    color: #e2e8f0;
}

[data-theme="dark"] .desemp-stat-lbl {
    color: #64748b;
}

[data-theme="dark"] .disc-analise-item {
    background: #19273a;
}

[data-theme="dark"] .disc-analise-nome {
    color: #e2e8f0;
}

[data-theme="dark"] .disc-analise-bar-wrap {
    background: #1e3550;
}

[data-theme="dark"] .hist-filters-bar {
    background: #19273a;
    border-color: #1e3550;
}

[data-theme="dark"] .hist-filter-label {
    color: #64748b;
}

[data-theme="dark"] .hist-filter-input {
    background: #0d1828;
    border-color: #1e3550;
    color: #e2e8f0;
}

[data-theme="dark"] .hist-filter-input:focus {
    border-color: #6366f1;
}

[data-theme="dark"] .hist-filter-sep {
    color: #64748b;
}

[data-theme="dark"] .hist-filter-clear {
    background: #19273a;
    border-color: #1e3550;
    color: #64748b;
}

[data-theme="dark"] .hist-filter-clear:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .hist-info {
    color: #64748b;
}

[data-theme="dark"] .hist-pg-btn {
    background: #19273a;
    border-color: #1e3550;
    color: #94a3b8;
}

[data-theme="dark"] .hist-pg-btn:hover:not(:disabled) {
    border-color: #6366f1;
    color: #6366f1;
}

[data-theme="dark"] .hist-pg-ellipsis {
    color: #64748b;
}
/* ══════════════════════════════════════════════
   DARK MODE — simulados.css
   ══════════════════════════════════════════════ */
[data-theme="dark"] .mini-sim-label { color: #94a3b8; }
