:root {
  --bs-primary: var(--opsight-green);
  --bs-primary-rgb: 8, 71, 67;
  --bs-link-color: var(--opsight-green);
  --bs-link-hover-color: var(--opsight-green-hover);
  --bs-body-bg: var(--opsight-paper);
  --bs-body-color: var(--opsight-ink);
}

.session-expired-overlay {
  position: fixed;
  z-index: 99999;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(23, 58, 55, 0.62);
  backdrop-filter: blur(3px);
}

.session-expired-overlay:focus {
  outline: none;
}

.session-expired-dialog {
  width: min(100%, 440px);
  padding: clamp(24px, 6vw, 36px);
  border: 1px solid var(--opsight-line);
  border-top: 3px solid var(--opsight-green);
  border-radius: 8px;
  background: var(--opsight-surface);
  box-shadow: 0 24px 64px rgba(3, 32, 28, 0.24);
  text-align: center;
}

.session-expired-icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid var(--opsight-sage-border);
  border-radius: 50%;
  background: var(--opsight-evidence-highlight);
  color: var(--opsight-green);
  font-size: 20px;
}

.session-expired-eyebrow {
  margin: 0 0 6px;
  color: var(--opsight-gold);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.session-expired-title {
  margin: 0 0 10px;
  color: var(--opsight-ink);
  font-family: var(--opsight-font-display);
  font-size: clamp(1.5rem, 5vw, 1.875rem);
  font-weight: 500;
  line-height: 1.2;
}

.session-expired-description {
  margin: 0 0 24px;
  color: var(--opsight-muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.session-expired-action {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 1px solid var(--opsight-green);
  border-radius: 4px;
  background: var(--opsight-green);
  color: var(--opsight-surface);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.session-expired-action:hover {
  border-color: var(--opsight-green-hover);
  background: var(--opsight-green-hover);
  color: var(--opsight-surface);
}

.session-expired-action:focus-visible {
  outline: 3px solid var(--opsight-gold-light);
  outline-offset: 3px;
}

body.app-shell,
body.app-public {
  min-height: 100vh;
  background: var(--opsight-paper);
  color: var(--opsight-ink);
  font-family: var(--opsight-font-sans);
  font-size: var(--opsight-font-body-size);
}

body.app-shell {
  overflow-x: hidden;
}

.maintenance-banner {
  --maintenance-accent: var(--opsight-gold);
  --maintenance-surface: rgba(227, 234, 223, 0.72);
  padding: 12px 28px;
  border-bottom: 1px solid var(--opsight-line);
  border-left: 3px solid var(--maintenance-accent);
  background: var(--maintenance-surface);
  color: var(--opsight-ink);
}

.maintenance-banner[data-level="info"] {
  --maintenance-accent: var(--opsight-green);
  --maintenance-surface: var(--opsight-evidence-highlight);
}

.maintenance-banner[data-level="warning"] {
  --maintenance-accent: var(--opsight-gold);
  --maintenance-surface: rgba(231, 212, 169, 0.42);
}

.maintenance-banner[data-level="danger"] {
  --maintenance-accent: var(--opsight-error);
  --maintenance-surface: rgba(155, 50, 43, 0.08);
}

.maintenance-banner-inner {
  display: flex;
  max-width: 1200px;
  align-items: flex-start;
  gap: 12px;
  margin: 0 auto;
}

.maintenance-banner-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  border: 1px solid var(--opsight-line);
  border-radius: 8px;
  background: var(--opsight-surface);
  color: var(--maintenance-accent);
  font-size: 15px;
}

.maintenance-banner-content {
  min-width: 0;
  flex: 1 1 auto;
}

.maintenance-banner-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 9px;
  margin-bottom: 3px;
}

.maintenance-banner-label {
  color: var(--maintenance-accent);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.maintenance-banner h2 {
  margin: 0;
  color: var(--opsight-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 500;
}

.maintenance-banner-message {
  color: var(--opsight-ink);
  font-size: 0.8125rem;
  line-height: 1.55;
}

.maintenance-banner-window {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
  color: var(--opsight-muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.maintenance-banner-window i {
  color: var(--maintenance-accent);
}

@media (max-width: 767.98px) {
  .maintenance-banner {
    padding: 11px 16px;
  }

  .maintenance-banner-inner {
    gap: 9px;
  }

  .maintenance-banner-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    font-size: 13px;
  }
}

.app-shell .sidenav {
  position: fixed;
  z-index: 1030;
  inset: 0 auto 0 0;
  display: flex;
  width: 260px;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--opsight-line);
  background: var(--opsight-paper);
  transition: width 180ms ease, transform 180ms ease;
}

.app-shell .sidenav-header {
  position: relative;
  display: flex;
  min-height: 72px;
  align-items: center;
  padding: 0 20px;
}

.app-shell .sidenav-header .navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0 0 0 6px;
  color: var(--opsight-ink);
  font: 1.625rem/1 var(--opsight-font-display);
  letter-spacing: -0.045em;
}

.app-shell .sidenav-header .navbar-brand-img {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  object-fit: contain;
}

.app-shell .sidenav .horizontal {
  width: calc(100% - 32px);
  margin: 0 16px 12px;
  border-color: var(--opsight-line);
  opacity: 1;
}

.app-sidebar-nav {
  flex: 1 1 auto;
}

.app-shell .sidenav .navbar-nav {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.app-shell .sidenav .navbar-nav > .nav-item {
  margin: 0;
}

.app-shell .sidenav .nav-link {
  position: relative;
  display: flex;
  min-height: 44px;
  align-items: center;
  margin: 1px 12px;
  padding: 2px 8px;
  border: 0;
  border-radius: 5px;
  color: var(--opsight-muted);
  text-align: left;
  text-decoration: none;
  box-shadow: none;
}

.app-shell .sidenav .nav-link:hover,
.app-shell .sidenav .nav-link:focus-visible {
  background: var(--opsight-tint);
  color: var(--opsight-green);
}

.app-shell .sidenav .nav-link.active {
  background: rgba(8, 71, 67, 0.06);
  color: var(--opsight-green);
  font-weight: 600;
}

.app-shell .sidenav .nav-link.active::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 2px;
  border-radius: 2px;
  background: var(--opsight-green);
  content: "";
}

.app-shell .workspace-nav-icon {
  display: inline-flex;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  align-items: center;
  justify-content: center;
  margin-right: 8px;
  color: var(--opsight-green);
}

.app-shell .workspace-nav-icon svg {
  fill: currentColor;
}

.app-shell .avatar {
  display: inline-block;
  flex: 0 0 auto;
  object-fit: cover;
}

.app-shell .avatar-xs {
  width: 26px;
  height: 26px;
}

.app-shell .avatar-sm {
  width: 34px;
  height: 34px;
}

.app-shell .sidenav .nav-link.btn {
  width: calc(100% - 24px);
  font: inherit;
}

.user-menu-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  color: var(--opsight-green);
  font-size: 1.1rem;
}

.app-sidebar-close {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-left: auto;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--opsight-muted);
}

.app-sidebar-close:hover,
.app-sidebar-close:focus-visible {
  background: var(--opsight-tint);
  color: var(--opsight-green);
}

.app-shell .main-content {
  min-height: 100vh;
  margin-left: 260px;
  overflow-x: hidden;
  background: transparent;
  transition: margin-left 180ms ease;
}

.app-shell .navbar-main {
  position: sticky;
  z-index: 1010;
  top: 0;
  display: flex;
  min-height: 58px;
  align-items: center;
  margin: 0;
  padding: 8px 28px;
  border: 0;
  border-bottom: 1px solid var(--opsight-line);
  border-radius: 0;
  background: var(--opsight-paper-translucent);
  backdrop-filter: blur(12px);
}

.app-shell .navbar-main-inner {
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  gap: 1rem;
}

.app-shell .navbar-main-start {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 0.75rem;
}

.app-shell .navbar-breadcrumb {
  min-width: 0;
  overflow: hidden;
}

.app-shell .navbar-main .breadcrumb {
  --bs-breadcrumb-divider-color: var(--opsight-muted);
  flex-wrap: nowrap;
  white-space: nowrap;
}

.app-shell .navbar-main .breadcrumb-item,
.app-shell .navbar-main h6 {
  color: var(--opsight-muted);
}

.app-shell .navbar-main .breadcrumb-item {
  flex: 0 0 auto;
}

.app-shell .navbar-main .breadcrumb-item.active {
  min-width: 0;
  overflow: hidden;
  flex: 0 1 auto;
  text-overflow: ellipsis;
}

.app-shell .navbar-main-actions {
  flex: 0 0 auto;
  gap: 0.5rem;
  margin-block: 0;
}

.app-shell .navbar-main-actions > .nav-item > .nav-link {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.app-shell .navbar-main-actions > .nav-item > .nav-link:hover,
.app-shell .navbar-main-actions > .nav-item > .nav-link:focus-visible {
  background: var(--opsight-tint);
}

.app-shell .navbar-main-actions > .nav-item > .dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  left: auto;
}

.app-shell .navbar-main-actions .bi-bell {
  font-size: 1rem;
}

.bi-3x {
  font-size: 3em;
}

.bi-spin {
  animation: bi-spin 1s linear infinite;
}

@keyframes bi-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bi-spin {
    animation: none;
  }
}

