/* Ajustes de legibilidad y responsive - panel Patricia Castellón */
:root {
    --pc-text: #1e293b;
    --pc-muted: #475569;
    --pc-line: #e2e8f0;
}

/* 1. Etiquetas de formulario: contraste suficiente sobre fondo blanco */
.main label,
.main .form-group label,
.main .control-label {
    color: var(--pc-muted) !important;
    font-weight: 600;
}

.main input::placeholder,
.main textarea::placeholder {
    color: #94a3b8;
    opacity: 1;
}

/* 2. Tablas de listado: sin desbordes; filas como tarjetas en celular */
@media (max-width: 767.98px) {
    .main .btn {
        min-height: 38px;
    }

    .main .card-body {
        padding: 0.75rem;
    }

    .main .card-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
}

/* Listados: en celular y tablet (hasta 991 px) cada fila es una tarjeta con etiquetas.
   En celular ocupa una columna; en tablet, dos columnas. */
@media (max-width: 991.98px) {
    table.table-listing tbody {
        display: grid !important;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 0.75rem;
    }

    table.table-listing thead {
        display: none !important;
    }

    table.table-listing {
        display: block !important;
        width: 100% !important;
    }

    table.table-listing tr {
        display: block !important;
        width: 100% !important;
    }

    table.table-listing td {
        display: flex !important;
        width: 100% !important;
    }

    table.table-listing tr {
        background: #fff;
        border: 1px solid var(--pc-line);
        border-radius: 8px;
        padding: 0.5rem 0.75rem;
        margin-bottom: 0.75rem;
        box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
    }

    table.table-listing td {
        border: 0 !important;
        padding: 0.4rem 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
        text-align: right;
        overflow-wrap: anywhere;
    }

    table.table-listing td::before {
        content: attr(data-label);
        flex: 0 0 40%;
        max-width: 40%;
        text-align: left;
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--pc-muted);
    }

    table.table-listing td:not([data-label])::before,
    table.table-listing td[data-label=""]::before {
        display: none;
    }

    table.table-listing td[data-label=""] {
        justify-content: flex-end;
        flex-wrap: wrap;
    }

    table.table-listing td .btn {
        margin-bottom: 0.25rem;
    }
}

/* 3. Dashboard: tarjetas de indicadores más compactas en celular */
@media (max-width: 767.98px) {
    .main .card.bg-primary .card-body {
        padding: 0.6rem 0.75rem;
    }

    .main .card.bg-primary .card-body p {
        font-size: 0.9rem !important;
        margin-bottom: 0.15rem !important;
        line-height: 1.25;
    }

    .main .card.bg-primary .card-body p:first-child {
        font-size: 1.05rem !important;
        font-weight: 600;
    }

    .main .card.bg-primary .card-body p:nth-child(3) {
        font-size: 2rem !important;
        font-weight: 700;
    }

    .main .card.bg-primary .card-body p:nth-child(4) {
        font-size: 0.95rem !important;
        font-weight: 600;
    }
}

/* 4. Asistente de inspección */

/* Control de cantidad (− cantidad +) siempre en una fila */
.number-input-group {
    flex-wrap: nowrap !important;
    max-width: 150px !important;
}

.number-input-group .qty-input {
    flex: 1 1 auto !important;
    width: 1% !important;
    min-width: 0 !important;
}

/* Botón "Volver" y demás botones: texto e icono centrados */
@media (max-width: 767.98px) {
    .main .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Flechas del asistente: botones flotantes en las esquinas inferiores */
    .wizard-nav-btn {
        position: fixed !important;
        bottom: 18px;
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        border-radius: 50% !important;
        z-index: 1040 !important;
        box-shadow: 0 4px 12px rgba(15, 23, 42, 0.3) !important;
    }

    .wizard-nav-btn[title="Paso anterior"] {
        left: 14px;
    }

    .wizard-nav-btn[title="Siguiente paso"] {
        right: 14px;
    }

    .main .card-body:has(.wizard-nav-btn) {
        padding-bottom: 90px;
    }

    /* Fotos y videos: una columna por fila en celular */
    .main .col-sm-12:has(> .inspection-media-card) {
        flex: 0 0 100%;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }

    /* Vista previa dentro de la tarjeta, sin salirse ni deformarse */
    .inspection-media-card .dropzone:has(.dz-preview) {
        height: auto !important;
        min-height: 210px !important;
    }

    .inspection-media-card .dz-preview {
        width: 100% !important;
        max-width: 100%;
        margin: 0.25rem 0;
    }

    .inspection-media-card .dz-preview .dz-image,
    .inspection-media-card .dz-preview .dz-details {
        width: 100% !important;
        max-width: 100%;
    }

    .inspection-media-card .dz-preview .dz-image img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 280px;
        object-fit: contain;
    }

    .inspection-media-card .card-header {
        white-space: normal !important;
        font-size: 0.78rem;
        padding: 0.5rem 0.6rem;
        min-height: 0;
    }

    .inspection-media-card .dropzone .dz-message .dz-custom-title {
        font-size: 0.85rem;
    }
}

