/* PGCRM — Design system */

/* Utilidades críticas (fallback si Tailwind CDN no carga en hosting) */
.hidden,
.pg-hidden {
    display: none !important;
}

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.shrink-0 { flex-shrink: 0; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.min-w-0 { min-width: 0; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.block { display: block; }
.opacity-60 { opacity: 0.6; }
.text-xs { font-size: 0.75rem; line-height: 1.25; }
.text-sm { font-size: 0.875rem; line-height: 1.45; }
.text-xl { font-size: 1.25rem; line-height: 1.35; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-900 { color: #111827; }
.text-center { text-align: center; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.25rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-0\.5 { margin-top: 0.125rem; }
.mt-1 { margin-top: 0.25rem; }
.pt-4 { padding-top: 1rem; }
.pr-3 { padding-right: 0.75rem; }
.pb-4 { padding-bottom: 1rem; }
.p-4 { padding: 1rem; }
.p-5 { padding: 1.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.border-t { border-top-width: 1px; border-top-style: solid; }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; }
.border-\[\#ECEEEF\] { border-color: #eceeef; }
.bg-\[\#F8F9FA\] { background-color: #f8f9fa; }
.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:items-start { align-items: flex-start; }
    .sm\:justify-between { justify-content: space-between; }
    .sm\:block { display: block; }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

.animate-fade-in { animation: fadeIn 0.35s ease-out forwards; }
.animate-slide-in { animation: slideIn 0.3s ease-out forwards; }
.animate-scale-in { animation: scaleIn 0.35s ease-out forwards; }

.stagger-1 { animation-delay: 0.05s; opacity: 0; }
.stagger-2 { animation-delay: 0.1s; opacity: 0; }
.stagger-3 { animation-delay: 0.15s; opacity: 0; }
.stagger-4 { animation-delay: 0.2s; opacity: 0; }

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: #1A1D21;
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(26, 29, 33, 0.12);
}
.btn-primary:hover {
    background: #2d3238;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 29, 33, 0.2);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary svg,
.btn-secondary svg,
.pg-form-back svg { width: 1rem; height: 1rem; flex-shrink: 0; }

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #ECEEEF;
    border-radius: 0.625rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: #dc2626;
    border: 1px solid #b91c1c;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    border-color: #991b1b;
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pg-form-section-icon--danger {
    background: #fef2f2;
    color: #dc2626;
}

.btn-secondary:hover {
    background: #F8F9FA;
    border-color: #d1d5db;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    background: transparent;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.15s ease;
}
.btn-ghost:hover { color: #111; background: #F8F9FA; }

/* Legacy form classes (lists) */
.form-input {
    width: 100%;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    color: #111;
    background: #fff;
    border: 1px solid #ECEEEF;
    border-radius: 0.625rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-input:focus {
    border-color: #1A1D21;
    box-shadow: 0 0 0 3px rgba(26, 29, 33, 0.08);
}
.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
}

.badge {
    display: inline-flex;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}
.table-responsive { overflow-x: auto; }

/* ——— Form page layout ——— */
.pg-form-page {
    max-width: 52rem;
    margin: 0 auto;
}

.pg-form-header {
    margin-bottom: 1.75rem;
}

/* Iconos SVG — tamaño fijo (evita estiramiento en botones full-width) */
.pg-svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    max-width: 1.25rem !important;
    max-height: 1.25rem !important;
    flex: 0 0 auto !important;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}
.pg-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    flex: 0 0 auto;
    flex-shrink: 0;
    line-height: 0;
}
.pg-btn-icon .pg-svg {
    width: 1rem !important;
    height: 1rem !important;
    max-width: 1rem !important;
    max-height: 1rem !important;
}
.pg-form-back-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}
.pg-form-back-icon .pg-svg { width: 1rem !important; height: 1rem !important; max-width: 1rem !important; max-height: 1rem !important; }
.pg-form-title-icon .pg-svg { width: 1.375rem !important; height: 1.375rem !important; max-width: 1.375rem !important; max-height: 1.375rem !important; }
.pg-form-section-icon .pg-svg { width: 1.125rem !important; height: 1.125rem !important; max-width: 1.125rem !important; max-height: 1.125rem !important; }
.pg-field-icon .pg-svg { width: 1.125rem !important; height: 1.125rem !important; max-width: 1.125rem !important; max-height: 1.125rem !important; }
.btn-primary .pg-svg,
.btn-secondary .pg-svg,
.btn-ghost .pg-svg,
.pg-inv-btn .pg-svg { width: 1rem !important; height: 1rem !important; max-width: 1rem !important; max-height: 1rem !important; }

.pg-form-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    margin-bottom: 1rem;
    padding: 0.375rem 0.625rem 0.375rem 0.25rem;
    margin-left: -0.25rem;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
}
.pg-form-back:hover { color: #1A1D21; background: #F8F9FA; }

.pg-form-title-text { flex: 1; min-width: 0; }
.pg-form-header-extra { margin-top: 0.625rem; }

.pg-form-title-row {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.pg-form-title-icon {
    flex-shrink: 0;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1A1D21 0%, #3d4450 100%);
    border-radius: 0.875rem;
    color: #fff;
    box-shadow: 0 4px 14px rgba(26, 29, 33, 0.25);
}
.pg-form-title-icon svg { width: 1.375rem; height: 1.375rem; }

.pg-form-title { font-size: 1.5rem; font-weight: 700; color: #111; letter-spacing: -0.02em; }
.pg-form-subtitle { font-size: 0.875rem; color: #6b7280; margin-top: 0.25rem; }

.pg-form-card {
    background: #fff;
    border: 1px solid #ECEEEF;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.pg-form-section {
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid #F0F1F2;
}
.pg-form-section:last-of-type { border-bottom: none; }

.pg-form-section-head {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
}
.pg-form-section-icon {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8F9FA;
    border-radius: 0.5rem;
    color: #1A1D21;
}
.pg-form-section-icon svg { width: 1.125rem; height: 1.125rem; }
.pg-form-section-title { font-size: 0.9375rem; font-weight: 600; color: #111; }
.pg-form-section-desc { font-size: 0.75rem; color: #9ca3af; margin-top: 0.125rem; }

.pg-form-grid {
    display: grid;
    gap: 1.25rem;
}
.pg-form-grid-2 { grid-template-columns: 1fr; }
@media (min-width: 640px) {
    .pg-form-grid-2 { grid-template-columns: repeat(2, 1fr); }
}
.pg-form-grid-3 { grid-template-columns: 1fr; }
@media (min-width: 768px) {
    .pg-form-grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.pg-form-col-full { grid-column: 1 / -1; }
.pg-field.pg-col-full { grid-column: 1 / -1; }

/* Field with icon */
.pg-field { position: relative; }
.pg-field-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}
.pg-field-label .required { color: #ef4444; margin-left: 0.125rem; }
.pg-field-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.pg-field-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.125rem;
    height: 1.125rem;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s;
}
.pg-field-wrap:focus-within .pg-field-icon { color: #1A1D21; }

.pg-field-input,
.pg-field-select,
.pg-field-textarea {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    font-size: 0.875rem;
    line-height: 1.4;
    color: #111;
    background: #FAFBFC;
    border: 1px solid #ECEEEF;
    border-radius: 0.625rem;
    outline: none;
    transition: all 0.2s ease;
}
.pg-field-input.no-icon,
.pg-field-select.no-icon,
.pg-field-textarea { padding-left: 1rem; }
.pg-field-textarea {
    min-height: 6rem;
    resize: vertical;
    padding-top: 0.75rem;
}
.pg-field-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
    cursor: pointer;
}
.pg-field-input:hover,
.pg-field-select:hover,
.pg-field-textarea:hover {
    border-color: #d1d5db;
    background: #fff;
}
.pg-field-input:focus,
.pg-field-select:focus,
.pg-field-textarea:focus {
    border-color: #1A1D21;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(26, 29, 33, 0.08);
}
.pg-field-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-top: 0.375rem;
}

/* Form footer actions */
.pg-form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.75rem;
    background: #FAFBFC;
    border-top: 1px solid #ECEEEF;
}

/* Upload zone */
/* Importar inventario desde AutoDeal */
.pg-scrape-bar {
    max-width: 52rem;
    margin: 0 auto 1.25rem;
    padding: 1rem 1.25rem;
    border-radius: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 55%);
    border: 1px solid #ECEEEF;
    box-shadow: 0 2px 12px rgba(26, 29, 33, 0.06);
}

.pg-scrape-bar-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    justify-content: space-between;
}

.pg-scrape-bar-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.pg-scrape-bar-label strong {
    display: block;
    font-size: 0.9375rem;
    color: #111;
}

.pg-scrape-bar-label span {
    display: block;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

.pg-scrape-bar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    background: #1A1D21;
    color: #fff;
    flex-shrink: 0;
}

.pg-scrape-bar-icon .pg-svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    stroke: #fff;
}

.pg-scrape-bar-form {
    display: flex;
    flex: 1;
    min-width: min(100%, 320px);
    gap: 0.5rem;
}

.pg-scrape-url-input {
    flex: 1;
    min-width: 0;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    border: 1px solid #ECEEEF;
    border-radius: 0.625rem;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pg-scrape-url-input:focus {
    border-color: #1A1D21;
    box-shadow: 0 0 0 3px rgba(26, 29, 33, 0.08);
}

.pg-scrape-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.pg-scrape-btn.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

.pg-scrape-hint {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    color: #6b7280;
}

.pg-scrape-hint.is-success {
    color: #047857;
}

.pg-scrape-hint.is-error {
    color: #b91c1c;
}

.pg-scrape-preview {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #ECEEEF;
}

.pg-scrape-preview-title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin: 0 0 0.625rem;
}

.pg-scrape-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pg-scrape-preview-grid img {
    width: 4.5rem;
    height: 4.5rem;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 1px solid #ECEEEF;
}

.pg-upload-zone {
    border: 2px dashed #ECEEEF;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    background: #FAFBFC;
    transition: all 0.2s ease;
}
.pg-upload-zone:hover {
    border-color: #1A1D21;
    background: #F8F9FA;
}
.pg-upload-zone-icon {
    width: 2.5rem;
    height: 2.5rem;
    margin: 0 auto 0.75rem;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pg-upload-zone-icon .pg-svg {
    width: 2.5rem !important;
    height: 2.5rem !important;
    max-width: 2.5rem !important;
    max-height: 2.5rem !important;
}
.pg-upload-zone-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}
.pg-upload-zone-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}
.pg-upload-input {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    font-size: 0.8125rem;
}
.pg-upload-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
    cursor: pointer;
}
.pg-upload-zone.is-dragover {
    border-color: #1A1D21;
    background: #F0F1F2;
}
.pg-media-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}
.pg-media-item {
    position: relative;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #ECEEEF;
    background: #F8F9FA;
    aspect-ratio: 4 / 3;
}
.pg-media-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.pg-media-badge {
    position: absolute;
    bottom: 0.375rem;
    left: 0.375rem;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: #1A1D21;
    color: #fff;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
}
.pg-media-delete {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
}
.pg-media-delete-btn {
    width: 1.5rem;
    height: 1.5rem;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.pg-media-delete-btn:hover { background: #ef4444; }
.pg-media-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}
.pg-media-preview img,
.pg-media-preview video {
    width: 72px;
    height: 54px;
    object-fit: cover;
    border-radius: 0.375rem;
    border: 1px solid #ECEEEF;
}

/* Main content area subtle bg */
.pg-main-content {
    background: linear-gradient(180deg, #f7f8f9 0%, #ffffff 120px);
    min-height: calc(100vh - 4rem);
}

/* ——— Roles por color ——— */
.pg-role-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pg-role-badge:hover {
    transform: translateY(-1px);
}
.pg-role-badge-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
}
.pg-role-badge-btn:hover {
    box-shadow: 0 2px 8px rgba(26, 29, 33, 0.12);
}
.pg-role-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.pg-role-modal[hidden] { display: none !important; }
.pg-role-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 17, 17, 0.45);
    backdrop-filter: blur(2px);
}
.pg-role-modal-panel {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 0.875rem;
    box-shadow: 0 20px 50px rgba(26, 29, 33, 0.2);
    border: 1px solid #ECEEEF;
    animation: scaleIn 0.25s ease-out;
}
.pg-role-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #F0F1F2;
}
.pg-role-modal-close {
    width: 2rem;
    height: 2rem;
    border: none;
    background: #F8F9FA;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
}
.pg-role-modal-close:hover { background: #ECEEEF; color: #111; }
.pg-role-modal-body { padding: 1.25rem 1.5rem 1.5rem; }
.pg-role-modal-resumen {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.5;
    margin-bottom: 1rem;
}
.pg-role-modal-subtitle {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}
.pg-role-modal-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.8125rem;
    color: #374151;
}
.pg-role-modal-list li {
    padding: 0.375rem 0 0.375rem 1.25rem;
    position: relative;
}
.pg-role-modal-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.65rem;
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    background: #1A1D21;
}
.pg-rol-descripcion-panel {
    margin-top: 0.75rem;
    padding: 1rem;
    background: #F8F9FA;
    border: 1px solid #ECEEEF;
    border-radius: 0.625rem;
}
.pg-rol-descripcion-resumen {
    font-size: 0.8125rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}
