/* ═══════════════════════════════════════════════
   Compras — Histórico Module & Drawer Detail
   Design tokens from --pv-* (desarrollo/main.css)
   ═══════════════════════════════════════════════ */

/* ── Bulk Edit Toolbar ─────────────────────────── */

.bulk-edit-toolbar {
    background: var(--pv-glass-surface);
    backdrop-filter: var(--pv-glass-blur);
    -webkit-backdrop-filter: var(--pv-glass-blur);
    border: 1px solid var(--pv-glass-border);
    border-radius: var(--pv-card-radius);
    padding: 14px 20px;
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 16px;
    animation: fadeSlideIn 0.35s var(--pv-ease-out);
    box-shadow: var(--pv-elevation);
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bulk-edit-toolbar label {
    font-size: var(--pv-text-xs);
    color: var(--pv-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    display: block;
}

.bulk-edit-toolbar .field-group {
    display: flex;
    flex-direction: column;
}

.bulk-edit-toolbar input,
.bulk-edit-toolbar select {
    background: var(--pv-card-surface);
    border: 1px solid var(--pv-card-border);
    border-radius: var(--pv-input-radius);
    color: var(--pv-text-primary);
    padding: 8px 12px;
    font-size: var(--pv-text-base);
    min-width: 140px;
    transition: border-color var(--pv-duration-fast) ease,
        box-shadow var(--pv-duration-fast) ease;
}

.bulk-edit-toolbar input:focus,
.bulk-edit-toolbar select:focus {
    outline: none;
    border-color: var(--pv-green);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.15);
}

.bulk-edit-toolbar .btn-apply {
    background: linear-gradient(135deg, var(--pv-green) 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: var(--pv-input-radius);
    padding: 10px 20px;
    font-weight: 600;
    font-size: var(--pv-text-sm);
    cursor: pointer;
    transition: all var(--pv-duration-fast) ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.bulk-edit-toolbar .btn-apply:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.bulk-edit-toolbar .btn-apply:active {
    transform: translateY(0);
}

.bulk-edit-toolbar .divider {
    width: 1px;
    height: 40px;
    background: var(--pv-card-border);
    margin: 0 8px;
}

/* ── Histórico Table ───────────────────────────── */

.cp-hist-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.cp-hist-table thead th {
    position: sticky;
    top: 0;
    background: var(--pv-card-surface-solid);
    color: var(--pv-text-secondary);
    font-size: var(--pv-text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 9px 10px;
    border-bottom: 2px solid var(--pv-card-border);
    z-index: 2;
    white-space: nowrap;
}

.cp-hist-table tbody tr {
    transition: background var(--pv-duration-fast) ease;
}

.cp-hist-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.06);
}

.cp-hist-table tbody td {
    padding: 7px 10px;
    border-bottom: 1px solid rgba(56, 73, 107, 0.12);
    color: var(--pv-text-primary);
    font-size: var(--pv-text-sm);
    vertical-align: middle;
}

.cp-hist-table tbody tr.clickable-row {
    cursor: pointer;
}

/* ── SKU Column ────────────────────────────────── */

.cp-sku-col {
    display: flex;
    flex-direction: column;
}

.cp-sku-col__sku {
    font-weight: 600;
    font-size: var(--pv-text-xs);
    color: #90cdf4;
}

.cp-sku-col__code {
    font-size: var(--pv-text-xs);
    color: var(--pv-text-secondary);
}

.cp-sku-col__desc {
    font-size: var(--pv-text-xs);
    color: var(--pv-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 400px;
}

/* ── Actions Cell ──────────────────────────────── */

.cp-actions-cell {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* ── Connection Badges ─────────────────────────── */

.cp-conn-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: var(--pv-text-xs);
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.cp-conn-badge--importada {
    background: linear-gradient(135deg, #3182CE 0%, #2B6CB0 100%);
    box-shadow: 0 2px 8px rgba(49, 130, 206, 0.3);
}

.cp-conn-badge--conectada {
    background: linear-gradient(135deg, #48BB78 0%, #38A169 100%);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.cp-conn-badge--fija {
    background: linear-gradient(135deg, #ED8936 0%, #DD6B20 100%);
    box-shadow: 0 2px 8px rgba(237, 137, 54, 0.3);
}

/* ── Drawer Overlay & Panel ────────────────────── */

.cp-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99999;
}

.cp-drawer-overlay.active {
    display: block;
}

.cp-drawer {
    display: none;
    position: fixed;
    right: 0;
    top: 0;
    height: 100%;
    width: 520px;
    max-width: 95vw;
    background: var(--pv-card-surface-solid);
    z-index: 100000;
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    flex-direction: column;
    border-left: 1px solid var(--pv-card-border);
    animation: drawerSlideIn 0.3s var(--pv-ease-out);
}

@keyframes drawerSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.cp-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--pv-glass-surface);
    backdrop-filter: var(--pv-glass-blur);
    -webkit-backdrop-filter: var(--pv-glass-blur);
    border-bottom: 1px solid var(--pv-card-border);
}

.cp-drawer-header h3 {
    margin: 0;
    color: var(--pv-text-primary);
    font-size: var(--pv-text-lg);
    font-weight: 600;
}

.cp-drawer-close {
    background: transparent;
    border: 1px solid var(--pv-card-border);
    color: var(--pv-text-secondary);
    font-size: 1.4em;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--pv-duration-fast) ease;
}

.cp-drawer-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: var(--pv-red);
    color: var(--pv-red-text);
}

.cp-drawer-body {
    padding: 0;
    color: var(--pv-text-primary);
    font-family: var(--pv-font-ui);
}

/* ── Drawer Hero Header ────────────────────────── */

.cp-drawer-hero {
    background: linear-gradient(180deg, var(--pv-card-surface-solid) 0%, var(--pv-bg-base) 100%);
    padding: 25px 30px;
    border-bottom: 1px solid var(--pv-card-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cp-drawer-hero__id {
    font-size: 1.8em;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.cp-drawer-hero__id--standard {
    color: var(--pv-accent-cyan);
}

.cp-drawer-hero__id--billing {
    color: var(--pv-amber-text);
}

.cp-drawer-hero__provider {
    font-size: 1.1em;
    color: var(--pv-text-primary);
    margin-top: 4px;
}

/* ── Drawer Status Badge ───────────────────────── */

.cp-drawer-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: var(--pv-text-sm);
    font-weight: 600;
}

.cp-drawer-status--standard {
    background: #2C5282;
    color: #90CDF4;
    border: 1px solid #4299E1;
}

.cp-drawer-status--billing {
    background: #C05621;
    color: #FBD38D;
    border: 1px solid #DD6B20;
}

/* ── Drawer Card (glassmorphism sections) ──────── */

.cp-drawer-card {
    background: var(--pv-card-surface);
    backdrop-filter: var(--pv-glass-blur);
    -webkit-backdrop-filter: var(--pv-glass-blur);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--pv-card-border);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.cp-drawer-card--finance {
    background: var(--pv-bg-base);
    position: relative;
    overflow: hidden;
}

.cp-drawer-card--finance::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--pv-green);
}

.cp-drawer-card--finance-billing::before {
    background: var(--pv-amber);
}

.cp-drawer-content-area {
    padding: 24px 30px;
    max-width: 800px;
    margin: 0 auto;
}

/* ── Drawer Product Highlight ──────────────────── */

.cp-drawer-product {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 20px;
}

.cp-drawer-product__icon {
    width: 50px;
    height: 50px;
    background: rgba(56, 73, 107, 0.4);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    flex-shrink: 0;
}

.cp-drawer-product__title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--pv-text-primary);
}

