/* layout.css — app shell, sidebar modes, topbar, page */

.app {
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Chrome (topbar + sidebar) sits on card; content sheet uses ground */
  background: var(--surface-card);
  color: var(--text);
}

.app-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  background: var(--surface-card);
  overflow: hidden;
}

/* Topbar host — sticky chrome */
#app-topbar-host {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  flex-shrink: 0;
}

.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--topbar-height);
  padding: 0 var(--space-4);
  background: var(--surface-card);
  border-bottom: 0;
  box-shadow: none;
}

.topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 600;
  font-size: var(--font-size-lg);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  order: 0;
}

.topbar-brand-logo {
  display: block;
  object-fit: contain;
  flex-shrink: 0;
}

/* Desktop: full Easy Payroll wordmark */
.topbar-brand-logo--full {
  height: 2.625rem;
  width: auto;
  max-width: min(14rem, 100%);
  border-radius: 4px;
}

.topbar-brand-logo--mark {
  display: none;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 4px;
}

@media (max-width: 991.98px) {
  .topbar-brand-logo--full {
    display: none !important;
  }

  .topbar-brand-logo--mark {
    display: block !important;
  }
}

/* Menu toggle: mobile always; desktop Static only */
.topbar-menu-toggle {
  display: inline-flex;
  order: 1;
  width: 3.25rem;
  height: 3.25rem;
}

.topbar-search {
  display: none;
  flex: 0 1 16rem;
  width: 16rem;
  max-width: 16rem;
}

.topbar-search input {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-ground);
  color: var(--text);
  font: inherit;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-left: auto;
  order: 2;
}

.topbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.topbar-btn:hover {
  background: var(--surface-hover);
}

.topbar-btn.topbar-btn-primary {
  background: transparent;
  color: var(--primary);
}

.topbar-btn.topbar-btn-primary:hover,
.topbar-btn.topbar-btn-primary:focus-visible {
  background: var(--surface-hover);
  color: var(--primary-hover);
}

.topbar-btn:focus-visible {
  background: var(--surface-hover);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.topbar-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.topbar-btn i {
  font-size: 1.125rem;
  line-height: 1;
}

.topbar-menu-toggle .topbar-menu-icon {
  width: 2.5rem;
  height: 2.5rem;
}

.topbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  max-width: min(28vw, 22rem);
  height: 2.25rem;
  padding: 0 var(--space-2) 0 var(--space-1);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.topbar-user-btn:hover {
  background: var(--surface-hover);
}

.topbar-user-btn:focus-visible {
  background: var(--surface-hover);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.topbar-user-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.topbar-user-name {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-sm);
  font-weight: 500;
}

.topbar-user-caret {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  opacity: 0.7;
}

.topbar-dropdown {
  position: relative;
}

.topbar-dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 14rem;
  padding: var(--space-2);
  background: var(--surface-overlay);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-0.35rem);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0.18s;
}

.topbar-dropdown.is-open .topbar-dropdown-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.topbar-dropdown-menu[hidden] {
  display: none !important;
}

.topbar-dropdown-menu a,
.topbar-dropdown-menu button {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

/* Icon buttons inside menus must not inherit the full-width menu-item rule */
.topbar-dropdown-menu .topbar-btn,
.topbar-dropdown-menu button.topbar-btn,
.topbar-dropdown-menu button.topbar-btn-sm {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  padding: 0;
  flex: 0 0 auto;
  gap: 0;
  justify-content: center;
  text-align: center;
}

.topbar-dropdown-menu .topbar-btn:hover,
.topbar-dropdown-menu button.topbar-btn:hover,
.topbar-dropdown-menu button.topbar-btn-sm:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.topbar-dropdown-menu a:hover,
.topbar-dropdown-menu button:hover {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-hover));
  color: var(--primary);
}

.topbar-dropdown-menu a svg,
.topbar-dropdown-menu button svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  opacity: 0.75;
}

.topbar-btn--badge {
  position: relative;
  overflow: visible;
}

.topbar-badge {
  position: absolute;
  top: 0.1rem;
  right: 0.08rem;
  z-index: 1;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--danger, #ef4444);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  line-height: 1rem;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 0 0 2px var(--surface-card);
}

.topbar-badge[hidden] {
  display: none !important;
}

/* User menu */
.topbar-dropdown-menu--user {
  min-width: min(22rem, calc(100vw - 1.5rem));
  padding: var(--space-2);
  gap: 0.15rem;
}

.topbar-menu-sep {
  height: 1px;
  margin: var(--space-1) var(--space-2);
  background: var(--border);
}

.topbar-menu-item {
  font-size: var(--font-size-sm);
}

