
:root {
    --navy: #101d3a;
    --navy-light: #1c3158;
    --blue: #2563eb;
    --blue-light: #eff6ff;
    --ink: #18243b;
    --muted: #7b879b;
    --line: #e8edf5;
    --bg: #f5f7fc;
    --white: #ffffff;
    --green: #16a34a;
    --red: #dc2626;
    --shadow: 0 5px 20px rgba(20, 40, 80, .045);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
    font-size: 14px;
}

button, input, select, textarea {
    font: inherit;
}

.app {
    min-height: 100vh;
    display: flex;
}

/* SIDEBAR */

.sidebar {
    width: 255px;
    min-height: 100vh;
    background: var(--navy);
    color: #dce5ff;
    padding: 25px 17px;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 8px 32px;
}

.brand strong {
    display: block;
    color: white;
    font-size: 15px;
    font-weight: 800;
}

.brand small {
    display: block;
    color: #9eafd1;
    font-size: 11px;
    margin-top: 4px;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: linear-gradient(135deg, #60a5fa, #2563eb);
    display: grid;
    place-items: center;
    color: white;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 5px 15px #2563eb55;
}

.nav-label {
    color: #7184a9;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
    padding: 0 13px;
    margin-bottom: 12px;
}

.sidebar nav {
    display: grid;
    gap: 7px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 13px;
    color: #bdcbe5;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 10px;
    font-weight: 500;
    transition: .2s;
}

.sidebar nav a i {
    width: 19px;
    text-align: center;
    font-size: 15px;
}

.sidebar nav a:hover,
.sidebar nav a.active {
    background: #263b65;
    color: white;
}

.sidebar nav a.active {
    box-shadow: inset 3px 0 #60a5fa;
}

.sidebar-bottom {
    margin-top: auto;
}

.sidebar-info {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1b2d50;
    padding: 13px;
    border-radius: 10px;
    margin-bottom: 16px;
}

.sidebar-info i {
    color: #60a5fa;
    font-size: 19px;
}

.sidebar-info strong,
.sidebar-info small {
    display: block;
}

.sidebar-info strong {
    font-size: 11px;
    color: white;
}

.sidebar-info small {
    color: #9eafd1;
    font-size: 10px;
    margin-top: 4px;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: transparent;
    border: 1px solid #344466;
    color: #dce5ff;
    padding: 12px;
    border-radius: 9px;
    cursor: pointer;
    transition: .2s;
}

.logout-btn:hover {
    background: #263b65;
}

/* CONTENIDO */

.main {
    flex: 1;
    min-width: 0;
    padding: 30px 35px;
    max-width: 1600px;
    margin: auto;
    width: 100%;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 27px;
    gap: 15px;
}

.topbar h1 {
    font-size: 26px;
    margin: 6px 0 0;
    font-weight: 800;
    letter-spacing: -.6px;
}

.topbar small,
.eyebrow {
    color: #8290a7;
    font-size: 10px;
    letter-spacing: 1.2px;
    font-weight: 700;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 11px;
    font-weight: 600;
}

.user-chip strong,
.user-chip small {
    display: block;
}

.user-chip strong {
    font-size: 12px;
    color: var(--ink);
}

.user-chip small {
    font-size: 10px;
    margin-top: 4px;
}

.avatar {
    width: 39px;
    height: 39px;
    border-radius: 12px;
    background: #dbeafe;
    color: #1d4ed8;
    display: grid;
    place-items: center;
    font-weight: 800;
}

/* BIENVENIDA */

.welcome {
    background: linear-gradient(115deg, #172554, #2855a1);
    color: white;
    padding: 30px;
    border-radius: 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    box-shadow: 0 10px 25px #17255420;
}

.welcome h2 {
    font-size: 23px;
    margin: 9px 0;
}

.welcome p {
    color: #d0dcf4;
    margin: 0;
    line-height: 1.6;
}

.light {
    background: white;
    color: #1e40af;
}

/* ESTADÍSTICAS */

.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 17px;
    margin-bottom: 24px;
}

.stat,
.panel {
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 21px;
    box-shadow: var(--shadow);
}

.stat {
    transition: transform .2s, box-shadow .2s;
}

.stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px #1d355714;
}

.stat span,
.stat small {
    display: block;
    color: var(--muted);
}

.stat strong {
    display: block;
    font-size: 31px;
    margin: 12px 0 6px;
    font-weight: 800;
    color: var(--ink);
}

.panel {
    margin-bottom: 21px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 19px;
    gap: 12px;
}

.panel h3 {
    margin: 0 0 5px;
    font-size: 16px;
    font-weight: 700;
}

.panel p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.panel-head a {
    color: var(--blue);
    text-decoration: none;
    font-weight: 600;
}

/* TABLAS */

.table-wrap {
    overflow-x: auto;
}

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

