* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #f3f6fa;
    color: #17324d;
}

.hero {
    min-height: 150px;
    background: linear-gradient(135deg, #07579f 0%, #1678c8 58%, #dceefa 100%);
    position: relative;
    overflow: hidden;
    border-bottom: 5px solid #0b5ea8;
}

.hero::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 260px;
    border-radius: 50%;
    right: -130px;
    top: -150px;
    background: rgba(255,255,255,.14);
}

.hero-overlay {
    width: 100%;
    max-width: none;
    margin: 0;
    min-height: 150px;
    padding: 30px 28px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;
}

.brand h1 {
    margin: 0;
    color: white;
    font-size: clamp(28px, 3.4vw, 42px);
    font-weight: 800;
    letter-spacing: .4px;
}

.brand p {
    margin: 10px 0 0;
    color: rgba(255,255,255,.94);
    font-size: 17px;
    font-weight: 400;
}

.container {
    width: 100%;
    max-width: none;
    margin: -22px auto 34px;
    padding: 0 18px;
    position: relative;
    z-index: 2;
}

section {
    background: white;
    border-radius: 16px;
    padding: 20px 22px;
    margin-bottom: 16px;
    box-shadow: 0 8px 28px rgba(22, 61, 100, .08);
    border: 1px solid #e3ebf3;
}

.section-title {
    display: flex;
    gap: 13px;
    align-items: center;
    margin-bottom: 19px;
}

.section-title > span {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8f3fc;
    font-size: 22px;
}

.section-title h2 {
    margin: 0;
    color: #07579f;
    font-size: 20px;
}

