@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    /* Main Palette - Modern & Premium */
    --primary: #0f172a;
    --primary-accent: #3b82f6;
    --primary-hover: #1e293b;
    --brand-coral: #E2664A;
    --brand-cream: #F7EFE6;
    --success: #10b981;
    --success-hover: #059669;
    --background: #f4f6fb;
    --surface: #ffffff;
    --text: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e6eaf1;
    --border-strong: #d5dbe6;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.08);
    --shadow-hover: 0 14px 30px rgba(15, 23, 42, 0.12);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-full: 9999px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --sidebar-w: 264px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    min-height: 100vh;
    background-color: var(--background);
    color: var(--text);
    padding-bottom: 120px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.no-scroll {
    overflow: hidden;
}

.container {
    padding: var(--space-md) var(--space-md) 96px;
    max-width: 600px;
    margin: 0 auto;
}

h1, h2, h3 {
    text-align: center;
    margin-bottom: var(--space-lg);
    margin-top: 0;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
}

.producto-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 16px;
    margin-bottom: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.producto-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-accent);
}



.producto-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.producto-nombre {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
    margin-bottom: 2px;
    line-height: 1.2;
}

.producto-descripcion {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-precio {
    color: var(--primary-accent);
    font-size: 18px;
    font-weight: 800;
    margin-top: 2px;
}

.producto-controles {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-left: 8px;
    border-left: 1px solid var(--border);
}

.btn-cantidad {
    background: #f1f5f9;
    border: none;
    color: var(--text);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cantidad:hover {
    background: var(--primary-accent);
    color: white;
}

.cantidad {
    font-size: 15px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
}

.btn-flotante {
    position: fixed;
    bottom: 24px;
    left: 24px;
    right: 24px;
    max-width: 500px;
    margin: 0 auto;
    background: var(--primary);
    color: white;
    text-align: center;
    padding: 18px 24px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-decoration: none;
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    display: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.btn-flotante:active {
    transform: scale(0.98);
    background: var(--primary-hover);
}

.btn-flotante.visible {
    display: block;
    animation: slideUpIn 0.4s ease;
}

@keyframes slideUpIn {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes premiumFadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes premiumSoftIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.premium-nav,
.nav-cliente {
    animation: premiumSoftIn 240ms ease both;
}

.box,
.stat-card,
.producto-card,
.pedido-card,
.mi-pedido-card,
.cliente-card,
.usuario-card,
.prod-card,
.stock-card,
.bodega-card,
.faltante-card,
.quick-btn {
    animation: premiumFadeUp 260ms ease both;
}

.box:nth-of-type(2),
.producto-card:nth-of-type(2),
.pedido-card:nth-of-type(2),
.mi-pedido-card:nth-of-type(2),
.cliente-card:nth-of-type(2),
.stock-card:nth-of-type(2),
.bodega-card:nth-of-type(2) {
    animation-delay: 35ms;
}

.box:nth-of-type(3),
.producto-card:nth-of-type(3),
.pedido-card:nth-of-type(3),
.mi-pedido-card:nth-of-type(3),
.cliente-card:nth-of-type(3),
.stock-card:nth-of-type(3),
.bodega-card:nth-of-type(3) {
    animation-delay: 70ms;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}

/* Formularios */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
}

.form-control {
    width: 100%;
    min-height: 52px;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    font-size: 16px;
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--surface);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(31, 97, 247, 0.12);
}

.btn-block {
    display: block;
    width: 100%;
    padding: 14px 24px;
    background: var(--primary);
    color: white;
    text-align: center;
    border: none;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.26px;
    text-decoration: none;
    margin-top: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-block:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

.btn-block:active {
    transform: translateY(0);
}

.btn-block.success {
    background: var(--success);
}

.btn-block.success:hover {
    background: var(--success-hover);
}

.btn-block.secondary {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text);
}

.btn-block.secondary:hover {
    background: rgba(15, 23, 42, 0.12);
}

.btn-block.secondary:active {
    background: rgba(15, 23, 42, 0.14);
}

.resumen-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
}

.resumen-total {
    display: flex;
    justify-content: space-between;
    padding: 16px 0;
    font-size: 18px;
    font-weight: 500;
    color: var(--text);
}

.box { 
    background: var(--surface); 
    padding: 24px; 
    border-radius: var(--radius); 
    border: 1px solid var(--border); 
    margin-bottom: 24px; 
    box-shadow: var(--shadow-soft);
}

.hidden {
    display: none !important;
}

.nav-admin {
    min-height: 66px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,250,252,0.92));
    backdrop-filter: blur(22px) saturate(145%);
    -webkit-backdrop-filter: blur(22px) saturate(145%);
    padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.22);
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.premium-nav .nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px 6px 6px;
    border-radius: 16px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    flex-shrink: 0;
}

.nav-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #fff;
    font-weight: 900;
    font-size: 15px;
    letter-spacing: 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1), 0 8px 16px rgba(15, 23, 42, 0.18);
}

.nav-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.nav-brand-text strong {
    font-size: 13px;
    letter-spacing: 0;
    color: var(--text);
}

.nav-brand-text small {
    margin-top: 3px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.premium-nav .nav-scroll {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    flex: 1;
    min-width: 0;
    padding: 4px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.035);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.premium-nav .nav-scroll::-webkit-scrollbar {
    display: none;
}

.vendor-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    margin-top: 48px;
    padding: 24px;
    font-size: 13px;
    border-top: 1px solid var(--border);
}

.vendor-footer a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.vendor-footer a:hover {
    color: var(--primary-accent);
}

.text-center {
    text-align: center;
}

.text-success {
    color: #1e8e3e;
}

.text-error {
    color: #dc3545;
}

.text-info {
    color: #0c5460;
}

.hero-title {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--primary);
    margin-bottom: 24px;
    text-align: center;
}

.app-logo,
.logo-sm {
    height: 44px;
    width: auto;
}

.producto-image {
    width: 90px !important;
    height: 90px !important;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid var(--border);
}

.producto-thumb {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

@media (max-width: 480px) {
    .producto-image {
        width: 72px !important;
        height: 72px !important;
    }
}

.field-note {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.link-secondary {
    display: inline-flex;
    align-items: center;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.link-secondary:hover {
    text-decoration: underline;
}

.logo-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px 20px;
    max-width: 700px;
    margin: 0 auto;
    background: transparent;
}

.app-logo {
    height: 60px !important;
    width: auto !important;
    max-width: 100% !important;
    object-fit: contain;
    margin: 0 auto;
    display: block;
}

.logo-header span {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

.detail-top {
    margin-bottom: 18px;
}

.text-muted {
    color: var(--text-secondary);
}

.item-actions {
    margin-top: 12px;
}

.pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.pedido-meta-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.texto-normal {
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
}

.empty-state-icon {
    font-size: 42px;
    margin-bottom: 16px;
}

.message-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.btn-small {
    padding: 10px 18px;
    font-size: 13px;
}

.mb-2 {
    margin-bottom: 16px;
}

.message-summary {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
}

@media (max-width: 520px) {
    .btn-flotante {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }
}

.nav-admin a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 14px;
    border-radius: 14px;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    position: relative;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.nav-admin a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.72);
}

.nav-admin a.active {
    background: #0f172a;
    color: white;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.18);
    transform: translateY(-1px);
}