/* Ajustes finos: campo de cantidad sin franja y icono visible en botones claros */
.number-input-group .qty-input {
    align-self: stretch !important;
    height: auto !important;
}

.btn-light i.fa,
.btn-light .fa {
    color: #1e293b !important;
}

/* Celular: botón de cámara con margen dentro de la tarjeta */
@media (max-width: 767.98px) {
    .inspection-media-card .btn-outline-primary {
        margin: 0.5rem 0.75rem 0.75rem !important;
    }
}

/* Avisos de estado de cada archivo (subida, 100 % sin confirmar, recibido, error) */
.pc-upload-note {
    display: block;
    background: #ffffff;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    border-left: 5px solid #94a3b8;
    border-radius: 6px;
    padding: 0.45rem 0.6rem;
    margin: 0.5rem 0.5rem 0.25rem;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* La vista previa del archivo no debe verse apagada: el aviso de estado tiene que leerse bien */
.inspection-media-card .dz-preview {
    opacity: 1 !important;
}

/* El aviso de estado debe quedar por encima de la capa de color de la vista previa */
.inspection-media-card .pc-upload-note {
    position: relative;
    z-index: 5;
}

/* Video dentro de la tarjeta: centrado, a todo el ancho disponible, sin ventana nueva */
.dropzone .dz-preview.pc-video-preview {
    width: 100% !important;
    max-width: 100%;
    margin: 0.5rem 0;
    display: block;
}

.dropzone .dz-preview.pc-video-preview .dz-image {
    width: 100% !important;
    height: auto !important;
    background: #000 !important;
    border-radius: 6px;
    overflow: hidden;
}

.dropzone .dz-preview.pc-video-preview .dz-image video.pc-video-inline {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: 70vh;
    height: auto;
    margin: 0 auto;
    background: #000;
}

.dropzone .dz-preview.pc-video-preview .dz-details {
    width: 100% !important;
    text-align: center;
}

.dropzone:has(.pc-video-preview) {
    height: auto !important;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Videos: acciones bajo el reproductor (Ampliar / Eliminar video); el botón Eliminar de Dropzone queda oculto */
.dropzone .dz-preview.pc-video-preview .dz-remove {
    display: none !important;
}

.pc-video-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.pc-video-actions .btn {
    min-height: 36px;
}

/* Visor modal de video: ocupa la pantalla, botón Cerrar visible a la derecha */
.pc-vm-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2000;
    background: rgba(2, 6, 23, 0.88);
    align-items: center;
    justify-content: center;
    padding: 12px;
}

.pc-vm-overlay.is-open {
    display: flex;
}

.pc-vm-panel {
    width: 100%;
    max-width: 960px;
    max-height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #0f172a;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.pc-vm-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-bottom: 1px solid #1e293b;
    color: #ffffff;
}

.pc-vm-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.pc-vm-close {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0.4rem 0.9rem;
    border: 0;
    border-radius: 6px;
    background: #ffffff;
    color: #0f172a;
    font-size: 1rem;
    font-weight: 700;
}

.pc-vm-close:focus {
    outline: 3px solid #38bdf8;
}

.pc-vm-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.pc-vm-body video {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100vh - 110px);
    background: #000000;
}

body.pc-vm-lock {
    overflow: hidden;
}

/* Videos: el nombre y los botones quedan visibles debajo del reproductor (Dropzone los dejaba flotando sobre el video) */
.dropzone .dz-preview.pc-video-preview .dz-details {
    position: static !important;
    opacity: 1 !important;
    background: transparent !important;
    padding: 0.5rem 0.25rem 0;
    text-align: center;
    width: 100% !important;
}

.dropzone .dz-preview.pc-video-preview .dz-size {
    display: none;
}