.section-title p {
    margin: 4px 0 0;
    color: #718294;
    font-size: 13px;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.card {
    min-height: 105px;
    border-radius: 15px;
    padding: 17px;
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    border: 1px solid #dfe8f0;
    transition: .2s ease;
    position: relative;
    background: #fbfdff;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(17, 85, 140, .12);
    border-color: #75add8;
}

.app-card {
    background: #f7fbfe;
}

.coordination-card {
    background: #f8fbff;
}

.drive-card {
    background: #fbfcfe;
}

.validator-card {
    background: #f9fcff;
}

.card-icon {
    min-width: 56px;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 27px;
    background: white;
    box-shadow: 0 3px 10px rgba(20, 70, 110, .08);
}

.card h3 {
    margin: 0 30px 5px 0;
    font-size: 16px;
    color: #17324d;
}

.card p {
    margin: 0;
    color: #748392;
    font-size: 13px;
    line-height: 1.35;
}

.arrow {
    position: absolute;
    right: 15px;
    top: 13px;
    font-size: 18px;
    color: #0b70bf;
}

footer {
    text-align: center;
    color: #7b8995;
    padding: 4px 20px 30px;
    font-size: 13px;
}

@media (max-width: 700px) {
    .hero-overlay {
        padding: 35px 20px;
    }

    .container {
        padding: 0 12px;
    }

    .brand h1 {
        font-size: 30px;
    }

    .brand p {
        font-size: 17px;
    }
}


/* ===== ADMINISTRADOR ===== */
.admin-page {
    min-height: 100vh;
    background: linear-gradient(135deg, #eef5fb, #f8fbfe);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
}

.login-box {
    width: 100%;
    max-width: 430px;
    background: white;
    border: 1px solid #dce8f2;
    border-radius: 22px;
    padding: 36px;
    box-shadow: 0 15px 40px rgba(18, 75, 120, .12);
}

.login-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    background: #e8f3fc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.login-box h1 {
    margin: 18px 0 4px;
    color: #07579f;
}

.login-box p {
    margin: 0 0 25px;
    color: #718294;
}

.login-box label,
.access-form label {
    display: block;
    margin: 13px 0 6px;
    color: #17324d;
    font-weight: 600;
    font-size: 14px;
}

.login-box input,
.access-form input,
.access-form select {
    width: 100%;
    border: 1px solid #d4e1eb;
    border-radius: 10px;
    padding: 11px 12px;
    font: inherit;
    outline: none;
    background: #fbfdff;
}

.login-box input:focus,
.access-form input:focus,
.access-form select:focus {
    border-color: #1980cf;
    box-shadow: 0 0 0 3px rgba(25,128,207,.10);
}

.login-box button,
.form-actions button {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 20px;
    background: #0868b5;
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.login-box button:hover,
.form-actions button:hover {
    background: #07579f;
}

.back-link {
    display: block;
    margin-top: 20px;
    color: #0868b5;
    text-decoration: none;
    text-align: center;
}

.error-box {
    padding: 10px 12px;
    border-radius: 9px;
    background: #fff0f0;
    color: #a43a3a;
    margin-bottom: 14px;
}

.admin-header {
    background: linear-gradient(135deg, #07579f, #1680d1);
    color: white;
    padding: 28px 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.admin-header h1 {
    margin: 0;
}

.admin-header p {
    margin: 7px 0 0;
    opacity: .9;
}

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-actions a {
    color: white;
    text-decoration: none;
    padding: 9px 13px;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 9px;
}

.admin-container {
    width: 100%;
    padding: 25px 4%;
    background: #f3f6fa;
    min-height: calc(100vh - 130px);
}

.admin-form-card,
.admin-list-card {
    background: white;
    border: 1px solid #dfe8f0;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 7px 24px rgba(22,61,100,.06);
}

.admin-form-card h2,
.admin-list-card h2 {
    color: #07579f;
    margin: 0 0 17px;
}

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

.form-grid .full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.form-actions button {
    width: auto;
    margin-top: 18px;
}

.form-actions a {
    margin-top: 18px;
    padding: 12px 18px;
    border-radius: 10px;
    background: #eef3f7;
    color: #31536d;
    text-decoration: none;
}

.admin-row {
    display: grid;
    grid-template-columns: 55px 1fr auto;
    align-items: center;
    gap: 15px;
    padding: 13px 0;
    border-top: 1px solid #e8eef3;
}

.admin-row-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f7fd;
    border-radius: 12px;
    font-size: 24px;
}

.admin-row-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.admin-row-info strong {
    color: #17324d;
}

.admin-row-info span {
    color: #708294;
    font-size: 13px;
}

.admin-row-info small {
    color: #9aa7b1;
    font-size: 11px;
    word-break: break-all;
}

.admin-row-actions {
    display: flex;
    gap: 7px;
    align-items: center;
}

.admin-row-actions a,
.admin-row-actions button {
    border: 1px solid #d7e3ec;
    background: white;
    color: #0868b5;
    border-radius: 8px;
    padding: 7px 10px;
    text-decoration: none;
    cursor: pointer;
}

.admin-row-actions button {
    color: #b04444;
}

@media (max-width: 700px) {
    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .form-grid .full {
        grid-column: auto;
    }

    .admin-row {
        grid-template-columns: 45px 1fr;
    }

    .admin-row-actions {
        grid-column: 2;
    }
}


/* ===== V10: VALIDADORES COMPACTOS ===== */
.validator-card {
    min-height: 82px;
    padding: 12px 14px;
    gap: 11px;
}

.validator-card .card-icon {
    min-width: 44px;
    width: 44px;
    height: 44px;
    font-size: 21px;
}

.validator-card h3 {
    font-size: 14px;
    margin-bottom: 2px;
}

.validator-card p {
    font-size: 11px;
}

.validator-card .arrow {
    right: 10px;
    top: 9px;
    font-size: 15px;
}

.validator-card:hover {
    transform: translateY(-2px);
}

/* Más presencia para los accesos principales */
.app-card,
.coordination-card {
    min-height: 96px;
}

/* Separación visual más limpia entre secciones */
section + section {
    border-top: 1px solid #e4edf5;
}

/* V11 - DISEÑO CENTRADO ELEGANTE */
body { background: #f3f6fa; }
.hero { min-height: 165px; }
.hero-overlay {
    width: min(1380px, calc(100% - 48px));
    max-width: 1380px;
    margin: 0 auto;
    min-height: 165px;
    padding: 34px 8px 30px;
}
.brand h1 {
    font-size: clamp(30px, 3.2vw, 44px);
    letter-spacing: .2px;
}
.brand p { font-size: 17px; margin-top: 8px; }
.container {
    width: min(1380px, calc(100% - 48px));
    max-width: 1380px;
    margin: -22px auto 38px;
    padding: 0;
}
section {
    border-radius: 18px;
    padding: 22px 24px;
    margin-bottom: 18px;
    box-shadow: 0 7px 25px rgba(22, 61, 100, .07);
}
.section-title { margin-bottom: 17px; }
.section-title > span { width: 44px; height: 44px; }
.section-title h2 { font-size: 20px; letter-spacing: -.15px; }
.section-title p { font-size: 12.5px; }
section:nth-of-type(1) .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
section:nth-of-type(2) .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
section:nth-of-type(3) .cards { grid-template-columns: repeat(7, minmax(0, 1fr)); }
section:nth-of-type(4) .cards { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.card { min-width: 0; padding: 15px; border-radius: 14px; }
.app-card, .coordination-card { min-height: 94px; }
.card-icon { min-width: 50px; width: 50px; height: 50px; font-size: 25px; }
.card h3 { font-size: 15px; }
.card p { font-size: 11.5px; }
.validator-card { min-height: 76px; padding: 10px 11px; gap: 9px; }
.validator-card .card-icon { min-width: 40px; width: 40px; height: 40px; font-size: 19px; }
.validator-card h3 { font-size: 13px; }
.validator-card p { font-size: 10px; }
.validator-card .arrow { right: 8px; top: 7px; font-size: 14px; }
@media (max-width: 1200px) {
    .container, .hero-overlay { width: min(1120px, calc(100% - 34px)); }
    section:nth-of-type(3) .cards, section:nth-of-type(4) .cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 900px) {
    section:nth-of-type(1) .cards, section:nth-of-type(2) .cards,
    section:nth-of-type(3) .cards, section:nth-of-type(4) .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 600px) {
    .container, .hero-overlay { width: calc(100% - 22px); }
    .hero-overlay { padding: 30px 0; }
    .brand h1 { font-size: 28px; }
    section { padding: 18px 15px; }
    section:nth-of-type(1) .cards, section:nth-of-type(2) .cards,
    section:nth-of-type(3) .cards, section:nth-of-type(4) .cards {
        grid-template-columns: 1fr;
    }
}

/* =========================================================
   V12 - DISTRIBUCIÓN EQUILIBRADA
   ========================================================= */

/* Operativos: 4 por fila para conservar legibilidad */
section:nth-of-type(3) .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Validadores: 6 por fila para dar más espacio a los nombres */
section:nth-of-type(4) .cards {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

section:nth-of-type(3) .card {
    min-height: 96px;
}

section:nth-of-type(4) .card {
    min-height: 82px;
}

section:nth-of-type(4) .card h3 {
    font-size: 13.5px;
}

section:nth-of-type(4) .card p {
    font-size: 10.5px;
}

/* Mantener el aspecto centrado en pantallas grandes */
@media (min-width: 1201px) {
    .container {
        width: min(1380px, calc(100% - 48px));
    }
}

/* Pantallas medianas */
@media (max-width: 1200px) {
    section:nth-of-type(3) .cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    section:nth-of-type(4) .cards {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Tablet */
@media (max-width: 900px) {
    section:nth-of-type(3) .cards,
    section:nth-of-type(4) .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Celular */
@media (max-width: 600px) {
    section:nth-of-type(3) .cards,
    section:nth-of-type(4) .cards {
        grid-template-columns: 1fr;
    }
}