.pg-rol-descripcion-list {
    margin: 0;
    padding-left: 1.125rem;
    font-size: 0.75rem;
    color: #6b7280;
}
.pg-usuarios-oficina-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
    border-bottom: 1px solid #ECEEEF;
}
.pg-usuarios-oficina-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #ECEEEF;
    border-radius: 0.5rem;
    color: #1A1D21;
    flex-shrink: 0;
}
.pg-usuarios-oficina-icon .pg-svg {
    width: 1.125rem !important;
    height: 1.125rem !important;
    max-width: 1.125rem !important;
    max-height: 1.125rem !important;
}
.pg-usuarios-oficina-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    margin: 0;
}
.pg-usuarios-admin-card {
    border-color: #e9d5ff;
    box-shadow: 0 1px 3px rgba(107, 33, 168, 0.08);
}
.pg-usuarios-admin-card .pg-usuarios-oficina-head {
    background: linear-gradient(180deg, #faf5ff 0%, #fff 100%);
}
.pg-usuarios-oficina-icon--admin {
    color: #7c3aed;
    border-color: #e9d5ff;
    background: #faf5ff;
}
.pg-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 1rem 0 0.5rem;
}
.pg-pagination-num,
.pg-pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.625rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    background: #fff;
    border: 1px solid #ECEEEF;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.15s ease;
}
.pg-pagination-num:hover,
.pg-pagination-btn:hover {
    background: #F8F9FA;
    border-color: #d1d5db;
}
.pg-pagination-num.is-active {
    background: #1A1D21;
    border-color: #1A1D21;
    color: #fff;
}

.pg-pagination-wrap {
    padding: 1rem 1.25rem;
    border-top: 1px solid #eceeef;
    background: #f8f9fa;
}

.pg-pagination-info {
    text-align: center;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-bottom: 0.75rem;
}

