/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', sans-serif; background: #f0f2f5; color: #1a1a2e; }

/* ── Login ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

.login-card {
    background: #fff;
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.login-logo {
    background: #FD7E14;
    color: #fff;
    font-weight: 900;
    font-size: 22px;
    padding: 10px 20px;
    border-radius: 8px;
    display: block;
    text-align: center;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.login-card h2 { font-size: 20px; margin-bottom: 24px; color: #1a1a2e; }

.login-card label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #555;
}

.login-card input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 16px;
    transition: border-color 0.2s;
    outline: none;
}

.login-card input:focus { border-color: #FD7E14; }

.login-card button[type="submit"] {
    width: 100%;
    padding: 14px;
    background: #FD7E14;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.login-card button[type="submit"]:hover { background: #e8590c; }
.login-card button:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Alert ── */
.alert-error {
    background: #ffe3e3;
    color: #c92a2a;
    border: 1px solid #ffa8a8;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ── Layout general ── */
.app { display: flex; min-height: 100vh; }

/* ── Sidebar ── */
.sidebar {
    width: 200px;
    background: #1a1a2e;
    display: flex;
    flex-direction: column;
    padding: 0;
    flex-shrink: 0;
}

.sidebar-logo {
    background: #FD7E14;
    color: #fff;
    font-weight: 900;
    font-size: 16px;
    padding: 20px;
    letter-spacing: 1px;
}

.sidebar nav { flex: 1; padding: 16px 0; }

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #adb5bd;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.sidebar nav a:hover, .sidebar nav a.active {
    background: #FD7E14;
    color: #fff;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid #2d2d4e;
    font-size: 12px;
    color: #6c757d;
}

/* ── Main content ── */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
    background: #fff;
    border-bottom: 1px solid #e9ecef;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.topbar h1 { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.topbar-actions { display: flex; gap: 10px; }

.btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary { background: #4C6EF5; color: #fff; }
.btn-primary:hover { background: #3b5bdb; }
.btn-danger  { background: #fa5252; color: #fff; }
.btn-danger:hover  { background: #e03131; }
.btn-sm { padding: 6px 14px; font-size: 12px; }

.content { padding: 28px; overflow-y: auto; flex: 1; }

/* ── Semáforo legend ── */
.legend {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: #555;
    flex-wrap: wrap;
}

.legend-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 4px;
}

.dot-green  { background: #51CF66; }
.dot-yellow { background: #FFD43B; }
.dot-red    { background: #FF6B6B; }
.dot-blue   { background: #4C6EF5; }
.dot-orange { background: #FD7E14; }

/* ── KPI Cards ── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.kpi-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    border-left: 4px solid;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.kpi-card.green  { border-color: #51CF66; }
.kpi-card.blue   { border-color: #4C6EF5; }
.kpi-card.orange { border-color: #FD7E14; }
.kpi-card.purple { border-color: #9775FA; }

.kpi-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
}

.kpi-card.green  .kpi-value { color: #51CF66; }
.kpi-card.blue   .kpi-value { color: #4C6EF5; }
.kpi-card.orange .kpi-value { color: #FD7E14; }
.kpi-card.purple .kpi-value { color: #9775FA; }

.kpi-label { font-size: 13px; color: #868e96; }

/* ── Cards ── */
.card {
    background: #fff;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.card-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 16px;
    color: #1a1a2e;
}

/* ── Progress bar ── */
.progress-bar {
    height: 10px;
    background: #f1f3f5;
    border-radius: 5px;
    overflow: hidden;
    flex: 1;
}

.progress-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.fill-green  { background: #51CF66; }
.fill-yellow { background: #FFD43B; }
.fill-red    { background: #FF6B6B; }

/* ── Table ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { background: #1a1a2e; color: #fff; }
thead th { padding: 12px 16px; text-align: left; font-size: 12px; letter-spacing: 0.5px; }
tbody tr { border-bottom: 1px solid #f1f3f5; transition: background 0.15s; }
tbody tr:hover { background: #f8f9fa; }
tbody td { padding: 12px 16px; }

/* ── Badge ── */
.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.badge-green  { background: #ebfbee; color: #2b8a3e; }
.badge-yellow { background: #fff9db; color: #e67700; }
.badge-red    { background: #ffe3e3; color: #c92a2a; }
.badge-blue   { background: #e7f5ff; color: #1971c2; }

/* ── Avatar ── */
.avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px; color: #fff;
    flex-shrink: 0;
}

/* ── Search & Filters ── */
.filters {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    padding: 10px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    width: 280px;
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus { border-color: #FD7E14; }

.filter-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    background: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn.active, .filter-btn:hover {
    background: #FD7E14;
    border-color: #FD7E14;
    color: #fff;
}

/* ── Mobile navbar ── */
.mobile-nav { display: none; }

/* ── Responsive móvil ── */
@media (max-width: 768px) {

    .sidebar { display: none; }

    .main { width: 100%; }

    .topbar {
        height: auto;
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 6px;
    }

    .topbar h1 { font-size: 16px; order: 1; }

    .topbar-actions { order: 2; }

    .legend { display: none; }

    .content { padding: 16px; padding-bottom: 80px; }

    .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .kpi-value { font-size: 26px !important; }
    .kpi-label { font-size: 11px; }
    .kpi-card  { padding: 14px 16px; }

    .row-grid {
        display: flex !important;
        flex-direction: column !important;
    }

    .search-input { width: 100%; }

    .filters { flex-direction: column; align-items: stretch; }

    table { min-width: 480px; font-size: 12px; }
    thead th { padding: 10px 12px; }
    tbody td { padding: 10px 12px; }

    .login-card { padding: 32px 24px; margin: 16px; }

    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: #1a1a2e;
        border-top: 2px solid #FD7E14;
        z-index: 999;
        padding: 8px 0;
    }

    .mobile-nav a {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        color: #adb5bd;
        text-decoration: none;
        font-size: 10px;
        gap: 3px;
        padding: 4px 0;
    }

    .mobile-nav a.active { color: #FD7E14; }
    .mobile-nav a .nav-icon { font-size: 20px; line-height: 1; }
}