:root {
    --accent: #007bff;
    --accent-two: #0056b3;
    --error: #A52019;
    --border: #f0f0f0;
    --muted: #666;
    --background: #f2f2f2;
    --background-two: #004d99;

}

/* INDEX */
.body {
    font-family: Inter, system-ui, Arial;
    margin: 0;
    display: flex;
    height: 100vh
}

.sidebar {
    width: 480px;
    min-width: 300px;
    max-width: 420px;
    border-right: 1px solid var(--border);
    padding: 18px;
    box-sizing: border-box;
    overflow: auto
}

.map {
    flex: 1
}

h1 {
    margin: 0 0 10px;
    font-size: 18px
}

.search {
    display: flex;
    gap: 8px;
    margin-bottom: 12px
}

input,
select {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    flex: 1
}

.school-list {
    margin-top: 8px
}

.school {
    position: relative;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    margin-bottom: 8px;
}


.meta {
    font-size: 13px;
    color: var(--muted)
}

.actions {
    margin-top: 8px;
    display: flex;
    gap: 8px
}

.small {
    font-size: 13px;
    padding: 6px 8px
}

.badge {
    background: var(--background);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px
}

@media(max-width:800px) {
    .sidebar {
        width: 100%;
        height: 45vh;
        max-width: none
    }

    body {
        flex-direction: column
    }

    .map {
        height: 55vh
    }
}

/* LOGIN */
.bodyNav {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

nav {
    margin: 0;
    background-color: var(--background-two);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: bold;
    margin-left: 10px;
}

nav img {
    height: 100px;
    cursor: pointer;
}

.logo {
    height: 80px;
}

.bodyLogin {
    max-width: 400px;
    margin: 40px auto;
    background: white;
    padding: 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

h2 {
    text-align: center;
    margin-bottom: 20px;
}

#errorMsg {
    color: red;
    height: 20px;
    margin-bottom: 10px;
    text-align: center;
}

.nivel {
    width: 100%;
    padding: 10px;
    margin: 8px 0;
    box-sizing: border-box;
    border-radius: 3px;
    border: 1px solid #ccc;
    font-size: 16px;
}

.btn-login {
    width: 100%;
    padding: 8px 12px;
    background-color: #004d99;
    border: none;
    color: white;
    font-size: 18px;
    border-radius: 3px;
    cursor: pointer;
}

button:hover {
    background-color: #003366;
}

.error {
    color: var(--error);
    margin-bottom: 15px;
    font-weight: bold;
}

footer {
    background-color: #222;
    color: #eee;
    text-align: center;
    padding: 15px 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
    font-size: 14px;
    margin-top: 14px;
    position: relative;
}

footer a {
    color: #66b2ff;
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-contenido {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    position: relative;
}

.cerrar {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 1.2em;
    cursor: pointer;
}

/* PERFIL */
.colegio {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    justify-content: center;
    height: 300px;
    margin-right: auto;
    margin-left: auto;
}

.colegio input,
.colegio select,
.colegio button {
    padding: 8px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

#estadisticasColegios {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    margin: 10px auto;
    max-width: auto;
    overflow-x: auto;
    min-width: auto;
    margin-top: 27px;
}

.card-nivel {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background: #f9f9f9;
    box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
    flex: 0 0 auto;
    min-width: auto;
    margin-top: 10px;
}

.card-nivel:hover {
    transform: translateY(-5px);
}

.card-nivel h3 {
    margin: 0;
    font-size: 1rem;
}

.card-nivel p {
    font-size: 0.9rem;
    margin: 0;
}

#popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #323232;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10000;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    max-width: 90%;
    text-align: center;
}

#popup.show {
    opacity: 1;
    pointer-events: auto;
}

.estadisticas-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    max-width: 900px;
    margin: 0 auto 40px;
}

.card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
    text-align: center;
    transition: transform 0.2s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25);
}

.card .titulo {
    font-size: 1.2rem;
    color: #000000;
    margin-bottom: 10px;
    font-weight: 600;
}

.card .valor {
    font-size: 2.5rem;
    color: #0056b3;
    font-weight: bold;
}

#localidades-container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

