/* =====================================================================
   Página del tablero (Views/Tableros/Detalle.cshtml) · body.page-board
   El color del tablero llega en --board (style del <body>) y se usa como acento:
   un brillo detrás del contenido, el borde superior de la barra y el punto junto al nombre.
   ===================================================================== */
body.page-board {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

body.page-board::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(60% 45% at 12% 0%, var(--board), transparent 70%);
    opacity: 0.22;
}

.page-board .app-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* ---- Barra superior del tablero ---- */
.topbar--board {
    border-top: 3px solid var(--board);
}

.board-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
    font-size: var(--text-md);
    font-weight: 800;
}

.board-title__dot {
    width: 10px;
    height: 10px;
    flex: none;
    border-radius: 3px;
    background: var(--board);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.board-title__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-members {
    margin-right: var(--space-2);
}

/* ---- Selector de vista: Tablero | Resumen por mes (resumen.js) ---- */
.barra-vistas {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 12px max(var(--space-5), env(safe-area-inset-right, 0px)) 0 max(var(--space-5), env(safe-area-inset-left, 0px));
}

.vista-switch {
    display: inline-flex;
    gap: 3px;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
}

.btn-vista {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 700;
    transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
    user-select: none;
}

.btn-vista:hover {
    color: var(--text);
    background: var(--surface-2);
}

.btn-vista.activa {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--accent-shadow);
}

.btn-vista .material-icons {
    font-size: 18px;
}

.barra-vistas__acciones {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.barra-vistas__acciones:empty,
.barra-vistas__acciones[hidden] {
    display: none !important;
}

.btn-crear-lista-top {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: var(--text-sm);
    font-weight: 700;
    box-shadow: 0 4px 12px var(--accent-shadow);
    transition: transform 0.1s, box-shadow 0.15s, background-color 0.15s;
    user-select: none;
}

.btn-crear-lista-top:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--accent-shadow);
}

.btn-crear-lista-top .material-icons {
    font-size: 18px;
}

/* ---- Modal de detalle de la tarjeta ---- */
.tab-panel {
    min-height: 330px;
    padding-top: var(--space-1);
}

.modal textarea.materialize-textarea {
    min-height: 96px;
    max-height: 220px;
    overflow-y: auto;
}

.indicador-cumplimiento {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.nota-autoguardado {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: var(--space-4);
    color: var(--text-faint);
    font-size: var(--text-xs);
}

.nota-autoguardado .material-icons {
    font-size: 16px;
}

/* Checklist */
.checklist-titulo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-2);
    font-weight: 800;
}

.checklist-porcentaje {
    color: var(--accent-hover);
    font-variant-numeric: tabular-nums;
}

.checklist-porcentaje.completo {
    color: var(--ok);
}

#detalle_checklist {
    margin: var(--space-3) 0;
}

#detalle_checklist li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 4px;
    border-bottom: 1px solid var(--border);
}

#detalle_checklist li label {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 10px;
    min-width: 0;
    cursor: pointer;
}

#detalle_checklist li span {
    overflow-wrap: anywhere;
}

#detalle_checklist li.completada span {
    color: var(--text-faint);
    text-decoration: line-through;
}

.btn-eliminar-subtarea,
.btn-eliminar-adjunto {
    padding: 4px;
    border-radius: 6px;
    color: var(--text-faint);
    font-size: 18px;
    cursor: pointer;
}

.btn-eliminar-subtarea:hover,
.btn-eliminar-adjunto:hover {
    background: var(--bad-soft);
    color: var(--bad);
}

