/* ============================================================
   PANEL CUADRES — Estilos v1.2
   ============================================================ */

.pc-wrapper {
    width: 100%;
    max-width: 1200px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #1e293b;
}

.pc-header { margin-bottom: 20px; }

.pc-titulo {
    font-size: 22px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 4px 0;
}

/* ============================================================
   FILTROS
   ============================================================ */
.pc-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    margin-bottom: 20px;
}

.pc-filtro-grupo {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 160px;
}

.pc-filtro-grupo label {
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pc-filtros select,
.pc-filtros input[type="date"] {
    padding: 8px 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    color: #1e293b;
    outline: none;
}

.pc-filtros select:focus,
.pc-filtros input:focus {
    border-color: #6a943a;
    box-shadow: 0 0 0 2px rgba(106, 148, 58, 0.15);
}

.pc-filtro-accion { justify-content: flex-end; }
.pc-oculto { display: none; }

/* ============================================================
   BOTONES
   ============================================================ */
.pc-btn {
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
    white-space: nowrap;
}

.pc-btn:hover  { opacity: 0.88; }
.pc-btn:active { transform: scale(0.97); }

.pc-btn-primary   { background: #6a943a; color: white; }
.pc-btn-secondary { background: #e2e8f0; color: #1e293b; }

/* ============================================================
   TABS
   ============================================================ */
.pc-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    border-bottom: 2px solid #e2e8f0;
}

.pc-tab {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.15s;
}

.pc-tab:hover  { color: #6a943a; }
.pc-tab.active { color: #6a943a; border-bottom-color: #6a943a; }

/* ============================================================
   DASHBOARD GLOBAL
   ============================================================ */
.pc-dashboard {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.pc-dashboard-global { margin-bottom: 20px; }

.pc-box {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
    min-width: 130px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.pc-box span {
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
}

.pc-box strong {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.pc-box-cuadre {
    background: #f0fdf4;
    border-color: #86efac;
}

.pc-box-cuadre strong { color: #16a34a; }

.pc-box-negativo {
    background: #fff1f2 !important;
    border-color: #fecaca !important;
}

.pc-box-negativo strong { color: #dc2626 !important; }

/* ============================================================
   BLOQUES POR MENSAJERO (tab Domicilios)
   ============================================================ */
.pc-mensajero-bloque {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 24px;
    transition: box-shadow 0.2s;
}

.pc-mensajero-bloque:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
}

.pc-bloque-completado {
    border-color: #86efac;
    opacity: 0.9;
}

.pc-mensajero-bloque-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: #1e293b;
    color: white;
    gap: 12px;
    flex-wrap: wrap;
}

.pc-bloque-header-izq {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
}

.pc-bloque-header-der {
    display: flex;
    align-items: center;
}

.pc-badge-pedidos {
    background: rgba(255,255,255,0.15);
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 500;
}

/* Botón completar en cabecera */
.pc-btn-completar-header {
    background: #6a943a;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}

.pc-btn-completar-header:hover { opacity: 0.85; }

/* Badge cuando ya está completado */
.pc-completado-badge {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-size: 12px;
    font-weight: 600;
    color: #86efac;
    line-height: 1.4;
}

.pc-completado-admin {
    font-weight: 400;
    font-size: 11px;
    color: #94a3b8;
}

/* Dashboard interno del mensajero */
.pc-dashboard-mensajero {
    margin: 0;
    padding: 14px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 0;
    gap: 10px;
}

.pc-dashboard-mensajero .pc-box {
    border-color: #e2e8f0;
    padding: 10px 14px;
}

.pc-dashboard-mensajero .pc-box strong { font-size: 15px; }

/* ============================================================
   TABLA DE DOMICILIOS
   ============================================================ */
.pc-tabla-wrapper {
    overflow-x: auto;
}

.pc-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.pc-tabla thead { background: #f8fafc; }

.pc-tabla th {
    padding: 10px 12px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.pc-tabla td {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.pc-tabla tbody tr:last-child td { border-bottom: none; }
.pc-tabla tbody tr:hover { background: #f8fafc; }

/* ============================================================
   TARJETAS CUADRES (tab Cuadres)
   ============================================================ */
.pc-cuadre-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
}

.pc-card-completado {
    border-color: #86efac;
    opacity: 0.85;
}

.pc-cuadre-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.pc-mensajero-nombre {
    font-size: 16px;
    font-weight: 700;
}

.pc-estado-badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.pc-estado-pendiente  { background: #fef3c7; color: #92400e; }
.pc-estado-completado { background: #dcfce7; color: #15803d; }

.pc-cuadre-metricas {
    display: flex;
    flex-wrap: wrap;
    padding: 16px 18px;
    border-bottom: 1px solid #f1f5f9;
}

.pc-metrica {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 120px;
    flex: 1;
    padding: 8px 12px;
    border-right: 1px solid #f1f5f9;
}

.pc-metrica:last-child { border-right: none; }

.pc-metrica span {
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    font-weight: 500;
}

.pc-metrica strong {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.pc-metrica small {
    font-size: 10px;
    color: #94a3b8;
}

.pc-metrica-cuadre {
    background: #f8fafc;
    border-radius: 6px;
}

.pc-completado-info {
    display: flex;
    flex-direction: column;
    padding: 10px 18px;
    font-size: 12px;
    color: #16a34a;
    font-weight: 600;
    gap: 2px;
    background: #f0fdf4;
}

/* ============================================================
   ESTADOS
   ============================================================ */
.pc-positivo strong, .pc-positivo { color: #16a34a !important; }
.pc-negativo strong, .pc-negativo { color: #dc2626 !important; }

/* ============================================================
   VACÍO / LOADING
   ============================================================ */
.pc-vacio {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 15px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px dashed #e2e8f0;
}

.pc-loading {
    text-align: center;
    padding: 30px;
    color: #94a3b8;
}

/* ============================================================
   MODAL
   ============================================================ */
.pc-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.pc-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 900px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.pc-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.pc-modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; }

.pc-btn-cerrar {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #64748b;
    padding: 4px 8px;
    border-radius: 4px;
    line-height: 1;
}

.pc-btn-cerrar:hover { background: #f1f5f9; }

#pc-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
}

/* ============================================================
   TOAST
   ============================================================ */
#pc-toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pc-toast {
    padding: 12px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-width: 340px;
}

.pc-toast-success { background: #16a34a; }
.pc-toast-error   { background: #dc2626; }
.pc-toast-info    { background: #1e293b; }

/* ============================================================
   OVERLAY PROCESO
   ============================================================ */
#pc-overlay-proceso {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pc-overlay-box {
    background: white;
    border-radius: 12px;
    padding: 30px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    font-weight: 600;
    color: #1e293b;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.pc-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #6a943a;
    border-radius: 50%;
    animation: pc-spin 0.7s linear infinite;
}

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

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {

    .pc-filtros { flex-direction: column; }

    .pc-filtro-grupo { min-width: unset; width: 100%; }

    .pc-dashboard, .pc-dashboard-mensajero { flex-direction: column; }

    .pc-box { min-width: unset; }

    .pc-mensajero-bloque-header { flex-direction: column; align-items: flex-start; }

    .pc-bloque-header-der { width: 100%; }

    .pc-btn-completar-header { width: 100%; text-align: center; }

    .pc-cuadre-metricas { flex-direction: column; }

    .pc-metrica {
        border-right: none;
        border-bottom: 1px solid #f1f5f9;
    }

    .pc-metrica:last-child { border-bottom: none; }
}

.pc-link-evidencia.pc-transferencia{
    color:#2563eb;
    font-weight:600;
    text-decoration:underline;
    cursor:pointer;
}

.pc-link-evidencia.pc-transferencia:hover{
    color:#1d4ed8;
}

/* ============================================================
   ACORDEÓN DE CUADRES
   ============================================================ */
.pc-acordeon-container {
    border-top: 1px solid #e2e8f0;
}

.pc-acordeon {
    border-bottom: 1px solid #f1f5f9;
}

.pc-acordeon:last-child {
    border-bottom: none;
}

.pc-acordeon-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    cursor: pointer;
    background: #f8fafc;
    transition: background 0.15s;
    flex-wrap: wrap;
    gap: 8px;
}

.pc-acordeon-header:hover {
    background: #f1f5f9;
}

.pc-acordeon-abierto {
    background: #f1f5f9;
}

.pc-acordeon-titulo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.pc-acord-icono {
    font-size: 11px;
    color: #64748b;
    width: 14px;
    display: inline-block;
}

.pc-acordeon-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pc-cuadre-valor {
    font-size: 15px;
    font-weight: 700;
}

.pc-completado-admin-small {
    font-size: 11px;
    color: #94a3b8;
}

.pc-acordeon-body {
    padding: 0;
    border-top: 1px solid #e2e8f0;
}

.pc-dashboard-acord {
    border-radius: 0 !important;
    border-bottom: 1px solid #e2e8f0;
}
