:root {
    --bg: #f3f6fb;
    --surface: #ffffff;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --muted: #6b7280;
    --accent: #06b6d4;
    --radius: 10px;
    --card-shadow: 0 8px 20px rgba(9, 30, 66, 0.06);
}

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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg);
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

/* Centered login */
.centered-view {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 20px
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--card-shadow);
    padding: 18px;
}

/* Auth card */
.auth-card {
    width: 380px;
    text-align: left
}

.auth-card h2 {
    margin-bottom: 12px;
    color: var(--primary-dark)
}

.auth-card label {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--muted);
    font-size: 12px;
}

.auth-card input {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e6eef8;
    margin-top: 6px
}

input {
    height: 35px;
}

.muted {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 0.85rem
}

/* Todas las A */
a {
    font-size: 12px;
}



/* Todos los P */
p {
    font-size: 12px;
}

/* Todos los Span */
span {
    font-size: 12px;
}


/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    margin-top: 12px;
}

.btn.primary {
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    color: #fff
}

.btn.ghost {
    background: transparent;
    border: 1px solid #e6eef8;
    color: var(--muted)
}

/* Layout */
#main-container {
    display: flex;
    min-height: 100vh
}

/* Sidebar */
.sidebar {
    width: 260px;
    padding: 20px;
    background: linear-gradient(180deg, #0f172a, #111827);
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.1rem
}

.brand i {
    font-size: 1.3rem;
    color: var(--accent)
}

.user-line {
    margin-top: 12px
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.sidebar-nav {
    margin-top: 12px;
    flex-grow: 1
}

.nav-list {
    list-style: none;
    padding: 0
}

.nav-item {
    margin-bottom: 6px
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    color: #e6eef8;
    text-decoration: none;
    transition: background 0.18s;
}

.nav-item a:hover {
    background: rgba(255, 255, 255, 0.04)
}

.nav-item a.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    font-weight: 700
}

/* Content */
.content-area {
    flex-grow: 1;
    padding: 28px 32px;
}

/* Header inside content */
.page-header h1 {
    font-size: 1.6rem;
    color: var(--primary-dark);
    margin-bottom: 12px
}

/* KPI summary */
.kpis-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 18px;
    margin-bottom: 22px
}

.kpi-card {
    text-align: center;
    padding: 18px;
    border-radius: 12px
}

.kpi-label {
    color: var(--muted);
    font-weight: 600;
    font-size: 12px;
}

.kpi-value {
    font-size: 2rem;
    color: var(--primary);
    font-weight: 800;
    margin-top: 6px
}

/* Dashboard grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 18px
}

.chart-card {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.chart-wrapper {
    height: 360px
}

/* Forms */
.form-card {
    max-width: 760px;
    margin: auto
}

.form-card label {
    display: block;
    margin-top: 12px;
    color: var(--muted);
    font-size: 12px;
}

select {
    height: 35px;
}

.form-card input,
.form-card select {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #e6eef8;
    margin-top: 6px
}

.form-title {
    color: var(--primary-dark);
    text-align: center;
    margin-bottom: 6px
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px
}

th,
td {
    padding: 12px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
    font-size: 12px;
}

th {
    background: #f8fafc;
    color: #374151;
    font-weight: 700;
    font-size: 12px;
}

tr.clickable-row:hover {
    background: #eef6ff;
    cursor: pointer
}

/* Small helpers */
.top-row {
    display: flex;
    justify-content: space-between;
    align-items: center
}

.muted-small {
    color: var(--muted);
    font-size: 0.9rem
}

/* Toasts */
.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.2);
    z-index: 9999;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.25s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0)
}

.toast.success {
    background: linear-gradient(90deg, #10b981, #059669)
}

/* Todos los select del form */
form label {
    font-size: 12px;
}

.prueba {
    height: 35px;
    background-color: white;
}

form select {
    height: 35px;
}

.toast.error {
    background: linear-gradient(90deg, #ef4444, #dc2626)
}

/* Filtros y Paginación */
.filter-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 20px;
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination-controls button {
    border: 1px solid #e6eef8;
    background-color: #f9fafb;
    color: #374151;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.15s;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: #eef6ff;
}

.pagination-controls button.active {
    background-color: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-controls button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive */
@media (max-width:900px) {
    .sidebar {
        display: none
    }

    #main-container {
        flex-direction: column
    }

    .chart-wrapper {
        height: 300px
    }
}