﻿/* ============================================================
   PÁGINA
   ============================================================ */

.detail-page {
    width: 100%;
    height: 100dvh;
    min-height: 650px;
    margin: 0;
    padding: 38px;
    box-sizing: border-box;
    overflow: hidden;
    background-color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
}


/* ============================================================
   CANVAS
   ============================================================ */

.detail-shell {
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    background-color: #10174A;
}


/* ============================================================
   HEADER
   ============================================================ */

.detail-header {
    position: relative;
    width: 100%;
    height: 56px;
    background-color: #1ECECA;
    border-bottom: 1px solid #4057A0;
}


.detail-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    gap: 4px;
    align-items: center;
    color: #000000;
    font-size: 19px;
    white-space: nowrap;
}


.detail-back,
.detail-home {
    position: absolute;
    top: 50%;
    width: 52px;
    height: 52px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}


.detail-back {
    left: 0;
}


.detail-home {
    right: 1px;
}


    .detail-back svg,
    .detail-home svg {
        width: 48px !important;
        height: 48px !important;
        fill: none;
        stroke: #000000;
        stroke-width: 3;
        stroke-linecap: round;
        stroke-linejoin: round;
    }


/* ============================================================
   SCROLL
   ============================================================ */

.detail-scroll {
    position: absolute;
    left: 0;
    right: 0;
    top: 56px;
    bottom: 0;
    padding: 10px 18px 30px;
    box-sizing: border-box;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #10174A;
}


/* ============================================================
   RESUMEN
   ============================================================ */

.case-summary {
    width: 100%;
    margin-bottom: 44px;
    background-color: #ffffff;
}


.summary-header,
.summary-row {
    width: 100%;
    display: grid;
    grid-template-columns: 6% 12% 12% 12% 34% 14% 10%;
}


.summary-header {
    height: 35px;
    background-color: #CACACA;
}


    .summary-header > div {
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 3px;
        box-sizing: border-box;
        border-right: 1px solid #3860B2;
        border-bottom: 1px solid #3860B2;
        color: #000000;
        text-align: center;
        font-size: 13px;
        font-weight: 700;
    }


.summary-row {
    min-height: 155px;
    background-color: #ffffff;
}


.summary-cell {
    min-width: 0;
    min-height: 155px;
    padding: 8px 5px;
    box-sizing: border-box;
    border-right: 1px solid #000000;
    border-bottom: 1px solid #000000;
    background-color: #ffffff;
    color: #000000;
    font-size: 13px;
    overflow-wrap: anywhere;
}


    .summary-cell:first-child {
        border-left: 1px solid #000000;
    }


.center-cell {
    text-align: center;
}


.requester-cell {
    padding: 0;
}


.requester-rut {
    min-height: 28px;
    padding: 5px;
    box-sizing: border-box;
    border-bottom: 1px solid #000000;
    text-align: center;
}


.requester-data {
    padding: 7px 5px;
    text-align: center;
}


.description-cell {
    line-height: 17px;
}


/* ============================================================
   CONTENIDO
   ============================================================ */

.detail-content {
    width: 100%;
    min-height: 930px;
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 10px;
}


/* ============================================================
   FORMULARIO
   ============================================================ */

.detail-form {
    min-width: 0;
    padding: 15px 25px 20px;
    box-sizing: border-box;
    background-color: #ffffff;
}


.form-top-row {
    display: grid;
    grid-template-columns: 1fr 1fr 55px;
    gap: 18px;
    align-items: start;
}


.field-group {
    min-width: 0;
}


    .field-group label,
    .solution-group label,
    .attachments-title {
        display: block;
        margin-bottom: 8px;
        color: #10174A;
        font-size: 18px;
        font-weight: 700;
    }


/* ============================================================
   SELECT
   ============================================================ */

.detail-select-wrapper {
    position: relative;
    width: 185px;
    height: 30px;
    max-width: 100%;
}


    .detail-select-wrapper select {
        width: 100%;
        height: 30px;
        padding: 0 36px 0 8px;
        box-sizing: border-box;
        border: 1px solid #3860B2;
        border-radius: 0;
        appearance: none;
        background-color: #ffffff;
    }


.detail-select-arrow {
    position: absolute;
    right: 0;
    top: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1ECECA;
    pointer-events: none;
}


    .detail-select-arrow svg {
        width: 22px !important;
        height: 22px !important;
        fill: none;
        stroke: #000000;
        stroke-width: 2;
    }


.tramites-error {
    width: 220px;
    max-width: 100%;
    margin-top: 5px;
    color: #b00020;
    font-size: 11px;
    line-height: 13px;
}


/* ============================================================
   UBICACIÓN
   ============================================================ */