.pg-pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    color: #9ca3af;
    font-size: 0.875rem;
}
.pg-role-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    animation: rolePulse 2s ease-in-out infinite;
}
@keyframes rolePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.9); }
}
.pg-role-dueno {
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    color: #6b21a8;
    border: 1px solid #e9d5ff;
}
.pg-role-dueno .pg-role-dot { background: #9333ea; }
.pg-role-gerente {
    background: linear-gradient(135deg, #dbeafe 0%, #e0f2fe 100%);
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}
.pg-role-gerente .pg-role-dot { background: #3b82f6; }
.pg-role-asesor {
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
    color: #047857;
    border: 1px solid #a7f3d0;
}
.pg-role-asesor .pg-role-dot { background: #10b981; }
.pg-role-inventario {
    background: linear-gradient(135deg, #ffedd5 0%, #fff7ed 100%);
    color: #c2410c;
    border: 1px solid #fed7aa;
}
.pg-role-inventario .pg-role-dot { background: #f97316; }
.pg-role-default {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}
.pg-role-default .pg-role-dot { background: #9ca3af; }

.pg-avatar.pg-role-dueno { background: linear-gradient(135deg, #7c3aed, #9333ea); }
.pg-avatar.pg-role-gerente { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.pg-avatar.pg-role-asesor { background: linear-gradient(135deg, #059669, #10b981); }
.pg-avatar.pg-role-inventario { background: linear-gradient(135deg, #ea580c, #f97316); }
.pg-avatar.pg-role-default { background: #1A1D21; }

/* Badges estado inventario */
.pg-badge {
    display: inline-flex;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: capitalize;
}
.pg-badge-success { background: #d1fae5; color: #047857; }
.pg-badge-warning { background: #fef3c7; color: #b45309; }
.pg-badge-info { background: #e0f2fe; color: #0369a1; }
.pg-badge-muted { background: #f3f4f6; color: #6b7280; }

/* UI amigable — animaciones */
.pg-card-hover {
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, border-color 0.2s;
}
.pg-card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(26, 29, 33, 0.1);
    border-color: #d1d5db;
}
.pg-stagger-item {
    opacity: 0;
    animation: fadeInUp 0.45s ease-out forwards;
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.pg-page-enter { animation: fadeIn 0.4s ease-out; }
.pg-table-row {
    transition: background 0.15s ease;
}
.pg-table-row:hover {
    background: #FAFBFC;
}
.pg-empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #9ca3af;
}
.pg-empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
    opacity: 0.6;
}
.pg-inventario-card-image {
    height: 10rem;
    background: linear-gradient(145deg, #f8f9fa 0%, #eceeef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.pg-inventario-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.pg-card-hover:hover .pg-inventario-card-image img {
    transform: scale(1.05);
}
.pg-inventario-placeholder {
    font-size: 3rem;
    opacity: 0.35;
    animation: floatIcon 3s ease-in-out infinite;
}

/* Inventario — acciones en tarjeta */
.pg-inv-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.875rem;
    padding-top: 0.875rem;
    border-top: 1px solid #ECEEEF;
    flex-wrap: wrap;
}
.pg-inv-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}
.pg-inv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    border-radius: 0.5rem;
    border: 1px solid transparent;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.pg-inv-btn:active {
    transform: translateY(0);
}
.pg-inv-btn .pg-btn-icon {
    opacity: 0.92;
}
.pg-inv-btn-show {
    color: #fff;
    background: linear-gradient(145deg, #1A1D21 0%, #343a42 100%);
    box-shadow: 0 2px 6px rgba(26, 29, 33, 0.18);
}
.pg-inv-btn-show:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 29, 33, 0.28);
    background: linear-gradient(145deg, #2d3238 0%, #1A1D21 100%);
}
.pg-inv-btn-show:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 29, 33, 0.2);
}
.pg-inv-btn-edit {
    color: #1A1D21;
    background: #fff;
    border-color: #ECEEEF;
}
.pg-inv-btn-edit:hover {
    background: #F8F9FA;
    border-color: #c5c9ce;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(26, 29, 33, 0.08);
}
.pg-inv-btn-edit:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(26, 29, 33, 0.1);
}
@media (max-width: 380px) {
    .pg-inv-card-foot {
        flex-direction: column;
        align-items: stretch;
    }
    .pg-inv-card-actions {
        margin-left: 0;
        width: 100%;
    }
    .pg-inv-btn {
        flex: 1;
    }
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* SweetAlert2 — acorde al diseño PGCRM */
.swal2-popup {
    font-family: system-ui, -apple-system, sans-serif;
    border-radius: 1rem;
}
.swal2-title {
    color: #111111;
    font-weight: 600;
}
.swal2-html-container {
    color: #4b5563;
}
.swal2-confirm {
    font-weight: 600 !important;
    border-radius: 0.5rem !important;
}
.swal2-cancel {
    font-weight: 500 !important;
    border-radius: 0.5rem !important;
}

/* ——— Sidebar abrir / cerrar ——— */
:root {
    --sidebar-width: 16rem;
}

.pg-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar-width);
    background: #1A1D21;
    color: #fff;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
}

html.sidebar-open .pg-sidebar {
    transform: translateX(0);
}

@keyframes pgBrandTitleIn {
    from {
        opacity: 0;
        transform: translateX(-12px);
        letter-spacing: 0.06em;
    }
    to {
        opacity: 1;
        transform: translateX(0);
        letter-spacing: -0.02em;
    }
}

@keyframes pgBrandSubIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.96);
        filter: blur(3px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.pg-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 4rem;
    padding: 0.65rem 0.75rem 0.65rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.pg-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.pg-sidebar-logo {
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.pg-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.125rem;
    min-width: 0;
    flex: 1;
    line-height: 1.2;
    overflow: hidden;
}

.pg-sidebar-title {
    display: block;
    font-size: clamp(0.8125rem, 2.8vw, 0.9375rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.pg-brand-anim-title {
    animation: pgBrandTitleIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pg-sidebar-subtitle {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin: 0;
    font-size: clamp(0.625rem, 2.4vw, 0.6875rem);
    font-weight: 500;
    color: rgba(255, 255, 255, 0.58);
    line-height: 1.35;
    letter-spacing: 0.02em;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.pg-brand-anim-sub {
    animation: pgBrandSubIn 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.14s both;
}

@media (prefers-reduced-motion: reduce) {
    .pg-brand-anim-title,
    .pg-brand-anim-sub {
        animation: none;
    }
}

@media (max-width: 380px) {
    :root {
        --sidebar-width: 15rem;
    }

    .pg-sidebar-header {
        padding-left: 1rem;
    }

    .pg-sidebar-brand {
        gap: 0.5rem;
    }
}

.pg-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.pg-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #9ca3af;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 0.125rem;
}

.pg-sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.pg-sidebar-nav a.active {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.pg-sidebar-nav a svg {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

/* Footer — cerrar sesión */
.pg-sidebar-footer {
    flex-shrink: 0;
    padding: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.18) 100%);
}

.pg-sidebar-logout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border-radius: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    color: #fecaca;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.3);
    position: relative;
    overflow: hidden;
    transition: color 0.25s, background 0.25s, border-color 0.25s,
        transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s;
}

.pg-sidebar-logout::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 0%,
        rgba(255, 255, 255, 0.12) 45%,
        transparent 90%
    );
    transform: translateX(-120%);
    transition: transform 0.55s ease;
}

.pg-sidebar-logout:hover::before {
    transform: translateX(120%);
}

.pg-sidebar-logout:hover {
    color: #fff;
    background: rgba(220, 38, 38, 0.45);
    border-color: rgba(248, 113, 113, 0.55);
    transform: scale(1.02);
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.35);
}

.pg-sidebar-logout:active {
    transform: scale(0.98);
}

.pg-sidebar-logout-icon {
    display: flex;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pg-sidebar-logout:hover .pg-sidebar-logout-icon {
    transform: translateX(3px);
}

.pg-sidebar-logout-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}

/* Créditos — estilo terminal / hacking */
.pg-credit-footer {
    position: relative;
    margin-top: 0.75rem;
    padding: 0.65rem 0.5rem 0.35rem;
    border-radius: 0.5rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(0, 255, 136, 0.12);
    box-shadow: inset 0 0 24px rgba(0, 255, 136, 0.04);
}

.pg-credit-footer::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 255, 136, 0.03) 2px,
        rgba(0, 255, 136, 0.03) 4px
    );
    pointer-events: none;
    animation: pgCreditScan 6s linear infinite;
}

.pg-credit-footer::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    top: -2px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 136, 0.55), transparent);
    animation: pgCreditSweep 3.2s ease-in-out infinite;
    pointer-events: none;
}

.pg-credit-line {
    position: relative;
    z-index: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.15rem;
    font-family: 'Share Tech Mono', 'Courier New', Consolas, monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1.4;
}

.pg-credit-prefix {
    color: #00ff88;
    opacity: 0.85;
    animation: pgCreditBlink 1.2s step-end infinite;
}

.pg-credit-text {
    color: #6ee7b7;
    text-shadow:
        0 0 6px rgba(0, 255, 136, 0.55),
        0 0 14px rgba(0, 255, 136, 0.25);
    animation: pgCreditGlow 2.8s ease-in-out infinite, pgCreditGlitch 4.5s steps(1) infinite;
}

.pg-credit-cursor {
    color: #00ff88;
    font-weight: 700;
    animation: pgCreditCursor 0.85s step-end infinite;
}

@keyframes pgCreditScan {
    0% { transform: translateY(0); }
    100% { transform: translateY(8px); }
}

@keyframes pgCreditSweep {
    0%, 100% {
        top: -2px;
        opacity: 0;
    }
    15% {
        opacity: 1;
    }
    50% {
        top: 100%;
        opacity: 0.6;
    }
}

@keyframes pgCreditGlow {
    0%, 100% {
        text-shadow:
            0 0 6px rgba(0, 255, 136, 0.5),
            0 0 12px rgba(0, 255, 136, 0.2);
        opacity: 0.92;
    }
    50% {
        text-shadow:
            0 0 10px rgba(0, 255, 136, 0.85),
            0 0 22px rgba(0, 255, 136, 0.4),
            0 0 32px rgba(52, 211, 153, 0.2);
        opacity: 1;
    }
}

@keyframes pgCreditGlitch {
    0%, 92%, 100% {
        transform: translate(0);
        filter: none;
    }
    93% {
        transform: translate(-1px, 0);
        text-shadow: 2px 0 #ff0080, -2px 0 #00ff88;
    }
    94% {
        transform: translate(1px, 0);
        text-shadow: -2px 0 #00d4ff, 2px 0 #00ff88;
    }
    95% {
        transform: translate(0);
    }
}

@keyframes pgCreditCursor {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

@keyframes pgCreditBlink {
    0%, 70% { opacity: 0.85; }
    71%, 72% { opacity: 0.2; }
    73%, 100% { opacity: 0.85; }
}

@media (prefers-reduced-motion: reduce) {
    .pg-credit-footer::before,
    .pg-credit-footer::after,
    .pg-credit-prefix,
    .pg-credit-text,
    .pg-credit-cursor {
        animation: none;
    }
}

.pg-login-footer {
    padding: 0 1rem 2rem;
    max-width: 28rem;
    width: 100%;
    margin: 0 auto;
}

.pg-login-card-footer .pg-credit-footer--login-rich {
    width: 100%;
    padding: 0.65rem 0.5rem 0.5rem;
    margin-top: 0;
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #0f1419 0%, #0a0e12 100%);
    border: 1px solid rgba(0, 255, 136, 0.12);
}

.pg-credit-footer--login {
    margin-top: 0;
}

/* Login — footer echo + panda */
.pg-login-footer-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.65rem;
    padding: 1.25rem 0.75rem 0.5rem;
}

.pg-echo-waves {
    position: absolute;
    top: 0.5rem;
    left: 50%;
    width: 4rem;
    height: 4rem;
    margin-left: -2rem;
    pointer-events: none;
}

.pg-echo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 1px solid rgba(0, 255, 136, 0.45);
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.15);
    opacity: 0;
    animation: pgEchoRing 2.8s ease-out infinite;
}

.pg-echo-ring--2 { animation-delay: 0.55s; }
.pg-echo-ring--3 { animation-delay: 1.1s; }
.pg-echo-ring--4 { animation-delay: 1.65s; }

@keyframes pgEchoRing {
    0% {
        transform: scale(0.35);
        opacity: 0.85;
    }
    70% {
        opacity: 0.25;
    }
    100% {
        transform: scale(2.6);
        opacity: 0;
    }
}

.pg-panda-ascii {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 0;
    font-family: 'Share Tech Mono', 'Courier New', Consolas, monospace;
    font-size: 0.72rem;
    line-height: 1.15;
    text-align: center;
    color: #a7f3d0;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    animation: pgPandaFloat 3s ease-in-out infinite;
    white-space: pre;
}

.pg-panda-eye {
    color: #00ff88;
    animation: pgPandaBlink 4s step-end infinite;
}

.pg-panda-core {
    color: #fef08a;
    text-shadow: 0 0 10px rgba(254, 240, 138, 0.8);
    animation: pgPandaCorePulse 1.6s ease-in-out infinite;
}

.pg-panda-ear,
.pg-panda-face,
.pg-panda-nose,
.pg-panda-body,
.pg-panda-paw,
.pg-panda-feet {
    color: #6ee7b7;
}

@keyframes pgPandaFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

@keyframes pgPandaBlink {
    0%, 88%, 100% { opacity: 1; }
    90%, 94% { opacity: 0.15; }
}

@keyframes pgPandaCorePulse {
    0%, 100% { opacity: 0.85; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.15); }
}

.pg-echo-stack {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    margin-top: -0.25rem;
}

.pg-echo-phrase {
    position: absolute;
    left: 50%;
    bottom: 0;
    margin: 0;
    transform: translateX(-50%);
    font-family: 'Share Tech Mono', 'Courier New', Consolas, monospace;
    font-size: 0.625rem;
    letter-spacing: 0.12em;
    text-transform: lowercase;
    white-space: nowrap;
    color: #00ff88;
    opacity: 0;
    animation: pgEchoPhrase 3.2s ease-out infinite;
    text-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

.pg-echo-phrase--1 {
    animation-delay: 0s;
    font-size: 0.72rem;
    font-weight: 700;
    color: #6ee7b7;
    text-shadow:
        0 0 8px rgba(0, 255, 136, 0.7),
        0 0 18px rgba(0, 255, 136, 0.35);
}

.pg-echo-phrase--2 { animation-delay: 0.35s; }
.pg-echo-phrase--3 { animation-delay: 0.7s; }
.pg-echo-phrase--4 { animation-delay: 1.05s; }

@keyframes pgEchoPhrase {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.92);
        filter: blur(2px);
    }
    12% {
        opacity: 0.95;
        filter: blur(0);
    }
    45% {
        opacity: 0.55;
        transform: translateX(-50%) scale(1.02);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) scale(1.18);
        filter: blur(3px);
    }
}

