:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #18313a;
    background: #f3f7f8;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --brand: #23758a;
    --brand-dark: #19586a;
    --border: #d5e1e5;
    --muted: #60767e;
    --surface: #ffffff;
    --shadow: 0 8px 24px rgba(24, 49, 58, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    min-width: 320px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    background: #f3f7f8 !important;
    color: #18313a;
}

header {
    min-height: 0 !important;
    height: auto !important;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1rem !important;
    padding: 1rem 1.25rem !important;
    border-radius: 16px !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow) !important;
}

header img,
header .imagen {
    flex: 0 0 auto;
    width: 76px !important;
    height: 76px !important;
    margin: 0 !important;
    border-radius: 16px !important;
    object-fit: cover;
}

header h1,
header h2,
header h3 {
    margin: 0.25rem 0 !important;
    color: #18313a !important;
    text-shadow: none !important;
}

header .div2 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    margin: 0 !important;
    padding: 1rem !important;
    border-radius: 12px !important;
    background: #e8f3f5 !important;
    box-shadow: none !important;
}

section,
form {
    margin: 0 0 1rem !important;
    padding: 1rem !important;
    border: 1px solid var(--border);
    border-radius: 16px !important;
    background: var(--surface) !important;
    box-shadow: var(--shadow) !important;
}

section.adentro {
    align-items: center;
}

section.adentro form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    width: min(100%, 360px) !important;
    color: #18313a !important;
}

section.adentro form button {
    align-self: center;
}

form .div1 {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

main {
    max-width: 560px;
    margin: 0 auto;
}

main form {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

main form a {
    align-self: center;
    color: var(--brand-dark);
}

label {
    color: #38545e;
}

input,
select,
textarea {
    width: 100%;
    min-height: 42px;
    padding: 0.6rem 0.75rem;
    border: 1px solid #bdcdd2;
    border-radius: 9px;
    background: #fff;
    color: #18313a;
    font: inherit;
}

input[type="checkbox"] {
    width: auto;
    min-height: 0;
    margin: 0 0.5rem 0 0;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
    outline: 3px solid rgba(35, 117, 138, 0.24);
    outline-offset: 2px;
    border-color: var(--brand);
}

button {
    min-height: 40px;
    padding: 0.55rem 0.9rem !important;
    border: 1px solid var(--brand) !important;
    border-radius: 9px !important;
    background: var(--brand) !important;
    color: #fff !important;
    font: inherit !important;
    font-size: 0.9rem !important;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms ease, transform 120ms ease;
}

button:hover:not(:disabled) {
    background: var(--brand-dark) !important;
}

button:active:not(:disabled) {
    transform: translateY(1px);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

table {
    min-width: 480px;
    border-collapse: collapse;
}

section:has(> table) {
    overflow-x: auto;
}

table th,
table td {
    padding: 0.8rem !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border) !important;
    font-size: 0.95rem !important;
}

table th {
    color: var(--muted);
    font-size: 0.8rem !important;
    font-weight: 700;
    text-transform: uppercase;
}

.modal {
    padding: 1rem;
}

.modal-content {
    width: min(100%, 520px) !important;
    max-height: 90vh;
    overflow: auto;
    margin: 5vh auto !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow) !important;
}

#listaResultados {
    padding-left: 0;
    list-style: none;
}

#listaResultados li {
    padding: 0.5rem 0.65rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

#listaResultados li:hover {
    background: #e8f3f5;
}

@media (max-width: 640px) {
    body {
        padding: 0.65rem;
    }

    header {
        flex-wrap: wrap;
        padding: 0.75rem !important;
    }

    header .div2 {
        flex-wrap: wrap;
    }

    section,
    form {
        padding: 0.8rem !important;
    }

    .seccion1 {
        width: 100% !important;
        flex-wrap: wrap;
        justify-content: center;
    }

    .div1 {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .divinter,
    .divinter2 {
        width: 100% !important;
        margin: 0 !important;
    }

    .modal-content {
        margin: 1rem auto !important;
    }
}
