/* Clientes shares Compras' cp-*, ho-* components and --pv-* design tokens. */
.cv-module {
    width: 100%;
    min-width: 0;
    margin: 0;
    color: var(--pv-text-primary);
    font-family: var(--pv-font-ui);
}
.cv-module *, .cv-module *::before, .cv-module *::after { box-sizing: border-box; }
.cv-module [hidden] { display: none !important; }
.cv-module button:disabled { opacity: .5; cursor: wait; }
.cv-module :focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }
.cv-module label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    color: var(--pv-text-secondary);
    font-size: var(--pv-text-sm);
    font-weight: 600;
}
.cv-module .grid-input { min-width: 0; color-scheme: dark; font-family: inherit; font-weight: 400; }
.cv-module input[readonly] { color: var(--pv-text-secondary); }
.cv-module input[type=checkbox] { width: auto; accent-color: var(--pv-accent); }
.cv-module textarea { resize: vertical; }
.cv-module .ho-toolbar-right .cp-btn-generate { padding: 7px 14px; font-size: .78rem; border-radius: .4rem; white-space: nowrap; }
.cv-module .ho-toolbar-left { flex-wrap: wrap; }
.cv-module .ho-toolbar-right { flex-wrap: wrap; }
.cv-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 16px; }
.cv-wide { grid-column: span 2; }
.cv-order-fields {
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--pv-card-border);
    border-radius: 12px;
    background: rgba(18, 24, 40, .5);
}
.cv-add-product { display: grid; grid-template-columns: 1fr 2fr auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.cv-module .cv-lines-wrap { min-height: 160px; height: auto; max-height: 40vh; }
.cv-lines { min-width: 960px; }
.cv-lines th:first-child { width: 30%; }
.cv-lines th svg { vertical-align: middle; margin-right: 5px; }
.cv-lines .grid-input { width: 82px; padding: 9px 8px; font-size: var(--pv-text-base); }
.cv-lines [data-field=precio] { width: 108px; }
.cv-lines [data-line-total] { white-space: nowrap; font-family: var(--pv-font-mono); font-size: var(--pv-text-sm); }
.cv-table-wrap table { min-width: 700px; text-align: left; }
.cv-table .ho-td { white-space: normal; vertical-align: middle; }
.cv-table tbody tr:nth-child(even) { background: rgba(30, 41, 59, .25); }
.cv-table tbody tr:hover { background: rgba(99, 102, 241, .07); }
.cv-table .ho-td small, .cv-product-name small { display: block; color: var(--pv-text-secondary); margin-top: 3px; font-size: .7rem; }
.cv-product-name { min-width: 190px; max-width: 320px; white-space: normal; }
.cv-cell-actions { display: flex; gap: 6px; white-space: nowrap; }
.cv-module .cv-empty { text-align: center; color: var(--pv-text-secondary); padding: 40px 20px; white-space: normal; font-size: var(--pv-text-sm); }
.cv-note { font-size: var(--pv-text-sm); color: var(--pv-text-secondary); line-height: 1.5; margin: 10px 0; }
.cv-quote-footer { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; margin-top: 16px; }
.cv-totals p { display: flex; justify-content: space-between; gap: 24px; margin: 0 0 7px; font-size: var(--pv-text-sm); color: var(--pv-text-secondary); }
.cv-totals p:last-child { font-size: var(--pv-text-lg); color: var(--pv-text-primary); border-top: 1px solid var(--pv-card-border); padding-top: 10px; }
.cv-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; margin-top: 20px; }
.cv-actions .cv-note { margin-right: auto; }
.cv-link { text-decoration: none; }
.cv-card { padding: 16px; margin: 12px 0; border: 1px solid var(--pv-card-border); border-radius: 12px; background: var(--pv-card-surface); }
.cv-dialog {
    color: var(--pv-text-primary);
    background: var(--pv-card-surface-solid);
    border: 1px solid var(--pv-glass-border);
    border-radius: var(--pv-card-radius);
    width: min(1120px, 94vw);
    max-height: 90vh;
    margin: auto;
    padding: 24px;
    box-shadow: var(--pv-elevation);
}
.cv-dialog::backdrop { background: rgba(0, 0, 0, .65); backdrop-filter: blur(4px); }
.cv-dialog:has(#cv-customer-form) { width: min(900px, 94vw); }
.cv-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.cv-dialog .cv-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cv-dialog form > .cv-actions { position: sticky; bottom: -24px; background: var(--pv-card-surface-solid); border-top: 1px solid var(--pv-card-border); padding: 12px 0; z-index: 3; }
.cv-dialog p { color: var(--pv-text-secondary); font-size: var(--pv-text-base); line-height: 1.5; }
.cv-detail-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; line-height: 1.6; margin-bottom: 20px; }
.cv-detail-meta p { white-space: pre-wrap; }
.cv-detail-section { margin-top: 24px; }
.cv-detail-section h3 { font-size: var(--pv-text-lg); }
.cv-warning { color: var(--pv-amber-text) !important; }
.cv-alert, #cv-dialog-error, #cv-feedback { background: rgba(239, 68, 68, .1); color: var(--pv-red-text); border: 1px solid rgba(239, 68, 68, .25); border-radius: 8px; padding: 12px 16px; margin: 0 0 12px; font-size: var(--pv-text-sm); line-height: 1.5; }
#cv-feedback { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
#cv-feedback.success { background: rgba(34, 197, 94, .1); color: var(--pv-green-text); border-color: rgba(34, 197, 94, .25); }
#cv-feedback.success button { display: none; }
.cv-ship-line { display: grid; grid-template-columns: 2fr 2fr 100px auto; gap: 10px; align-items: end; margin: 14px 0; }
.cv-notices-button { position: fixed; right: 24px; bottom: 20px; z-index: 1050; background: #1e293b; color: #a5b4fc; border: 1px solid rgba(99, 102, 241, .4); border-radius: 8px; padding: 10px 17px; cursor: pointer; box-shadow: var(--pv-elevation); font-weight: 600; }
.cv-notices-button[hidden] { display: none; }
@media (max-width: 1000px) {
    .cv-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cv-quote-footer { grid-template-columns: 1fr 260px; gap: 20px; }
    .cv-module .ho-toolbar-right { flex-basis: 100%; justify-content: flex-start; }
    .cv-module .ho-search-input { min-width: 180px; }
}
@media (max-width: 650px) {
    .cv-module .cp-creator-card, .cv-dialog { padding: 16px; }
    .cv-fields, .cv-dialog .cv-fields, .cv-add-product, .cv-quote-footer, .cv-detail-meta { grid-template-columns: 1fr; }
    .cv-wide { grid-column: auto; }
    .cv-ship-line { grid-template-columns: 1fr 1fr; }
    .cv-actions button { flex: 1; }
    .cv-module .cp-action-bar { flex-wrap: wrap; gap: 12px; }
    .cv-module .ho-search-input { max-width: none; width: 100%; flex-basis: 100%; }
    .cv-notices-button { right: 12px; bottom: 12px; }
}