#localidades-container h2 {
    text-align: center;
    margin-bottom: 20px;
    color: #333;
}

#localidades-lista {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
    border-top: 1px solid #ddd;
}

#localidades-lista li {
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
    font-size: 1rem;
    color: #444;
    display: flex;
    justify-content: space-between;
}

#localidades-lista li:nth-child(odd) {
    background: #f9f9f9;
}

.modal.active {
    display: flex;
}

.cerrar:hover {
    color: #007bff;
}

.modal-contenido input {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 6px;
    border: 1px solid #ccc;
    font-size: 16px;
    box-sizing: border-box;
}

.modal-contenido button[type="submit"] {
    width: 100%;
    padding: 12px;
    background-color: #004d99;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.modal-contenido button[type="submit"]:hover {
    background-color: #003366;
}

#btnOpenPass,
#btnOpenLocation,
#btnOpenProfile {
    margin: 10px 5px;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    width: auto;
}

#perfilDatos p {
    margin: 6px 0;
}

.btn-descripcion {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-62%);
    background-color: #004d99;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-weight: bold;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-descripcion:hover {
    background-color: #003366;
}

.descripcion {
    display: none;
    margin-top: 10px;
    padding-top: 8px;
    color: #555;
    border-top: 3px solid #ccc;
    line-height: 1.4;
    width: 80%;
    font-size: 13px;
    color: var(--muted)
}

/* ---------- TICKETS ---------- */
#ticketsContainer {
    max-width: 900px;
    margin: auto;
    background: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#ticketsContainer p {
    text-align: center;
    color: #000000;
}

.ticket {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    border-left: 6px solid #1abc9c;
}

.btn-tratar {
    width: 40%;
    padding: 8px 12px;
    background-color: #004d99;
    border: none;
    color: white;
    font-size: 18px;
    border-radius: 3px;
    cursor: pointer;
    display: block;
    margin: 10px auto;
    text-transform: uppercase;
}

.btn-popup {
    width: auto;
    padding: 5px;
    background-color: #004d99;
    border: none;
    color: white;
    font-size: 18px;
    border-radius: 3px;
    cursor: pointer;
}

.datos-colegio {
    display: none;
    padding: 8px;
    border-radius: 6px;
    flex: 1;
}

.detalle-textarea {
    width: 95%;
    height: 100px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
}

.selectPopup {
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 6px;
    flex: 1;
    margin-bottom: 10px;
}

.footer {
    background-color: #222;
    color: #eee;
    text-align: center;
    padding: 15px 10px;
    position: fixed;
    bottom: 0;
    width: 100%;
    font-size: 14px;
    margin-top: 14px;
    position: fixed;
}

.btn-description {
    width: 100%;
    margin-bottom: 5px;
    padding: 8px 12px;
    background-color: #004d99;
    border: none;
    color: white;
    font-size: 18px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-table {
    width: 100%;
    margin-bottom: 5px;
    padding: 8px 12px;
    background-color: #004d99;
    border: none;
    color: white;
    font-size: 14px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-table-description {
    width: 100%;
    margin-bottom: 5px;
    padding: 8px 12px;
    background-color: #004d99;
    border: none;
    color: white;
    font-size: 14px;
    border-radius: 3px;
    cursor: pointer;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    margin-bottom: 51px;
}

th,
td {
    padding: 8px;
    text-align: left;
    font-size: 14px;
    word-wrap: break-word;
}

thead {
    background-color: #004d99;
    color: aliceblue;
}

input {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 4px;
    border: none;
}

select {
    width: 100%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 4px;
    border: none;
    background-color: #007bff20;
}

button {
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
}

@media screen and (max-width: 768px) {
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    th,
    td {
        min-width: 120px;
    }
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 300px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin-top: 0;
}

.modal-content input {
    width: 100%;
    margin-bottom: 10px;
    padding: 5px;
    font-size: 14px;
}

.modal-content button {
    margin-right: 5px;
}

.filtroNivel {
    margin: 0 15px;
}

.selectFiltro {
    width: 20%;
    box-sizing: border-box;
    font-size: 13px;
    padding: 4px;
    background-color: #007bff20;
}

.cursor {
    cursor: pointer;
}