.app-shell #notifications-dropdown {
  background-color: var(--opsight-surface);
  border-color: var(--opsight-line);
  max-height: min(72svh, 38rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.app-shell #notifications-dropdown .notification-summary {
  border-radius: 0.45rem;
  transition: background-color 140ms ease;
}

.app-shell #notifications-dropdown .notification-item.is-expanded .notification-summary {
  background-color: var(--opsight-tint);
}

.app-shell #notifications-dropdown .notification-details {
  margin-top: 0.65rem !important;
  padding: 0.65rem 0.5rem 0.15rem;
  border-top: 1px solid var(--opsight-line) !important;
}

.app-shell #notifications-dropdown .notification-details > p {
  margin-bottom: 0.75rem;
  color: var(--opsight-ink) !important;
  font-size: 0.8125rem;
  line-height: 1.5 !important;
  overflow-wrap: anywhere;
}

.app-shell #notifications-dropdown .notification-content:focus-visible {
  outline: 2px solid var(--opsight-green);
  outline-offset: 2px;
  border-radius: 4px;
}

.opsight-toast {
  padding: 0.7rem 1rem;
  border: 1px solid var(--opsight-line);
  border-left: 4px solid var(--opsight-sage);
  border-radius: 10px;
  background: var(--opsight-surface);
  box-shadow: 0 12px 32px rgba(3, 32, 28, 0.16);
  color: var(--opsight-ink);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.45;
  transition: opacity 0.2s ease;
}