.pg-credit-footer--login-rich {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.75rem 0.65rem 0.55rem;
    animation: pgLoginCreditPulse 4s ease-in-out infinite;
}

@keyframes pgLoginCreditPulse {
    0%, 100% {
        border-color: rgba(0, 255, 136, 0.12);
        box-shadow:
            inset 0 0 24px rgba(0, 255, 136, 0.04),
            0 0 0 rgba(0, 255, 136, 0);
    }
    50% {
        border-color: rgba(0, 255, 136, 0.35);
        box-shadow:
            inset 0 0 32px rgba(0, 255, 136, 0.08),
            0 0 20px rgba(0, 255, 136, 0.12);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pg-echo-ring,
    .pg-panda-ascii,
    .pg-panda-eye,
    .pg-panda-core,
    .pg-echo-phrase,
    .pg-credit-footer--login-rich {
        animation: none;
    }
    .pg-echo-phrase--1 {
        opacity: 1;
        position: relative;
        transform: translateX(-50%);
    }
    .pg-echo-phrase--2,
    .pg-echo-phrase--3,
    .pg-echo-phrase--4 {
        display: none;
    }
}

/* Avatar topbar → burbuja mi cuenta */
.pg-topbar-user-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1rem;
    border-left: 1px solid #eceeef;
}

.pg-topbar-user-meta {
    display: none;
    text-align: right;
    min-width: 0;
}

@media (min-width: 640px) {
    .pg-topbar-user-meta {
        display: block;
    }
}

.pg-topbar-user-name {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: #111111;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 12rem;
}

.pg-topbar-user-rol {
    margin-top: 0.125rem;
    display: flex;
    justify-content: flex-end;
}

.pg-topbar-avatar {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 9999px;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.pg-profile-trigger {
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pg-profile-trigger:hover {
    transform: scale(1.06);
    box-shadow: 0 0 0 3px rgba(26, 29, 33, 0.12);
}

.pg-profile-trigger[aria-expanded="true"] {
    transform: scale(1.06);
    box-shadow: 0 0 0 3px rgba(26, 29, 33, 0.18);
}

.pg-profile-backdrop {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(17, 17, 17, 0.35);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.pg-profile-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.pg-profile-bubble {
    position: fixed;
    z-index: 60;
    width: min(20rem, calc(100vw - 1.5rem));
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px) scale(0.96);
    transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1),
        visibility 0.28s;
    pointer-events: none;
}

.pg-profile-bubble.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.pg-profile-bubble-card {
    position: relative;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.18);
    padding: 1.25rem;
    border: 1px solid #ECEEEF;
}

.pg-profile-bubble-arrow {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #fff;
    border-right: 1px solid #ECEEEF;
    border-bottom: 1px solid #ECEEEF;
    transform: rotate(45deg);
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.06);
}

.pg-profile-bubble--below .pg-profile-bubble-arrow {
    top: -6px;
}

.pg-profile-bubble--above .pg-profile-bubble-arrow {
    bottom: -6px;
}

