/* ============================================================
   Newbery — estilos de la aplicación (complementan dashboard.css)
   Colores: siempre con var(--...) definidas en variables.css
   Colors: always via var(--...) defined in variables.css
   ============================================================ */

/* Footer siempre abajo en desktop, sin espacio debajo: la página ocupa
   todo el alto de la ventana y el contenido empuja el footer al final.
   Footer always at the very bottom on desktop. */
@media (min-width: 768px) {
    body.app-layout {
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }

    body.app-layout > .app-body {
        flex: 1 0 auto;
        display: flex;
        flex-direction: column;
    }

    .app-body > .app-row {
        flex: 1 0 auto;
    }

    .main-newb {
        display: flex;
        flex-direction: column;
    }

    .main-newb > .main-content {
        flex: 1 0 auto;
    }

    .main-newb > .footer-sticky {
        flex-shrink: 0;
        margin-top: auto;
    }
}

/* Botón con la identidad de Newbery */
.btn-newb { background-color: var(--color-aznewb); border-color: var(--color-aznewb); color: var(--color-white); }
.btn-newb:hover, .btn-newb:focus { background-color: var(--color-aznewb-dark); border-color: var(--color-aznewb-dark); color: var(--color-white); }

.text-aznewb { color: var(--color-aznewb); }

/* Selector de sitio en la barra superior */
/* Propiedad activa arriba del menú lateral / Active property above the sidebar menu */
.site-card { margin: 0 14px 20px; padding: 10px 12px 12px; background: var(--color-site-card); border-radius: 12px; }
.site-card-label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--color-site-card-label); }
.site-card-select { border: 0; border-radius: 8px; font-weight: 600; color: var(--color-text-strong); cursor: pointer; }
.site-card-select:focus { box-shadow: 0 0 0 3px var(--color-amnewb); }

/* Módulos bloqueados en el menú */
.sidebar .nav-link.locked { opacity: .6; }
.sidebar .nav-link .lock-icon { width: 14px; height: 14px; color: var(--color-icon-strong); }

/* Tarjetas del dashboard */
.kpi-icon, .module-icon { width: 44px; height: 44px; }
.kpi-icon [data-lucide], .module-icon [data-lucide] { width: 22px; height: 22px; }
.kpi-value { font-size: 1.75rem; font-weight: 700; color: var(--color-aznewb); line-height: 1; }
.chart-box { position: relative; height: 260px; }
.category-table .legend-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
/* «Sin identificar»: puntito blanco punteado / Unidentified: dashed white dot */
.category-table .legend-dot.is-unidentified { background: var(--color-white) !important; border: 1px dashed var(--color-unidentified-border); }
.category-table .progress { height: 8px; background: var(--color-track); }

/* Login */
.auth-page .logo { max-height: 45px; }
.auth-card { width: 100%; max-width: 400px; border-top: 4px solid var(--color-amnewb) !important; }

/* Editor de tableros */
.breaker-table .num { width: 70px; }
.breaker-table .new-row { background: var(--color-row-new); }
.photo-thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.photo-thumb img { width: 120px; height: 90px; object-fit: cover; border-radius: 6px; }

/* Modales de fotos de Explore: grandes y con la imagen completa visible.
   Explore photo modals: large, whole image visible. */
/* ==========================================================
   Galería de fotos en modales (opción C: miniaturas abajo)
   Photo gallery in modals (option C: thumbnails below)
   ========================================================== */
#modal-panel .modal-dialog,
#modal-breaker .modal-dialog {
    max-width: min(1200px, 92vw);
}

/* Contenedor de la foto / Photo frame */
.newb-gallery .carousel-caja-imagen {
    max-height: none;
    border-radius: 8px;
    background-color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
}

.newb-gallery .carousel-caja-imagen img {
    width: 100%;
    height: 62vh;
    max-height: 62vh;
    object-fit: contain;
}

/* Flechas redondas sobre la imagen / Round arrows over the image */
.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--color-aznewb-85);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px var(--color-shadow-25);
    transition: background .15s ease, transform .15s ease;
}
.gallery-arrow:hover,
.gallery-arrow:focus-visible {
    background: var(--color-aznewb);
    transform: translateY(-50%) scale(1.06);
    outline: none;
}
.gallery-arrow:focus-visible { box-shadow: 0 0 0 3px var(--color-amnewb); }
.gallery-arrow-prev { left: 12px; }
.gallery-arrow-next { right: 12px; }

/* Barra con descripción y contador / Caption and counter bar */
.gallery-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 2px 8px;
    font-size: .875rem;
    color: var(--color-text-soft);
}
.gallery-caption { flex: 1; min-width: 0; }
.gallery-counter {
    flex-shrink: 0;
    background: var(--color-wiinfo);
    color: var(--color-aznewb);
    font-weight: 600;
    padding: 2px 10px;
    border-radius: 12px;
}

