@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
/* ============================================================
   DojoMap - Hoja de estilos base (compartida por todos los módulos)
   Colores claros, un solo color de acento, diseño responsive.
   ============================================================ */

:root {
    --acento: #d64545;
    --acento-hover: #bf3636;
    --acento-suave: #fdeeee;
    --texto: #1f2937;
    --texto-suave: #6b7280;
    --fondo: #f6f7fb;
    --superficie: #ffffff;
    --borde: #e5e7eb;
    --exito: #1e7e34;
    --exito-fondo: #eafaf1;
    --error: #b42318;
    --error-fondo: #fdecea;
    --aviso-fondo: #fff8e1;
    --radio: 16px;
    --radio-chico: 10px;
    --sombra: 0 1px 2px rgba(17, 24, 39, 0.05), 0 10px 30px rgba(17, 24, 39, 0.07);
    --degradado: linear-gradient(135deg, #e55a5a 0%, #c93b3b 100%);
    --fuente: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--fuente);
    font-size: 15px;
    line-height: 1.5;
    color: var(--texto);
    background-color: var(--fondo);
    margin: 0;
}

h1, h2, h3, h4 { line-height: 1.25; color: var(--texto); }

a { color: var(--acento); }
a:hover { color: var(--acento-hover); }

img { max-width: 100%; }

:focus-visible {
    outline: 3px solid rgba(214, 69, 69, 0.45);
    outline-offset: 2px;
}

/* --- Formularios --- */

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="time"], input[type="search"],
input[type="url"], select, textarea {
    font-family: inherit;
    font-size: 15px;
    color: var(--texto);
    background: var(--superficie);
    border: 1px solid #d1d5db;
    border-radius: var(--radio-chico);
    padding: 10px 12px;
    min-height: 44px;
    max-width: 100%;
}

textarea { min-height: 90px; }

input:focus, select:focus, textarea:focus {
    border-color: var(--acento);
    outline: 3px solid rgba(214, 69, 69, 0.2);
    outline-offset: 0;
}

/* --- Botones --- */

button, .btn {
    font-family: inherit;
    font-size: 15px;
    min-height: 44px;
    border-radius: var(--radio-chico);
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 600;
}