.cp-drawer-product__sku {
    font-family: var(--pv-font-mono);
    color: var(--pv-accent-cyan);
    font-size: var(--pv-text-base);
    margin-top: 2px;
}

.cp-drawer-product__code {
    font-family: var(--pv-font-mono);
    color: var(--pv-text-secondary);
    font-size: var(--pv-text-sm);
}

/* ── Drawer Fields ─────────────────────────────── */

.cp-drawer-field {
    margin-bottom: 8px;
}

.cp-drawer-field__label {
    font-size: var(--pv-text-xs);
    color: var(--pv-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.cp-drawer-field__value {
    font-size: var(--pv-text-base);
    color: var(--pv-text-primary);
    font-weight: 400;
    word-break: break-word;
}

.cp-drawer-field__value--highlight {
    color: var(--pv-text-primary);
    font-weight: 600;
}

/* ── Drawer Grid ───────────────────────────────── */

.cp-drawer-grid {
    display: grid;
    gap: 15px;
}

.cp-drawer-grid--2 {
    grid-template-columns: repeat(2, 1fr);
}

.cp-drawer-grid--3 {
    grid-template-columns: repeat(3, 1fr);
}

.cp-drawer-grid--4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ── Section Titles ────────────────────────────── */

.cp-drawer-section-title {
    margin: 0 0 15px;
    font-size: var(--pv-text-base);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.cp-drawer-section-title--green {
    color: var(--pv-green-text);
}

.cp-drawer-section-title--blue {
    color: var(--pv-accent-cyan);
}

.cp-drawer-section-title--amber {
    color: var(--pv-amber-text);
}

/* ── Drawer Totals ─────────────────────────────── */

.cp-drawer-totals {
    border-top: 1px solid var(--pv-card-border);
    margin-top: 15px;
    padding-top: 15px;
}

.cp-drawer-totals__box {
    padding: 12px;
    border-radius: 8px;
}

.cp-drawer-totals__box--usd {
    background: #1A365D;
    border: 1px solid #2C5282;
}

.cp-drawer-totals__box--mxn {
    background: #1C4532;
    border: 1px solid #276749;
}

.cp-drawer-totals__label {
    display: block;
    font-size: var(--pv-text-xs);
    font-weight: bold;
    margin-bottom: 8px;
}

.cp-drawer-totals__label--usd {
    color: #90CDF4;
}

.cp-drawer-totals__label--mxn {
    color: #9AE6B4;
}

.cp-drawer-totals__row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.cp-drawer-totals__row-label {
    color: var(--pv-text-secondary);
    font-size: var(--pv-text-sm);
}

.cp-drawer-totals__row-value {
    font-size: var(--pv-text-sm);
    color: var(--pv-text-primary);
}

.cp-drawer-totals__row-value--iva {
    color: var(--pv-amber-text);
}

.cp-drawer-totals__row-value--total {
    color: var(--pv-green-text);
    font-weight: bold;
}

.cp-drawer-totals__row--border {
    border-top: 1px solid rgba(56, 73, 107, 0.3);
    padding-top: 4px;
    margin-top: 4px;
}

.cp-drawer-totals__grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
}

.cp-drawer-totals__grid-item-label {
    display: block;
    color: var(--pv-text-secondary);
    font-size: var(--pv-text-xs);
}

.cp-drawer-totals__grid-item-value {
    font-size: var(--pv-text-base);
}

.cp-drawer-totals__grid-item-value--subtotal {
    color: var(--pv-text-primary);
}

.cp-drawer-totals__grid-item-value--iva {
    color: var(--pv-amber-text);
}

.cp-drawer-totals__grid-item-value--total {
    color: var(--pv-green-text);
    font-weight: bold;
}

/* ── Drawer Input (underline style) ────────────── */

.cp-drawer-input {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    color: #e2e8f0;
    width: 100%;
    padding: 8px 10px;
    font-size: var(--pv-text-base);
    transition: border-color var(--pv-duration-fast) ease;
    color-scheme: dark;
}

.cp-drawer-input:focus {
    outline: none;
    border-bottom-color: var(--pv-accent);
}

.cp-drawer-input--editing {
    border: 1px solid var(--pv-accent-cyan);
    background: var(--pv-bg-base);
}

.cp-drawer-input--editing-green {
    border-bottom: 1px solid var(--pv-green-text);
    background: rgba(18, 24, 40, 0.5);
}

.cp-drawer-input--editing-amber {
    border-bottom: 1px solid var(--pv-amber-text);
    background: rgba(18, 24, 40, 0.5);
}

/* ── Drawer Form Labels ────────────────────────── */

.cp-drawer-form-label {
    font-size: var(--pv-text-xs);
    color: var(--pv-text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

/* ── TC Status Badges ──────────────────────────── */

.cp-tc-status {
    font-size: var(--pv-text-xs);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.cp-tc-status--tentativo {
    background: rgba(56, 73, 107, 0.6);
    color: var(--pv-text-secondary);
}

.cp-tc-status--provisional {
    background: #2B6CB0;
    color: #90CDF4;
}

.cp-tc-status--confirmado {
    background: #276749;
    color: #9AE6B4;
}

.cp-tc-status--variable {
    background: #C05621;
    color: #FBD38D;
}

.cp-tc-status--manual {
    background: #6B46C1;
    color: #D6BCFA;
}

.cp-tc-status--congelado {
    background: var(--pv-bg-base);
    color: var(--pv-text-muted);
}

/* ── Billing Card ──────────────────────────────── */

.cp-drawer-billing-card {
    background: var(--pv-card-surface);
    backdrop-filter: var(--pv-glass-blur);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--pv-card-border);
    margin-bottom: 20px;
}

.cp-drawer-validation-error {
    background: #742A2A;
    color: #FEB2B2;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--pv-text-xs);
    border: 1px solid #9B2C2C;
}

.cp-drawer-link {
    color: var(--pv-accent-cyan);
    text-decoration: underline;
    word-break: break-all;
}

.cp-drawer-link:hover {
    color: var(--pv-accent);
}

/* ── Upload Buttons ───────────────────────────── */

.cp-drawer-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: rgba(59, 130, 246, 0.15);
    border: 1px dashed rgba(59, 130, 246, 0.4);
    border-radius: 8px;
    color: var(--pv-accent-cyan);
    font-size: var(--pv-text-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--pv-duration-fast) ease;
    margin-top: 4px;
}

.cp-drawer-upload-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: var(--pv-accent-cyan);
    transform: translateY(-1px);
}

.cp-drawer-upload-btn--small {
    padding: 2px 6px;
    font-size: 0.85em;
    border-radius: 6px;
    margin-top: 0;
}

/* ── Action Buttons (Cancel, Split) ───────────── */

.cp-drawer-action-btn {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid;
    transition: all var(--pv-duration-fast) ease;
}

.cp-drawer-action-btn--cancel {
    background: rgba(229, 62, 62, 0.1);
    border-color: rgba(229, 62, 62, 0.3);
    color: #FEB2B2;
}

.cp-drawer-action-btn--cancel:hover {
    background: rgba(229, 62, 62, 0.25);
    border-color: #E53E3E;
}

.cp-drawer-action-btn--split {
    background: rgba(107, 70, 193, 0.1);
    border-color: rgba(107, 70, 193, 0.3);
    color: #D6BCFA;
}

.cp-drawer-action-btn--split:hover {
    background: rgba(107, 70, 193, 0.25);
    border-color: #6B46C1;
}

/* ── SweetAlert Dark Theme Overrides ──────────── */

.swal-dark-popup {
    border: 1px solid #30363D !important;
    box-shadow: 0 16px 48px rgba(0,0,0,0.5) !important;
}

.swal2-container.swal2-backdrop-show {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    z-index: 200000 !important;
}

.swal-dark-popup .swal2-title {
    color: #E2E8F0 !important;
    font-size: 1.3em !important;
}

.swal-dark-popup .swal2-html-container {
    color: #A0AEC0 !important;
}

.swal-dark-popup .swal2-select,
.swal-dark-popup select {
    background: #0D1117 !important;
    color: #E2E8F0 !important;
    border: 2px solid #30363D !important;
    border-radius: 10px !important;
    padding: 12px 16px !important;
    font-size: 1.05em !important;
    width: 100% !important;
    outline: none !important;
}

.swal-dark-popup .swal2-select:focus,
.swal-dark-popup select:focus {
    border-color: #48BB78 !important;
}

.swal-dark-popup .swal2-select option,
.swal-dark-popup select option {
    background: #0D1117 !important;
    color: #E2E8F0 !important;
    padding: 8px !important;
}

.swal-dark-popup .swal2-input {
    background: #0D1117 !important;
    color: #E2E8F0 !important;
    border: 2px solid #30363D !important;
    border-radius: 10px !important;
    font-size: 1em !important;
}

.swal-dark-popup .swal2-input:focus {
    border-color: #48BB78 !important;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.15) !important;
}

.swal-dark-popup .swal2-input::placeholder {
    color: #4A5568 !important;
}

.swal-dark-popup .swal2-validation-message {
    background: rgba(229, 62, 62, 0.15) !important;
    color: #FEB2B2 !important;
    border: none !important;
}

/* ── Payment Conditions Bar ────────────────────── */

.cp-drawer-conditions {
    background: var(--pv-card-surface);
    backdrop-filter: var(--pv-glass-blur);
    padding: 15px 20px;
    border-radius: 8px;
    border: 1px solid var(--pv-card-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cp-drawer-conditions__title {
    margin: 0 0 5px;
    font-size: var(--pv-text-base);
    color: var(--pv-amber-text);
}

/* ── Related Products ──────────────────────────── */

.cp-related-section {
    margin-top: 30px;
    border-top: 1px solid var(--pv-card-border);
    padding-top: 20px;
}

.cp-related-section__title {
    color: var(--pv-text-secondary);
    font-size: var(--pv-text-base);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.cp-related-item {
    border-bottom: 1px solid var(--pv-card-border);
    padding: 10px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.cp-related-item__sku {
    font-weight: bold;
    color: var(--pv-accent-cyan);
    font-size: var(--pv-text-base);
}

.cp-related-item__code {
    font-size: var(--pv-text-sm);
    color: var(--pv-text-secondary);
}

.cp-related-item__desc {
    color: var(--pv-text-primary);
    font-size: var(--pv-text-sm);
    margin-bottom: 4px;
}

.cp-related-item__qty {
    font-size: var(--pv-text-sm);
    color: var(--pv-text-secondary);
}

.cp-related-item__pu {
    font-size: var(--pv-text-xs);
    color: var(--pv-text-secondary);
}

.cp-related-item__total {
    font-size: var(--pv-text-base);
    color: var(--pv-green-text);
    font-weight: bold;
}

/* ── Loading & Error States ────────────────────── */

.cp-drawer-loading {
    padding: 40px;
    text-align: center;
    color: var(--pv-text-secondary);
}

.cp-drawer-error {
    padding: 20px;
    color: var(--pv-red-text);
    text-align: center;
}

/* ── Edit Action Buttons ───────────────────────── */

.cp-drawer-edit-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.2em;
    padding: 0 5px;
    color: var(--pv-text-secondary);
    transition: color var(--pv-duration-fast) ease;
}

.cp-drawer-edit-btn:hover {
    color: var(--pv-text-primary);
}

.cp-drawer-edit-btn--amber {
    color: var(--pv-amber-text);
    border: 1px solid var(--pv-amber-text);
    padding: 2px 8px;
    border-radius: 6px;
}

/* ── CTA Button (full width) ──────────────────── */

.cp-drawer-cta {
    width: 100%;
    padding: 12px;
    background: var(--pv-accent);
    border: none;
    border-radius: var(--pv-input-radius);
    color: white;
    font-weight: 600;
    font-size: var(--pv-text-base);
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.3);
    transition: all var(--pv-duration-fast) ease;
}

.cp-drawer-cta:hover {
    background: var(--pv-accent-hover);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.4);
}

/* ── Section header action row ─────────────────── */

.cp-drawer-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* ── Full span grid items ──────────────────────── */

.cp-drawer-grid-span-2 {
    grid-column: span 2;
    border-top: 1px solid var(--pv-card-border);
    padding-top: 10px;
    margin-top: 5px;
}

/* ═════════════════════════════════════════════════════════════
   Histórico OC — Premium Dashboard Layer
   Mirrors Consolidado Ventas design language
   ═════════════════════════════════════════════════════════════ */

/* ── KPI Summary Cards ── */
.ho-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.ho-kpi-card {
    position: relative;
    padding: 12px 16px;
    border-radius: 0.65rem;
    overflow: hidden;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ho-kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.ho-kpi-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0.7;
    z-index: 0;
    border-radius: inherit;
}

.ho-kpi-1::before {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(49, 46, 129, 0.35) 50%, rgba(15, 23, 42, 0.5) 100%);
}

.ho-kpi-2::before {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.25) 0%, rgba(6, 78, 59, 0.35) 50%, rgba(15, 23, 42, 0.5) 100%);
}

