/* =====================================================
   Cliente Pedidos Pro — estilos
   Diseño profesional, liviano, totalmente responsive
   ===================================================== */

/* Utility: ocultar elementos con máxima prioridad (gana sobre !important del display móvil) */
.cpp-hidden,
.cpp-hidden.cpp-aj-row,
.cpp-hidden.cpp-etq-row,
tr.cpp-hidden,
.cpp-aj-table tbody tr.cpp-hidden,
.cpp-etq-table tbody tr.cpp-hidden {
    display: none !important;
}

/* Inputs de nombre de producto: text-transform uppercase para feedback visual */
#cpp-aj-create-name,
#cpp-aj-rename-new {
    text-transform: uppercase;
}

.cpp-wrap {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: #0f172a;
    line-height: 1.5;
}

.cpp-wrap *,
.cpp-wrap *::before,
.cpp-wrap *::after { box-sizing: border-box; }

.cpp-title {
    text-align: center;
    margin: 12px 0 20px;
    font-weight: 700;
    font-size: clamp(18px, 2.4vw, 24px);
    color: #0c4a6e;
}

/* ============ Filtros ============ */
.cpp-filters {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(2, minmax(140px, 1fr)) auto;
    gap: 12px;
    align-items: end;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 14px;
    border-radius: 12px;
    margin-bottom: 12px;
}

.cpp-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.cpp-field label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.cpp-label-spacer { visibility: hidden; }

.cpp-field input[type="text"],
.cpp-field input[type="date"] {
    height: 42px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    font-size: 14px;
    outline: none;
    transition: box-shadow .15s, border-color .15s;
    width: 100%;
}
.cpp-field input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14,165,233,.18);
}