.topbar-menu-item--danger {
  color: var(--danger, #ef4444);
}

.topbar-menu-item--danger:hover {
  background: color-mix(in srgb, var(--danger, #ef4444) 12%, var(--surface-hover));
  color: var(--danger, #ef4444);
}

.topbar-menu-item--danger svg {
  opacity: 0.9;
}

/* Notifications dropdown */
.topbar-dropdown-menu--notifications {
  min-width: 19rem;
  max-width: min(22rem, calc(100vw - 1.5rem));
  padding: 0;
  gap: 0;
  overflow: hidden;
}

.topbar-dropdown-menu--notifications.is-empty {
  padding: var(--space-5) var(--space-4);
}

.topbar-dropdown-menu--notifications.is-empty .topbar-notif-head,
.topbar-dropdown-menu--notifications.is-empty .topbar-notif-list,
.topbar-dropdown-menu--notifications.is-empty .topbar-notif-view-all {
  display: none !important;
}

.topbar-dropdown-menu--notifications.is-empty .topbar-notif-empty {
  display: flex;
}

.topbar-notif-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0.55rem 0.85rem;
  border-bottom: 0;
}

.topbar-notif-head::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--border);
  pointer-events: none;
}

.topbar-notif-head-row {
  display: contents;
}

.topbar-notif-head-title {
  font-size: var(--font-size-sm);
  font-weight: 650;
  color: var(--text);
  line-height: 1.25;
}

/* Match static/overlay sidebar icon tile + hover */
.topbar-dropdown-menu--notifications .topbar-notif-refresh,
.topbar-dropdown-menu--notifications button.topbar-notif-refresh {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2rem !important;
  height: 2rem !important;
  min-width: 2rem !important;
  max-width: 2rem !important;
  padding: 0 !important;
  flex: 0 0 2rem !important;
  gap: 0 !important;
  border: 0 !important;
  border-radius: var(--radius-sm) !important;
  background: var(--surface-hover) !important;
  color: var(--sidebar-icon, var(--text-muted)) !important;
  box-shadow: none !important;
  transition: background 0.15s ease, color 0.15s ease;
}

.topbar-dropdown-menu--notifications .topbar-notif-refresh svg {
  width: 1rem !important;
  height: 1rem !important;
  opacity: 1 !important;
}

.topbar-dropdown-menu--notifications .topbar-notif-refresh:hover,
.topbar-dropdown-menu--notifications button.topbar-notif-refresh:hover,
.topbar-dropdown-menu--notifications .topbar-notif-refresh:focus-visible,
.topbar-dropdown-menu--notifications button.topbar-notif-refresh:focus-visible {
  /* Same as html[data-menu=static|overlay] .sidebar-item:hover > i.fa */
  background: color-mix(in srgb, var(--primary) 16%, transparent) !important;
  color: var(--primary) !important;
}

.topbar-notif-list {
  list-style: none;
  margin: 0;
  padding: var(--space-2) !important; /* beat _Layout bridge zero-padding */
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.topbar-notif-item {
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: inherit;
}

.topbar-notif-item:hover {
  color: inherit;
}

.topbar-notif-item.is-unread {
  background: color-mix(in srgb, var(--primary) 6%, transparent);
}

.topbar-notif-item.is-unread:hover {
  background: color-mix(in srgb, var(--primary) 12%, var(--surface-hover));
}

.topbar-notif-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

.topbar-notif-icon svg,
.topbar-notif-icon i.fa,
.topbar-notif-icon i.fas {
  width: 1.1rem;
  height: 1.1rem;
  font-size: 0.95rem;
  opacity: 1;
}

.topbar-notif-icon--success {
  background: color-mix(in srgb, var(--success, #22c55e) 14%, transparent);
  color: var(--success, #16a34a);
}

.topbar-notif-icon--warn {
  background: color-mix(in srgb, var(--warning, #f59e0b) 14%, transparent);
  color: var(--warning, #f59e0b);
}

.topbar-notif-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-notif-text {
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text);
  line-height: 1.35;
}

.topbar-notif-time {
  font-size: var(--font-size-xs, 0.8125rem);
  color: var(--text-muted);
  line-height: 1.3;
}

/* Billing alert counts — trailing pill, not a timestamp under the label */
.topbar-notif-count {
  flex: 0 0 auto;
  margin-left: auto;
  min-width: 1.5rem;
  height: 1.35rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  background: color-mix(in srgb, var(--danger, #ef4444) 14%, transparent);
  color: var(--danger, #ef4444);
}

.topbar-notif-item:hover .topbar-notif-count {
  background: color-mix(in srgb, var(--danger, #ef4444) 18%, transparent);
  color: var(--danger, #ef4444);
}

.topbar-notif-view-all {
  justify-content: center;
  margin-top: var(--space-1);
  padding-block: var(--space-2);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--primary);
}

.topbar-notif-view-all:hover {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  color: var(--primary);
}

.topbar-notif-empty {
  display: none;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
}

.topbar-notif-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: var(--space-1);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
}

.topbar-notif-empty-icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.topbar-notif-empty-title {
  margin: 0;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.topbar-notif-empty-msg {
  margin: 0;
  font-size: var(--font-size-xs, 0.8125rem);
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 12rem;
}

.topbar-dropdown-empty {
  margin: 0;
  padding: var(--space-3);
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  text-align: center;
}

/* Sidebar — mobile: fixed off-canvas, below topbar (not full page) */
#app-sidebar-host {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  z-index: var(--z-overlay);
  width: var(--sidebar-width);
  max-width: 85vw;
  height: calc(100vh - var(--topbar-height));
  height: calc(100dvh - var(--topbar-height));
  transform: translateX(-100%);
  transition: transform 0.2s ease;
  background: var(--sidebar-bg, var(--surface-card));
  border-right: 0;
  box-shadow: none;
  overflow-y: auto;
}

#app-sidebar-host.is-open,
.sidebar.is-open {
  transform: translateX(0);
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  height: 100%;
  color: var(--sidebar-item, var(--text));
}

.sidebar-nav {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--space-3) var(--space-2);
  overflow-x: hidden;
  overflow-y: auto;
}

.sidebar-group {
  margin-bottom: var(--space-4);
}

.sidebar-group-label {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.85;
}

.sidebar-menu,
.sidebar-menu ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-menu > li + li {
  margin-top: var(--space-1);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-1) var(--space-2) var(--space-1);
  border-radius: var(--radius-md);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.sidebar-item > i.fa,
.sidebar-item > i.fas,
.sidebar-item > i.far,
.sidebar-item > .fa {
  flex: 0 0 auto;
  width: 1.25rem;
  text-align: center;
  font-size: 0.95rem;
  color: var(--sidebar-icon, var(--text-muted));
  opacity: 1;
  transition: color 0.15s ease;
}

.sidebar-item.is-active > i.fa,
.sidebar-item.is-active > i.fas,
.sidebar-item.is-active > i.far,
.sidebar-item[aria-current="page"] > i.fa,
.sidebar-item[aria-current="page"] > i.fas,
.sidebar-item[aria-current="page"] > i.far {
  color: var(--sidebar-item-active, var(--primary));
}

.sidebar-item:hover,
.sidebar-item:focus-visible {
  background: var(--surface-hover);
  color: var(--sidebar-item-active, var(--primary));
}

.sidebar-item:hover > i.fa,
.sidebar-item:hover > i.fas,
.sidebar-item:hover > i.far,
.sidebar-item:hover > .fa,
.sidebar-item:focus-visible > i.fa,
.sidebar-item:focus-visible > i.fas,
.sidebar-item:focus-visible > i.far,
.sidebar-item:focus-visible > .fa,
.sidebar-item:hover > svg,
.sidebar-item:focus-visible > svg {
  color: var(--sidebar-item-active, var(--primary));
}

.sidebar-item:hover > .badge,
.sidebar-item:focus-visible > .badge {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
}

.sidebar-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.sidebar-item.is-active,
.sidebar-item[aria-current="page"] {
  color: var(--sidebar-item-active, var(--primary));
  background: var(--surface-hover);
  font-weight: 600;
}

.sidebar-item.is-active > .badge,
.sidebar-item[aria-current="page"] > .badge {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
}

.sidebar-item svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.sidebar-item-label {
  flex: 1 1 auto;
  min-width: 0;
}

/* Count badge sits on the trailing edge; chevron follows when present */
.sidebar-item > .badge {
  margin-left: auto;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

/* Parent with nested menu — trailing chevron flush to menu edge */
.sidebar-item[aria-expanded]::after {
  content: "";
  width: 0.875rem;
  height: 0.875rem;
  margin-left: auto;
  flex-shrink: 0;
  background-color: currentColor;
  opacity: 0.55;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  transform: rotate(-90deg);
  transition: transform 0.2s ease, opacity 0.15s ease, color 0.15s ease;
}

.sidebar-item[aria-expanded]:has(> .badge)::after {
  margin-left: var(--space-2);
}

.sidebar-item[aria-expanded="true"]::after {
  transform: rotate(0deg);
  opacity: 0.8;
}

/* Dashboard has no count — hide legacy badge if still in markup */
#OpenDashboardPage > .badge,
#spnTxtDashboardCount {
  display: none !important;
}

.sidebar-menu ul {
  /* Light indent under parent */
  margin-left: var(--space-3);
  padding-left: 0;
  border-left: 0;
}

.sidebar-menu ul .sidebar-item {
  font-size: var(--font-size-sm);
  padding-block: var(--space-1);
}

html[data-menu="static"] .sidebar-nav,
html[data-menu="overlay"] .sidebar-nav {
  padding: var(--space-3) var(--space-2);
}

html[data-menu="static"] .sidebar-group-label,
html[data-menu="overlay"] .sidebar-group-label {
  padding: 0.35rem 0.4rem 0.55rem;
  font-size: 0.6875rem;
  letter-spacing: 0.07em;
  opacity: 0.7;
}

html[data-menu="static"] .sidebar-menu > li + li,
html[data-menu="overlay"] .sidebar-menu > li + li {
  margin-top: 0.2rem;
}

html[data-menu="static"] .sidebar-item,
html[data-menu="overlay"] .sidebar-item {
  gap: 0.4rem;
  padding: 0.5rem 0.35rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  font-weight: 500;
  line-height: 1.3;
  transition: background 0.15s ease, color 0.15s ease;
}

html[data-menu="static"] .sidebar-item > i.fa,
html[data-menu="static"] .sidebar-item > i.fas,
html[data-menu="static"] .sidebar-item > i.far,
html[data-menu="static"] .sidebar-item > .fa,
html[data-menu="overlay"] .sidebar-item > i.fa,
html[data-menu="overlay"] .sidebar-item > i.fas,
html[data-menu="overlay"] .sidebar-item > i.far,
html[data-menu="overlay"] .sidebar-item > .fa {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  color: var(--sidebar-icon, var(--text-muted));
  transition: background 0.15s ease, color 0.15s ease;
}

html[data-menu="static"] .sidebar-item > svg,
html[data-menu="overlay"] .sidebar-item > svg {
  width: 2rem;
  height: 2rem;
  padding: 0.35rem;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
}

html[data-menu="static"] .sidebar-item:hover,
html[data-menu="overlay"] .sidebar-item:hover,
html[data-menu="static"] .sidebar-item:focus-visible,
html[data-menu="overlay"] .sidebar-item:focus-visible {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
}

html[data-menu="static"] .sidebar-item:hover > i.fa,
html[data-menu="static"] .sidebar-item:hover > i.fas,
html[data-menu="static"] .sidebar-item:hover > i.far,
html[data-menu="static"] .sidebar-item:hover > .fa,
html[data-menu="static"] .sidebar-item:focus-visible > i.fa,
html[data-menu="static"] .sidebar-item:focus-visible > i.fas,
html[data-menu="static"] .sidebar-item:focus-visible > i.far,
html[data-menu="static"] .sidebar-item:focus-visible > .fa,
html[data-menu="overlay"] .sidebar-item:hover > i.fa,
html[data-menu="overlay"] .sidebar-item:hover > i.fas,
html[data-menu="overlay"] .sidebar-item:hover > i.far,
html[data-menu="overlay"] .sidebar-item:hover > .fa,
html[data-menu="overlay"] .sidebar-item:focus-visible > i.fa,
html[data-menu="overlay"] .sidebar-item:focus-visible > i.fas,
html[data-menu="overlay"] .sidebar-item:focus-visible > i.far,
html[data-menu="overlay"] .sidebar-item:focus-visible > .fa {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
}

html[data-menu="static"] .sidebar-item:hover > svg,
html[data-menu="static"] .sidebar-item:focus-visible > svg,
html[data-menu="overlay"] .sidebar-item:hover > svg,
html[data-menu="overlay"] .sidebar-item:focus-visible > svg {
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
}

html[data-menu="static"] .sidebar-item.is-active,
html[data-menu="static"] .sidebar-item[aria-current="page"],
html[data-menu="overlay"] .sidebar-item.is-active,
html[data-menu="overlay"] .sidebar-item[aria-current="page"] {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  box-shadow: none;
  font-weight: 600;
}

html[data-menu="static"] .sidebar-item.is-active > i.fa,
html[data-menu="static"] .sidebar-item.is-active > i.fas,
html[data-menu="static"] .sidebar-item.is-active > i.far,
html[data-menu="static"] .sidebar-item.is-active > .fa,
html[data-menu="static"] .sidebar-item[aria-current="page"] > i.fa,
html[data-menu="static"] .sidebar-item[aria-current="page"] > i.fas,
html[data-menu="static"] .sidebar-item[aria-current="page"] > i.far,
html[data-menu="overlay"] .sidebar-item.is-active > i.fa,
html[data-menu="overlay"] .sidebar-item.is-active > i.fas,
html[data-menu="overlay"] .sidebar-item.is-active > i.far,
html[data-menu="overlay"] .sidebar-item.is-active > .fa,
html[data-menu="overlay"] .sidebar-item[aria-current="page"] > i.fa,
html[data-menu="overlay"] .sidebar-item[aria-current="page"] > i.fas,
html[data-menu="overlay"] .sidebar-item[aria-current="page"] > i.far {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
}

html[data-menu="static"] .sidebar-item.is-active > svg,
html[data-menu="static"] .sidebar-item[aria-current="page"] > svg,
html[data-menu="overlay"] .sidebar-item.is-active > svg,
html[data-menu="overlay"] .sidebar-item[aria-current="page"] > svg {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
}

html[data-menu="static"] .sidebar-item-label,
html[data-menu="overlay"] .sidebar-item-label {
  letter-spacing: 0.01em;
}

html[data-menu="static"] .sidebar-menu ul,
html[data-menu="overlay"] .sidebar-menu ul {
  margin-left: 0.85rem;
  margin-top: 0.15rem;
  padding-left: 0;
  border-left: 0;
}

html[data-menu="static"] .sidebar-menu ul .sidebar-item,
html[data-menu="overlay"] .sidebar-menu ul .sidebar-item {
  gap: 0.35rem;
  padding: 0.4rem 0.3rem;
  font-size: var(--font-size-xs);
  font-weight: 500;
}

html[data-menu="static"] .sidebar-menu ul .sidebar-item > i.fa,
html[data-menu="static"] .sidebar-menu ul .sidebar-item > i.fas,
html[data-menu="static"] .sidebar-menu ul .sidebar-item > i.far,
html[data-menu="static"] .sidebar-menu ul .sidebar-item > .fa,
html[data-menu="overlay"] .sidebar-menu ul .sidebar-item > i.fa,
html[data-menu="overlay"] .sidebar-menu ul .sidebar-item > i.fas,
html[data-menu="overlay"] .sidebar-menu ul .sidebar-item > i.far,
html[data-menu="overlay"] .sidebar-menu ul .sidebar-item > .fa {
  width: 1.55rem;
  height: 1.55rem;
  font-size: 0.85rem;
}

html[data-menu="static"] .sidebar-menu ul .sidebar-item > svg,
html[data-menu="overlay"] .sidebar-menu ul .sidebar-item > svg {
  width: 1.55rem;
  height: 1.55rem;
  padding: 0.25rem;
  box-sizing: border-box;
  border-radius: var(--radius-sm);
  background: var(--surface-hover);
  color: var(--sidebar-icon, var(--text-muted));
}

.sidebar-flyout,
.sidebar-panel {
  display: none;
  position: fixed;
  z-index: calc(var(--z-overlay) + 1);
  background: var(--sidebar-bg, var(--surface-card));
  border: 1px solid var(--sidebar-border, var(--border));
  box-shadow: var(--shadow-md);
  color: var(--sidebar-item, var(--text));
}

.sidebar-flyout.is-open,
.sidebar-panel.is-open {
  display: block;
}

.sidebar-flyout {
  left: var(--sidebar-width-slim);
  min-width: 12rem;
  max-width: 18rem;
  padding: var(--space-2);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-left: 0;
}

html[data-menu="slimplus"] .sidebar-flyout {
  left: var(--sidebar-width-slimplus);
}

.sidebar-flyout-title {
  padding: var(--space-2) var(--space-3);
  font-weight: 600;
  font-size: var(--font-size-sm);
}

.sidebar-flyout-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-flyout .sidebar-item {
  justify-content: flex-start;
  flex-direction: row;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  text-align: left;
}

.sidebar-flyout .sidebar-item-label {
  position: static !important;
  display: inline;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0;
  overflow: visible !important;
  clip: auto !important;
  clip-path: none !important;
  white-space: normal !important;
  font-size: var(--font-size-sm);
  font-weight: 500;
  letter-spacing: normal;
  text-align: left;
  text-overflow: unset;
}

html[data-menu="slim"] .sidebar-flyout .sidebar-item:hover,
html[data-menu="slim"] .sidebar-flyout .sidebar-item:focus-visible,
html[data-menu="slimplus"] .sidebar-flyout .sidebar-item:hover,
html[data-menu="slimplus"] .sidebar-flyout .sidebar-item:focus-visible {
  background: transparent !important;
  color: var(--primary);
}

html[data-menu="slim"] .sidebar-flyout .sidebar-item.is-active,
html[data-menu="slimplus"] .sidebar-flyout .sidebar-item.is-active {
  background: transparent !important;
  color: var(--primary);
  font-weight: 600;
}

.sidebar-panel {
  top: 0;
  left: var(--sidebar-width-slim);
  width: calc(var(--sidebar-width) - var(--sidebar-width-slim));
  height: 100vh;
  overflow-y: auto;
  border-radius: 0;
  border-left: 0;
}

html[data-menu="slimplus"] .sidebar-panel {
  left: var(--sidebar-width-slimplus);
  width: calc(var(--sidebar-width) - var(--sidebar-width-slimplus));
}

.sidebar-panel-inner {
  padding: var(--space-3) var(--space-2);
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-overlay) - 1);
  background: rgba(15, 23, 42, 0.4);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.sidebar-backdrop.is-visible {
  display: block;
}

/* Main content — Verona inset sheet with large top corners */
.main {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface-ground);
  border-top-left-radius: var(--radius-sheet);
  border-top-right-radius: var(--radius-sheet);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

.content {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 100%;
  padding: var(--space-2);
  overflow-x: hidden;
  overflow-y: auto;
}

/* Shared foot height so sidebar + app border-top sit on one continuous line */
:root {
  --app-footer-height: 3rem;
}

/* App page footer — pinned under content, card surface like topbar */
.app-footer {
  position: relative;
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-top: 0;
  height: var(--app-footer-height);
  min-height: var(--app-footer-height);
  max-height: var(--app-footer-height);
  padding: 0 var(--space-4);
  box-sizing: border-box;
  border-top: 1px solid var(--border);
  background: var(--surface-card);
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.25rem;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--text-muted);
  z-index: 1;
  overflow: hidden;
}

/* Sidebar foot — identical height/border-top as .app-footer (one continuous line) */
.sidebar-footer {
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-top: auto;
  height: var(--app-footer-height);
  min-height: var(--app-footer-height);
  max-height: var(--app-footer-height);
  box-sizing: border-box;
  padding: 0 var(--space-3);
  border-top: 1px solid var(--border);
  background: var(--surface-card);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  overflow: hidden;
}

.sidebar-session-timer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  white-space: nowrap;
}

/* Dedicated idle chip — not a generic .badge (cleaner in the slim footer) */
.sidebar-session-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.7rem 0.3rem 0.35rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface-card));
  color: var(--text);
  font-size: 0.8125rem;
  line-height: 1;
  box-shadow: none;
}

.sidebar-session-chip > i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 16%, transparent);
  color: var(--primary);
  font-size: 0.72rem;
}

.sidebar-session-chip .remindsession {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  min-width: 3.75rem;
  text-align: left;
  letter-spacing: 0.01em;
  color: var(--text);
}

.app-footer-print-hook {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.app-footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  min-width: 0;
}

.app-footer-brand {
  font-weight: 600;
  color: var(--text);
}

.app-footer-sep {
  opacity: 0.45;
  user-select: none;
}

.app-footer-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.app-footer-link:hover {
  text-decoration: underline;
}

.app-footer-ver {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.app-footer-jsver {
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.app-footer-license {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin-left: auto;
  text-align: right;
}

.app-footer-license-label {
  color: var(--text-muted);
}

.app-footer-license-name {
  font-weight: 600;
  color: var(--text);
}

.toast-root {
  position: fixed;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  max-width: min(24rem, calc(100vw - 2rem));
}

.toast-root.toast-pos-bottom-right {
  top: auto;
  bottom: var(--space-4);
  left: auto;
  right: var(--space-4);
  align-items: flex-end;
}

.toast-root.toast-pos-bottom-left {
  top: auto;
  bottom: var(--space-4);
  left: var(--space-4);
  right: auto;
  align-items: flex-start;
}

.toast-root.toast-pos-bottom-center {
  top: auto;
  bottom: var(--space-4);
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  align-items: center;
}

.toast-root.toast-pos-top-right,
.toast-root:not([class*="toast-pos-"]) {
  top: var(--space-4);
  bottom: auto;
  left: auto;
  right: var(--space-4);
  align-items: flex-end;
}

.toast-root.toast-pos-top-left {
  top: var(--space-4);
  bottom: auto;
  left: var(--space-4);
  right: auto;
  align-items: flex-start;
}

.toast-root.toast-pos-top-center {
  top: var(--space-4);
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translateX(-50%);
  align-items: center;
}

/* Settings host lives outside .app so overflow:hidden on the shell cannot clip it */
#app-settings-host {
  position: relative;
  z-index: var(--z-modal);
}

/* Drawer panels — keep selectors class-only so .is-open can override transform/visibility */
.drawer {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: var(--z-modal);
  width: min(var(--drawer-width, var(--drawer-width-md)), 100vw);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  background: var(--surface-overlay);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transform: translateX(100%);
  visibility: hidden;
  pointer-events: none;
  transition:
    transform 0.28s ease,
    visibility 0.28s ease;
}

.drawer-sm { --drawer-width: var(--drawer-width-sm); }
.drawer-md { --drawer-width: var(--drawer-width-md); }
.drawer-lg { --drawer-width: var(--drawer-width-lg); }
.drawer-xl { --drawer-width: var(--drawer-width-xl); }
.drawer-xxl { --drawer-width: var(--drawer-width-xxl); }

.drawer-right {
  right: 0;
  transform: translateX(100%);
}

.drawer-left {
  left: 0;
  right: auto;
  border-left: 0;
  border-right: 1px solid var(--border);
  transform: translateX(-100%);
}

.drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.drawer.is-attention {
  transition: none;
}

.drawer-right.is-attention {
  animation: ui-drawer-attention-right 0.28s ease;
}

.drawer-left.is-attention {
  animation: ui-drawer-attention-left 0.28s ease;
}

@keyframes ui-drawer-attention-right {
  0%,
  100% {
    transform: translateX(0);
  }
  40% {
    transform: translateX(-0.3rem);
  }
}

@keyframes ui-drawer-attention-left {
  0%,
  100% {
    transform: translateX(0);
  }
  40% {
    transform: translateX(0.3rem);
  }
}

.drawer[hidden] {
  display: none !important;
}

.drawer.is-open[hidden] {
  display: flex !important;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  min-height: 0;
  padding: var(--surface-padding);
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

.drawer-heading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.drawer-heading-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.875rem;
  height: 1.875rem;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
}

.drawer-heading-icon svg {
  width: 1.125rem;
  height: 1.125rem;
}

.drawer-title {
  margin: 0;
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1.3;
}

.drawer-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--surface-padding);
  overflow-y: auto;
}

.drawer-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: auto;
  padding: var(--surface-padding);
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  background: var(--surface-overlay);
  overflow: visible;
  position: relative;
  z-index: 5;
}

