.ops-command-trigger,
.ops-notification-trigger {
  position: relative;
  min-width: 40px;
  min-height: 40px;
}

/* Professional shell controls ------------------------------------------------ */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ops-skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 12px;
  padding: 10px 14px;
  border-radius: 9px;
  background: #f8fafc;
  color: #052e23;
  font-size: 12px;
  font-weight: 800;
  transform: translateY(-160%);
  transition: transform .18s ease;
}

.ops-skip-link:focus { transform: translateY(0); }

.ops-mobile-menu {
  display: none;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #dff8ef;
  cursor: pointer;
}

.ops-nav-scrim {
  position: fixed;
  z-index: 84;
  inset: var(--shell-header-height) 0 0;
  border: 0;
  background: rgba(1, 8, 6, .68);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  backdrop-filter: blur(3px);
}

.ops-nav-filter-wrap {
  position: sticky;
  z-index: 2;
  top: -18px;
  margin: -1px 0 7px;
  padding: 1px 0 8px;
  background: linear-gradient(180deg, #091512 78%, rgba(9, 21, 18, 0));
}

.ops-nav-filter {
  width: 100%;
  height: 38px;
  padding: 0 11px 0 34px;
  border: 1px solid rgba(148, 163, 184, .14);
  border-radius: 10px;
  outline: 0;
  background: rgba(3, 13, 10, .72);
  color: #e5f5ef;
  font-size: 11px;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.ops-nav-filter-wrap > i {
  position: absolute;
  top: 13px;
  left: 12px;
  color: #6f847c;
  font-size: 11px;
}

.ops-nav-filter:focus {
  border-color: rgba(52, 211, 153, .65);
  box-shadow: 0 0 0 3px rgba(52, 211, 153, .09);
}

.ops-nav-filter-hidden { display: none !important; }

.ops-sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, .1);
}

.ops-density-button {
  min-height: 38px;
  justify-content: flex-start;
  color: #91a69e;
}

.ops-sidebar-hint {
  padding: 0 9px;
  color: #5f756d;
  font-size: 9px;
  line-height: 1.45;
}

.ops-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(148, 163, 184, .13);
  border-radius: 9px;
  background: rgba(255, 255, 255, .022);
  color: #8fa39c;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.ops-sync-status i { color: #34d399; font-size: 8px; }