/* Buscador cliente con autocomplete */
.cpp-client-search {
    position: relative;
    display: flex;
    align-items: stretch;
}
.cpp-client-search input[type="text"] {
    padding-right: 36px; /* espacio para botón limpiar */
}
.cpp-client-clear {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 0;
    background: #e2e8f0;
    color: #475569;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    transition: background .15s;
}
.cpp-client-clear:hover { background: #cbd5e1; }

.cpp-suggest {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 12px 32px rgba(15,23,42,.12);
    display: none;
}
.cpp-suggest.show { display: block; }
.cpp-suggest-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f1f5f9;
    transition: background .12s;
}
.cpp-suggest-item:last-child { border-bottom: 0; }
.cpp-suggest-item:hover { background: #eff6ff; }
.cpp-suggest-empty {
    padding: 14px;
    color: #64748b;
    font-size: 13px;
    font-style: italic;
    text-align: center;
}

.cpp-client-selected {
    margin-top: 4px;
    font-size: 12px;
    color: #16a34a;
    min-height: 16px;
    font-weight: 500;
}

/* ============ Botones ============ */
.cpp-btn {
    height: 42px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s, transform .05s, box-shadow .15s;
    white-space: nowrap;
}
.cpp-btn:active { transform: translateY(1px); }
.cpp-btn:disabled { opacity: .5; cursor: not-allowed; }

.cpp-btn-primary {
    background: #0ea5e9;
    color: #fff;
    box-shadow: 0 2px 6px rgba(14,165,233,.3);
}
.cpp-btn-primary:hover:not(:disabled) { background: #0284c7; }

.cpp-btn-secondary {
    background: #fff;
    color: #0f172a;
    border-color: #cbd5e1;
}
.cpp-btn-secondary:hover:not(:disabled) { background: #f1f5f9; border-color: #94a3b8; }

.cpp-btn-ghost { background: #f1f5f9; color: #0f172a; }
.cpp-btn-ghost:hover:not(:disabled) { background: #e2e8f0; }

.cpp-btn-danger { background: #ef4444; color: #fff; }
.cpp-btn-danger:hover:not(:disabled) { background: #dc2626; }

.cpp-btn-success { background: #16a34a; color: #fff; }
.cpp-btn-success:hover:not(:disabled) { background: #15803d; }

.cpp-btn-sm { height: 32px; padding: 0 10px; font-size: 12px; }

/* ============ Export bar ============ */
.cpp-export-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.cpp-export-bar .cpp-btn { flex: 0 0 auto; }

/* ============ Resumen ============ */
.cpp-summary {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    border: 1px solid #67e8f9;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 12px;
    font-size: 14px;
}
.cpp-summary strong { color: #0c4a6e; }

/* ============ Mensaje ============ */
.cpp-message {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #9a3412;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 12px;
}
.cpp-message.cpp-error   { background:#fef2f2; border-color:#fecaca; color:#991b1b; }
.cpp-message.cpp-info    { background:#eff6ff; border-color:#bfdbfe; color:#1e3a8a; }
.cpp-message.cpp-success { background:#ecfdf5; border-color:#a7f3d0; color:#065f46; }

/* ============ Tabla principal ============ */
.cpp-table-wrap {
    overflow-x: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(15,23,42,.06);
}

.cpp-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}
.cpp-table th, .cpp-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 14px;
    font-size: 14px;
    text-align: left;
}
.cpp-table thead th {
    background: #0f172a;
    color: #fff;
    font-weight: 600;
    text-align: left;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.cpp-table tbody tr:hover { background: #f8fafc; }
.cpp-table tbody tr.cpp-row-pos { box-shadow: inset 3px 0 0 #f59e0b; }

.cpp-toggle-btn {
    width: 30px; height: 30px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
    color: #475569;
    transition: all .15s;
}
.cpp-toggle-btn:hover { border-color: #0ea5e9; color: #0ea5e9; }
.cpp-toggle-btn.open { background: #0ea5e9; color: #fff; border-color: #0ea5e9; }

/* Detalle expandido */
.cpp-table tr.cpp-detail-row td { background: #f9fafb; padding: 0; }
.cpp-detail-inner { padding: 16px; }
.cpp-detail-inner table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
    font-size: 13px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
}
.cpp-detail-inner th, .cpp-detail-inner td {
    border-bottom: 1px solid #e5e7eb;
    padding: 8px 12px;
    text-align: left;
}
.cpp-detail-inner th { background: #f1f5f9; font-weight: 600; font-size: 12px; }
.cpp-detail-inner td.right, .cpp-detail-inner th.right { text-align: right; }
.cpp-detail-inner td.num, .cpp-detail-inner th.num { font-variant-numeric: tabular-nums; }
.cpp-detail-inner .cpp-discount-cell { color: #b91c1c; font-weight: 600; font-size: 12px; }

.cpp-actions-cell {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.cpp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
    vertical-align: middle;
    white-space: nowrap;
}
.cpp-badge-pos { background: #fef3c7; color: #92400e; }
.cpp-badge-disc { background: #fee2e2; color: #991b1b; }

/* Strip de totales en detalle */
.cpp-totals-strip {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    margin-top: 12px;
    font-size: 13px;
    flex-wrap: wrap;
    padding: 10px 12px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}
.cpp-totals-strip .item { display: flex; gap: 6px; align-items: baseline; }
.cpp-totals-strip .item.discount { color: #b91c1c; }
.cpp-totals-strip .item.total strong { color: #16a34a; font-size: 16px; }
.cpp-totals-strip strong { color: #0f172a; font-weight: 700; }

/* ============ Modal de edición ============ */
.cpp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}
.cpp-modal {
    background: #fff;
    width: 100%;
    max-width: 880px;
    max-height: 92vh;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cpp-modal-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to right, #0c4a6e, #0e7490);
    color: #fff;
}
.cpp-modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.cpp-modal-close {
    background: transparent;
    border: 0;
    font-size: 22px;
    cursor: pointer;
    color: rgba(255,255,255,.85);
    line-height: 1;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background .15s;
}
.cpp-modal-close:hover { background: rgba(255,255,255,.15); }

.cpp-modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.cpp-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f8fafc;
}

.cpp-edit-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px 18px;
    font-size: 13px;
    background: #f1f5f9;
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    border-left: 4px solid #0ea5e9;
}
.cpp-edit-info .lbl { color: #64748b; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.cpp-edit-info .val { color: #0f172a; font-weight: 600; font-size: 13px; }

/* Tabla de edición */
.cpp-edit-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cpp-edit-table thead th {
    background: #f1f5f9;
    text-align: left;
    padding: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.cpp-edit-table tbody td {
    border-bottom: 1px solid #e5e7eb;
    padding: 8px;
    vertical-align: middle;
}
.cpp-edit-table td.right, .cpp-edit-table th.right { text-align: right; }
.cpp-edit-table input[type="number"] {
    width: 100px;
    padding: 6px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-align: right;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}
.cpp-edit-table input[type="number"]:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 2px rgba(14,165,233,.15);
}
.cpp-edit-table tr.removed { opacity: .4; }
.cpp-edit-table tr.removed input { text-decoration: line-through; }

/* Sección de descuentos en modal */
.cpp-discount-section {
    background: #fef3c7;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 14px;
}
.cpp-discount-section h4 {
    margin: 0 0 8px;
    font-size: 13px;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cpp-discount-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.cpp-discount-row label {
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
}
.cpp-discount-row input[type="number"] {
    width: 130px;
    padding: 6px 10px;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    text-align: right;
}
.cpp-discount-actions { display: flex; gap: 8px; }

/* Buscador de productos para agregar */
.cpp-add-product {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #cbd5e1;
}
.cpp-add-product > label {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
    display: block;
}
.cpp-product-search { position: relative; }
.cpp-product-search input[type="text"] {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
}
.cpp-product-search input[type="text"]:focus {
    outline: none;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14,165,233,.18);
}

/* ============ Loading overlay global ============ */
.cpp-loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}
.cpp-loading-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px 32px;
    box-shadow: 0 20px 50px rgba(0,0,0,.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 240px;
    max-width: 90vw;
}
.cpp-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #e0f2fe;
    border-top-color: #0ea5e9;
    border-radius: 50%;
    animation: cpp-spin 0.9s linear infinite;
}
@keyframes cpp-spin { to { transform: rotate(360deg); } }
.cpp-loading-text {
    font-size: 14px;
    color: #0f172a;
    font-weight: 500;
    text-align: center;
}

/* ============ Responsivo: tablet ============ */
@media (max-width: 900px) {
    .cpp-filters {
        grid-template-columns: 1fr 1fr;
    }
    .cpp-filters .cpp-field-client {
        grid-column: 1 / -1;
    }
    .cpp-filters .cpp-field-actions {
        grid-column: 1 / -1;
    }
    .cpp-filters .cpp-field-actions .cpp-btn {
        width: 100%;
    }
}

/* ============ Responsivo: móvil ============ */
@media (max-width: 600px) {
    .cpp-wrap { padding: 0 4px; }

    .cpp-filters {
        grid-template-columns: 1fr;
        padding: 12px;
        gap: 10px;
    }
    .cpp-label-spacer { display: none; }
    .cpp-field-actions { grid-column: 1 / -1; }
    .cpp-field-actions .cpp-btn { width: 100%; }

    .cpp-export-bar { flex-direction: column; }
    .cpp-export-bar .cpp-btn { width: 100%; }

    .cpp-summary { font-size: 13px; gap: 12px; }

    /* Tabla colapsa a cards en móvil */
    .cpp-table-wrap { overflow-x: visible; box-shadow: none; background: transparent; }
    .cpp-table { min-width: 0; }
    .cpp-table thead { display: none; }
    .cpp-table tbody { display: block; }
    .cpp-table tbody tr {
        display: block;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 10px;
        margin-bottom: 10px;
        padding: 10px 12px;
        box-shadow: 0 1px 3px rgba(15,23,42,.04);
    }
    .cpp-table tbody tr.cpp-row-pos { border-left: 4px solid #f59e0b; box-shadow: none; }
    .cpp-table tbody tr.cpp-detail-row {
        padding: 0;
        background: #f9fafb;
        border: 1px solid #e5e7eb;
    }
    .cpp-table tbody tr.cpp-detail-row td { padding: 0; display: block; }
    .cpp-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        padding: 6px 0;
        border: 0;
        font-size: 13px;
    }
    .cpp-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .03em;
    }
    .cpp-table tbody td.cpp-cell-toggle::before { display: none; }
    .cpp-table tbody td.cpp-cell-toggle {
        justify-content: flex-start;
        padding-bottom: 8px;
        margin-bottom: 6px;
        border-bottom: 1px dashed #e5e7eb;
    }
    .cpp-actions-cell { width: 100%; justify-content: stretch; }
    .cpp-actions-cell .cpp-btn { flex: 1; }

    /* Detalle inline en móvil: tabla compacta a cards */
    .cpp-detail-inner { padding: 12px; }
    .cpp-detail-inner table { font-size: 12px; }
    .cpp-detail-inner th, .cpp-detail-inner td { padding: 6px 8px; }

    /* Modal en móvil */
    .cpp-modal { max-height: 100vh; border-radius: 0; height: 100%; max-width: 100%; }
    .cpp-modal-backdrop { padding: 0; align-items: stretch; }
    .cpp-modal-body { padding: 14px; }
    .cpp-modal-footer { padding: 12px 14px; }
    .cpp-edit-info { padding: 10px; gap: 6px 10px; }
    .cpp-edit-table { font-size: 12px; }
    .cpp-edit-table thead { display: none; }
    .cpp-edit-table tbody tr {
        display: block;
        padding: 10px;
        background: #fff;
        border: 1px solid #e5e7eb;

        border-radius: 8px;
        margin-bottom: 8px;
    }
    .cpp-edit-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 4px 0;
        border: 0;
        gap: 10px;
    }
    .cpp-edit-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 11px;
        text-transform: uppercase;
    }
    .cpp-edit-table input[type="number"] { width: 110px; }
}

/* =====================================================
   v1.2.0 — Menú principal glass + Gate PIN + 80mm print
   ===================================================== */

/* ============ Variables ============ */
.cpp-app {
    --cpp-bg: #f1f5f9;
    --cpp-card: rgba(255,255,255,0.72);
    --cpp-card-border: rgba(255,255,255,0.5);
    --cpp-accent: #0ea5e9;
    --cpp-accent-2: #06b6d4;
    --cpp-text: #0f172a;
    --cpp-text-muted: #64748b;

    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 8px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--cpp-text);
    line-height: 1.5;
    box-sizing: border-box;
}
.cpp-app *, .cpp-app *::before, .cpp-app *::after { box-sizing: border-box; }

/* ============ Hero ============ */
.cpp-hero {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    padding: 28px 26px;
    margin: 16px 0 20px;
    color: #fff;
    background: linear-gradient(135deg, #0c4a6e 0%, #0e7490 50%, #0891b2 100%);
    box-shadow: 0 20px 50px -10px rgba(14, 116, 144, 0.45);
    isolation: isolate;
}
.cpp-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at top right, rgba(34, 211, 238, .55) 0%, transparent 55%),
        radial-gradient(ellipse at bottom left, rgba(99, 102, 241, .35) 0%, transparent 55%);
    z-index: -1;
}
.cpp-hero::before {
    /* Patrón de puntos decorativo */
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 22px 22px;
    z-index: -1;
    opacity: 0.5;
}
.cpp-hero-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}
.cpp-brand { display: flex; align-items: center; gap: 14px; }
.cpp-brand-mark {
    width: 54px; height: 54px;
    border-radius: 14px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    border: 1px solid rgba(255,255,255,0.3);
}
.cpp-brand-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.cpp-brand-sub   { margin: 2px 0 0; font-size: 13px; opacity: 0.85; }
.cpp-hero-meta {
    text-align: right;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.2);
}
.cpp-hero-date { font-size: 12px; opacity: 0.85; }
.cpp-hero-time { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: 0.03em; }

/* ============ Sección genérica ============ */
.cpp-section {
    margin-bottom: 22px;
}
.cpp-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 10px;
    flex-wrap: wrap;
}
.cpp-section-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--cpp-text);
}

/* ============ Outlets grid ============ */
.cpp-outlets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.cpp-outlet-card {
    position: relative;
    background: var(--cpp-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--cpp-card-border);
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    transition: transform .2s ease, box-shadow .2s ease;
    overflow: hidden;
}
.cpp-outlet-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cpp-accent), var(--cpp-accent-2));
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}
.cpp-outlet-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}
.cpp-outlet-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--cpp-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.cpp-outlet-name::before {
    content: '🏪';
    font-size: 14px;
}
.cpp-outlet-total {
    font-size: 22px;
    font-weight: 800;
    color: var(--cpp-text);
    letter-spacing: -0.02em;
    margin: 4px 0 6px;
    font-variant-numeric: tabular-nums;
}
.cpp-outlet-total .currency { color: var(--cpp-text-muted); font-size: 14px; margin-right: 2px; }
.cpp-outlet-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    font-size: 12px;
}
.cpp-outlet-stat { display: flex; align-items: center; gap: 4px; color: var(--cpp-text-muted); }
.cpp-outlet-stat strong { color: var(--cpp-text); font-weight: 700; }

.cpp-outlet-percent-bar {
    height: 4px;
    background: rgba(15, 23, 42, 0.08);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}
.cpp-outlet-percent-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--cpp-accent), var(--cpp-accent-2));
    border-radius: 2px;
    transition: width .6s cubic-bezier(.4,0,.2,1);
}

.cpp-outlet-card.empty .cpp-outlet-total { color: #cbd5e1; }
.cpp-outlet-card.empty::before { background: #cbd5e1; }

.cpp-outlets-total {
    margin-top: 14px;
    background: linear-gradient(135deg, #ecfeff 0%, #cffafe 100%);
    border: 1px solid #67e8f9;
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.cpp-outlets-total .lbl {
    display: block;
    font-size: 11px;
    color: #0c4a6e;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}
.cpp-outlets-total strong {
    font-size: 20px;
    font-weight: 800;
    color: #0c4a6e;
    font-variant-numeric: tabular-nums;
}

/* ============ Skeleton loading ============ */
.cpp-skeleton .sk-line {
    height: 12px;
    background: linear-gradient(90deg, rgba(15,23,42,.06) 0%, rgba(15,23,42,.12) 50%, rgba(15,23,42,.06) 100%);
    background-size: 200% 100%;
    animation: cpp-shimmer 1.4s infinite;
    border-radius: 6px;
    margin-bottom: 8px;
}
@keyframes cpp-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ============ Modules grid ============ */
.cpp-modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.cpp-module-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 18px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--cpp-text);
    background: var(--cpp-card);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--cpp-card-border);
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
    transition: all .25s ease;
    overflow: hidden;
}
.cpp-module-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(14, 165, 233, 0.1) 100%);
    opacity: 0;
    transition: opacity .25s ease;
    pointer-events: none;
    border-radius: 18px;
}
.cpp-module-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.4);
}
.cpp-module-card:hover::after { opacity: 1; }