.nav-admin .nav-logout {
    margin-left: auto;
    color: #991b1b;
    background: rgba(254, 242, 242, 0.92);
    border: 1px solid rgba(248, 113, 113, 0.22);
    flex-shrink: 0;
    box-shadow: 0 8px 18px rgba(153, 27, 27, 0.06);
}

.nav-admin-primary {
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 0.96));
    border-bottom-color: rgba(255,255,255,0.08);
    box-shadow: 0 14px 34px rgba(2, 6, 23, 0.18);
}

.nav-admin-primary a {
    color: rgba(255,255,255,0.78);
}

.nav-admin-primary .nav-brand {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.12);
}

.nav-admin-primary .nav-brand-mark {
    background: #ffffff;
    color: #0f172a;
}

.nav-admin-primary .nav-brand-text strong {
    color: #fff;
}

.nav-admin-primary .nav-brand-text small {
    color: rgba(255,255,255,0.58);
}

.nav-admin-primary .nav-scroll {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
}

.nav-admin-primary a:hover {
    color: white;
    background: rgba(255,255,255,0.1);
}

.nav-admin-primary a.active {
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 10px 22px rgba(0,0,0,0.18);
}

.nav-admin-primary .nav-brand.active {
    color: white;
    box-shadow: none;
}

.nav-admin-primary .nav-admin-logout {
    margin-left: auto;
    color: rgba(255,255,255,0.92);
}

.nav-admin-primary .nav-logout {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255,255,255,0.12);
}