.opsight-toast[data-toast-type="success"] {
  border-left-color: var(--opsight-green);
}

.opsight-toast[data-toast-type="warning"] {
  border-left-color: var(--opsight-gold);
}

.opsight-toast[data-toast-type="error"] {
  border-left-color: var(--opsight-error);
}

.bulk-action-panel {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1080;
  display: none;
  width: min(22rem, calc(100vw - 2rem));
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  pointer-events: none;
}

.bulk-action-panel-summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem 0.4rem 0.75rem;
  border: 1px solid var(--opsight-line);
  border-radius: 9px;
  background: var(--opsight-surface);
  box-shadow: 0 8px 24px rgba(3, 32, 28, 0.14);
  color: var(--opsight-ink);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.2;
  pointer-events: auto;
}

#bulk-action-toast-count {
  display: inline-flex;
  min-width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: var(--opsight-tint);
  color: var(--opsight-green);
  font-size: 0.7rem;
  font-weight: 700;
}

#bulk-action-panel-toggle {
  padding: 0.25rem 0.55rem;
  border: 1px solid var(--opsight-sage-border);
  border-radius: 6px;
  background: transparent;
  color: var(--opsight-green);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
}

#bulk-action-panel-toggle:hover,
#bulk-action-panel-toggle:focus-visible {
  background: var(--opsight-tint);
}

#bulk-action-toasts {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

#bulk-action-toasts > * {
  width: 100%;
  pointer-events: auto;
}

.bulk-action-toast {
  font-size: 0.8125rem;
}

.bulk-action-toast__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.bulk-action-toast__status {
  flex: 0 0 auto;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--opsight-tint);
  color: var(--opsight-green);
  font-size: 0.7rem;
  font-weight: 600;
}

.opsight-toast[data-toast-type="warning"] .bulk-action-toast__status {
  background: var(--opsight-event-hover);
  color: var(--opsight-gold);
}

.opsight-toast[data-toast-type="error"] .bulk-action-toast__status {
  background: var(--opsight-tint);
  color: var(--opsight-error);
}

.bulk-action-toast__track {
  height: 0.375rem;
  margin-top: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--opsight-soft-surface);
}

.bulk-action-toast__bar {
  width: 0;
  height: 100%;
  background: var(--opsight-green);
  transition: width 0.2s ease;
}

.opsight-toast[data-toast-type="error"] .bulk-action-toast__bar {
  background: var(--opsight-error);
}

.bulk-action-toast__detail {
  margin-top: 0.4rem;
  color: var(--opsight-muted);
  font-size: 0.75rem;
}

