/* Pick up: páginas del panel de administrador (Configuración, Carga de datos y Estadísticas).
   Rediseño verde: tarjeta con banner, columnas y tiles. Los colores son los del diseño y no
   siguen el color de la sucursal. Todo cuelga de .pk-page para no tocar el resto del panel. */

.pk-page {
    --pk-verde: #43A047;
    --pk-verde-osc: #2E7D32;
    --pk-verde-claro: #A5D6A7;
    --pk-verde-tenue: #E3F1E4;
    --pk-tinta: #1C1C1C;
    --pk-gris: #656565;
    --pk-linea: #D9D9D9;
    /* el datepicker y los gráficos leen --admin-color: dentro de pick up es el verde */
    --admin-color: #43A047;
    --admin-color-dark: #2E7D32;

    box-sizing: border-box;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 24px 20px 48px;
    color: var(--pk-tinta);
}

.pk-page *,
.pk-page *::before,
.pk-page *::after {
    box-sizing: border-box;
}

.pk-wrap {
    position: relative;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

/* ---------- Tarjeta con banner ---------- */

.pk-panel {
    background: #fff;
    border: 1.5px solid var(--pk-verde);
    border-radius: 24px;
    padding-bottom: 24px;
}

.pk-panel__titulo {
    margin: 0;
    padding: 14px 16px;
    border-radius: 22px 22px 0 0;
    background: var(--pk-verde);
    color: #fff;
    text-align: center;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.pk-barra {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    padding: 10px 14px 0;
    font-size: 13px;
    font-weight: 600;
}

.pk-barra:empty {
    display: none;
}

.pk-sucursal {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.pk-sucursal select {
    min-width: 110px;
    padding: 4px 8px;
    border: 1.5px solid var(--pk-tinta);
    border-radius: 8px;
    background: #fff;
    color: var(--pk-tinta);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
}

.pk-aviso {
    margin: 18px 28px 0;
    font-size: 15px;
    line-height: 1.4;
}

.pk-seccion-titulo {
    margin: 4px 0 8px;
    text-align: center;
    font-size: 22px;
    font-weight: 300;
    color: var(--pk-gris);
    line-height: 1.2;
}

.pk-seccion-titulo--chico {
    font-size: 18px;
    margin-top: 20px;
}

/* ---------- Columnas ---------- */

.pk-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    padding: 8px 0 0;
}

.pk-col {
    min-width: 0;
    padding: 16px 28px;
}

.pk-col + .pk-col {
    border-left: 1.5px solid var(--pk-verde);
}

/* Configuración: cada columna scrollea sola, como en el diseño */
.pk-cols--config .pk-col {
    height: 470px;
    overflow-y: auto;
}

.pk-cols--config .pk-seccion-titulo {
    margin-bottom: 20px;
}

.pk-col--flex {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ---------- Opciones de configuración ---------- */

.pk-opcion {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 16px 0;
}

.pk-opcion--primera {
    padding-top: 0;
}

.pk-opcion + .pk-opcion {
    border-top: 1px solid var(--pk-linea);
}

.pk-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.pk-check input {
    -webkit-appearance: none;
    appearance: none;
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 1.5px solid var(--pk-verde);
    border-radius: 6px;
    background: #fff center / 14px no-repeat;
    cursor: pointer;
    transition: background-color 0.15s;
}

.pk-check input:checked {
    background-color: var(--pk-verde);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E");
}

.pk-check input:focus-visible,
.pk-campo input:focus-visible,
.pk-campo select:focus-visible,
.pk-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.28);
}

/* Opción que se ve pero no se toca acá (turno sin ticket sin display separado) */
.pk-check--bloqueado {
    cursor: not-allowed;
    opacity: 0.6;
}

.pk-check--bloqueado input {
    cursor: not-allowed;
}

.pk-ayuda {
    margin: 0 0 0 32px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--pk-gris);
    text-wrap: pretty;
}

.pk-ayuda strong {
    color: var(--pk-tinta);
}

.pk-ayuda--sin-sangria,
.pk-col--flex > .pk-ayuda {
    margin-left: 0;
}

.pk-ayuda--error {
    color: #FF2D2D;
    font-weight: 600;
}

.pk-link {
    color: var(--pk-verde);
    font-weight: 600;
}

.pk-link:hover {
    color: var(--pk-verde-osc);
}

/* Campos (select, input) */
.pk-campo {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-left: 32px;
}

.pk-campo--fila {
    flex-direction: row;
    align-items: center;
    gap: 12px;
    margin-left: 0;
}

.pk-campo label {
    font-size: 14px;
}

.pk-campo--fila label {
    font-size: 16px;
    font-weight: 600;
}

