
:root{
    --text: #333333;
    --muted: #6a6a6a;
    --border: #dddddd;
    --border-soft: #ebebeb;
    --bg-soft: #f7f7f7;
    --bg-chip: #f2f2f2;
    --hover: #efefef;
    --accent: #ff385c;
    --celeste: #0092db;
    --celeste-texto: #0174ae;
    --shadow: 0 8px 24px rgba(0,0,0,.12);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --header-height: 65px;
    --sidebar-width: 400px;
}

*{
    box-sizing: border-box;
}

html,
body{
    margin: 0;
    padding: 0;
    height: 100%;
    background: #ffffff;
    color: var(--text);
    font-family: 'Airbnb Cereal', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

a{
    color: inherit;
    text-decoration: none;
}

.app-shell{
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* header */

.topbar{
    height: var(--header-height);
    background: #0092db;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    padding: 0 24px;
}

.brand{
    display: flex;
    align-items: center;
    min-width: max-content;
}

.brand a{
    display: flex;
    align-items: center;
}

.brand img{
    display: block;
    width: 180px;
    height: auto;
}

.topnav{
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 26px;
    overflow: visible;
    flex-wrap: nowrap;
}

.topnav a{
    position: relative;
    color: #fff;
    white-space: nowrap;
    font-weight: 300;
    font-size: 16px;
    line-height: 1;
    padding: 6px 0;
}

.topnav a.is-active,
.topnav .nav-item.is-active > a{
    font-weight: 400;
}

.topnav a.is-active:after,
.topnav .nav-item.is-active > a:after{
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: #fff;
}

.topnav span {
    color: #73c5ee;
}

.topbar-actions{
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: max-content;
}

.menu-button {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,.14);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
    line-height: 1;
    transition: background .15s ease;
}

.menu-button:hover {
    background: rgba(255,255,255,.22);
}

.menu-button i{
    color: #fff;
    font-size: 18px;
    line-height: 1;
}

.menu-button.login i {
    margin-right: 3px;
}


/* layout principal */

.page-layout{
    display: grid;
    flex: 1;
    grid-template-columns: 1fr;
}

.page-main{
    min-width: 0;
    padding: 30px 70px 30px 70px;
}

.cabecera{
    display: flex;
    align-items: center;
}

.cabecera h1{
    margin: 0 0 20px 0;
    font-size: 34px;
    font-weight: 500;
    letter-spacing: -0.03em;
}

.cabecera h1 span{
    font-size: 20px;
    font-weight: 400;
}

.cabecera .btn-agregar {
    margin-left: auto;
    padding: 6px 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* botón cancelar superior */
.cabecera a.cancelar {
    margin-left: auto;
    margin-bottom: 10px;
}

.cabecera a.cancelar .icon-cancel:before {
    padding: 7px 8px 8px 8px;
    background: transparent;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    color: #666;
}

.cabecera a.cancelar .icon-cancel:hover:before {
    color: #000;
    background: rgba(0,0,0,.1);
}

/* tabla listados */

.listado-table{
    border: 1px solid var(--border);
    border-radius: 14px;
}

.listado-row{
    display: grid;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 400;
}

.listado-row:last-child {
    border-bottom: none;
}

.listado-row.inactivo,
.sortable-subrow.inactivo {
    background-color: #fee;
}

.listado-row.inactivo div,
.sortable-subrow.inactivo span {
    color: #a00;
}

.listado-header{
    background: var(--bg-soft);
    font-size: 16px;
    font-weight: 400;
    color: var(--muted);
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
}

.listado-header > div:first-child{
    text-align: center;
}

.listado-header span.sortable{
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* columnas */
.listado-row > div{
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
    margin-right: 5px;
}

.sortable-subrow > div:first-child,
.listado-row:not(.listado-header) > div:first-child{
    text-align: right;
    padding-right: 10px;
    color: #aaa;
    font-size: 12px;
}

.sortable{
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-indicator:before{
    font-size: 16px;
    color: #888;
}

.sortable.asc .sort-indicator:before,
.sortable.desc .sort-indicator:before{
    color: #0092db;
}

/* íconos genéricos listado */

.listado-table .icon-filter,
.listado-table .icon-reception-bell,
.listado-table .icon-plus,
.listado-table .icon-user,
.listado-table .icon-location,
.listado-table .icon-picture,
.listado-table .icon-pencil,
.listado-table .icon-trash {
    color: #0092db;
}

.listado-table .icon-filter:hover:before,
.listado-table .icon-reception-bell:hover:before,
.listado-table .icon-plus:hover:before,
.listado-table .icon-user:hover:before,
.listado-table .icon-location:hover:before,
.listado-table .icon-picture:hover:before,
.listado-table .icon-pencil:hover:before,
.listado-table .icon-trash:hover:before {
    color: #0070a8;
}

.listado-table .icon-filter.desactivado,
.listado-table .icon-reception-bell.desactivado,
.listado-table .icon-plus.desactivado,
.listado-table .icon-user.desactivado,
.listado-table .icon-location.desactivado,
.listado-table .icon-picture.desactivado,
.listado-table .icon-pencil.desactivado,
.listado-table .icon-trash.desactivado {
    color: #ccc;
}

.listado-table .icon-filter.desactivado:hover:before,
.listado-table .icon-reception-bell.desactivado:hover:before,
.listado-table .icon-plus.desactivado:hover:before,
.listado-table .icon-user.desactivado:hover:before,
.listado-table .icon-location.desactivado:hover:before,
.listado-table .icon-picture.desactivado:hover:before,
.listado-table .icon-pencil.desactivado:hover:before,
.listado-table .icon-trash.desactivado:hover:before {
    color: #ccc;
}

.icon-reception-bell {
    margin-right: 7px;
}
.icon-reception-bell:before {
    font-size: 16px;
}


/* acciones */
.col-acciones{
    text-align: right;
    cursor: pointer;
}

.listado-footer{
    margin-top: 25px;
    display: flex;
    gap: 8px;
}

/* modales */

.modal-loading{
    text-align: center;
    margin-top: 17px;
}

.spinner{
    width: 40px;
    height: 40px;
    border: 3px solid #ddd;
    border-top-color: #0092db;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin{
    to { transform: rotate(360deg); }
}

.modal{
    position: fixed;
    inset: 0;
    overflow-y: auto;
    background: rgba(0,0,0,.5);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
    z-index: 60;
}


.modal.is-open{
    opacity: 1;
    visibility: visible;
}

.modal-dialog{
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #fff;
    box-shadow: var(--shadow);
    transform: translateY(20px) scale(.96);
    opacity: 0;
    transition: all .25s ease;
    margin: auto 0;
    max-height: none;
    overflow: visible;
    border-radius: 18px;
}

.modal.is-open .modal-dialog{
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-close{
    width: 35px;
    height: 35px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer; 
    background: transparent;
}

.modal-header .icon-cancel:before {
    color: #444;
    font-size: 22px;
}

.modal-header .icon-cancel:hover:before {
    color: #000;
}

.modal-close:hover{
    background: rgba(0,0,0,.1);
    border-radius: 50%;
}

.modal-header{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 25px;
    background-color: #f5f5f5;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
    border-bottom: 1px solid #ddd;
}

.modal-title{
    margin: 0;
    font-size: 28px;
    font-weight: 500;
    color: var(--text);
}

.modal-body{
    padding: 25px 25px 5px 25px;
}

/* errores en la carga del modal */
.modal-body.error{
    padding-bottom: 25px;
    color: #e00;
}

.modal-body.error .icon-attention{
    color: #f00;
}

.modal-footer{
    padding: 20px 25px;
    border-top: 1px solid #ddd;
    background-color: #f5f5f5;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;    
    display: flex;
    justify-content: flex-end;
}

.modal-footer.login {
    display: block;
    font-size: 12px;
    text-align: center;
}

.modal-footer.login a {
    color: #007cbb;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-check-row{
    margin-bottom: 20px;
}

.modal-links{
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-links a{
    font-size: 14px;
    color: #0092db;
}

.modal-links a:hover{
    text-decoration: underline;
}

#modalBorrarTexto {
    margin: 5px 0 25px 0;
    line-height: 25px;
}


/* login */

.modal-dialog.login{
    max-width: 400px;
}

.modal-submit{
    width: 100%;
}

.mobile-nav-toggle{
    display: none;
}

.login-social-separador{
    position:relative;
    margin:25px 0 20px;
    text-align:center;
}

.login-social-separador::before{
    content:"";
    position:absolute;
    left:0;
    right:0;
    top:50%;
    border-top:1px solid #e3e3e3;
}

.login-social-separador span{
    position:relative;
    background:#fff;
    padding:0 14px;
    color:#888;
    font-size:14px;
}

.login-social{
    display:flex;
    gap:12px;
    margin-bottom:20px;
}

.login-social-btn{
    flex:1;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:15px;
    border:1px solid #ddd;
    border-radius:10px;
    background:#fff;
    transition:.15s;
}

.login-social-btn:hover{
    border-color:#0092db;
    background:#f7fbff;
}

.login-social-btn svg{
    width:24px;
    height:24px;
}


/* dropdown */

.nav-item{
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-bottom: 12px;
    margin-bottom: -12px;
}

.nav-item > a {
    color: #fff;
    font-weight: 300;
    font-size: 16px;
    padding: 6px 0;
}

.dropdown{
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 20;
}

.nav-item:hover .dropdown{
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown a{
    display: block;
    padding: 10px 15px 10px 30px;
    font-size: 15px;
    color: #333;
    white-space: nowrap;
}

.dropdown a:hover{
    background: #f5f5f5;
}

/* círculo base */
.dropdown a::before{
    content: "";
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border: 1px solid #888;
    border-radius: 50%;
}

.dropdown a.active::before{
    border-color: #0092db;;
    background: #0092db;;
}

.nav-item.config .dropdown{
    left: auto;
    right: 0;
}

/* paneles deslizables */

.drawer-overlay{
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 40;
}

.drawer-overlay.is-active{
    opacity: 1;
    pointer-events: auto;
}

.drawer{
    position: fixed;
    top: 0;
    bottom: 0;
    width: 290px;
    background: #fff;
    z-index: 50;
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
}

.drawer-header{
    display: flex;
    justify-content: flex-end;
    padding: 16px 16px 0 16px;
}

.drawer-close{
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background .15s ease;
}

.drawer-close:hover{
    background: rgba(0,0,0,.06);
}

.drawer-close i{
    font-size: 18px;
}

.drawer-left{
    left: 0;
    transform: translateX(-100%);
}

.drawer-left.is-open{
    transform: translateX(0);
}

.drawer-item{
    border-bottom: 1px solid var(--border);
}

.drawer-toggle{
    all: unset;
    width: 100%;
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 300;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-toggle.is-active{
    font-weight: 500;
}

.drawer-toggle i{
    transition: transform .2s ease;
}

.drawer-item.is-open .drawer-toggle i{
    transform: rotate(180deg);
}

.drawer-submenu{
    display: none;
    padding-left: 10px;
}

.drawer-item.is-open .drawer-submenu{
    display: block;
}

.drawer-submenu a{
    position: relative;
    padding: 10px 0 10px 15px;
    display: block;
    font-size: 15px;
    color: #555;
}

/* círculo base */
.drawer-submenu a::before{
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 5px;
    border: 1px solid #888;
    border-radius: 50%;
}

/* estado activo */
.drawer-submenu a.active{
    font-weight: 500;
}

.drawer-submenu a.active::before{
    border-color: #0092db;
    background: #0092db;
}

.drawer-right{
    right: 0;
    transform: translateX(100%);
}

.drawer-right.is-open{
    transform: translateX(0);
}

.drawer-content{
    padding: 28px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    font-weight: 100;
}

.drawer-content h3{
    margin: 0 0 18px 0;
    font-size: 20px;
    font-weight: 500;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.drawer-content > a{
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid #ddd;
    font-size: 16px;
}

.drawer-content a:last-child{
    border-bottom: none;
}

.icon-logout{
    margin-left: 3px;
}

.icon-logout:before{
    font-size: 16px;
    color: #555;
}


/* toast */
.toast {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 99999;
    transform: translate(-50%, -20px);
    min-width: 260px;
    max-width: 90vw;
    padding: 15px 30px 20px 30px;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    background-color: #effaff;
    color: #007cba;
    border: 5px solid #0092db;
    border-top: 0;
    font-size: 18px;
    line-height: 1.35;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.toast.ok {
    background-color: #e3fddf;
    border-color: #027000;
    color: #026400;
}

.toast.error {
    background-color: #ffd2d2;
    border-color: #bf0000;
    color: #bf0000;
}

/* botoncitos redondos */

.chip{
    border: none;
    background: var(--bg-chip);
    color: var(--text);
    border-radius: 999px;
    width: 46px;
    height: 46px;
    padding: 0;
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    white-space: nowrap;
}

.chip:hover{
    background: #ececec;
}

/* tooltips */

.tooltip {
    position: relative;
}

/* base común */
.tooltip::after,
.tooltip::before{
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    pointer-events: none;
    transition: .2s ease;
}

/* tooltip simple (usa atributo data-tooltip) */
.tooltip::after {
    content: attr(data-tooltip);
    bottom: calc(90% + 12px);
    background: #f8fbfd;;
    color: #666;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -0.03em;
    white-space: pre-line;
    width: max-content;
    max-width: 250px;
    text-align: left;
    box-shadow: 0 8px 20px rgba(0,0,0,0.5);
    z-index:1002;
}

/* tooltip html */
.tooltip-html{
    display: none;
    position: absolute;
    left: 50%;
    bottom: calc(90% + 12px);
    transform: translateX(-50%);
    background: #f8fbfd;
    color: #444;
    padding: 20px;
    border: 1px solid #ccc;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: -.03em;
    width: max-content;
    max-width: 250px;
    text-align: left;
    box-shadow: 0 8px 20px rgba(0,0,0,.5);
    z-index: 1002;
}

.tooltip-html strong{
    color: #555;
    font-weight: 500;
}

/* si existe tooltip html, oculta el clásico */
.tooltip.has-html::after{
    display: none;
}

/* cuadrado rotado 45 grados para armar el piquito */
.tooltip::before{
    content:"";
    position: absolute;
    left:50%;
    bottom:calc(90% + 6px);
    width:12px;
    height:12px;
    background:#f8fbfd;
    border-left:1px solid #ccc;
    border-bottom:1px solid #ccc;
    transform: translateX(-50%) rotate(-45deg);
    opacity: 0;
    transition: .2s;
    z-index:1003;

}

/* hover */
.tooltip:hover::before{
    opacity:1;
    transform: translateX(-50%) translateY(-5px) rotate(-45deg);
}

.tooltip:hover::after{
    opacity:1;
    transform: translateX(-50%) translateY(-5px);
}

.tooltip:hover > .tooltip-html{
    display: block;
    transform: translateX(-50%) translateY(-5px);
}

/* paginador */

.paginador {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-top: 20px;
}

.pag-link,
.pag-ellipsis {
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #333;
    background: #f3f3f3;
}

.pag-link:hover {
    background: #e7e7e7;
}

.pag-link.activo {
    background: #0092db;
    color: #fff;
}

/* cursor drag */

.drag-handle,
.drag-handle-sub {
    cursor: grab;
    color: #666;
}

.drag-handle:active,
.drag-handle-sub:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: .45;
}

@media (max-width: 1024px){

    .page-layout{
        grid-template-columns: 1fr;
    }

    .page-main{
        padding: 20px 25px 20px 25px;
    }

    .topbar{
        position: relative;
        display: grid;
        grid-template-columns: 40px 1fr 40px;
        align-items: center;
        gap: 12px;
        padding: 0 16px;
        height: var(--header-height);
    }

    .topnav{
        display: none;
    }

    .brand{
        grid-column: 2;
        grid-row: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
        height: 100%;
    }

    .brand a{
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        line-height: 1;
    }

    .brand img{
        display: block;
        width: 160px;
        max-width: 100%;
        max-height: 32px;
        height: auto;
        margin: 0;
    }

    .topbar-actions{
        grid-column: 1 / 4;
        grid-row: 1;
        display: grid;
        grid-template-columns: 40px 1fr 40px;
        align-items: center;
        height: 100%;
        pointer-events: none;
    }

    .mobile-nav-toggle{
        display: inline-flex;
        grid-column: 1;
        justify-self: start;
        align-self: center;
        pointer-events: auto;
    }

    .menu-button.login,
    .menu-button.user-button{
        grid-column: 3;
        justify-self: end;
        align-self: center;
        pointer-events: auto;
    }
}

@media (max-width: 768px){

    .page-main{
        padding: 15px 15px 15px 15px;
    }

}

/* celular */
@media (max-width: 640px){

    .contenedor {
        padding: 20px;
    }

    .cabecera h1{
        font-size: 26px;
    }

    .cabecera h1 span{
        font-size: 18px;
    }

    .modal-title {
        font-size: 24px;
    }
}