.cpp-module-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e0f2fe 0%, #cffafe 100%);
    border: 1px solid rgba(14, 165, 233, 0.2);
}
.cpp-module-ajuste .cpp-module-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-color: rgba(245, 158, 11, 0.25);
}
.cpp-module-estado .cpp-module-icon {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    border-color: rgba(139, 92, 246, 0.25);
}
.cpp-module-resumen .cpp-module-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-color: rgba(16, 185, 129, 0.25);
}

.cpp-module-body { flex: 1; min-width: 0; }
.cpp-module-body h3 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: var(--cpp-text);
    letter-spacing: -0.01em;
}
.cpp-module-body p {
    margin: 0;
    font-size: 13px;
    color: var(--cpp-text-muted);
    line-height: 1.4;
}
.cpp-module-arrow {
    font-size: 22px;
    color: var(--cpp-accent);
    font-weight: 700;
    opacity: 0.6;
    transition: transform .2s ease, opacity .2s ease;
    flex-shrink: 0;
}
.cpp-module-card:hover .cpp-module-arrow {
    transform: translateX(4px);
    opacity: 1;
}

/* ============ Footer ============ */
.cpp-footer {
    text-align: center;
    padding: 14px;
    color: var(--cpp-text-muted);
    font-size: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    margin-top: 20px;
}

/* ============ Page header (historial) ============ */
.cpp-page-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0 16px;
    flex-wrap: wrap;
}
.cpp-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #cbd5e1;
    color: var(--cpp-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all .15s ease;
}
.cpp-back-btn:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
}
.cpp-page-header .cpp-title {
    margin: 0;
    flex: 1;
    text-align: left;
}

/* ============ Gate PIN ============ */
.cpp-gate-wrap {
    width: 100%;
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
.cpp-gate-card {
    width: 100%;
    max-width: 380px;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 22px;
    padding: 32px 28px;
    box-shadow:
        0 20px 50px rgba(15, 23, 42, 0.15),
        0 0 0 1px rgba(14, 165, 233, 0.08);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cpp-gate-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0ea5e9 0%, #06b6d4 100%);
}
.cpp-gate-icon {
    width: 72px; height: 72px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e0f2fe 0%, #cffafe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border: 1px solid rgba(14, 165, 233, 0.2);
    box-shadow: 0 6px 18px rgba(14, 165, 233, 0.18);
}
.cpp-gate-title {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 700;
    color: #0c4a6e;
}
.cpp-gate-sub {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--cpp-text-muted, #64748b);
}
.cpp-gate-field {
    margin-bottom: 14px;
}
.cpp-gate-input {
    width: 100%;
    height: 56px;
    padding: 0 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 12px;
    font-size: 24px;
    letter-spacing: 0.4em;
    text-align: center;
    background: #fff;
    color: #0f172a;
    outline: none;
    transition: all .15s ease;
    font-variant-numeric: tabular-nums;
}
.cpp-gate-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.15);
}
.cpp-gate-input::placeholder {
    letter-spacing: 0.3em;
    color: #cbd5e1;
}
.cpp-gate-btn {
    width: 100%;
    height: 50px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.3);
}
.cpp-gate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.45);
}
.cpp-gate-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.cpp-gate-msg {
    margin-top: 12px;
    min-height: 20px;
    font-size: 13px;
    color: #b91c1c;
    font-weight: 500;
}
.cpp-gate-cooldown {
    margin-top: 8px;
    font-size: 13px;
    color: #475569;
    background: #fef3c7;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #fde68a;
}

/* ============ Responsive del menú ============ */
@media (max-width: 700px) {
    .cpp-hero { padding: 22px 18px; }
    .cpp-hero-content { gap: 12px; }
    .cpp-brand-title { font-size: 18px; }
    .cpp-brand-mark { width: 46px; height: 46px; font-size: 22px; }
    .cpp-hero-time { font-size: 20px; }
    .cpp-modules-grid { grid-template-columns: 1fr; }
    .cpp-outlets-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .cpp-outlet-total { font-size: 18px; }
}
@media (max-width: 460px) {
    .cpp-outlets-grid { grid-template-columns: 1fr; }
    .cpp-hero-meta { padding: 8px 12px; }
    .cpp-page-header { flex-direction: column; align-items: flex-start; }
    .cpp-page-header .cpp-title { text-align: center; width: 100%; }
}

/* =====================================================
   IMPRESIÓN TÉRMICA 80mm (POS)
   ===================================================== */