.ho-kpi-3::before {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2) 0%, rgba(14, 116, 144, 0.35) 50%, rgba(15, 23, 42, 0.5) 100%);
}

.ho-kpi-4::before {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(120, 53, 15, 0.35) 50%, rgba(15, 23, 42, 0.5) 100%);
}

.ho-kpi-label {
    position: relative;
    z-index: 1;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 4px;
}

.ho-kpi-value {
    position: relative;
    z-index: 1;
    font-size: 1.35rem;
    font-weight: 800;
    color: #f1f5f9;
    line-height: 1.1;
    font-family: 'Inter', 'JetBrains Mono', system-ui, sans-serif;
}

.ho-kpi-sub {
    position: relative;
    z-index: 1;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
}

/* ── Toolbar ── */
.ho-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 7px 12px;
    background: rgba(30, 41, 59, 0.65);
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 0.5rem;
    position: relative;
    z-index: 10;
    overflow: visible;
    flex-wrap: wrap;
    gap: 6px;
}

.ho-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ho-toolbar-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 1;
    justify-content: flex-end;
    min-width: 0;
}

.ho-toolbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ho-count-pill {
    font-size: 0.78rem;
    color: #64748b;
    background: rgba(51, 65, 85, 0.3);
    padding: 2px 10px;
    border-radius: 10px;
}