.location-icon {
    width: 52px;
    height: 60px;
}


    .location-icon svg {
        width: 48px !important;
        height: 58px !important;
        fill: none;
        stroke: #10174A;
        stroke-width: 2;
    }


/* ============================================================
   FECHAS
   ============================================================ */

.form-date-row {
    margin-top: 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}


.field-group > input {
    width: 185px;
    max-width: 100%;
    height: 30px;
    padding: 0 7px;
    box-sizing: border-box;
    border: 1px solid #3860B2;
    background-color: #ffffff;
    color: #555555;
}


/* ============================================================
   SOLUCIÓN
   ============================================================ */

.solution-group {
    margin-top: 30px;
}


    .solution-group textarea {
        display: block;
        width: 88%;
        height: 265px;
        resize: none;
        padding: 10px;
        box-sizing: border-box;
        border: 1px solid #3860B2;
        outline: none;
        background-color: #ffffff;
        font-size: 14px;
    }


/* ============================================================
   ADJUNTOS
   ============================================================ */

.attachments-title {
    margin-top: 30px;
}


.attachments-area {
    width: 88%;
    display: grid;
    grid-template-columns: 42% 58%;
    gap: 12px;
}


.attachment-upload,
.attachment-preview {
    height: 315px;
    box-sizing: border-box;
    border: 1px solid #3860B2;
    background-color: #ffffff;
}


.attachment-upload {
    padding: 13px;
}


.attachment-empty {
    margin-bottom: 22px;
    color: #222222;
    font-size: 13px;
}


.attachment-button {
    position: relative;
    display: inline-block;
    color: #222222;
    font-size: 13px;
    cursor: pointer;
}


    .attachment-button input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }


/* ============================================================
   GUARDAR
   ============================================================ */

.save-area {
    margin-top: 55px;
}


.save-button {
    width: 145px;
    height: 42px;
    border: 2px solid #b0b0b0;
    border-radius: 10px;
    background-color: #f4f4f4;
    color: #aaaaaa;
    font-size: 18px;
    font-weight: 700;
}


/* ============================================================
   PANEL ARCHIVOS
   ============================================================ */

.images-panel {
    min-width: 0;
    background-color: #ffffff;
}


.images-title {
    width: 100%;
    height: 33px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #CACACA;
    color: #000000;
    font-size: 14px;
    font-weight: 700;
}


/* ============================================================
   GALERÍA
   ============================================================ */

.images-body {
    min-height: 895px;
    padding: 12px 20px 30px;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat( 2, minmax(120px, 1fr));
    grid-auto-rows: max-content;
    gap: 22px;
    align-content: start;
    background-color: #ffffff;
}


/* ============================================================
   TARJETA
   ============================================================ */

.case-file-card {
    min-width: 0;
    height: 240px;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    border: 1px solid #b8b8b8;
    border-radius: 0;
    outline: none;
    background-color: #ffffff;
    color: #222222;
    text-align: left;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}


    .case-file-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 3px 9px rgba(0, 0, 0, 0.15);
    }


    .case-file-card:focus {
        outline: 2px solid #1ECECA;
        outline-offset: 2px;
    }


/* ============================================================
   IMAGEN
   ============================================================ */

.case-image-container {
    width: 100%;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #f5f5f5;
}


    .case-image-container img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }


/* ============================================================
   DOCUMENTO
   ============================================================ */

.case-document-container {
    width: 100%;
    height: 170px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f5f5f5;
}


/* ============================================================
   ICONO TIPO ARCHIVO
   ============================================================ */

.file-type-icon {
    width: 76px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    border: 2px solid #10174A;
    background-color: #ffffff;
    color: #10174A;
    font-size: 21px;
    font-weight: 700;
}


.pdf-icon {
    font-size: 17px;
}


.word-icon,
.excel-icon,
.powerpoint-icon {
    font-size: 30px;
}


.generic-icon {
    padding: 4px;
    font-size: 12px;
    text-align: center;
    overflow: hidden;
}


/* ============================================================
   NOMBRE
   ============================================================ */

.case-file-name {
    width: 100%;
    padding: 7px 8px 2px;
    box-sizing: border-box;
    overflow: hidden;
    color: #222222;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
}


/* ============================================================
   TAMAÑO
   ============================================================ */

.case-file-size {
    padding: 1px 8px 7px;
    color: #777777;
    font-size: 11px;
}


/* ============================================================
   MENSAJES ARCHIVOS
   ============================================================ */

.files-message {
    grid-column: 1 / -1;
    width: 100%;
    padding: 35px 10px;
    box-sizing: border-box;
    color: #555555;
    text-align: center;
    font-size: 13px;
}


.files-error {
    color: #b00020;
}


/* ============================================================
   VISOR
   ============================================================ */

