:root {
    --verde-principal: #00774e;
    --verde-claro: #b3d722;
    --verde-oscuro: #00593a;
    --gris-fondo: #f4f7f2;
    --blanco: #ffffff;
    --texto: #263238;
    --borde: #d9e1dd;
}

* {
    box-sizing: border-box;
}

html {
    width: 100%;
    overflow-x: hidden;
}

body {
    margin: 0;
    width: 100%;
    overflow-x: hidden;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--gris-fondo);
    color: var(--texto);
}

.login-body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--verde-principal), var(--verde-claro));
    position: relative;
    padding: 25px;
}

.login-card {
    width: 100%;
    max-width: 450px;
    background: var(--blanco);
    padding: 35px;
    border-radius: 18px;
    box-shadow: 0 15px 35px rgba(0,0,0,.18);
    border-top: 8px solid var(--verde-claro);
}

.login-card h1 {
    color: var(--verde-principal);
    margin: 0 0 18px;
    text-align: center;
    font-size: clamp(20px, 5vw, 24px);
    letter-spacing: .5px;
}

.login-card h2 {
    text-align: center;
    font-size: clamp(16px, 4vw, 18px);
    margin-bottom: 25px;
    color: var(--texto);
}

.logo-box {
    width: min(180px, 70vw);
    height: 100px;
    margin: 0 auto 20px;
    border: 2px dashed var(--verde-principal);
    border-radius: 14px;
    background: #f8fbf0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--verde-principal);
    font-weight: bold;
    text-align: center;
}

.logo-img {
    display: block;
    width: auto;
    max-width: min(220px, 75vw);
    max-height: 120px;
    margin: 0 auto 20px;
    object-fit: contain;
}

.corner-image-box,
.small-corner-image {
    width: 95px;
    height: 70px;
    border: 2px dashed var(--verde-claro);
    border-radius: 12px;
    background: rgba(255,255,255,.9);
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--verde-principal);
    font-weight: bold;
    font-size: 13px;
}

.corner-image-box {
    position: absolute;
    top: 20px;
    right: 25px;
}

.corner-img {
    position: absolute;
    top: 18px;
    right: 25px;
    width: 95px;
    height: 70px;
    object-fit: contain;
}

.main-header {
    position: relative;
    background: var(--verde-principal);
    color: white;
    padding: 25px 35px 30px;
    text-align: center;
    border-bottom: 7px solid var(--verde-claro);
}

.main-header h1 {
    margin: 0 0 15px;
    font-size: clamp(22px, 5vw, 30px);
    letter-spacing: .8px;
    padding: 0 130px;
}

.main-header p {
    margin: 6px 0 0;
    font-size: clamp(14px, 3vw, 16px);
}

.header-logo {
    background: white;
    margin-bottom: 12px;
}

.small-corner-image {
    position: absolute;
    top: 18px;
    right: 25px;
}

.logout {
    position: absolute;
    left: 25px;
    top: 24px;
    color: white;
    text-decoration: none;
    font-weight: bold;
    background: var(--verde-oscuro);
    padding: 10px 16px;
    border-radius: 8px;
    white-space: nowrap;
}

.container {
    width: 100%;
    max-width: 1100px;
    margin: 30px auto;
    padding: 0 20px;
}

.welcome {
    background: var(--blanco);
    border-left: 6px solid var(--verde-claro);
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.form-card {
    width: 100%;
    background: var(--blanco);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(0,0,0,.08);
}

.form-card h2 {
    color: var(--verde-principal);
    margin-top: 25px;
    border-bottom: 2px solid var(--borde);
    padding-bottom: 8px;
    font-size: clamp(18px, 4vw, 22px);
}

label {
    display: block;
    margin-top: 14px;
    font-weight: bold;
}

input,
select,
textarea {
    width: 100%;
    max-width: 100%;
    margin-top: 6px;
    padding: 12px;
    border: 1px solid var(--borde);
    border-radius: 8px;
    font-size: 16px;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--verde-claro);
    border-color: var(--verde-principal);
}

input[readonly] {
    background: #eef2f0;
    color: #555;
}

button {
    margin-top: 25px;
    background: var(--verde-principal);
    color: white;
    border: none;
    padding: 14px 22px;
    border-radius: 9px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    min-height: 48px;
}

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

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

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

.alert {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.error {
    background: #ffe6e6;
    color: #a30000;
}

.success {
    background: #ecffd6;
    color: #315f00;
    border-left: 6px solid var(--verde-claro);
}

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

    .main-header h1 {
        padding: 0 110px;
    }
}

@media (max-width: 700px) {
    .login-body {
        align-items: flex-start;
        padding: 100px 15px 25px;
    }

    .login-card {
        padding: 25px 20px;
        border-radius: 14px;
    }

    .corner-image-box {
        top: 15px;
        right: 15px;
        width: 75px;
        height: 55px;
        font-size: 11px;
    }

    .main-header {
        padding: 105px 18px 25px;
    }

    .main-header h1 {
        padding: 0;
        margin-top: 5px;
        line-height: 1.2;
    }

    .logout {
        top: 18px;
        left: 18px;
        padding: 9px 12px;
        font-size: 14px;
    }

    .small-corner-image,
    .corner-img {
        top: 15px;
        right: 15px;
        width: 75px;
        height: 55px;
        font-size: 11px;
    }

    .container {
        margin: 20px auto;
        padding: 0 12px;
    }

    .form-card {
        padding: 20px 15px;
        border-radius: 12px;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
        gap: 0;
    }

    button {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .login-body {
        padding-top: 90px;
    }

    .login-card h1 {
        font-size: 19px;
    }

    .main-header {
        padding-top: 95px;
    }

    .logout {
        font-size: 13px;
        padding: 8px 10px;
    }

    .small-corner-image,
    .corner-image-box,
    .corner-img {
        width: 65px;
        height: 48px;
    }

    .logo-box {
        height: 85px;
    }

    .logo-img {
        max-height: 95px;
    }

    input,
    select,
    textarea {
        font-size: 16px;
    }

    .admin-actions {
        margin-bottom: 20px;
    }
    
    .table-responsive {
        width: 100%;
        overflow-x: auto;
        margin-top: 20px;
    }
    
    .data-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 900px;
    }
    
    .data-table th,
    .data-table td {
        border: 1px solid var(--borde);
        padding: 10px;
        text-align: left;
        font-size: 14px;
    }
    
    .data-table th {
        background: var(--verde-principal);
        color: white;
    }
    
    .data-table tr:nth-child(even) {
        background: #f8fbf0;
    }
    
    .data-table a {
        color: var(--verde-principal);
        font-weight: bold;
        text-decoration: none;
    }
    
    .data-table a:hover {
        text-decoration: underline;
    }
}