.pk-campo select,
.pk-campo input {
    height: 40px;
    max-width: 340px;
    padding: 0 12px;
    border: 1.5px solid var(--pk-verde);
    border-radius: 8px;
    background: #fff;
    color: var(--pk-tinta);
    font-family: inherit;
    font-size: 15px;
}

.pk-campo input[name="letra"] {
    width: 44px;
    padding: 0;
    text-align: center;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--pk-verde);
}

.pk-campo input[name="letra"].pk-invalido {
    border-color: #FF2D2D;
    color: #FF2D2D;
}

/* Link + Copiar */
.pk-url {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 32px;
    padding: 8px 12px;
    border: 1.5px solid var(--pk-verde);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    word-break: break-all;
}

.pk-url a {
    flex: 1;
    min-width: 0;
    color: inherit;
    text-decoration: none;
}

.pk-url a:hover {
    text-decoration: underline;
}

.pk-copiar {
    flex: none;
    padding: 0;
    border: none;
    background: none;
    color: var(--pk-verde);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.pk-copiar:hover {
    color: var(--pk-verde-osc);
}

.pk-totem-url {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-left: 32px;
}

.pk-totem-url .pk-url {
    margin-left: 0;
}

.pk-totem-url__fila {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 16px;
}

.pk-totem-url__qr {
    width: 132px;
    height: 132px;
    padding: 12px;
    border: 1px solid var(--pk-linea);
    border-radius: 16px;
    background: #fff;
}

.pk-totem-url__qr svg {
    display: block;
    width: 100%;
    height: 100%;
}

.pk-advertencia {
    margin-top: 16px;
    padding: 10px 14px;
    border: 1px solid #FFA600;
    border-radius: 12px;
    background: #FFF4E0;
    color: var(--pk-tinta);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
}

.pk-advertencia--suelta {
    margin: 18px 28px 0;
}

/* ---------- Botones ---------- */

.pk-btn {
    padding: 12px 44px;
    border: none;
    border-radius: 999px;
    background: var(--pk-verde);
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s, transform 0.1s;
}

.pk-btn:hover {
    filter: brightness(0.94);
}

.pk-btn:active {
    transform: scale(0.98);
}

.pk-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.pk-btn--chico {
    padding: 9px 26px;
    font-size: 14px;
}

.pk-btn--texto {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 0 4px;
    background: none;
    color: var(--pk-verde);
    font-size: 14px;
    font-weight: 600;
}

.pk-btn--texto:hover {
    background: none;
    color: var(--pk-verde-osc);
}

/* Guardar: flota sobre el borde inferior de la tarjeta */
.pk-acciones {
    position: absolute;
    left: 50%;
    bottom: -20px;
    transform: translateX(-50%);
}

.pk-acciones .pk-btn {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.pk-acciones--en-linea {
    position: static;
    transform: none;
    margin-top: 16px;
    text-align: center;
}

/* ---------- Tiles de resumen ---------- */

.pk-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
}

.pk-resumen--carga {
    padding: 18px 28px 0;
}

.pk-resumen-item {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px;
    border: 1.5px solid var(--pk-verde-claro);
    border-radius: 12px;
    font-size: 12px;
    line-height: 1.2;
    color: var(--pk-gris);
}

.pk-resumen-item span {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    color: var(--pk-verde);
}

.pk-resumen-item small {
    font-size: 11px;
}

.pk-resumen--chico .pk-resumen-item span {
    font-size: 22px;
}

/* ---------- Carga de datos ---------- */

.pk-drop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 22px 16px;
    border: 1.5px dashed var(--pk-verde);
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.15s;
}

.pk-drop:hover,
.pk-drop--arrastrando {
    background: #F1F8F1;
}

.pk-drop svg {
    flex: none;
}

.pk-drop__nombre {
    font-size: 15px;
    font-weight: 600;
    word-break: break-all;
}

.pk-drop__boton {
    padding: 9px 26px;
    border-radius: 999px;
    background: var(--pk-verde);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.pk-drop input[type="file"] {
    display: none;
}

.pk-nota {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--pk-verde-claro);
    font-size: 13px;
    line-height: 1.4;
    color: var(--pk-gris);
}

.pk-nota strong {
    color: var(--pk-tinta);
}

.pk-vacio {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    padding: 16px;
    border: 1px solid var(--pk-linea);
    border-radius: 16px;
    font-size: 13px;
    color: var(--pk-gris);
    text-align: center;
}

.pk-cargas {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pk-carga {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--pk-linea);
    border-radius: 12px;
}

.pk-carga svg {
    flex: none;
}