.pg-profile-bubble-close {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    border: none;
    background: #F8F9FA;
    border-radius: 0.5rem;
    font-size: 1.25rem;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.pg-profile-bubble-close:hover {
    background: #ECEEEF;
    color: #111;
}

.pg-profile-bubble-head {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-right: 1.5rem;
}

.pg-profile-bubble-avatar {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.pg-profile-bubble-avatar.pg-role-dueno { background: linear-gradient(135deg, #7c3aed, #9333ea); }
.pg-profile-bubble-avatar.pg-role-gerente { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.pg-profile-bubble-avatar.pg-role-asesor { background: linear-gradient(135deg, #059669, #10b981); }
.pg-profile-bubble-avatar.pg-role-inventario { background: linear-gradient(135deg, #ea580c, #f97316); }
.pg-profile-bubble-avatar.pg-role-default { background: #1A1D21; }

.pg-profile-bubble-title {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.pg-profile-bubble-sub {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0.15rem 0 0;
    word-break: break-all;
}

.pg-profile-bubble-note {
    font-size: 0.75rem;
    color: #6b7280;
    background: #F8F9FA;
    border-radius: 0.5rem;
    padding: 0.5rem 0.625rem;
    margin: 0 0 0.875rem;
    line-height: 1.4;
}

.pg-profile-bubble-form {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.pg-profile-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pg-profile-field span {
    font-size: 0.75rem;
    font-weight: 500;
    color: #374151;
}

.pg-profile-field input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid #ECEEEF;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pg-profile-field input:focus {
    outline: none;
    border-color: #1A1D21;
    box-shadow: 0 0 0 3px rgba(26, 29, 33, 0.08);
}

.pg-profile-msg {
    font-size: 0.8125rem;
    padding: 0.5rem 0.625rem;
    border-radius: 0.5rem;
    margin: 0;
}

.pg-profile-msg.is-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.pg-profile-msg.is-success {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}

.pg-profile-submit {
    margin-top: 0.25rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: #1A1D21;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.pg-profile-submit:hover {
    background: #2d3139;
}

.pg-profile-submit:active {
    transform: scale(0.98);
}

.pg-profile-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.pg-sidebar-header .pg-sidebar-toggle {
    flex-shrink: 0;
}

.pg-sidebar-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.pg-sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.pg-sidebar-toggle svg {
    width: 1.125rem;
    height: 1.125rem;
}

#sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

html.sidebar-open #sidebar-overlay {
    opacity: 1;
    visibility: visible;
}

.pg-main-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin-left: 0;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#sidebar-toggle .icon-close { display: none; }
#sidebar-toggle .icon-open { display: block; }

html.sidebar-open #sidebar-toggle .icon-close { display: block; }
html.sidebar-open #sidebar-toggle .icon-open { display: none; }

/* Escritorio: sidebar abierto empuja contenido */
@media (min-width: 1024px) {
    html.sidebar-open .pg-main-wrapper {
        margin-left: var(--sidebar-width);
    }

    html.sidebar-open #sidebar-overlay {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    .pg-sidebar {
        transform: translateX(-100%);
    }

    html.sidebar-open .pg-sidebar {
        transform: translateX(0);
    }
}

/* Móvil: overlay solo cuando abierto */
@media (max-width: 1023px) {
    html.sidebar-closed #sidebar-overlay {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

/* Burbuja presentación inventario (listado) */
.pg-inv-bubble {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s;
    pointer-events: none;
}

.pg-inv-bubble.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.pg-inv-bubble-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 17, 20, 0.65);
    backdrop-filter: blur(6px);
}

.pg-inv-bubble-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 100%);
    max-height: calc(100vh - 1.5rem);
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #0f1114 0%, #1a1d21 45%, #2a3038 100%);
    color: #fff;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: scale(0.94) translateY(12px);
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pg-inv-bubble.is-open .pg-inv-bubble-dialog {
    transform: scale(1) translateY(0);
}

.pg-inv-bubble-head .pg-showcase-print {
    margin-left: auto;
}

.pg-inv-bubble-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.pg-inv-bubble .pg-showcase-main {
    max-width: none;
    margin: 0;
    padding: 1.25rem 1.5rem 1.5rem;
}

.pg-inv-bubble-dock {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    transform: none !important;
    max-width: none !important;
    width: auto !important;
    margin: 0 1rem 1rem;
    pointer-events: auto;
}

body.pg-inv-bubble-open {
    overflow: hidden;
}

@media print {
    @page {
        margin: 1cm;
        size: auto;
    }

    /* La burbuja vive dentro de #main-wrapper, no como hijo directo de body */
    body.pg-inv-bubble-open .pg-sidebar,
    body.pg-inv-bubble-open #sidebar-overlay,
    body.pg-inv-bubble-open #pg-profile-bubble,
    body.pg-inv-bubble-open #main-wrapper > header,
    body.pg-inv-bubble-open #pg-flash-data,
    body.pg-inv-bubble-open .pg-main-content > *:not(#pg-inv-bubble) {
        display: none !important;
    }

    body.pg-inv-bubble-open {
        overflow: visible !important;
        background: #fff !important;
    }

    body.pg-inv-bubble-open #main-wrapper,
    body.pg-inv-bubble-open .pg-main-content {
        margin: 0 !important;
        padding: 0 !important;
        min-height: 0 !important;
    }

    body.pg-inv-bubble-open #pg-inv-bubble,
    body.pg-inv-bubble-open #pg-inv-bubble[hidden] {
        display: flex !important;
        position: static !important;
        inset: auto !important;
        width: 100% !important;
        max-width: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        padding: 0 !important;
        z-index: auto !important;
    }

    body.pg-inv-bubble-open .pg-inv-bubble-backdrop,
    body.pg-inv-bubble-open .pg-inv-bubble-head,
    body.pg-inv-bubble-open .pg-inv-bubble-dock,
    body.pg-inv-bubble-open .pg-showcase-nav,
    body.pg-inv-bubble-open .pg-showcase-filters,
    body.pg-inv-bubble-open .pg-showcase-unit-bar,
    body.pg-inv-bubble-open .pg-showcase-thumbs,
    body.pg-inv-bubble-open #pg-showcase-actions,
    body.pg-inv-bubble-open .pg-showcase-media-badge,
    body.pg-inv-bubble-open .pg-showcase-media-counter {
        display: none !important;
    }

    body.pg-inv-bubble-open .pg-inv-bubble-dialog {
        max-height: none !important;
        width: 100% !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        transform: none !important;
        border: none !important;
        background: #fff !important;
        color: #111 !important;
        overflow: visible !important;
    }

    body.pg-inv-bubble-open .pg-inv-bubble-scroll {
        overflow: visible !important;
    }

    body.pg-inv-bubble-open .pg-showcase-title,
    body.pg-inv-bubble-open .pg-showcase-type,
    body.pg-inv-bubble-open .pg-showcase-meta,
    body.pg-inv-bubble-open .pg-showcase-price,
    body.pg-inv-bubble-open .pg-showcase-price-alt,
    body.pg-inv-bubble-open .pg-showcase-price-label {
        color: #111 !important;
    }

    body.pg-inv-bubble-open .pg-showcase-desc {
        background: #f9fafb !important;
        border: 1px solid #e5e7eb !important;
    }

    body.pg-inv-bubble-open .pg-showcase-desc p {
        color: #333 !important;
    }

    body.pg-inv-bubble-open .pg-showcase-hero {
        background: #f3f4f6 !important;
        break-inside: avoid;
    }

    body.pg-inv-bubble-open .pg-showcase-hero {
        max-height: 420px;
    }

    body.pg-inv-bubble-open .pg-showcase-hero img,
    body.pg-inv-bubble-open .pg-showcase-hero video,
    body.pg-inv-bubble-open .pg-showcase-hero-video {
        object-fit: contain;
    }

    body.pg-inv-bubble-open .pg-badge {
        border: 1px solid #d1d5db;
        color: #111 !important;
    }

    body.pg-inv-bubble-open .swal2-container {
        display: none !important;
    }

    body.pg-inv-bubble-open {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Presentación inventario (vista cliente / pestaña) */
.pg-showcase-body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(160deg, #0f1114 0%, #1a1d21 45%, #2a3038 100%);
    color: #fff;
    font-family: system-ui, -apple-system, sans-serif;
}

.pg-showcase-top {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pg-showcase-back,
.pg-showcase-edit,
.pg-showcase-print {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    color: #e5e7eb;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    cursor: pointer;
}

.pg-showcase-print { margin-left: auto; }

.pg-showcase-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem 3rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    .pg-showcase-main {
        grid-template-columns: 1.15fr 1fr;
        align-items: start;
    }
}

.pg-showcase-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    max-height: min(52vh, 480px);
    min-height: 12rem;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#pg-showcase-hero-inner,
.pg-showcase-hero-inner {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.pg-showcase-hero img,
.pg-showcase-hero video,
#pg-showcase-hero-inner img,
.pg-showcase-hero-video {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
}

.pg-showcase-hero-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: clamp(2.5rem, 8vw, 5rem);
    opacity: 0.5;
}

.pg-showcase-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.pg-showcase-thumb {
    flex: 0 0 72px;
    height: 54px;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 2px solid transparent;
    padding: 0;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.3);
}

.pg-showcase-thumb.is-active {
    border-color: #fff;
}

.pg-showcase-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pg-showcase-videos {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pg-showcase-video {
    width: 100%;
    border-radius: 0.75rem;
    max-height: 280px;
    background: #000;
}

.pg-showcase-type {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.pg-showcase-title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 0.35rem;
}

.pg-showcase-meta {
    color: #9ca3af;
    margin-bottom: 1.5rem;
}

.pg-showcase-prices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 520px) {
    .pg-showcase-prices {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1rem;
    }
}

.pg-showcase-prices > div {
    min-width: 0;
}

.pg-showcase-price-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.pg-showcase-price {
    display: block;
    font-size: clamp(1.375rem, 5vw, 2rem);
    font-weight: 700;
    margin-top: 0.25rem;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.pg-showcase-price-alt {
    display: block;
    font-size: clamp(1.125rem, 4vw, 1.35rem);
    font-weight: 600;
    margin-top: 0.25rem;
    line-height: 1.25;
    color: #d1d5db;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.pg-showcase-badge {
    margin-bottom: 1.5rem;
}

/* Acciones rápidas asesor (dentro de burbuja inventario) */
.pg-showcase-actions {
    margin-top: 1.25rem;
    padding: 0;
    border-radius: 0.875rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.pg-showcase-actions-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1rem;
    border: none;
    background: transparent;
    cursor: pointer;
    color: inherit;
    text-align: left;
    transition: background 0.2s ease;
}

.pg-showcase-actions-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
}

.pg-showcase-actions.is-open .pg-showcase-actions-toggle {
    background: rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.pg-showcase-actions-chevron {
    font-size: 0.625rem;
    color: #9ca3af;
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.pg-showcase-actions.is-open .pg-showcase-actions-chevron {
    transform: rotate(180deg);
}

.pg-showcase-actions-body {
    padding: 0 1rem 1rem;
}

.pg-showcase-actions-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #e5e7eb;
    margin-bottom: 0;
}

.pg-showcase-actions-icon {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.875rem;
}

.pg-quick-precio-pick {
    margin-bottom: 0.875rem;
    padding-top: 0.875rem;
}

.pg-quick-precio-label {
    display: block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.pg-quick-precio-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.pg-quick-precio-opt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    color: #d1d5db;
    cursor: pointer;
    text-align: left;
    transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.15s;
}

.pg-quick-precio-opt:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.pg-quick-precio-opt.is-active {
    background: #fff;
    border-color: #fff;
    color: #1a1d21;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.pg-quick-precio-opt-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
}

.pg-quick-precio-val {
    font-size: 0.9375rem;
    font-weight: 700;
    line-height: 1.2;
}

.pg-showcase-actions-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.pg-quick-tab {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    background: transparent;
    color: #d1d5db;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.pg-quick-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.pg-quick-tab.is-active {
    background: #fff;
    color: #1a1d21;
    border-color: #fff;
}

.pg-quick-hint {
    font-size: 0.75rem;
    color: #9ca3af;
    margin: 0 0 0.75rem;
    line-height: 1.4;
}

.pg-quick-form {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.pg-quick-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
}

@media (max-width: 520px) {
    .pg-quick-grid {
        grid-template-columns: 1fr;
    }
}

.pg-quick-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.pg-quick-field-full {
    grid-column: 1 / -1;
}

.pg-quick-field span {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pg-quick-field input,
.pg-quick-field select,
.pg-quick-field textarea {
    width: 100%;
    padding: 0.5rem 0.625rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-size: 0.875rem;
}

.pg-quick-field input:focus,
.pg-quick-field select:focus,
.pg-quick-field textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
}

.pg-quick-field select option {
    color: #111;
    background: #fff;
}

.pg-quick-submit {
    margin-top: 0.25rem;
    padding: 0.625rem 1rem;
    border: none;
    border-radius: 0.5rem;
    background: #fff;
    color: #1a1d21;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}

.pg-quick-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.pg-quick-submit-alt {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.pg-showcase-desc {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.pg-showcase-desc h2 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.pg-showcase-desc p {
    line-height: 1.6;
    color: #e5e7eb;
}

.pg-showcase-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.875rem;
}

.pg-showcase-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: #d1d5db;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.pg-showcase-filter:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.pg-showcase-filter.is-active {
    background: #fff;
    border-color: #fff;
    color: #1a1d21;
}

.pg-showcase-filter-count {
    display: inline-flex;
    min-width: 1.25rem;
    justify-content: center;
    padding: 0 0.35rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.6875rem;
    font-weight: 700;
}

.pg-showcase-filter.is-active .pg-showcase-filter-count {
    background: rgba(26, 29, 33, 0.12);
}

.pg-showcase-unit-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.625rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pg-showcase-nav-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.pg-showcase-nav-counter {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #e5e7eb;
    min-width: 3.5rem;
    text-align: center;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.pg-showcase-hero-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.pg-showcase-nav {
    flex: 0 0 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}

.pg-showcase-nav-unit {
    flex: 0 0 2.25rem;
    height: 2.25rem;
    font-size: 1.35rem;
}

.pg-showcase-nav-media {
    flex: 0 0 2.75rem;
    height: 2.75rem;
    background: rgba(0, 0, 0, 0.35);
    border-color: rgba(255, 255, 255, 0.25);
}

.pg-showcase-nav:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.22);
    transform: scale(1.04);
}

.pg-showcase-nav:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none;
}

.pg-showcase-hero-wrap .pg-showcase-hero {
    flex: 1;
    min-width: 0;
    max-width: 100%;
}

.pg-showcase-gallery,
.pg-showcase-info {
    min-width: 0;
    max-width: 100%;
}

/* Showcase inventario — móvil y pantallas estrechas */
@media (max-width: 767px) {
    .pg-inv-bubble {
        padding: 0;
        align-items: stretch;
    }

    .pg-inv-bubble-dialog {
        width: 100%;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100%;
        border-radius: 0;
    }

    .pg-inv-bubble.is-open .pg-inv-bubble-dialog {
        transform: none;
    }

    .pg-inv-bubble .pg-showcase-main {
        padding: 1rem 1rem 1.5rem;
        gap: 1.25rem;
    }

    .pg-inv-bubble-head.pg-showcase-top {
        padding: 0.65rem 0.875rem;
        gap: 0.5rem;
    }

    .pg-showcase-back,
    .pg-showcase-edit,
    .pg-showcase-print {
        font-size: 0.8125rem;
        padding: 0.45rem 0.7rem;
    }

    .pg-showcase-title {
        font-size: clamp(1.35rem, 6vw, 1.75rem);
        word-break: break-word;
    }

    .pg-showcase-meta {
        font-size: 0.875rem;
        line-height: 1.45;
        margin-bottom: 1rem;
    }

    .pg-showcase-filters {
        gap: 0.4rem;
        margin-bottom: 0.75rem;
    }

    .pg-showcase-filter {
        font-size: 0.8125rem;
        padding: 0.4rem 0.65rem;
        max-width: 100%;
    }

    .pg-showcase-filter-count {
        flex-shrink: 0;
        min-width: 1.35rem;
    }

    /* Barra vehículo: flechas a los lados, texto centrado */
    .pg-showcase-unit-bar {
        display: grid;
        grid-template-columns: 2.75rem 1fr 2.75rem;
        grid-template-rows: auto auto;
        gap: 0.2rem 0.5rem;
        padding: 0.5rem 0.4rem;
        margin-bottom: 0.65rem;
    }

    #pg-showcase-unit-prev {
        grid-column: 1;
        grid-row: 1 / span 2;
        align-self: center;
        justify-self: center;
    }

    #pg-showcase-unit-next {
        grid-column: 3;
        grid-row: 1 / span 2;
        align-self: center;
        justify-self: center;
    }

    .pg-showcase-unit-bar .pg-showcase-nav-label {
        grid-column: 2;
        grid-row: 1;
        justify-self: center;
    }

    .pg-showcase-unit-bar .pg-showcase-nav-counter {
        grid-column: 2;
        grid-row: 2;
        justify-self: center;
        min-width: 0;
        font-size: 0.9375rem;
    }

    /* Fotos/videos: flechas sobre la imagen */
    .pg-showcase-hero-wrap {
        position: relative;
        display: block;
        margin-bottom: 0.65rem;
    }

    .pg-showcase-hero-wrap .pg-showcase-hero {
        width: 100%;
    }

    .pg-showcase-nav-media {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 4;
        flex: none;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.35rem;
        background: rgba(0, 0, 0, 0.45);
        border-color: rgba(255, 255, 255, 0.3);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    }

    .pg-showcase-nav-media:hover:not(:disabled) {
        transform: translateY(-50%) scale(1.05);
    }

    #pg-showcase-media-prev {
        left: 0.4rem;
    }

    #pg-showcase-media-next {
        right: 0.4rem;
    }

    .pg-showcase-hero {
        aspect-ratio: 4 / 3;
        max-height: min(42vh, 320px);
        min-height: 11rem;
    }

    .pg-showcase-media-counter {
        font-size: 0.8125rem;
        padding: 0.25rem 0.55rem;
        white-space: nowrap;
    }

    .pg-showcase-prices {
        grid-template-columns: 1fr;
    }

    .pg-showcase-actions-tabs {
        flex-direction: column;
    }

    .pg-quick-tab {
        width: 100%;
        text-align: center;
    }

    .pg-quick-precio-val {
        font-size: clamp(0.8125rem, 3.5vw, 0.9375rem);
        word-break: break-word;
        overflow-wrap: anywhere;
        max-width: 100%;
    }

    .pg-inv-bubble-dock {
        margin: 0 0.65rem 0.65rem;
    }
}

@media (max-width: 400px) {
    .pg-quick-precio-options {
        grid-template-columns: 1fr;
    }

    .pg-showcase-filter {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .pg-showcase-hero {
        aspect-ratio: 4 / 3;
        max-height: min(42vh, 320px);
        min-height: 10rem;
    }
}

.pg-showcase-media-badge {
    position: absolute;
    top: 0.625rem;
    left: 0.625rem;
    z-index: 2;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
}

.pg-showcase-media-counter {
    position: absolute;
    bottom: 0.625rem;
    right: 0.625rem;
    z-index: 2;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    min-width: auto;
}

.pg-showcase-hero-video {
    background: #000;
}

.pg-showcase-thumb.is-video {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    position: relative;
}

.pg-showcase-thumb-play {
    position: absolute;
    font-size: 1.25rem;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.pg-showcase-thumb-ph {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #9ca3af;
    margin-top: 1.25rem;
}

.pg-showcase-main.is-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.2s;
}

.pg-showcase-loader {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.pg-showcase-loader:not([hidden])::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.5rem;
    height: 2.5rem;
    margin: -1.25rem 0 0 -1.25rem;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: pg-spin 0.7s linear infinite;
}

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

/* Burbuja flotante — similares */
.pg-showcase-dock {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: min(100vw - 2rem, 640px);
    width: 100%;
    pointer-events: none;
}

.pg-showcase-dock > * {
    pointer-events: auto;
}

.pg-showcase-dock-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    border-radius: 999px;
    border: none;
    background: #fff;
    color: #1a1d21;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pg-showcase-dock-toggle.is-open {
    transform: scale(1.02);
}

.pg-showcase-dock-bubble {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #1a1d21;
    color: #fff;
    font-size: 0.75rem;
}

.pg-showcase-dock-count {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #1a1d21;
    color: #fff;
    font-size: 0.7rem;
    line-height: 1.25rem;
    text-align: center;
}

.pg-showcase-dock-panel {
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 1rem;
    border-radius: 1rem;
    background: rgba(26, 29, 33, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
}

.pg-showcase-dock-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-bottom: 0.75rem;
}

.pg-showcase-dock-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x mandatory;
}

.pg-showcase-dock-card {
    flex: 0 0 140px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
    border-radius: 0.75rem;
    border: 2px solid transparent;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    text-align: left;
    color: #fff;
    transition: border-color 0.2s, background 0.2s;
}

.pg-showcase-dock-card:hover {
    background: rgba(255, 255, 255, 0.12);
}

.pg-showcase-dock-card.is-active {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.pg-showcase-dock-card img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 0.5rem;
}

.pg-showcase-dock-card-ph {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 4 / 3;
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
}

.pg-showcase-dock-card-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    font-size: 0.7rem;
    color: #9ca3af;
}

.pg-showcase-dock-card-info strong {
    font-size: 0.8rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-showcase-body {
    padding-bottom: 5rem;
}

@media print {
    .pg-showcase-top,
    .pg-showcase-dock,
    .pg-showcase-nav { display: none !important; }
    .pg-showcase-body { background: #fff; color: #111; padding-bottom: 0; }
    .pg-showcase-desc { border-color: #ddd; background: #f9fafb; }
    .pg-showcase-desc p { color: #333; }
}

/* Ventas — listado y comprobante */
.pg-venta-card {
    padding: 1rem 1.25rem;
    border: 1px solid #eceeef;
    border-radius: 0.875rem;
    background: #fff;
    text-decoration: none;
    color: inherit;
}

.pg-venta-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
}

.pg-venta-folio {
    display: block;
    font-family: ui-monospace, monospace;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1d21;
    letter-spacing: 0.02em;
}

.pg-venta-folio.lg {
    font-size: 1.35rem;
}

.pg-venta-folio-label {
    display: block;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
    margin-top: 0.125rem;
}

.pg-venta-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
}

@media (min-width: 768px) {
    .pg-venta-card-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.pg-venta-meta-label {
    display: block;
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.pg-venta-meta-val {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #1a1d21;
}

.pg-venta-meta-sub {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
}

.pg-venta-monto {
    font-variant-numeric: tabular-nums;
}

.pg-venta-comprobante-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 2px solid #1a1d21;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
}

.pg-venta-comprobante-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1d21;
}

.pg-venta-comprobante-tipo {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #6b7280;
}

.pg-venta-comprobante-body {
    padding: 1.25rem 1.5rem;
}

.pg-venta-comprobante-highlight {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 1.25rem;
    border-radius: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #eceeef;
}

.pg-venta-comprobante-highlight .label,
.pg-venta-dl dt {
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.pg-venta-comprobante-highlight .value {
    display: block;
    font-weight: 600;
    color: #1a1d21;
}

.pg-venta-comprobante-section {
    margin-bottom: 1.25rem;
}

.pg-venta-comprobante-section h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 0.625rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid #eceeef;
}

.pg-venta-dl {
    display: grid;
    gap: 0.5rem;
}

.pg-venta-dl div {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 0.5rem;
    align-items: baseline;
}

.pg-venta-dl dd {
    margin: 0;
    font-size: 0.875rem;
    color: #1a1d21;
}

.pg-venta-monto-lg {
    font-size: 1.25rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pg-venta-comprobante-foot {
    padding: 1rem 1.5rem;
    border-top: 1px solid #eceeef;
    background: #f8f9fa;
    font-size: 0.75rem;
    color: #6b7280;
    text-align: center;
}

.pg-venta-text-right {
    text-align: right;
}

.pg-venta-muted {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.pg-venta-comprobante-sub {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

.pg-venta-note {
    font-size: 0.875rem;
    color: #374151;
    margin: 0;
    white-space: pre-wrap;
}

.pg-venta-foot-note {
    font-size: 0.6875rem;
    color: #9ca3af;
    margin: 0;
}

/* Seguimientos */
.pg-seg-card {
    padding: 1rem 1.25rem;
    border: 1px solid #eceeef;
    border-radius: 0.875rem;
    background: #fff;
}

.pg-seg-card-overdue {
    border-color: #fecaca;
    background: #fef2f2;
}

.pg-seg-card-today {
    border-color: #fde68a;
    background: #fffbeb;
}

.pg-seg-card-done {
    opacity: 0.85;
    background: #f8f9fa;
}

.pg-seg-card-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.625rem;
}

.pg-seg-desc {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.5;
}

.pg-seg-card-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #f0f1f2;
}

.pg-seg-fecha {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
}

/* Impresión en la misma pestaña: solo el bloque marcado como pg-print-root-active */
@media print {
    .no-print,
    .pg-print-hide,
    .pg-sidebar,
    #sidebar-overlay,
    #pg-profile-bubble,
    .pg-main-content > header {
        display: none !important;
    }

    body.pg-print-active {
        background: #fff !important;
    }

    body.pg-print-active * {
        visibility: hidden;
    }

    body.pg-print-active .pg-print-root-active,
    body.pg-print-active .pg-print-root-active * {
        visibility: visible;
    }

    body.pg-print-active .pg-print-root-active {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 0;
    }

    body.pg-print-active .pg-sidebar,
    body.pg-print-active #sidebar-overlay,
    body.pg-print-active #pg-profile-bubble,
    body.pg-print-active #main-wrapper > header,
    body.pg-print-active .pg-oficina-activa-bar,
    body.pg-print-active .no-print {
        display: none !important;
        visibility: hidden !important;
    }

    body.pg-print-active #pg-venta-comprobante.pg-print-root-active {
        max-width: none;
        margin: 0;
    }

    .pg-venta-comprobante {
        box-shadow: none;
        border: 1px solid #ccc;
    }

    @page {
        margin: 12mm;
    }
}

.pg-venta-foot-system {
    font-size: 0.625rem;
    color: #9ca3af;
}

/* Permisos por rol */
.pg-perm-page {
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
}

.pg-perm-page-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
    .pg-perm-page-header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
    }
}

.pg-perm-page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.pg-perm-page-desc {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0.25rem 0 0;
}

.pg-perm-page-back {
    font-size: 0.875rem;
    color: #4b5563;
    text-decoration: none;
    flex-shrink: 0;
}

.pg-perm-page-back:hover {
    color: #111827;
}

.pg-perm-rol-summary {
    padding: 1rem;
    border-radius: 0.5rem;
    background: #f8f9fa;
    border: 1px solid #eceeef;
    margin-bottom: 1.25rem;
}

.pg-perm-rol-summary-name {
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.pg-perm-rol-summary-desc {
    font-size: 0.875rem;
    color: #4b5563;
    margin: 0.25rem 0 0;
}

.pg-perm-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
    padding-top: 1rem;
    border-top: 1px solid #eceeef;
}

.pg-perm-alert {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #fde68a;
    background: #fffbeb;
}

.pg-perm-alert-title {
    font-weight: 600;
    color: #92400e;
    margin: 0;
}

.pg-perm-alert-text {
    font-size: 0.875rem;
    color: #b45309;
    margin: 0.25rem 0 0;
}

.pg-perm-alert-text code {
    background: #fff;
    padding: 0.1rem 0.35rem;
    border-radius: 0.25rem;
    font-size: 0.8125rem;
}

.pg-role-modal-header-main {
    min-width: 0;
    flex: 1;
    padding-right: 0.75rem;
}

.pg-role-modal-header-title {
    font-weight: 600;
    color: #111827;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-role-modal-header-sub {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0.125rem 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pg-usuario-perm-activo {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eceeef;
}

.pg-usuario-perm-toggle-title {
    display: block;
    font-weight: 500;
    font-size: 0.875rem;
    color: #111827;
}

.pg-usuario-perm-toggle-hint {
    display: block;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.125rem;
}

.pg-usuario-perm-rol-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin: 0 0 0.75rem;
}

