/* CRM and Purchase operational control centers (2026-08-20 local review). */
.executive-dashboard{display:grid;gap:14px;color:#16253a;max-width:1680px;margin:0 auto;padding:2px 0 24px}.executive-header{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 18px;background:#fff;border:1px solid #d9e2ec;border-radius:12px;box-shadow:0 2px 10px rgba(20,42,67,.05)}.executive-header p{margin:0 0 3px;color:#3973a9;font-size:11px;font-weight:800;letter-spacing:.13em}.executive-header h1{margin:0;font-size:22px;line-height:1.2;color:#102a43}.executive-header span{display:block;margin-top:6px;color:#627d98;font-size:13px}.executive-header-actions{display:flex;align-items:center;gap:8px;flex-shrink:0}.executive-header-actions .button,.executive-header-actions .ghost-button{min-height:36px;padding:7px 13px;text-decoration:none}.executive-kpi-strip,.purchase-flow-strip{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));background:#fff;border:1px solid #d9e2ec;border-radius:10px;overflow:hidden}.executive-kpi,.purchase-flow-step{position:relative;display:flex;min-width:0;flex-direction:column;align-items:flex-start;gap:2px;padding:11px 14px;text-align:left;background:#fff;border:0;border-right:1px solid #e7edf4;color:#243b53;cursor:pointer}.executive-kpi:last-child,.purchase-flow-step:last-child{border-right:0}.executive-kpi:before,.purchase-flow-step:before{content:"";position:absolute;inset:0 auto 0 0;width:3px;background:#9fb3c8}.executive-kpi.blue:before,.purchase-flow-step.blue:before{background:#2474b5}.executive-kpi.green:before,.purchase-flow-step.green:before{background:#1f8f61}.executive-kpi.red:before,.purchase-flow-step.red:before{background:#cf3b4c}.executive-kpi.amber:before,.purchase-flow-step.amber:before{background:#d58a12}.executive-kpi.purple:before,.purchase-flow-step.purple:before{background:#7357b4}.executive-kpi span,.purchase-flow-step small{color:#627d98;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}.executive-kpi b,.purchase-flow-step b{font-size:20px;line-height:1.1;color:#102a43;font-variant-numeric:tabular-nums}.executive-kpi small,.purchase-flow-step span{color:#829ab1;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.executive-kpi:hover,.purchase-flow-step:hover{background:#f7fafc}.executive-filters{display:flex;align-items:end;gap:8px;padding:10px 12px;background:#f7f9fc;border:1px solid #dce5ef;border-radius:10px;overflow-x:auto}.executive-filters label{display:grid;gap:3px;min-width:120px}.executive-filters label>span{color:#627d98;font-size:10px;font-weight:800;text-transform:uppercase;letter-spacing:.05em}.executive-filters input,.executive-filters select{height:34px;min-width:0;padding:5px 9px;background:#fff;border:1px solid #cbd7e3;border-radius:7px;color:#243b53;font-size:12px}.executive-filters .executive-search{min-width:240px;flex:1}.executive-filters .ghost-button{height:34px;white-space:nowrap}.executive-primary-grid,.executive-secondary-grid{display:grid;grid-template-columns:minmax(280px,.8fr) minmax(0,1.7fr);gap:14px}.executive-secondary-grid{grid-template-columns:minmax(0,1.7fr) minmax(280px,.8fr)}.executive-panel{min-width:0;background:#fff;border:1px solid #d9e2ec;border-radius:10px;overflow:hidden}.executive-panel>header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:58px;padding:11px 14px;border-bottom:1px solid #e7edf4;background:#fbfcfe}.executive-panel>header h2{margin:0;color:#102a43;font-size:15px}.executive-panel>header p{margin:3px 0 0;color:#829ab1;font-size:11px}.executive-panel>header button{padding:4px 7px;background:transparent;border:0;color:#1665a5;font-size:11px;font-weight:700;cursor:pointer}.executive-panel>header>span{display:inline-flex;align-items:center;justify-content:center;min-width:25px;height:25px;padding:0 7px;background:#eaf2f8;border-radius:20px;color:#315b7d;font-size:11px;font-weight:800}.executive-stage-list{display:grid;padding:4px 12px 8px}.executive-stage-row{display:grid;grid-template-columns:minmax(110px,1fr) minmax(70px,1fr) 92px;align-items:center;gap:10px;padding:9px 2px;background:#fff;border:0;border-bottom:1px solid #edf2f7;text-align:left;cursor:pointer}.executive-stage-row:last-child{border-bottom:0}.executive-stage-row span{display:grid}.executive-stage-row b{font-size:12px}.executive-stage-row small{color:#829ab1;font-size:10px}.executive-stage-row i{height:5px;background:#edf2f7;border-radius:4px;overflow:hidden}.executive-stage-row i em{display:block;height:100%;background:#2474b5;border-radius:4px}.executive-stage-row strong{text-align:right;color:#334e68;font-size:11px;font-variant-numeric:tabular-nums}.executive-table-wrap{overflow:auto}.executive-table-wrap table{width:100%;border-collapse:collapse;font-size:11px}.executive-table-wrap th{position:sticky;top:0;padding:8px 10px;background:#f4f7fa;border-bottom:1px solid #d9e2ec;color:#627d98;font-size:9px;text-align:left;text-transform:uppercase;letter-spacing:.04em;white-space:nowrap}.executive-table-wrap td{padding:9px 10px;border-bottom:1px solid #edf2f7;vertical-align:middle;color:#334e68}.executive-table-wrap td b{display:block;color:#243b53;font-size:11px}.executive-table-wrap td small{display:block;color:#9aaabd;font-size:9px;margin-top:2px}.executive-table-wrap td.number,.executive-table-wrap th.number{text-align:right;font-variant-numeric:tabular-nums}.executive-table-wrap tbody tr:last-child td{border-bottom:0}.executive-table-wrap .clickable-row{cursor:pointer}.executive-table-wrap .clickable-row:hover td{background:#f8fbfd}.table-link{padding:0;background:transparent;border:0;color:#1665a5;font:inherit;font-weight:700;cursor:pointer;text-decoration:underline;text-decoration-color:#b7cfdf;text-underline-offset:2px}.executive-badge{display:inline-flex;align-items:center;max-width:150px;padding:3px 7px;border-radius:10px;background:#edf2f7;color:#526d82;font-size:9px;font-weight:800;line-height:1.2;text-transform:uppercase;letter-spacing:.03em;white-space:nowrap}.executive-badge.urgent,.executive-badge.missing,.executive-badge.review-required,.executive-badge.cancelled{background:#fdebed;color:#b72738}.executive-badge.today,.executive-badge.high,.executive-badge.pending,.executive-badge.open{background:#fff2dc;color:#9a5d00}.executive-badge.won,.executive-badge.posted,.executive-badge.accounting-posted,.executive-badge.fully-reserved,.executive-badge.ready-for-delivery,.executive-badge.approved{background:#e5f6ed;color:#18734c}.executive-badge.sent,.executive-badge.draft-quoted,.executive-badge.draft{background:#e7f1fa;color:#1d659b}.executive-exception-list,.executive-activity-list{display:grid}.executive-exception{display:grid;grid-template-columns:28px 1fr 14px;align-items:start;gap:8px;padding:11px 13px;background:#fff;border:0;border-bottom:1px solid #edf2f7;text-align:left;color:#486581;cursor:pointer}.executive-exception>span:first-child{display:flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:7px;background:#fff3e0;color:#a96500}.executive-exception.critical>span:first-child{background:#fdebed;color:#b72738}.executive-exception svg,.executive-activity-list svg{width:15px;height:15px;fill:currentColor}.executive-exception b{display:block;color:#243b53;font-size:11px}.executive-exception small,.executive-exception em{display:block;margin-top:2px;color:#829ab1;font-size:10px;font-style:normal}.executive-exception:hover,.executive-activity-list button:hover{background:#f8fbfd}.executive-empty{display:grid;place-items:center;gap:4px;padding:25px;color:#829ab1;text-align:center}.executive-empty svg{width:24px;height:24px;fill:#4da57d}.executive-empty b{color:#486581;font-size:12px}.executive-empty small{font-size:10px}.executive-activity-list button{display:grid;grid-template-columns:68px 1fr 14px;align-items:center;gap:8px;padding:9px 12px;background:#fff;border:0;border-bottom:1px solid #edf2f7;text-align:left;color:#627d98;cursor:pointer}.executive-activity-list time{font-size:9px}.executive-activity-list b{display:block;color:#334e68;font-size:10px;text-transform:capitalize}.executive-activity-list small{display:block;color:#829ab1;font-size:9px;margin-top:1px}.purchase-primary-grid{grid-template-columns:minmax(0,1.4fr) minmax(300px,.6fr)}.purchase-payables-summary{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:15px}.purchase-payables-summary>div{padding:10px;background:#f6f9fc;border:1px solid #e2eaf2;border-radius:8px}.purchase-payables-summary span{display:block;color:#829ab1;font-size:10px;text-transform:uppercase}.purchase-payables-summary b{display:block;margin-top:4px;color:#102a43;font-size:18px;font-variant-numeric:tabular-nums}.purchase-payables-summary p{grid-column:1/-1;margin:0;color:#627d98;font-size:10px}.purchase-control-notes{display:grid;gap:0;margin:0;padding:0;list-style:none}.purchase-control-notes li{display:grid;gap:2px;padding:12px 14px;border-bottom:1px solid #edf2f7}.purchase-control-notes b{font-size:11px}.purchase-control-notes span{color:#829ab1;font-size:10px}.purchase-existing-workflow{margin-top:14px;border:1px solid #d9e2ec;border-radius:10px;background:#fff;overflow:hidden}.purchase-existing-workflow>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 16px;background:#f7f9fc;cursor:pointer;list-style:none}.purchase-existing-workflow>summary::-webkit-details-marker{display:none}.purchase-existing-workflow>summary span{display:grid;gap:2px}.purchase-existing-workflow>summary b{font-size:13px}.purchase-existing-workflow>summary small{color:#829ab1;font-size:10px}.purchase-existing-workflow>summary svg{width:16px;height:16px;fill:#627d98}.purchase-existing-workflow[open]>summary svg{transform:rotate(180deg)}.purchase-existing-workflow-body{padding:14px}.purchase-existing-workflow-body>.card:first-child{margin-top:0}
@media(max-width:1180px){.executive-kpi-strip,.purchase-flow-strip{grid-template-columns:repeat(3,1fr)}.executive-kpi:nth-child(3),.purchase-flow-step:nth-child(3){border-right:0}.executive-primary-grid,.executive-secondary-grid,.purchase-primary-grid{grid-template-columns:1fr}.executive-wide{grid-column:auto}}
@media(max-width:720px){.executive-header{align-items:flex-start;flex-direction:column}.executive-header-actions{width:100%;flex-wrap:wrap}.executive-kpi-strip,.purchase-flow-strip{grid-template-columns:repeat(2,1fr)}.executive-kpi:nth-child(odd),.purchase-flow-step:nth-child(odd){border-right:1px solid #e7edf4}.executive-kpi:nth-child(even),.purchase-flow-step:nth-child(even){border-right:0}.executive-filters{align-items:stretch;flex-direction:column}.executive-filters label,.executive-filters .executive-search{min-width:100%}.executive-panel>header{align-items:flex-start}.purchase-payables-summary{grid-template-columns:1fr}}

/* Shell stabilization guards: operational dashboards stay inside the existing AQ360 content area. */
html body[data-view="crm"] .crm-executive-dashboard,
html body[data-view="purchases"] .purchase-executive-dashboard {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
}

html body .executive-dashboard .table-link {
  padding: 0;
  border: 0;
  background: transparent;
}

/* Notification remains an anchored overlay and never participates in header layout. */
html body .topbar-actions .notification-center {
  position: relative !important;
  flex: 0 0 38px !important;
  overflow: visible !important;
}

html body .notification-panel {
  position: absolute !important;
  top: calc(100% + 10px) !important;
  right: 0 !important;
  left: auto !important;
  width: min(320px, calc(100vw - 24px)) !important;
  max-height: min(640px, calc(100vh - 110px)) !important;
  overflow-y: auto !important;
  z-index: 61 !important;
}

/* A CRM register/form is a temporary modal only; closed state reserves no space. */
html body #modal:not(.open) {
  display: none !important;
  pointer-events: none !important;
}
/* Purchase Order line editor: keep the include checkbox compact and make the
   legacy free-text to stock-item mapping explicit before a Draft PO is saved. */
.purchase-order-lines table {
  min-width: 1040px;
}

.purchase-order-lines th:nth-child(1),
.purchase-order-lines td:nth-child(1) {
  width: 390px;
  overflow: visible;
  white-space: normal !important;
}

.purchase-order-lines th:nth-child(6),
.purchase-order-lines td:nth-child(6) {
  width: 150px;
  text-align: right;
}

.po-line-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.po-line-check {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 9px 0 0 !important;
  padding: 0 !important;
}

.po-line-item-details {
  display: grid;
  min-width: 0;
  gap: 5px;
  white-space: normal;
}

.po-line-item-details b,
.po-line-item-details small {
  display: block;
  overflow-wrap: anywhere;
  white-space: normal;
}

.po-line-item-details select {
  width: 100%;
  min-width: 0;
}

.purchase-order-lines output {
  display: inline-block;
  min-width: 110px;
  font-weight: 800;
  color: var(--ink);
}