.dropzone .dz-preview.pc-video-preview .dz-filename,
.dropzone .dz-preview.pc-video-preview .dz-filename a {
    color: #1e293b !important;
    font-weight: 600;
    word-break: break-all;
}

/* Botones Ampliar / Eliminar video: icono y texto en una línea, tamaño normal */
.dropzone .pc-video-actions .btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.9rem;
    line-height: 1.2;
    padding: 0.35rem 0.75rem;
    box-shadow: none;
}

.dropzone .pc-video-actions .btn .fa {
    font-size: 0.95rem;
    line-height: 1;
    color: inherit;
}

/* Listados en celular: tarjetas más legibles, etiquetas y valores alineados, botones de acción táctiles */
@media (max-width: 767.98px) {
    table.table-listing tbody {
        gap: 0.85rem;
    }

    table.table-listing tr {
        padding: 0.7rem 0.9rem;
        border-color: #dbe3ee;
        border-radius: 10px;
        box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
    }

    table.table-listing td {
        padding: 0.5rem 0 !important;
        font-size: 0.95rem;
        line-height: 1.35;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    table.table-listing td:last-child {
        border-bottom: 0 !important;
    }

    table.table-listing td::before {
        flex: 0 0 46%;
        max-width: 46%;
        font-size: 0.68rem;
        line-height: 1.25;
        color: #64748b;
    }

    /* Primera fila de cada tarjeta: el identificador (VIN / vehículo) destacado */
    table.table-listing td:first-child {
        font-weight: 700;
        color: #1e293b;
    }

    /* Botones de acción: tamaño táctil, todos iguales, alineados a la derecha */
    table.table-listing td[data-label=""] {
        padding-top: 0.75rem !important;
        gap: 0.5rem;
    }

    table.table-listing td[data-label=""] .btn {
        min-width: 46px;
        min-height: 40px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 0;
    }

    /* Barra de búsqueda y selector de cantidad: alto cómodo para el dedo */
    .main .card-body input.form-control,
    .main .card-body select.form-control {
        min-height: 42px;
    }
}

/* ===== Dashboard moderno y minimalista (.pc-dash) ===== */
.pc-dash {
    max-width: 1200px;
    margin: 0 auto;
    color: #0f172a;
}

.pc-dash-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0.25rem 0 1.25rem;
}

.pc-dash-eyebrow {
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}

.pc-dash-title {
    margin: 0;
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0f172a;
}

.pc-dash-date {
    font-size: 0.9rem;
    color: #64748b;
}

/* Indicadores */
.pc-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.pc-kpi {
    --kpi-bg: #e0f2fe;
    --kpi-fg: #0369a1;
    --kpi-tint: #7dd3fc;
    position: relative;
    overflow: hidden;
    padding: 1.1rem 1.25rem 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -16px rgba(15, 23, 42, 0.18);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pc-kpi::after {
    content: "";
    position: absolute;
    right: -48px;
    bottom: -64px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--kpi-tint) 0%, transparent 70%);
    opacity: 0.45;
    pointer-events: none;
}

.pc-kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 16px 34px -18px rgba(15, 23, 42, 0.25);
}

.pc-kpi--user {
    --kpi-bg: #ede9fe;
    --kpi-fg: #6d28d9;
    --kpi-tint: #c4b5fd;
}

.pc-kpi--client {
    --kpi-bg: #dcfce7;
    --kpi-fg: #15803d;
    --kpi-tint: #86efac;
}

.pc-kpi-top {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.pc-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: var(--kpi-bg);
    color: var(--kpi-fg);
    font-size: 1rem;
}

.pc-kpi-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #334155;
}