.drawer-section {
  margin-bottom: var(--space-5);
}

.drawer-section-title {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .topbar-dropdown-menu {
    transition: none !important;
  }

  .drawer.is-attention {
    animation: none !important;
  }

  html.ui-ready[data-menu="static"] #app-sidebar-host {
    transition: none !important;
  }

  .topbar-dropdown.is-open .topbar-dropdown-menu {
    transform: none;
  }
}

/* Desktop ≥992px — menu modes from html[data-menu] */
@media (min-width: 992px) {
  .app-body {
    flex-direction: row;
  }

  .topbar-search {
    display: block;
  }

  /* Desktop: menu toggle for Static + Overlay; hidden for Slim / Slim+ */
  .topbar-menu-toggle {
    display: none;
  }

  html[data-menu="static"] .topbar-menu-toggle,
  html[data-menu="overlay"] .topbar-menu-toggle {
    display: inline-flex;
  }

  /*
   * Static desktop: pin the hamburger to the sidebar / content seam
   * (right edge of --sidebar-width). Brand stays in the sidebar column;
   * company name starts in the content column.
   */
  html[data-menu="static"] .topbar {
    display: grid;
    grid-template-columns: var(--sidebar-width) auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--space-3);
    padding-left: 0;
    padding-right: var(--space-4);
  }

  html[data-menu="static"] .topbar-brand {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    max-width: 100%;
    padding-left: var(--space-4);
    padding-right: 2.75rem;
    box-sizing: border-box;
  }

  html[data-menu="static"] .topbar-nav-cluster {
    display: contents;
  }

  html[data-menu="static"] .topbar-nav-cluster .topbar-menu-toggle {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    align-self: center;
    margin-right: 0;
    order: unset;
    z-index: 1;
  }

  html[data-menu="static"] .topbar-nav-cluster .topbar-company {
    grid-column: 2;
    grid-row: 1;
    order: unset;
    max-width: min(33vw, 16rem);
  }

  html[data-menu="static"] .topbar-actions {
    grid-column: 3;
    grid-row: 1;
    margin-left: 0;
    justify-self: end;
    order: unset;
  }

  #app-sidebar-host {
    position: sticky;
    top: 0;
    align-self: stretch;
    transform: none;
    flex: 0 0 var(--sidebar-width);
    width: var(--sidebar-width);
    max-width: none;
    height: auto;
    min-height: 0;
    max-height: none;
    transition: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 0;
    box-shadow: none;
  }

  #app-sidebar-host.is-open,
  .sidebar.is-open {
    transform: none;
  }

  .main {
    flex: 1 1 auto;
    min-width: 0;
    z-index: 1;
    overflow: hidden;
    /* Verona: large radius only where content meets sidebar + topbar */
    border-top-left-radius: var(--radius-sheet);
    border-top-right-radius: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
  }

  .content {
    /* Always fill .main so width tracks the sidebar animation (no max-width snap) */
    max-width: none;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  /* Static — visible by default (no JS required); .is-collapsed hides it */
  html[data-menu="static"] #app-sidebar-host {
    position: relative;
    top: 0;
    align-self: stretch;
    flex: 0 0 auto;
    width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-width: 0;
    height: auto;
    min-height: 0;
    max-height: none;
    transform: none;
    transition: none;
    overflow: hidden;
    opacity: 1;
    pointer-events: auto;
    border-right: 0;
  }

  /* Keep nav at full width so collapse clips instead of reflowing labels mid-tween */
  html[data-menu="static"] #app-sidebar-host .sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-sizing: border-box;
  }

  html.ui-ready[data-menu="static"] #app-sidebar-host {
    transition:
      width 0.15s cubic-bezier(0.4, 0, 0.2, 1),
      max-width 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Freeze chart paints mid-tween so resize thrash does not stall the toggle */
  html.is-sidebar-animating .chart,
  html.is-sidebar-animating .ag-charts-wrapper {
    pointer-events: none;
  }

  html.is-sidebar-animating .ag-charts-wrapper {
    transform-origin: left top;
    will-change: transform;
  }

  html[data-menu="static"] #app-sidebar-host.is-collapsed {
    width: 0;
    max-width: 0;
    min-width: 0;
    box-shadow: none;
    pointer-events: none;
  }

  /* Overlay — absolute over content; same size/placement as Static (app-body, not full page) */
  html[data-menu="overlay"] #app-sidebar-host {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: var(--z-overlay);
    flex: 0 0 0;
    width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    min-width: 0;
    height: auto;
    max-height: 100%;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    overflow: hidden;
    opacity: 1;
    pointer-events: auto;
    border-right: 0;
    box-shadow: none;
  }

  html[data-menu="overlay"] #app-sidebar-host .sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
  }

  html[data-menu="overlay"] #app-sidebar-host.is-open {
    transform: translateX(0);
  }

  html[data-menu="overlay"] .main {
    flex: 1 1 100%;
    width: 100%;
  }

  /* Backdrop covers content area only (below topbar), matching overlay panel height */
  html[data-menu="overlay"] .sidebar-backdrop.is-visible {
    top: var(--topbar-height);
  }

  /* Slim / Slim+ — icon rail */
  html[data-menu="slim"] #app-sidebar-host {
    position: relative;
    align-self: stretch;
    flex: 0 0 var(--sidebar-width-slim);
    width: var(--sidebar-width-slim);
    height: auto;
    max-height: 100%;
    overflow: visible;
    transform: none;
    /* Above .main so fixed flyouts/tooltips are not covered */
    z-index: calc(var(--z-overlay) + 1);
  }

  html[data-menu="slimplus"] #app-sidebar-host {
    position: relative;
    align-self: stretch;
    flex: 0 0 var(--sidebar-width-slimplus);
    width: var(--sidebar-width-slimplus);
    height: auto;
    max-height: 100%;
    overflow: visible;
    transform: none;
    z-index: calc(var(--z-overlay) + 1);
  }

  html[data-menu="slim"] .sidebar,
  html[data-menu="slimplus"] .sidebar {
    overflow: visible;
  }

  /* Slim: icon-only in the rail (labels clipped) — not inside flyout */
  html[data-menu="slim"] .sidebar-nav .sidebar-item-label,
  html[data-menu="slim"] .sidebar-nav .sidebar-group-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  html[data-menu="slim"] .sidebar-item {
    justify-content: center;
    padding-inline: var(--space-2);
  }

  /* Slim / Slim+: hide count badges on the icon rail (flyout/panel still show them) */
  html[data-menu="slim"] .sidebar-nav .sidebar-item > .badge,
  html[data-menu="slimplus"] .sidebar-nav .sidebar-item > .badge {
    display: none !important;
  }

  /* No expand chevron on icon rails (flyout/panel handles nesting) */
  html[data-menu="slim"] .sidebar-nav .sidebar-item[aria-expanded]::after,
  html[data-menu="slimplus"] .sidebar-nav .sidebar-item[aria-expanded]::after {
    display: none;
  }

  html[data-menu="slim"] .sidebar-menu > li > ul,
  html[data-menu="slimplus"] .sidebar-nav .sidebar-menu > li > ul {
    display: none;
  }

  /* Slim+: icon + label under icon; no gray hover block on the rail */
  html[data-menu="slimplus"] .sidebar-nav .sidebar-group-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  html[data-menu="slimplus"] .sidebar-nav .sidebar-item {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.2rem;
    padding: 0.55rem 0.25rem;
    text-align: center;
    border-radius: var(--radius-md);
  }

  html[data-menu="slimplus"] .sidebar-nav .sidebar-item-label {
    position: static;
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    padding: 0 0.15rem;
    overflow: hidden;
    clip: auto;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: 0.01em;
    text-align: center;
  }

  html[data-menu="slimplus"] .sidebar-nav .sidebar-item svg {
    width: 1.35rem;
    height: 1.35rem;
  }

  /* Slim+: no hover/active gray anywhere on the left rail or its panel */
  html[data-menu="slimplus"] #app-sidebar-host .sidebar-item:hover,
  html[data-menu="slimplus"] #app-sidebar-host .sidebar-item:focus-visible,
  html[data-menu="slimplus"] #app-sidebar-host .sidebar-item:active,
  html[data-menu="slimplus"] #app-sidebar-host .sidebar-item.is-active,
  html[data-menu="slimplus"] #app-sidebar-host .sidebar-item[aria-current="page"],
  html[data-menu="slimplus"] #app-sidebar-host .sidebar-item.is-active:hover,
  html[data-menu="slimplus"] #app-sidebar-host .sidebar-item[aria-current="page"]:hover,
  html[data-menu="slimplus"] #app-sidebar-host .sidebar-item.is-active:focus-visible,
  html[data-menu="slimplus"] #app-sidebar-host .sidebar-item[aria-current="page"]:focus-visible,
  html[data-menu="slimplus"] #app-sidebar-host a:hover,
  html[data-menu="slimplus"] #app-sidebar-host button:hover,
  html[data-menu="slimplus"] #app-sidebar-host li:hover {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
  }

  html[data-menu="slimplus"] .sidebar-nav .sidebar-item:hover,
  html[data-menu="slimplus"] .sidebar-nav .sidebar-item:focus-visible {
    color: var(--primary);
  }

  html[data-menu="slimplus"] .sidebar-nav .sidebar-item:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 1px;
  }

  html[data-menu="slimplus"] .sidebar-nav .sidebar-item.is-active,
  html[data-menu="slimplus"] .sidebar-nav .sidebar-item[aria-current="page"] {
    color: var(--primary);
    font-weight: 600;
  }

  /* Slim+ panel restores full list chrome inside the panel only */
  html[data-menu="slimplus"] .sidebar-panel .sidebar-item-label,
  html[data-menu="slimplus"] .sidebar-panel .sidebar-group-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    font-size: inherit;
    text-align: left;
    text-overflow: unset;
  }

  html[data-menu="slimplus"] .sidebar-panel .sidebar-item {
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: var(--space-3);
    padding-inline: var(--space-3);
    text-align: left;
  }

  html[data-menu="slimplus"] .sidebar-panel .sidebar-item:hover,
  html[data-menu="slimplus"] .sidebar-panel .sidebar-item:focus-visible {
    color: var(--primary);
  }

  html[data-menu="slimplus"] .sidebar-panel .sidebar-item.is-active,
  html[data-menu="slimplus"] .sidebar-panel .sidebar-item[aria-current="page"] {
    color: var(--primary);
    font-weight: 600;
  }

  html[data-menu="slimplus"] .sidebar-panel .sidebar-menu > li > ul {
    display: block;
  }
}