.pg-usuario-perm-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid #eceeef;
}

.pg-usuario-perm-actions-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pg-usuario-perm-loading,
.pg-usuario-perm-readonly {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    padding: 2rem 0;
}

.pg-perm-rol-tab {
    display: inline-flex;
    padding: 0.25rem;
    border-radius: 9999px;
    border: 2px solid transparent;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
}

.pg-perm-rol-tab:hover {
    background: rgba(26, 29, 33, 0.04);
}

.pg-perm-rol-tab.is-active {
    border-color: #1a1d21;
    background: rgba(26, 29, 33, 0.06);
}

.pg-perm-group {
    border: none;
    padding: 0;
    margin: 0 0 1.25rem;
}

.pg-perm-group-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6b7280;
    margin-bottom: 0.625rem;
    padding: 0;
}

.pg-perm-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .pg-perm-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.pg-perm-check {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.625rem 0.75rem 0.625rem 2rem;
    border: 1px solid #eceeef;
    border-radius: 0.5rem;
    background: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.pg-perm-check:hover {
    border-color: #d1d5db;
}

.pg-perm-check.is-checked {
    border-color: #1a1d21;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.pg-perm-check input {
    position: absolute;
    left: 0.75rem;
    top: 0.85rem;
    width: 1rem;
    height: 1rem;
    margin: 0;
    accent-color: #1a1d21;
    cursor: pointer;
}

.pg-perm-check-key {
    font-size: 0.625rem;
    font-family: ui-monospace, monospace;
    color: #9ca3af;
    word-break: break-all;
}

.pg-perm-check-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #374151;
    line-height: 1.35;
}

