/* A lighter skin for sweetalert 1.x, on every page (loaded after sweetalert.css and
   erp_default.css). Look only: no behaviour, markup or option changes.

   - Centering: erp_default.css pins .showSweetAlert with margin -200px/-200px
     (!important), which only centres a 400px box, and sweetalert's JS writes an
     inline margin-top. Both are overridden with a translate(-50%, -50%) centre, so
     the open/close animations are redefined here to keep that translate.
   - Buttons: callers pass confirmButtonColor, which sweetalert writes as an inline
     background (and darkens inline on hover). The confirm button is the app blue;
     the red "danger" colours callers use (#DD6B55, #d9534f, #ff0000) stay red. */

.sweet-overlay {
	background-color: rgba(15, 23, 42, .45) !important;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.sweet-alert,
.sweet-alert.showSweetAlert {
	width: 440px;
	max-width: calc(100vw - 32px);
	max-height: 80vh;
	overflow: auto;
	left: 50%;
	top: 50%;
	margin: 0 !important;
	transform: translate(-50%, -50%);
	padding: 26px 28px 22px;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 20px 50px rgba(15, 23, 42, .25), 0 2px 6px rgba(15, 23, 42, .08);
	font-family: inherit;
	box-sizing: border-box;
}
/* invoice.html (also the DC page), grn.html, oa.html, sales_estimate.html and note.html
   link erp_default.css a second time in the page body, after this file, so its equally
   specific -200px !important margins won and the card sat 200px up and left. The doubled
   class outranks that rule wherever it is loaded. */
.sweet-alert.sweet-alert.showSweetAlert { margin: 0 !important; }

.sweet-alert.showSweetAlert[data-animation="pop"] { animation: pfSwalIn .2s ease-out; }
.sweet-alert.hideSweetAlert[data-animation="pop"] { animation: pfSwalOut .15s ease-in forwards; }
@keyframes pfSwalIn {
	from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
	to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes pfSwalOut {
	from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
	to { opacity: 0; transform: translate(-50%, -50%) scale(.96); }
}

/* Icons at ~70% of sweetalert's 80px; zoom leaves the icons' own transform animations alone. */
.sweet-alert .sa-icon { zoom: .7; margin: 4px auto 14px; }

.sweet-alert h2 {
	margin: 6px 0 6px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
	color: #1f2733;
	text-transform: none;
}
.sweet-alert h2:empty { display: none; }
.sweet-alert p {
	font-size: 14px;
	line-height: 1.55;
	color: #5b6675;
	font-weight: normal;
	word-break: break-word;
}

.sweet-alert fieldset { margin-top: 8px; }
.sweet-alert input {
	height: 38px;
	margin-top: 12px;
	padding: 0 12px;
	font-size: 14px;
	border: 1px solid #d0d7e2;
	border-radius: 6px;
	box-shadow: none;
}
.sweet-alert input:focus { border-color: #209be1; box-shadow: 0 0 0 3px rgba(32, 155, 225, .15); }

.sweet-alert .sa-button-container { margin-top: 20px; }
.sweet-alert button {
	min-width: 96px;
	margin: 0 5px;
	padding: 9px 22px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .3px;
	text-transform: none;
	box-shadow: none !important;
	transition: background-color .15s, border-color .15s, color .15s;
}
.sweet-alert button.confirm {
	background-color: #209be1 !important;
	border: 1px solid #209be1;
	color: #fff;
}
/* sweetalert.css turns the FOCUSED confirm button green (#44ad6b !important) and
   scales it; sweetalert focuses it on open, so every OK was green. */
.sweet-alert button.confirm:hover,
.sweet-alert button.confirm:focus { background-color: #1a86c4 !important; border-color: #1a86c4; transform: none; }
.sweet-alert button.confirm:focus { background-color: #209be1 !important; box-shadow: 0 0 0 3px rgba(32, 155, 225, .25) !important; }
.sweet-alert button:hover, .sweet-alert button:focus { transform: none; }

.sweet-alert button.confirm[style*="221, 107, 85"],
.sweet-alert button.confirm[style*="217, 83, 79"],
.sweet-alert button.confirm[style*="255, 0, 0"],
.sweet-alert button.confirm[style*="dd6b55" i],
.sweet-alert button.confirm[style*="d9534f" i] {
	background-color: #e5484d !important;
	border-color: #e5484d;
}
.sweet-alert button.confirm[style*="221, 107, 85"]:focus,
.sweet-alert button.confirm[style*="217, 83, 79"]:focus,
.sweet-alert button.confirm[style*="255, 0, 0"]:focus { background-color: #e5484d !important; box-shadow: 0 0 0 3px rgba(229, 72, 77, .25) !important; }
.sweet-alert button.confirm[style*="221, 107, 85"]:hover,
.sweet-alert button.confirm[style*="217, 83, 79"]:hover,
.sweet-alert button.confirm[style*="255, 0, 0"]:hover { background-color: #cf3c41 !important; border-color: #cf3c41; }

.sweet-alert button.cancel {
	background-color: #fff !important;
	border: 1px solid #d0d7e2;
	color: #444;
}
.sweet-alert button.cancel:hover { background-color: #f3f5f8 !important; border-color: #c2cad6; }

@media (max-width: 480px) {
	.sweet-alert, .sweet-alert.showSweetAlert { padding: 22px 18px 18px; }
	.sweet-alert button { min-width: 0; padding: 9px 16px; }
}

/* Dialogs that size themselves with a customClass also offset themselves for the old
   margin centring (sweetalert.css .swal-wide, erp_default.css .swal-remarks, the
   e-invoice page's inline .einvoice-alert). Keep their widths, drop their offsets.
   The doubled .sweet-alert outranks the e-invoice page's later inline <style>. */
.sweet-alert.sweet-alert.showSweetAlert.swal-wide,
.sweet-alert.sweet-alert.showSweetAlert.swal-remarks,
.sweet-alert.sweet-alert.showSweetAlert.einvoice-alert { left: 50%; margin: 0 !important; }
.sweet-alert.sweet-alert.swal-wide { width: 600px; }
.sweet-alert.sweet-alert.swal-remarks { width: 500px; max-height: 500px; }
.sweet-alert.sweet-alert.einvoice-alert { width: 470px; max-height: 90vh; }

/* Colour by type. sweetalert 1.x does not tag the card with its type; it shows the one
   icon it needs (.sa-success / .sa-error / .sa-warning / .sa-info) with an inline
   display:block, so :has() reads the type from that. Each type gets a 4px accent bar
   across the top of the card and a matching icon colour. Browsers without :has() just
   show the plain card. */
.sweet-alert { --swal-accent: transparent; position: fixed; }
.sweet-alert::before {
	content: ''; position: absolute; left: 0; right: 0; top: 0; height: 4px;
	background: var(--swal-accent);
}
.sweet-alert:has(.sa-icon.sa-success[style*="block"]) { --swal-accent: #22a06b; }
.sweet-alert:has(.sa-icon.sa-error[style*="block"])   { --swal-accent: #e5484d; }
.sweet-alert:has(.sa-icon.sa-warning[style*="block"]) { --swal-accent: #f59e0b; }
.sweet-alert:has(.sa-icon.sa-info[style*="block"])    { --swal-accent: #209be1; }

/* Success: green ring and tick. */
.sweet-alert .sa-icon.sa-success { border-color: #22a06b; }
.sweet-alert .sa-icon.sa-success .sa-placeholder { border-color: rgba(34, 160, 107, .22); }
.sweet-alert .sa-icon.sa-success .sa-line { background-color: #22a06b; }
/* Error: red ring and cross. */
.sweet-alert .sa-icon.sa-error { border-color: #e5484d; }
.sweet-alert .sa-icon.sa-error .sa-line { background-color: #e5484d; }
/* Warning: amber ring and exclamation mark (was dark grey #484848). sweetalert's
   pulseWarning / pulseWarningIns keyframes animate these colours, and an animation
   outranks a normal declaration, so these need !important. */
.sweet-alert .sa-icon.sa-warning { border-color: #f59e0b !important; }
.sweet-alert .sa-icon.sa-warning .sa-body,
.sweet-alert .sa-icon.sa-warning .sa-dot { background-color: #f59e0b !important; }
/* Info: blue ring and "i". */
.sweet-alert .sa-icon.sa-info { border-color: #209be1; }
.sweet-alert .sa-icon.sa-info::before,
.sweet-alert .sa-icon.sa-info::after { background-color: #209be1; }