.pk-carga__datos {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.pk-carga__nombre {
    font-size: 14px;
    font-weight: 600;
    word-break: break-all;
}

.pk-carga__detalle {
    font-size: 12px;
    color: var(--pk-gris);
}

.pk-carga__hora {
    flex: none;
    font-size: 12px;
    color: var(--pk-gris);
    text-align: right;
}

/* ---------- Conexión con la tienda online ---------- */

.pk-conexiones {
    padding: 8px 28px 0;
}

.pk-conexiones__intro {
    max-width: 640px;
    margin: 0 auto 14px;
    text-align: center;
}

.pk-conexiones__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 14px;
}

.pk-conexion {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    padding: 14px 16px;
    border: 1.5px solid var(--pk-linea);
    border-radius: 16px;
}

.pk-conexion--ok {
    border-color: var(--pk-verde);
}

.pk-conexion--error {
    border-color: #FFA600;
}

.pk-conexion--reconectar {
    border-color: #FF2D2D;
}

.pk-conexion__cab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.pk-conexion__nombre {
    font-size: 17px;
}

.pk-chip {
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--pk-verde-tenue);
    color: var(--pk-verde-osc);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.pk-chip--error {
    background: #FFF4E0;
    color: #8A5300;
}

.pk-chip--reconectar {
    background: #FFE5E5;
    color: #C40000;
}

.pk-conexion__datos {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
    color: var(--pk-gris);
    overflow-wrap: anywhere;
}

.pk-conexion__error {
    color: #C40000;
    font-weight: 600;
}

.pk-conexion__acciones,
.pk-conexion__botones {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

.pk-conexion .pk-btn--chico {
    padding: 8px 18px;
}

.pk-conexion .pk-btn--texto {
    padding: 0;
}

.pk-btn--peligro {
    color: #C40000;
}

.pk-btn--peligro:hover {
    color: #8E0000;
}

.pk-conexion__form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px dashed var(--pk-verde-claro);
}

.pk-conexion__form.hide {
    display: none;
}

.pk-conexion .pk-campo {
    margin-left: 0;
}

.pk-conexion .pk-campo input,
.pk-conexion .pk-campo select {
    max-width: none;
    width: 100%;
    box-sizing: border-box;
}

.pk-conexion .pk-check {
    font-size: 14px;
}

/* Subir un archivo: último recurso, plegable */
.pk-archivo__resumen {
    cursor: pointer;
    list-style: none;
    margin: 4px 0 8px;
    text-align: center;
    font-size: 18px;
    font-weight: 300;
    color: var(--pk-gris);
}

.pk-archivo__resumen::-webkit-details-marker {
    display: none;
}

.pk-archivo__resumen::before {
    content: '▸ ';
}

.pk-archivo[open] > .pk-archivo__resumen::before {
    content: '▾ ';
}

.pk-archivo__cuerpo {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Paso 2 (mapeo) y errores: debajo de las dos columnas */
.pk-paso {
    margin: 8px 28px 0;
    padding-top: 16px;
    border-top: 1.5px solid var(--pk-verde);
}

.pk-paso .pk-ayuda {
    margin-bottom: 10px;
}

.pk-tabla-scroll {
    overflow-x: auto;
}

.pk-tabla {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.pk-tabla th,
.pk-tabla td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--pk-linea);
    text-align: left;
    white-space: nowrap;
}

.pk-tabla th {
    font-weight: 700;
    background: #F1F8F1;
}

.pk-tabla select {
    height: 34px;
    padding: 0 8px;
    border: 1.5px solid var(--pk-verde);
    border-radius: 8px;
    background: #fff;
    font-family: inherit;
    font-size: 13px;
}

.pk-tabla--mapeo td:first-child {
    font-weight: 600;
}

.pk-ejemplo {
    max-width: 22rem;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--pk-gris);
}

/* ---------- Estadísticas ---------- */

.pk-stats {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 18px 28px 32px;
}

.pk-barra--stats {
    padding: 14px 32px 0;
}

.pk-stats-mensaje {
    padding: 10px 14px;
    border: 1px solid #FFA600;
    border-radius: 12px;
    background: #FFF4E0;
    color: var(--pk-tinta);
    font-size: 13px;
    font-weight: 600;
}

