/* Hamyara 0.15.37 — transaction quick actions + party editor controls */

/* Transaction center: keep creation actions together and to the right of transfer in RTL. */
body .transaction-center-actions-v187{
  display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:9px!important;flex-wrap:wrap!important;min-width:0!important;
}
body .transaction-create-actions-v187{
  display:flex!important;align-items:center!important;gap:8px!important;flex-wrap:wrap!important;min-width:0!important;
}
body .transaction-create-btn-v187,body .transaction-transfer-btn-v187{min-width:132px!important;white-space:nowrap!important}
body .transaction-create-btn-v187.sale{background:linear-gradient(135deg,#159a72,#0c8160)!important;color:#fff!important;border-color:transparent!important;box-shadow:0 8px 20px rgba(15,145,104,.16)!important}
body .transaction-create-btn-v187.purchase{background:#eef6ff!important;color:#245d9b!important;border-color:#d8e8f7!important}
body .transaction-create-btn-v187.expense{background:#fff6e9!important;color:#9a6113!important;border-color:#f1dfc3!important}
body .transaction-export-btn-v187{margin-inline-start:2px!important;white-space:nowrap!important}

/* Party editor: photo and active status share one deliberate row. */
body .party-profile-row-v187{
  display:grid!important;grid-template-columns:minmax(0,1.55fr) minmax(250px,.75fr)!important;gap:14px!important;align-items:stretch!important;direction:rtl!important;
}
body .party-photo-field-v187,body .party-active-card-v187{
  min-width:0!important;border:1px solid #dce7ef!important;border-radius:15px!important;background:linear-gradient(145deg,#fff,#f8fbfd)!important;padding:13px 14px!important;
}
body .party-photo-upload-v187{display:grid!important;grid-template-columns:76px minmax(0,1fr)!important;gap:14px!important;align-items:center!important;margin-top:7px!important}
body .party-photo-preview-v187{width:76px!important;height:76px!important;border-radius:19px!important;box-shadow:0 8px 22px rgba(27,77,111,.10)!important;border:1px solid #d7e5ee!important;background:#eef6fa!important}
body .party-photo-action-v187{display:grid!important;grid-template-columns:max-content minmax(0,1fr)!important;gap:6px 10px!important;align-items:center!important;min-width:0!important}
body .party-photo-input-v187{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
body .party-photo-button-v187{min-width:142px!important;height:42px!important;cursor:pointer!important;justify-self:start!important;background:#edf7fb!important;color:#236681!important;border-color:#cfe3ed!important;box-shadow:0 5px 14px rgba(34,103,132,.08)!important}
body .party-photo-button-v187:hover{background:#e4f3f9!important;border-color:#b8d8e6!important}
body .party-photo-name-v187{font-size:11px!important;color:#647d90!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;min-width:0!important}
body .party-photo-action-v187>.field-hint{grid-column:1/-1!important;margin:0!important;line-height:1.75!important}
body .party-active-card-v187{min-height:118px!important;height:auto!important;margin:0!important;align-self:stretch!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important}
body .party-active-card-v187>span{display:grid!important;gap:4px!important}
body .party-active-card-v187>span strong{font-size:14px!important;color:#173650!important}
body .party-active-card-v187>span small{font-size:11px!important;line-height:1.7!important;color:#7890a3!important}

/* Roles are genuine toggle buttons: the switch is the primary affordance, not a checkbox square. */
body .role-toggle-selector-v187{gap:10px!important}
body .role-toggle-v187{
  min-height:72px!important;padding:10px 12px!important;border:1px solid #d9e5ee!important;border-radius:14px!important;background:#fff!important;
  display:grid!important;grid-template-columns:44px minmax(0,1fr)!important;align-items:center!important;gap:11px!important;cursor:pointer!important;transition:.18s ease!important;
}
body .role-toggle-v187:hover{border-color:#bad5e4!important;background:#f8fcfe!important;transform:translateY(-1px)!important}
body .role-toggle-v187 input{position:absolute!important;opacity:0!important;pointer-events:none!important}
body .role-toggle-v187>i{
  position:relative!important;inset:auto!important;width:42px!important;height:24px!important;border:0!important;border-radius:999px!important;background:#cad7e1!important;box-shadow:inset 0 0 0 1px rgba(36,75,103,.08)!important;display:block!important;
}
body .role-toggle-v187>i::after{
  content:""!important;position:absolute!important;top:3px!important;right:3px!important;width:18px!important;height:18px!important;border-radius:50%!important;background:#fff!important;box-shadow:0 2px 7px rgba(17,55,82,.22)!important;transition:transform .18s ease!important;
}
body .role-toggle-v187 input:checked+i{background:#149f78!important;box-shadow:inset 0 0 0 1px rgba(9,113,83,.10)!important}
body .role-toggle-v187 input:checked+i::after{transform:translateX(-18px)!important}
body .role-toggle-copy-v187{display:grid!important;gap:3px!important;min-width:0!important}
body .role-toggle-copy-v187 b{font-size:13.5px!important;color:#183850!important}
body .role-toggle-copy-v187 small{font-size:10.5px!important;color:#73899b!important;line-height:1.6!important}
body .role-toggle-v187:has(input:checked){background:#f1fbf7!important;border-color:#adddca!important;box-shadow:0 7px 18px rgba(17,143,105,.08)!important}
body .role-toggle-v187.partner-locked{cursor:default!important;background:#f6f8fa!important;border-color:#dce4ea!important;opacity:.92!important}
body .role-toggle-v187.partner-locked:hover{transform:none!important}

@media(max-width:980px){
  body .transaction-create-btn-v187,body .transaction-transfer-btn-v187{min-width:0!important;flex:1 1 150px!important}
  body .transaction-create-actions-v187{width:100%!important}
  body .transaction-export-btn-v187{flex:1 1 150px!important}
}
@media(max-width:680px){
  body .transaction-center-actions-v187,body .transaction-create-actions-v187{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important;gap:8px!important}
  body .transaction-export-btn-v187{grid-column:1/-1!important;width:100%!important;margin:0!important}
  body .transaction-create-btn-v187,body .transaction-transfer-btn-v187{width:100%!important;min-width:0!important;padding-inline:8px!important;font-size:11.5px!important}
  body .party-profile-row-v187{grid-template-columns:1fr!important}
  body .party-photo-upload-v187{grid-template-columns:68px minmax(0,1fr)!important}
  body .party-photo-preview-v187{width:68px!important;height:68px!important}
  body .party-photo-action-v187{grid-template-columns:1fr!important}
  body .party-photo-button-v187{width:100%!important;justify-self:stretch!important}
  body .party-photo-action-v187>.field-hint{grid-column:auto!important}
  body .party-active-card-v187{min-height:84px!important}
}
@media(max-width:420px){
  body .transaction-center-actions-v187,body .transaction-create-actions-v187{grid-template-columns:1fr!important}
  body .transaction-export-btn-v187{grid-column:auto!important}
}

/* QA 0.15.37: keep expense payment rows inside the content column on mid-width desktop/tablet layouts. */
@media(min-width:901px) and (max-width:1180px){
  body.transaction-page form[data-tx-type="expense"] .retail-payment{
    grid-template-columns:minmax(0,1fr) minmax(130px,.55fr) minmax(140px,.6fr) 36px!important;
    gap:10px!important;
    min-width:0!important;
  }
  body.transaction-page form[data-tx-type="expense"] .retail-payment>*{min-width:0!important}
}