/* Tira de miniaturas / Thumbnail strip */
.gallery-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding: 4px 2px 6px;
    scrollbar-width: thin;
}
.gallery-thumb {
    flex: 0 0 auto;
    width: 84px;
    height: 60px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: var(--color-photo-bg);
    opacity: .6;
    scroll-snap-align: center;
    transition: opacity .15s ease, border-color .15s ease;
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.gallery-thumb:hover { opacity: .9; }
.gallery-thumb.active {
    opacity: 1;
    border-color: var(--color-amnewb);
}
.gallery-thumb:focus-visible { outline: 2px solid var(--color-aznewb); outline-offset: 2px; }

/* Móvil: foto más baja, flechas y miniaturas más pequeñas
   Mobile: shorter photo, smaller arrows and thumbnails */
@media (max-width: 767.98px) {
    .newb-gallery .carousel-caja-imagen img { height: 48vh; max-height: 48vh; }
    .gallery-arrow { width: 36px; height: 36px; }
    .gallery-arrow-prev { left: 6px; }
    .gallery-arrow-next { right: 6px; }
    .gallery-thumb { width: 64px; height: 46px; }
}


/* ==========================================================
   Módulo Reportes / Reports module
   ========================================================== */
.icon-sm { width: 18px; height: 18px; }
.icon-xs { width: 14px; height: 14px; vertical-align: -2px; }

/* Pestañas Documentos / Bitácora */
.report-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--color-border); }
.report-tab {
    display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 4px;
    color: var(--color-text-soft); text-decoration: none; font-weight: 500;
    border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.report-tab.active { color: var(--color-aznewb); border-bottom-color: var(--color-aznewb); font-weight: 600; }
.report-tab.disabled { opacity: .6; cursor: default; }
.report-tab-count {
    font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
    background: var(--color-muted-bg); color: var(--color-text-soft);
}
.report-tab.active .report-tab-count { background: var(--color-wiinfo); color: var(--color-aznewb); }

/* Filtros tipo chip */
.report-chip {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
    border: 1px solid var(--color-border); background: var(--color-white);
    color: var(--color-text-strong); text-decoration: none; font-size: 14px;
}
.report-chip:hover { border-color: var(--color-aznewb); color: var(--color-aznewb); }
.report-chip.active { background: var(--color-text-strong); border-color: var(--color-text-strong); color: var(--color-white); font-weight: 500; }

.report-search-icon {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    width: 18px; height: 18px; color: var(--color-text-soft); pointer-events: none;
}

/* Tabla agrupada por antigüedad */
.report-table-card { border-radius: 14px; overflow: hidden; }
.report-table { font-size: 14px; min-width: 900px; }
.report-table thead th { color: var(--color-text-soft); font-size: 13px; font-weight: 600; padding-top: 14px; padding-bottom: 14px; background: var(--color-white); }
.report-table td { padding-top: 14px; padding-bottom: 14px; border-color: var(--color-border-soft); }
.report-group th {
    background: var(--color-surface-soft) !important; color: var(--color-aznewb);
    font-size: 13px; font-weight: 600; padding-top: 16px; padding-bottom: 8px;
}
.report-group th span { color: var(--color-text-soft); font-weight: 500; }
.report-title-cell { max-width: 380px; }
.report-description { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.report-sort { display: inline-flex; align-items: center; gap: 4px; color: var(--color-text-soft); text-decoration: none; }
.report-sort [data-lucide], .report-sort svg { width: 14px; height: 14px; }
.report-sort.active, .report-sort:hover { color: var(--color-aznewb); }

/* Etiquetas de estado y origen */
.report-pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill-success { background: var(--color-success-bg); color: var(--color-success-text); }
.pill-upload { background: var(--color-warning-bg); color: var(--color-warning-text); }
.pill-info { background: var(--color-wiinfo); color: var(--color-aznewb); }
.pill-muted { background: var(--color-muted-bg); color: var(--color-text-soft); }

.report-empty-icon { width: 40px; height: 40px; color: var(--color-aznewb); }

/* Zona para arrastrar archivos */
.report-dropzone {
    display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
    padding: 32px; border: 2px dashed var(--color-dropzone-border); border-radius: 14px;
    background: var(--color-surface-soft); cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.report-dropzone:hover, .report-dropzone.is-dragover { border-color: var(--color-aznewb); background: var(--color-wiinfo); }
.report-dropzone:focus-within { outline: 3px solid var(--color-amnewb); outline-offset: 2px; }
.report-dropzone-icon { width: 34px; height: 34px; color: var(--color-aznewb); }

/* Lista de archivos */
.report-file-list { display: flex; flex-direction: column; gap: 8px; }
.report-file {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    border: 1px solid var(--color-border-soft); border-radius: 10px; background: var(--color-white);
}
.report-file-compact { padding: 8px 10px; }
.report-file-badge {
    flex: none; width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
    background: var(--color-wiinfo); color: var(--color-aznewb); font-size: 11px; font-weight: 700;
}
.report-file-name { flex: 1; min-width: 0; font-size: 14px; }
.report-file-primary, .report-file-remove { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.report-file-primary:has(input:checked) { color: var(--color-aznewb); font-weight: 600; }
.report-file-delete {
    width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent;
    color: var(--color-text-soft); font-size: 20px; line-height: 1;
}
.report-file-delete:hover { background: var(--color-muted-bg); }

.report-assets { min-height: 150px; }

/* Visor de archivos: PDF y fotos / File viewer: PDF and photos */
.report-preview { border-radius: 14px; overflow: hidden; background: var(--color-photo-bg); }
.report-viewer-bar {
    display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 16px;
    background: var(--color-text-strong); color: var(--color-white); font-size: 14px;
}
.report-viewer-name { flex: 1; min-width: 0; font-weight: 500; }
.report-viewer-tools { display: flex; align-items: center; gap: 4px; }
.report-viewer-tools[hidden] { display: none; }
.report-viewer-btn {
    width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--color-white);
    display: flex; align-items: center; justify-content: center;
}
.report-viewer-btn:hover, .report-viewer-btn:focus-visible { background: var(--color-aznewb); outline: none; }
.report-viewer-btn svg { width: 18px; height: 18px; }
.report-viewer-zoom { min-width: 48px; text-align: center; font-variant-numeric: tabular-nums; }
.report-viewer-counter {
    flex: none; background: var(--color-amnewb); color: var(--color-text-strong);
    font-weight: 600; font-size: 13px; padding: 2px 10px; border-radius: 999px;
}
.report-viewer-counter:empty { display: none; }

.report-viewer-stage { position: relative; height: 75vh; }
.report-viewer-stage iframe { width: 100%; height: 100%; border: 0; display: block; background: var(--color-white); }
.report-viewer-stage iframe[hidden] { display: none; }
.report-viewer-image {
    width: 100%; height: 100%; overflow: auto; display: flex; align-items: center; justify-content: center;
    background: var(--color-photo-bg);
}
.report-viewer-image[hidden] { display: none; }
.report-viewer-image img { max-width: 100%; max-height: 100%; object-fit: contain; cursor: zoom-in; user-select: none; }
.report-viewer-image.is-zoomed { display: block; cursor: grab; }
.report-viewer-image.is-zoomed img { max-width: none; cursor: zoom-out; }

/* Flechas sobre el visor (como la galería de Explore) / Arrows over the viewer */
.report-viewer-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 44px; height: 44px; border: 0; border-radius: 50%;
    background: var(--color-aznewb-85); color: var(--color-white);
    display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px var(--color-shadow-25);
}
.report-viewer-arrow:hover, .report-viewer-arrow:focus-visible { background: var(--color-aznewb); outline: none; box-shadow: 0 0 0 3px var(--color-amnewb); }
.report-viewer-arrow.prev { left: 12px; }
.report-viewer-arrow.next { right: 12px; }

/* Archivo que se está viendo / File being viewed */
.report-file.is-active { border-color: var(--color-aznewb); background: var(--color-wiinfo); }
.report-view-link { font-size: inherit; text-decoration: underline; color: var(--bs-link-color); }

@media (max-width: 767.98px) {
    .report-viewer-stage { height: 60vh; }
    .report-viewer-arrow { width: 36px; height: 36px; }
}

.report-text { white-space: pre-line; }


/* ==========================================================
   Bitácora de novedades / Event log
   ========================================================== */
.pill-danger { background: var(--color-danger-bg); color: var(--color-danger-text); }

.log-group-title {
    font-size: 13px; font-weight: 600; color: var(--color-aznewb);
    text-transform: uppercase; letter-spacing: .05em; margin: 8px 0 10px;
}
.log-group-title span { color: var(--color-text-soft); font-weight: 500; }

.log-card {
    display: flex; gap: 16px; align-items: flex-start; padding: 18px 20px;
    background: var(--color-white); border-radius: 14px; box-shadow: 0 1px 3px var(--color-shadow);
}
.log-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.log-type { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--color-aznewb); }
.log-where { font-size: 14px; font-weight: 500; color: var(--color-text-strong); }
.log-title { font-size: 15px; font-weight: 600; color: var(--color-text-strong); text-decoration: none; }
.log-title:hover { color: var(--color-aznewb); text-decoration: underline; }
.log-facts { display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 14px; line-height: 1.5; }

/* Ícono por tipo de novedad / Icon per event type */
.log-icon {
    flex: none; width: 42px; height: 42px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; color: var(--color-text-strong);
}
.log-icon svg { width: 20px; height: 20px; }
.log-icon-lg { width: 52px; height: 52px; }
.log-icon-maintenance { background: var(--color-event-maintenance); }
.log-icon-failure { background: var(--color-event-failure); }
.log-icon-outage { background: var(--color-event-outage); }
.log-icon-installation_change { background: var(--color-event-installation_change); }
.log-icon-finding { background: var(--color-event-finding); }
.log-icon-other { background: var(--color-event-other); }
.log-icon-new_panel { background: var(--color-event-new_panel); }

/* «Tablero nuevo»: tablero dibujado para llenar sus breakers
   "New panel": drawn panel to fill in its breakers */
.np-panel { border: 3px solid var(--color-np-frame); border-radius: 12px; padding: 12px 10px; background: var(--color-white); }
.np-cols { display: grid; grid-template-columns: 1fr 1fr; }
.np-side { display: flex; flex-direction: column; gap: 6px; padding: 0 10px; min-width: 0; }
.np-left { border-right: 2px solid var(--color-np-frame); }
.np-side-title { font-size: 11px; font-weight: 700; color: var(--color-aznewb); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.np-breaker { display: grid; align-items: center; gap: 6px; border: 1px solid var(--color-border-soft); border-radius: 8px; background: var(--color-np-slot); padding: 5px 6px; min-height: 42px; }
.np-left .np-breaker { grid-template-columns: 1fr 64px 92px 30px; }
.np-left .np-breaker .np-number { order: 4; }
.np-right .np-breaker { grid-template-columns: 30px 92px 64px 1fr; }
.np-right .np-breaker [data-np-field="poles"] { order: 1; }
.np-right .np-breaker [data-np-field="rating"] { order: 2; }
.np-right .np-breaker [data-np-field="name"] { order: 3; }
.np-breaker.np-poles-2 { min-height: 90px; }
.np-breaker.np-poles-3 { min-height: 138px; }
.np-breaker.is-filled { background: var(--color-np-filled); border-color: var(--color-np-filled-border); }
.np-number { font-weight: 700; font-size: 12px; text-align: center; line-height: 1.2; }
.np-row { border-bottom: 1px dashed var(--color-border-soft); padding: 6px 0; }
.np-row:last-child { border-bottom: 0; }
.np-row-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.np-row-type { width: auto; }
.np-row-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.np-breaker.np-industrial { grid-template-columns: 30px 1fr 70px; }
@media (max-width: 767.98px) {
  .np-cols, .np-row-sides { grid-template-columns: 1fr; }
  .np-left { border-right: 0; border-bottom: 2px solid var(--color-np-frame); padding-bottom: 10px; margin-bottom: 10px; }
}

.log-damage-filter { padding-bottom: 8px; }

/* Formulario: tarjetas de tipo / Form: type cards */
.log-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 991.98px) { .log-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) { .log-type-grid { grid-template-columns: minmax(0, 1fr); } }
.log-type-card {
    display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; min-height: 84px; cursor: pointer;
    background: var(--color-white); border: 1px solid var(--color-border); border-radius: 12px;
    transition: border-color .15s ease, background .15s ease;
}
.log-type-card:hover { border-color: var(--color-aznewb); }
.log-type-card.is-selected { border: 2px solid var(--color-aznewb); background: var(--color-wiinfo); }
.log-type-card:focus-within { outline: 3px solid var(--color-amnewb); outline-offset: 2px; }

/* Opciones tipo botón / Button-like options */
.log-option {
    border: 1px solid var(--color-border); background: var(--color-white); color: var(--color-text-strong);
    border-radius: 10px; min-height: 40px; display: inline-flex; align-items: center;
}
.btn-check:checked + .log-option { background: var(--color-aznewb); border-color: var(--color-aznewb); color: var(--color-white); }
.btn-check:focus-visible + .log-option { outline: 3px solid var(--color-amnewb); outline-offset: 2px; }

/* Recuadro de daños (amarillo suave) / Damage box (soft yellow) */
.log-damage-box {
    padding: 20px; border-radius: 12px;
    background: var(--color-amnewb-soft); border: 1px solid var(--color-amnewb);
}
.log-approval-note {
    display: flex; gap: 12px; align-items: flex-start; padding: 16px 20px; border-radius: 12px;
    background: var(--color-wiinfo); border: 1px solid var(--color-aznewb); color: var(--color-text-strong); font-size: 14px;
}
.log-approval-note svg { flex: none; width: 20px; height: 20px; color: var(--color-aznewb); }

/* Ficha de datos / Data list */
.log-data { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 8px 12px; font-size: 14px; }
.log-data dt { color: var(--color-text-soft); font-weight: 500; }
.log-data dd { margin: 0; }

[data-types][hidden], [data-type-dependent][hidden], [data-damage-box][hidden] { display: none !important; }


/* ==========================================================
   Selector de posición y cambios en Explore / Position picker and Explore changes
   ========================================================== */
.panel-picker { border: 1px solid var(--color-border-soft); border-radius: 12px; padding: 14px; background: var(--color-white); }
.panel-picker[hidden] { display: none; }
.panel-picker-search { max-width: 220px; }
.panel-picker-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.panel-picker-grid.is-industrial { grid-template-columns: minmax(0, 1fr); }
.panel-picker-group { display: flex; flex-direction: column; gap: 6px; }
.panel-picker-group-title { font-size: 12px; font-weight: 600; color: var(--color-aznewb); text-transform: uppercase; letter-spacing: .04em; }
.panel-picker-items { display: flex; flex-direction: column; gap: 4px; }
.panel-picker-grid.is-industrial .panel-picker-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel-picker-item {
    display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 6px 10px; text-align: left;
    border: 1px solid transparent; border-radius: 8px; background: var(--color-surface-soft);
    font-size: 13px; color: var(--color-text-strong); cursor: pointer;
}
.panel-picker-item:hover:not(:disabled) { border-color: var(--color-aznewb); }
.panel-picker-item:disabled { opacity: .45; cursor: not-allowed; }
.panel-picker-item.is-unknown .panel-picker-name { color: var(--color-text-soft); font-style: italic; }
.panel-picker-item.is-free { border: 1px dashed var(--color-dropzone-border); background: var(--color-white); }
.panel-picker-item.is-selected { background: var(--color-amnewb); border-color: var(--color-amnewb); font-weight: 600; }
.panel-picker-item:focus-visible { outline: 3px solid var(--color-aznewb); outline-offset: 1px; }
.panel-picker-pos { flex: none; min-width: 34px; color: var(--color-text-soft); font-variant-numeric: tabular-nums; }
.panel-picker-name { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.panel-picker-rating { flex: none; font-size: 12px; color: var(--color-text-soft); }
@media (max-width: 575.98px) { .panel-picker-grid { grid-template-columns: minmax(0, 1fr); } }

.explore-change { padding: 22px; border-radius: 14px; background: var(--color-wiinfo); border: 1px solid var(--color-aznewb); color: var(--color-text-strong); }
.explore-change[hidden] { display: none; }
.explore-change h2 { color: var(--color-aznewb); }
.explore-change-table { width: 100%; font-size: 14px; border-collapse: collapse; }
.explore-change-table th, .explore-change-table td { padding: 8px 10px 8px 0; vertical-align: top; text-align: left; }
.explore-change-table thead th { color: var(--color-text-soft); font-weight: 500; font-size: 13px; }
.explore-change-table tbody th { font-weight: 500; width: 28%; }
.explore-change-old { color: var(--color-text-soft); text-decoration: line-through; width: 36%; }
.explore-change-new { font-weight: 600; }
.explore-change-decision { border-top: 1px solid var(--color-border); margin-top: 16px; padding-top: 16px; }
.pill-approved { background: var(--color-success-bg); color: var(--color-success-text); }
.pill-rejected { background: var(--color-danger-bg); color: var(--color-danger-text); }
.log-stale { padding: 12px 16px; border-radius: 10px; background: var(--color-amnewb-soft); border: 1px solid var(--color-amnewb); font-size: 14px; }
.log-pending-banner {
    display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 12px; text-decoration: none;
    background: var(--color-amnewb-soft); border: 1px solid var(--color-amnewb); color: var(--color-text-strong);
}
.log-pending-banner:hover { border-color: var(--color-aznewb); color: var(--color-text-strong); }
.log-pending-banner svg { width: 20px; height: 20px; color: var(--color-aznewb); }

/* Fotos que pasan a Explore al aprobar / Photos copied to Explore on approval */
.explore-photo-picks { display: flex; flex-wrap: wrap; gap: 8px; }
.explore-photo-pick { position: relative; width: 84px; height: 64px; border-radius: 8px; overflow: hidden; cursor: pointer; border: 2px solid var(--color-border); }
.explore-photo-pick img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .45; transition: opacity .15s ease; }
.explore-photo-pick input { position: absolute; top: 4px; left: 4px; width: 18px; height: 18px; accent-color: var(--color-aznewb); z-index: 1; }
.explore-photo-pick:has(input:checked) { border-color: var(--color-amnewb); }
.explore-photo-pick:has(input:checked) img { opacity: 1; }
.explore-photo-pick:focus-within { outline: 3px solid var(--color-aznewb); outline-offset: 1px; }

/* Breakers de una novedad / Breakers of an event */
.log-item { border: 1px solid var(--color-border); border-radius: 12px; padding: 14px 16px; background: var(--color-white); }
.log-item-position { display: inline-block; padding: 6px 0; font-weight: 500; }
.explore-change-group th { padding-top: 14px; font-weight: 600; color: var(--color-aznewb); border-bottom: 1px solid var(--color-border); }
.explore-photo-pick:has(select) { width: 140px; height: auto; cursor: default; border-color: var(--color-border); }
.explore-photo-pick:has(select) img { height: 84px; opacity: 1; }
.explore-photo-pick select { border: 0; border-top: 1px solid var(--color-border); border-radius: 0; font-size: 12px; }
.explore-change-old.is-empty { text-decoration: none; }

/* Aviso en el menú: hay algo por atender / Menu alert: something to attend */
.nav-alert {
  position: absolute; top: -4px; right: -4px; z-index: 1;
  min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--color-alert); color: var(--color-alert-text);
  font-size: 11px; font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 2px var(--color-white);
}

