/* CAPITAL GRID WEB V37.0.3 — Compact Admin Expense Allocation */
.cg-expense-allocate-button{border-color:#b9cddd!important;background:#f6fbff!important;color:#174d70!important;font-weight:800!important;white-space:nowrap!important}
.cg-expense-allocate-button.allocated{border-color:#86cfa6!important;background:#eaf8ef!important;color:#08743f!important;font-weight:900!important}
.cg-expense-allocate-button.allocated:hover{border-color:#69b98c!important;background:#dff4e7!important;color:#056735!important}
.expense-actions-inline .cg-expense-allocate-button{padding-left:10px!important;padding-right:10px!important}
.cg-expense-allocation-detail{margin-top:12px;border:1px solid #c7dce8;background:#f8fcfe}
.cg-allocation-detail-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 16px}
.cg-allocation-detail-grid>div{min-width:0;font-size:12px;line-height:1.45}
.cg-allocation-detail-grid b{display:block;color:#20384b;margin-bottom:2px}
.cg-allocation-detail-grid span{overflow-wrap:anywhere}
.cg-allocation-status{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;font-size:10px;font-weight:800;white-space:nowrap}
.cg-allocation-status.linked{border:1px solid #9dd9b7;background:#ebf9f0;color:#08743f}
.cg-allocation-status.neutral{border:1px solid #cbd8e1;background:#f5f8fa;color:#526575}
.cg-expense-allocation-card{max-width:840px}
.cg-allocation-expense-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin:10px 0 14px}
.cg-allocation-expense-summary>div{border:1px solid #d8e4ec;border-radius:11px;padding:10px;background:#fff;min-width:0}
.cg-allocation-expense-summary small{display:block;color:#6d7e8e;margin-bottom:3px;font-size:10px}
.cg-allocation-expense-summary b{display:block;font-size:12.5px;overflow-wrap:anywhere}
.cg-allocation-expense-summary span{display:block;margin-top:2px;color:#6d7e8e;font-size:10px;overflow-wrap:anywhere}
.cg-allocation-formgrid{margin-top:8px}
.cg-allocation-preview{margin-top:10px;border:1px solid #d5e1ea;border-radius:11px;padding:11px 13px;background:#f8fbfd;font-size:12px;line-height:1.55;color:#263d4e}
.cg-allocation-preview.warn{border-color:#edc27d;background:#fff8e9;color:#805000}
.cg-allocation-preview.linked{border-color:#9dd9b7;background:#eefaf3;color:#17643d}
.cg-allocation-linked-notice{border-color:#9dd9b7!important;background:#eefaf3!important;color:#17643d!important}
.cg-allocation-actions{gap:8px;flex-wrap:wrap}
.cg-portal-notification{outline:1px solid #9fd7ca;outline-offset:-1px;background:linear-gradient(90deg,#f0fbf7,#fff)}
.cg-portal-notification .cg-notify-titleline b:before{content:'↗ ';color:#087760}
@media(max-width:900px){.cg-allocation-expense-summary{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:680px){.cg-allocation-detail-grid,.cg-allocation-expense-summary{grid-template-columns:1fr}.cg-allocation-status{white-space:normal}.cg-allocation-actions>button{width:100%}}

/* V37.0.3 — compact desktop actions + robust Allocated status */
@media(min-width:1101px){
  #expenseTable .expense-actions-inline .cg-expense-allocate-button{padding-left:7px!important;padding-right:7px!important}
  #expenseTable .expense-actions-inline{gap:5px!important}
  #expenseTable .expense-actions-cell{overflow:visible!important}
}


/* V37.0.3 — action button refinement requested from live 100% view */
#root #expenseTable .expense-actions-inline{
  gap:4px!important;
}
#root #expenseTable .expense-actions-inline .cg-expense-icon-action{
  width:29px!important;
  min-width:29px!important;
  max-width:29px!important;
  height:27px!important;
  min-height:27px!important;
  padding:0!important;
  border-radius:8px!important;
  display:inline-grid!important;
  place-items:center!important;
  font-size:12px!important;
  line-height:1!important;
}
#root #expenseTable .expense-actions-inline .cg-expense-edit-icon{
  color:#ad5a00!important;
}
#root #expenseTable .expense-actions-inline .cg-expense-delete-icon{
  color:#b3261e!important;
}

/* Keep Receipt and Allocate wording intact; only tighten their footprint slightly. */
#root #expenseTable .expense-receipt-cell button,
#root #expenseTable .expense-actions-inline .cg-expense-allocate-button{
  min-height:27px!important;
  height:27px!important;
  padding:3px 7px!important;
  border-radius:8px!important;
  font-size:9.6px!important;
  line-height:1!important;
  white-space:nowrap!important;
}

/* Must outrank the legacy #root button.secondary black-text rule. */
#root #expenseTable .expense-actions-inline .cg-expense-allocate-button.allocated{
  color:#08743f!important;
  font-weight:900!important;
  background:#eaf8ef!important;
  border:1px solid #7fc79d!important;
  text-shadow:none!important;
}
#root #expenseTable .expense-actions-inline .cg-expense-allocate-button.allocated:hover{
  color:#056735!important;
  background:#dff4e7!important;
  border-color:#62b785!important;
}

/* ============================================================
   CAPITAL GRID V37.1.2.2 — Expense register action alignment
   - Petty Cash link indicator sits beside Allocation status
   - Receipt and Allocation remain visually unchanged
   - tighter, centered right-side layout
   ============================================================ */
#root #expenseTable .expense-actions-cell{
  vertical-align:middle!important;
  text-align:center!important;
  padding-left:6px!important;
  padding-right:6px!important;
}
#root #expenseTable .expense-actions-inline{
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex-wrap:nowrap!important;
  gap:8px!important;
  width:100%!important;
  min-height:29px!important;
}
#root #expenseTable .expense-actions-inline .expense-petty-link-indicator{
  order:-1!important;
  flex:0 0 16px!important;
  width:16px!important;
  height:16px!important;
  margin:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:12px!important;
  line-height:1!important;
}
#root #expenseTable .expense-actions-inline .cg-expense-allocate-button{
  margin:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
#root #expenseTable .expense-receipt-cell{
  vertical-align:middle!important;
  text-align:center!important;
}
#root #expenseTable .expense-receipt-cell button{
  margin-left:auto!important;
  margin-right:auto!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}

/* V39.5.30: payment source editor / readable allocation preview */
#cgAllocationPaymentSource{width:100%;max-width:100%}
.cg-expense-allocation-card{overflow-x:hidden}
