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

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0c0e14;
    color: #d0d0d0;
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* ── Navbar ───────────────────────────────────────── */
.navbar {
    background: #13161f;
    border-bottom: 1px solid #1e2230;
    padding: 0 1.5rem;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-brand {
    font-weight: 700;
    font-size: 1rem;
    color: #8b9aff;
    text-decoration: none;
}

.nav-sep { color: #2a2d3a; }
.nav-sub { color: #555; font-size: 0.8rem; }

.nav-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    color: #888;
    text-decoration: none;
    font-size: 0.85rem;
    transition: color 0.2s;
}

.nav-link:hover { color: #ccc; }
.nav-logout { color: #666; }
.nav-user {
    color: #8b9aff;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.2rem 0.6rem;
    background: #1a1d2e;
    border-radius: 4px;
}

/* ── Main Content ─────────────────────────────────── */
.main-content {
    padding: 1.5rem;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

/* ── Page Header ──────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.page-header h1 {
    font-size: 1.5rem;
    color: #eee;
    font-weight: 600;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.section-header {
    margin: 2rem 0 1rem;
}

.section-header h2 {
    font-size: 1.1rem;
    color: #bbb;
    font-weight: 500;
}

/* ── Flash Messages ───────────────────────────────── */
.flash-container {
    max-width: 1000px;
    margin: 0 auto 1rem;
}

.flash {
    padding: 0.7rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.flash-success { background: #132a1a; color: #4ade80; border: 1px solid #1a3a22; }
.flash-error { background: #2a1313; color: #f87171; border: 1px solid #3a1a1a; }
.flash-warning { background: #2a2813; color: #facc15; border: 1px solid #3a351a; }

/* ── Upload Card ──────────────────────────────────── */
.upload-card {
    background: #13161f;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 1.5rem;
}

.dropzone {
    border: 2px dashed #2a2d3a;
    border-radius: 10px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s;
    margin-bottom: 1rem;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: #8b9aff;
    background: #161a28;
}

.dropzone-icon { color: #3a3f55; margin-bottom: 0.8rem; }
.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon { color: #8b9aff; }

.dropzone-text {
    font-size: 1rem;
    color: #aaa;
    margin-bottom: 0.3rem;
}

.dropzone-sub { font-size: 0.8rem; color: #555; }
.file-input { display: none; }

/* ── File List ────────────────────────────────────── */
.file-list {
    background: #0f1118;
    border: 1px solid #1e2230;
    border-radius: 8px;
    padding: 0.8rem 1rem;
    margin-bottom: 1rem;
    max-height: 200px;
    overflow-y: auto;
}

.file-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
    color: #888;
}

.file-list ul {
    list-style: none;
}

.file-list li {
    font-size: 0.8rem;
    color: #8b9aff;
    padding: 0.15rem 0;
    font-family: monospace;
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-primary {
    background: #6c7bef;
    color: #fff;
}
.btn-primary:hover { background: #5a69d4; }
.btn-primary:disabled { background: #2a2d3a; color: #555; cursor: not-allowed; }

.btn-outline {
    background: transparent;
    border: 1px solid #2a2d3a;
    color: #8b9aff;
}
.btn-outline:hover { border-color: #8b9aff; background: #161a28; }

.btn-ghost {
    background: transparent;
    color: #888;
}
.btn-ghost:hover { color: #ccc; }

.btn-danger {
    background: #7f1d1d;
    color: #fca5a5;
}
.btn-danger:hover { background: #991b1b; }

.btn-full { width: 100%; margin-top: 0.5rem; padding: 0.75rem; font-size: 0.9rem; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.75rem; }

/* ── Card ─────────────────────────────────────────── */
.card {
    background: #13161f;
    border: 1px solid #1e2230;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card-title {
    font-size: 0.9rem;
    color: #aaa;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* ── Table ────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #1e2230;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table th {
    background: #161922;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    padding: 0.7rem 1rem;
    text-align: left;
    border-bottom: 1px solid #1e2230;
}

.table td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid #141720;
    vertical-align: middle;
}

.table tbody tr:hover { background: #161922; }
.table tbody tr:last-child td { border-bottom: none; }

/* ── Badge ────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-concluido { background: #132a1a; color: #4ade80; }
.badge-processando { background: #1a1d2e; color: #8b9aff; }
.badge-parcial { background: #2a2813; color: #facc15; }
.badge-erro { background: #2a1313; color: #f87171; }
.badge-admin { background: #2a1a30; color: #c084fc; }
.badge-user { background: #1a1d2e; color: #8b9aff; }

/* ── Forms ────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    color: #777;
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.8rem;
    background: #0c0e14;
    border: 1px solid #1e2230;
    border-radius: 6px;
    color: #ddd;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: #6c7bef;
}

.form-inline {
    display: flex;
    gap: 0.8rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.form-check label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    color: #aaa;
}

.inline-form {
    display: inline-flex;
    gap: 0.3rem;
    align-items: center;
}

.input-sm {
    padding: 0.25rem 0.5rem;
    background: #0c0e14;
    border: 1px solid #1e2230;
    border-radius: 4px;
    color: #ddd;
    font-size: 0.75rem;
    width: 110px;
    outline: none;
}

.input-sm:focus { border-color: #6c7bef; }

/* ── Actions ──────────────────────────────────────── */
.actions {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-wrap: wrap;
}

/* ── Login ────────────────────────────────────────── */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.login-card {
    background: #13161f;
    border: 1px solid #1e2230;
    border-radius: 14px;
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 380px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.5rem;
    color: #8b9aff;
    font-weight: 700;
}

.login-header p {
    color: #555;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

/* ── Utilities ────────────────────────────────────── */
.text-muted { color: #555; font-size: 0.85rem; }
.text-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.text-sm { font-size: 0.8rem; }
.text-xs { font-size: 0.7rem; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #444;
    font-size: 0.9rem;
}

/* ── Stats Grid ───────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #13161f;
    border: 1px solid #1e2230;
    border-radius: 10px;
    padding: 1.2rem 1rem;
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: #8b9aff;
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #555;
    margin-top: 0.3rem;
}

/* ── Rankings Grid ────────────────────────────────── */
.rankings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.table-mini {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.table-mini th {
    color: #555;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    padding: 0.4rem 0.5rem;
    text-align: left;
    border-bottom: 1px solid #1e2230;
}

.table-mini td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid #141720;
    color: #bbb;
}

.text-center { text-align: center; }

/* ── Responsive ───────────────────────────────────── */
@media (max-width: 768px) {
    .navbar { padding: 0 1rem; }
    .nav-sub { display: none; }
    .nav-sep { display: none; }
    .page-header { flex-direction: column; }
    .form-inline { flex-direction: column; align-items: stretch; }
    .actions { flex-direction: column; }
    .stats-grid { grid-template-columns: 1fr; }
    .rankings-grid { grid-template-columns: 1fr; }
}