/* Dashboard: pendientes de revisión / waiting for review */
.pending-card { border-left: 4px solid var(--color-alert) !important; }
.pending-count {
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--color-alert); color: var(--color-alert-text); font-size: 13px; font-weight: 700;
}
.pending-list li + li { border-top: 1px solid var(--color-border-soft); }
.pending-item { display: flex; align-items: center; gap: 12px; padding: 10px 4px; color: var(--color-text-strong); text-decoration: none; }
.pending-item:hover { background: var(--color-surface-soft); }
.pending-icon { width: 20px; height: 20px; color: var(--color-aznewb); flex-shrink: 0; }
.pending-age { font-size: 13px; color: var(--color-text-soft); white-space: nowrap; }
.pending-age.is-late { color: var(--color-danger-text); background: var(--color-danger-bg); padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.pending-go { font-size: 13px; font-weight: 600; color: var(--color-aznewb); white-space: nowrap; }
.min-w-0 { min-width: 0; }
@media (max-width: 575.98px) { .pending-go { display: none; } }

/* ==========================================================
   Buscador general / General search
   ========================================================== */
.nb-search { position: relative; flex: 1; max-width: 560px; margin: 0 16px; display: none; }
@media (min-width: 768px) { .nb-search { display: block; } }
.nb-search-box {
  display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px;
  background: var(--color-white); border: 2px solid transparent; border-radius: 8px;
}
.nb-search-box:focus-within { border-color: var(--color-amnewb); }
.nb-search-box svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--color-text-soft); }
.nb-search-box input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--color-text-strong); }
.nb-search-box kbd { font-size: 11px; color: var(--color-text-soft); background: transparent; border: 1px solid var(--color-border-soft); border-radius: 4px; padding: 1px 6px; }
.nb-search-close { border: 0; background: transparent; padding: 4px; color: var(--color-text-soft); }
.nb-search-open { color: var(--color-text-strong); padding: 4px 8px; }