@media (max-width: 575.98px) {
  .bulk-action-panel {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}

.app-shell #notifications-dropdown .notification-item .avatar {
  background-color: transparent !important;
}

.app-shell .navbar-profile-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--opsight-tint);
  color: var(--opsight-green);
  font-size: 0.8rem;
}

.app-shell .navbar-profile-icon-sm {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
}

.app-shell .dropdown-menu .navbar-profile-icon {
  background: transparent;
}

.app-shell .navbar-main-actions #notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.65rem;
  line-height: 18px;
  text-align: center;
  transform: translate(25%, -25%);
}

.app-shell .workspace-nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  padding: 8px;
  border-radius: 4px;
  color: var(--opsight-green);
}

.app-shell .workspace-nav-toggle:hover {
  background: var(--opsight-tint);
}

.app-shell .workspace-nav-toggle:focus-visible,
.app-sidebar-backdrop:focus-visible {
  outline: 3px solid var(--opsight-gold-light);
  outline-offset: 2px;
}

.sidenav-toggler-inner {
  display: inline-flex;
  width: 18px;
  flex-direction: column;
  gap: 4px;
}

.sidenav-toggler-line {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.app-sidebar-backdrop {
  display: none;
}

.app-public {
  display: flex;
  flex-direction: column;
}

.app-public .app-public-main {
  flex: 1 0 auto;
}

.app-public .app-public-navbar {
  z-index: 1020;
  border-bottom: 1px solid var(--opsight-line);
  background: var(--opsight-paper-translucent);
  backdrop-filter: blur(12px);
}

.app-public .navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--opsight-ink);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
}

.app-public-navbar__brand-mark {
  display: block;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  object-fit: contain;
}

.app-public .navbar-brand:hover {
  color: var(--opsight-green);
}

.app-public .navbar-toggler {
  border-color: var(--opsight-line);
}

.app-public .footer {
  border-top: 1px solid var(--opsight-line);
}

.app-public .footer a {
  color: var(--opsight-muted) !important;
  text-decoration: none;
}

.app-public .footer a:hover {
  color: var(--opsight-green) !important;
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--opsight-green);
  --bs-btn-border-color: var(--opsight-green);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--opsight-green-hover);
  --bs-btn-hover-border-color: var(--opsight-green-hover);
  --bs-btn-active-bg: var(--opsight-green-hover);
  --bs-btn-active-border-color: var(--opsight-green-hover);
  --bs-btn-disabled-bg: var(--opsight-green);
  --bs-btn-disabled-border-color: var(--opsight-green);
}

.text-xs {
  font-size: 0.75rem !important;
}

.text-sm {
  font-size: 0.875rem !important;
}

.text-lg {
  font-size: 1.125rem !important;
}

.max-h-half-viewport {
  max-height: 50vh !important;
}

@media (min-width: 1200px) {
  body.app-shell.sidenav-collapsed .sidenav {
    width: 80px;
  }

  body.app-shell.sidenav-collapsed .main-content {
    margin-left: 80px;
  }

  body.app-shell.sidenav-collapsed .sidenav-header {
    justify-content: center;
    padding: 0;
  }

  body.app-shell.sidenav-collapsed .sidenav-header .navbar-brand {
    justify-content: center;
    gap: 0;
    padding: 0;
  }

  body.app-shell.sidenav-collapsed .sidenav-header .navbar-brand span,
  body.app-shell.sidenav-collapsed .sidenav .nav-link-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  body.app-shell.sidenav-collapsed .sidenav .nav-link {
    justify-content: center;
    margin-right: 8px;
    margin-left: 8px;
    padding-right: 0;
    padding-left: 0;
  }

  body.app-shell.sidenav-collapsed .sidenav .workspace-nav-icon {
    margin-right: 0;
  }
}

@media (max-width: 1199.98px) {
  .app-shell .sidenav {
    width: min(280px, calc(100vw - 48px));
    transform: translateX(-105%);
    box-shadow: 12px 0 36px rgba(3, 32, 28, 0.14);
  }

  body.app-shell.sidenav-open .sidenav {
    transform: translateX(0);
  }

  .app-shell .main-content {
    margin-left: 0;
  }

  .app-sidebar-close {
    display: inline-flex;
  }

  .app-sidebar-backdrop {
    position: fixed;
    z-index: 1025;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(17, 37, 33, 0.38);
  }

  body.app-shell.sidenav-open .app-sidebar-backdrop {
    display: block;
  }
}

@media (max-width: 767.98px) {
  .app-shell .navbar-main {
    padding: 8px 16px;
  }
}