/* ---------- Standalone auth / login ---------- */
.auth {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--surface-ground);
  color: var(--text);
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr;
  min-height: 100vh;
  min-height: 100dvh;
}

@media (min-width: 900px) {
  .auth-split {
    grid-template-columns: minmax(22rem, 34%) 1fr;
  }

  .auth-split--form-end {
    grid-template-columns: 1fr minmax(22rem, 34%);
  }

  .auth-split--form-end .auth-panel {
    order: 2;
  }

  .auth-split--form-end .auth-aside {
    order: 1;
  }
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: var(--space-5) var(--space-4);
  background: var(--surface-card);
}

@media (min-width: 900px) {
  .auth-panel {
    padding: var(--space-5) clamp(1.5rem, 3vw, 2.75rem);
  }
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
  margin-bottom: var(--space-4);
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--primary-contrast);
  flex-shrink: 0;
}

.auth-brand-mark svg {
  width: 1.25rem;
  height: 1.25rem;
}

.auth-brand-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.auth-brand-name {
  font-weight: 600;
  font-size: var(--font-size-base);
  color: var(--text);
  line-height: 1.2;
}

.auth-brand-note {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.auth-form-wrap {
  width: 100%;
  max-width: 22rem;
  margin: auto 0;
  padding: var(--space-4) 0;
}

.auth .input-group-icon,
.auth .input-group-text,
.auth .ux-pwd-toggle {
  background: var(--surface-card);
}

.auth button.input-group-icon:hover,
.auth button.input-group-icon:focus-visible,
.auth .ux-pwd-toggle:hover,
.auth .ux-pwd-toggle:focus-visible,
.auth .input-group-text.ux-pwd-toggle:hover,
.auth .input-group-text.ux-pwd-toggle:focus-visible {
  background: color-mix(in srgb, var(--surface-hover) 45%, var(--surface-card));
  color: var(--text-muted);
}

.auth-form-header {
  margin-bottom: var(--space-5);
}

.auth-form-title {
  margin: 0 0 var(--space-2);
  font-size: clamp(1.75rem, 2.5vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.auth-form-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.auth-form .form-group {
  margin-bottom: var(--space-4);
}

.auth-form-actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
  margin-top: var(--space-1);
}

.auth-form-forgot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  align-self: center;
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.auth-form-forgot:hover {
  color: var(--primary);
}

.auth-form-forgot svg {
  width: 1rem;
  height: 1rem;
}

.auth-btn-icon {
  width: 1.125rem;
  height: 1.125rem;
  margin-inline-start: var(--space-1);
}

/* Showcase / aside panel */
.auth-aside {
  position: relative;
  display: none;
  overflow: hidden;
  color: #fff;
  min-height: 16rem;
}

@media (min-width: 900px) {
  .auth-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-6) clamp(2rem, 5vw, 4rem);
  }
}