.ops-sync-status.is-syncing i { animation: ops-pulse 1s ease-in-out infinite; }
.ops-sync-status.is-error i { color: #f87171; }

.ops-workspace-meta {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

@keyframes ops-pulse { 50% { opacity: .35; transform: scale(.78); } }

.app-container > [id^="tab-"].ops-view-enter {
  animation: ops-view-enter .2s ease-out;
}

@keyframes ops-view-enter {
  from { opacity: .35; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Keep column context visible in long operational ledgers. */
.table-container thead,
.data-table-wrapper thead {
  position: sticky;
  z-index: 3;
  top: 0;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #5ee0b0;
  outline-offset: 2px;
}

body.ops-compact .kpi-card { min-height: 142px; padding: 15px 17px; }
body.ops-compact .section-card { padding: 17px; margin-bottom: 15px; }
body.ops-compact th { padding: 9px 12px; }
body.ops-compact td { padding: 10px 12px; }
body.ops-compact .form-control { min-height: 38px; }

body.sidebar-collapsed .ops-nav-filter-wrap,
body.sidebar-collapsed .ops-sidebar-hint,
body.sidebar-collapsed .ops-density-button span { display: none; }

body.sidebar-collapsed .ops-density-button { justify-content: center; padding-inline: 8px; }

.ops-pagination { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:14px 2px; color:var(--text-muted); font-size:12px; }
.ops-pagination > div { display:flex; gap:8px; }
.ops-health-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:14px; }
.ops-health-card { border:1px solid var(--border); border-radius:16px; padding:18px; background:var(--card-bg, #fff); display:flex; flex-direction:column; gap:7px; text-transform:capitalize; }
.ops-health-card span,.ops-health-card small { color:var(--text-muted); }
.ops-health-card strong { font-size:22px; }
.ops-health-card.is-healthy { border-color:rgba(16,185,129,.38); }
.ops-health-card.is-degraded,.ops-health-card.is-unhealthy { border-color:rgba(239,68,68,.5); }
.ops-staff-form { display:grid; grid-template-columns:1fr 1fr; gap:14px; padding:18px; }
.ops-form-wide { grid-column:1 / -1; }
@media(max-width:700px){.ops-staff-form{grid-template-columns:1fr}.ops-form-wide{grid-column:auto}.ops-pagination{align-items:flex-start;flex-direction:column}}

.ops-command-trigger kbd {
  margin-left: 8px;
  padding: 2px 6px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 5px;
  color: var(--text-muted);
  font: 600 10px/1.3 Inter, sans-serif;
}

.ops-notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #08110f;
  border-radius: 10px;
  background: #ef4444;
  color: white;
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
}

.ops-alert-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.ops-alert-card {
  display: flex;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(16, 34, 29, 0.95), rgba(10, 24, 20, 0.95));
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.ops-alert-card:hover { border-color: rgba(52, 211, 153, 0.45); }
.ops-alert-card.is-critical { border-left: 3px solid #ef4444; }
.ops-alert-card.is-warning { border-left: 3px solid #f59e0b; }
.ops-alert-card.is-good { border-left: 3px solid #10b981; }
.ops-alert-card strong { display: block; margin-bottom: 3px; font-size: 20px; }
.ops-alert-card span { overflow: hidden; color: var(--text-muted); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.ops-analytics-card {
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.13);
  border-radius: 16px;
  background: linear-gradient(155deg, rgba(16, 34, 29, 0.96), rgba(11, 25, 21, 0.94));
}

.ops-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  align-items: end;
  gap: 12px;
  height: 180px;
  margin-top: 18px;
}

.ops-chart-column { display: flex; height: 100%; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.ops-chart-value { color: #dffaf0; font-size: 10px; font-weight: 750; }
.ops-chart-bar { width: min(38px, 75%); min-height: 4px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #34d399, #087a5b); box-shadow: 0 7px 18px rgba(16,185,129,.15); }
.ops-chart-label { color: var(--text-muted); font-size: 10px; }

.ops-insight-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:22px; margin-top:18px; padding-top:16px; border-top:1px solid rgba(148,163,184,.1); }
.ops-insight-grid h4 { margin:0 0 9px; font-size:12px; }
.ops-insight-grid p { color:var(--text-muted); font-size:11px; }
.ops-insight-row { display:flex; justify-content:space-between; gap:12px; padding:7px 0; border-bottom:1px solid rgba(148,163,184,.07); color:var(--text-muted); font-size:11px; }
.ops-insight-row strong { color:var(--text-main); }

.ops-panel {
  position: fixed;
  z-index: 220;
  top: calc(var(--shell-header-height) + 10px);
  right: 20px;
  width: min(430px, calc(100vw - 32px));
  max-height: calc(100vh - var(--shell-header-height) - 30px);
  overflow: auto;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 15px;
  background: #10231e;
  box-shadow: 0 24px 70px rgba(1,8,6,.65);
}

.ops-notification-row,
.ops-search-result {
  display: flex;
  width: 100%;
  gap: 11px;
  align-items: center;
  padding: 11px;
  border: 0;
  border-bottom: 1px solid rgba(148,163,184,.09);
  background: transparent;
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
}

.ops-notification-row:hover,
.ops-search-result:hover { background: rgba(52,211,153,.07); }

.ops-search-overlay { z-index: 250; }
.ops-search-card { width: min(680px, calc(100vw - 32px)) !important; padding: 18px !important; }
.ops-search-input { width: 100%; min-height: 50px; padding-left: 42px; font-size: 15px; }
.ops-search-wrap { position: relative; }
.ops-search-wrap > i { position: absolute; z-index: 2; top: 18px; left: 15px; color: #55dca9; }
.ops-search-results { max-height: min(520px, 65vh); margin-top: 10px; overflow: auto; }
.ops-result-icon { display:flex; width:34px; height:34px; flex:0 0 34px; align-items:center; justify-content:center; border-radius:9px; background:rgba(52,211,153,.1); color:#55dca9; }

.ops-audit-meta { max-width: 260px; overflow: hidden; color: var(--text-muted); font-family: ui-monospace, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.ops-live-dot { display:inline-block; width:7px; height:7px; margin-right:6px; border-radius:50%; background:#10b981; box-shadow:0 0 0 4px rgba(16,185,129,.1); }
.ops-live-dot.is-offline { background:#f59e0b; box-shadow:0 0 0 4px rgba(245,158,11,.1); }

@media (max-width: 1180px) { .ops-alert-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) {
  .ops-command-trigger span, .ops-command-trigger kbd { display: none; }
  .ops-alert-grid { grid-template-columns: minmax(0, 1fr); }
  .ops-panel { right: 10px; width: calc(100vw - 20px); }
  .ops-insight-grid { grid-template-columns:minmax(0,1fr); }
}

@media (max-width: 860px) {
  .ops-mobile-menu { display: inline-flex; }

  body .app-container > .tab-bar {
    position: fixed;
    z-index: 86;
    top: var(--shell-header-height);
    bottom: 0;
    left: 0;
    width: min(310px, calc(100vw - 48px));
    margin: 0;
    padding: 16px 14px 22px;
    border-right: 1px solid rgba(148, 163, 184, .15);
    border-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    box-shadow: 20px 0 50px rgba(1, 8, 6, .45);
    transform: translateX(-105%);
    transition: transform .22s cubic-bezier(.4, 0, .2, 1);
  }

  body.admin-nav-open { overflow: hidden; }
  body.admin-nav-open .app-container > .tab-bar { transform: translateX(0); }
  body.admin-nav-open .ops-nav-scrim { opacity: 1; pointer-events: auto; }

  body .app-container > .tab-bar .nav-section-label { display: block; }
  body .app-container > .tab-bar .tab-btn {
    width: 100%;
    min-height: 42px;
    justify-content: flex-start;
  }

  body .app-container > .tab-bar .tab-btn.active {
    box-shadow: inset 3px 0 0 #34d399, inset 0 0 0 1px rgba(52, 211, 153, .16);
  }

  .ops-nav-filter-wrap { top: -16px; }
  .ops-sidebar-footer { margin-top: 14px; }
}

@media (max-width: 620px) {
  .ops-sync-status { display: none; }
  .ops-workspace-meta { display: none; }
  .ops-command-trigger { min-width: 38px; padding-inline: 10px; }
  header .brand-title { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .ops-nav-scrim,
  body .app-container > .tab-bar,
  .app-container > [id^="tab-"].ops-view-enter { transition: none; animation: none; }
}

.ops-health-detail { grid-column:1 / -1; min-width:0; border:1px solid var(--border); border-radius:16px; padding:18px; background:var(--card-bg,#fff); }
.ops-health-detail h3 { margin:0 0 10px; font-size:16px; }
.ops-health-detail p { color:var(--text-muted); font-size:13px; line-height:1.5; margin-bottom:14px; }
.ops-health-detail .table-container { margin:14px 0; overflow-x:auto; }
.ops-health-detail .ops-health-card { text-transform:none; min-width:0; overflow-wrap:anywhere; }
@media(max-width:600px) { .ops-health-detail { padding:12px; } .ops-health-grid { grid-template-columns:minmax(0,1fr); } }