.nb-search-panel {
  position: absolute; top: calc(100% + 8px); left: 0; width: max(100%, 560px); z-index: 1050;
  background: var(--color-white); border-radius: 12px; overflow: hidden;
  box-shadow: 0 12px 32px var(--color-search-shadow); color: var(--color-text-strong);
}
.nb-search-results { max-height: 470px; overflow-y: auto; padding: 6px 0; }
.nb-search-group { display: flex; align-items: center; gap: 8px; padding: 10px 16px 4px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--color-text-soft); }
.nb-search-pill { font-size: 11px; font-weight: 600; text-transform: none; letter-spacing: 0; padding: 1px 8px; border-radius: 10px; color: var(--color-text-strong); }
.nb-search-pill.explore { background: var(--color-search-pill-explore); }
.nb-search-pill.reports { background: var(--color-search-pill-reports); }
.nb-search-item { display: flex; align-items: center; gap: 12px; padding: 8px 16px; color: inherit; text-decoration: none; }
.nb-search-item:hover, .nb-search-item.is-active { background: var(--color-search-active); color: inherit; }
.nb-search-icon { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--color-surface-soft); color: var(--color-aznewb); }
.nb-search-icon svg { width: 16px; height: 16px; }
.nb-search-dot { width: 14px; height: 14px; border-radius: 50%; }
.nb-search-main { min-width: 0; flex: 1; }
.nb-search-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-search-sub { font-size: 12px; color: var(--color-text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nb-search-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--color-warning-bg); color: var(--color-warning-text); white-space: nowrap; }
.nb-search-results mark { background: var(--color-search-highlight); color: inherit; padding: 0 1px; border-radius: 2px; }
.nb-search-more { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 4px 16px 8px 60px; font-size: 12px; color: var(--color-aznewb); }
.nb-search-more:hover { text-decoration: underline; }
.nb-search-empty { padding: 24px 16px; text-align: center; color: var(--color-text-soft); font-size: 14px; }
.nb-search-status { padding: 10px 16px; font-size: 12px; color: var(--color-text-soft); }
.nb-search-foot { gap: 16px; padding: 8px 16px; border-top: 1px solid var(--color-border-soft); background: var(--color-surface-soft); font-size: 12px; color: var(--color-text-soft); white-space: nowrap; }

