/* Kaame SweetAlert2 skin (loaded after vendor/sweetalert2/sweetalert2.min.css). Mapped to the Kaame look: navy text, cobalt buttons, 16px radius. */
:root {
  --km-n-navy: #0B1A4F;
  --km-n-cobalt: #1A5CEE;
  --km-n-cobalt-dark: #104ed6;
  --km-n-danger: #c0392b;
  --km-n-muted: #546280;
  --km-n-font: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* The native APEX page messages are held hidden from first paint (no flash before the dialog) and released
   after 2 s if kaame-notify.js never ran (script blocked or switched off). */
#APEX_SUCCESS_MESSAGE, #APEX_ERROR_MESSAGE { visibility: hidden; height: 0; overflow: hidden; animation: km-n-release 0s 2s forwards; }
html.km-n-ready #APEX_SUCCESS_MESSAGE, html.km-n-ready #APEX_ERROR_MESSAGE { display: none !important; animation: none; }
@keyframes km-n-release { to { visibility: visible; height: auto; overflow: visible; } }

.km-n-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.swal2-container.km-n-container { font-family: var(--km-n-font); z-index: 20000; }
.swal2-container.km-n-container--toast { padding-top: 4.25rem; }
.swal2-popup.km-n-popup { width: min(30rem, 100%); max-width: 100%; box-sizing: border-box; padding: 1.6rem 1.4rem 1.3rem; border-radius: 16px; background: #fff; color: var(--km-n-navy); box-shadow: 0 24px 60px rgba(4, 13, 42, .28); font-family: var(--km-n-font); }
.swal2-popup.km-n-popup--toast { width: auto; max-width: min(26rem, calc(100vw - 2rem)); padding: .8rem 1rem; border-radius: 12px; box-shadow: 0 10px 30px rgba(4, 13, 42, .2); }
.km-n-popup .swal2-title.km-n-title { margin: .4rem 0 .2rem; padding: 0; font-size: 1.2rem; font-weight: 800; line-height: 1.3; letter-spacing: -.01em; color: var(--km-n-navy); }
.km-n-popup--toast .swal2-title.km-n-title { margin: 0; font-size: .9rem; font-weight: 700; text-align: center; }
.km-n-popup .swal2-html-container.km-n-text { margin: .6rem 0 0; padding: 0; font-size: .92rem; line-height: 1.55; color: var(--km-n-muted); white-space: pre-line; }
.km-n-list { margin: 0; padding: 0; list-style: none; text-align: left; display: grid; gap: .45rem; }
.km-n-list li { position: relative; padding: .55rem .7rem .55rem 1.6rem; border-radius: 9px; background: #fff5f4; color: #7b241c; font-size: .9rem; line-height: 1.45; white-space: normal; }
.km-n-list li::before { content: ''; position: absolute; left: .7rem; top: 1.05rem; width: 6px; height: 6px; border-radius: 50%; background: var(--km-n-danger); }
.km-n-actions { gap: .6rem; margin-top: 1.1rem; }
.km-n-btn { min-height: 44px; min-width: 7rem; padding: .6rem 1.4rem; border-radius: 10px; font: 750 .85rem/1.2 var(--km-n-font); cursor: pointer; transition: background-color .18s, border-color .18s, color .18s, box-shadow .18s, transform .18s; }
.km-n-btn-primary { background: var(--km-n-cobalt); color: #fff; border: 1.5px solid var(--km-n-cobalt); }
.km-n-btn-primary:hover { background: var(--km-n-cobalt-dark); border-color: var(--km-n-cobalt-dark); box-shadow: 0 6px 20px rgba(26, 92, 238, .15); }
.km-n-btn-secondary { background: #fff; color: var(--km-n-navy); border: 1.5px solid #9BAAC7; }
.km-n-btn-secondary:hover { background: #F3F8FE; color: var(--km-n-cobalt); border-color: var(--km-n-cobalt); box-shadow: 0 6px 20px rgba(26, 92, 238, .12); }
.km-n-btn-danger { background: var(--km-n-danger); color: #fff; border: 1.5px solid var(--km-n-danger); }
.km-n-btn-danger:hover { background: #a93226; border-color: #a93226; box-shadow: 0 6px 20px rgba(192, 57, 43, .18); }
.km-n-btn:focus-visible { outline: 3px solid rgba(26, 92, 238, .35); outline-offset: 2px; }
.km-n-popup .swal2-icon { margin: .2rem auto .6rem; }
.km-n-popup--toast .swal2-icon { margin: 0 .7rem 0 0; }
/* toast: same width, height, padding and look as before. SweetAlert's own toast grid keeps empty rows below the content, so the checkmark and the message sat above the
   middle and 2px apart. One flex row puts both on the popup's centre line; min-height keeps the original height, and the message is centred in the room beside the
   checkmark (its right margin equals the checkmark's, so the spacing on both sides is balanced). */
.swal2-popup.km-n-popup--toast { display: flex !important; align-items: center; min-height: 69px; padding-top: calc(.8rem + 4px); padding-bottom: calc(.8rem + 4px); }
.km-n-popup--toast .swal2-title.km-n-title { flex: 1 1 auto; margin: 0 -.3rem 0 0; }
.swal2-timer-progress-bar { background: var(--km-n-cobalt); }

@media (max-width: 480px) {
  .swal2-popup.km-n-popup { padding: 1.3rem 1rem 1.1rem; }
  .km-n-actions { flex-direction: column-reverse; width: 100%; }
  .km-n-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .km-n-btn { transition: none; }
  .swal2-popup, .swal2-container { animation: none !important; transition: none !important; }
}

/* Log In button while the sign-in wait runs: label shows the remaining seconds; the original label and look return when it is over */
.km-login-submit.km-login-cooling, .km-login-submit.km-login-cooling:hover { background: #8fa3c7 !important; border-color: #8fa3c7 !important; color: #fff !important; box-shadow: none !important; cursor: not-allowed; transform: none !important; }

/* ---- Global focus ring (all pages; this file is loaded application-wide) ---- */
/* Global focus ring: no ring after a mouse click, one subtle ring for keyboard users.
   Only the :focus-but-not-:focus-visible state is touched (what browsers use for mouse clicks), so text inputs, selects and textareas
   (which always match :focus-visible), hover, active, selected and disabled styling are left exactly as they are. */
:where(button, a[href], summary, [role="button"], [role="tab"], [role="menuitem"], [role="switch"], [role="option"], [role="link"], [tabindex]):focus:not(:focus-visible) {
    outline: none;
}
/* Universal Theme components also draw their click ring as a box-shadow; custom buttons keep their own resting shadows (not touched). */
.t-Button:focus:not(:focus-visible),
.t-Header-nav a:focus:not(:focus-visible),
.t-NavigationBar a:focus:not(:focus-visible),
.t-TreeNav a:focus:not(:focus-visible),
.t-Tabs a:focus:not(:focus-visible),
.a-Menu-label:focus:not(:focus-visible),
.a-Button:focus:not(:focus-visible) {
    outline: none;
    box-shadow: none;
}
/* Keyboard focus: one consistent KAAME indicator (same cobalt as the platform pages); :where keeps its specificity low so the
   page-specific focus-visible rules in platform.css still win where they exist. */
:where(button, a[href], summary, [role="button"], [role="tab"], [role="menuitem"], [role="switch"], [role="option"], [role="link"], .t-Button, .t-Tabs a, .t-TreeNav a, .t-NavigationBar a, .a-Menu-label):focus-visible {
    outline: 2px solid #1a5cee;
    outline-offset: 2px;
}