.ho-search-input {
    padding: 8px 14px 8px 36px;
    background: #0f172a;
    color: #f1f5f9;
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0.5rem;
    font-size: 0.82rem;
    min-width: 280px;
    flex: 1;
    max-width: 400px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 10px center;
    background-size: 16px;
}

.ho-search-input:focus {
    border-color: rgba(99, 102, 241, 0.6);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.ho-select {
    padding: 5px 10px;
    background: #0f172a;
    color: #e2e8f0;
    border: 1px solid rgba(51, 65, 85, 0.45);
    border-radius: 0.4rem;
    font-size: 0.78rem;
    outline: none;
    cursor: pointer;
}

.ho-select-filter {
    padding: 5px 10px;
    background: rgba(15, 23, 42, 0.6);
    color: #94a3b8;
    border: 1px solid rgba(51, 65, 85, 0.4);
    border-radius: 0.4rem;
    font-size: 0.75rem;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s;
}
.ho-select-filter:focus {
    border-color: rgba(99, 102, 241, 0.5);
    color: #e2e8f0;
}

/* ── Status Badges ── */
.ho-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}
.ho-status--recibido {
    background: rgba(74, 222, 128, 0.12);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.25);
}
.ho-status--enviada {
    background: rgba(96, 165, 250, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.25);
}
.ho-status--pendiente {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.25);
}
.ho-status--cancelado {
    background: rgba(248, 113, 113, 0.12);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.25);
}
.ho-status--default {
    background: rgba(100, 116, 139, 0.12);
    color: #94a3b8;
    border: 1px solid rgba(100, 116, 139, 0.25);
}
.ho-btn-filter {
    padding: 5px 14px;
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.ho-btn-filter:hover {
    background: rgba(99, 102, 241, 0.22);
}

.ho-btn-danger {
    padding: 5px 14px;
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.ho-btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.ho-btn-warning {
    padding: 5px 14px;
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.ho-btn-warning:hover {
    background: rgba(245, 158, 11, 0.2);
}

.ho-btn-filter {
    padding: 5px 14px;
    background: rgba(129, 140, 248, 0.1);
    color: #a5b4fc;
    border: 1px solid rgba(129, 140, 248, 0.25);
    border-radius: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.ho-btn-filter:hover {
    background: rgba(129, 140, 248, 0.2);
}

/* ── Premium Table ── */
.ho-table-container {
    overflow-x: auto;
    overflow-y: auto;
    max-height: 72vh;
    border: 1px solid rgba(51, 65, 85, 0.25);
    border-radius: 0.6rem;
    background: rgba(15, 23, 42, 0.4);
}

.ho-table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.ho-th {
    padding: 7px 8px;
    text-align: left;
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    position: sticky;
    top: 0;
    background: #1e293b;
    z-index: 2;
    border-bottom: 2px solid rgba(51, 65, 85, 0.4);
}

.ho-th-center { text-align: center; }
.ho-th-right { text-align: right; }

.ho-td {
    padding: 5px 8px;
    color: #cbd5e1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.73rem;
    border-bottom: 1px solid rgba(51, 65, 85, 0.15);
    transition: background 0.15s ease;
}

.ho-td-id {
    font-weight: 700;
    color: #e2e8f0;
}

.ho-td-date {
    color: #64748b;
    font-size: 0.7rem;
}

.ho-td-prov {
    color: #94a3b8;
    font-size: 0.7rem;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ho-td-money {
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #4ade80;
    font-weight: 600;
}

.ho-td-qty {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: #e2e8f0;
}

.ho-td-center { text-align: center; }

.hist-filter-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    min-width: 172px;
    padding: 8px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.hist-filter-menu .cp-filter-check {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;
    padding: 6px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.hist-filter-menu .cp-filter-check:hover {
    background: rgba(99, 102, 241, 0.12);
}

/* ── Row Zebra + Hover ── */
#compras-historico-table tbody tr.ho-row:nth-child(even) .ho-td {
    background: rgba(30, 41, 59, 0.25);
}

#compras-historico-table tbody tr.ho-row:hover .ho-td {
    background: rgba(99, 102, 241, 0.07);
}

/* ── Facturación table zebra + hover ── */
#compras-facturacion-table tbody tr.ho-row:nth-child(even) .ho-td {
    background: rgba(30, 41, 59, 0.25);
}

#compras-facturacion-table tbody tr.ho-row:hover .ho-td {
    background: rgba(99, 102, 241, 0.07);
}

/* ── Inventario PT table zebra + hover ── */
#distribucion-inventarios-table tbody tr.ho-row:nth-child(even) .ho-td {
    background: rgba(30, 41, 59, 0.25);
}

#distribucion-inventarios-table tbody tr.ho-row:hover .ho-td {
    background: rgba(99, 102, 241, 0.07);
}