.pk-stats-resumenes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pk-stats-resumenes .pk-resumen:last-child {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.pk-stats-nota {
    margin: 0;
    font-size: 12px;
    color: var(--pk-gris);
}

.pk-stats-nota b {
    color: var(--pk-tinta);
}

.pk-stats-nota--limites {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 0;
    padding-top: 14px;
    border-top: 1px solid var(--pk-linea);
    font-size: 13px;
    line-height: 1.4;
}

.pk-stats-nota--limites p {
    margin: 0;
}

/* El panel de estadísticas de turnos trae su propio scroll y alto: acá la página ya scrollea */
.pk-page .stats-page {
    display: block;
    overflow: visible;
    min-height: 0;
}

.pk-page .stats-dashboard {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 24px 32px 36px;
    overflow: visible;
}

.pk-page .stats-dashboard__toolbar {
    justify-content: flex-start;
}

.pk-page .stats-filter {
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.pk-page .stats-filter label {
    font-weight: 600;
}

.pk-page .turnos-date-picker {
    width: 140px;
}

.pk-page .turnos-date-picker__trigger {
    min-height: 0;
    padding: 4px 28px 4px 8px;
    border: 1.5px solid var(--pk-verde);
    border-radius: 8px;
    background-color: #fff;
    font-size: 13px;
    font-weight: 600;
}

/* Mapas de calor (Retiros por hora / Tiempos por hora) */
.pk-page .stats-charts-row {
    padding-right: 0;
    gap: 14px;
}

.pk-page .stats-charts-row--heatmaps {
    gap: 28px;
    margin-top: 8px;
}

.pk-page .stats-heatmap-block {
    --stats-heatmap-line: var(--pk-verde-tenue);
    gap: 10px;
}

.pk-page .stats-heatmap-block__header {
    margin-bottom: 0;
}

.pk-page .stats-heatmap-block__title {
    font-size: 22px;
    font-weight: 300;
    color: var(--pk-gris);
}

.pk-page .stats-heatmap-table-wrap {
    border: 1.5px solid var(--pk-verde);
    border-radius: 16px;
}

.pk-page .stats-heatmap-table {
    font-family: inherit;
}

.pk-page .stats-heatmap-table th,
.pk-page .stats-heatmap-table td {
    border-color: #fff;
    font-size: 12px;
}

.pk-page .stats-heatmap-table thead th {
    border-bottom: 1px solid var(--pk-verde-claro);
    border-right-color: var(--pk-verde-tenue);
}

.pk-page .stats-heatmap-table th.stats-heatmap-table__hour {
    height: auto;
    padding: 10px 4px;
    font-size: 12px;
    font-weight: 700;
    color: var(--pk-tinta);
}

.pk-page .stats-heatmap-table__sector {
    padding: 10px 14px;
    text-align: left;
    font-size: 14px;
    font-weight: 700;
    color: var(--pk-tinta);
}

.pk-page .stats-heatmap-table__cell,
.pk-page .stats-heatmap-table--compact .stats-heatmap-table__cell {
    height: 38px;
    font-size: 12px;
    color: var(--pk-gris);
}

.pk-page .stats-heatmap-table th.stats-heatmap-table__total,
.pk-page .stats-heatmap-table td.stats-heatmap-table__total {
    background: #F1F8F1;
    border-left-color: var(--pk-verde-tenue);
    color: var(--pk-tinta);
}

.pk-page .stats-heatmap-legend--inline {
    margin-top: 0;
}

.pk-page .stats-heatmap-legend--inline .stats-heatmap-legend__label {
    font-size: 12px;
    font-weight: 600;
    color: var(--pk-gris);
}

/* Separadores "Por puesto" / "Tiempo total en la sucursal" */
.pk-page .stats-section-divider {
    gap: 16px;
    margin: 16px 0 0;
    font-size: 22px;
    font-weight: 300;
    color: var(--pk-gris);
}

.pk-page .stats-section-divider::before,
.pk-page .stats-section-divider::after {
    height: 0;
    background: none;
    border-top: 1px dashed var(--pk-verde);
}

/* Gráficos de barras en tarjetas */
.pk-page .stats-charts-row--bars {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.pk-page .stats-bar-block {
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid var(--pk-linea);
    border-radius: 16px;
}

.pk-page .stats-bar-block__title {
    margin: 0;
    padding: 0;
    font-size: 14px;
    font-weight: 700;
    color: var(--pk-verde);
}

.pk-page .stats-chart-host,
.pk-page .stats-chart-host--bar {
    min-height: 0;
}

.pk-page .stats-chart-host--bar {
    max-height: 60vh;
}

@media (max-width: 700px) {
    .pk-page {
        padding: 12px 10px 40px;
    }

    .pk-col,
    .pk-resumen--carga,
    .pk-page .stats-dashboard.pk-stats,
    .pk-barra--stats {
        padding-left: 16px;
        padding-right: 16px;
    }

    .pk-col + .pk-col {
        border-left: none;
        border-top: 1.5px solid var(--pk-verde);
    }

    .pk-cols--config .pk-col {
        height: auto;
        overflow: visible;
    }

    .pk-paso,
    .pk-aviso,
    .pk-advertencia--suelta {
        margin-left: 16px;
        margin-right: 16px;
    }
}