.file-viewer-overlay {
    position: absolute;
    inset: 0;
    z-index: 2000;
    padding: 18px;
    box-sizing: border-box;
    background-color: rgba( 5, 9, 35, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
}


/* ============================================================
   VENTANA VISOR
   ============================================================ */

.file-viewer-window {
    width: 96%;
    height: 96%;
    max-width: 1600px;
    display: grid;
    grid-template-rows: 58px minmax(0, 1fr);
    box-sizing: border-box;
    border: 2px solid #1ECECA;
    background-color: #ffffff;
    overflow: hidden;
}


/* ============================================================
   TOOLBAR VISOR
   ============================================================ */

.file-viewer-toolbar {
    min-width: 0;
    height: 58px;
    padding: 7px 12px 7px 18px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    background-color: #1ECECA;
    color: #000000;
}


.file-viewer-info {
    min-width: 0;
    flex: 1;
}


.file-viewer-title {
    overflow: hidden;
    font-size: 16px;
    font-weight: 700;
    white-space: nowrap;
    text-overflow: ellipsis;
}


.file-viewer-subtitle {
    margin-top: 3px;
    color: #222222;
    font-size: 11px;
}


/* ============================================================
   CERRAR
   ============================================================ */

.file-viewer-close {
    width: 42px;
    height: 42px;
    min-width: 42px;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background-color: transparent;
    color: #000000;
    font-size: 38px;
    line-height: 1;
    font-weight: 300;
    cursor: pointer;
}


    .file-viewer-close:hover {
        background-color: rgba( 255, 255, 255, 0.35);
    }


/* ============================================================
   BODY VISOR
   ============================================================ */

.file-viewer-body {
    position: relative;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #eeeeee;
}


/* ============================================================
   IFRAME
   ============================================================ */

.viewer-frame {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background-color: #ffffff;
}


/* ============================================================
   VISOR IMAGEN
   ============================================================ */

.viewer-image-wrapper {
    width: 100%;
    height: 100%;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background-color: #161616;
}


.viewer-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}


/* ============================================================
   ESTADO VISOR
   ============================================================ */

.viewer-status {
    position: absolute;
    inset: 0;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    box-sizing: border-box;
    background-color: #ffffff;
    color: #10174A;
    text-align: center;
    font-size: 14px;
}


.viewer-error {
    color: #b00020;
}


/* ============================================================
   SPINNER
   ============================================================ */

.viewer-spinner {
    width: 42px;
    height: 42px;
    box-sizing: border-box;
    border: 4px solid #d0d0d0;
    border-top-color: #1ECECA;
    border-radius: 50%;
    animation: viewer-spin 0.8s linear infinite;
}


@keyframes viewer-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ============================================================
   CARGA GENERAL
   ============================================================ */

.detail-loading {
    padding: 40px;
    color: #ffffff;
    text-align: center;
    font-size: 16px;
}


.detail-error {
    color: #ffb3b3;
}


/* ============================================================
   SCROLL
   ============================================================ */

.detail-scroll {
    scrollbar-width: auto;
    scrollbar-color: #929292 #eeeeee;
}


    .detail-scroll::-webkit-scrollbar {
        width: 15px;
    }


    .detail-scroll::-webkit-scrollbar-track {
        background-color: #eeeeee;
    }


    .detail-scroll::-webkit-scrollbar-thumb {
        border: 2px solid #eeeeee;
        border-radius: 8px;
        background-color: #929292;
    }


/* ============================================================
   PANTALLA MEDIA
   ============================================================ */

@media (max-width: 1500px) {

    .summary-header > div,
    .summary-cell {
        font-size: 12px;
    }


    .detail-form {
        padding-left: 20px;
        padding-right: 20px;
    }


    .field-group label,
    .solution-group label,
    .attachments-title {
        font-size: 16px;
    }


    .images-body {
        gap: 16px;
        padding-left: 14px;
        padding-right: 14px;
    }


    .file-viewer-window {
        width: 98%;
        height: 98%;
    }
}


/* ============================================================
   NOTEBOOK
   ============================================================ */

@media (max-width: 1200px) {

    .detail-page {
        padding: 24px;
    }


    .detail-content {
        grid-template-columns: 60% 40%;
    }


    .solution-group textarea,
    .attachments-area {
        width: 95%;
    }


    .images-body {
        grid-template-columns: repeat( 2, minmax(100px, 1fr));
        gap: 10px;
    }


    .case-file-card {
        height: 210px;
    }


    .case-image-container,
    .case-document-container {
        height: 145px;
    }


    .file-viewer-overlay {
        padding: 8px;
    }


    .file-viewer-window {
        width: 100%;
        height: 100%;
    }
}