.btn-primario { background: var(--acento); color: #fff; }
.btn-primario:hover { background: var(--acento-hover); color: #fff; }
.btn-secundario { background: var(--superficie); color: var(--texto); border-color: #d1d5db; }
.btn-secundario:hover { background: #f3f4f6; color: var(--texto); }
.btn:disabled, button:disabled { opacity: 0.55; cursor: not-allowed; }

/* --- Mensajes --- */

.mensaje-error, .mensaje-exito, .mensaje-aviso {
    padding: 12px 14px;
    border-radius: var(--radio-chico);
    font-size: 14px;
}
.mensaje-error { background: var(--error-fondo); color: var(--error); border: 1px solid #f5c6cb; }
.mensaje-exito { background: var(--exito-fondo); color: var(--exito); border: 1px solid #b7e4c7; }
.mensaje-aviso { background: var(--aviso-fondo); color: #8a6d00; border: 1px solid #ffe0a3; }

/* --- Tarjetas y utilidades --- */

.tarjeta {
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 20px;
}

.tabla-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

table { border-collapse: collapse; }
th { text-align: left; }

.solo-lectores {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

/* ============================================================
   Barra superior (topbar)
   ============================================================ */

.topbar {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    min-height: 60px;
    background: var(--superficie);
    border-bottom: 1px solid var(--borde);
}

.topbar-marca {
    font-weight: 800;
    font-size: 18px;
    color: var(--texto);
    text-decoration: none;
    letter-spacing: 0.2px;
    white-space: nowrap;
}
.topbar-marca span { color: var(--acento); }

.topbar-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    margin-left: 12px;
}

.topbar-links a {
    color: var(--texto-suave);
    text-decoration: none;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: var(--radio-chico);
}
.topbar-links a:hover { background: #f3f4f6; color: var(--texto); }
.topbar-links a.activo { background: var(--acento-suave); color: var(--acento-hover); font-weight: 600; }

.topbar-acciones {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.topbar-salir button {
    background: transparent;
    border: 1px solid #d1d5db;
    color: var(--texto);
    padding: 8px 14px;
    min-height: 40px;
    font-size: 14px;
}
.topbar-salir button:hover { background: #f3f4f6; }

.topbar-menu-btn {
    display: none;
    background: transparent;
    border: 1px solid #d1d5db;
    width: 44px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

@media (max-width: 900px) {
    .topbar { flex-wrap: wrap; padding: 8px 14px; }
    .topbar-menu-btn { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; order: 2; }
    .topbar-acciones { order: 3; margin-left: 0; }
    .topbar-links {
        display: none;
        order: 4;
        width: 100%;
        flex-direction: column;
        margin: 4px 0 8px;
    }
    .topbar.abierto .topbar-links { display: flex; }
    .topbar-links a { padding: 12px; }
    .topbar-salir { display: none; }
    .topbar.abierto .topbar-salir { display: block; order: 5; width: 100%; }
    .topbar.abierto .topbar-salir button { width: 100%; }
}

/* ============================================================
   Notificaciones: campana, panel y ventana de detalle
   ============================================================ */

.notificaciones-widget { position: relative; display: inline-block; }

.btn-notificaciones {
    position: relative;
    background: transparent;
    border: 1px solid #d1d5db;
    width: 44px;
    height: 44px;
    padding: 0;
    color: var(--texto);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-notificaciones:hover { background: #f3f4f6; }
.btn-notificaciones svg { width: 22px; height: 22px; }

.btn-notificaciones .insignia {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    background: var(--acento);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 10px;
    padding: 4px 6px;
    text-align: center;
}

.panel-notificaciones {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    max-width: calc(100vw - 28px);
    max-height: 420px;
    overflow-y: auto;
    background: var(--superficie);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: 0 10px 30px rgba(17, 24, 39, 0.15);
    z-index: 80;
}

@media (max-width: 600px) {
    .panel-notificaciones { position: fixed; top: 68px; left: 14px; right: 14px; width: auto; max-width: none; }
}

.notif-item {
    display: block;
    width: 100%;
    text-align: left;
    background: var(--superficie);
    border: none;
    border-bottom: 1px solid #f0f1f3;
    border-radius: 0;
    padding: 12px 14px;
    min-height: 0;
    cursor: pointer;
    font: inherit;
    color: var(--texto);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f9fafb; }
.notif-no-leida { background: var(--acento-suave); }
.notif-no-leida:hover { background: #fbe4e4; }

.notif-mensaje { font-size: 14px; margin: 0 0 4px; }
.notif-fecha { font-size: 12px; color: var(--texto-suave); margin: 0; }
.notif-vacio { padding: 20px; font-size: 14px; color: var(--texto-suave); text-align: center; margin: 0; }

/* Ventana de detalle de notificación */

.notif-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.notif-modal[hidden] { display: none; }

.notif-modal-fondo { position: absolute; inset: 0; background: rgba(17, 24, 39, 0.5); }

.notif-modal-caja {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--superficie);
    border-radius: var(--radio);
    box-shadow: 0 20px 50px rgba(17, 24, 39, 0.3);
    padding: 24px;
}

.notif-modal-cerrar {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    background: transparent;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--texto-suave);
}
.notif-modal-cerrar:hover { color: var(--texto); }

.notif-modal-caja h2 { margin: 0 40px 6px 0; font-size: 20px; }
.notif-modal-fecha { margin: 0 0 14px; font-size: 13px; color: var(--texto-suave); }
.notif-modal-mensaje { margin: 0 0 14px; font-size: 16px; }

.notif-detalle {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: var(--fondo);
    border-radius: var(--radio-chico);
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 14px;
    font-size: 14px;
}
.notif-detalle dt { color: var(--texto-suave); }
.notif-detalle dd { margin: 0; font-weight: 600; }

.notif-modal-aviso { margin: 0 0 12px; font-size: 14px; }

.notif-modal-acciones { display: flex; flex-wrap: wrap; gap: 10px; }
.notif-modal-acciones .btn, .notif-modal-acciones button { flex: 1 1 160px; }

/* ============================================================
   Responsive general
   ============================================================ */

@media (max-width: 600px) {
    body { font-size: 15px; }
    .tarjeta { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}

@media (max-width: 700px) {
    table { display: block; max-width: 100%; overflow-x: auto; }
}

/* ============================================================
   Refinamientos visuales
   ============================================================ */

.marca-acceso {
    font-size: 26px;
    font-weight: 800;
    color: var(--texto);
    text-decoration: none;
    letter-spacing: -0.3px;
}
.marca-acceso span { color: var(--acento); }

input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="time"], input[type="search"],
input[type="url"], select, textarea {
    min-height: 48px;
    border: 1.5px solid #e2e5ea;
    border-radius: var(--radio-chico);
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}
input:hover, select:hover, textarea:hover { border-color: #cdd2da; }
input:focus, select:focus, textarea:focus {
    border-color: var(--acento);
    outline: none;
    box-shadow: 0 0 0 4px rgba(214, 69, 69, 0.14);
}

.btn { transition: transform .12s, box-shadow .15s, background-color .15s; }
.btn-primario {
    background: var(--degradado);
    box-shadow: 0 6px 16px rgba(214, 69, 69, 0.28);
}
.btn-primario:hover { background: var(--degradado); filter: brightness(0.96); transform: translateY(-1px); color: #fff; }
.btn-secundario { border-color: #e2e5ea; }

.tarjeta { border-radius: var(--radio); }

.topbar {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #eceef2;
    box-shadow: 0 1px 0 rgba(17, 24, 39, 0.02), 0 6px 20px rgba(17, 24, 39, 0.04);
}
.topbar-links a { border-radius: 999px; padding: 8px 14px; font-weight: 500; }
.topbar-links a.activo { background: var(--acento-suave); color: var(--acento-hover); font-weight: 600; }
.btn-notificaciones, .topbar-salir button { border-color: #e2e5ea; border-radius: 999px; }
.topbar-salir button { padding: 8px 16px; font-weight: 500; }
.btn-notificaciones { width: 42px; height: 42px; min-height: 42px; }

.panel-notificaciones, .notif-modal-caja { border-radius: var(--radio); }

/* ---------- Pantallas de contenido (cliente) ---------- */
.texto-centrado { text-align: center; }
.texto-suave { color: var(--texto-suave); font-size: 14px; }

/* --- Botón "ver contraseña" --- */
.campo-contrasena {
    position: relative;
    display: block;
}
.campo-contrasena input {
    padding-right: 44px;
}
.ver-contrasena {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #6b7280;
    cursor: pointer;
}
.ver-contrasena:hover { color: #111827; background: rgba(0, 0, 0, 0.05); }
.ver-contrasena:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; }
