/* SERS Cloud V0.10 R10 — shared modal contract. Loaded last on every application shell.
   Content and workflows stay owned by their modules; presentation is shared. */
:root{--sers-modal-navy:#103d66;--sers-modal-border:#dce7f2;--sers-modal-focus:#55c2ff;--sers-modal-blue:#086dbe}
:is(.portal-app,.core-app) :is(dialog,.modal-panel,.po-detail-modal,.po-editor[open]){box-sizing:border-box;border-radius:14px;background:#fff;color:#15324d;box-shadow:0 22px 72px #03152f55;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}
:is(.portal-app,.core-app) dialog::backdrop{background:rgba(5,20,42,.66)}
:is(.portal-app,.core-app) :is(.cm-dialog-head,.po-dialog-head,.po-detail-header,.financial-compose-header,.r14-modal-head,.sa-alarm-head,.modal-head){box-sizing:border-box;min-height:68px;padding:14px 22px;background:linear-gradient(110deg,#103d66,#104b7c);color:#fff;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid #2d668e;border-radius:0;margin:0}
:is(.portal-app,.core-app) :is(.cm-dialog-head,.po-dialog-head,.po-detail-header,.financial-compose-header,.r14-modal-head,.sa-alarm-head,.modal-head) :is(h1,h2,h3){font-size:19px;line-height:1.3;font-weight:750;letter-spacing:-.02em;color:#fff;margin:0}
:is(.portal-app,.core-app) :is(.cm-close,.po-close,.po-email-close,.po-details-close,.r14-close,.sa-alarm-head button,.modal-close){box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;flex:0 0 42px;width:42px;height:42px;min-width:42px;min-height:42px;padding:0;border:1px solid #86b9df;border-radius:9px;background:#ffffff12;color:#fff;font-size:25px;font-weight:700;line-height:1;text-decoration:none;box-shadow:none;cursor:pointer}
:is(.portal-app,.core-app) :is(.cm-close,.po-close,.po-email-close,.po-details-close,.r14-close,.sa-alarm-head button,.modal-close):hover{background:#216b9e;color:#fff;border-color:#b2dfff}
:is(.portal-app,.core-app) :is(.cm-close,.po-close,.po-email-close,.po-details-close,.r14-close,.sa-alarm-head button,.modal-close):focus-visible{outline:3px solid var(--sers-modal-focus);outline-offset:2px;box-shadow:none}
:is(.portal-app,.core-app) :is(.cm-dialog-content,.po-dialog-body,.sa-alarm-content){min-height:0;overscroll-behavior:contain;overflow-y:auto}
:is(.portal-app,.core-app) :is(.cm-dialog-foot,.cm-dialog-actions,.po-dialog-foot,.financial-compose-footer,.r14-modal-actions,.modal-actions){gap:10px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
:is(.portal-app,.core-app) :is(dialog,.modal-panel,.po-detail-modal) :is(input:not([type=checkbox]):not([type=radio]),select,textarea){box-sizing:border-box;max-width:100%;border:1px solid #c4d6e7;border-radius:8px;background:#fff;color:#163553;font:inherit}
:is(.portal-app,.core-app) :is(dialog,.modal-panel,.po-detail-modal) :is(input,select,textarea,button,a):focus-visible{outline:3px solid var(--sers-modal-focus);outline-offset:2px}
:is(.portal-app,.core-app) :is(dialog,.modal-panel,.po-detail-modal) :is(button,[type=submit]){font-family:inherit}
/* Core overlays use the same header rather than a white, padded card. */
.core-app .modal-panel{padding:0;overflow:auto}
.core-app .modal-head{padding:14px 22px;margin:0}
.core-app .modal-panel>:not(.modal-head){margin-left:22px;margin-right:22px}
.core-app .modal-panel>.modal-actions{margin-bottom:20px}
/* Readable profile actions in every interaction state. */
.office-brand .office-profile-panel{background:#fff;color:#15324d;border:1px solid #b8cde0;box-shadow:0 16px 38px #001a3855}
.office-brand .office-profile-panel a,.office-brand .office-profile-panel a:link,.office-brand .office-profile-panel a:visited{color:#143a60!important;background:#fff;font-weight:700;opacity:1;text-shadow:none}
.office-brand .office-profile-panel a:hover,.office-brand .office-profile-panel a:focus-visible{background:#e8f3ff!important;color:#073a6b!important}
.office-brand .office-profile-panel a:focus-visible{outline:3px solid var(--sers-modal-focus);outline-offset:-2px}
@media(max-width:640px){
 :is(.portal-app,.core-app) :is(dialog,.modal-panel,.po-detail-modal,.po-editor[open]){max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px)}
 :is(.portal-app,.core-app) :is(.cm-dialog-head,.po-dialog-head,.po-detail-header,.financial-compose-header,.r14-modal-head,.sa-alarm-head,.modal-head){padding:10px 14px;min-height:60px}
 :is(.portal-app,.core-app) :is(.cm-dialog-head,.po-dialog-head,.po-detail-header,.financial-compose-header,.r14-modal-head,.sa-alarm-head,.modal-head) :is(h1,h2,h3){font-size:17px}
 :is(.portal-app,.core-app) :is(.cm-close,.po-close,.po-email-close,.po-details-close,.r14-close,.sa-alarm-head button,.modal-close){width:42px;height:42px;flex-basis:42px}
}

/* V0.10 R10: Edit Customer is the canonical modal. High specificity is intentional:
   legacy page-specific selectors were more specific than the original shared contract. */
.portal-app dialog.cm-dialog>.cm-dialog-head,
.portal-app dialog.cm-dialog.cs-form-dialog>.cm-dialog-head,
.portal-app dialog.cm-dialog.sa-alarm-dialog>.cm-dialog-head,
.portal-app dialog.sa-create-dialog>.cm-dialog-head,
.portal-app dialog.cm-dialog.sa-catalogue-dialog>.cm-dialog-head,
.portal-app dialog.cm-dialog>.sa-alarm-head{
 min-height:78px!important;height:auto!important;padding:16px 22px!important;
 background:linear-gradient(110deg,#102d4c,#0c548b)!important;
 color:#fff!important;display:flex!important;align-items:center!important;
 justify-content:space-between!important;gap:15px!important;box-sizing:border-box!important;
}
.portal-app dialog.cm-dialog>.cm-dialog-head :is(h1,h2,h3),
.portal-app dialog.sa-create-dialog>.cm-dialog-head h2,
.portal-app dialog.cm-dialog.sa-alarm-dialog>.cm-dialog-head h2{
 font-size:20px!important;line-height:1.25!important;font-weight:750!important;color:#fff!important;margin:0!important;
}
.portal-app dialog.cm-dialog>.cm-dialog-head :is(.cm-close,button[data-close-alarm]),
.portal-app dialog.sa-create-dialog>.cm-dialog-head .cm-close,
.portal-app dialog.cm-dialog.sa-alarm-dialog>.cm-dialog-head .cm-close,
.portal-app dialog.cm-dialog.sa-catalogue-dialog>.cm-dialog-head .cm-close{
 width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
 flex:0 0 44px!important;display:inline-flex!important;align-items:center!important;
 justify-content:center!important;border:1px solid #86b9df!important;border-radius:9px!important;
 padding:0!important;background:rgba(255,255,255,.1)!important;color:#fff!important;
 box-shadow:none!important;font-size:27px!important;line-height:1!important;
}
.portal-app dialog.cm-dialog>.cm-dialog-head :is(.cm-close,button[data-close-alarm]):focus-visible{
 outline:3px solid #55c2ff!important;outline-offset:2px!important;box-shadow:none!important;
}
.portal-app dialog.cm-dialog :is(.cm-dialog-actions,.cm-dialog-foot){justify-content:flex-end!important;}
.portal-app dialog.sa-create-dialog .cm-dialog-actions{justify-content:flex-end!important;}
.portal-app dialog.cm-dialog .cm-dialog-content{min-height:0;overflow-y:auto;overscroll-behavior:contain;}
@media(max-width:640px){
 .portal-app dialog.cm-dialog>.cm-dialog-head,.portal-app dialog.sa-create-dialog>.cm-dialog-head,
 .portal-app dialog.cm-dialog.sa-alarm-dialog>.cm-dialog-head{min-height:68px!important;padding:12px 16px!important;}
 .portal-app dialog.cm-dialog>.cm-dialog-head :is(h1,h2,h3){font-size:18px!important;}
}