.nueva-subtarea {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* Pestaña Archivos */
.zona-subida {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 20px;
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-muted);
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

.zona-subida:hover,
.zona-subida:focus,
.zona-subida.arrastrando {
    border-color: var(--accent);
    background: var(--accent-soft);
    outline: none;
}

.zona-subida > .material-icons {
    color: var(--accent);
    font-size: 36px;
}

.zona-subida strong {
    color: var(--text);
}

.zona-subida-nota {
    color: var(--text-faint);
    font-size: var(--text-xs);
}

.adjuntos-estado {
    min-height: 1.4em;
    margin: 6px 0;
    color: var(--accent-hover);
    font-size: var(--text-sm);
}

.lista-adjuntos li {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.lista-adjuntos .vista {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    flex: none;
    overflow: hidden;
    border-radius: var(--radius-xs);
    background: var(--surface-2);
}

.lista-adjuntos .vista img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lista-adjuntos .vista .material-icons {
    color: var(--bad);
    font-size: 32px;
}

.lista-adjuntos .info {
    flex: 1;
    min-width: 0;
}

.lista-adjuntos .info a {
    display: block;
    overflow: hidden;
    color: var(--text);
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lista-adjuntos .info small {
    color: var(--text-faint);
}

/* ---- Modal de miembros ---- */
.member-list {
    display: flex;
    flex-direction: column;
}

.member-list__item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.member-list__item:last-child {
    border-bottom: 0;
}

.member-list__info {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-width: 0;
}

.member-list__info small {
    overflow: hidden;
    color: var(--text-faint);
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Modal API de estado del sistema ---- */
.api-modo {
    margin-left: auto;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: var(--text-xs);
    font-weight: 700;
    white-space: nowrap;
}

.api-modo.debug {
    background: var(--warn-soft);
    color: var(--warn);
}

.api-modo.release {
    background: var(--accent-soft);
    color: var(--accent-hover);
}

.api-etiqueta {
    margin: 18px 0 6px;
    color: var(--text-faint);
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.api-url {
    display: flex;
    align-items: center;
    gap: 4px;
}

.api-url input {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}

.api-estado {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 700;
}

.api-estado.activo {
    background: var(--ok-soft);
    color: var(--ok);
}

.api-estado.programado {
    background: var(--warn-soft);
    color: var(--warn);
}

.api-estado.suspendido {
    background: var(--bad-soft);
    color: var(--bad);
}

.api-fecha,
.api-prueba {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-2);
}

.api-fecha input {
    width: 170px;
}

.api-prueba {
    margin-top: 22px;
}

.api-respuesta {
    max-height: 260px;
    margin-top: var(--space-3);
    padding: 12px;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: rgba(2, 8, 21, 0.6);
    color: #b8e986;
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    white-space: pre-wrap;
    word-break: break-all;
}

.api-respuesta.error {
    color: var(--bad);
}

/* ---- Visor de adjuntos (resumen.js) ---- */
.modal.modal-visor {
    width: min(1100px, calc(100% - 32px));
    height: 88vh;
    max-height: 92%;
    overflow: hidden;
}

/* Solo al estar abierto: un display fijo anularía el display:none con el que Materialize oculta el modal */
.modal.modal-visor.open {
    display: flex !important;
    flex-direction: column;
}

.visor-cabecera {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 10px 8px 18px;
    border-bottom: 1px solid var(--border);
}

.visor-nombre {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.visor-contenido {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
    background: rgba(2, 8, 21, 0.7);
}

.visor-contenido img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.visor-contenido iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

@media (max-width: 760px) {
    .board-members {
        display: none;
    }

    .board-title {
        font-size: var(--text-base);
    }

    .barra-vistas {
        padding: 8px 12px 0;
        gap: 8px;
    }

    .btn-vista {
        height: 32px;
        padding: 0 10px;
        font-size: var(--text-xs);
    }

    .btn-crear-lista-top {
        height: 32px;
        padding: 0 10px;
        font-size: var(--text-xs);
    }

    .tab-panel {
        min-height: auto;
    }

    .modal.modal-visor {
        width: 100% !important;
        height: 100% !important;
        max-height: 100% !important;
        border-radius: 0 !important;
    }

    .topbar--board .topbar__brand {
        display: none;
    }
}

@media (max-width: 440px) {
    .btn-crear-lista-top span {
        display: none;
    }

    .btn-crear-lista-top {
        padding: 0 8px;
        width: 32px;
        justify-content: center;
    }
}


