/* CONNECTOR_PROJECT_CHANGE_ORDERS_DESKTOP_V2 */
.co-modal-box{
    width:min(1560px,98vw);
    max-height:96vh;
    padding:0;
    gap:0;
    overflow:hidden;
    border-radius:22px;
}

.co-modal-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:16px;
    padding:20px 22px;
    background:linear-gradient(135deg,#111827,#7c2d12 58%,#c2410c);
    color:#fff;
}

.co-modal-header h2{
    margin:6px 0 0;
    color:#fff;
    font-size:22px;
    line-height:1.2;
}

.co-modal-header-main{min-width:0}
.co-modal-header-badges{display:flex;gap:8px;flex-wrap:wrap}

.co-badge{
    display:inline-flex;
    align-items:center;
    min-height:25px;
    padding:5px 9px;
    border:1px solid rgba(255,255,255,.2);
    border-radius:999px;
    background:rgba(255,255,255,.14);
    color:#fff;
    font-size:10px;
    font-weight:900;
    letter-spacing:.06em;
}

.co-badge.closed{border-color:#fecaca;background:#fee2e2;color:#991b1b}

.co-modal-close,
.co-form-header button{
    display:grid;
    place-items:center;
    width:42px;
    height:42px;
    flex:0 0 42px;
    margin:0;
    padding:0;
    border:1px solid rgba(255,255,255,.15);
    border-radius:12px;
    background:rgba(255,255,255,.12);
    color:#fff;
    cursor:pointer;
}

.co-modal-close:hover,
.co-form-header button:hover{background:rgba(255,255,255,.22)}

.co-modal-scroll{
    min-height:0;
    padding:18px;
    overflow:auto;
    background:#f1f5f9;
}

.co-loading,
.co-error{
    display:flex;
    min-height:220px;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:9px;
    padding:30px;
    border:1px dashed #cbd5e1;
    border-radius:17px;
    background:#fff;
    color:#64748b;
    text-align:center;
}

.co-loading i,.co-error i{font-size:30px}
.co-error{border-color:#fecaca;background:#fff7f7;color:#b91c1c}

.co-summary-grid{
    display:grid;
    grid-template-columns:repeat(6,minmax(0,1fr));
    gap:11px;
    margin-bottom:14px;
}

.co-summary-card{
    min-width:0;
    padding:14px;
    border:1px solid #e2e8f0;
    border-top:4px solid #64748b;
    border-radius:16px;
    background:#fff;
    box-shadow:0 8px 20px rgba(15,23,42,.055);
}

.co-summary-card.approval{border-top-color:#0f766e;background:#f0fdfa}
.co-summary-card.pending{border-top-color:#f59e0b}
.co-summary-card.revenue{border-top-color:#2563eb}
.co-summary-card.cost{border-top-color:#dc2626}
.co-summary-card.approved{border-top-color:#16a34a}
.co-summary-card.margin{border-top-color:#7c3aed}
.co-summary-card.danger{border-top-color:#dc2626;background:#fff7f7}

.co-summary-card span,
.co-summary-card strong,
.co-summary-card small{display:block}

.co-summary-card span{
    color:#64748b;
    font-size:10px;
    font-weight:900;
    letter-spacing:.045em;
    text-transform:uppercase;
}

.co-summary-card strong{
    margin-top:6px;
    color:#0f172a;
    font-size:20px;
    line-height:1.15;
    overflow-wrap:anywhere;
}

.co-summary-card small{
    margin-top:5px;
    color:#64748b;
    font-size:10px;
    line-height:1.35;
}

.co-toolbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:18px;
    margin-bottom:12px;
    padding:15px;
    border:1px solid #fed7aa;
    border-radius:17px;
    background:#fff;
    box-shadow:0 7px 18px rgba(124,45,18,.045);
}

.co-toolbar-copy{min-width:0}
.co-toolbar h3{margin:0;color:#0f172a;font-size:17px}
.co-toolbar p{max-width:760px;margin:5px 0 0;color:#64748b;font-size:11px;line-height:1.45}

.co-toolbar-actions{
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:10px;
    flex-wrap:wrap;
}

.co-new-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    min-height:44px;
    margin:0;
    padding:10px 14px;
    border:0;
    border-radius:12px;
    background:#c2410c;
    color:#fff;
    font-weight:900;
    cursor:pointer;
    box-shadow:0 8px 18px rgba(194,65,12,.2);
}

.co-new-button:hover{background:#9a3412}
.co-new-button:disabled{background:#e2e8f0;color:#94a3b8;box-shadow:none;cursor:not-allowed}

.co-admin-setting{
    display:flex;
    align-items:center;
    gap:10px;
    min-height:44px;
    margin:0;
    padding:8px 11px;
    border:1px solid #dbeafe;
    border-radius:12px;
    background:#eff6ff;
    cursor:pointer;
}

.co-admin-setting input{
    width:18px;
    height:18px;
    flex:0 0 18px;
    accent-color:#2563eb;
}

.co-admin-setting span,.co-admin-setting b,.co-admin-setting small{display:block}
.co-admin-setting b{color:#1e3a8a;font-size:10px}
.co-admin-setting small{margin-top:2px;color:#64748b;font-size:9px}

.co-filter-bar{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:9px;
    padding:8px;
    border:1px solid #e2e8f0;
    border-radius:14px;
    background:#fff;
    overflow:auto;
}

.co-filter-button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:38px;
    margin:0;
    padding:8px 11px;
    border:1px solid transparent;
    border-radius:10px;
    background:#f8fafc;
    color:#475569;
    font-size:11px;
    font-weight:900;
    white-space:nowrap;
    cursor:pointer;
}

.co-filter-button span{
    display:grid;
    place-items:center;
    min-width:22px;
    height:22px;
    padding:0 5px;
    border-radius:999px;
    background:#e2e8f0;
    color:#334155;
    font-size:9px;
}

.co-filter-button:hover{border-color:#cbd5e1;background:#fff}
.co-filter-button.active{border-color:#fdba74;background:#fff7ed;color:#9a3412}
.co-filter-button.active span{background:#ffedd5;color:#9a3412}

.co-result-caption{
    margin:0 2px 8px;
    color:#64748b;
    font-size:10px;
}
.co-result-caption strong{color:#334155}

.co-table-wrap{
    overflow:auto;
    border:1px solid #dbe3ee;
    border-radius:16px;
    background:#fff;
    box-shadow:0 8px 24px rgba(15,23,42,.05);
}

.co-table{
    width:100%;
    min-width:1500px;
    margin:0;
    border-collapse:separate;
    border-spacing:0;
    border-radius:0;
    background:#fff;
    box-shadow:none;
}

.co-table thead th{
    position:sticky;
    top:0;
    z-index:2;
    padding:12px 11px;
    border-bottom:1px solid #cbd5e1;
    background:#eaf0f7;
    color:#334155;
    font-size:10px;
    font-weight:900;
    letter-spacing:.045em;
    text-align:left;
    text-transform:uppercase;
    white-space:nowrap;
}

.co-table tbody td{
    padding:13px 11px;
    border-bottom:1px solid #edf2f7;
    background:#fff;
    color:#334155;
    font-size:11px;
    line-height:1.4;
    vertical-align:top;
    white-space:normal;
}

.co-table tbody tr:last-child td{border-bottom:0}
.co-table tbody tr:hover td{background:#f8fafc}
.co-table tbody tr.my-approval td{background:#f0fdfa}
.co-table tbody tr.my-approval:hover td{background:#e6fffb}
.co-table tbody tr.status-returned td:first-child{box-shadow:inset 4px 0 #ea580c}
.co-table tbody tr.status-submitted td:first-child{box-shadow:inset 4px 0 #2563eb}
.co-table tbody tr.status-approved td:first-child{box-shadow:inset 4px 0 #16a34a}
.co-table tbody tr.status-rejected td:first-child{box-shadow:inset 4px 0 #dc2626}
.co-table tbody tr.status-cancelled{opacity:.78}

.co-table td>strong,
.co-table td>small{display:block}

.co-table td>strong{color:#0f172a;font-size:12px}
.co-table td>small{margin-top:4px;color:#64748b;font-size:9px;line-height:1.35}

.co-number{
    display:inline-flex!important;
    align-items:center;
    padding:6px 9px;
    border-radius:9px;
    background:#fff7ed;
    color:#9a3412!important;
    font-size:12px!important;
    font-weight:950;
    white-space:nowrap;
}

.co-row-description{
    display:-webkit-box;
    max-width:280px;
    margin:7px 0 0;
    overflow:hidden;
    color:#475569;
    font-size:10px;
    line-height:1.4;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:3;
}

.co-legacy,
.co-applied{
    width:max-content;
    padding:3px 6px;
    border-radius:999px;
    background:#ede9fe;
    color:#6d28d9!important;
    font-size:8px!important;
    font-weight:900;
}

.co-applied{background:#dcfce7;color:#166534!important}

.co-status{
    display:inline-flex;
    align-items:center;
    width:max-content;
    max-width:190px;
    padding:7px 9px;
    border-radius:999px;
    background:#e2e8f0;
    color:#475569;
    font-size:9px;
    font-weight:900;
    line-height:1.2;
    text-align:center;
}

.co-status.draft{background:#fef3c7;color:#92400e}
.co-status.submitted{background:#dbeafe;color:#1d4ed8}
.co-status.returned{background:#ffedd5;color:#9a3412}
.co-status.approved{background:#dcfce7;color:#166534}
.co-status.rejected{background:#fee2e2;color:#b91c1c}
.co-status.cancelled{background:#e2e8f0;color:#64748b}

.co-assigned-to-me{
    width:max-content;
    margin-top:7px!important;
    padding:5px 7px;
    border-radius:8px;
    background:#ccfbf1;
    color:#0f766e!important;
    font-weight:900;
}

.co-decision-note{
    max-width:190px;
    margin-top:7px!important;
    padding-left:7px;
    border-left:3px solid #cbd5e1;
    color:#475569!important;
}

.co-workflow{
    display:grid;
    grid-template-columns:minmax(90px,1fr) 16px minmax(100px,1fr);
    gap:6px;
    align-items:center;
    min-width:260px;
}

.co-workflow>i{color:#94a3b8;text-align:center}
.co-workflow span{min-width:0}
.co-workflow em,.co-workflow strong{display:block}
.co-workflow em{color:#94a3b8;font-size:8px;font-style:normal;font-weight:900;text-transform:uppercase}
.co-workflow strong{margin-top:2px;color:#334155;font-size:10px;overflow-wrap:anywhere}
.co-workflow>small{grid-column:1/-1;margin:3px 0 0;color:#64748b;font-size:9px}

.co-money-stack{
    display:grid;
    min-width:145px;
    gap:4px;
}

.co-money-stack span{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:9px;
    padding:4px 0;
    border-bottom:1px dashed #e2e8f0;
}

.co-money-stack span:last-child{border-bottom:0}
.co-money-stack em{color:#94a3b8;font-size:8px;font-style:normal;font-weight:800;text-transform:uppercase}
.co-money-stack strong{color:#334155;font-size:10px;white-space:nowrap}
.co-money-stack .positive strong,.positive{color:#166534!important}
.co-money-stack .negative strong,.negative{color:#b91c1c!important}
.co-not-applicable{display:block;padding:12px;color:#94a3b8;text-align:center}

.co-date-stack{display:grid;gap:4px;min-width:110px}
.co-date-stack strong{color:#0f172a;font-size:11px}
.co-date-stack small{color:#64748b;font-size:9px}

.co-actions{
    display:flex;
    width:220px;
    gap:5px;
    flex-wrap:wrap;
    align-items:center;
}

.co-actions button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:6px;
    min-height:34px;
    margin:0;
    padding:7px 9px;
    border:0;
    border-radius:9px;
    background:#2563eb;
    color:#fff;
    font-size:9px;
    font-weight:900;
    cursor:pointer;
}

.co-actions button span{display:none}
.co-actions button:hover span{display:inline}
.co-actions button.history{background:#e2e8f0;color:#334155}
.co-actions button.edit{background:#2563eb}
.co-actions button.submit{background:#0f766e}
.co-actions button.approve{background:#16a34a}
.co-actions button.return{background:#ea580c}
.co-actions button.reject,.co-actions button.danger{background:#dc2626}
.co-actions button.cancel{background:#475569}
.co-readonly{color:#94a3b8;font-size:9px;font-weight:800}

.co-empty{
    display:flex;
    min-height:190px;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:1px dashed #cbd5e1;
    border-radius:16px;
    background:#fff;
    color:#64748b;
    text-align:center;
}

.co-empty.compact{min-height:130px}
.co-empty i{color:#f97316;font-size:32px}
.co-empty strong{color:#334155;font-size:17px}

.co-form-box{
    width:min(920px,96vw);
    max-height:94vh;
    padding:0;
    gap:0;
    overflow:hidden;
    border-radius:20px;
}

.co-form-box.narrow{width:min(680px,95vw)}

.co-form-header{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding:17px 19px;
    background:linear-gradient(135deg,#0f172a,#334155);
    color:#fff;
}

.co-form-header-main{min-width:0}
.co-form-header h2{margin:0;color:#fff;font-size:20px}
.co-form-header p{margin:5px 0 0;color:#cbd5e1;font-size:11px;line-height:1.4}

.co-form-scroll{
    min-height:0;
    padding:17px;
    overflow:auto;
    background:#f8fafc;
}

.co-form-section{
    margin-bottom:14px;
    padding:15px;
    border:1px solid #e2e8f0;
    border-radius:16px;
    background:#fff;
    box-shadow:0 5px 14px rgba(15,23,42,.035);
}

.co-form-section:last-child{margin-bottom:0}

.co-form-section-heading{
    display:flex;
    align-items:center;
    gap:9px;
    margin-bottom:12px;
    padding-bottom:10px;
    border-bottom:1px solid #edf2f7;
}

.co-form-section-heading i{
    display:grid;
    place-items:center;
    width:34px;
    height:34px;
    border-radius:10px;
    background:#ffedd5;
    color:#c2410c;
}

.co-form-section-heading h3{margin:0;color:#0f172a;font-size:14px}
.co-form-section-heading p{margin:3px 0 0;color:#64748b;font-size:9px}

.co-form-grid{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:12px;
}

.co-form-grid label{display:grid;gap:6px;margin:0;min-width:0}
.co-form-grid label.full{grid-column:1/-1}
.co-form-grid label>span{color:#475569;font-size:10px;font-weight:900}
.co-form-grid label>small{margin-top:-2px;color:#94a3b8;font-size:8px;line-height:1.35}

.co-form-grid input,
.co-form-grid select,
.co-form-grid textarea{
    width:100%;
    min-width:0;
    min-height:44px;
    padding:10px 12px;
    box-sizing:border-box;
    border:1px solid #cbd5e1;
    border-radius:11px;
    outline:none;
    background:#fff;
    color:#0f172a;
    font:inherit;
    font-size:12px;
    transition:border-color .15s ease,box-shadow .15s ease,background .15s ease;
}

.co-form-grid textarea{min-height:100px;line-height:1.45;resize:vertical}
.co-form-grid input::placeholder,.co-form-grid textarea::placeholder{color:#94a3b8}
.co-form-grid input:hover,.co-form-grid select:hover,.co-form-grid textarea:hover{border-color:#94a3b8}
.co-form-grid input:focus,.co-form-grid select:focus,.co-form-grid textarea:focus{
    border-color:#f97316;
    background:#fff;
    box-shadow:0 0 0 3px rgba(249,115,22,.14);
}

.co-form-grid input:disabled,.co-form-grid select:disabled,.co-form-grid textarea:disabled{
    background:#f1f5f9;
    color:#94a3b8;
    cursor:not-allowed;
}

.co-checkbox{
    display:flex!important;
    align-items:center;
    align-self:end;
    min-height:44px;
    gap:9px!important;
    padding:10px 12px;
    border:1px solid #bfdbfe;
    border-radius:11px;
    background:#eff6ff;
    cursor:pointer;
}

.co-checkbox input{width:18px!important;min-height:18px!important;height:18px;padding:0;accent-color:#2563eb}
.co-checkbox span{color:#1e3a8a!important}

.co-live-margin{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    min-height:44px;
    padding:10px 12px;
    border:1px solid #ddd6fe;
    border-radius:11px;
    background:#f5f3ff;
}
.co-live-margin span{color:#6d28d9;font-size:10px;font-weight:900}
.co-live-margin strong{font-size:15px}

.co-form-hint,
.co-warning-box{
    display:flex;
    align-items:flex-start;
    gap:10px;
    margin-bottom:12px;
    padding:12px;
    border:1px solid #bfdbfe;
    border-radius:12px;
    background:#eff6ff;
    color:#1e40af;
    font-size:10px;
    line-height:1.45;
}

.co-warning-box{border-color:#fed7aa;background:#fff7ed;color:#9a3412}
.co-form-hint i,.co-warning-box i{margin-top:2px}

.co-form-actions{
    display:flex;
    justify-content:flex-end;
    gap:9px;
    padding:14px 17px;
    border-top:1px solid #e2e8f0;
    background:#fff;
}

.co-form-actions button{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:42px;
    margin:0;
    padding:9px 13px;
    border:0;
    border-radius:10px;
    background:#c2410c;
    color:#fff;
    font-weight:900;
    cursor:pointer;
}

.co-form-actions button.secondary{background:#e2e8f0;color:#334155}
.co-form-actions button.approve{background:#16a34a}
.co-form-actions button.return{background:#ea580c}
.co-form-actions button.danger{background:#dc2626}
.co-form-actions button:disabled{background:#e2e8f0;color:#94a3b8;cursor:not-allowed}

.co-history-list{display:grid;gap:9px}
.co-history-item{
    display:grid;
    grid-template-columns:38px minmax(0,1fr);
    gap:10px;
    padding:12px;
    border:1px solid #e2e8f0;
    border-left:4px solid #94a3b8;
    border-radius:12px;
    background:#fff;
}
.co-history-item.event-approved{border-left-color:#16a34a}
.co-history-item.event-rejected{border-left-color:#dc2626}
.co-history-item.event-returned{border-left-color:#ea580c}
.co-history-item.event-submitted,.co-history-item.event-reassigned{border-left-color:#2563eb}
.co-history-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:#f1f5f9;color:#475569}
.co-history-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.co-history-top strong{color:#0f172a;font-size:11px}
.co-history-top time{color:#94a3b8;font-size:9px;white-space:nowrap}
.co-history-item span{display:block;margin-top:3px;color:#64748b;font-size:9px}
.co-history-item p{margin:7px 0 0;padding:8px;border-radius:8px;background:#f8fafc;color:#334155;font-size:10px;line-height:1.4}

.co-sheet-actions{display:flex;justify-content:flex-end;margin-bottom:12px}
.co-sheet-actions button{display:inline-flex;align-items:center;gap:8px;min-height:42px;margin:0;padding:9px 13px;border:0;border-radius:11px;background:#c2410c;color:#fff;font-weight:900}
.co-sheet-actions button span{display:grid;place-items:center;min-width:24px;height:24px;padding:0 5px;border-radius:999px;background:rgba(255,255,255,.2);font-size:10px}
.pc-sheet-metric.change-order{border-color:#fed7aa;background:#fff7ed}
.pc-sheet-metric.change-order>i{background:#ffedd5;color:#c2410c}

@media(max-width:1250px){
    .co-summary-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
    .co-toolbar{align-items:flex-start;flex-direction:column}
    .co-toolbar-actions{width:100%;justify-content:space-between}
}

@media(max-width:820px){
    .co-modal-scroll{padding:12px}
    .co-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
    .co-form-grid{grid-template-columns:1fr}
    .co-form-grid label.full{grid-column:auto}
    .co-toolbar-actions{align-items:stretch;flex-direction:column}
    .co-new-button,.co-admin-setting{width:100%;box-sizing:border-box}
    .co-form-actions{display:grid;grid-template-columns:1fr 1fr}
    .co-form-actions button{width:100%}

    .co-table-wrap{border:0;background:transparent;box-shadow:none;overflow:visible}
    .co-table{display:block;min-width:0;background:transparent}
    .co-table thead{display:none}
    .co-table tbody{display:grid;gap:11px}
    .co-table tr{
        display:grid;
        border:1px solid #e2e8f0;
        border-radius:15px;
        overflow:hidden;
        background:#fff;
        box-shadow:0 6px 16px rgba(15,23,42,.05);
    }
    .co-table tbody td{
        display:grid;
        grid-template-columns:115px minmax(0,1fr);
        gap:10px;
        padding:10px 12px;
        border-bottom:1px solid #edf2f7;
    }
    .co-table tbody td::before{
        content:attr(data-label);
        color:#94a3b8;
        font-size:8px;
        font-weight:900;
        letter-spacing:.04em;
        text-transform:uppercase;
    }
    .co-table tbody td>*{grid-column:2}
    .co-workflow{grid-template-columns:1fr 16px 1fr;min-width:0}
    .co-money-stack{min-width:0}
    .co-actions{width:auto}
    .co-actions button span{display:inline}
}

@media(max-width:520px){
    .co-summary-grid{grid-template-columns:1fr}
    .co-filter-bar{align-items:stretch;flex-direction:column}
    .co-filter-button{width:100%;justify-content:space-between}
    .co-table tbody td{grid-template-columns:1fr}
    .co-table tbody td::before{margin-bottom:-4px}
    .co-table tbody td>*{grid-column:1}
    .co-form-actions{grid-template-columns:1fr}
    .co-history-top{align-items:flex-start;flex-direction:column}
}
