/*
 * Operational UI
 * A deliberately small compatibility layer for the direct app.css runtime.
 * It owns only the application shell, explicit interaction states and the
 * mobile drawer contract used by assets/js/app.js.
 */

body.ow-operational-interface {
  --ow-operational-focus: rgba(31, 111, 235, .32);
  --ow-operational-hover: #eef5ff;
}

body.ow-operational-interface .ow-ui-icon {
  display: block;
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
}

body.ow-operational-interface .ow-operational-topbar {
  min-width: 0;
  padding: 4px 0;
}

body.ow-operational-interface .ow-topbar-heading {
  min-width: 0;
}

body.ow-operational-interface .ow-topbar-heading h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.ow-operational-interface .ow-topbar-actions {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

body.ow-operational-interface :is(.ow-topbar-notification, .ow-ai-assistant-toggle, .ow-mobile-app-menu) {
  position: relative;
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 11px;
  border: 1px solid #d4dfed;
  border-radius: 13px;
  background: #fff;
  color: #174f86;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 7px 20px rgba(7, 23, 47, .06);
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .16s ease;
}

body.ow-operational-interface .ow-topbar-notification b {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #d92d20;
  color: #fff;
  font-size: 10px;
}

body.ow-operational-interface .ow-ai-assistant-toggle[hidden] {
  display: none;
}

body.ow-operational-interface .ow-language-switcher.is-crm {
  margin-right: 0;
}

body.ow-operational-interface .ow-language-switcher-icon {
  color: #55708f;
}

body.ow-operational-interface .ow-operational-user {
  gap: 5px;
  padding: 5px;
}

body.ow-operational-interface .ow-operational-profile,
body.ow-operational-interface .ow-operational-logout {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #173452;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

body.ow-operational-interface .ow-operational-logout {
  background: var(--ow-blue-soft);
  color: var(--ow-blue);
}

body.ow-operational-interface .ow-user-avatar-image-wrap,
body.ow-operational-interface .ow-user-avatar-image {
  width: 30px;
  height: 30px;
  display: block;
  flex: 0 0 30px;
  border-radius: 50%;
  object-fit: cover;
}

body.ow-operational-interface .ow-nav > .ow-nav-utility.is-first {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .12);
}

body.ow-operational-interface .ow-sidebar-collapse-label {
  position: sticky;
  bottom: 0;
  z-index: 5;
  width: 100% !important;
  min-height: 42px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding: 9px 10px;
  border-color: rgba(255, 255, 255, .15);
  background: #0c2b50;
  color: #fff;
  box-shadow: 0 -8px 18px rgba(4, 18, 36, .18);
}

body.ow-operational-interface .ow-sidebar-collapse-label em {
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

body.ow-operational-interface .ow-mobile-app-menu,
body.ow-operational-interface .ow-mobile-sidebar-backdrop {
  display: none;
}

body.ow-operational-interface :where(
  button,
  a[href],
  input,
  select,
  textarea,
  summary,
  [role="button"],
  [tabindex]:not([tabindex="-1"])
):focus-visible {
  outline: 3px solid var(--ow-operational-focus);
  outline-offset: 2px;
}

body.ow-operational-interface :where(input, select, textarea):focus {
  border-color: #7ea9df;
  box-shadow: 0 0 0 3px var(--ow-operational-focus);
}

@media (hover: hover) {
  body.ow-operational-interface :is(.ow-topbar-notification, .ow-ai-assistant-toggle, .ow-mobile-app-menu):hover,
  body.ow-operational-interface .ow-operational-profile:hover,
  body.ow-operational-interface .ow-operational-logout:hover {
    border-color: #9cbce3;
    background: var(--ow-operational-hover);
    color: #0d57a6;
    box-shadow: 0 10px 26px rgba(7, 23, 47, .1);
    transform: translateY(-1px);
  }

  body.ow-operational-interface :is(.ow-primary, .ow-button):not(:disabled):hover {
    filter: brightness(1.08);
    box-shadow: 0 12px 28px rgba(7, 23, 47, .2);
    transform: translateY(-1px);
  }

  body.ow-operational-interface .ow-secondary:not(:disabled):hover {
    border-color: #9cbce3;
    background: var(--ow-operational-hover);
    color: #0d57a6;
  }

  body.ow-operational-interface .ow-danger:not(:disabled):hover {
    border-color: #f2a6a6;
    background: #fff1f1;
  }

  body.ow-operational-interface :is(.ow-link-button, .ow-button-link):hover {
    text-decoration: underline;
    text-underline-offset: 3px;
  }

  body.ow-operational-interface :is(.ow-clickable-row, .ow-grid-row, tr[data-action]):hover,
  body.ow-operational-interface :is(.ow-dashboard-list-row, .ow-operational-health-row):hover {
    background: #f5f9ff;
  }

  body.ow-operational-interface :is(.ow-module-sidebar-item, .ow-internal-menu button, .ow-tab-button, .ow-settings-tree-item):not(.is-active):hover {
    border-color: #c8d9ed;
    background: #f4f8fe;
    color: #134f91;
  }

  body.ow-operational-interface :is(.ow-card, .ow-ui-card)[data-action]:hover {
    border-color: #aac4e4;
    box-shadow: 0 15px 38px rgba(7, 23, 47, .1);
    transform: translateY(-1px);
  }
}

@media (min-width: 48rem) {
  body.ow-operational-interface .ow-app-shell {
    height: 100vh;
    display: flex;
    align-items: stretch;
    overflow: hidden;
  }

  body.ow-operational-interface .ow-sidebar {
    position: sticky !important;
    top: 0;
    width: 270px !important;
    min-width: 270px !important;
    height: 100vh !important;
    min-height: 100vh !important;
    flex: 0 0 270px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  body.ow-operational-interface .ow-sidebar .ow-nav {
    display: grid !important;
  }

  body.ow-operational-interface .ow-main {
    width: auto !important;
    height: 100vh;
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.ow-operational-interface .ow-content {
    min-height: 0;
    flex: 1 1 auto;
    overflow: auto;
  }

  body.ow-operational-interface .ow-app-shell.is-sidebar-collapsed .ow-sidebar {
    width: 78px !important;
    min-width: 78px !important;
    flex-basis: 78px !important;
    padding-inline: 10px !important;
  }

  body.ow-operational-interface .ow-app-shell.is-sidebar-collapsed :is(.ow-sidebar-brand-copy, .ow-sidebar-collapse-label em),
  body.ow-operational-interface .ow-app-shell.is-sidebar-collapsed .ow-nav-item > span:last-child,
  body.ow-operational-interface .ow-app-shell.is-sidebar-collapsed .ow-nav-section-title > span:last-child,
  body.ow-operational-interface .ow-app-shell.is-sidebar-collapsed .ow-nav-chevron,
  body.ow-operational-interface .ow-app-shell.is-sidebar-collapsed .ow-nav-group {
    display: none !important;
  }

  body.ow-operational-interface .ow-app-shell.is-sidebar-collapsed :is(.ow-sidebar-brand, .ow-nav > .ow-nav-item, .ow-nav-section-toggle, .ow-nav-section-title) {
    justify-content: center !important;
  }
}

@media (max-width: 47.99rem) {
  body.ow-operational-interface {
    overflow: auto;
  }

  body.ow-operational-interface .ow-app-shell {
    display: block;
    min-height: 100vh;
    overflow: visible;
  }

  body.ow-operational-interface .ow-sidebar {
    position: fixed !important;
    inset: 0 auto 0 0;
    z-index: 1200;
    width: min(88vw, 330px) !important;
    min-width: 0 !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    padding: 14px 12px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    border-radius: 0 !important;
    opacity: 1 !important;
    transform: translateX(-104%) !important;
    pointer-events: none;
    transition: transform .2s ease;
  }

  body.ow-operational-interface .ow-sidebar.is-mobile-open {
    transform: translateX(0) !important;
    pointer-events: auto;
  }

  body.ow-operational-interface .ow-sidebar-brand {
    position: static;
    padding: 0 0 12px;
  }

  body.ow-operational-interface .ow-sidebar .ow-nav {
    display: grid !important;
    max-height: none;
    margin-top: 0 !important;
    overflow: visible !important;
  }

  body.ow-operational-interface .ow-nav-group:not(.is-open) {
    display: none !important;
  }

  body.ow-operational-interface .ow-mobile-menu-toggle {
    display: inline-flex;
  }

  body.ow-operational-interface .ow-sidebar-collapse-label {
    display: none !important;
  }

  body.ow-operational-interface .ow-main {
    width: 100% !important;
    min-height: 100vh;
    padding: 10px 10px 24px;
  }

  body.ow-operational-interface .ow-operational-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 58px !important;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 9px;
    margin: -10px -10px 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #dbe4f0;
    background: rgba(244, 247, 251, .96);
    backdrop-filter: blur(12px);
  }

  body.ow-operational-interface .ow-mobile-app-menu {
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    padding: 9px;
  }

  body.ow-operational-interface .ow-mobile-app-menu svg {
    width: 22px;
    height: 22px;
  }

  body.ow-operational-interface .ow-topbar-heading {
    flex: 1 1 auto;
  }

  body.ow-operational-interface .ow-topbar-heading .ow-eyebrow {
    display: none;
  }

  body.ow-operational-interface .ow-topbar-heading h1 {
    font-size: 20px;
  }

  body.ow-operational-interface .ow-topbar-actions {
    width: auto;
    flex: 0 1 auto;
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  body.ow-operational-interface .ow-ai-assistant-toggle > span,
  body.ow-operational-interface .ow-operational-profile > span:last-child,
  body.ow-operational-interface .ow-operational-logout > span,
  body.ow-operational-interface .ow-language-switcher-icon {
    display: none;
  }

  body.ow-operational-interface .ow-operational-user {
    padding: 3px;
  }

  body.ow-operational-interface .ow-operational-profile,
  body.ow-operational-interface .ow-operational-logout {
    min-width: 38px;
    padding: 4px;
    justify-content: center;
  }

  body.ow-operational-interface .ow-mobile-sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    border: 0;
    background: rgba(4, 18, 36, .56);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  body.ow-operational-interface[data-mobile-menu-state="open"] .ow-mobile-sidebar-backdrop {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
}

@media (max-width: 36rem) {
  body.ow-operational-interface .ow-language-switcher.is-crm,
  body.ow-operational-interface .ow-sync-status,
  body.ow-operational-interface .ow-help-center-toggle {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.ow-operational-interface *,
  body.ow-operational-interface *::before,
  body.ow-operational-interface *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