@media print {
    /* Para impresoras térmicas 80mm, los rollos suelen tener un área
       imprimible útil de ~72mm. Forzamos página estrecha sin márgenes. */
    @page {
        size: 80mm auto;
        margin: 2mm 1mm;
    }

    html, body {
        width: 78mm;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    body {
        font-size: 10pt;
        padding: 0 !important;
        font-family: 'Courier New', Courier, monospace, -apple-system, BlinkMacSystemFont, sans-serif;
    }

    /* Header compacto */
    .header {
        padding-bottom: 4px !important;
        margin-bottom: 6px !important;
        border-bottom-width: 2px !important;
        flex-direction: column !important;
        gap: 2px !important;
        align-items: stretch !important;
    }
    .header-left h1 {
        font-size: 13pt !important;
        line-height: 1.2;
        margin: 0 0 2px !important;
    }
    .header-left .subtitle { font-size: 8pt !important; }
    .header-right { font-size: 8pt !important; text-align: left !important; }

    /* Meta-grid compacto */
    .meta-grid {
        display: block !important;
        margin-bottom: 6px !important;
        font-size: 9pt !important;
    }
    .meta-grid > div { margin-bottom: 4px; }
    .meta-grid .label {
        font-size: 7pt !important;
        margin-bottom: 0 !important;
        display: inline-block;
        margin-right: 6px;
    }
    .meta-grid .value { font-size: 9pt !important; display: inline; font-weight: 700; }

    /* Tablas compactas */
    table {
        font-size: 8.5pt !important;
        margin-bottom: 6px !important;
    }
    thead th {
        padding: 3px 4px !important;
        font-size: 8pt !important;
        background: #000 !important;
        color: #fff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    tbody td {
        padding: 3px 4px !important;
        font-size: 8.5pt !important;
        word-break: break-word;
    }
    tbody tr:nth-child(even) td { background: #f3f4f6 !important; }

    /* Totales compactos */
    .totales-strip {
        display: block !important;
        padding: 4px 6px !important;
        margin-bottom: 6px !important;
        font-size: 9pt !important;
        background: #f8fafc !important;
    }
    .totales-strip .item {
        display: flex !important;
        justify-content: space-between !important;
        margin-bottom: 2px;
    }
    .totales-strip .item.total strong { font-size: 11pt !important; }

    /* Subsecciones */
    .subseccion {
        padding: 4px 6px !important;
        margin: 8px 0 4px !important;
        border-left-width: 3px !important;
        border-radius: 0 !important;
        page-break-after: avoid;
    }
    .subseccion h2 { font-size: 10pt !important; margin: 0 !important; }
    .subseccion .meta { font-size: 8pt !important; }

    .badge {
        padding: 1px 4px !important;
        font-size: 7pt !important;
    }

    /* Mantener saltos limpios */
    .order-section { page-break-inside: avoid; }
    tr { page-break-inside: avoid; }
    thead { display: table-header-group; }

    /* Ocultar botones siempre */
    .actions, .cpp-back-btn, button { display: none !important; }
}

/* =====================================================
   v1.3.0 — Página /resumen (ventas del día por outlet)
   ===================================================== */

/* Módulo productos en menú */
.cpp-module-productos .cpp-module-icon {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    border-color: rgba(236, 72, 153, 0.25);
}

/* Filtros compactos (sin grid completo) */
.cpp-filters-compact {
    grid-template-columns: minmax(180px, 1fr) auto !important;
    max-width: 480px;
}

/* KPIs del día */
.cpp-vd-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.cpp-vd-kpi {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    position: relative;
    overflow: hidden;
}
.cpp-vd-kpi::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #0ea5e9, #06b6d4);
}
.cpp-vd-kpi .lbl {
    display: block;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.cpp-vd-kpi strong {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

/* Tarjetas de outlet (en resumen del día) */
.cpp-vd-outlets {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.cpp-vd-outlet {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}
.cpp-vd-outlet-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #0c4a6e 0%, #0e7490 100%);
    color: #fff;
    gap: 12px;
    flex-wrap: wrap;
}
.cpp-vd-outlet-head .name {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cpp-vd-outlet-head .name::before {
    content: '🏪';
    font-size: 18px;
}
.cpp-vd-outlet-head .stats {
    display: flex;
    gap: 18px;
    font-size: 13px;
    align-items: center;
    flex-wrap: wrap;
}
.cpp-vd-outlet-head .stats > div { display: flex; align-items: baseline; gap: 4px; }
.cpp-vd-outlet-head .stats .lbl { opacity: 0.8; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.cpp-vd-outlet-head .stats strong { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }

.cpp-vd-outlet-body { padding: 0; }
.cpp-vd-empty {
    padding: 22px;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

.cpp-vd-sales {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cpp-vd-sales thead th {
    background: #f8fafc;
    color: #475569;
    text-align: left;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e5e7eb;
}
.cpp-vd-sales tbody td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.cpp-vd-sales tbody tr {
    cursor: pointer;
    transition: background .12s ease;
}
.cpp-vd-sales tbody tr:hover { background: #f0f9ff; }
.cpp-vd-sales tbody tr:last-child td { border-bottom: 0; }
.cpp-vd-sales .col-time { width: 80px; font-variant-numeric: tabular-nums; color: #64748b; }
.cpp-vd-sales .col-consec { width: 110px; font-weight: 700; }
.cpp-vd-sales .col-items { width: 100px; color: #64748b; text-align: center; }
.cpp-vd-sales .col-total { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: #16a34a; }
.cpp-vd-sales .col-actions { width: 50px; text-align: center; }
.cpp-vd-sales .col-actions::after {
    content: '›';
    font-size: 22px;
    color: #cbd5e1;
    font-weight: 300;
    line-height: 1;
}

/* Detalle dentro del modal (productos vendidos) */
.cpp-vd-detail-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px 14px;
    border-left: 4px solid #0ea5e9;
}
.cpp-vd-detail-info .lbl {
    display: block;
    font-size: 11px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 2px;
}
.cpp-vd-detail-info .val {
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.cpp-vd-detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.cpp-vd-detail-table thead th {
    background: #f1f5f9;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: #475569;
    text-align: left;
}
.cpp-vd-detail-table tbody td {
    padding: 8px 10px;
    border-bottom: 1px solid #f1f5f9;
}
.cpp-vd-detail-table .right { text-align: right; }
.cpp-vd-detail-table .num   { font-variant-numeric: tabular-nums; }
.cpp-vd-detail-table .col-num-cell  { width: 30px; color: #64748b; }
.cpp-vd-detail-table .col-qty-cell  { width: 50px; text-align: center; }
.cpp-vd-detail-table .col-pu-cell   { width: 90px; }
.cpp-vd-detail-table .col-tot-cell  { width: 100px; font-weight: 700; }

/* Responsivo */
@media (max-width: 600px) {
    .cpp-vd-outlet-head { padding: 12px 14px; }
    .cpp-vd-outlet-head .stats { gap: 12px; font-size: 12px; }
    .cpp-vd-outlet-head .stats strong { font-size: 14px; }

    .cpp-vd-sales { font-size: 12px; }
    .cpp-vd-sales thead { display: none; }
    .cpp-vd-sales tbody tr {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 4px 10px;
        padding: 10px 14px;
        border-bottom: 1px solid #f1f5f9;
    }
    .cpp-vd-sales tbody tr:hover { background: #f0f9ff; }
    .cpp-vd-sales tbody td { padding: 2px 0; border: 0; }
    .cpp-vd-sales .col-time { grid-column: 1; grid-row: 1; width: auto; font-size: 11px; }
    .cpp-vd-sales .col-consec { grid-column: 2; grid-row: 1; width: auto; }
    .cpp-vd-sales .col-total { grid-column: 3; grid-row: 1 / 3; align-self: center; }
    .cpp-vd-sales .col-items { grid-column: 1 / 3; grid-row: 2; width: auto; text-align: left; font-size: 11px; }
    .cpp-vd-sales .col-actions { display: none; }

    .cpp-vd-detail-info { grid-template-columns: 1fr 1fr; padding: 10px; }
    .cpp-vd-detail-table { font-size: 12px; }
    .cpp-vd-detail-table thead th, .cpp-vd-detail-table tbody td { padding: 6px 8px; }
}

/* =====================================================
   v1.4.0 — Topbar, /ajuste, /etiquetas, toast
   ===================================================== */

/* ============ TOPBAR ============ */
/* ============ TOPBAR (a prueba de temas/Elementor con #id) ============ */
#cpp-topbar-container,
#cpp-topbar-container * {
    box-sizing: border-box !important;
}
#cpp-topbar-container {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 18px 0 !important;
    padding: 0 !important;
}
#cpp-topbar-container .cpp-topbar {
    display: block !important;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 14px !important;
    margin: 0 !important;
    padding: 8px !important;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
    position: relative !important;
    overflow: hidden !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
}
#cpp-topbar-container .cpp-topbar-inner {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 6px !important;
    max-width: 100% !important;
    margin: 0 !important;
    width: 100% !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    min-height: 0 !important;
    padding: 0 !important;
}
#cpp-topbar-container .cpp-topbar-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    padding: 10px 6px !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    color: #475569 !important;
    background: #fff !important;
    border: 1px solid #e2e8f0 !important;
    transition: all .15s ease !important;
    cursor: pointer !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 78px !important;
    max-height: 90px !important;
    height: 78px !important;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03) !important;
    font-family: inherit !important;
    overflow: hidden !important;
    line-height: 1.2 !important;
}
#cpp-topbar-container .cpp-topbar-item:hover {
    background: #f0f9ff !important;
    border-color: #7dd3fc !important;
    color: #0c4a6e !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.12) !important;
    text-decoration: none !important;
}
#cpp-topbar-container .cpp-topbar-item.active {
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3) !important;
}
#cpp-topbar-container .cpp-topbar-item.active:hover { color: #fff !important; }
#cpp-topbar-container .cpp-topbar-item.active .cpp-topbar-desc { color: rgba(255,255,255,0.9) !important; }
#cpp-topbar-container .cpp-topbar-icon {
    font-size: 20px !important;
    line-height: 1 !important;
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    display: block !important;
    height: auto !important;
    width: auto !important;
}
#cpp-topbar-container .cpp-topbar-label {
    font-size: 13px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.01em !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}
#cpp-topbar-container .cpp-topbar-desc {
    font-size: 10.5px !important;
    color: #94a3b8 !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    font-weight: 500 !important;
    display: block !important;
}

/* ============ Page title bar ============ */
.cpp-page-title-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin: 8px 0 18px;
    flex-wrap: wrap;
}
.cpp-page-title {
    margin: 0;
    font-size: clamp(20px, 2.4vw, 26px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #0c4a6e;
    line-height: 1.2;
}
.cpp-page-subtitle {
    margin: 4px 0 0;
    font-size: 13.5px;
    color: #64748b;
}
.cpp-page-title-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ============ AJUSTE — Toolbar y stats ============ */
.cpp-aj-wrap { padding-top: 0; }
.cpp-aj-toolbar {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.cpp-aj-search {
    flex: 1;
    min-width: 240px;
    position: relative;
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0 12px;
    transition: all .15s ease;
}
.cpp-aj-search:focus-within {
    background: #fff;
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.cpp-aj-search-icon {
    font-size: 16px;
    opacity: 0.6;
    margin-right: 8px;
}
.cpp-aj-search input {
    flex: 1;
    border: 0;
    background: transparent;
    height: 42px;
    font-size: 14px;
    outline: none;
    min-width: 0;
}
.cpp-aj-search-clear {
    background: #e2e8f0;
    border: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}
.cpp-aj-search-clear:hover { background: #cbd5e1; }

.cpp-aj-stats {
    display: flex;
    gap: 18px;
    font-size: 13px;
    color: #64748b;
    margin-bottom: 12px;
    padding: 0 4px;
    flex-wrap: wrap;
}
.cpp-aj-stats strong {
    color: #0c4a6e;
    font-size: 15px;
    font-weight: 800;
    margin-right: 4px;
}

/* ============ AJUSTE — Tabla ============ */
.cpp-aj-table-wrap {
    overflow-x: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    position: relative;
}
.cpp-aj-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 760px;
}
.cpp-aj-table thead th {
    background: #f8fafc;
    color: #475569;
    text-align: left;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid #e2e8f0;
}
.cpp-aj-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.cpp-aj-table tbody tr:last-child td { border-bottom: 0; }
.cpp-aj-table tbody tr:hover { background: #fafbfc; }
.cpp-aj-table .col-prod    { width: 38%; }
.cpp-aj-table .col-barcode { width: 24%; }
.cpp-aj-table .col-price   { width: 18%; }
.cpp-aj-table .col-actions { width: 20%; }

.cpp-aj-prod { display: flex; flex-direction: column; gap: 2px; line-height: 1.25; }
.cpp-aj-prod strong { font-size: 14px; color: #0f172a; font-weight: 700; }
.cpp-aj-prod small  { color: #94a3b8; font-size: 11px; }

.cpp-aj-barcode {
    display: flex;
    gap: 6px;
    align-items: center;
}
.cpp-aj-input {
    height: 36px;
    padding: 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    outline: none;
    transition: all .15s ease;
    width: 100%;
    min-width: 0;
}
.cpp-aj-input:disabled {
    background: #f8fafc;
    color: #475569;
    border-color: #e2e8f0;
}
.cpp-aj-input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.cpp-aj-input-barcode { font-variant-numeric: tabular-nums; }
.cpp-aj-input-price {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.cpp-aj-price {
    display: flex;
    gap: 6px;
    align-items: center;
}

.cpp-aj-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.cpp-aj-status {
    display: block;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 4px;
    min-height: 13px;
}
.cpp-aj-status.success { color: #16a34a; font-weight: 600; }
.cpp-aj-status.error   { color: #b91c1c; font-weight: 600; }

.cpp-empty {
    padding: 40px 20px;
    text-align: center;
    color: #94a3b8;
    font-style: italic;
}

/* ============ Modal small ============ */
.cpp-modal-sm { max-width: 520px; }

.cpp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.cpp-form-grid .cpp-field-full { grid-column: 1 / -1; }
.cpp-form-grid .cpp-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.cpp-form-grid .cpp-field label {
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}
.cpp-form-grid .cpp-field input {
    height: 42px;
    padding: 0 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: all .15s ease;
}
.cpp-form-grid .cpp-field input:focus {
    border-color: #0ea5e9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}
.cpp-form-grid .cpp-field input[readonly] {
    background: #f8fafc;
    color: #64748b;
}
.cpp-required { color: #ef4444; }
.cpp-help { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.cpp-modal-msg {
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}
.cpp-modal-msg.success { display: block; background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.cpp-modal-msg.error   { display: block; background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.cpp-modal-msg.info    { display: block; background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ============ Toast ============ */
.cpp-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0f172a;
    color: #fff;
    padding: 12px 20px;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    z-index: 100500;
    font-size: 14px;
    font-weight: 500;
    max-width: 90%;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.cpp-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.cpp-toast.error   { background: #991b1b; }
.cpp-toast.success { background: #065f46; }
.cpp-toast code {
    background: rgba(255,255,255,0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* ============ ETIQUETAS ============ */
.cpp-etq-table .col-check {
    width: 50px;
    text-align: center;
}
.cpp-etq-table tbody tr {
    cursor: pointer;
    transition: background .12s ease;
}
.cpp-etq-table tbody tr:hover { background: #f0f9ff; }
.cpp-etq-table tbody tr.selected { background: #ecfeff; }
.cpp-etq-cb {
    width: 22px;
    height: 22px;
    accent-color: #0ea5e9;
    cursor: pointer;
}
.cpp-etq-price {
    font-weight: 800;
    font-size: 15px;
    color: #16a34a;
    font-variant-numeric: tabular-nums;
}

.cpp-etq-chip {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 95;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 22px;
    background: linear-gradient(135deg, #0ea5e9 0%, #06b6d4 100%);
    color: #fff;
    border: 0;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(14, 165, 233, 0.4);
    transition: transform .2s ease, box-shadow .2s ease;
}
.cpp-etq-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 32px rgba(14, 165, 233, 0.5);
}
.cpp-etq-pill {
    background: rgba(255, 255, 255, 0.25);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    min-width: 26px;
    text-align: center;
}

.cpp-etq-list {
    max-height: 55vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 4px;
    background: #fafbfc;
}
.cpp-etq-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px dashed #e5e7eb;
}
.cpp-etq-list-item:last-child { border-bottom: 0; }
.cpp-etq-list-item .name { font-weight: 700; color: #0f172a; flex: 1; }
.cpp-etq-list-item .price { font-weight: 800; color: #16a34a; font-variant-numeric: tabular-nums; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
    #cpp-topbar-container .cpp-topbar-item .cpp-topbar-desc { display: none !important; }
    #cpp-topbar-container .cpp-topbar-inner { gap: 5px !important; }
    #cpp-topbar-container .cpp-topbar-item {
        padding: 8px 4px !important;
        min-height: 64px !important;
        height: 64px !important;
        max-height: 70px !important;
    }
    #cpp-topbar-container .cpp-topbar-icon { font-size: 18px !important; }
    #cpp-topbar-container .cpp-topbar-label { font-size: 11.5px !important; }
}
@media (max-width: 700px) {
    #cpp-topbar-container { margin: 0 0 14px 0 !important; }
    #cpp-topbar-container .cpp-topbar {
        padding: 6px !important;
        border-radius: 12px !important;
    }
    #cpp-topbar-container .cpp-topbar-inner { gap: 4px !important; }
    #cpp-topbar-container .cpp-topbar-icon { font-size: 16px !important; margin-bottom: 2px !important; }
    #cpp-topbar-container .cpp-topbar-label { font-size: 10.5px !important; line-height: 1 !important; }
    #cpp-topbar-container .cpp-topbar-item {
        padding: 6px 2px !important;
        border-radius: 8px !important;
        min-height: 54px !important;
        height: 54px !important;
        max-height: 60px !important;
    }

    .cpp-page-title-bar { flex-direction: column; align-items: flex-start; gap: 12px; }
    .cpp-page-title-actions { width: 100%; }
    .cpp-page-title-actions .cpp-btn { flex: 1; }

    .cpp-form-grid { grid-template-columns: 1fr; }

    /* Tabla ajuste a cards en móvil (a prueba de temas) */
    .cpp-aj-table-wrap {
        overflow-x: visible !important;
        box-shadow: none !important;
        background: transparent !important;
        border: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    .cpp-aj-table {
        min-width: 0 !important;
        width: 100% !important;
        display: block !important;
        table-layout: auto !important;
        border-collapse: collapse !important;
    }
    .cpp-aj-table thead { display: none !important; }
    .cpp-aj-table tbody { display: block !important; width: 100% !important; }
    .cpp-aj-table tbody tr {
        display: block !important;
        background: #fff !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 12px !important;
        margin: 0 0 10px 0 !important;
        padding: 14px !important;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    .cpp-aj-table tbody td {
        display: block !important;
        padding: 0 !important;
        border: 0 !important;
        font-size: 13px !important;
        margin: 0 0 12px 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        text-align: left !important;
    }
    .cpp-aj-table tbody td:last-child { margin-bottom: 0 !important; }
    .cpp-aj-table tbody td::before {
        content: attr(data-label);
        display: block !important;
        font-weight: 700 !important;
        color: #94a3b8 !important;
        font-size: 10.5px !important;
        text-transform: uppercase !important;
        letter-spacing: 0.06em !important;
        margin-bottom: 6px !important;
    }
    .cpp-aj-table tbody td[data-label="Producto"] {
        padding-bottom: 12px !important;
        margin-bottom: 12px !important;
        border-bottom: 1px dashed #e2e8f0 !important;
    }
    .cpp-aj-table tbody td[data-label="Producto"]::before { display: none !important; }

    .cpp-aj-prod { width: 100% !important; display: block !important; }
    .cpp-aj-prod strong { font-size: 14px !important; display: block !important; }
    .cpp-aj-prod small  { font-size: 11px !important; display: block !important; }

    /* Filas de input + botón */
    .cpp-aj-table .cpp-aj-barcode,
    .cpp-aj-table .cpp-aj-price {
        display: flex !important;
        gap: 8px !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-wrap: nowrap !important;
        box-sizing: border-box !important;
    }
    .cpp-aj-table .cpp-aj-barcode > input.cpp-aj-input,
    .cpp-aj-table .cpp-aj-price > input.cpp-aj-input {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        height: 44px !important;
        font-size: 14px !important;
        padding: 0 12px !important;
        box-sizing: border-box !important;
    }
    .cpp-aj-table .cpp-aj-barcode > button.cpp-btn,
    .cpp-aj-table .cpp-aj-price > button.cpp-btn {
        flex: 0 0 auto !important;
        height: 44px !important;
        min-width: 50px !important;
        padding: 0 14px !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
    }

    /* Acciones: dos botones lado a lado */
    .cpp-aj-table .cpp-aj-actions {
        display: flex !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        flex-wrap: nowrap !important;
        box-sizing: border-box !important;
    }
    .cpp-aj-table .cpp-aj-actions > button.cpp-aj-edit-name {
        flex: 1 1 auto !important;
        height: 44px !important;
        padding: 0 12px !important;
        font-size: 13px !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
    }
    .cpp-aj-table .cpp-aj-actions > button.cpp-aj-delete {
        flex: 0 0 60px !important;
        width: 60px !important;
        height: 44px !important;
        padding: 0 !important;
        font-size: 14px !important;
        box-sizing: border-box !important;
    }

    /* Status pequeño */
    .cpp-aj-table .cpp-aj-status {
        display: block !important;
        margin-top: 4px !important;
        font-size: 11px !important;
    }

    /* === ETIQUETAS (/productos) en móvil === */
    .cpp-etq-table tbody tr {
        position: relative;
        padding-left: 50px !important; /* espacio para checkbox flotante */
    }
    .cpp-etq-table tbody tr td[data-label=""],
    .cpp-etq-table tbody tr td.col-check {
        position: absolute;
        top: 14px;
        left: 14px;
        width: 26px !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .cpp-etq-table tbody tr td[data-label=""]::before,
    .cpp-etq-table tbody tr td.col-check::before { display: none; }
    .cpp-etq-table tbody tr td[data-label="Precio"] {
        text-align: left;
        margin-bottom: 0 !important;
    }
    .cpp-etq-table tbody tr td[data-label="Precio"] .cpp-etq-price {
        font-size: 18px;
    }
    .cpp-etq-table tbody tr td[data-label="Producto"] {
        padding-bottom: 8px;
        margin-bottom: 8px;
        border-bottom: 1px dashed #e2e8f0;
    }

    .cpp-etq-chip {
        bottom: 14px;
        right: 14px;
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* v2.0.3 — tarjetas adicionales (Compras XML, Proveedores) y estado locked */
.cpp-module-compras .cpp-module-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: rgba(59, 130, 246, 0.25);
}
.cpp-module-proveedores .cpp-module-icon {
    background: linear-gradient(135deg, #ccfbf1 0%, #99f6e4 100%);
    border-color: rgba(20, 184, 166, 0.25);
}

/* Tarjeta bloqueada (usuario operario viendo accesos solo de dueño) */
.cpp-module-card.cpp-module-locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}
.cpp-module-card.cpp-module-locked:hover {
    transform: none;
    box-shadow: none;
}
.cpp-module-lock {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    background: #e2e8f0;
    color: #64748b;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.4px;
    border-radius: 10px;
    text-transform: uppercase;
}

/* v2.0.4 — tarjeta POS */
.cpp-module-pos .cpp-module-icon {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ============================================================
 * v2.0.15 — Banner de usuario activo + secciones priorizadas
 * ============================================================ */

/* Banner de identidad bajo el header */
.cpp-user-banner {
    margin-top: 16px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
    position: relative;
    z-index: 1;
}
.cpp-user-banner__avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fde047 0%, #facc15 100%);
    color: #1e293b;
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(250, 204, 21, 0.4);
    letter-spacing: -1px;
}
.cpp-user-banner__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}
.cpp-user-banner__greeting {
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    letter-spacing: 1.4px;
}
.cpp-user-banner__name {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cpp-user-banner__rol {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.6px;
    width: fit-content;
}
.cpp-user-banner__rol--dueño,
.cpp-user-banner__rol--dueno {
    background: #1e293b;
    color: #fde047;
}
.cpp-user-banner__rol--operario {
    background: #e2e8f0;
    color: #334155;
}

/* Sección principal con header reforzado */
.cpp-section--primary .cpp-section-title {
    background: linear-gradient(90deg, #fde047, #facc15);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}
.cpp-section-hint {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 500;
    margin-left: auto;
    letter-spacing: 0.3px;
}
.cpp-section-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

/* Grid principal con tarjetas más grandes */
.cpp-modules-grid--primary {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}
.cpp-module-card--featured {
    padding: 22px 20px;
    border-width: 2px;
    background: #fff;
    position: relative;
    overflow: hidden;
}
.cpp-module-card--featured .cpp-module-icon {
    width: 60px;
    height: 60px;
    font-size: 30px;
    border-radius: 14px;
}
.cpp-module-card--featured h3 {
    font-size: 17px;
    margin: 0 0 4px;
    font-weight: 700;
}
.cpp-module-card--featured::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #fde047, #facc15);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}
.cpp-module-card--featured:hover::before { transform: scaleX(1); }

/* Mobile-first: tarjetas en columna en móvil, 2 en tablet, auto en desktop */
@media (max-width: 600px) {
    .cpp-modules-grid,
    .cpp-modules-grid--primary {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .cpp-user-banner__name { font-size: 19px; }
    .cpp-user-banner__avatar { width: 46px; height: 46px; font-size: 21px; }
    .cpp-module-card--featured { padding: 16px 14px; }
    .cpp-module-card--featured .cpp-module-icon { width: 48px; height: 48px; font-size: 24px; }
    .cpp-section-hint { display: none; }
}
@media (min-width: 601px) and (max-width: 900px) {
    .cpp-modules-grid--primary { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
 * Form de login PIN — variante warning para bloqueo/horario
 * ============================================================ */
.scp-pin-card__error--warning {
    background: linear-gradient(135deg, #fef3c7, #fde68a) !important;
    color: #78350f !important;
    border: 1px solid #fbbf24 !important;
}

/* ============================================================
 * v2.0.18 — Rediseño dashboard /menu (look profesional)
 * Aplica solo cuando el contenedor tiene .cpp-app--v2
 * ============================================================ */

.cpp-app--v2 {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", Roboto, Helvetica, Arial, sans-serif;
	color: #0f172a;
	background: #f8fafc;
	padding: 18px 18px 40px;
	max-width: 1280px;
	margin: 0 auto;
	-webkit-font-smoothing: antialiased;
}

/* ---- Hero compacto ---- */
.cpp-hero-v2 {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
	background: #ffffff;
	border-radius: 16px;
	padding: 14px 20px;
	margin-bottom: 14px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 8px 24px -10px rgba(15, 23, 42, 0.08);
	border: 1px solid #e2e8f0;
}
.cpp-hero-v2__greeting {
	display: flex;
	align-items: center;
	gap: 14px;
	min-width: 0;
}
.cpp-hero-v2__avatar {
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
	color: #fde047;
	font-size: 22px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	letter-spacing: -1px;
}
.cpp-hero-v2__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.cpp-hero-v2__hello {
	font-size: 11px;
	font-weight: 600;
	color: #94a3b8;
	letter-spacing: 1.2px;
	text-transform: uppercase;
}
.cpp-hero-v2__name {
	font-size: 19px;
	font-weight: 800;
	color: #0f172a;
	letter-spacing: -0.3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
}
.cpp-hero-v2__role {
	display: inline-block;
	margin-top: 4px;
	padding: 2px 9px;
	border-radius: 6px;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.8px;
	width: fit-content;
}
.cpp-hero-v2__role--dueño,
.cpp-hero-v2__role--dueno    { background: #fde047; color: #422006; }
.cpp-hero-v2__role--operario { background: #e2e8f0; color: #334155; }

.cpp-hero-v2__clock {
	text-align: right;
	display: flex;
	flex-direction: column;
	gap: 1px;
}
.cpp-hero-v2__date {
	font-size: 11px;
	color: #64748b;
	letter-spacing: 0.4px;
	font-weight: 600;
	text-transform: uppercase;
}
.cpp-hero-v2__time {
	font-size: 28px;
	font-weight: 800;
	color: #0f172a;
	font-variant-numeric: tabular-nums;
	letter-spacing: -1px;
	line-height: 1;
}

/* ---- KPI strip ---- */
.cpp-kpis {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 10px;
	margin-bottom: 18px;
}
.cpp-kpi {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 14px 16px;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cpp-kpi:hover {
	transform: translateY(-1px);
	border-color: #cbd5e1;
	box-shadow: 0 6px 16px -8px rgba(15, 23, 42, 0.15);
}
.cpp-kpi--primary {
	background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
	color: #ffffff;
	border: 0;
}
.cpp-kpi--primary .cpp-kpi__label { color: rgba(255,255,255,0.6); }
.cpp-kpi--primary .cpp-kpi__value { color: #fde047; }
.cpp-kpi--primary .cpp-kpi__hint  { color: rgba(255,255,255,0.45); }
.cpp-kpi__label {
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.8px;
	color: #94a3b8;
	text-transform: uppercase;
}
.cpp-kpi__value {
	font-size: 24px;
	font-weight: 800;
	color: #0f172a;
	letter-spacing: -0.6px;
	line-height: 1.1;
	margin: 4px 0 2px;
	font-variant-numeric: tabular-nums;
}
.cpp-kpi__hint {
	font-size: 11px;
	color: #94a3b8;
	font-weight: 500;
}

/* ---- Secciones más compactas ---- */
.cpp-app--v2 .cpp-section {
	margin: 0 0 18px 0;
	padding: 0;
	background: transparent;
	box-shadow: none;
}
.cpp-app--v2 .cpp-section-head {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 8px;
	padding: 0 4px;
}
.cpp-app--v2 .cpp-section-title {
	font-size: 13px;
	font-weight: 700;
	color: #0f172a;
	letter-spacing: 0.3px;
	text-transform: uppercase;
	background: none !important;
	-webkit-text-fill-color: currentColor !important;
}
.cpp-app--v2 .cpp-section-hint {
	font-size: 11.5px;
	color: #94a3b8;
	font-weight: 500;
}

/* ---- Tarjetas de outlets más compactas ---- */
.cpp-outlets-grid--v2 {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 10px;
}
.cpp-app--v2 .cpp-outlet-card {
	background: #ffffff;
	border-radius: 14px;
	padding: 14px 16px;
	border: 1px solid #e2e8f0;
	box-shadow: none;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.cpp-app--v2 .cpp-outlet-card:hover {
	transform: translateY(-1px);
	border-color: #cbd5e1;
	box-shadow: 0 6px 16px -8px rgba(15, 23, 42, 0.15);
}

/* ---- Módulos: tarjetas más sobrias y profesionales ---- */
.cpp-app--v2 .cpp-modules-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: 10px;
}
.cpp-app--v2 .cpp-modules-grid--primary {
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.cpp-app--v2 .cpp-module-card {
	background: #ffffff;
	border: 1px solid #e2e8f0;
	border-radius: 14px;
	padding: 14px 16px;
	display: flex;
	align-items: center;
	gap: 14px;
	text-decoration: none;
	color: inherit;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
	position: relative;
	overflow: hidden;
}
.cpp-app--v2 .cpp-module-card:hover {
	transform: translateY(-1px);
	border-color: #cbd5e1;
	box-shadow: 0 8px 22px -10px rgba(15, 23, 42, 0.18);
}
.cpp-app--v2 .cpp-module-card::before { display: none; }

.cpp-app--v2 .cpp-module-icon--svg {
	width: 42px;
	height: 42px;
	border-radius: 11px;
	background: #f1f5f9;
	color: #475569;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	border: 0;
	font-size: inherit;
}
/* Colores temáticos del icon-svg por módulo */
.cpp-app--v2 .cpp-module-pos         .cpp-module-icon--svg { background: #fef3c7; color: #92400e; }
.cpp-app--v2 .cpp-module-ajuste      .cpp-module-icon--svg { background: #dcfce7; color: #166534; }
.cpp-app--v2 .cpp-module-estado      .cpp-module-icon--svg { background: #dbeafe; color: #1e40af; }
.cpp-app--v2 .cpp-module-productos   .cpp-module-icon--svg { background: #fce7f3; color: #9d174d; }
.cpp-app--v2 .cpp-module-resumen     .cpp-module-icon--svg { background: #ede9fe; color: #5b21b6; }
.cpp-app--v2 .cpp-module-compras     .cpp-module-icon--svg { background: #dbeafe; color: #1e40af; }
.cpp-app--v2 .cpp-module-proveedores .cpp-module-icon--svg { background: #ccfbf1; color: #0f766e; }
.cpp-app--v2 .cpp-module-pedidospos  .cpp-module-icon--svg { background: #fef3c7; color: #92400e; }
.cpp-app--v2 .cpp-module-usuarios    .cpp-module-icon--svg { background: #e0e7ff; color: #3730a3; }

.cpp-app--v2 .cpp-module-body { flex: 1; min-width: 0; }
.cpp-app--v2 .cpp-module-body h3 {
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 2px 0;
	letter-spacing: -0.2px;
	line-height: 1.25;
}
.cpp-app--v2 .cpp-module-body p {
	font-size: 12px;
	color: #64748b;
	margin: 0;
	line-height: 1.35;
}
.cpp-app--v2 .cpp-module-arrow {
	color: #cbd5e1;
	font-weight: 700;
	font-size: 18px;
	transition: transform .15s ease, color .15s ease;
}
.cpp-app--v2 .cpp-module-card:hover .cpp-module-arrow {
	color: #0f172a;
	transform: translateX(2px);
}
.cpp-app--v2 .cpp-module-card.cpp-module-locked {
	opacity: 0.55;
	cursor: not-allowed;
}
.cpp-app--v2 .cpp-module-card.cpp-module-locked:hover {
	transform: none;
	box-shadow: none;
	border-color: #e2e8f0;
}
.cpp-app--v2 .cpp-module-lock {
	display: inline-block;
	margin-top: 4px;
	padding: 2px 7px;
	background: #e2e8f0;
	color: #64748b;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.4px;
	border-radius: 6px;
}

/* ---- Footer ---- */
.cpp-app--v2 .cpp-footer {
	text-align: center;
	color: #94a3b8;
	font-size: 11px;
	margin-top: 20px;
	font-weight: 500;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
	.cpp-kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.cpp-app--v2 { padding: 12px 12px 32px; }
	.cpp-hero-v2 { padding: 12px 14px; }
	.cpp-hero-v2__time { font-size: 22px; }
	.cpp-hero-v2__name { font-size: 16px; }
	.cpp-hero-v2__avatar { width: 42px; height: 42px; font-size: 19px; }
	.cpp-kpis { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.cpp-kpi__value { font-size: 20px; }
	.cpp-app--v2 .cpp-modules-grid,
	.cpp-app--v2 .cpp-modules-grid--primary { grid-template-columns: 1fr; }
	.cpp-app--v2 .cpp-module-icon--svg { width: 38px; height: 38px; }
}

/* v2.0.19 — KPI total ahora recibe HTML de WooCommerce (.html() en vez de .text()) */
.cpp-kpi__value .woocommerce-Price-amount,
.cpp-kpi__value .amount,
.cpp-kpi__value bdi {
	font-size: inherit !important;
	font-weight: inherit !important;
	color: inherit !important;
	letter-spacing: inherit !important;
	font-family: inherit !important;
	display: inline !important;
}
.cpp-kpi__value .woocommerce-Price-currencySymbol {
	font-size: 0.7em;
	font-weight: 700;
	margin-right: 2px;
	opacity: 0.85;
}

/* ============================================================
 * v2.0.19 — Compactar aún más el dashboard
 * El usuario reporta "muchos espacios". Reducir paddings/gaps.
 * ============================================================ */
.cpp-app--v2 {
	padding: 12px 14px 28px !important;
}
.cpp-hero-v2 {
	padding: 10px 14px !important;
	margin-bottom: 10px !important;
	border-radius: 12px !important;
}
.cpp-hero-v2__avatar {
	width: 42px !important;
	height: 42px !important;
	font-size: 18px !important;
	border-radius: 10px !important;
}
.cpp-hero-v2__name      { font-size: 16px !important; }
.cpp-hero-v2__time      { font-size: 22px !important; }
.cpp-kpis {
	gap: 8px !important;
	margin-bottom: 12px !important;
}
.cpp-kpi {
	padding: 11px 13px !important;
	border-radius: 11px !important;
}
.cpp-kpi__value      { font-size: 20px !important; margin: 3px 0 1px !important; }
.cpp-kpi__label      { font-size: 10px !important; letter-spacing: 0.6px !important; }
.cpp-kpi__hint       { font-size: 10.5px !important; }

.cpp-app--v2 .cpp-section          { margin: 0 0 12px 0 !important; }
.cpp-app--v2 .cpp-section-head     { margin-bottom: 6px !important; padding: 0 2px !important; }
.cpp-app--v2 .cpp-section-title    { font-size: 12px !important; letter-spacing: 0.4px !important; }
.cpp-app--v2 .cpp-section-hint     { font-size: 11px !important; }
.cpp-app--v2 .cpp-modules-grid     { gap: 8px !important; }
.cpp-app--v2 .cpp-module-card      { padding: 11px 13px !important; gap: 11px !important; border-radius: 11px !important; }
.cpp-app--v2 .cpp-module-body h3   { font-size: 13.5px !important; }
.cpp-app--v2 .cpp-module-body p    { font-size: 11.5px !important; }
.cpp-app--v2 .cpp-module-icon--svg { width: 38px !important; height: 38px !important; border-radius: 9px !important; }
.cpp-app--v2 .cpp-outlet-card      { padding: 11px 13px !important; }
.cpp-outlets-grid--v2              { gap: 8px !important; }
.cpp-app--v2 .cpp-outlets-total    { margin-top: 8px !important; padding: 10px 14px !important; }