/* ── Inventory Parent/Child Grouping ── */
.inv-parent-row .ho-td {
    background: rgba(30, 41, 59, 0.35);
    border-top: 1px solid rgba(148, 163, 184, 0.06);
    border-bottom: none;
    padding-top: 10px;
    padding-bottom: 10px;
}

.inv-parent--alt .ho-td {
    background: rgba(51, 65, 85, 0.35);
}

.inv-parent-row:hover .ho-td {
    background: rgba(99, 102, 241, 0.08);
}

.inv-child-row .ho-td {
    background: rgba(15, 23, 42, 0.3);
    padding-top: 6px;
    padding-bottom: 6px;
}

.inv-parent-arrow {
    display: inline-block;
    width: 12px;
    font-size: 0.7rem;
    color: #818cf8;
    transition: transform 0.15s ease;
}

.inv-child-row .ho-td {
    border-left: 2px solid transparent;
}

.inv-child-row .ho-td:first-child {
    border-left: 2px solid rgba(99, 102, 241, 0.2);
}

/* ── Search Match Inline Highlight ── */
mark.inv-hl {
    background: rgba(129, 140, 248, 0.3);
    color: #c7d2fe;
    padding: 1px 2px;
    border-radius: 3px;
    font-weight: 600;
}

.ho-row {
    cursor: pointer;
    transition: background 0.15s ease;
}
.ho-row--cancelled {
    opacity: 0.45;
}
.ho-row--cancelled:hover {
    opacity: 0.65;
}