.pc-kpi-value {
    margin: 0.85rem 0 0.6rem;
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

.pc-kpi-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.pc-pill {
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Paneles con listados */
.pc-panel {
    margin-bottom: 1.25rem;
    padding: 1rem 1.25rem 0.5rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -16px rgba(15, 23, 42, 0.14);
}

.pc-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.pc-panel-head h2 {
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
}

.pc-panel-head a {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.pc-panel-head a:hover {
    text-decoration: underline;
}

.pc-table {
    margin-bottom: 0.25rem;
    border-collapse: separate;
    border-spacing: 0;
}

.pc-table thead th {
    padding: 0.6rem 0.5rem;
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.pc-table tbody td {
    padding: 0.7rem 0.5rem;
    border: 0;
    border-top: 1px solid #f1f5f9;
    font-size: 0.92rem;
    vertical-align: middle;
    color: #1e293b;
}

.pc-table tbody tr:hover td {
    background: #f8fafc;
}

.pc-id {
    display: inline-block;
    padding: 0.12rem 0.5rem;
    border-radius: 6px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
}

.pc-id:hover {
    background: #dbeafe;
    text-decoration: none;
}

.pc-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: #fee2e2;
    color: #b91c1c;
    font-weight: 700;
    font-size: 0.82rem;
}

.pc-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.25rem 0;
    color: #64748b;
}

.pc-empty .fa {
    color: #16a34a;
}

/* Celular: indicadores más compactos y los listados como tarjetas (ya lo maneja table-listing) */
@media (max-width: 767.98px) {
    .pc-dash-title {
        font-size: 1.5rem;
    }

    .pc-kpis {
        gap: 0.75rem;
    }

    .pc-kpi {
        padding: 0.9rem 1rem;
        border-radius: 16px;
    }

    .pc-kpi-value {
        font-size: 2.4rem;
        margin: 0.6rem 0 0.45rem;
    }

    .pc-panel {
        padding: 0.85rem 0.9rem 0.4rem;
        border-radius: 16px;
    }

    .pc-panel-head h2 {
        font-size: 0.98rem;
    }
}

/* Dashboard en celular: los tres indicadores en una franja compacta, una al lado de la otra */
@media (max-width: 767.98px) {
    .pc-kpis {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .pc-kpi {
        padding: 0.7rem 0.6rem 0.6rem;
        border-radius: 14px;
    }

    .pc-kpi::after {
        width: 110px;
        height: 110px;
        right: -40px;
        bottom: -50px;
    }

    .pc-kpi-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.4rem;
    }

    .pc-kpi-icon {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        font-size: 0.85rem;
    }

    .pc-kpi-label {
        font-size: 0.72rem;
        line-height: 1.2;
    }

    .pc-kpi-value {
        margin: 0.5rem 0 0.4rem;
        font-size: 1.9rem;
    }

    .pc-kpi-foot {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
        font-size: 0.7rem;
    }

    .pc-kpi-foot > span:first-child {
        display: none;
    }

    .pc-pill {
        padding: 0.12rem 0.4rem;
        font-size: 0.66rem;
        white-space: normal;
    }
}

/* ===== Listados con estilo moderno (.pc-listing), mismo lenguaje que el dashboard ===== */
.pc-listing {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -16px rgba(15, 23, 42, 0.14);
}

.pc-listing > .card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
}

.pc-listing > .card-header .fa {
    color: #2563eb;
}

.pc-listing > .card-header .btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.4rem 0.85rem;
    box-shadow: none;
}

.pc-listing > .card-header .pull-right {
    float: none !important;
    margin-left: auto;
}

.pc-listing > .card-body {
    padding: 1rem 1.25rem 1.25rem;
}

/* Buscador y selector de cantidad */
.pc-listing .input-group .form-control,
.pc-listing select.form-control {
    min-height: 44px;
    border-color: #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.pc-listing .input-group .form-control {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.pc-listing .input-group-append .btn {
    min-height: 44px;
    border-radius: 0 12px 12px 0;
    padding: 0 1.1rem;
    font-weight: 600;
    box-shadow: none;
}

.pc-listing .form-group {
    margin-bottom: 0.75rem;
}

/* Tabla: encabezados discretos y filas con hover suave */
.pc-listing table.table-listing thead th {
    border: 0;
    border-bottom: 1px solid #e2e8f0;
    background: transparent;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0.65rem 0.6rem;
}

.pc-listing table.table-listing tbody td {
    border: 0;
    border-top: 1px solid #f1f5f9;
    padding: 0.75rem 0.6rem;
    font-size: 0.92rem;
    color: #1e293b;
    vertical-align: middle;
}

.pc-listing table.table-listing tbody tr:hover td {
    background: #f8fafc;
}

.pc-listing table.table-listing tbody td a {
    color: #1d4ed8;
    font-weight: 600;
    text-decoration: none;
}

.pc-listing table.table-listing tbody td a:hover {
    text-decoration: underline;
}

/* Acciones: botones redondeados de color suave */
.pc-listing table.table-listing .btn-sm {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 0;
    box-shadow: none;
}

.pc-listing table.table-listing .btn-info {
    background: #eff6ff;
    color: #1d4ed8;
}

.pc-listing table.table-listing .btn-info:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.pc-listing table.table-listing .btn-danger {
    background: #fef2f2;
    color: #b91c1c;
}

