/* ======================================================================
   UA GLOBAL FEEDBACK + STABLE RTL DIMENSIONS
   Final layout pass: no stacked fixes. Sidebar right, content bounded.
   ====================================================================== */

:root{
  --ua-layout-sidebar-w:238px;
  --ua-layout-gap:16px;
  --ua-layout-topbar-h:28px;
  --ua-page-windowbar-h:38px;
}

*{box-sizing:border-box!important;}
html,body{margin:0!important;padding:0!important;overflow-x:hidden!important;}
body.ua-authed{min-height:100vh!important;background:#07111f!important;direction:rtl!important;}

/* Sidebar: fixed RIGHT only */
body.ua-authed .ua-sb3,
body.ua-authed aside.ua-sb3{
  position:fixed!important;
  top:0!important;right:0!important;bottom:0!important;left:auto!important;
  width:var(--ua-layout-sidebar-w)!important;
  min-width:var(--ua-layout-sidebar-w)!important;
  max-width:var(--ua-layout-sidebar-w)!important;
  height:100vh!important;
  margin:0!important;
  z-index:999!important;
  transform:none!important;
}

/* Main content: one reserve only, with small safe gutter */
body.ua-authed .ua-main{
  position:relative!important;
  display:block!important;
  width:auto!important;
  max-width:none!important;
  min-width:0!important;
  margin:0!important;
  margin-right:calc(var(--ua-layout-sidebar-w) + var(--ua-layout-gap))!important;
  margin-left:var(--ua-layout-gap)!important;
  padding:0!important;
  overflow-x:hidden!important;
}
body.ua-authed .ua-page{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  overflow-x:hidden!important;
}

/* Empty top rail: bounded to same content width, not over sidebar */
body.ua-authed .ua-topbar.ua-glass-topbar.ua-topbar-empty,
body.ua-authed header.ua-topbar.ua-topbar-v2.ua-glass-topbar.ua-topbar-empty{
  position:relative!important;
  display:block!important;
  top:auto!important;right:auto!important;left:auto!important;
  width:auto!important;
  max-width:none!important;
  min-width:0!important;
  height:var(--ua-layout-topbar-h)!important;
  min-height:var(--ua-layout-topbar-h)!important;
  max-height:var(--ua-layout-topbar-h)!important;
  margin:0!important;
  margin-right:calc(var(--ua-layout-sidebar-w) + var(--ua-layout-gap))!important;
  margin-left:var(--ua-layout-gap)!important;
  padding:0!important;
  overflow:hidden!important;
  z-index:60!important;
  pointer-events:none!important;
  border:0!important;
  border-radius:0 0 0 16px!important;
  background:linear-gradient(90deg,rgba(236,244,255,.28) 0%,rgba(122,146,174,.16) 42%,rgba(35,54,78,.07) 74%,rgba(6,18,34,0) 100%)!important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.22),0 6px 14px rgba(0,0,0,.045)!important;
  backdrop-filter:blur(12px) saturate(115%)!important;
  -webkit-backdrop-filter:blur(12px) saturate(115%)!important;
}
body.ua-authed .ua-topbar.ua-glass-topbar.ua-topbar-empty>*{display:none!important;}
body.ua-authed .ua-topbar.ua-glass-topbar.ua-topbar-empty::before{
  content:""!important;position:absolute!important;inset:0!important;border-radius:inherit!important;
  border-top:1px solid rgba(236,246,255,.26)!important;
  border-bottom:1px solid rgba(236,246,255,.10)!important;
  pointer-events:none!important;
}
body.ua-authed .ua-topbar.ua-glass-topbar.ua-topbar-empty::after{
  content:""!important;position:absolute!important;left:0!important;right:0!important;bottom:0!important;height:1px!important;
  background:linear-gradient(90deg,transparent,rgba(111,224,255,.28),rgba(255,214,82,.16),transparent)!important;
  opacity:.35!important;pointer-events:none!important;
}

