/* CRM_APPROVAL_RULE_ENGINE_V2 */
.approval-metrics{
  display:grid;
  grid-template-columns:repeat(5,minmax(150px,1fr));
  gap:12px;
  margin-bottom:14px
}
.approval-metrics article{
  padding:15px;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff
}
.approval-metrics article.risk{border-color:#f1d39b;background:#fffaf0}
.approval-metrics small{display:block;color:var(--muted);margin-bottom:7px}
.approval-metrics strong{font-size:24px}
.approval-tabs{display:flex;gap:7px;margin:14px 0;overflow:auto}
.approval-tabs button{border:0;border-radius:11px;padding:10px 14px;background:#eef2f7;color:var(--muted);font-weight:800;white-space:nowrap}
.approval-tabs button.active{background:var(--accent);color:#fff}
.approval-filter-grid{display:grid;grid-template-columns:1.2fr 1fr 1fr 1fr 1fr auto;gap:10px;align-items:end}
.approval-filter-actions{display:flex;gap:8px}
.approval-table{min-width:1320px}
.approval-table td small{display:block;margin-top:4px;color:var(--muted)}
.approval-module,.approval-status{display:inline-flex;width:max-content;padding:5px 9px;border-radius:999px;font-size:11px;font-weight:800;white-space:nowrap}
.approval-module.CUSTOMER{background:#eef2ff;color:#4451a6}
.approval-module.DISCOUNT{background:#fff3d8;color:#8b5b00}
.approval-module.ORDER{background:#e8f8f1;color:#257a59}
.approval-module.RETURN{background:#f5ecff;color:#7545a5}
.approval-status.PENDING,.approval-status.PENDING_TAX_APPROVAL,.approval-status.PENDING_FINAL_APPROVAL{background:#fff3d8;color:#8b5b00}
.approval-status.APPROVED{background:#e8f8f1;color:#257a59}
.approval-status.REJECTED{background:#fdebec;color:#b42318}
.approval-status.CANCELLED{background:#edf2f7;color:#64748b}
.approval-row-actions{flex-wrap:wrap}
.approval-empty{display:grid;place-items:center;gap:5px;min-height:130px;text-align:center}
.approval-dialog{width:min(980px,calc(100vw - 24px));max-width:none}
.approval-dialog.approval-wide{width:min(1380px,calc(100vw - 24px));max-width:none}
.approval-dialog .modal-card{width:100%;max-height:calc(100vh - 24px);overflow:auto;padding-bottom:0}
.approval-detail-head{display:flex;justify-content:space-between;gap:18px;padding-right:32px;margin-bottom:14px}
.approval-detail-head h3{margin:3px 0}
.approval-section{margin:12px 0;padding:15px;border:1px solid var(--line);border-radius:15px;background:#fff}
.approval-section-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:12px}
.approval-section-head span{color:var(--muted);font-size:12px}
.approval-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px}
.approval-summary-grid>div{display:grid;gap:5px;padding:11px;border:1px solid var(--line);border-radius:12px;background:#f8fafc}
.approval-summary-grid small{color:var(--muted)}
.approval-summary-grid .span-2{grid-column:span 2}
.approval-item-table{min-width:980px}
.approval-json{max-height:360px;overflow:auto;padding:12px;border-radius:12px;background:#111827;color:#dbeafe;font-size:12px}
.approval-timeline{display:grid;gap:10px}
.approval-timeline article{padding:11px;border-left:3px solid var(--accent);background:#f8fafc;border-radius:0 10px 10px 0}
.approval-timeline span{display:block;color:var(--muted);font-size:12px;margin-top:3px}
.approval-timeline p{margin:7px 0 0}
.approval-detail-actions{position:sticky;bottom:0;z-index:8;display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap;margin:14px -23px -23px;padding:14px 23px;border-top:1px solid var(--line);background:rgba(255,255,255,.97);backdrop-filter:blur(12px)}
@media(max-width:1200px){.approval-metrics{grid-template-columns:repeat(3,1fr)}.approval-filter-grid{grid-template-columns:repeat(3,1fr)}.approval-summary-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:720px){.approval-metrics{grid-template-columns:repeat(2,1fr)}.approval-filter-grid{grid-template-columns:1fr}.approval-summary-grid{grid-template-columns:1fr}.approval-summary-grid .span-2{grid-column:auto}.approval-detail-head,.approval-section-head{flex-direction:column}.approval-detail-actions button{flex:1 1 140px}}

.approval-config-actions{display:flex;gap:8px;flex-wrap:wrap}.approval-rule-step{display:grid;grid-template-columns:70px 110px 130px 1fr 1fr 1fr auto auto;gap:8px;align-items:end;padding:10px;border:1px solid var(--line);border-radius:12px;margin-bottom:8px;background:#f8fafc}.approval-rule-step label{min-width:0}.approval-rule-table small{display:block;margin-top:4px;color:var(--muted)}@media(max-width:1100px){.approval-rule-step{grid-template-columns:repeat(3,1fr)}}@media(max-width:720px){.approval-config-actions{width:100%}.approval-config-actions button{flex:1}.approval-rule-step{grid-template-columns:1fr}}

.approval-product-spec{margin-top:14px}.approval-product-spec small{display:block;color:var(--muted);margin-bottom:6px}.approval-product-spec pre{white-space:pre-wrap;word-break:break-word;background:#f8fafc;border:1px solid var(--line);border-radius:12px;padding:12px;max-height:300px;overflow:auto}

/* CRM_IMPORT_APPROVAL_WORKSPACE_V1 */
.approval-dialog.approval-wide{width:min(1560px,calc(100vw - 24px));max-width:none}
.approval-select-col{width:42px;min-width:42px;text-align:center}
.approval-select-col input{width:17px;height:17px;cursor:pointer}
.approval-row-selected td{background:#f2f7ff}
.approval-bulk-bar{display:flex;justify-content:space-between;align-items:center;gap:14px;margin:12px 0;padding:12px 14px;border:1px solid #c9daf8;border-radius:14px;background:#f5f8ff}
.approval-bulk-bar>div:first-child{display:grid;gap:3px}
.approval-bulk-bar span{font-size:12px;color:var(--muted)}
.approval-bulk-bar button:disabled{opacity:.5;cursor:not-allowed}
.approval-customer-profile{overflow:hidden;padding:0}
.approval-customer-profile-head{display:grid;grid-template-columns:auto 1fr auto;gap:16px;align-items:center;padding:20px;background:linear-gradient(135deg,#f3f7ff,#fff)}
.approval-customer-profile-head h3{margin:3px 0;font-size:24px}
.approval-customer-profile-head p{margin:0;color:var(--muted)}
.approval-customer-profile-head small{font-weight:800;color:var(--accent);letter-spacing:.08em}
.approval-customer-avatar{display:grid;place-items:center;width:58px;height:58px;border-radius:18px;background:var(--accent);color:#fff;font-size:20px;font-weight:900}
.approval-customer-tags{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}
.approval-customer-tags span{padding:7px 10px;border-radius:999px;background:#fff;border:1px solid var(--line);font-size:12px;font-weight:800}
.approval-customer-grid{padding:18px}
.approval-customer-grid>div{min-height:66px;background:#fff}
.approval-before-snapshot,.approval-technical-data{margin:0 18px 16px;border:1px solid var(--line);border-radius:12px;background:#f8fafc}
.approval-before-snapshot summary,.approval-technical-data summary{cursor:pointer;padding:12px 14px;font-weight:800}
.approval-before-snapshot .approval-json,.approval-technical-data .approval-json{margin:0;border-radius:0 0 12px 12px}
.approval-decision-box textarea{min-height:100px;resize:vertical}
.approval-bulk-review-list{display:grid;gap:8px;margin-bottom:14px;max-height:360px;overflow:auto}
.approval-bulk-review-list article{display:grid;gap:4px;padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:#f8fafc}
.approval-bulk-review-list article span{color:var(--muted);font-size:12px}
.approval-bulk-review-list article.success{border-color:#a9dbc5;background:#effaf5}
.approval-bulk-review-list article.failed{border-color:#efb7b7;background:#fff4f4}
@media(max-width:900px){
  .approval-bulk-bar{align-items:flex-start;flex-direction:column}
  .approval-bulk-bar .actions{width:100%}
  .approval-bulk-bar .actions button{flex:1}
  .approval-customer-profile-head{grid-template-columns:auto 1fr}
  .approval-customer-tags{grid-column:1/-1;justify-content:flex-start}
}
@media(max-width:720px){
  .approval-dialog.approval-wide{width:calc(100vw - 12px)}
  .approval-customer-profile-head{grid-template-columns:1fr;text-align:center}
  .approval-customer-avatar{margin:auto}
  .approval-customer-tags{justify-content:center}
}