.pc-listing table.table-listing .btn-danger:hover {
    background: #b91c1c;
    color: #ffffff;
}

/* Paginación y mensajes */
.pc-listing .pagination-caption {
    font-size: 0.85rem;
    color: #64748b;
}

.pc-listing .pagination .page-link {
    border-radius: 10px;
    margin: 0 2px;
    border-color: #e2e8f0;
    color: #334155;
}

.pc-listing .pagination .page-item.active .page-link {
    background: #2563eb;
    border-color: #2563eb;
}

/* Celular: tarjetas más compactas dentro del contenedor */
@media (max-width: 767.98px) {
    .pc-listing {
        border-radius: 16px;
    }

    .pc-listing > .card-header {
        padding: 0.85rem 0.9rem;
    }

    .pc-listing > .card-body {
        padding: 0.85rem 0.8rem 1rem;
    }

    .pc-listing table.table-listing tr {
        border-color: #e2e8f0;
        border-radius: 14px;
    }
}

/* Acciones del listado: edición y eliminación en una sola fila y con colores legibles */
.pc-listing table.table-listing td .row.no-gutters {
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
}

.pc-listing table.table-listing td .row.no-gutters > .col-auto,
.pc-listing table.table-listing td .row.no-gutters > form.col {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
    padding: 0;
}

.pc-listing table.table-listing .btn-info,
.pc-listing table.table-listing .btn-info .fa {
    color: #1d4ed8 !important;
}

.pc-listing table.table-listing .btn-danger,
.pc-listing table.table-listing .btn-danger .fa {
    color: #b91c1c !important;
}

.pc-listing table.table-listing .btn-info:hover,
.pc-listing table.table-listing .btn-info:hover .fa {
    color: #ffffff !important;
}

.pc-listing table.table-listing .btn-danger:hover,
.pc-listing table.table-listing .btn-danger:hover .fa {
    color: #ffffff !important;
}

.pc-listing table.table-listing .btn .fa {
    font-size: 0.9rem;
    line-height: 1;
}

/* ===== Detalle de manifiesto (.pc-show) ===== */
.pc-show {
    max-width: 1200px;
    margin: 0 auto;
    color: #0f172a;
}

.pc-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.25rem 0 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2563eb;
    text-decoration: none;
}

.pc-back:hover {
    text-decoration: underline;
}

.pc-show-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.pc-pill--lg {
    padding: 0.4rem 0.9rem;
    font-size: 0.9rem;
}

/* Fechas: tres tarjetas con acento de color */
.pc-dates {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.pc-date {
    --accent: #64748b;
    position: relative;
    padding: 0.9rem 1.1rem 0.9rem 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 22px -16px rgba(15, 23, 42, 0.16);
    overflow: hidden;
}

.pc-date::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 4px;
    background: var(--accent);
}

.pc-date--expected {
    --accent: #e11d48;
}

.pc-date--actual {
    --accent: #0284c7;
}

.pc-date--reg {
    --accent: #16a34a;
}

.pc-date span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.pc-date strong {
    display: block;
    margin-top: 0.3rem;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
    color: #0f172a;
}

/* Datos generales en cuadrícula */
.pc-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.pc-info-item {
    padding: 0.85rem 1.1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
}

.pc-info-item span {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #64748b;
}

.pc-info-item strong {
    display: block;
    margin-top: 0.25rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

/* Botones de exportación */
.pc-export {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pc-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.pc-btn--green {
    background: #16a34a;
    color: #ffffff;
}

.pc-btn--green:hover {
    background: #15803d;
    color: #ffffff;
    text-decoration: none;
}

.pc-btn--green-soft {
    background: #dcfce7;
    color: #166534;
}

.pc-btn--green-soft:hover {
    background: #bbf7d0;
    color: #166534;
    text-decoration: none;
}

.pc-panel-head--wrap {
    align-items: center;
}

/* Estado y acciones de cada vehículo */
.pc-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
}

.pc-badge--ok {
    background: #dcfce7;
    color: #166534;
}

.pc-badge--ok:hover {
    background: #bbf7d0;
    color: #166534;
    text-decoration: none;
}

.pc-row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 0.4rem;
}

.pc-row-actions form {
    margin: 0;
}

.pc-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
}

.pc-icon-btn--edit {
    background: #eff6ff;
    color: #1d4ed8;
}

.pc-icon-btn--edit:hover {
    background: #1d4ed8;
    color: #ffffff;
    text-decoration: none;
}