th, td {
    text-align: left;
    padding: 15px 11px;
    border-bottom: 1px solid #edf0f5;
}

th {
    color: #7b8799;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .7px;
    font-weight: 800;
    background: #fafbfe;
}

td {
    font-size: 12px;
    color: #46536a;
}

tbody tr:hover {
    background: #f8faff;
}

/* ESTADOS */

.pill {
    display: inline-block;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 20px;
    padding: 6px 11px;
    font-size: 10px;
    font-weight: 700;
}

/* FORMULARIOS */

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 17px;
}

.form-grid > div {
    display: grid;
    gap: 8px;
}

.form-grid label,
.login-card label {
    font-size: 12px;
    font-weight: 700;
    color: #536078;
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.login-card input {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #dce2ec;
    border-radius: 9px;
    background: white;
    outline: none;
    transition: .2s;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus,
.login-card input:focus {
    border-color: #6095f5;
    box-shadow: 0 0 0 3px #dbeafe;
}

.span-2 {
    grid-column: span 2;
}

/* BOTONES */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 0;
    border-radius: 9px;
    padding: 11px 17px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
    transition: .2s;
}

.btn:hover {
    transform: translateY(-1px);
}

.primary {
    background: var(--blue);
    color: white;
    box-shadow: 0 4px 12px #2563eb30;
}

.primary:hover {
    background: #1d4ed8;
}

.primary:disabled {
    opacity: .5;
}

.form-grid > .btn {
    justify-self: start;
}

.link-danger {
    border: 0;
    background: none;
    color: var(--red);
    cursor: pointer;
    font-weight: 700;
}

/* MENSAJES */

.alert {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
    padding: 13px 15px;
    border-radius: 9px;
    margin-bottom: 17px;
}

/* LOGIN */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #eaf1ff, #f7f9fd);
}

.login-card {
    width: min(100%, 420px);
    background: white;
    padding: 38px;
    border-radius: 18px;
    box-shadow: 0 18px 55px #1d35571a;
}

.login-brand {
    padding: 0;
    margin-bottom: 30px;
}

.login-brand strong {
    color: #172554;
}

.login-brand small {
    color: #738096;
}

.login-card h1 {
    font-size: 26px;
    margin: 0 0 7px;
}

.muted {
    color: #778399;
}

.login-card form {
    display: grid;
    gap: 10px;
    margin: 24px 0;
}

.login-card form label:not(:first-of-type) {
    margin-top: 8px;
}

.full {
    width: 100%;
    margin-top: 12px;
}

.login-card > .muted {
    font-size: 11px;
    text-align: center;
}

/* RESPONSIVE */

@media(max-width: 1100px) {
    .stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 900px) {
    .sidebar {
        width: 220px;
    }

    .main {
        padding: 22px;
    }
}

@media(max-width: 620px) {
    .app {
        display: block;
    }

    .sidebar {
        width: 100%;
        min-height: auto;
        padding: 16px;
    }

    .brand {
        padding-bottom: 16px;
    }

    .sidebar nav {
        grid-template-columns: repeat(2, 1fr);
    }

    .sidebar-bottom {
        margin-top: 15px;
    }

    .main {
        padding: 18px;
    }

    .stats {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .welcome {
        display: block;
        padding: 22px;
    }

    .welcome .btn {
        margin-top: 18px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: auto;
    }

    .topbar h1 {
        font-size: 20px;
    }

    .user-chip {
        font-size: 11px;
    }

    .stat {
        padding: 15px;
    }

    .stat strong {
        font-size: 25px;
    }

    .login-card {
        padding: 25px;
    }
}


/* ICONOS DE ESTADISTICAS */

.stat-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    font-size: 17px;
}

.stat-icon.blue {
    background: #eff6ff;
    color: #2563eb;
}

.stat-icon.purple {
    background: #f3e8ff;
    color: #9333ea;
}

.stat-icon.green {
    background: #dcfce7;
    color: #16a34a;
}

.stat-icon.orange {
    background: #ffedd5;
    color: #ea580c;
}

/* GRAFICOS */

.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 22px;
}

.chart-box {
    min-width: 0;
}

.chart-container {
    position: relative;
    height: 260px;
    width: 100%;
}

.chart-heading-icon {
    color: #93a4bd;
    font-size: 20px;
}

.task-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    border-top: 1px solid var(--line);
    margin-top: 15px;
    padding-top: 15px;
}

.task-summary div {
    display: grid;
    gap: 5px;
}

.task-summary span {
    font-size: 10px;
    color: var(--muted);
}

.task-summary strong {
    font-size: 19px;
    color: var(--ink);
}

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

.link-edit {
    border: none;
    background: #eff6ff;
    color: #2563eb;
    padding: 7px 12px;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 600;
}

.link-edit:hover {
    background: #dbeafe;
}