/* Celular: pantalla completa / Mobile: full screen */
@media (max-width: 767.98px) {
  .nb-search.is-open {
    display: block; position: fixed; inset: 0; z-index: 1060; margin: 0; max-width: none;
    padding: 12px; background: var(--color-search-backdrop);
  }
  .nb-search.is-open .nb-search-panel { position: static; width: 100%; margin-top: 8px; max-height: calc(100vh - 80px); }
  .nb-search.is-open .nb-search-results { max-height: calc(100vh - 100px); }
}

/* ==========================================================
   Bolita del idioma abajo del menú / Language button below the menu
   ========================================================== */
.sidebar-sticky { display: flex; flex-direction: column; }
.locale-switch { position: relative; margin-top: auto; padding: 16px 18px 18px; }
.locale-button {
  display: block; width: 28px; height: 28px; padding: 0; border-radius: 50%; overflow: hidden;
  border: 2px solid var(--color-white); background: var(--color-white);
  box-shadow: 0 2px 6px var(--color-search-shadow); cursor: pointer;
}
.locale-button:focus-visible { outline: 3px solid var(--color-amnewb); outline-offset: 2px; }
.locale-button svg, .locale-flag svg { display: block; width: 100%; height: 100%; }
.locale-menu {
  position: absolute; left: 14px; bottom: 54px; z-index: 5; min-width: 150px;
  display: flex; flex-direction: column; gap: 4px; padding: 6px;
  background: var(--color-white); border-radius: 12px; box-shadow: 0 10px 28px var(--color-search-shadow);
}
.locale-menu[hidden] { display: none; }
.locale-option {
  display: flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border: 0; border-radius: 18px;
  background: transparent; font-size: 13px; color: var(--color-text-strong); text-align: left; cursor: pointer;
}
.locale-option:hover, .locale-option.is-current { background: var(--color-locale-active); }
.locale-option.is-current { font-weight: 600; }
.locale-flag { width: 20px; height: 20px; border-radius: 50%; overflow: hidden; flex-shrink: 0; box-shadow: 0 0 0 1px var(--color-border-soft); }