.pg-role-modal-edit {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eceeef;
}

.pg-role-modal-edit .btn-secondary {
    display: flex;
}

/* Modal permisos de usuario */
.pg-usuario-perm-panel {
    max-width: 36rem;
    max-height: min(90vh, 720px);
    display: flex;
    flex-direction: column;
}

.pg-usuario-perm-body {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.pg-usuario-perm-groups {
    max-height: 42vh;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.pg-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    cursor: pointer;
}

.pg-toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pg-toggle-switch {
    position: relative;
    width: 2.75rem;
    height: 1.5rem;
    background: #d1d5db;
    border-radius: 9999px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.pg-toggle-switch::after {
    content: '';
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1.1rem;
    height: 1.1rem;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.pg-toggle-input:checked + .pg-toggle-switch {
    background: #1a1d21;
}

.pg-toggle-input:checked + .pg-toggle-switch::after {
    transform: translateX(1.25rem);
}

.pg-toggle-input:focus-visible + .pg-toggle-switch {
    outline: 2px solid #1a1d21;
    outline-offset: 2px;
}

/* Oficina activa (atención / legal) */
.pg-oficina-activa-bar {
    margin: -0.5rem 0 1rem;
    padding: 0.65rem 1rem;
    background: #f0f4ff;
    border: 1px solid #dbeafe;
    border-radius: 0.5rem;
}

.pg-oficina-activa-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.pg-oficina-activa-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1e40af;
}

.pg-oficina-activa-select {
    min-width: 12rem;
    max-width: 100%;
}

/* Expediente atención */
.pg-expediente-doc-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .pg-expediente-doc-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:col-span-2 {
        grid-column: span 2;
    }
}

.pg-form-span-2 {
    grid-column: 1 / -1;
}

.pg-expediente-doc-card {
    border: 1px solid #eceeef;
    border-radius: 0.75rem;
    padding: 1rem;
    background: #fafafa;
}

.pg-expediente-doc-card.is-cargado {
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.pg-expediente-doc-card.is-pendiente {
    background: #fffbeb;
    border-color: #fde68a;
}

.pg-expediente-doc-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.space-y-3 > * + * {
    margin-top: 0.75rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.grid {
    display: grid;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

/* Centro de notificaciones */
.pg-notif-wrap {
    position: relative;
}

.pg-notif-trigger {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 0.5rem;
    background: transparent;
    color: #4b5563;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.pg-notif-trigger:hover,
.pg-notif-trigger[aria-expanded="true"] {
    background: #f3f4f6;
    color: #111111;
}

.pg-notif-icon {
    width: 1.35rem;
    height: 1.35rem;
}

.pg-notif-badge {
    position: absolute;
    top: 0.2rem;
    right: 0.15rem;
    min-width: 1.1rem;
    height: 1.1rem;
    padding: 0 0.25rem;
    border-radius: 9999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    line-height: 1.1rem;
    text-align: center;
}

.pg-notif-panel {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    width: min(22rem, calc(100vw - 2rem));
    max-height: 24rem;
    background: #fff;
    border: 1px solid #eceeef;
    border-radius: 0.75rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.pg-notif-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eceeef;
}

.pg-notif-panel-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #111111;
}

.pg-notif-mark-all {
    border: none;
    background: none;
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
    text-decoration: underline;
}

.pg-notif-mark-all:hover {
    color: #111111;
}

.pg-notif-list {
    overflow-y: auto;
    max-height: 20rem;
}

.pg-notif-empty {
    margin: 0;
    padding: 1.25rem 1rem;
    font-size: 0.8125rem;
    color: #6b7280;
    text-align: center;
}

.pg-notif-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-bottom: 1px solid #f3f4f6;
    background: #fff;
    text-align: left;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background 0.12s ease;
}

.pg-notif-item:hover {
    background: #f8f9fa;
}

.pg-notif-item.is-read {
    opacity: 0.65;
}

.pg-notif-item.is-alta:not(.is-read) {
    border-left: 3px solid #dc2626;
    padding-left: calc(1rem - 3px);
}

.pg-notif-item-title {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111111;
}

.pg-notif-item-msg {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.75rem;
    color: #4b5563;
    line-height: 1.35;
}

.pg-notif-item-time {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.6875rem;
    color: #9ca3af;
}

.pg-notif-panel--send-only {
    max-height: 28rem;
}

.pg-notif-panel:not(.pg-notif-panel--send-only) {
    max-height: min(32rem, calc(100vh - 6rem));
}

.pg-notif-panel:not(.pg-notif-panel--send-only) .pg-notif-list {
    flex: 1 1 auto;
    min-height: 6rem;
    max-height: min(18rem, 50vh);
}

.pg-notif-send {
    flex-shrink: 0;
    border-top: 1px solid #eceeef;
    background: #fafafa;
}

.pg-notif-send-toggle {
    display: block;
    width: 100%;
    padding: 0.65rem 1rem;
    border: none;
    background: transparent;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1a1d21;
    text-align: left;
    cursor: pointer;
    transition: background 0.12s ease;
}

.pg-notif-send-toggle:hover {
    background: #f3f4f6;
}

.pg-notif-compose-form.is-collapsed {
    display: none;
}

.pg-notif-send .pg-notif-compose-form {
    padding: 0 1rem 0.75rem;
    border-top: 1px solid #eceeef;
}

.pg-notif-panel--send-only .pg-notif-compose-form {
    padding: 0.75rem 1rem;
}

.pg-notif-compose {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #eceeef;
}

.pg-notif-compose-form {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.pg-notif-compose-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pg-notif-compose-select,
.pg-notif-compose-input,
.pg-notif-compose-textarea {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid #eceeef;
    border-radius: 0.5rem;
    font-size: 0.8125rem;
    color: #111111;
    background: #fff;
}

.pg-notif-compose-textarea {
    resize: vertical;
    min-height: 4rem;
}

.pg-notif-compose-submit {
    margin-top: 0.25rem;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 0.5rem;
    background: #1a1d21;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}

.pg-notif-compose-submit:hover {
    background: #2a2f35;
}

.pg-notif-compose-hint {
    margin: 0;
    font-size: 0.75rem;
    text-align: center;
}

.pg-notif-compose-hint.is-success {
    color: #059669;
}

.pg-notif-compose-hint.is-error {
    color: #dc2626;
}

.pg-form-readonly input,
.pg-form-readonly select,
.pg-form-readonly textarea,
.pg-form-readonly button[type="submit"] {
    pointer-events: none;
    opacity: 0.85;
}


.pg-identificacion-upload-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .pg-identificacion-upload-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.pg-identificacion-card {
    border: 1px solid #eceeef;
    border-radius: 0.75rem;
    padding: 1rem;
    background: #fff;
}

.pg-identificacion-card.is-pendiente {
    border-color: #fcd34d;
    background: #fffbeb;
}

.pg-identificacion-card.is-cargado {
    border-color: #86efac;
    background: #f0fdf4;
}

.pg-identificacion-preview {
    display: block;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    max-height: 10rem;
}

.pg-identificacion-preview img {
    width: 100%;
    height: 10rem;
    object-fit: cover;
    display: block;
}

.pg-identificacion-pdf {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 5rem;
    font-size: 0.8125rem;
    color: #4b5563;
    background: #f3f4f6;
    padding: 0.75rem;
    text-align: center;
}

.pg-live-results {
    position: relative;
    transition: opacity 0.2s ease;
}

.pg-live-results.is-loading {
    opacity: 0.55;
    pointer-events: none;
}

.pg-live-results.is-loading::after {
    content: '';
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #e5e7eb;
    border-top-color: #1a1d21;
    border-radius: 50%;
    animation: pg-spin 0.7s linear infinite;
}

/* Estadísticas — KPI y gráficos */
.pg-stats-kpi {
    background: #fff;
    border: 1px solid #ECEEEF;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    transition: box-shadow 0.2s ease;
}
.pg-stats-kpi:hover {
    box-shadow: 0 4px 12px rgba(26, 29, 33, 0.06);
}
.pg-stats-kpi-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: #F8F9FA;
    color: #1A1D21;
    margin-bottom: 0.5rem;
}
.pg-stats-kpi-icon svg {
    width: 1.125rem;
    height: 1.125rem;
}
.pg-stats-chart-wrap {
    position: relative;
    height: 260px;
    width: 100%;
}
.pg-stats-chart-donut {
    height: 280px;
}
