/* THRS Ultra Premium P2 — Navigation & Shell
   Layout Locked. Static visual rules only: no geometry, DOM or permission changes.
   Navy/gold Tamiyouz identity; dark/light, RTL/LTR, mobile and reduced motion.
   Source of truth: THRS Live header/aside classNames (no broad global overrides).
*/
.thrs-shell {
  --p2-header-surface: rgba(255,255,255,.97);
  --p2-header-ink: #132e51;
  --p2-header-muted: #53677e;
  --p2-control-surface: #f7f9fd;
  --p2-control-border: #c3cfdd;
  --p2-control-hover: #e8eef7;
  --p2-control-shadow: 0 3px 9px rgba(12,38,73,.055),0 10px 25px rgba(12,38,73,.045);
  --p2-gold: #a27c27;
  --p2-accent-ring: 0 0 0 3px rgba(184,144,50,.3);
  --p2-side-text: #e4edf9;
  --p2-side-muted: #bacce2;
  --p2-side-bright: #fff;
}
[data-theme="dark"] .thrs-shell {
  --p2-header-surface: rgba(8,22,42,.97);
  --p2-header-ink: #eff6ff;
  --p2-header-muted: #b7c9de;
  --p2-control-surface: #142b49;
  --p2-control-border: #4d6581;
  --p2-control-hover: #203c5f;
  --p2-control-shadow: 0 4px 14px rgba(0,0,0,.27);
  --p2-gold: #e3ba63;
  --p2-accent-ring: 0 0 0 3px rgba(225,185,93,.35);
}
/* Translucent premium header: text and controls remain readable in both modes. */
.thrs-shell > .thrs-header {
  background: var(--p2-header-surface) !important;
  border-bottom-color: rgba(163,131,58,.28) !important;
  box-shadow: 0 2px 2px rgba(13,40,78,.024),0 10px 30px rgba(13,40,78,.08) !important;
}
[data-theme="dark"] .thrs-shell > .thrs-header {
  box-shadow: 0 10px 36px rgba(0,0,0,.29) !important;
}
.thrs-shell > .thrs-header .thrs-header-brand h1,
.thrs-shell > .thrs-header .thrs-header-user-name {
  color: var(--p2-header-ink) !important;
}
.thrs-shell > .thrs-header .thrs-header-user-role {
  color: var(--p2-header-muted) !important;
}
.thrs-shell > .thrs-header .thrs-brand-logo {
  border-color: var(--p2-control-border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05),0 2px 10px rgba(20,39,71,.085);
}
/* Theme/language/menu/notification controls — preserve sizes and click areas. */
.thrs-shell > .thrs-header .thrs-header-controls > button,
.thrs-shell > .thrs-header .thrs-header-controls .touch-target,
.thrs-shell > .thrs-header .thrs-icon-button {
  color: var(--p2-header-ink) !important;
  border-color: var(--p2-control-border) !important;
  box-shadow: var(--p2-control-shadow) !important;
}
.thrs-shell > .thrs-header .thrs-header-controls > button:hover:not(:disabled),
.thrs-shell > .thrs-header .thrs-header-controls .touch-target:hover:not(:disabled),
.thrs-shell > .thrs-header .thrs-icon-button:hover:not(:disabled) {
  border-color: var(--p2-gold) !important;
  box-shadow: var(--p2-control-shadow),0 0 0 1px rgba(192,153,57,.14) !important;
}
.thrs-shell > .thrs-header :is(button,a):focus-visible {
  outline: 2px solid var(--p2-gold) !important;
  outline-offset: 3px;
  box-shadow: var(--p2-accent-ring) !important;
}
.thrs-shell > .thrs-header .thrs-logout-btn {
  color: var(--p2-header-ink) !important;
  border-color: var(--p2-control-border) !important;
  background-color: var(--p2-control-surface) !important;
}
.thrs-shell > .thrs-header .thrs-logout-btn:hover:not(:disabled) {
  color: var(--p2-header-ink) !important;
  background-color: var(--p2-control-hover) !important;
  border-color: var(--p2-gold) !important;
}
/* Left/right sidebar retains existing width, links, scroll and group placement. */
.thrs-shell > .thrs-sidebar,
.thrs-shell > .sidebar {
  border-inline-end-color: rgba(209,180,107,.24);
}
.thrs-shell .thrs-sidebar-section-label {
  color: var(--p2-side-muted) !important;
  opacity: 1 !important;
}
.thrs-shell .thrs-sidebar-section-label::after {
  background: linear-gradient(90deg,rgba(223,194,126,.30),rgba(223,194,126,.04));
}
[dir="rtl"] .thrs-shell .thrs-sidebar-section-label::after {
  background: linear-gradient(270deg,rgba(223,194,126,.30),rgba(223,194,126,.04));
}
.thrs-shell .thrs-sidebar-link {
  color: var(--p2-side-text) !important;
  border-color: transparent !important;
  transition: background-color .18s ease,color .18s ease,
              border-color .18s ease,box-shadow .18s ease !important;
}
.thrs-shell .thrs-sidebar-link .thrs-sidebar-link-label {
  color: inherit !important;
  opacity: 1;
}
.thrs-shell .thrs-sidebar-link:hover {
  color: var(--p2-side-bright) !important;
  background: rgba(255,255,255,.105) !important;
  border-color: rgba(227,186,99,.33) !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02) !important;
}
.thrs-shell .thrs-sidebar-link.sidebar-active-link,
.thrs-shell .thrs-sidebar-link[aria-current="page"] {
  color: #fff !important;
  background: linear-gradient(110deg,rgba(255,255,255,.17),rgba(188,140,42,.17)) !important;
  border-color: rgba(230,193,111,.64) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.10),0 8px 22px rgba(0,0,0,.21) !important;
}
.thrs-shell .thrs-sidebar-link.sidebar-active-link::before {
  background: #e6c574 !important;
  box-shadow: 0 0 12px rgba(228,190,98,.39);
}
.thrs-shell .thrs-sidebar-link:focus-visible {
  outline: 2px solid #e6c574 !important;
  outline-offset: -2px;
  color: #fff !important;
}
.thrs-shell .thrs-sidebar-link :is(svg,.thrs-modern-icon-wrap) {
  color: inherit;
  opacity: 1;
}
.thrs-shell .thrs-sidebar .thrs-sidebar-divider {
  background-color: rgba(229,199,132,.23);
}
/* Footers and secondary guidance must remain legible over navy surfaces. */
.thrs-shell .thrs-sidebar-footer {
  border-color: rgba(223,190,113,.28) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.055);
}
.thrs-shell .thrs-sidebar-footer-toggle :is(strong,small),
.thrs-shell .thrs-sidebar-footer-quote-ar {
  color: var(--p2-side-text) !important;
}
.thrs-shell .thrs-sidebar-footer-toggle:hover {
  background: rgba(255,255,255,.095) !important;
}
.thrs-shell .thrs-sidebar-footer-toggle:focus-visible {
  outline: 2px solid #e6c574 !important;
  outline-offset: 2px;
}
.thrs-shell .thrs-sidebar-overlay {
  background: rgba(4,12,23,.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
/* Keyboard and motion safety, independent of direction / viewport size. */
@media (prefers-reduced-motion: reduce) {
  .thrs-shell :is(.thrs-sidebar-link,.thrs-sidebar-link svg,.thrs-header button) {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
  .thrs-shell .thrs-sidebar-overlay { backdrop-filter: none; -webkit-backdrop-filter: none; }
}
@media (forced-colors: active) {
  .thrs-shell .thrs-sidebar-link.sidebar-active-link { outline: 2px solid Highlight; }
  .thrs-shell .thrs-header button { border: 1px solid ButtonText !important; }
}