/* ==========================================================
   Ficha de la propiedad (inicio) / Property profile (home)
   ========================================================== */
.property-hero { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.property-hero.no-map { grid-template-columns: minmax(0, 1fr); }
.property-photo, .property-map { position: relative; height: 300px; border-radius: 14px; overflow: hidden; box-shadow: 0 1px 3px var(--color-search-shadow); }
.property-photo { background: var(--color-property-empty) center / cover no-repeat; }
.property-default { position: absolute; inset: 0; width: 100%; height: 100%; }
.property-caption {
  position: absolute; z-index: 1; left: 0; right: 0; bottom: 0; padding: 18px 20px 16px; color: var(--color-white);
  background: linear-gradient(0deg, var(--color-property-shade), var(--color-property-shade-clear));
}
.property-caption strong { display: block; font-size: 22px; line-height: 1.2; }
.property-caption span { font-size: 13px; opacity: .92; }
.property-tag { position: absolute; z-index: 2; top: 14px; left: 16px; padding: 3px 10px; border-radius: 12px; background: var(--color-property-tag); color: var(--color-text-strong); font-size: 12px; font-weight: 600; }
.property-edit {
  position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 16px; background: var(--color-property-tag); color: var(--color-text-strong);
  font-size: 13px; font-weight: 600; text-decoration: none;
}
.property-edit:hover { color: var(--color-aznewb); }
.property-edit svg { width: 14px; height: 14px; }
.property-map { background: var(--color-property-map); }
.property-map-canvas { position: absolute; inset: 0; }
.property-map-link {
  position: absolute; left: 12px; bottom: 12px; z-index: 500; padding: 6px 12px; border-radius: 8px;
  background: var(--color-white); color: var(--color-aznewb); font-size: 13px; font-weight: 600; text-decoration: none;
  box-shadow: 0 1px 4px var(--color-search-shadow);
}
.property-map-empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--color-aznewb); font-weight: 600; text-decoration: none; }
.property-map-empty svg { width: 32px; height: 32px; }
.property-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.property-fact { padding: 14px 18px; border-right: 1px solid var(--color-border-soft); }
.property-fact:last-child { border-right: 0; }
.property-fact small { display: block; margin-bottom: 4px; font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: var(--color-text-soft); }
.property-fact strong { font-size: 15px; }
@media (max-width: 991.98px) {
  .property-hero { grid-template-columns: minmax(0, 1fr); }
  .property-photo, .property-map { height: 220px; }
}