/* ── Status Badges ── */
.ho-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    min-width: 72px;
    text-transform: uppercase;
}

.ho-status--recibido {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.ho-status--pendiente {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.ho-status--cancelado {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.ho-status--borrador {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px dashed rgba(148, 163, 184, 0.4);
    letter-spacing: 0.04em;
}

.ho-status--enviada {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.ho-status--default {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* ── Connection Badges ── */
.ho-conn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.66rem;
    font-weight: 600;
    white-space: nowrap;
}

.ho-conn--conectada {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.ho-conn--importada {
    background: rgba(99, 102, 241, 0.1);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.ho-conn--fija {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ── Action Buttons ── */
.ho-action-btn {
    background: none;
    border: 1px solid rgba(51, 65, 85, 0.3);
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.15s ease;
    line-height: 1;
}

.ho-action-btn:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

.ho-action-btn--danger:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.3);
}

.ho-actions-cell {
    display: flex;
    gap: 4px;
    justify-content: center;
}

/* ── Connection Dot (compact indicator) ── */
.ho-conn-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 4px currentColor;
    position: relative;
}
.ho-conn-dot::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border-radius: 50%;
}
/* tooltip handled by global JS data-tip system */

/* Generic tooltip for table cells (contenido preview etc.) */
.fp-contenido-cell {
    position: relative;
    max-width: 220px;
}
.fp-contenido-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.76rem;
    color: #94a3b8;
}
.fp-contenido-cell[data-tooltip]:not([data-tooltip=""]):hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    background: #1a1f2e;
    color: #e2e8f0;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: 5px;
    white-space: normal;
    max-width: 340px;
    min-width: 160px;
    border: 1px solid #30363d;
    pointer-events: none;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Factura Mini-Card ── */
.fp-factura-cell { white-space: normal; padding: 6px 10px !important; }
.fp-factura-card { display: flex; flex-direction: column; gap: 3px; }
.fp-factura-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fp-factura-ver {
    font-size: 0.72rem; color: #60a5fa; cursor: pointer;
    border-bottom: 1px dashed rgba(96,165,250,0.3);
    transition: color 0.15s;
}
.fp-factura-ver:hover { color: #93c5fd; }
.fp-factura-serie {
    font-size: 0.68rem; color: #94a3b8; background: rgba(100,116,139,0.15);
    padding: 1px 5px; border-radius: 3px; cursor: pointer;
    transition: background 0.15s;
}
.fp-factura-serie:hover { background: rgba(129,140,248,0.2); color: #c7d2fe; }
.fp-factura-add-mini {
    font-size: 0.65rem; color: #475569; cursor: pointer;
    font-style: italic; transition: color 0.15s;
}
.fp-factura-add-mini:hover { color: #818cf8; }
.fp-factura-dates { font-size: 0.7rem; color: #64748b; }
.fp-factura-dates span { cursor: pointer; transition: color 0.15s; }
.fp-factura-dates span:hover { color: #94a3b8; }
.fp-factura-venc { color: #475569 !important; cursor: default !important; }
.fp-factura-empty { color: #475569; font-size: 0.68rem; cursor: pointer; }
.fp-factura-empty:hover { color: #818cf8; }

/* ── Pago Cell ── */
.fp-pago-cell {
    text-align: center;
    vertical-align: middle;
}
.fp-pago-link {
    font-size: 0.72rem; color: #60a5fa; cursor: pointer;
    border-bottom: 1px dashed rgba(96,165,250,0.3);
    transition: color 0.15s;
}
.fp-pago-link:hover { color: #93c5fd; }

/* ── Add Button ── */
.fp-add-btn {
    background: rgba(129, 140, 248, 0.1); border: 1px dashed #334155;
    color: #818cf8; padding: 4px 12px; border-radius: 5px;
    font-size: 0.72rem; cursor: pointer; transition: all 0.15s;
}
.fp-add-btn:hover { background: rgba(129, 140, 248, 0.2); border-color: #818cf8; }
.fp-add-btn--sm { padding: 2px 8px; font-size: 0.68rem; }

/* ── SKU Column (premium) ── */

.ho-provider-col {
    display: flex;
    min-width: 0;
    max-width: 150px;
    overflow: hidden;
}

.ho-provider-col__name {
    color: #a5b4fc;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ho-sku-col {
    display: flex;
    flex-direction: column;
    gap: 1px;
    line-height: 1.3;
    max-width: 500px;
    overflow: hidden;
    position: relative;
}
/* tooltip handled by global JS data-tip system */

.ho-sku-col__sku {
    font-weight: 600;
    color: #f1f5f9;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ho-sku-col__code {
    font-size: 0.68rem;
    color: #64748b;
}

.ho-sku-col__desc {
    font-size: 0.73rem;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* ── Responsive ── */
@media (max-width: 1200px) {
    .ho-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ho-kpi-row {
        grid-template-columns: 1fr;
    }
    .ho-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ── Drawer: Editable Field Indicators ── */
.cp-drawer-field__value--editable {
    cursor: pointer;
    border-bottom: 1px dashed rgba(99, 102, 241, 0.35);
    padding-bottom: 2px;
    transition: border-color 0.2s ease, background 0.2s ease;
    position: relative;
}

.cp-drawer-field__value--editable:hover {
    border-bottom-color: rgba(99, 102, 241, 0.65);
    background: rgba(99, 102, 241, 0.05);
    border-radius: 3px 3px 0 0;
}

.cp-drawer-field__value--editable::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 6px;
    opacity: 0;
    transition: opacity 0.15s ease;
    vertical-align: middle;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23818cf8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

.cp-drawer-field__value--editable:hover::after {
    opacity: 0.7;
}

/* Read-only indicator */
.cp-drawer-field__value--readonly {
    color: #64748b;
    cursor: default;
}

/* Inline edit active state */
.cp-drawer-field__value--editing {
    border-bottom: 1px solid rgba(99, 102, 241, 0.6);
    background: rgba(99, 102, 241, 0.08);
    border-radius: 4px;
    padding: 4px 8px;
}

.cp-drawer-field__value--editing input,
.cp-drawer-field__value--editing select {
    background: transparent;
    border: none;
    color: #f1f5f9;
    font-size: inherit;
    font-family: inherit;
    outline: none;
    width: 100%;
}

/* Section title SVG icon alignment */
.cp-drawer-section-title svg {
    vertical-align: -2px;
    margin-right: 4px;
}

/* ── Documentation Column Mini-Card ── */
.ho-doc-cell { white-space: normal; padding: 4px 6px 4px 44px !important; }
.ho-doc-card { display: flex; flex-direction: column; gap: 1px; }
.ho-doc-row { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; white-space: nowrap; }
.ho-doc-item {
    font-size: 0.7rem; color: #8B949E; cursor: pointer;
    transition: color 0.15s ease;
}
.ho-doc-item:hover { color: #c9d1d9; }
.ho-doc-badge {
    font-size: 0.68rem; color: #94a3b8; background: rgba(100,116,139,0.15);
    padding: 1px 5px; border-radius: 3px; cursor: pointer;
    transition: background 0.15s ease;
    display: inline-block;
}
.ho-doc-badge:hover { background: rgba(129,140,248,0.2); color: #c7d2fe; }
.ho-doc-badge--coa {
    background: rgba(72,187,120,0.12); color: #68D391;
    border: 1px solid rgba(72,187,120,0.2);
}
.ho-doc-badge--coa:hover { background: rgba(72,187,120,0.25); color: #9ae6b4; }
.ho-doc-empty { color: #475569; font-size: 0.68rem; cursor: pointer; font-style: italic; }
.ho-doc-empty:hover { color: #818cf8; }
.ho-doc-edit-icon {
    font-size: 0.6rem; cursor: pointer; opacity: 0.4;
    transition: opacity 0.15s ease;
    margin-left: 2px;
}
.ho-doc-edit-icon:hover { opacity: 1; }

.ho-coa-suggest {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid rgba(129,140,248,0.22);
    border-radius: 8px;
    background: rgba(15,23,42,0.72);
}
.ho-coa-suggest__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.ho-coa-suggest__title {
    color: #e2e8f0;
    font-size: 0.78rem;
    font-weight: 800;
}
.ho-coa-suggest__subtitle {
    color: #64748b;
    font-size: 0.7rem;
    margin-top: 1px;
}
.ho-coa-suggest__apply {
    border: 1px solid rgba(34,197,94,0.35);
    background: rgba(34,197,94,0.12);
    color: #86efac;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}
.ho-coa-suggest__apply:disabled {
    opacity: 0.65;
    cursor: default;
}
.ho-coa-suggest__card {
    border: 1px solid rgba(51,65,85,0.9);
    border-radius: 7px;
    padding: 8px;
    background: rgba(2,6,23,0.45);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.ho-coa-suggest__card:hover,
.ho-coa-suggest__card:focus-visible {
    border-color: rgba(129,140,248,0.62);
    background: rgba(15,23,42,0.85);
    outline: none;
}
.ho-coa-suggest__card--applied {
    border-color: rgba(34,197,94,0.72);
    background: rgba(22,101,52,0.16);
    box-shadow: 0 0 0 1px rgba(34,197,94,0.18) inset;
}
.ho-coa-suggest__card--applied .ho-coa-suggest__label,
.ho-coa-suggest__card--applied .ho-coa-suggest__confidence {
    color: #86efac;
}
.ho-coa-suggest__card + .ho-coa-suggest__card { margin-top: 7px; }
.ho-coa-suggest__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}
.ho-coa-suggest__label {
    color: #94a3b8;
    font-size: 0.68rem;
    text-transform: uppercase;
    font-weight: 800;
}
.ho-coa-suggest__confidence {
    color: #c7d2fe;
    font-size: 0.68rem;
    font-weight: 800;
}
.ho-coa-suggest__value {
    color: #f8fafc;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.86rem;
    font-weight: 800;
    margin-top: 3px;
}
.ho-coa-suggest__reason,
.ho-coa-suggest__message {
    color: #94a3b8;
    font-size: 0.72rem;
    line-height: 1.35;
    margin-top: 5px;
}
.ho-coa-suggest__message--error { color: #fca5a5; }
.ho-coa-suggest__quote {
    color: #cbd5e1;
    font-size: 0.7rem;
    line-height: 1.35;
    margin-top: 6px;
    padding: 6px 8px;
    border-left: 2px solid rgba(129,140,248,0.55);
    background: rgba(129,140,248,0.07);
    border-radius: 4px;
}
.ho-coa-suggest__image {
    display: block;
    width: 100%;
    max-height: 120px;
    object-fit: contain;
    margin-top: 7px;
    border-radius: 5px;
    border: 1px solid rgba(148,163,184,0.2);
    background: #fff;
}
.ho-coa-quick-fields {
    margin-top: 10px;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 9px;
    border-radius: 8px;
    background: rgba(34,197,94,0.07);
    border: 1px solid rgba(34,197,94,0.18);
}
.ho-coa-quick-fields__check {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #86efac;
    font-size: 0.74rem;
    font-weight: 700;
}
.ho-coa-quick-fields__label {
    color: #94a3b8;
    font-size: 0.72rem;
}
.ho-coa-quick-fields__input {
    margin: 4px 0 0 !important;
    width: 100% !important;
    background: #0d1117 !important;
    border: 1px solid #30363d !important;
    color: #e2e8f0 !important;
    font-size: 0.82rem !important;
}

/* ══════════════════════════════════════════════
   Column Filter System
   ══════════════════════════════════════════════ */

.ho-col-filter {
    cursor: pointer;
    user-select: none;
    position: relative;
    transition: color 0.15s ease;
}
.ho-col-filter:hover { color: #c7d2fe; }
.ho-col-filter--active { color: #818cf8 !important; }

/* Small indicator dot when filter is active */
.ho-col-filter-dot {
    display: inline-block;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #818cf8;
    margin-left: 3px;
    vertical-align: middle;
    box-shadow: 0 0 4px #818cf8;
}

/* Sort arrow shown in header */
.ho-col-sort-arrow {
    font-size: 0.55rem;
    margin-left: 2px;
    color: #818cf8;
}

/* ── Dropdown Panel ── */
.ho-col-dropdown {
    position: fixed;
    z-index: 9999;
    min-width: 230px;
    max-width: 300px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(20px);
    font-size: 0.78rem;
    color: #cbd5e1;
    overflow: hidden;
}

.ho-col-dd-section {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(51, 65, 85, 0.35);
}
.ho-col-dd-section:last-child { border-bottom: none; }

.ho-col-dd-title {
    font-size: 0.65rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

.ho-col-dd-sort-btn {
    display: flex; align-items: center; gap: 6px;
    width: 100%; padding: 5px 8px; margin-bottom: 2px;
    background: transparent; border: none; border-radius: 5px;
    color: #94a3b8; font-size: 0.76rem; cursor: pointer;
    transition: all 0.12s ease; text-align: left;
}
.ho-col-dd-sort-btn:hover { background: rgba(99,102,241,0.12); color: #e2e8f0; }
.ho-col-dd-sort-btn--active { background: rgba(99,102,241,0.18); color: #a5b4fc; font-weight: 600; }

.ho-col-dd-search {
    width: 100%; padding: 6px 10px;
    background: rgba(15,23,42,0.8); border: 1px solid rgba(51,65,85,0.5);
    border-radius: 6px; color: #f1f5f9; font-size: 0.76rem;
    outline: none; transition: border-color 0.15s;
}
.ho-col-dd-search:focus { border-color: rgba(99,102,241,0.5); }
.ho-col-dd-search::placeholder { color: #475569; }

.ho-col-dd-checks {
    max-height: 180px; overflow-y: auto;
    scrollbar-width: thin; scrollbar-color: #334155 transparent;
}

.ho-col-dd-check-label {
    display: flex; align-items: center; gap: 6px;
    padding: 3px 4px; border-radius: 4px; cursor: pointer;
    font-size: 0.74rem; color: #94a3b8;
    transition: background 0.1s;
}
.ho-col-dd-check-label:hover { background: rgba(51,65,85,0.3); color: #e2e8f0; }
.ho-col-dd-check-label input { accent-color: #818cf8; }

.ho-col-dd-actions {
    display: flex; gap: 6px; justify-content: flex-end;
}
.ho-col-dd-btn {
    padding: 4px 12px; border-radius: 5px;
    font-size: 0.72rem; font-weight: 600;
    cursor: pointer; border: none; transition: all 0.12s;
}
.ho-col-dd-btn--clear {
    background: transparent; color: #64748b;
    border: 1px solid rgba(51,65,85,0.4);
}
.ho-col-dd-btn--clear:hover { color: #f87171; border-color: rgba(248,113,113,0.3); }
.ho-col-dd-btn--apply {
    background: rgba(99,102,241,0.2); color: #a5b4fc;
    border: 1px solid rgba(99,102,241,0.35);
}
.ho-col-dd-btn--apply:hover { background: rgba(99,102,241,0.35); }