.pc-icon-btn--delete {
    background: #fef2f2;
    color: #b91c1c;
}

.pc-icon-btn--delete:hover {
    background: #b91c1c;
    color: #ffffff;
}

@media (max-width: 767.98px) {
    .pc-date {
        padding: 0.75rem 0.9rem 0.75rem 1.1rem;
        border-radius: 14px;
    }

    .pc-date strong {
        font-size: 1.15rem;
    }

    .pc-info-item {
        padding: 0.75rem 0.9rem;
        border-radius: 14px;
    }

    .pc-export .pc-btn {
        flex: 1 1 100%;
        justify-content: center;
        white-space: normal;
    }
}

/* Botones de exportación: el color del texto no se pierde frente a los enlaces del panel */
.pc-show .pc-btn--green,
.pc-show .pc-btn--green:hover,
.pc-show .pc-btn--green .fa {
    color: #ffffff !important;
}

.pc-show .pc-btn--green-soft,
.pc-show .pc-btn--green-soft:hover,
.pc-show .pc-btn--green-soft .fa {
    color: #166534 !important;
}

/* ===== Formulario de siniestro (.pc-form, .pc-media-card) ===== */
.pc-form {
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 10px 28px -16px rgba(15, 23, 42, 0.14);
}

.pc-form > .card-header {
    padding: 1rem 1.25rem;
    background: #ffffff;
    border-bottom: 1px solid #f1f5f9;
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
}

.pc-form > .card-header .fa {
    color: #2563eb;
}

.pc-form > .card-body {
    padding: 1.25rem;
}

/* Tarjetas de foto y video */
.pc-media-card {
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 22px -16px rgba(15, 23, 42, 0.16) !important;
    background: #ffffff;
}

.pc-media-card > .card-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
    padding: 0.85rem 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.98rem;
    font-weight: 700;
    color: #0f172a;
}

.pc-media-card > .card-header .fa {
    color: #2563eb;
}

.pc-media-card > .card-header small {
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.72rem;
    font-weight: 600;
}

.pc-media-card > .card-header .fa-lock {
    color: #64748b;
}

.pc-media-card .dropzone {
    border-radius: 14px;
}

.pc-media-card .btn-outline-primary {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.45rem 0.9rem;
}

.pc-media-card .btn-outline-primary:hover {
    color: #ffffff;
}

/* Pie del formulario */
.pc-form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid #e2e8f0;
}

.pc-form-footer .btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 0.5rem 1.1rem;
    box-shadow: none;
}

.pc-form-footer .btn-primary {
    background: #2563eb;
    border-color: #2563eb;
}

.pc-form-footer .btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

@media (max-width: 767.98px) {
    .pc-form > .card-body {
        padding: 0.9rem;
    }

    .pc-form-footer {
        padding: 0.8rem 0.9rem;
    }

    .pc-form-footer .btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

/* Foto y video no se estiran a la misma altura: cada tarjeta ocupa lo que necesita */
.pc-form .pc-media-card.h-100 {
    height: auto !important;
}

/* Fotos: la miniatura indica que se puede ampliar; el visor muestra la imagen completa */
.dropzone .dz-preview:not(.pc-video-preview) .dz-image img {
    cursor: zoom-in;
}

.pc-vm-img {
    display: none;
    max-width: 100%;
    max-height: calc(100vh - 110px);
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

.pc-vm-overlay.is-image .pc-vm-body video {
    display: none;
}

.pc-vm-overlay.is-image .pc-vm-img {
    display: block;
}

/* Fotos: la capa de detalles de Dropzone no tapa la miniatura; solo el nombre del archivo sigue siendo clicable */
.dropzone .dz-preview:not(.pc-video-preview) .dz-details {
    pointer-events: none;
}

.dropzone .dz-preview:not(.pc-video-preview) .dz-details .dz-filename a {
    pointer-events: auto;
}

/* Peso del video junto al nombre en la tarjeta */
.pc-size { color: #64748b; font-weight: 500; white-space: nowrap; }

/* Legibilidad en celular: texto +1 pt, botones +2 pt (1 pt = 1,333 px) */
@media (max-width: 767.98px) {
    body { font-size: calc(0.875rem + 1.33px) !important; }
    .form-control, .custom-select { font-size: calc(1rem + 1.33px) !important; }
    .btn { font-size: calc(1rem + 2.67px) !important; }
    .btn-sm { font-size: calc(0.875rem + 2.67px) !important; }
}