/* Formulario de la ficha / Profile form */
.property-form-photo { position: relative; height: 200px; border-radius: 12px; overflow: hidden; background: var(--color-property-empty) center / cover no-repeat; }
.property-picker { height: 320px; border-radius: 12px; overflow: hidden; background: var(--color-property-map); }

/* Página 404: bombillo que parpadea y enchufe colgando.
   404 page: flickering bulb and hanging plug. */
.nf-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--color-wiinfo); color: var(--color-text-strong); }
.nf-top { height: 56px; display: flex; }
.nf-brand { width: 250px; background: var(--color-amnewb); display: flex; align-items: center; padding-left: 16px; }
.nf-brand .logo { max-height: 45px; }
.nf-band { flex: 1; background: var(--color-aznewb); }
.nf-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.nf-wrap { text-align: center; width: 100%; max-width: 620px; }
.nf-code { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 168px; font-weight: 800; line-height: 1; color: var(--color-aznewb); letter-spacing: -4px; }
.nf-bulb { width: 150px; height: 190px; margin: 0 4px; }
.nf-bulb svg, .nf-cable svg { width: 100%; height: 100%; overflow: visible; }
.nf-glass { fill: var(--color-404-glass); stroke: var(--color-aznewb); stroke-width: 5; animation: nf-flicker 4s infinite; }
.nf-glow { fill: var(--color-404-glow); filter: blur(18px); animation: nf-glow 4s infinite; }
.nf-filament { stroke: var(--color-amnewb); stroke-width: 4; fill: none; stroke-linecap: round; animation: nf-filament 4s infinite; }
.nf-base { fill: var(--color-404-base); }
.nf-base-dark { fill: var(--color-404-base-dark); }
.nf-cable { height: 120px; width: 300px; max-width: 100%; margin: -6px auto 8px; }
.nf-plug { transform-origin: 150px 0; animation: nf-swing 3.2s ease-in-out infinite; }
.nf-wire { stroke: var(--color-404-cable); stroke-width: 5; fill: none; stroke-linecap: round; }
.nf-plug-body { fill: var(--color-aznewb); }
.nf-spark { fill: var(--color-404-spark); opacity: 0; transform-box: fill-box; transform-origin: center; animation: nf-spark 3.2s infinite; }
.nf-spark.nf-s2 { animation-delay: .15s; }
.nf-spark.nf-s3 { animation-delay: .3s; }
.nf-title { margin: 6px 0 8px; font-size: 26px; font-weight: 700; }
.nf-text { margin: 0 auto 24px; color: var(--color-text-soft); font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.nf-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.nf-actions .btn { padding: 10px 20px; border-radius: 8px; font-weight: 600; font-size: 15px; }
.nf-btn-main { background: var(--color-aznewb); color: var(--color-white); }
.nf-btn-main:hover { background: var(--color-aznewb-dark); color: var(--color-white); }
.nf-btn-alt { background: var(--color-white); color: var(--color-aznewb); box-shadow: 0 1px 3px var(--color-404-shadow); }
.nf-btn-alt:hover { color: var(--color-aznewb-dark); }
.nf-hint { margin-top: 22px; font-size: 13px; color: var(--color-text-soft); }
.nf-hint a { color: var(--color-aznewb); }

@keyframes nf-flicker {
    0%, 18%, 22%, 25%, 53%, 57%, 100% { fill: var(--color-404-glass); }
    20%, 24%, 55%, 70%, 92% { fill: var(--color-404-glass-off); }
}
@keyframes nf-glow {
    0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; }
    20%, 24%, 55%, 70%, 92% { opacity: 0; }
}
@keyframes nf-filament {
    0%, 18%, 22%, 25%, 53%, 57%, 100% { stroke: var(--color-amnewb); }
    20%, 24%, 55%, 70%, 92% { stroke: var(--color-404-base); }
}
@keyframes nf-swing { 0%, 100% { transform: rotate(9deg); } 50% { transform: rotate(-9deg); } }
@keyframes nf-spark { 0%, 40%, 60%, 100% { opacity: 0; transform: scale(.4); } 48% { opacity: 1; transform: scale(1.3); } }

/* Sin animación si el usuario lo pide / No motion when the user asks for it */
@media (prefers-reduced-motion: reduce) {
    .nf-glass, .nf-glow, .nf-filament, .nf-plug, .nf-spark { animation: none; }
}
/* Celular / Mobile */
@media (max-width: 560px) {
    .nf-brand { width: auto; padding-right: 16px; }
    .nf-code { font-size: 96px; letter-spacing: -2px; }
    .nf-bulb { width: 90px; height: 115px; }
    .nf-cable { height: 90px; width: 220px; }
    .nf-title { font-size: 22px; }
}