/* Inner wrappers: never exceed available workspace */
body.ua-authed .content-wrapper,
body.ua-authed .ua-page>.content-wrapper,
body.ua-authed .ua-page>.container,
body.ua-authed .ua-page>.container-fluid{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  overflow-x:hidden!important;
  border-radius:0 0 24px 24px!important;
}
body.ua-authed .content,
body.ua-authed section.content{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0!important;
  padding:16px!important;
  overflow-x:hidden!important;
}
body.ua-authed .content-header,
body.ua-authed section.content-header{
  width:100%!important;
  max-width:100%!important;
  margin:0!important;
  padding:12px 16px 0!important;
  overflow:hidden!important;
}
body.ua-authed .row{
  margin-left:0!important;
  margin-right:0!important;
  max-width:100%!important;
}
body.ua-authed [class*="col-"]{
  min-width:0!important;
  padding-left:10px!important;
  padding-right:10px!important;
}

/* Window controls rail: same page width, not larger */
body.ua-authed .ua-close-strip{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  direction:ltr!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  margin:0 0 12px!important;
  padding:0!important;
  position:relative!important;
  z-index:70!important;
  overflow:hidden!important;
}
body.ua-authed .ua-close-float.ua-window-link,
body.ua-authed .ua-close-float{
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
  height:var(--ua-page-windowbar-h)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  padding:4px 9px!important;
  margin:0!important;
  border-radius:0 0 16px 16px!important;
  background:linear-gradient(90deg,rgba(9,23,43,.82),rgba(13,31,58,.48),rgba(255,255,255,.04))!important;
  border:1px solid rgba(255,255,255,.11)!important;
  border-top:0!important;
  box-shadow:0 10px 26px rgba(0,0,0,.14),inset 0 1px 0 rgba(255,255,255,.08)!important;
  backdrop-filter:blur(16px)!important;
  -webkit-backdrop-filter:blur(16px)!important;
}
.ua-close-float.ua-window-link .ua-close-label{display:none!important;}
.ua-window-controls{height:30px!important;display:inline-flex!important;align-items:center!important;gap:1px!important;direction:ltr!important;background:transparent!important;border-radius:12px!important;padding:0!important;}
.ua-window-btn{width:36px!important;height:28px!important;border:0!important;border-radius:9px!important;background:transparent!important;color:#dbe8fa!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;cursor:pointer!important;text-decoration:none!important;font-weight:500!important;line-height:1!important;transition:background .14s ease,color .14s ease,transform .14s ease!important;box-shadow:none!important;padding:0!important;}
.ua-window-btn:hover{background:rgba(255,255,255,.11)!important;color:#fff!important;}
.ua-window-close:hover{background:#e81123!important;color:#fff!important;}
.ua-window-btn:active{transform:scale(.96);}
.ua-window-close{font-size:18px!important;font-family:"Segoe UI",Arial,sans-serif!important;}
.ua-window-btn i{display:none!important;}
.ua-win11-min-icon,.ua-win11-max-icon{display:block;position:relative;width:12px!important;height:12px!important;}
.ua-win11-min-icon::before{content:"";position:absolute;left:1px;right:1px;bottom:3px;height:1.5px;border-radius:2px;background:currentColor;}
.ua-win11-max-icon::before{content:"";position:absolute;left:1px;top:1px;width:10px;height:10px;border:1.7px solid currentColor;border-radius:2px;}
.modal-header .ua-window-controls,.ua-secure-head .ua-window-controls{margin-inline-start:auto;}
.ua-secure-close.ua-hidden-by-window-controls,.btn-close.ua-hidden-by-window-controls{display:none!important;}

/* Footer follows the same workspace */
body.ua-authed .ua-footer{
  margin:0!important;
  margin-right:calc(var(--ua-layout-sidebar-w) + var(--ua-layout-gap))!important;
  margin-left:var(--ua-layout-gap)!important;
}
.ua-footer-inner{align-items:center!important;}
.ua-footer-right{min-width:0;flex:1 1 auto;}
.ua-footer-taskbar,#uaFooterTaskbar{display:inline-flex!important;align-items:center;gap:6px;flex-wrap:nowrap;margin-inline-start:10px;min-width:0;max-width:min(520px,45vw);overflow:hidden;vertical-align:middle;}
.ua-task-chip{position:relative;display:inline-flex;align-items:center;justify-content:center;width:42px!important;height:34px!important;min-width:42px!important;max-width:42px!important;border:1px solid rgba(255,214,94,.22)!important;background:linear-gradient(180deg,rgba(17,38,68,.72),rgba(9,20,38,.86))!important;border-radius:13px!important;box-shadow:0 10px 24px rgba(0,0,0,.18),inset 0 1px 0 rgba(255,255,255,.06)!important;backdrop-filter:blur(14px)!important;-webkit-backdrop-filter:blur(14px)!important;cursor:pointer;overflow:hidden!important;flex:0 0 42px!important;}
.ua-task-chip:hover{background:linear-gradient(180deg,rgba(30,60,96,.82),rgba(13,29,52,.9))!important;border-color:rgba(255,214,94,.42)!important;}
.ua-task-chip::after{content:"";position:absolute;bottom:3px;left:50%;transform:translateX(-50%);width:16px;height:2px;border-radius:4px;background:rgba(255,214,94,.85);}
.ua-task-open{width:100%;height:100%;border:0;background:transparent;color:#eef4ff;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0!important;}
.ua-task-open i{font-size:16px;}
.ua-task-open span,.ua-task-close,.ua-task-chip .ua-task-x{display:none!important;}
.ua-task-count{position:absolute;top:-6px;right:-6px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:#ffd64f;color:#0b1424;font-size:11px;font-weight:900;display:flex;align-items:center;justify-content:center;border:1px solid rgba(0,0,0,.22);}
.ua-task-menu{position:fixed;z-index:2147483100;min-width:190px;background:rgba(14,30,54,.96);border:1px solid rgba(255,214,94,.28);border-radius:14px;box-shadow:0 18px 46px rgba(0,0,0,.42);padding:7px;direction:rtl;text-align:right;backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px);}
.ua-task-menu-title{padding:7px 9px 9px;color:#fff;font-weight:900;max-width:240px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:5px;}
.ua-task-menu button{width:100%;border:0;background:transparent;color:#edf5ff;border-radius:10px;padding:9px 10px;display:flex;align-items:center;gap:8px;justify-content:flex-start;cursor:pointer;font-weight:800;}
.ua-task-menu button:hover{background:rgba(255,255,255,.09);}
.ua-task-menu button.ua-danger{color:#ffd0d0;}
.ua-task-menu button.ua-danger:hover{background:rgba(232,17,35,.22);color:#fff;}

/* Unified non-blocking feedback region: every page toast anchors here. */
.ua-feedback-stack,
.ua-toast-stack{
  position:fixed;
  left:22px;
  right:auto;
  top:auto;
  bottom:22px;
  z-index:2147483000;
  display:flex;
  width:min(520px,calc(100vw - 44px));
  flex-direction:column;
  align-items:stretch;
  gap:10px;
  margin:0;
  padding:0;
  transform:none;
  direction:rtl;
  pointer-events:none;
}
.ua-toast{min-width:260px;max-width:min(520px,calc(100vw - 44px));background:linear-gradient(135deg,rgba(10,24,44,.98),rgba(15,33,58,.98));color:#fff;border:1px solid rgba(255,210,82,.38);border-radius:16px;padding:12px 15px;box-shadow:0 16px 42px rgba(0,0,0,.42);font-weight:800;line-height:1.7;pointer-events:auto;transform:translateY(10px);opacity:0;transition:.22s ease;direction:rtl;text-align:right;}
.ua-toast.show{transform:translateY(0);opacity:1;}
.ua-toast-success{border-color:rgba(65,214,123,.55);box-shadow:0 16px 42px rgba(0,0,0,.42),inset 4px 0 0 rgba(65,214,123,.9);}
.ua-toast-error{border-color:rgba(255,75,90,.6);box-shadow:0 16px 42px rgba(0,0,0,.42),inset 4px 0 0 rgba(255,75,90,.95);}
.ua-toast-warning{border-color:rgba(255,202,59,.75);box-shadow:0 16px 42px rgba(0,0,0,.42),inset 4px 0 0 rgba(255,202,59,.95);}
.ua-toast-info{box-shadow:0 16px 42px rgba(0,0,0,.42),inset 4px 0 0 rgba(75,170,255,.95);}

/* Maximized */
body.ua-page-maximized .ua-topbar,
body.ua-page-maximized .ua-sb3,
body.ua-page-maximized .ua-footer{display:none!important;}
body.ua-page-maximized .ua-main,
body.ua-page-maximized .content-wrapper,
body.ua-page-maximized .ua-page{margin:0!important;max-width:none!important;width:100%!important;padding:0!important;}

@media(max-width:992px){
  :root{--ua-layout-sidebar-w:238px;--ua-layout-gap:12px;--ua-layout-topbar-h:24px;}
  body.ua-authed .ua-sb3{transform:translateX(100%)!important;transition:transform .2s ease!important;}
  body.ua-mobile-sb-open .ua-sb3{transform:translateX(0)!important;}
  body.ua-authed .ua-main,
  body.ua-authed .ua-topbar.ua-glass-topbar.ua-topbar-empty,
  body.ua-authed header.ua-topbar.ua-topbar-v2.ua-glass-topbar.ua-topbar-empty,
  body.ua-authed .ua-footer{margin-right:0!important;margin-left:0!important;}
  body.ua-authed .content,body.ua-authed section.content{padding:12px!important;}
  body.ua-authed [class*="col-"]{padding-left:6px!important;padding-right:6px!important;}
  .ua-footer-taskbar,#uaFooterTaskbar{max-width:44vw;}
  .ua-window-btn{width:34px!important;height:28px!important;}
  .ua-feedback-stack,.ua-toast-stack{left:12px;right:12px;bottom:14px;width:auto;}
  .ua-toast{max-width:none;width:100%;}
}

/* ===== UA TOPBAR EDGE VISIBILITY FIX =====
   Only visual spacing for the upper rails. Does not change sidebar/content width. */
body.ua-authed .ua-topbar.ua-glass-topbar.ua-topbar-empty,
body.ua-authed header.ua-topbar.ua-topbar-v2.ua-glass-topbar.ua-topbar-empty{
  height:50px!important;
  min-height:50px!important;
  max-height:50px!important;
  margin-top:8px!important;
  margin-bottom:8px!important;
  border-radius:16px!important;
  overflow:visible!important;
  background:linear-gradient(90deg,rgba(236,244,255,.30) 0%,rgba(122,146,174,.18) 42%,rgba(35,54,78,.08) 74%,rgba(6,18,34,.02) 100%)!important;
}
body.ua-authed .ua-topbar.ua-glass-topbar.ua-topbar-empty::before{
  border-radius:16px!important;
  border:1px solid rgba(236,246,255,.20)!important;
}
body.ua-authed .ua-topbar.ua-glass-topbar.ua-topbar-empty::after{
  left:14px!important;
  right:14px!important;
  bottom:0!important;
}
body.ua-authed .ua-close-strip{
  margin-top:0!important;
}
body.ua-authed .ua-close-float.ua-window-link,
body.ua-authed .ua-close-float{
  border-radius:16px!important;
  border-top:1px solid rgba(255,255,255,.11)!important;
}

/* 2026-05-19: window controls order for child/modal pages.
   The close button must be the first physical button from the left. */
body.ua-authed .ua-window-controls{
  direction:ltr!important;
  flex-direction:row!important;
}
body.ua-authed .ua-window-controls .ua-window-close{order:1!important;}
body.ua-authed .ua-window-controls .ua-window-max{order:2!important;}
body.ua-authed .ua-window-controls .ua-window-min{order:3!important;}
body.ua-authed :where(.modal-header,.ua-secure-head) .ua-window-controls{
  order:-999!important;
  margin-left:0!important;
  margin-right:auto!important;
  margin-inline-start:0!important;
  margin-inline-end:auto!important;
}


/* 2026-05-20 - Unified protection-style dialog messages across the program. */
.ua-global-dialog-open{overflow:hidden!important;}
.ua-global-dialog-backdrop{
  position:fixed!important;
  inset:0!important;
  z-index:2147483600!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:18px!important;
  direction:rtl!important;
  background:rgba(2,18,22,.34)!important;
  -webkit-backdrop-filter:blur(2px)!important;
  backdrop-filter:blur(2px)!important;
}
.ua-global-dialog-card{
  width:min(460px,96vw)!important;
  border-radius:24px!important;
  background:rgba(244,252,250,.97)!important;
  color:#102a2d!important;
  border:1px solid rgba(153,246,228,.58)!important;
  box-shadow:0 28px 80px rgba(2,28,34,.34)!important;
  padding:20px!important;
  box-sizing:border-box!important;
  overflow:hidden!important;
  font-family:Tahoma,Arial,sans-serif!important;
  text-align:right!important;
}
.ua-global-dialog-icon{
  width:48px!important;
  height:48px!important;
  margin:0 auto 12px!important;
  border-radius:14px!important;
  background:linear-gradient(135deg,#5eead4,#187577)!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  color:#fff!important;
  font-size:22px!important;
  box-shadow:0 12px 28px rgba(24,117,119,.28)!important;
}
.ua-global-dialog-title{
  margin:0 0 12px!important;
  text-align:center!important;
  font-size:18px!important;
  line-height:1.45!important;
  font-weight:950!important;
  color:transparent!important;
  background:linear-gradient(90deg,#12686a,#1b8178)!important;
  -webkit-background-clip:text!important;
  background-clip:text!important;
}
.ua-global-dialog-message{
  color:#29464a!important;
  font-size:15px!important;
  line-height:1.9!important;
  font-weight:800!important;
  max-height:min(52vh,360px)!important;
  overflow:auto!important;
  padding-inline:2px!important;
}
.ua-global-dialog-message b,
.ua-global-dialog-message strong{color:#12686a!important;font-weight:950!important;}
.ua-global-dialog-message ul{margin:8px 0 0!important;padding-inline-start:22px!important;}
.ua-global-dialog-actions{
  display:flex!important;
  flex-direction:row-reverse!important;
  gap:8px!important;
  margin-top:16px!important;
}
.ua-global-dialog-btn{
  flex:1!important;
  min-width:0!important;
  height:42px!important;
  border:0!important;
  border-radius:14px!important;
  padding:0 18px!important;
  font-size:14px!important;
  font-weight:950!important;
  cursor:pointer!important;
  font-family:inherit!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
}
.ua-global-dialog-cancel{
  background:#eef6f4!important;
  color:#29464a!important;
  box-shadow:0 3px 10px rgba(15,23,42,.05)!important;
}
.ua-global-dialog-cancel:hover{background:#dcefed!important;}
.ua-global-dialog-ok{
  background:linear-gradient(90deg,#27c8b6,#187577)!important;
  color:#fff!important;
  box-shadow:0 10px 30px rgba(24,117,119,.24)!important;
}
.ua-global-dialog-ok:hover{filter:saturate(1.04) brightness(.98)!important;}
.ua-global-dialog-danger .ua-global-dialog-icon{background:linear-gradient(135deg,#f59e0b,#dc2626)!important;}
.ua-global-dialog-alert .ua-global-dialog-icon{background:linear-gradient(135deg,#60a5fa,#187577)!important;}
@media(max-width:640px){
  .ua-global-dialog-card{padding:16px!important;border-radius:20px!important;}
  .ua-global-dialog-title{font-size:17px!important;}
  .ua-global-dialog-message{font-size:14px!important;}
}
