
/* DTEL CONTIGO - IDENTIDAD VISUAL */

:root {
    --verde: #168447;
    --verde-oscuro: #106536;
    --verde-claro: #e5f5eb;
    --negro: #14251c;
    --blanco: #ffffff;
    --fondo: #f3f6f4;
    --texto: #26352c;
    --gris: #718078;
    --borde: #dfe7e2;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--fondo);
    color: var(--texto);
}

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

button {
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

button:focus-visible, a:focus-visible {
    outline: 3px solid #62c98b;
    outline-offset: 3px;
}

/* PANTALLA DE INICIO DE SESION */

.login-screen {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.login-brand {
    background: linear-gradient(145deg, #101b15, #17683a);
    color: white;
    padding: 70px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-brand h1 {
    font-size: 48px;
    margin: 0;
}

.login-brand h1 span {
    color: #6de09b;
}

.login-brand h2 {
    font-size: 38px;
    line-height: 1.3;
    margin-top: 60px;
    margin-bottom: 15px;
}

.login-brand p {
    color: #c6e4d1;
    line-height: 1.7;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 35px;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border-radius: 22px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
}

.login-card h2 {
    font-size: 28px;
    margin-bottom: 8px;
    color: var(--negro);
}

.login-card p {
    color: var(--gris);
    line-height: 1.5;
}

.login-card label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-top: 22px;
    margin-bottom: 8px;
}

input, select, textarea {
    width: 100%;
    padding: 13px;
    border: 1px solid var(--borde);
    border-radius: 9px;
    background: white;
    color: var(--texto);
}

input:focus, select:focus, textarea:focus {
    outline: 2px solid var(--verde);
    outline-offset: 1px;
}

textarea {
    min-height: 100px;
    resize: vertical;
}

#login-button {
    width: 100%;
    padding: 15px;
    margin-top: 25px;
    background: var(--verde);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
}

#login-button:hover {
    background: var(--verde-oscuro);
}

#login-button:disabled {
    opacity: 0.6;
    cursor: wait;
}

#login-message {
    font-size: 14px;
    overflow-wrap: anywhere;
}

.login-card small {
    display: block;
    text-align: center;
    color: var(--gris);
    margin-top: 25px;
    line-height: 1.6;
}

/* APLICACION PRINCIPAL */

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

/* MENU LATERAL */

.sidebar {
    width: 255px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background: var(--negro);
    color: white;
    padding: 20px 14px;
    overflow-y: auto;
    z-index: 100;
}

.logo {
    font-size: 27px;
    font-weight: 800;
    padding: 12px 10px 25px;
}

.logo span {
    color: #6de09b;
}

.menu-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #92b4a0;
    margin: 24px 10px 10px;
}

.sidebar nav button {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: #d8e8de;
    padding: 12px 10px;
    margin-bottom: 4px;
    border-radius: 8px;
    font-size: 14px;
}

.sidebar nav button:hover,
.sidebar nav button.active {
    background: var(--verde);
    color: white;
}

#logout-button {
    width: 100%;
    margin-top: 25px;
    padding: 12px;
    background: transparent;
    border: 1px solid #648371;
    color: white;
    border-radius: 8px;
}

#logout-button:hover {
    background: #30483a;
}

/* CONTENIDO PRINCIPAL */

.main-content {
    margin-left: 255px;
    width: calc(100% - 255px);
    min-height: 100vh;
}

.topbar {
    min-height: 72px;
    background: white;
    border-bottom: 1px solid var(--borde);
    padding: 15px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar h2 {
    margin: 0;
    font-size: 22px;
}

.user-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 14px;
    font-weight: 600;
}

#notifications-button,
#menu-toggle {
    background: var(--verde-claro);
    border: none;
    border-radius: 10px;
    padding: 10px;
    color: var(--verde-oscuro);
}

#menu-toggle {
    display: none;
}

#page-content {
    padding: 30px;
    min-height: 75vh;
}

/* PANEL DE BIENVENIDA */

.hero, .welcome-banner {
    background: linear-gradient(120deg, #106536, #209b55);
    color: white;
    border-radius: 18px;
    padding: 35px;
    margin-bottom: 25px;
}

.hero h1, .welcome-banner h1 {
    margin-top: 0;
    font-size: 30px;
}

.hero p, .welcome-banner p {
    line-height: 1.6;
    margin-bottom: 0;
}

/* TARJETAS E INDICADORES */

.grid, .stats-grid, .cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.card, .stat-card, .panel {
    background: white;
    padding: 22px;
    border: 1px solid var(--borde);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.03);
    margin-bottom: 15px;
    overflow-wrap: anywhere;
}

.card h3, .panel h3 {
    margin-top: 0;
}

.stat-card h2, .stat-number {
    font-size: 32px;
    color: var(--verde);
    margin: 10px 0;
}

.muted {
    color: var(--gris);
}

.badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    background: var(--verde-claro);
    color: var(--verde-oscuro);
    font-size: 12px;
    font-weight: 600;
}

/* BOTONES Y FORMULARIOS */

.btn, .btn-primary {
    background: var(--verde);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    font-weight: 600;
}

.btn:hover, .btn-primary:hover {
    background: var(--verde-oscuro);
}

.btn-secondary {
    background: var(--verde-claro);
    color: var(--verde-oscuro);
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
}

.error {
    color: #b42318;
}

.success {
    color: var(--verde-oscuro);
}

/* TABLAS */

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

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid var(--borde);
    font-size: 14px;
}

th {
    background: var(--verde-claro);
    color: var(--verde-oscuro);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

footer {
    padding: 25px;
    text-align: center;
    color: var(--gris);
    font-size: 12px;
}

/* ADAPTACION A CELULARES */

@media (max-width: 768px) {

    .login-screen {
        grid-template-columns: 1fr;
    }

    .login-brand {
        padding: 30px;
    }

    .login-brand h1 {
        font-size: 34px;
    }

    .login-brand h2 {
        font-size: 24px;
        margin-top: 25px;
    }

    .login-container {
        padding: 20px;
    }

    .login-card {
        padding: 25px;
    }

    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    #menu-toggle {
        display: block;
    }

    .topbar {
        padding: 12px 15px;
    }

    .topbar h2 {
        font-size: 18px;
    }

    #page-content {
        padding: 15px;
    }

    .hero, .welcome-banner {
        padding: 25px;
    }

    .grid, .stats-grid, .cards-grid {
        grid-template-columns: 1fr;
    }
}