/* Nav Stock y Entrega (rol deposito) */
.premium-nav-deposito {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-bottom-color: rgba(255,255,255,0.08);
}
.premium-nav-deposito a { color: rgba(255,255,255,0.78); }
.premium-nav-deposito .nav-brand { background:rgba(255,255,255,0.1); border-color:rgba(255,255,255,0.15); }
.premium-nav-deposito .nav-brand-mark { background:#10b981; color:white; }
.premium-nav-deposito .nav-brand-text strong { color:#fff; }
.premium-nav-deposito .nav-brand-text small { color:rgba(255,255,255,0.6); }
.premium-nav-deposito .nav-scroll { background:rgba(255,255,255,0.06); border-color:rgba(255,255,255,0.08); }
.premium-nav-deposito a:hover { color:white; background:rgba(255,255,255,0.1); }
.premium-nav-deposito a.active { background:#10b981; color:white; }
.premium-nav-deposito .nav-logout { color:white; background:rgba(255,255,255,0.1); border-color:rgba(255,255,255,0.12); }

@media (max-width: 720px) {
    .nav-admin {
        min-height: 62px;
        gap: 8px;
        padding-top: 8px;
        padding-bottom: 8px;
        flex-wrap: wrap;
    }

    .premium-nav .nav-brand {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        padding: 5px 8px 5px 5px;
        background: transparent;
        border-color: transparent;
        box-shadow: none;
    }

    .nav-brand-text {
        display: flex;
        min-width: 0;
    }

    .nav-brand-mark {
        width: 32px;
        height: 32px;
        border-radius: 11px;
    }

    .premium-nav .nav-scroll {
        order: 3;
        flex: 0 0 100%;
        width: 100%;
        gap: 4px;
        padding: 4px;
        scroll-snap-type: x proximity;
    }

    .nav-admin a {
        padding: 9px 12px;
        font-size: 12px;
    }

    .premium-nav .nav-scroll a {
        scroll-snap-align: start;
    }

    .nav-admin .nav-logout {
        order: 2;
        margin-left: 0;
        padding: 8px 12px;
    }
}

.mb-4 {
    margin-bottom: 24px;
}

.font-semibold {
    font-weight: 600;
}

.hist-item-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.cliente-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-soft);
}

.cliente-nombre {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.cliente-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    line-height: 1.7;
}

.metricas {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: #f8f9fa;
    border-radius: 16px;
    padding: 14px;
    margin-bottom: 14px;
    text-align: center;
}

.metrica-val {
    font-size: 17px;
    font-weight: 700;
    color: var(--primary);
}

.metrica-lbl {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.acciones {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 10px 12px;
    font-size: 13px;
    border-radius: 12px;
    text-align: center;
    border: none;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    flex: 1;
}

.btn-pedido {
    background: var(--primary);
    color: white;
}

.btn-hist {
    background: rgba(15, 23, 42, 0.06);
    color: var(--text);
}

.historial {
    display: none;
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
}

.historial.abierto {
    display: block;
}

.hist-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.hist-item:last-child {
    border-bottom: none;
}

.hist-productos {
    font-size: 11px;
    color: #999;
    margin-top: 6px;
}

.badge-total {
    background: var(--primary);
    color: white;
    font-size: 11px;
    padding: 6px 10px;
    border-radius: 999px;
}

.filtros {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
    padding-bottom: 4px;
}

.filtro-btn {
    padding: 7px 16px;
    border: 1px solid var(--border);
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    white-space: nowrap;
    color: var(--text);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.filtro-btn:hover {
    background: rgba(31, 97, 247, 0.08);
}

.filtro-btn.active {
    background: var(--primary);
    color: white;
    border-color: rgba(31, 97, 247, 0.25);
}

.stat-card-wide {
    grid-column: span 2;
}

.text-sm {
    font-size: 12px;
}

.text-italic {
    font-style: italic;
}

.with-bottom-bar {
    padding-bottom: 88px;
}

.nav-title {
    font-weight: 500;
    margin-left: 8px;
}

.field-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.field-row .form-control {
    flex: 1;
    min-width: 140px;
}

.btn-inline {
    width: auto;
    padding: 0 16px;
    flex-shrink: 0;
}

.hidden {
    display: none !important;
}

.mt-1 {
    margin-top: 8px;
}

.mt-2 {
    margin-top: 16px;
}


.gps-dot {
    display:inline-block;
    width:10px;
    height:10px;
    border-radius:50%;
    background:#6c757d;
    margin-right:8px;
    vertical-align:middle;
}

.gps-dot.activo {
    background:#1e8e3e;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.welcome {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 4px;
}

.welcome-sub {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.quick-actions {
    display:grid;
    grid-template-columns:repeat(2, 1fr);
    gap:12px;
    margin-bottom:20px;
}

.quick-btn {
    background: var(--surface);
    border:1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 16px;
    text-align:center;
    text-decoration:none;
    color: var(--text);
    transition: box-shadow 0.2s ease;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.quick-btn:hover {
    box-shadow: var(--shadow);
}

.quick-btn-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.quick-btn-label {
    font-size: 13px;
    font-weight: 500;
}

.login-wrap {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 16px;
}

.page-center {
    display: flex;
    align-items: center;
    min-height: 100vh;
    padding: 24px 16px;
}

.logo-area {
    text-align: center;
    margin-bottom: 32px;
}

.logo-icon img {
    height: 72px;
    width: auto;
}

.logo-title {
    font-size: 22px;
    font-weight: 500;
    margin-top: 8px;
    color: var(--text);
}

.logo-sub {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.consent-wrap {
    background: white;
    border-radius: 16px;
    margin: 20px 16px;
    padding: 32px 24px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.consent-icon {
    font-size: 56px;
    text-align: center;
    margin-bottom: 16px;
}

.consent-titulo {
    font-size: 20px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text);
}

.consent-subtitulo {
    font-size: 14px;
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.consent-lista {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

.consent-item {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.5;
}

.consent-item:last-child {
    margin-bottom: 0;
}

.consent-item-icon {
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 1px;
}

.consent-check {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 20px;
}

.consent-check input[type=checkbox] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.consent-check label {
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

.btn-aceptar {
    opacity: 0.5;
    pointer-events: none;
}

.btn-aceptar.activo {
    opacity: 1;
    pointer-events: all;
}

.link-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15,23,42,0.04);
    border: 1px solid rgba(15,23,42,0.12);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.link-button:hover {
    background: rgba(15,23,42,0.08);
}

.page-center.consent-page {
    background: #1a73e8;
}

/* ───────────── ALERTAS ───────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    border-left: 4px solid transparent;
}
.alert-success { background: #d4edda; color: #155724; border-color: #28a745; }
.alert-error   { background: #f8d7da; color: #721c24; border-color: #dc3545; }
.alert-warning { background: #fff3cd; color: #856404; border-color: #ffc107; }
.alert-info    { background: #d1ecf1; color: #0c5460; border-color: #17a2b8; }

/* ───────────── NAV CLIENTE ───────────── */
.nav-cliente {
    background: rgba(255,255,255,0.94);
    backdrop-filter: blur(18px) saturate(145%);
    -webkit-backdrop-filter: blur(18px) saturate(145%);
    padding: 10px max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    color: var(--text);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 62px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.nav-cliente-izq { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.nav-cliente-nombre { font-size: 14px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-cliente a {
    color: var(--text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
    padding: 9px 13px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(15, 23, 42, 0.06);
    transition: all 0.2s;
    white-space: nowrap;
}
.nav-cliente a:hover { background: rgba(15, 23, 42, 0.1); }
.nav-cliente .client-brand {
    padding: 0;
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    flex-shrink: 0;
}
.nav-cliente .client-brand .nav-brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
}

/* ───────────── BUSCADOR ───────────── */
.search-box {
    position: relative;
    margin-bottom: 24px;
}
.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}
.search-input {
    width: 100%;
    padding: 16px 18px 16px 48px;
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 16px;
    background: var(--surface);
    color: var(--text);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.search-input:focus {
    outline: none;
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* ───────────── FILTROS CATEGORÍA ───────────── */
.cat-filtros {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 24px;
    padding: 4px 0;
    scrollbar-width: none;
}
.cat-filtros::-webkit-scrollbar { display: none; }

.cat-btn {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.cat-btn:hover {
    border-color: var(--primary-accent);
    color: var(--primary-accent);
}
.cat-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

/* ───────────── SIN RESULTADOS ───────────── */
.sin-resultados {
    display: none;
    text-align: center;
    padding: 40px 24px;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
}
.sin-resultados-icon { font-size: 42px; margin-bottom: 12px; }

/* ───────────── CATEGORÍA TAG EN PRODUCTO ───────────── */
.cat-tag {
    display: inline-block;
    font-size: 11px;
    color: var(--primary);
    background: #e8f0fe;
    border-radius: 10px;
    padding: 1px 8px;
    margin-bottom: 4px;
    font-weight: 500;
}

/* ───────────── ESTADO BADGE ───────────── */
.estado-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.estado-Pendiente       { background: #fff3cd; color: #856404; }
.estado-En-preparacion  { background: #d1ecf1; color: #0c5460; }
.estado-Listo           { background: #cce5ff; color: #004085; }
.estado-Despachado      { background: #ede9fe; color: #5b21b6; }
.estado-Facturacion-directa { background: #e0e7ff; color: #3730a3; }
.estado-Entregado       { background: #d4edda; color: #155724; }
.estado-Cancelado       { background: #f8d7da; color: #721c24; }

/* ───────────── MIS PEDIDOS (CLIENTE) ───────────── */
.mi-pedido-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    transition: box-shadow 0.2s;
}
.mi-pedido-card:hover { box-shadow: var(--shadow); }
.mi-pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.mi-pedido-num { font-weight: 500; font-size: 15px; }
.mi-pedido-meta { font-size: 13px; color: var(--text-secondary); margin-top: 6px; }

/* ───────────── SPINNER ───────────── */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────────── STATS ADMIN ───────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
}
.stat-numero { font-size: 26px; font-weight: 700; color: var(--primary); line-height: 1.2; }
.stat-numero-sm { font-size: 20px; }
.stat-label  { font-size: 11px; color: var(--text-secondary); font-weight: 500; margin-top: 2px; }
.stat-pendiente .stat-numero  { color: #856404; }
.stat-prep .stat-numero      { color: #17a2b8; }
.stat-listo .stat-numero     { color: #004085; }
.stats-grid-gap { gap: 10px; }

/* ───────────── BADGE GENÉRICO ───────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}
.badge-activo   { background: #d4edda; color: #155724; }
.badge-inactivo { background: #f8d7da; color: #721c24; }

/* ───────────── PROD CARD ADMIN ───────────── */
.prod-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    transition: box-shadow 0.2s;
}
.prod-card:hover { box-shadow: var(--shadow); }
.prod-card-info { flex-grow: 1; min-width: 0; }
.prod-card-nombre { font-weight: 500; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prod-card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ── Modal detalle producto ─────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: flex-end;
    justify-content: center;
}
.modal-overlay.abierto { display: flex; }
.modal-sheet {
    background: white;
    border-radius: 24px 24px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0 0 32px;
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.1);
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
.modal-handle {
    width: 32px; height: 4px;
    background: #e2e8f0; border-radius: 2px;
    margin: 12px auto;
}
.modal-img {
    width: 100%; height: auto;
    max-height: 300px;
    object-fit: contain;
    background: #f8fafc;
}
.modal-img-placeholder {
    width: 100%; height: 180px;
    background: #f8fafc;
    display: flex; align-items: center;
    justify-content: center; font-size: 64px;
}
.modal-body { padding: 24px 24px; }
.modal-cat { font-size: 13px; color: var(--primary-accent); font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.05em; }
.modal-nombre { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 8px; line-height: 1.2; }
.modal-precio { font-size: 28px; font-weight: 800; color: var(--primary-accent); margin-bottom: 16px; }
.modal-desc { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 24px; }
.modal-stock { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; display: flex; align-items: center; gap: 6px; }
.modal-controles { display: flex; align-items: center; gap: 24px; justify-content: center; background: #f8fafc; padding: 16px; border-radius: 16px; }
.btn-modal-cant {
    width: 48px; height: 48px; font-size: 24px; border-radius: 12px;
    border: 1px solid var(--border); background: var(--surface);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: var(--text);
    transition: all 0.2s;
}
.btn-modal-cant:active { transform: scale(0.95); background: #f1f5f9; }
.modal-cantidad { font-size: 24px; font-weight: 800; min-width: 40px; text-align: center; }
.btn-detalle-prod {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 13px;
    color: var(--primary-accent);
    margin-top: 8px;
    text-align: left;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}
.btn-detalle-prod:hover {
    text-decoration: underline;
}
.prod-card-precio { font-weight: 600; font-size: 15px; white-space: nowrap; }

/* ══════════════════════════════════════════════════════════════
   MULTI-STEP FORM (vendedor/nuevo_pedido)
══════════════════════════════════════════════════════════════ */
.step { display: none; }
.step.activo { display: block; }

.step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}
.step-num {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 10px rgba(15,23,42,0.22);
}
.step-titulo {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* Barra fija inferior: Atrás / Siguiente */
.barra-inferior {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    padding: 10px 16px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    box-shadow: 0 -4px 24px rgba(15,23,42,0.07);
    z-index: 800;
}
.barra-inferior .btn-block { margin-top: 0; flex: 1; }

/* GPS box */
.gps-box {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
    color: #14532d;
}
.gps-coords {
    font-size: 12px;
    color: #166534;
    margin-top: 6px;
    font-family: ui-monospace, SFMono-Regular, 'Courier New', monospace;
    word-break: break-all;
    font-weight: 400;
}

/* Líneas del resumen de pedido */
.resumen-check {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    gap: 12px;
}
.resumen-check:last-child { border-bottom: none; }
.resumen-check span:last-child { font-weight: 700; white-space: nowrap; color: var(--primary); }

/* Banner cliente pre-seleccionado */
#clienteBanner { border-radius: var(--radius); }

/* ══════════════════════════════════════════════════════════════
   SECCIÓN TITLE (dentro de forms/boxes)
══════════════════════════════════════════════════════════════ */
.section-title,
h3.section-title {
    text-align: left !important;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 14px;
    padding-bottom: 7px;
    border-bottom: 1px solid var(--border);
    line-height: 1.2;
}

/* ══════════════════════════════════════════════════════════════
   MAPA LINK
══════════════════════════════════════════════════════════════ */
.mapa-link {
    font-size: 13px;
    color: var(--primary-accent);
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}
.mapa-link:hover { text-decoration: underline; }

/* ══════════════════════════════════════════════════════════════
   BTN-CANTIDAD — ESTADOS MEJORADOS
══════════════════════════════════════════════════════════════ */
.btn-cantidad:active { transform: scale(0.86); }
.btn-cantidad:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   BTN-BLOCK — DISABLED
══════════════════════════════════════════════════════════════ */
.btn-block:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

/* ══════════════════════════════════════════════════════════════
   FORM CONTROLS — MEJORAS
══════════════════════════════════════════════════════════════ */

/* Select con flecha custom */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 44px;
    cursor: pointer;
}

/* Textarea solo resize vertical */
textarea.form-control {
    resize: vertical;
    min-height: 90px;
    line-height: 1.55;
    padding-top: 12px;
    padding-bottom: 12px;
}

/* File input */
input[type="file"].form-control {
    padding: 10px 16px;
    cursor: pointer;
    border-radius: 12px;
    font-size: 14px;
}
input[type="file"]::file-selector-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-right: 12px;
    transition: background 0.2s;
}
input[type="file"]::file-selector-button:hover { background: var(--primary-hover); }

/* Ocultar flechas en inputs numéricos */
input[type="number"].form-control::-webkit-outer-spin-button,
input[type="number"].form-control::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"].form-control { -moz-appearance: textfield; }

/* ══════════════════════════════════════════════════════════════
   PRODUCTO SIN STOCK
══════════════════════════════════════════════════════════════ */
.producto-card.sin-stock .producto-nombre { color: var(--text-secondary); }
.producto-card.sin-stock .producto-precio { color: var(--text-muted); font-size: 14px; }
.sin-stock-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 2px 8px;
    border-radius: 8px;
    margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════
   TOUCH / TAP IMPROVEMENTS
══════════════════════════════════════════════════════════════ */
button,
a,
.btn-block,
.btn-sm,
.btn-cantidad,
.cat-btn,
.filtro-btn {
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* ══════════════════════════════════════════════════════════════
   H2 EN PANELES — ALINEADO A LA IZQUIERDA
══════════════════════════════════════════════════════════════ */
.container > h2 { text-align: left; }

/* ══════════════════════════════════════════════════════════════
   BADGE ROL DEPOSITO
══════════════════════════════════════════════════════════════ */
.badge-rol-deposito { background: #d1fae5; color: #065f46; }

/* ══════════════════════════════════════════════════════════════════════════
   PANEL ADMIN — SHELL WEB-FIRST (sidebar de escritorio + drawer móvil)
   Alcance acotado a admin vía `.admin-sidebar` y `body:has(.admin-sidebar)`.
   El resto de paneles (vendedor / depósito / cliente) quedan intactos.
══════════════════════════════════════════════════════════════════════════ */

/* ── Topbar (visible sólo en móvil/tablet) ─────────────────────────────── */
.admin-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    position: sticky;
    top: 0;
    z-index: 850;
    min-height: 56px;
    padding: 9px 14px;
    color: #fff;
    background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
    box-shadow: 0 6px 22px rgba(2, 6, 23, 0.26);
}
.admin-topbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -0.01em;
}
.admin-topbar-brand img {
    height: 30px;
    width: auto;
    display: block;
    background: var(--brand-cream);
    border-radius: 8px;
    padding: 3px;
}
.admin-burger,
.admin-topbar-logout {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: rgba(255, 255, 255, 0.09);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.18s ease;
}
.admin-burger:hover,
.admin-topbar-logout:hover { background: rgba(255, 255, 255, 0.18); }
.admin-burger svg,
.admin-topbar-logout svg { width: 22px; height: 22px; }

/* ── Sidebar (drawer en móvil, fijo en escritorio) ─────────────────────── */
.admin-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    padding: 16px 14px;
    color: #e2e8f0;
    background: linear-gradient(180deg, #0f172a 0%, #0b1220 100%);
    box-shadow: 0 0 44px rgba(2, 6, 23, 0.42);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
.admin-sidebar.open { transform: translateX(0); }
.admin-sidebar::-webkit-scrollbar { width: 6px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }

.admin-scrim {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
.admin-scrim.open { opacity: 1; pointer-events: auto; }

/* Marca */
.admin-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 8px 16px;
    margin-bottom: 10px;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.admin-brand-chip {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 13px;
    background: var(--brand-cream);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.admin-brand-chip img { width: 34px; height: 34px; object-fit: contain; display: block; }
.admin-brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.admin-brand-text strong { color: #fff; font-size: 15px; font-weight: 800; letter-spacing: -0.01em; }
.admin-brand-text small {
    margin-top: 3px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
}

/* Lista de navegación */
.admin-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.admin-nav-group {
    padding: 16px 12px 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #64748b;
}
.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #9aa7bd;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    transition: background 0.16s ease, color 0.16s ease;
}
.admin-nav-item .ico { width: 20px; height: 20px; flex-shrink: 0; }
.admin-nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.admin-nav-item.active { background: rgba(226, 102, 74, 0.14); color: #fff; }
.admin-nav-item.active .ico { color: var(--brand-coral); }
.admin-nav-item.active::before {
    content: "";
    position: absolute;
    left: -14px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: var(--brand-coral);
}

/* Cerrar sesión */
.admin-logout {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    color: #fca5a5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    border: 1px solid rgba(248, 113, 113, 0.2);
    transition: background 0.16s ease, color 0.16s ease;
}
.admin-logout:hover { background: rgba(248, 113, 113, 0.12); color: #fecaca; }
.admin-logout .ico { width: 20px; height: 20px; }
/* Acceso a la propia ficha (cambiar la contraseña), mismo formato que Cerrar sesión. */
.admin-micuenta { color: #cbd5e1; border-color: rgba(203, 213, 225, 0.2); }
.admin-micuenta:hover { background: rgba(203, 213, 225, 0.1); color: #fff; }

/* ── Escritorio: sidebar permanente + contenido ancho y centrado ───────── */
@media (min-width: 1024px) {
    .admin-topbar,
    .admin-scrim { display: none; }

    .admin-sidebar {
        transform: none;
        box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05), 6px 0 28px rgba(2, 6, 23, 0.07);
    }

    body:has(.admin-sidebar) {
        padding-left: var(--sidebar-w);
        padding-bottom: 48px;
    }
    body:has(.admin-sidebar) .container {
        max-width: 1240px;
        padding: 34px clamp(24px, 3vw, 48px) 64px;
    }
    /* Un poco más de aire para los títulos de página en escritorio */
    body:has(.admin-sidebar) .container > h2 { font-size: 24px; margin-bottom: 22px; }
}

@media (min-width: 1440px) {
    body:has(.admin-sidebar) .container { max-width: 1360px; }
}

/* ── Utilidades de layout para listas (evita filas ultra-anchas) ───────── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
    align-items: start;
}
/* Mensajes de carga / "sin resultados" ocupan toda la fila */
.card-grid > p { grid-column: 1 / -1; }

/* Encabezado de página reutilizable: título + acciones */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}
.page-head h2 { margin: 0 !important; text-align: left !important; }
.page-head .page-head-sub { font-size: 13px; color: var(--text-secondary); font-weight: 500; }

/* ══════════════════════════════════════════════════════════════════════════
   TIENDA PÚBLICA (WEB) — catálogo en grilla tipo e-commerce
   Solo aplica dentro de `.tienda-grid`; el catálogo del vendedor (que usa
   `.producto-card` en formato lista) queda intacto.
══════════════════════════════════════════════════════════════════════════ */
.container.tienda { max-width: 1200px; }

.tienda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 6px;
}
@media (min-width: 560px) { .tienda-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; } }

/* Tarjeta vertical: imagen arriba, datos, y controles abajo */
.tienda-grid .producto-card {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
    margin-bottom: 0;
    height: 100%;
}
.tienda-grid .producto-image,
.tienda-grid .producto-ph {
    width: 100% !important;
    height: 190px !important;
    flex-shrink: 0;
}
.tienda-grid .producto-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 46px;
    color: #cbd5e1;
}
.tienda-grid .producto-info { gap: 3px; flex: 1; }
.tienda-grid .producto-nombre { font-size: 15px; }
.tienda-grid .producto-precio { font-size: 20px; margin-top: 6px; }
.tienda-grid .btn-detalle-prod { margin-top: 6px; }

/* Controles +/− en fila, pegados al fondo de la tarjeta */
.tienda-grid .producto-controles {
    flex-direction: row-reverse;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 10px 0 0;
    border-left: none;
    border-top: 1px solid var(--border);
    margin-top: auto;
}
.tienda-grid .producto-controles .btn-cantidad { width: 38px; height: 38px; font-size: 20px; }
.tienda-grid .producto-card .cantidad { font-size: 16px; min-width: 28px; }

/* Barra flotante “Realizar pedido”: centrada también en escritorio */
@media (min-width: 640px) {
    .btn-flotante { max-width: 420px; }
}

/* ══════════════════════════════════════════════════════════════════════════
   PANEL DEL EQUIPO — componentes compartidos (prefijo pv-)
   Pantalla del pedido (admin/views/pedido_ver.php) y listado de pedidos.
   Botones, tarjetas, tablas compactas y formularios en línea.
══════════════════════════════════════════════════════════════════════════ */
.pv { --pv-indigo: #4338ca; --pv-indigo-bg: #eef2ff; --pv-warn: #b45309; --pv-warn-bg: #fffbeb; --pv-danger: #dc2626; }
.pv h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0; text-align: left; }
.pv h3 { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary); margin: 0 0 12px; text-align: left; }
.pv h4 { text-align: left; }
.pv-back { display: inline-block; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none; }
.pv-back:hover { color: var(--text); }
.pv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.pv-sub { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.pv-sub a { color: inherit; font-weight: 600; }
.pv-head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Botones */
.pv-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px; border-radius: 10px; border: 1px solid transparent;
    font: inherit; font-size: 14px; font-weight: 700; line-height: 1.2;
    text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.pv-btn--primary { background: var(--primary); color: #fff; }
.pv-btn--primary:hover { background: var(--primary-hover); }
.pv-btn--success { background: var(--success); color: #fff; }
.pv-btn--success:hover { background: var(--success-hover); }
.pv-btn--ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.pv-btn--ghost:hover { border-color: var(--text-muted); }
.pv-btn--danger { background: #fff; color: var(--pv-danger, #dc2626); border-color: #fecaca; }
.pv-btn--danger:hover { background: #fef2f2; }
.pv-btn--wa { background: #25D366; color: #fff; }
.pv-btn--sm { padding: 7px 11px; font-size: 13px; }
.pv-btn--block { width: 100%; }
.pv-inline { display: inline; margin: 0; }
.pv-btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pv-link-danger { background: none; border: none; padding: 0; color: #dc2626; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }

/* "Qué sigue" */
.pv-next {
    display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap;
    background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--primary-accent);
    border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm);
}
.pv-next--warn   { border-left-color: #f59e0b; background: #fffdf5; }
.pv-next--indigo { border-left-color: #6366f1; background: #f8f8ff; }
.pv-next--ok     { border-left-color: var(--success); }
.pv-next--muted  { border-left-color: var(--text-muted); background: #f8fafc; }
.pv-next--devuelto { border-left-color: #dc2626; background: #fff8f8; }
.pv-devuelto { margin: 6px 0 10px; padding: 10px 12px; border-left: 3px solid #dc2626; background: #fff; border-radius: 0 8px 8px 0; font-size: 15px; font-weight: 600; color: #7f1d1d; }
.pv-devuelto span { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--text-secondary); }
.pv-next-txt { flex: 1 1 340px; min-width: 0; }
.pv-next-txt > strong { display: block; font-size: 17px; margin-bottom: 4px; }
.pv-next-txt p { margin: 0; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.pv-next-txt .pv-next-nota { margin-top: 8px; color: #166534; }
.pv-next-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; align-content: flex-start; }
/* Bonificaciones que propuso el vendedor: Administración acepta o rechaza */
.pv-bonif { margin-top: 12px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #78350f; }
.pv-bonif > strong { display: block; margin-bottom: 4px; }
.pv-bonif ul { list-style: none; margin: 4px 0; padding: 0; }
.pv-bonif li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 6px 0; border-top: 1px dashed #fde68a; }
.pv-bonif li:first-child { border-top: 0; }
.pv-bonif em { font-style: normal; color: #92400e; font-weight: 600; }
.pv-bonif-btns { display: flex; gap: 6px; }
.pv-bonif-pie { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 6px; color: #92400e; }
.pv-bonif-pie a { color: #b45309; font-weight: 700; }
.pv-falta { margin-top: 12px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 10px 12px; font-size: 13px; color: #7f1d1d; }
.pv-falta > strong { display: block; margin-bottom: 2px; }
.pv-falta ul { margin: 6px 0 6px 18px; padding: 0; }
.pv-falta a { color: #b91c1c; font-weight: 700; }

/* "Otras acciones" desplegable */
.pv-more { position: relative; }
.pv-more > summary {
    list-style: none; cursor: pointer; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border-strong);
    background: var(--surface); font-size: 14px; font-weight: 700; user-select: none;
}
.pv-more > summary::-webkit-details-marker { display: none; }
.pv-more > summary::after { content: " ▾"; color: var(--text-muted); }
.pv-more[open] > summary { border-color: var(--text-muted); }
.pv-more-body {
    display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-soft);
    min-width: min(320px, 85vw);
}
.pv-more-body .pv-btn { width: 100%; justify-content: flex-start; }
.pv-more-body form.pv-inline { display: block; }
.pv-cancelar { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 0; padding-top: 10px; border-top: 1px dashed var(--border); }

/* Grilla principal + tarjetas */
.pv-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
@media (min-width: 980px) { .pv-grid { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); } }
.pv-main, .pv-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pv-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); }
.pv-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.pv-card--nota { background: #fffbeb; border-color: #fde68a; }
.pv-card--nota p { margin: 0; font-size: 15px; }
/* Nota interna del pedido: guardada se lee (con quién y cuándo); se edita con "Editar". */
.pv-nota-texto { margin-top: 2px; padding: 10px 12px; border-left: 3px solid var(--brand-coral); background: rgba(226, 102, 74, .06); border-radius: 0 10px 10px 0; }
.pv-nota-texto p { margin: 0; font-size: 15px; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.pv-nota-texto small { display: block; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.pv-hint { font-size: 12px; color: var(--text-secondary); margin: 6px 0 0; }
.pv-subtitle { font-size: 14px; margin: 16px 0 8px; }
.pv-count { display: inline-block; min-width: 20px; padding: 1px 7px; border-radius: 10px; background: #f1f5f9; color: var(--text); font-size: 11px; letter-spacing: 0; text-align: center; }

/* Tabla compacta */
.pv-table-wrap { overflow-x: auto; margin: 0 -4px; }
.pv-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.pv-table th { text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); padding: 8px 6px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.pv-table td { padding: 10px 6px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.pv-table tbody tr:last-child td { border-bottom: none; }
.pv-table tfoot td { border-top: 2px solid var(--border-strong); border-bottom: none; font-weight: 800; font-size: 16px; padding-top: 12px; }
.pv-table .num { text-align: right; white-space: nowrap; }
.pv-table .nowrap { white-space: nowrap; }
.pv-tag { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; white-space: nowrap; background: #f1f5f9; color: var(--text-secondary); }
.pv-tag--ok { background: #dcfce7; color: #166534; }
.pv-tag--warn { background: #fef3c7; color: #92400e; }
.pv-tag--indigo { background: #e0e7ff; color: #3730a3; }
.pv-tag--danger { background: #fee2e2; color: #991b1b; }
.pv-volvio { margin: 8px 0; padding: 8px 10px; border: 1px solid #fecaca; border-radius: 8px; background: #fef2f2; font-size: 13px; }
.pv-volvio legend { font-weight: 700; color: #991b1b; padding: 0 4px; }
.pv-volvio label { display: block; margin-top: 4px; cursor: pointer; }
.pv-aviso-credito { margin-top: 10px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 10px; padding: 8px 12px; font-size: 13px; color: #9a3412; }
.pv-aviso-credito a { color: #c2410c; font-weight: 700; margin-left: 4px; }
/* Plazo de pago: pedidos bloqueados (rojo) y "solo contra entrega" (bien visible para el depósito). */
.pv-aviso-bloqueo { margin-top: 10px; background: #fef2f2; border: 1px solid #fecaca; border-radius: 10px; padding: 8px 12px; font-size: 13px; color: #991b1b; }
.pv-aviso-bloqueo span { color: #b91c1c; font-size: 12px; }
.pv-contra-entrega { margin-top: 10px; background: #fef9c3; border: 2px solid #ca8a04; border-radius: 10px; padding: 8px 12px; font-size: 15px; font-weight: 800; color: #713f12; letter-spacing: .02em; text-align: center; }
.pv-tachado { text-decoration: line-through; color: var(--text-secondary, #64748b); }

/* Formularios en línea */
.pv-in { padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px; font: inherit; font-size: 14px; background: #fff; width: 110px; max-width: 100%; }
.pv-in:focus { outline: none; border-color: var(--primary-accent); box-shadow: 0 0 0 3px rgba(59, 130, 246, .15); }
.pv-in--sm { width: 72px; }
.pv-in--grow { flex: 1 1 160px; width: auto; min-width: 0; }
.pv-in--block { width: 100%; }
.pv-unit { font-size: 12px; color: var(--text-secondary); margin-left: 4px; }
.pv-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.pv-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-file { font-size: 13px; max-width: 100%; }
.pv-check { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; white-space: nowrap; }
.pv-nuevo { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.pv-edit-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.pv-entrega { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.pv-entrega span { flex: 1; min-width: 0; }

/* Cliente / montos / archivos */
.pv-cliente-nombre { font-size: 17px; font-weight: 800; margin: 0; }
.pv-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 12px 0 0; font-size: 13px; }
.pv-kv dt { color: var(--text-secondary); }
.pv-kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.pv-montos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pv-montos div { background: #f8fafc; border-radius: 10px; padding: 8px 10px; }
.pv-montos span { display: block; font-size: 11px; color: var(--text-secondary); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pv-montos strong { font-size: 16px; }
.pv-montos .ok { color: #047857; }
.pv-montos .mal { color: #b91c1c; }
.pv-archivos { list-style: none; margin: 4px 0 0; padding: 0; }
.pv-archivos li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pv-archivos a { font-weight: 600; color: var(--text); }
.pv-fotos { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-fotos img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.pv-vinculos { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 13px; }
.pv-vinculos a { font-weight: 700; }

/* Historial */
.pv-timeline { list-style: none; margin: 0; padding: 0; }
.pv-timeline li { display: grid; grid-template-columns: 118px 1fr; gap: 2px 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.pv-timeline li:last-child { border-bottom: none; }
.pv-tl-fecha { color: var(--text-muted); grid-row: span 2; font-variant-numeric: tabular-nums; }
.pv-tl-quien { font-weight: 700; }
.pv-tl-que { color: var(--text-secondary); }

/* Listado de pedidos (admin/pedidos.php) */
.pl-buscar { display: flex; gap: 8px; flex: 1 1 360px; max-width: 520px; }
.pl-bandejas { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 10px; scrollbar-width: none; }
.pl-bandejas::-webkit-scrollbar { display: none; }
.pl-bandeja {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 10px; white-space: nowrap;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-secondary);
    font-size: 14px; font-weight: 700; text-decoration: none;
}
.pl-bandeja span { min-width: 22px; padding: 1px 7px; border-radius: 9px; background: #f1f5f9; color: var(--text); font-size: 12px; text-align: center; }
.pl-bandeja.activa { background: var(--primary); border-color: var(--primary); color: #fff; }
.pl-bandeja.activa span { background: rgba(255, 255, 255, .18); color: #fff; }
.pl-bandeja--alerta { color: #b91c1c; border-color: #fecaca; }
.pl-bandeja--alerta span { background: #fee2e2; color: #991b1b; }
.pl-canales { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; font-size: 13px; margin-bottom: 14px; color: var(--text-secondary); }
.pl-canales a { color: var(--text-secondary); text-decoration: none; font-weight: 600; padding: 3px 0; border-bottom: 2px solid transparent; }
.pl-canales a.activa { color: var(--text); border-bottom-color: var(--brand-coral); }
.pl-canales .pl-limpiar { color: #b91c1c; }
.pl-card { padding: 4px 10px; }
.pl-vacio { text-align: center; color: var(--text-secondary); padding: 36px 16px; }
.pl-tabla tbody tr { cursor: pointer; }
.pl-tabla tbody tr:hover td { background: #f8fafc; }
.pl-num { font-weight: 800; color: var(--text); text-decoration: none; }
.pl-cliente { font-weight: 700; color: var(--text); text-decoration: none; }
.pl-items { color: var(--text-secondary); font-size: 13px; }
.pl-items em { font-style: normal; font-weight: 700; color: var(--text); }
.pl-acc { width: 1%; text-align: right; }
.pl-paginas { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 13px; color: var(--text-secondary); }
/* En celular la tabla se vuelve tarjetas apiladas */
@media (max-width: 760px) {
    .pl-tabla thead { display: none; }
    .pl-tabla, .pl-tabla tbody, .pl-tabla tr, .pl-tabla td { display: block; width: 100%; }
    .pl-tabla tr { position: relative; padding: 10px 2px; border-bottom: 1px solid var(--border); }
    .pl-tabla tbody tr:last-child { border-bottom: none; }
    .pl-tabla td { border: none; padding: 2px 0; text-align: left !important; }
    .pl-tabla td[data-l="Fecha"], .pl-tabla td[data-l="Origen"] { display: inline-block; width: auto; font-size: 12px; color: var(--text-secondary); margin-right: 8px; }
    .pl-tabla td[data-l="Total"] { position: absolute; top: 10px; right: 2px; width: auto; }
    .pl-tabla .pl-acc { position: absolute; bottom: 8px; right: 2px; width: auto; }
}

/* Nuevo pedido (admin/pedido_nuevo.php) */
.pn-pasos { display: flex; gap: 8px; margin-bottom: 14px; font-size: 13px; font-weight: 700; }
.pn-pasos > * { padding: 6px 12px; border-radius: 999px; background: #eef1f6; color: var(--text-secondary); text-decoration: none; }
.pn-pasos .activo { background: var(--primary); color: #fff; }
.pn-clientes { list-style: none; margin: 8px 0 0; padding: 0; }
.pn-clientes li a { display: flex; flex-direction: column; gap: 1px; padding: 10px 8px; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; border-radius: 8px; }
.pn-clientes li a:hover { background: #f8fafc; }
.pn-clientes li a span { font-size: 13px; color: var(--text-secondary); }
.pn-clientes li a small { font-size: 12px; color: var(--text-muted); }
.pn-vacio { padding: 12px 8px; color: var(--text-secondary); font-size: 13px; }
.pn-resultados { list-style: none; margin: 8px 0 0; padding: 0; max-height: 420px; overflow-y: auto; }
.pn-resultados li button {
    width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; cursor: pointer;
    padding: 10px 8px; border: none; border-bottom: 1px solid var(--border); background: none; font: inherit; color: var(--text);
}
.pn-resultados li button:hover, .pn-resultados li:first-child button { background: #f8fafc; }
.pn-resultados li button > span:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pn-resultados small { font-size: 12px; color: var(--text-secondary); }
.pn-precio { text-align: right; font-weight: 700; white-space: nowrap; display: flex; flex-direction: column; }
.pn-mas { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; flex-shrink: 0; }
.pn-label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.pn-acciones { display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 600px) {
    .pn-resultados .pv-tag { display: none; }
}

/* Generar remito desde el panel */
.pv-despacho > summary { cursor: pointer; font-size: 15px; font-weight: 800; list-style: none; }
.pv-despacho > summary::-webkit-details-marker { display: none; }
.pv-despacho > summary::after { content: " ▾"; color: var(--text-muted); }
.pv-despacho[open] > summary { margin-bottom: 8px; }

/* Herramientas de dueños */
.pv-admin > summary { cursor: pointer; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary); }
.pv-admin[open] > summary { margin-bottom: 4px; }

.pv-solo-movil { display: none; font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
@media (max-width: 600px) {
    .pv-items .c-precio, .pv-items .c-desc { display: none; }
    .pv-solo-movil { display: block; }
    .pv-next { padding: 14px; }
    .pv-next-actions { width: 100%; }
    .pv-next-actions > .pv-btn, .pv-next-actions > form, .pv-next-actions > form .pv-btn, .pv-more, .pv-more > summary { width: 100%; }
    .pv-montos strong { font-size: 14px; }
    .pv-timeline li { grid-template-columns: 1fr; }
    .pv-tl-fecha { grid-row: auto; }
}

/* ═══ Cuenta corriente (estado de cuenta) ═══ */
.cc-saldo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin: 0 0 16px; padding: 16px 20px; border-radius: 14px; border: 1px solid; }
.cc-saldo > div { display: flex; flex-direction: column; }
.cc-saldo strong { font-size: 32px; line-height: 1.1; font-weight: 800; }
.cc-saldo p { margin: 0; flex: 1; min-width: 220px; font-size: 13px; }
.cc-saldo-lbl { font-size: 12px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; }
.cc-saldo--debe { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.cc-saldo--favor { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.cc-saldo--aldia { background: #f8fafc; border-color: #e2e8f0; color: #334155; }
.cc-filtro { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; }
.cc-filtro label { display: flex; align-items: center; gap: 4px; }
.cc-tabla td { vertical-align: top; }
.cc-tabla small { color: #94a3b8; }
.cc-debe { color: #b91c1c; }
.cc-haber { color: #047857; }
.cc-anulado td { color: #94a3b8; }
.cc-anulado td:nth-child(2), .cc-anulado .num { text-decoration: line-through; }
.cc-anterior td { background: #f8fafc; font-weight: 700; }
.cc-tipo { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 8px; margin-right: 4px; }
.cc-tipo--debe { background: #fee2e2; color: #991b1b; }
.cc-tipo--haber { background: #d1fae5; color: #065f46; }
.cc-tipos { display: grid; gap: 6px; }
.cc-tipos label { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid #e2e8f0; border-radius: 10px; cursor: pointer; font-size: 13px; }
.cc-tipos label:has(input:checked) { border-color: #0f172a; background: #f8fafc; }
.cc-tipos span b { margin-right: 4px; }
.cc-pendientes { list-style: none; margin: 0; padding: 0; }
.cc-pendientes li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid #f1f5f9; font-size: 13px; }
.cc-pendientes li:first-child { border-top: 0; }
.cc-pendientes span { flex: 1; color: #64748b; }

/* Aprobar: directa o depósito por producto */
.pv-col-directa { text-align: center; white-space: nowrap; }
.pv-switch-dir { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border: 1px solid #e2e8f0; border-radius: 999px; cursor: pointer; font-size: 12px; color: #475569; }
.pv-switch-dir:has(input:checked) { background: #e0e7ff; border-color: #a5b4fc; color: #3730a3; font-weight: 700; }

/* Detalle de cobros: medio, fecha real, e-cheq */
.cc-pago-det { display: grid; gap: 8px; }
.cc-pago-det .pv-form-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pv-label-in { display: grid; gap: 3px; font-size: 12px; font-weight: 600; color: #475569; flex: 1 1 140px; }
.pv-label-in .pv-in { width: 100%; }
.cc-det { display: block; font-size: 12px; color: #475569; margin-top: 2px; }
.cc-cargado { display: block; font-size: 11px; color: #94a3b8; }

/* Contador en el menú (p. ej. cobros a confirmar) */
.admin-nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #dc2626; color: #fff; font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }

/* Cobros de vendedores */
.cob-lista { display: grid; gap: 12px; }
.cob-item { display: grid; grid-template-columns: 88px 1fr auto; gap: 14px; align-items: start; padding: 14px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; }
.cob-item--pendiente { border-color: #fcd34d; background: #fffbeb; }
.cob-foto { width: 88px; height: 88px; border-radius: 10px; object-fit: cover; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #64748b; text-align: center; overflow: hidden; border: 1px solid #e2e8f0; }
.cob-foto img { width: 100%; height: 100%; object-fit: cover; }
.cob-monto { font-size: 20px; font-weight: 800; }
.cob-meta { font-size: 13px; color: #475569; margin-top: 2px; }
.cob-acciones { display: grid; gap: 6px; justify-items: end; }
.cob-acciones .pv-in { width: 130px; }
@media (max-width: 720px) {
    .cob-item { grid-template-columns: 64px 1fr; }
    .cob-foto { width: 64px; height: 64px; }
    .cob-acciones { grid-column: 1 / -1; justify-items: stretch; }
    .cob-acciones .pv-in { width: 100%; }
}

/* Vendedores y comisiones */
.vd-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 4px 0 16px; }
.vd-kpis > div { background: #fff; border: 1px solid #e2e8f0; border-radius: 14px; padding: 14px 16px; display: grid; gap: 2px; }
.vd-kpis span { font-size: 12px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .04em; }
.vd-kpis strong { font-size: 22px; font-weight: 800; color: #0f172a; }
.vd-kpis small { font-size: 12px; color: #64748b; }
.vd-pos { font-size: 18px; text-align: center; width: 40px; }
.vd-desde { display: block; font-size: 11.5px; color: #94a3b8; font-weight: 500; }
.vd-barra { height: 5px; background: #f1f5f9; border-radius: 999px; margin-top: 6px; overflow: hidden; max-width: 260px; }
.vd-barra span { display: block; height: 100%; background: linear-gradient(90deg, #4f46e5, #818cf8); border-radius: 999px; }
.vd-pcts { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 8px 0 14px; }

/* Pestañas tipo "libro" (Productos, Cobros de vendedores, Vendedores y comisiones) */
.tabs-libro { display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 2px solid var(--border); margin-bottom: 14px; }
.tab-libro { padding: 9px 16px; border: 1px solid var(--border); border-bottom: none; border-radius: 9px 9px 0 0;
    background: #f1f5f9; color: var(--text-secondary); font-weight: 700; font-size: 13px; text-decoration: none;
    display: flex; align-items: center; gap: 7px; position: relative; top: 2px; }
.tab-libro .n { font-size: 11px; background: #e2e8f0; color: #475569; padding: 1px 7px; border-radius: 10px; font-weight: 800; }
.tab-libro.active { background: var(--surface); color: var(--primary); border-color: var(--border); border-bottom: 2px solid var(--surface); }
.tab-libro.active .n { background: var(--primary); color: #fff; }

/* Lo marcado "hidden" se oculta siempre, aunque su clase tenga display: flex/grid. */
[hidden] { display: none !important; }

/* Filtros con fecha o desplegable: que entren completos (pv-in--sm es para números). */
.cc-filtro input[type="date"].pv-in--sm { width: auto; min-width: 140px; }
.cc-filtro select.pv-in--sm { width: auto; min-width: 150px; }