.auth-aside-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-aside--network .auth-aside-bg svg,
.auth-center-network {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.95;
}

.auth-net-base {
  fill: none;
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1;
  stroke-linecap: round;
}

.auth-net-flow {
  fill: none;
  stroke: rgba(255, 255, 255, 0.55);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 12 88;
  stroke-dashoffset: 0;
  opacity: 0.55;
}

.auth-net-link.is-live .auth-net-flow {
  animation-name: auth-net-flow;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}

.auth-net-link.is-hot .auth-net-base {
  stroke: rgba(255, 255, 255, 0.35);
  stroke-width: 1.35;
}

.auth-net-link.is-hot .auth-net-flow {
  stroke: #fff;
  stroke-width: 2.4;
  stroke-dasharray: 18 42;
  opacity: 1;
  animation-duration: 0.55s !important;
  filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.75));
}

.auth-net-node {
  fill: rgba(255, 255, 255, 0.45);
  transition: fill 0.15s ease;
}

.auth-net-node.is-hot {
  fill: #fff;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.85));
}

@keyframes auth-net-flow {
  to {
    stroke-dashoffset: -100;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-net-link.is-live .auth-net-flow {
    animation: none;
    opacity: 0.25;
  }

  .auth-net-link.is-hot .auth-net-flow {
    filter: none;
  }

  .auth-net-node.is-hot {
    filter: none;
  }
}

.auth-aside-content {
  position: relative;
  z-index: 1;
  max-width: 28rem;
}

.auth-aside-eyebrow {
  margin: 0 0 var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: color-mix(in srgb, #fff 55%, var(--warning));
}

.auth-aside-title {
  margin: 0 0 var(--space-3);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.auth-aside-title span {
  color: color-mix(in srgb, #fff 30%, var(--warning));
}

.auth-aside-lead {
  margin: 0 0 var(--space-5);
  font-size: var(--font-size-base);
  color: color-mix(in srgb, #fff 78%, transparent);
  line-height: 1.5;
}

.auth-aside-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.auth-aside-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--font-size-sm);
  color: color-mix(in srgb, #fff 88%, transparent);
  line-height: 1.4;
}

.auth-aside-list svg {
  flex-shrink: 0;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  opacity: 0.9;
}

/* BG variants */
.auth-aside--network {
  background: linear-gradient(
    145deg,
    color-mix(in srgb, var(--primary) 28%, #07101f) 0%,
    #0b1730 42%,
    color-mix(in srgb, var(--primary) 45%, #143a6b) 100%
  );
}

.auth-aside--network .auth-aside-bg {
  opacity: 1;
}

.auth-aside--mesh {
  background:
    radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--info) 35%, transparent), transparent 42%),
    radial-gradient(circle at 85% 75%, color-mix(in srgb, var(--primary) 40%, transparent), transparent 45%),
    linear-gradient(160deg, #0a1220, color-mix(in srgb, var(--primary) 32%, #152033));
}

.auth-aside--mesh .auth-aside-bg {
  background-image:
    radial-gradient(circle at 25% 40%, color-mix(in srgb, #fff 18%, transparent) 0 40%, transparent 55%),
    radial-gradient(circle at 75% 30%, color-mix(in srgb, var(--info) 22%, transparent) 0 35%, transparent 50%);
  opacity: 0.85;
}

.auth-aside--mesh .auth-aside-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(color-mix(in srgb, #fff 7%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, #fff 7%, transparent) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 15%, transparent 78%);
  opacity: 0.55;
}

/* Centered variant — full-bleed bg + floating card */
.auth-center {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--space-5) var(--space-4);
  overflow: hidden;
}

.auth-center-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    165deg,
    #07101f 0%,
    color-mix(in srgb, var(--primary) 35%, #0b1730) 48%,
    #0f1b33 100%
  );
}

.auth-center-bg::before {
  content: none;
}

.auth-center-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 24rem;
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.auth-center .auth-brand {
  margin-bottom: var(--space-4);
}

.auth-center .auth-form-wrap {
  max-width: none;
}


