:root {
    --cspc-navy: #28256f;
    --cspc-navy-dark: #1c1d57;
    --cspc-blue: #229bd7;
    --cspc-sky: #5bbbea;
    --cspc-gold: #e5b800;
    --cspc-gold-light: #ffd51d;
    --cspc-beige: #e5e0d5;
    --cspc-slate: #8793a9;
    --cspc-bg: #f4f6fa;
    --cspc-text: #17223a;
    --cspc-muted: #667085;
    --cspc-border: #dbe1ea;
    --cspc-white: #fff;
    --cspc-success: #137a4a;
    --cspc-danger: #b42318;
    --cspc-shadow: 0 12px 34px rgba(8, 45, 104, .08);
}

* { box-sizing: border-box; }
html { background: var(--cspc-bg); }
body.cspc-system-page {
    margin: 0;
    color: var(--cspc-text);
    background: var(--cspc-bg);
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}
body.cspc-system-page a { color: inherit; }
body.cspc-system-page button,
body.cspc-system-page input,
body.cspc-system-page select,
body.cspc-system-page textarea { font: inherit; }

.cspc-app { min-height: 100vh; display: flex; flex-direction: column; }
.cspc-topbar {
    min-height: 68px;
    padding: 7px clamp(18px, 4vw, 64px);
    background: linear-gradient(90deg, #fff 0%, #f2faff 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.cspc-brand { display: flex; align-items: center; gap: 16px; text-decoration: none; }
.cspc-brand > span:last-child { display: flex; flex-direction: column; }
.cspc-brand strong { color: var(--cspc-navy); font-size: 17px; letter-spacing: .01em; }
.cspc-brand small { color: var(--cspc-muted); }
.cspc-userbox { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.cspc-userbox span { font-weight: 700; }
.cspc-userbox a { color: var(--cspc-navy); font-weight: 700; text-decoration: none; }
.cspc-userbox .cspc-topbar-tool { min-height: 38px; padding: 8px 11px; display: inline-flex; align-items: center; gap: 6px; color: #fff; background: var(--cspc-navy); border-radius: 9px; }
.cspc-userbox .cspc-topbar-tool .dashicons { width: 17px; height: 17px; font-size: 17px; }

.cspc-logo-lockup { display: inline-flex; align-items: center; gap: 8px; }
.cspc-logo-lockup img { display: block; width: 100%; height: 100%; object-fit: contain; }
.cspc-logo-dorminova, .cspc-logo-sanpablo { display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.cspc-logo-sanpablo { background: transparent; padding: 0; }
.cspc-logo-small .cspc-logo-sanpablo { width: 102px; height: 62px; }
.cspc-logo-small .cspc-logo-dorminova { width: 88px; height: 44px; }
.cspc-logo-large .cspc-logo-sanpablo { width: min(250px, 50vw); height: 153px; }
.cspc-logo-large .cspc-logo-dorminova { width: min(220px, 40vw); height: 110px; }

.cspc-brand-strip, .cspc-print-strip { display: grid; grid-template-columns: repeat(5, 1fr); height: 8px; }
.cspc-brand-strip i:nth-child(1), .cspc-print-strip i:nth-child(1) { background: var(--cspc-navy); }
.cspc-brand-strip i:nth-child(2), .cspc-print-strip i:nth-child(2) { background: var(--cspc-gold); }
.cspc-brand-strip i:nth-child(3), .cspc-print-strip i:nth-child(3) { background: var(--cspc-beige); }
.cspc-brand-strip i:nth-child(4), .cspc-print-strip i:nth-child(4) { background: var(--cspc-slate); }
.cspc-brand-strip i:nth-child(5), .cspc-print-strip i:nth-child(5) { background: var(--cspc-navy); }

.cspc-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    overflow: visible;
    padding: 0 clamp(18px, 4vw, 64px);
    background: var(--cspc-navy-dark);
    color: #fff;
}
.cspc-nav a { display: inline-flex; align-items: center; gap: 7px; padding: 15px 17px 13px; border-bottom: 3px solid transparent; text-decoration: none; white-space: nowrap; opacity: .78; }
.cspc-nav a:hover, .cspc-nav a.is-active { opacity: 1; background: rgba(255,255,255,.06); border-bottom-color: var(--cspc-gold-light); }
.cspc-nav .dashicons { width: 18px; height: 18px; font-size: 18px; }
.cspc-nav a.cspc-nav-admin { opacity: 1; color: #fff; background: rgba(194,154,68,.20); border-bottom-color: rgba(224,197,128,.55); }
.cspc-nav a.cspc-nav-admin:hover, .cspc-nav a.cspc-nav-admin.is-active { background: var(--cspc-gold); border-bottom-color: var(--cspc-gold-light); }

.cspc-main { width: min(1420px, calc(100% - 36px)); margin: 0 auto; padding: 34px 0 50px; flex: 1; }
.cspc-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 24px; }
.cspc-page-head h1 { margin: 2px 0 4px; color: var(--cspc-navy); font-size: clamp(27px, 3vw, 38px); line-height: 1.1; }
.cspc-page-head p { margin: 0; color: var(--cspc-muted); }
.cspc-eyebrow { margin: 0; color: var(--cspc-gold) !important; font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cspc-head-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.cspc-inline-action { display: inline-flex; align-items: center; gap: 7px; }
.cspc-inline-action select { min-height: 42px; padding: 8px 10px; border: 1px solid var(--cspc-border); border-radius: 9px; background: #fff; }

.cspc-button {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 750;
    line-height: 1.15;
    text-decoration: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.cspc-button:hover { transform: translateY(-1px); }
.cspc-button-primary { color: #fff !important; background: var(--cspc-navy); box-shadow: 0 5px 14px rgba(8,45,104,.18); }
.cspc-button-primary:hover { background: var(--cspc-blue); }
.cspc-button-quiet { color: var(--cspc-navy) !important; background: #fff; border-color: var(--cspc-border); }
.cspc-button-danger { color: var(--cspc-danger) !important; background: #fff3f2; border-color: #f5c5c0; }
.cspc-button-return { color: #fff !important; background: #16806a; box-shadow: 0 5px 14px rgba(22,128,106,.18); }
.cspc-button-return:hover { background: #0f6958; }
.cspc-button-load { color: #fff !important; background: #137a4a; border-color: #137a4a; box-shadow: 0 5px 14px rgba(19,122,74,.18); }
.cspc-button-load:hover { background: #0f623c; }
.cspc-button-small { min-height: 34px; padding: 7px 11px; font-size: 12px; white-space: nowrap; }

.cspc-notice { margin: 0 0 20px; padding: 13px 16px; border: 1px solid; border-radius: 10px; font-weight: 650; }
.cspc-notice-success { color: #0d623a; background: #eaf8f1; border-color: #a9dfc3; }
.cspc-notice-error { color: #8e1b13; background: #fff0ef; border-color: #f0b5b0; }

.cspc-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 22px; }
.cspc-stat { min-height: 118px; padding: 22px; border: 1px solid var(--cspc-border); border-radius: 14px; background: #fff; box-shadow: var(--cspc-shadow); display: flex; align-items: center; gap: 18px; }
.cspc-stat > .dashicons { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; }
.cspc-stat div { display: flex; flex-direction: column; }
.cspc-stat strong { font-size: 29px; line-height: 1.05; color: var(--cspc-navy); }
.cspc-stat small { margin-top: 5px; color: var(--cspc-muted); }
.cspc-stat-blue > .dashicons { color: #176ca2; background: #e9f5fc; }
.cspc-stat-gold > .dashicons { color: #87610b; background: #fbf3db; }
.cspc-stat-slate > .dashicons { color: #53617b; background: #eef0f4; }
.cspc-stat-navy > .dashicons { color: #fff; background: var(--cspc-navy); }
.cspc-stat-red { border-color: #efaaa4; background: #fff5f4; }
.cspc-stat-red > .dashicons { color: #fff; background: var(--cspc-danger); }
.cspc-stat-red strong, .cspc-stat-red small { color: #8e1b13; }

.cspc-panel { margin-bottom: 22px; padding: 22px; border: 1px solid var(--cspc-border); border-radius: 14px; background: #fff; box-shadow: var(--cspc-shadow); }
.cspc-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 17px; }
.cspc-panel-head h2 { margin: 0; color: var(--cspc-navy); font-size: 20px; }
.cspc-panel-head p { margin: 3px 0 0; color: var(--cspc-muted); }
.cspc-panel-head > a { color: var(--cspc-blue); font-weight: 700; text-decoration: none; }

.cspc-table-wrap { width: 100%; overflow-x: auto; }
.cspc-data-table { width: 100%; border-collapse: collapse; }
.cspc-data-table th { padding: 10px 12px; color: #5f6b7d; background: #f6f8fb; border-bottom: 1px solid var(--cspc-border); font-size: 11px; letter-spacing: .07em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.cspc-data-table td { padding: 13px 12px; border-bottom: 1px solid #edf0f4; vertical-align: middle; }
.cspc-data-table tbody tr:last-child td { border-bottom: 0; }
.cspc-data-table tbody tr:hover { background: #fafbfd; }
.cspc-data-table td small { display: block; margin-top: 3px; color: var(--cspc-muted); }
.cspc-row-link { display: inline-block; padding: 6px 10px; color: var(--cspc-navy) !important; border: 1px solid var(--cspc-border); border-radius: 7px; font-weight: 750; text-decoration: none; }
.cspc-row-actions { display: flex; align-items: center; gap: 6px; }
.cspc-row-link-return { color: #0f6958 !important; border-color: #9fd3c7; background: #effaf7; }
.cspc-archive-inline { display: inline-flex; margin: 0; }
.cspc-row-link-archive { appearance: none; background: #f7f9fc; cursor: pointer; font: inherit; font-size: 12px; line-height: 1.2; }

.cspc-status { display: inline-flex; align-items: center; justify-content: center; min-height: 29px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.cspc-status-draft { color: #596274; background: #edf0f4; }
.cspc-status-prepared { color: #6e4c03; background: #fbefc7; }
.cspc-status-reviewed { color: #125b87; background: #e2f2fb; }
.cspc-status-dispatched { color: #1b4c90; background: #e8effb; }
.cspc-status-finalized { color: #0e6840; background: #e4f7ed; }
.cspc-status-cancelled { color: #961f16; background: #fde9e7; }
.cspc-route-open-load { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 12px 0; }
.cspc-status-pending, .cspc-status-production, .cspc-status-draft { color: #6e4c03; background: #fbefc7; }
.cspc-status-ready, .cspc-status-scheduled, .cspc-status-sent { color: #125b87; background: #e2f2fb; }
.cspc-status-ready_for_load { color: #0e6840; background: #ddf6e9; }
.cspc-status-loaded, .cspc-status-converted { color: #293d7a; background: #e9edfb; }
.cspc-status-delivered, .cspc-status-accepted { color: #0e6840; background: #e4f7ed; }
.cspc-status-pending_later, .cspc-status-expired { color: #76520b; background: #fff0c9; }
.cspc-status-returned, .cspc-status-rejected { color: #961f16; background: #fde9e7; }
.cspc-status-partial_delivery { color: #7a4b00; background: #fff0c9; }

.cspc-form-section { padding: 26px; }
.cspc-section-title { display: flex; align-items: center; gap: 13px; margin-bottom: 22px; }
.cspc-section-title > span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--cspc-navy); font-weight: 800; }
.cspc-section-title h2 { margin: 0; color: var(--cspc-navy); font-size: 20px; }
.cspc-section-title p { margin: 2px 0 0; color: var(--cspc-muted); }
.cspc-field-grid { display: grid; gap: 16px; }
.cspc-field-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cspc-span-2 { grid-column: span 2; }
.cspc-form label, .cspc-filter label, .cspc-create-user label, .cspc-catalog-form label, .cspc-block-label { display: flex; flex-direction: column; gap: 6px; color: #344054; font-size: 13px; font-weight: 750; }
.cspc-form label b { color: var(--cspc-danger); }
.cspc-form input, .cspc-form select, .cspc-form textarea,
.cspc-filter input, .cspc-filter select,
.cspc-create-user input, .cspc-create-user select,
.cspc-catalog-form input, .cspc-returns input, .cspc-returns select, .cspc-returns textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    color: var(--cspc-text);
    background: #fff;
    border: 1px solid #cfd6e2;
    border-radius: 8px;
    outline: none;
}
.cspc-form textarea, .cspc-returns textarea { min-height: 86px; resize: vertical; }
.cspc-form input:focus, .cspc-form select:focus, .cspc-form textarea:focus,
.cspc-filter input:focus, .cspc-filter select:focus { border-color: var(--cspc-blue); box-shadow: 0 0 0 3px rgba(10,86,137,.12); }

.cspc-item-table-wrap { overflow-x: auto; }
.cspc-item-table { width: 100%; min-width: 1900px; border-collapse: collapse; }
.cspc-item-table th { padding: 8px 7px; color: #526071; background: #f5f7fa; font-size: 11px; text-align: left; text-transform: uppercase; }
.cspc-item-table th small { display: block; margin-top: 2px; color: #137a4a; font-size: 9px; letter-spacing: .04em; }
.cspc-item-table td { padding: 6px 5px; border-bottom: 1px solid #edf0f4; }
.cspc-item-table th:nth-child(1), .cspc-item-table td:nth-child(1) { width: 72px; }
.cspc-item-table th:nth-child(2), .cspc-item-table td:nth-child(2) { width: 270px; }
.cspc-item-table th:nth-child(3), .cspc-item-table td:nth-child(3) { width: 130px; }
.cspc-item-table th:nth-child(4), .cspc-item-table td:nth-child(4) { min-width: 220px; }
.cspc-item-table th:nth-child(5), .cspc-item-table td:nth-child(5) { width: 130px; }
.cspc-item-table th:nth-child(6), .cspc-item-table td:nth-child(6) { width: 140px; }
.cspc-item-table th:nth-child(7), .cspc-item-table td:nth-child(7) { width: 125px; }
.cspc-item-table th:nth-child(8), .cspc-item-table td:nth-child(8) { width: 155px; }
.cspc-item-table th:nth-child(9), .cspc-item-table td:nth-child(9) { width: 125px; }
.cspc-item-table th:nth-child(10), .cspc-item-table td:nth-child(10) { width: 125px; }
.cspc-item-table th:last-child, .cspc-item-table td:last-child { width: 42px; }
.cspc-item-table input, .cspc-item-table select { min-height: 38px; padding: 7px 8px; }
.cspc-item-table input[data-price] { color: #0d623a; background: #f5fff9; border-color: #acd9c2; font-weight: 800; }
.cspc-item-table [data-line-discount-amount] { display: block; margin-top: 4px; color: var(--cspc-danger); font-size: 11px; font-weight: 750; }
#cspc-items-table { min-width: 1500px; table-layout: fixed; }
#cspc-items-table th:nth-child(4), #cspc-items-table td:nth-child(4) { width: 145px; min-width: 145px; max-width: 145px; }
#cspc-items-table .cspc-description { width: 100%; }
.cspc-remove-row { width: 32px; height: 32px; color: #a3261d; background: #fff1f0; border: 0; border-radius: 7px; cursor: pointer; font-size: 22px; line-height: 1; }
.cspc-items-actions { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 16px; }
.cspc-items-actions > div { display: flex; gap: 16px; color: var(--cspc-muted); }
.cspc-items-actions strong { color: var(--cspc-navy); }
.cspc-form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin: 16px 0 8px; }
.cspc-conversion-panel { border-left: 5px solid var(--cspc-blue); }
.cspc-conversion-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cspc-conversion-panel > small { display: block; margin-top: 12px; color: var(--cspc-muted); }
.cspc-load-queue { border: 2px solid #9bd8bb; background: #f8fffb; }
.cspc-load-queue .cspc-panel-head > strong { color: #0e6840; }
.cspc-route-preselected { background: #ebfff4 !important; outline: 2px solid #82cda7; outline-offset: -2px; }

.cspc-filter { display: grid; grid-template-columns: 1.6fr repeat(5, 1fr); gap: 12px; align-items: end; margin-bottom: 20px; padding: 18px; border: 1px solid var(--cspc-border); border-radius: 12px; background: #fff; }
.cspc-filter-short { grid-template-columns: 190px 190px auto; justify-content: start; }
.cspc-filter-actions { display: flex; gap: 7px; }
.cspc-pagination { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 18px; }
.cspc-pagination a { min-width: 34px; height: 34px; padding: 6px; display: grid; place-items: center; border: 1px solid var(--cspc-border); border-radius: 7px; text-decoration: none; }
.cspc-pagination a.is-current { color: #fff; background: var(--cspc-navy); border-color: var(--cspc-navy); }
.cspc-empty { padding: 44px 20px; text-align: center; color: var(--cspc-muted); }
.cspc-empty .dashicons { width: 46px; height: 46px; color: var(--cspc-slate); font-size: 46px; }
.cspc-empty h3 { margin: 10px 0 3px; color: var(--cspc-navy); }
.cspc-empty p { margin: 0; }

.cspc-status-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 20px; padding: 12px 14px; border: 1px solid var(--cspc-border); border-radius: 11px; background: #fff; }
.cspc-status-actions form { margin: 0; }
.cspc-status-actions > .cspc-status { margin-right: auto; }

.cspc-print-sheet { width: 8.5in; min-height: 11in; margin: 0 auto 24px; padding: .3in .34in .24in; display: flex; flex-direction: column; color: #111827; background: #fff; box-shadow: 0 6px 34px rgba(0,0,0,.12); }
.cspc-print-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cspc-print-company { display: flex; flex-direction: column; font-size: 10.5px; font-style: italic; font-weight: 650; line-height: 1.35; }
.cspc-print-company h2 { margin: 0 0 5px; color: var(--cspc-navy); font-size: 16px; font-style: normal; letter-spacing: .02em; }
.cspc-print-company strong { font-size: 12px; }
.cspc-logo-print .cspc-logo-sanpablo { width: 112px; height: 69px; }
.cspc-logo-print .cspc-logo-dorminova { width: 108px; height: 45px; }
.cspc-print-strip { height: 6px; margin: 5px 0 8px; }
.cspc-print-title { display: grid; grid-template-columns: 1fr 152px; border: 1px solid #9da9ba; }
.cspc-print-title > div { padding: 8px 10px; }
.cspc-print-title > div + div { border-left: 1px solid #9da9ba; text-align: center; }
.cspc-print-title small { display: block; color: #5b6678; font-size: 7.5px; font-weight: 800; letter-spacing: .1em; }
.cspc-print-title h1 { margin: 2px 0 0; color: var(--cspc-navy); font-size: 15px; line-height: 1.2; }
.cspc-print-title strong { display: block; margin-top: 4px; color: var(--cspc-navy); font-size: 14px; }
.cspc-print-meta { display: grid; grid-template-columns: repeat(6, 1fr); margin: 6px 0; border: 1px solid #9da9ba; }
.cspc-print-meta div { min-height: 35px; padding: 4px 6px; border-right: 1px solid #c3cad4; }
.cspc-print-meta div:last-child { border-right: 0; }
.cspc-print-meta .wide { grid-column: span 2; }
.cspc-print-meta dt { color: #596579; font-size: 7.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.cspc-print-meta dd { margin: 3px 0 0; font-size: 9.5px; font-weight: 700; }
.cspc-print-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cspc-print-table th { padding: 5px 4px; color: #fff; background: var(--cspc-navy); border: 1px solid var(--cspc-navy-dark); font-size: 7.5px; line-height: 1.15; text-align: center; text-transform: uppercase; }
.cspc-print-table td { height: 28px; padding: 4px 5px; border: 1px solid #9da9ba; font-size: 8.5px; line-height: 1.15; vertical-align: middle; }
.cspc-print-table th:nth-child(1) { width: 7%; }
.cspc-print-table th:nth-child(2) { width: 14%; }
.cspc-print-table th:nth-child(3) { width: 11%; }
.cspc-print-table th:nth-child(4) { width: 23%; }
.cspc-print-table th:nth-child(5) { width: 11%; }
.cspc-print-table th:nth-child(6) { width: 14%; }
.cspc-print-table th:nth-child(7) { width: 20%; }
.cspc-doc-table th:nth-child(1) { width: 8%; }
.cspc-doc-table th:nth-child(2) { width: 31%; }
.cspc-doc-table th:nth-child(3) { width: 15%; }
.cspc-doc-table th:nth-child(4) { width: 15%; }
.cspc-doc-table th:nth-child(5) { width: 16%; }
.cspc-doc-table th:nth-child(6) { width: 15%; }
.cspc-print-table td:first-child { text-align: center; font-weight: 800; }
.cspc-print-table tr.blank td { height: 25px; }
.cspc-load-print-table th:nth-child(1) { width: 4%; }
.cspc-load-print-table th:nth-child(2) { width: 6%; }
.cspc-load-print-table th:nth-child(3) { width: 11%; }
.cspc-load-print-table th:nth-child(4) { width: 12%; }
.cspc-load-print-table th:nth-child(5) { width: 9%; }
.cspc-load-print-table th:nth-child(6) { width: 13%; }
.cspc-load-print-table th:nth-child(7) { width: 24%; }
.cspc-load-print-table th:nth-child(8) { width: 21%; }
.cspc-load-print-table td small { display: block; margin-top: 2px; color: #596579; font-size: 7px; }
.cspc-print-summary { display: grid; grid-template-columns: 1fr 1.35fr; margin-top: 8px; border: 1px solid #9da9ba; }
.cspc-print-summary > div { min-height: 55px; padding: 7px 9px; }
.cspc-print-summary > div + div { border-left: 1px solid #9da9ba; }
.cspc-print-summary strong { display: block; color: var(--cspc-navy); font-size: 9px; }
.cspc-print-summary span, .cspc-print-summary p { margin: 3px 0 0; font-size: 8px; line-height: 1.25; }
.cspc-print-route-control { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 13px; margin-top: 7px; padding: 6px 8px; border: 1px solid #9da9ba; font-size: 7.7px; }
.cspc-print-route-control strong { color: var(--cspc-navy); }
.cspc-print-incident { min-height: 30px; padding: 6px 8px; display: flex; gap: 6px; border: 1px solid #9da9ba; border-top: 0; font-size: 7.7px; }
.cspc-print-incident strong { color: var(--cspc-navy); white-space: nowrap; }
.cspc-signatures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 20px 4px 8px; break-inside: avoid; page-break-inside: avoid; }
.cspc-signatures div { text-align: center; }
.cspc-signatures span { display: block; border-top: 1px solid #283449; }
.cspc-signatures strong { display: block; margin-top: 4px; color: var(--cspc-navy); font-size: 8.5px; }
.cspc-signatures small { display: block; margin-top: 2px; color: #687487; font-size: 7.5px; }
.cspc-print-footer { display: flex; flex-direction: column; align-items: center; gap: 1px; margin-top: auto; padding: 4px 8px; color: #fff; background: var(--cspc-blue); font-size: 7px; text-align: center; break-inside: avoid; page-break-inside: avoid; }
.cspc-print-footer a { color: #fff; font-weight: 800; }

.cspc-returns { margin-top: 24px; scroll-margin-top: 24px; }
.cspc-returns:target { border-color: #67b8a7; box-shadow: 0 0 0 3px rgba(22,128,106,.13), var(--cspc-shadow); }
.cspc-returns .cspc-data-table input { min-width: 100px; }
.cspc-returns .cspc-data-table select { min-width: 150px; }
.cspc-return-table { min-width: 1450px; }
.cspc-returns-list { min-width: 1040px; }
.cspc-empty-compact { padding: 28px 16px; }
.cspc-return-table tr.is-code-match { background: #fff5cf; outline: 2px solid var(--cspc-gold); outline-offset: -2px; }
.cspc-return-code-search { width: min(460px, 100%); margin: 0 0 16px; display: flex; flex-direction: column; gap: 5px; color: #344054; font-size: 13px; font-weight: 800; }
.cspc-return-code-search small { color: var(--cspc-muted); font-weight: 500; }
.cspc-return-summary { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 10px; margin: 0 0 16px; }
.cspc-return-summary span { padding: 12px 14px; display: flex; flex-direction: column; color: var(--cspc-muted); background: #f4f7fb; border: 1px solid var(--cspc-border); border-radius: 9px; font-size: 11px; font-weight: 750; }
.cspc-return-summary strong { margin-top: 3px; color: var(--cspc-navy); font-size: 22px; }
.cspc-code-chip { display: inline-flex; padding: 5px 8px; color: #fff; background: var(--cspc-navy); border-radius: 6px; font-size: 12px; letter-spacing: .04em; }
.cspc-internal-value { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: -8px 0 20px; }
.cspc-internal-value article { padding: 14px 16px; display: flex; flex-direction: column; background: #f7f3ea; border: 1px solid #ead8aa; border-radius: 10px; }
.cspc-internal-value small { color: var(--cspc-muted); font-weight: 750; }
.cspc-internal-value strong { margin-top: 3px; color: var(--cspc-navy); font-size: 20px; }
.cspc-internal-value p { grid-column: 1 / -1; margin: 0; color: var(--cspc-muted); font-size: 11px; }
.cspc-stock-negative { color: var(--cspc-danger); }
.cspc-block-label { margin-top: 16px; }
.cspc-audit { margin: 20px 0; padding: 14px 18px; border: 1px solid var(--cspc-border); border-radius: 10px; background: #fff; }
.cspc-audit summary { color: var(--cspc-navy); cursor: pointer; font-weight: 750; }
.cspc-audit ol { margin: 14px 0 0; padding-left: 22px; }
.cspc-audit li { margin: 8px 0; padding-left: 5px; }
.cspc-audit li span, .cspc-audit li small { display: block; color: var(--cspc-muted); }

.cspc-report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cspc-catalog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.cspc-catalog-card { margin: 0; }
.cspc-catalog-card ul { margin: 0 0 20px; padding: 0; list-style: none; }
.cspc-catalog-card li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid #edf0f4; }
.cspc-catalog-card li small { display: block; color: var(--cspc-muted); }
.cspc-mini-button { padding: 5px 8px; color: #6e7787; background: #f0f2f5; border: 0; border-radius: 999px; cursor: pointer; font-size: 11px; font-weight: 800; }
.cspc-mini-button.is-active { color: #0f6840; background: #e5f7ee; }
.cspc-catalog-form { display: grid; gap: 10px; padding-top: 15px; border-top: 2px solid var(--cspc-beige); }
.cspc-user-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 20px; }
.cspc-create-user { display: flex; flex-direction: column; gap: 12px; }
.cspc-create-user label small, .cspc-help { color: var(--cspc-muted); font-size: 12px; }
.cspc-catalog-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.cspc-catalog-summary article { padding: 17px 20px; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--cspc-border); border-radius: 12px; }
.cspc-catalog-summary strong { color: var(--cspc-navy); font-size: 22px; }
.cspc-catalog-summary span { color: var(--cspc-muted); font-size: 12px; }
.cspc-source { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; }
.cspc-source-web { color: #075f72; background: #dff5f8; }
.cspc-source-manual { color: #754b00; background: #fff0c8; }
.cspc-inline-price { display: flex; align-items: center; gap: 6px; min-width: 260px; }
.cspc-inline-price span { color: var(--cspc-muted); font-weight: 800; }
.cspc-inline-price input { width: 112px; min-height: 38px; padding: 7px 9px; border: 1px solid var(--cspc-border); border-radius: 7px; }
.cspc-check-field { min-height: 42px; align-items: center; flex-direction: row !important; padding: 9px 11px; background: #f7f9fc; border: 1px solid #cfd6e2; border-radius: 8px; }
.cspc-check-field input { width: 18px; min-height: 18px; margin: 0; }
.cspc-email-action input { width: 230px; min-height: 42px; padding: 8px 10px; border: 1px solid #cfd6e2; border-radius: 9px; }
.cspc-button-whatsapp { color: #fff !important; background: #128c4b; border-color: #128c4b; }

.cspc-ticket-shell { width: min(860px, 100%); margin: 0 auto 28px; }
.cspc-ticket { overflow: hidden; color: #172033; background: #fff; border-radius: 18px; border: 1px solid #d8e3ef; box-shadow: 0 10px 34px rgba(8,38,76,.12); }
.cspc-ticket > header { min-height: 128px; padding: 22px 28px 18px; display: flex; align-items: center; justify-content: space-between; gap: 22px; color: var(--cspc-navy); background: #fff; }
.cspc-ticket > header > div:first-child { display: flex; flex-direction: column; gap: 7px; }
.cspc-ticket > header span { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: var(--cspc-muted); }
.cspc-ticket > header strong { font-size: 34px; line-height: 1.05; color: var(--cspc-navy); }
.cspc-ticket > header small { color: var(--cspc-blue); font-weight: 800; }
.cspc-ticket > header .cspc-logo-lockup { background: transparent; }
.cspc-ticket-strip { height: 8px; background: linear-gradient(90deg, var(--cspc-gold) 0 34%, #d9d9d9 34% 64%, var(--cspc-navy) 64% 100%); }
.cspc-ticket dl { margin: 0; padding: 18px 24px 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.cspc-ticket dl div { padding: 12px 14px; background: #f4f8fc; border: 1px solid #e2e8f0; border-radius: 10px; }
.cspc-ticket dt { color: var(--cspc-muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.cspc-ticket dd { margin: 4px 0 0; color: var(--cspc-navy); font-size: 15px; font-weight: 800; }
.cspc-ticket-customer { margin: 0 24px 16px; padding: 15px 16px; display: flex; flex-direction: column; gap: 3px; background: #f9fbfd; border: 1px solid #e4edf6; border-left: 4px solid var(--cspc-blue); border-radius: 10px; }
.cspc-ticket-customer strong { color: var(--cspc-navy); font-size: 18px; }
.cspc-ticket-customer span, .cspc-ticket-customer small { color: var(--cspc-muted); }
.cspc-ticket table { width: calc(100% - 48px); margin: 0 24px; border-collapse: collapse; }
.cspc-ticket th { padding: 11px 8px; color: #fff; background: var(--cspc-navy); font-size: 10px; text-align: left; text-transform: uppercase; }
.cspc-ticket td { padding: 12px 8px; border-bottom: 1px solid #e1e6ee; font-size: 13px; }
.cspc-ticket td small { display: block; margin-top: 3px; color: var(--cspc-muted); }
.cspc-ticket th:nth-child(2), .cspc-ticket td:nth-child(2) { width: 58px; text-align: center; }
.cspc-ticket th:nth-child(3), .cspc-ticket td:nth-child(3) { width: 105px; text-align: right; }
.cspc-ticket th:last-child, .cspc-ticket td:last-child { text-align: right; }
.cspc-ticket-totals { margin: 18px 24px; padding: 16px 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; background: #eff7fc; border: 1px solid #d5e8f4; border-radius: 12px; }
.cspc-ticket-totals > div { display: flex; flex-direction: column; gap: 7px; }
.cspc-ticket-totals span, .cspc-ticket-totals strong { display: flex; justify-content: space-between; gap: 16px; color: var(--cspc-muted); font-size: 12px; }
.cspc-ticket-totals b { color: var(--cspc-navy); }
.cspc-ticket-totals strong { margin-top: 4px; padding-top: 8px; color: var(--cspc-navy); border-top: 1px solid #bddbea; font-size: 17px; }
.cspc-ticket-totals .cspc-ticket-payment-highlight,
.cspc-ticket-totals .cspc-ticket-balance-highlight { margin-top: 3px; padding: 9px 11px; align-items: center; border-radius: 8px; font-weight: 800; }
.cspc-ticket-totals .cspc-ticket-payment-highlight { color: #176b49; background: #e8f7f0; border: 1px solid #b8e3cf; }
.cspc-ticket-totals .cspc-ticket-balance-highlight { color: var(--cspc-navy); background: #fff8dc; border: 1px solid #edd783; }
.cspc-ticket-totals .cspc-ticket-payment-highlight b,
.cspc-ticket-totals .cspc-ticket-balance-highlight b { font-size: 15px; }

.cspc-ticket-note { margin: 0 28px 30px; padding: 12px 14px; color: var(--cspc-muted); background: #f8fafc; border-left: 4px solid var(--cspc-gold); }
.cspc-ticket > footer { margin-top: 12px; padding: 18px 25px; display: flex; align-items: center; flex-direction: column; gap: 5px; color: #fff; background: var(--cspc-blue); text-align: center; }
.cspc-ticket > footer strong { font-size: 18px; }
.cspc-ticket > footer span { font-size: 12px; }
.cspc-ticket > footer small { margin-top: 5px; font-size: 9px; }
.cspc-ticket-toast { position: fixed; right: 20px; bottom: 20px; z-index: 99999; max-width: 420px; padding: 14px 18px; color: #fff; background: #13734b; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.22); font-weight: 750; }
.cspc-ticket-toast.is-error { background: #9c3f19; }

.cspc-quick-customer { margin-top: 18px; padding: 18px; background: #eef8fd; border: 1px solid #bfe4f5; border-radius: 11px; }
.cspc-quick-customer[hidden] { display: none; }
.cspc-quote-terms { margin-top: 16px; }
.cspc-condition-field { min-width: 260px; display: grid; grid-template-columns: 130px 1fr; gap: 6px; }
.cspc-delete-load, .cspc-delete-record { margin: 0 0 20px; padding: 14px 16px; display: flex; align-items: end; gap: 12px; background: #fff7f6; border: 1px solid #f1c0bb; border-radius: 10px; }
.cspc-delete-load label, .cspc-delete-record > div { flex: 1; display: flex; flex-direction: column; gap: 4px; color: var(--cspc-danger); font-weight: 800; }
.cspc-delete-load input, .cspc-delete-record input, .cspc-inline-delete input, .cspc-catalog-delete input { min-height: 38px; padding: 7px 9px; border: 1px solid #d7a8a3; border-radius: 7px; }
.cspc-delete-record > div small { color: var(--cspc-muted); font-weight: 500; }
.cspc-inline-delete { min-width: 235px; display: flex; align-items: center; gap: 6px; }
.cspc-inline-delete input { min-width: 120px; }
.cspc-user-cards { display: grid; gap: 13px; }
.cspc-user-card { padding: 16px; border: 1px solid var(--cspc-border); border-radius: 11px; background: #fbfcfe; }
.cspc-user-card > header { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 12px; }
.cspc-user-card > header div { display: flex; flex-direction: column; }
.cspc-user-card > header strong { color: var(--cspc-navy); }
.cspc-user-card > header span { color: var(--cspc-muted); font-size: 12px; }
.cspc-user-card > header b { color: var(--cspc-blue); font-size: 12px; }
.cspc-role-checks { margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; border: 0; }
.cspc-role-checks legend { margin-bottom: 8px; color: var(--cspc-navy); font-weight: 800; }
.cspc-role-checks label { display: flex; align-items: center; flex-direction: row; gap: 7px; padding: 8px 10px; background: #eef8fd; border-radius: 7px; font-size: 12px; }
.cspc-role-checks input { width: auto; min-height: 0; }
.cspc-role-summary { display: flex; flex-wrap: wrap; gap: 6px; }
.cspc-role-summary span { padding: 5px 8px; color: var(--cspc-navy); background: #e9f6fc; border-radius: 999px; font-size: 11px; font-weight: 750; }
.cspc-user-delete { margin-top: 12px; }
.cspc-catalog-actions { display: flex; align-items: center; gap: 7px; }
.cspc-catalog-delete { display: flex; align-items: center; gap: 5px; }
.cspc-catalog-delete input { width: 105px; }
.cspc-mini-button.is-delete { color: var(--cspc-danger); background: #fff0ef; }
.cspc-audit-snapshot pre { max-width: 480px; max-height: 280px; overflow: auto; padding: 12px; color: #d6e9ff; background: #11152f; border-radius: 8px; font-size: 10px; white-space: pre-wrap; }
.cspc-direct-payment { width: min(760px, 100%); margin: 0 auto 28px; display: grid; grid-template-columns: repeat(3, 1fr) auto; gap: 12px; align-items: end; }
.cspc-direct-payment .cspc-panel-head { grid-column: 1 / -1; }
.cspc-direct-payment label { display: flex; flex-direction: column; gap: 6px; color: #344054; font-size: 13px; font-weight: 750; }
.cspc-direct-payment input { min-height: 42px; padding: 9px 11px; border: 1px solid #cfd6e2; border-radius: 8px; }

.cspc-footer { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 17px 20px; color: #dce7f7; background: var(--cspc-navy-dark); font-size: 12px; }
.cspc-credit-button { display: inline-flex; padding: 5px 9px; color: var(--cspc-navy-dark) !important; background: var(--cspc-gold-light); border-radius: 999px; font-weight: 800; text-decoration: none; }

.cspc-quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cspc-quick-grid a { min-height: 116px; padding: 20px; display: grid; grid-template-columns: 42px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; color: var(--cspc-navy); background: #fff; border: 1px solid var(--cspc-border); border-radius: 14px; box-shadow: var(--cspc-shadow); text-decoration: none; }
.cspc-quick-grid .dashicons { grid-row: span 2; width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: var(--cspc-navy); border-radius: 11px; font-size: 21px; }
.cspc-quick-grid a.cspc-quick-admin { border-color: #d7bd7e; background: linear-gradient(135deg, #fffdf7 0%, #f8edcf 100%); }
.cspc-quick-grid a.cspc-quick-admin .dashicons { background: var(--cspc-gold); }
.cspc-quick-grid strong { align-self: end; font-size: 16px; }
.cspc-quick-grid small { align-self: start; color: var(--cspc-muted); }
.cspc-filter-search { grid-template-columns: minmax(135px, .55fr) minmax(260px, 1.6fr) minmax(150px, .7fr) auto auto; }
.cspc-filter-orders { grid-template-columns: minmax(135px, .55fr) minmax(240px, 1.5fr) minmax(160px, .7fr) minmax(160px, .7fr) auto; }
.cspc-filter-archive { grid-template-columns: 135px minmax(220px, 1.4fr) repeat(5, minmax(125px, .72fr)) auto; }
.cspc-form-narrow { width: min(650px, 100%); margin: 0 auto; }
.cspc-form-narrow .cspc-create-user textarea, .cspc-create-user textarea { width: 100%; min-height: 78px; padding: 10px 11px; border: 1px solid #cfd6e2; border-radius: 8px; resize: vertical; }
.cspc-notice-warning { background: #fff8e5; color: #704d00; border: 1px solid #efc76e; }
.cspc-edit-lock-note { color: #704d00; font-weight: 700; }
.cspc-edit-payment { min-width: 210px; margin-bottom: 8px; }
.cspc-edit-payment summary { color: #075a94; cursor: pointer; font-weight: 800; }
.cspc-edit-payment form { display: grid; gap: 7px; margin-top: 8px; padding: 10px; background: #f3f7fb; border: 1px solid #d8e3ef; border-radius: 10px; }
.cspc-edit-payment label { display: grid; gap: 3px; font-size: 11px; font-weight: 800; color: #40536a; }
.cspc-edit-payment input { width: 100%; min-width: 150px; padding: 7px 8px; border: 1px solid #c9d5e3; border-radius: 7px; }
.cspc-commercial-lines { min-width: 1320px; }
.cspc-commercial-lines th:nth-child(1) { width: 190px; }
.cspc-commercial-lines th:nth-child(2) { width: 230px; }
.cspc-commercial-lines th:nth-child(3), .cspc-commercial-lines th:nth-child(4), .cspc-commercial-lines th:nth-child(5) { width: 135px; }
.cspc-commercial-lines th:nth-child(6) { width: 76px; }
.cspc-commercial-lines th:nth-child(7) { width: 125px; }
.cspc-commercial-lines th:nth-child(8) { width: 110px; }
.cspc-commercial-summary { margin-top: 18px; padding: 16px 18px; display: flex; justify-content: flex-end; gap: 28px; color: var(--cspc-muted); background: #f7f9fc; border-radius: 10px; }
.cspc-commercial-summary strong { margin-left: 8px; color: var(--cspc-navy); font-size: 20px; }
.cspc-commercial-summary i { color: var(--cspc-muted); font-style: normal; font-weight: 750; }
.cspc-quote-terms label > small { margin-top: 5px; color: var(--cspc-muted); font-size: 11px; font-weight: 600; }
.cspc-quote-expiry-alert { margin: 0 0 20px; padding: 18px; color: #7d1710; background: #fff0ef; border: 2px solid #d92d20; border-radius: 13px; box-shadow: 0 8px 24px rgba(180,35,24,.10); }
.cspc-quote-expiry-title { display: flex; align-items: center; gap: 12px; }
.cspc-quote-expiry-title > .dashicons { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; background: var(--cspc-danger); border-radius: 50%; font-size: 22px; }
.cspc-quote-expiry-title h2 { margin: 0; color: #7d1710; font-size: 20px; }
.cspc-quote-expiry-title p { margin: 2px 0 0; }
.cspc-quote-expiry-list { display: grid; gap: 7px; margin-top: 14px; }
.cspc-quote-expiry-list a { padding: 10px 12px; display: grid; grid-template-columns: minmax(125px,.55fr) minmax(160px,1fr) minmax(220px,1.2fr); gap: 12px; color: #7d1710 !important; background: #fff; border: 1px solid #efaaa4; border-radius: 9px; text-decoration: none; }
.cspc-quote-expiry-list a:hover { border-color: #d92d20; }
.cspc-quote-expiry-list b { text-align: right; }
.cspc-quote-row-alert { background: #fff7f6; }
.cspc-quote-row-alert:hover { background: #ffefed !important; }
.cspc-follow-up { display: inline-flex; padding: 5px 8px; border-radius: 7px; font-size: 11px; font-weight: 800; white-space: nowrap; }
.cspc-follow-up-today, .cspc-follow-up-overdue { color: #8e1b13; background: #fee4e2; border: 1px solid #f4aaa4; }
.cspc-follow-up-soon { color: #76520b; background: #fff0c9; border: 1px solid #ead18c; }
.cspc-follow-up-clear { color: #137a4a; font-size: 12px; font-weight: 750; }
.cspc-quote-view-alert { margin: -8px 0 20px; padding: 13px 16px; display: flex; align-items: center; gap: 10px; color: #8e1b13; background: #fff0ef; border: 2px solid #d92d20; border-radius: 11px; }
.cspc-quote-view-alert .dashicons { color: var(--cspc-danger); }
.cspc-route-select { margin-top: 22px; border: 1px solid var(--cspc-border); border-radius: 10px; }
.cspc-route-select input[type="checkbox"] { width: 18px; height: 18px; }
.cspc-route-unassigned { margin-bottom: 20px; }
.cspc-driver-queues { display: grid; gap: 12px; }
.cspc-driver-queue { overflow: hidden; border: 1px solid var(--cspc-border); border-radius: 14px; background: #fff; box-shadow: var(--cspc-shadow); }
.cspc-driver-queue > summary { display: grid; grid-template-columns: auto minmax(150px, 1fr) auto auto; align-items: center; gap: 10px; padding: 16px 18px; cursor: pointer; color: var(--cspc-navy); list-style: none; }
.cspc-driver-queue > summary::-webkit-details-marker { display: none; }
.cspc-driver-queue > summary small { color: var(--cspc-muted); }
.cspc-driver-queue > summary .dashicons:last-child { transition: transform .2s ease; }
.cspc-driver-queue[open] > summary .dashicons:last-child { transform: rotate(180deg); }
.cspc-driver-empty { padding: 0 18px 18px; color: var(--cspc-muted); }
.cspc-driver-branch-queue { margin: 0 14px 14px; box-shadow: none; background: #f9fbfe; }
.cspc-driver-branch-queue .cspc-route-select { margin-top: 14px; background: #fff; }
.cspc-driver-branch-queue h3 { margin: 0; color: var(--cspc-navy); }
.cspc-driver-branch-queue .cspc-form-actions label { min-width: 220px; }
.cspc-selection-count { margin-right: auto; color: var(--cspc-muted); }
.cspc-selection-count b { color: var(--cspc-navy); font-size: 19px; }
.cspc-order-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cspc-order-actions form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; }
.cspc-order-actions .cspc-panel-head { grid-column: 1 / -1; }
.cspc-order-actions label { display: flex; flex-direction: column; gap: 6px; color: #344054; font-size: 13px; font-weight: 750; }
.cspc-order-actions input, .cspc-order-actions select { min-height: 42px; padding: 9px 11px; border: 1px solid #cfd6e2; border-radius: 8px; }
.cspc-order-actions .cspc-help { grid-column: 1 / -1; }
.cspc-document-sheet { min-height: 10.45in; display: flex; flex-direction: column; }
.cspc-doc-meta { display: grid; grid-template-columns: 1.25fr 1fr 1fr; margin: 10px 0; border: 1px solid #9da9ba; }
.cspc-doc-meta-quote { grid-template-columns: 1.2fr 1fr 1fr 1fr; }
.cspc-doc-meta > div { min-height: 58px; padding: 8px 10px; display: flex; flex-direction: column; border-right: 1px solid #c3cad4; }
.cspc-doc-meta > div:last-child { border-right: 0; }
.cspc-doc-meta small { color: #596579; font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.cspc-doc-meta strong { margin-top: 3px; color: var(--cspc-navy); font-size: 11px; }
.cspc-doc-meta span { margin-top: 2px; color: #586579; font-size: 9px; }
.cspc-advisor-inline { margin-left: 8px; color: var(--cspc-muted); font-size: 13px; font-weight: 750; }
.cspc-doc-table th:nth-child(1) { width: 9%; }
.cspc-doc-table th:nth-child(2) { width: 42%; }
.cspc-doc-table th:nth-child(3) { width: 15%; }
.cspc-doc-table th:nth-child(4), .cspc-doc-table th:nth-child(5) { width: 17%; }
.cspc-doc-table td:nth-child(4), .cspc-doc-table td:nth-child(5) { text-align: right; }
.cspc-doc-bottom { display: grid; grid-template-columns: 1fr 260px; gap: 18px; margin-top: 12px; }
.cspc-doc-bottom > div:first-child { padding: 11px 12px; border: 1px solid #c3cad4; }
.cspc-doc-bottom p { margin: 5px 0; font-size: 9px; }
.cspc-doc-totals { display: flex; flex-direction: column; border: 1px solid #9da9ba; }
.cspc-doc-totals span, .cspc-doc-totals > strong { padding: 6px 9px; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #d2d7df; font-size: 9px; }
.cspc-doc-totals > strong { color: #fff; background: var(--cspc-navy); border-bottom: 0; font-size: 11px; }
.cspc-doc-sign { width: 240px; margin: auto auto 15px; text-align: center; }
.cspc-doc-sign span { display: block; border-top: 1px solid #283449; }
.cspc-doc-sign strong { font-size: 8px; }
.cspc-warranty-copy { margin: 8px 0 10px; padding: 8px 10px 10px; border: 1px solid #b8c1cf; display: flex; flex: 1 1 auto; flex-direction: column; gap: 4px; min-height: 120mm; }
.cspc-warranty-copy h2 { margin: 0; color: var(--cspc-navy); font-size: 11px; }
.cspc-warranty-policy-text { margin: 0; display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; justify-content: space-between; font-size: 11px; line-height: 1.55; text-align: justify; hyphens: auto; }
.cspc-warranty-policy-text .cspc-policy-line { display: block; margin: 0; }
.cspc-warranty-policy-text .cspc-policy-line + .cspc-policy-line { padding-top: 7px; }

.cspc-login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr); }
.cspc-login-brand { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(35px, 7vw, 110px); color: #fff; background: radial-gradient(circle at 18% 18%, #154f8b 0, var(--cspc-navy-dark) 58%, #021128 100%); }
.cspc-login-brand .cspc-logo-lockup { padding: 12px 16px; background: rgba(255,255,255,.96); border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.22); }
.cspc-login-brand .cspc-eyebrow { margin-top: 32px; }
.cspc-login-brand h1 { margin: 5px 0 10px; font-size: clamp(38px, 5vw, 66px); line-height: 1; }
.cspc-login-brand > p:not(.cspc-eyebrow) { max-width: 570px; margin: 0; color: #dce7f6; font-size: 18px; }
.cspc-login-brand .cspc-brand-strip { width: min(480px, 100%); margin-top: 34px; }
.cspc-login-card { display: grid; place-items: center; padding: 38px; background: #fff; }
.cspc-login-card > div { width: min(410px, 100%); }
.cspc-login-card h2 { margin: 5px 0; color: var(--cspc-navy); font-size: 29px; }
.cspc-login-card > div > p:not(.cspc-eyebrow) { margin: 0 0 24px; color: var(--cspc-muted); }
.cspc-login-card label { color: #344054; font-weight: 700; }
.cspc-login-card .login-username, .cspc-login-card .login-password { margin: 13px 0; }
.cspc-login-card input[type="text"], .cspc-login-card input[type="password"] { width: 100%; min-height: 48px; margin-top: 6px; padding: 10px 12px; border: 1px solid #cfd6e2; border-radius: 9px; }
.cspc-login-card .login-remember { font-size: 13px; }
.cspc-login-card .login-submit input { width: 100%; min-height: 48px; color: #fff; background: var(--cspc-navy); border: 0; border-radius: 9px; cursor: pointer; font-weight: 800; }
.cspc-login-credit { margin-top: 28px !important; padding-top: 18px; border-top: 1px solid var(--cspc-border); color: var(--cspc-muted); font-size: 11px; line-height: 1.8; }
.cspc-denied { width: min(560px, calc(100% - 34px)); margin: 12vh auto; padding: 36px; border-radius: 14px; background: #fff; box-shadow: var(--cspc-shadow); text-align: center; }

@media (max-width: 1050px) {
    .cspc-stat-grid { grid-template-columns: repeat(2, 1fr); }
    .cspc-field-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .cspc-filter { grid-template-columns: repeat(3, 1fr); }
    .cspc-catalog-grid { grid-template-columns: 1fr; }
    .cspc-user-grid { grid-template-columns: 1fr; }
    .cspc-quick-grid { grid-template-columns: repeat(2, 1fr); }
    .cspc-order-actions { grid-template-columns: 1fr; }
    .cspc-internal-value { grid-template-columns: repeat(2, 1fr); }
    .cspc-return-summary { grid-template-columns: repeat(2, 1fr); }
    .cspc-print-sheet { width: 100%; min-height: auto; }
}

@media (max-width: 720px) {
    .cspc-topbar { align-items: flex-start; padding: 9px 14px; }
    .cspc-brand > span:last-child { display: none; }
    .cspc-logo-small .cspc-logo-sanpablo { width: 88px; }
    .cspc-logo-small .cspc-logo-dorminova { width: 70px; }
    .cspc-userbox { align-items: flex-end; flex-direction: column; gap: 2px; }
    .cspc-main { width: min(100% - 24px, 1420px); padding-top: 24px; }
    .cspc-page-head { align-items: stretch; flex-direction: column; }
    .cspc-page-head .cspc-button { align-self: flex-start; }
    .cspc-stat-grid, .cspc-report-grid { grid-template-columns: 1fr; }
    .cspc-field-grid-4, .cspc-filter, .cspc-filter-short { grid-template-columns: 1fr; }
    .cspc-span-2 { grid-column: auto; }
    .cspc-quick-grid { grid-template-columns: 1fr; }
    .cspc-commercial-summary { align-items: flex-end; flex-direction: column; gap: 7px; }
    .cspc-order-actions form { grid-template-columns: 1fr; }
    .cspc-order-actions .cspc-panel-head { grid-column: auto; }
    .cspc-items-actions { align-items: flex-start; flex-direction: column; }
    .cspc-catalog-summary { grid-template-columns: 1fr; }
    .cspc-email-action { width: 100%; flex-wrap: wrap; }
    .cspc-email-action input { width: 100%; }
    .cspc-ticket > header { align-items: flex-start; flex-direction: column; }
    .cspc-logo-ticket { width: 100%; }
    .cspc-ticket dl { grid-template-columns: 1fr; }
    .cspc-ticket-totals { grid-template-columns: 1fr; }
    .cspc-role-checks { grid-template-columns: 1fr; }
    .cspc-delete-load, .cspc-delete-record, .cspc-inline-delete, .cspc-inline-price, .cspc-catalog-actions, .cspc-catalog-delete { align-items: stretch; flex-direction: column; }
    .cspc-inline-delete, .cspc-catalog-delete input { width: 100%; }
    .cspc-direct-payment { grid-template-columns: 1fr; }
    .cspc-internal-value, .cspc-return-summary { grid-template-columns: 1fr; }
    .cspc-direct-payment .cspc-panel-head { grid-column: auto; }
    .cspc-quote-expiry-list a { grid-template-columns: 1fr; gap: 3px; }
    .cspc-quote-expiry-list b { text-align: left; }
    .cspc-quote-view-alert { align-items: flex-start; flex-direction: column; }
    .cspc-driver-queue > summary { grid-template-columns: auto 1fr auto; }
    .cspc-driver-queue > summary small { grid-column: 2; }
    .cspc-driver-queue > summary .dashicons:last-child { grid-column: 3; grid-row: 1 / span 2; }
    .cspc-driver-branch-queue { margin: 0 7px 10px; }
    .cspc-login-shell { grid-template-columns: 1fr; }
    .cspc-login-brand { min-height: 46vh; padding: 35px 24px; }
    .cspc-login-card { padding: 35px 24px; }
    .cspc-logo-large .cspc-logo-sanpablo { width: 190px; height: 116px; }
    .cspc-logo-large .cspc-logo-dorminova { width: 125px; height: 63px; }
}

@page { size: Letter portrait; margin: 6mm 7mm; }
@media print {
    html, body.cspc-system-page { width: 100%; min-height: 100%; margin: 0; padding: 0; color: #000; background: #fff; }
    .no-print, #wpadminbar, .cspc-notice { display: none !important; }
    .cspc-app, .cspc-main { display: block; width: 100%; min-height: 0; margin: 0; padding: 0; }
    .cspc-print-sheet { width: 100%; min-height: 267mm; margin: 0; padding: 0; display: flex; flex-direction: column; box-shadow: none; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .cspc-print-header { gap: 10px; min-height: 0; }
    .cspc-print-company { font-size: 9px; line-height: 1.22; }
    .cspc-print-company h2 { margin-bottom: 2px; font-size: 13px; }
    .cspc-print-company strong { font-size: 10px; }
    .cspc-logo-print { gap: 5px; }
    .cspc-logo-print .cspc-logo-sanpablo { width: 96px; height: 59px; }
    .cspc-logo-print .cspc-logo-dorminova { width: 92px; height: 38px; }
    .cspc-print-title > div { padding: 5px 7px; }
    .cspc-print-title h1 { font-size: 13px; }
    .cspc-print-title strong { font-size: 12px; }
    .cspc-print-table thead { display: table-header-group; }
    .cspc-print-table tr, .cspc-print-summary, .cspc-print-route-control, .cspc-print-incident, .cspc-signatures, .cspc-print-footer { break-inside: avoid; page-break-inside: avoid; }
    .cspc-print-table td { height: 25px; padding: 3px 4px; }
    .cspc-print-table tr.blank td { height: 22px; }
    .cspc-print-summary { margin-top: 5px; }
    .cspc-print-summary > div { min-height: 45px; padding: 5px 7px; }
    .cspc-print-route-control { margin-top: 5px; padding: 4px 6px; }
    .cspc-print-incident { min-height: 24px; padding: 4px 6px; }
    .cspc-signatures { margin-top: 16px; margin-bottom: 6px; }
    .cspc-print-footer { margin-top: auto; }
    .cspc-print-footer a { text-decoration: none; }
    .cspc-ticket-shell { width: 100%; margin: 0; }
    .cspc-ticket { box-shadow: none; border: 1px solid #cfd6e2; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
    .cspc-warranty-sheet { min-height: 267mm; }
    .cspc-warranty-sheet .cspc-print-header { gap: 7px; }
    .cspc-warranty-sheet .cspc-print-strip { margin: 3px 0 5px; }
    .cspc-warranty-sheet .cspc-print-title > div { padding: 4px 6px; }
    .cspc-warranty-sheet .cspc-print-title h1 { font-size: 12px; }
    .cspc-warranty-sheet .cspc-print-title strong { font-size: 11px; }
    .cspc-warranty-sheet .cspc-warranty-copy { break-inside: avoid; page-break-inside: avoid; flex: 1 1 auto; min-height: 108mm; margin: 6px 0 8px; padding: 7px 9px 8px; }
    .cspc-warranty-sheet .cspc-warranty-copy h2 { margin-bottom: 4px; font-size: 11px; }
    .cspc-warranty-sheet .cspc-warranty-policy-text { display: flex; flex: 1 1 auto; min-height: 0; flex-direction: column; justify-content: space-between; font-size: 10px; line-height: 1.5; text-align: justify; }
    .cspc-warranty-sheet .cspc-warranty-policy-text .cspc-policy-line { margin: 0; padding: 0; }
    .cspc-warranty-sheet .cspc-warranty-policy-text .cspc-policy-line + .cspc-policy-line { padding-top: 5px; }
    .cspc-warranty-sheet .cspc-doc-sign { margin: 10px auto 8px; }
    .cspc-warranty-sheet .cspc-print-footer { margin-top: auto; }
}

/* Mejoras 3.6.0: cola, garantías y configuración por componentes. */
.cspc-status-queue { color: #684700; background: #fff0bd; border: 1px solid #f0d36e; }
.cspc-inline-product-settings { display: grid; grid-template-columns: minmax(110px, 1fr) minmax(95px, .7fr) auto; align-items: end; gap: 8px; }
.cspc-inline-product-settings label { margin: 0; }
.cspc-component-grid { display: grid; grid-template-columns: 1.35fr 1.35fr .55fr .65fr; gap: 10px; align-items: end; margin-bottom: 10px; }
.cspc-component-grid > label { min-width: 0; }
.cspc-warranty-table { margin: 7px 0 8px; }
.cspc-warranty-sheet .cspc-doc-meta { margin: 6px 0; }
.cspc-warranty-sheet .cspc-doc-meta > div { min-height: 43px; padding: 5px 7px; }
.cspc-warranty-sheet .cspc-doc-meta small { font-size: 7px; }
.cspc-warranty-sheet .cspc-doc-meta strong { font-size: 9.5px; }
.cspc-warranty-sheet .cspc-doc-meta span { font-size: 7.8px; }
.cspc-warranty-sheet .cspc-warranty-table th { padding: 3px; font-size: 6.8px; }
.cspc-warranty-sheet .cspc-warranty-table td { height: auto; padding: 3px 4px; font-size: 7.7px; line-height: 1.12; }
.cspc-warranty-sheet .cspc-doc-sign { margin-bottom: 7px; }

@media (max-width: 760px) {
    .cspc-inline-product-settings, .cspc-component-grid { grid-template-columns: 1fr; }
}

/* V3.7.0 — Apartados y herramientas del sistema */
.cspc-system-card .dashicons,
.cspc-cleanup-panel .dashicons { color: var(--cspc-blue); font-size: 30px; width: 30px; height: 30px; }
.cspc-system-status-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.cspc-system-status-grid > div { padding: 15px 16px; background: #f7fafc; border: 1px solid #dfe8f1; border-radius: 12px; }
.cspc-system-status-grid small { display: block; color: var(--cspc-muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.cspc-system-status-grid strong { display: block; margin-top: 5px; color: var(--cspc-navy); font-size: 16px; }
.cspc-cleanup-panel { border: 1px solid #e7c0b4; }
.cspc-status-active { color: #126343; background: #dff5ea; }
.cspc-status-paid { color: #124e79; background: #e0f0fa; }
.cspc-status-converted { color: #5a3c86; background: #eee6fa; }
.cspc-status-delivered { color: #126343; background: #dff5ea; }
.cspc-status-cancelled { color: #8d2e2e; background: #f8dddd; }
.cspc-status-expired { color: #8c5a00; background: #fff0c9; }
.cspc-status-archived { color: #475467; background: #eef1f4; }
.cspc-total-box { min-width: 250px; padding: 14px 16px; background: #eef8fd; border: 1px solid #d4e8f4; border-radius: 10px; }
.cspc-total-box span,.cspc-total-box strong { display:flex; justify-content:space-between; gap:18px; padding:5px 0; }
.cspc-total-box strong { margin-top:5px; padding-top:10px; border-top:1px solid #bddbea; color:var(--cspc-navy); font-size:16px; }
@media (max-width: 850px) { .cspc-system-status-grid { grid-template-columns: 1fr; } }

/* Multisucursal y proceso individual de rutas */
.cspc-nav .cspc-scope-selector{margin-left:auto;display:flex;align-items:center;gap:9px;padding:7px 0 8px 16px;background:transparent;border:0;color:#fff}.cspc-nav .cspc-scope-selector label{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:800;color:#fff;white-space:nowrap}.cspc-nav .cspc-scope-selector select{min-width:235px;min-height:36px;padding:6px 34px 6px 10px;color:var(--cspc-navy-dark);background:#fff;border:1px solid rgba(255,255,255,.35);border-radius:8px}.cspc-scope-badge{padding:6px 10px;border-radius:999px;font-size:11px;font-weight:900;white-space:nowrap}.cspc-scope-badge.is-operational{background:#dff7e9;color:#176b49}.cspc-scope-badge.is-readonly{background:#fff1b8;color:#6e4e00}.cspc-route-legend{display:flex;flex-wrap:wrap;gap:7px;margin:-8px 0 18px;padding:13px 15px;background:#fff;border:1px solid var(--cspc-border);border-radius:12px;box-shadow:var(--cspc-shadow)}.cspc-route-inline{display:grid;grid-template-columns:minmax(150px,1fr) minmax(190px,2fr) auto;gap:6px;margin-top:8px}.cspc-route-inline select,.cspc-route-inline input{min-width:0}.cspc-route-process-table .cspc-route-row td:first-child{border-left:5px solid transparent}.cspc-route-row-queued td:first-child{border-left-color:#d6a500}.cspc-route-row-assigned td:first-child{border-left-color:#3974d9}.cspc-route-row-in_load td:first-child{border-left-color:#5b47c8}.cspc-route-row-dispatched td:first-child{border-left-color:#e2781a}.cspc-route-row-in_route td:first-child{border-left-color:#1595c5}.cspc-route-row-delivered td:first-child{border-left-color:#1f8d57}.cspc-route-row-not_delivered td:first-child{border-left-color:#c93a31}.cspc-route-row-rescheduled td:first-child{border-left-color:#8c5bd1}.cspc-route-row-returned td:first-child{border-left-color:#65758b}.cspc-route-row-finalized td:first-child{border-left-color:#185c48}.cspc-route-driver{display:block;color:var(--cspc-navy)}.cspc-route-driver-lock{display:inline-flex!important;margin-top:5px!important;padding:3px 7px;color:#475467!important;background:#eef2f6;border-radius:999px;font-size:10px!important;font-weight:800}.cspc-status-queued{background:#fff4cc;color:#745600}.cspc-status-assigned{background:#e8f1ff;color:#2459aa}.cspc-status-in_load{background:#eeeaff;color:#503ca4}.cspc-status-dispatched{background:#fff0df;color:#9a4d08}.cspc-status-in_route{background:#dff6ff;color:#046b91}.cspc-status-delivered{background:#e3f7ec;color:#176b49}.cspc-status-not_delivered{background:#ffebe8;color:#b42318}.cspc-status-rescheduled{background:#f2eaff;color:#6941a5}.cspc-status-returned{background:#edf0f4;color:#475467}.cspc-status-finalized{background:#dcefe9;color:#124f3d}@media(max-width:1100px){.cspc-nav .cspc-scope-selector{width:100%;margin-left:0;justify-content:flex-end;padding:8px 0 10px}}@media(max-width:760px){.cspc-nav .cspc-scope-selector{align-items:stretch;flex-direction:column}.cspc-nav .cspc-scope-selector label{flex-direction:column;align-items:stretch}.cspc-nav .cspc-scope-selector select{min-width:0;width:100%}.cspc-route-inline{grid-template-columns:1fr}.cspc-route-legend{margin-top:0}}

/* V3.8.3: Proceso de rutas usa exclusivamente boletas despachadas. */
.cspc-route-process-table .cspc-route-driver{font-weight:900}.cspc-route-process-table .cspc-route-driver-lock{background:#e8f1ff;color:#2459aa!important}.cspc-route-process-table .cspc-status-dispatched{box-shadow:inset 0 0 0 1px rgba(154,77,8,.18)}

/* === 3.9.0 · Simplificación comercial / agenda / etiquetas === */
.cspc-operation-type-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:8px 0 20px}
.cspc-operation-type-grid label{display:flex;align-items:flex-start;gap:9px;padding:16px;border:1px solid #dbe4ee;border-radius:14px;background:#fff;cursor:pointer}
.cspc-operation-type-grid label:has(input:checked){border-color:#0a5689;box-shadow:0 0 0 2px rgba(10,86,137,.1);background:#f7fbff}
.cspc-operation-type-grid strong{display:block;color:#08264c;font-size:15px}.cspc-operation-type-grid small{display:block;color:#64748b;margin-top:3px}
.cspc-row-pending-verification{background:#fff8e8!important}.cspc-warning-text{color:#a45b00!important;font-weight:700}.cspc-status-warning{background:#fff0c2!important;color:#805200!important}
.cspc-agenda-sheet{padding:0;overflow:hidden}.cspc-agenda-sheet .cspc-panel-head{padding:18px 20px;margin:0}.cspc-agenda-table{font-size:12px;min-width:1500px}.cspc-agenda-table th{position:sticky;top:0;z-index:2;background:#08264c;color:#fff;white-space:nowrap}.cspc-agenda-table td{vertical-align:top;line-height:1.35}.cspc-agenda-table td small{display:block;margin-top:4px;color:#667085}.cspc-route-select{min-width:145px}
.cspc-agenda-row{border-left:7px solid transparent}.cspc-driver-color-0{border-left-color:#5d87b2}.cspc-driver-color-1{border-left-color:#d19b4c}.cspc-driver-color-2{border-left-color:#799a75}.cspc-driver-color-3{border-left-color:#9d79a8}.cspc-driver-color-4{border-left-color:#c97373}.cspc-driver-color-5{border-left-color:#65a7a7}
.cspc-inventory-registration .cspc-field-grid{align-items:end}.cspc-label-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}.cspc-inventory-label{border:1.5px solid #111;padding:10px 12px;min-height:118px;display:flex;flex-direction:column;justify-content:center;background:#fff;color:#111;break-inside:avoid}.cspc-label-brand{font-size:9px;font-weight:800;letter-spacing:.5px;border-bottom:1px solid #111;padding-bottom:4px;margin-bottom:6px}.cspc-inventory-label>strong{font-size:18px;line-height:1.05}.cspc-inventory-label>span{font-size:12px;margin-top:2px}.cspc-label-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-weight:900;font-size:16px;letter-spacing:.5px;margin:7px 0 4px}.cspc-inventory-label small{font-size:9px;line-height:1.25}
@media(max-width:900px){.cspc-operation-type-grid{grid-template-columns:1fr}.cspc-label-grid{grid-template-columns:1fr}}
@media print{.cspc-label-grid{grid-template-columns:repeat(3,1fr);gap:4mm}.cspc-inventory-label{min-height:34mm;padding:3mm;page-break-inside:avoid}.cspc-main:has(.cspc-label-grid) .cspc-print-sheet{display:none}}


/* === 3.9.1 · Agenda persistente / reasignación segura === */
.cspc-agenda-last-update{display:block;margin-top:6px;color:#526173}.cspc-assignment-current{padding:4px 7px;border-radius:7px;background:#eef5fb;color:#274862!important}.cspc-agenda-row.is-programming-dirty{box-shadow:inset 0 0 0 2px rgba(209,155,76,.35);background:#fffaf0}.cspc-route-select.is-dirty{border-color:#d19b4c;box-shadow:0 0 0 2px rgba(209,155,76,.13)}.cspc-agenda-table{min-width:1650px}.cspc-head-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
