/* ======================================================================
   FTA Ops — Shell Layout: Rail + Header + Content Tabs
   Shared by all 5 main admin pages
   ====================================================================== */

/* ── Rail ── */
.ops-rail {
  position: fixed;
  top: 0;
  left: 0;
  width: 64px;
  height: 100vh;
  background: var(--bg-light);
  border-right: 1px solid var(--card-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  z-index: 50;
  overflow: visible;
}

.ops-rail-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 0 10px;
  color: var(--primary);
  border-bottom: 1px solid var(--card-light);
  width: 100%;
}
.ops-rail-logo:hover {
  background: var(--card);
}
.ops-rail-logo svg {
  pointer-events: none;
}
.ops-rail-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 2px;
  margin-top: 2px;
  color: var(--primary);
}

/* Rail sections */
.ops-rail-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 0;
  width: 100%;
}

.ops-rail-divider {
  width: 32px;
  height: 1px;
  background: var(--card-light);
}

/* Rail items */
.ops-rail-item {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}
.ops-rail-item svg {
  pointer-events: none;
}

/* Tooltips */
.ops-rail-item::after {
  content: attr(data-label);
  position: absolute;
  left: 56px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--brand);
  color: #fff;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
  z-index: 60;
}
.ops-rail-item:hover::after {
  opacity: 1;
}

/* Cockpit section (orange) */
.ops-rail-section.cockpit .ops-rail-item {
  color: var(--brand);
}
.ops-rail-section.cockpit .ops-rail-item:hover {
  background: var(--brand-bg);
  color: var(--brand);
}
.ops-rail-section.cockpit .ops-rail-item.active {
  background: var(--brand);
  color: #fff;
}

/* Verwaltung section (muted) */
.ops-rail-section.verwaltung .ops-rail-item {
  color: var(--text-muted);
}
.ops-rail-section.verwaltung .ops-rail-item:hover {
  background: var(--card);
  color: var(--text);
}
.ops-rail-section.verwaltung .ops-rail-item.active {
  background: var(--card);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--card-light);
}

/* ── Header ── */
.ops-header {
  position: fixed;
  top: 0;
  left: 64px;
  right: 0;
  height: 54px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--card-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 40;
}

.ops-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ops-header-brand {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.5px;
}
.ops-header-sep {
  color: var(--text-muted);
  font-size: 16px;
}
.ops-header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.ops-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Theme switcher in header */
.ops-theme-switcher {
  display: flex;
  gap: 2px;
  background: var(--card);
  border-radius: 6px;
  padding: 2px;
}
.ops-theme-btn {
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 20px;
  width: 36px;
  height: 36px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ops-theme-btn:hover { color: var(--text); }
.ops-theme-btn.active { background: var(--primary); color: #fff; border-radius: 8px; }

.ops-logout-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.15s;
}
.ops-logout-btn:hover {
  background: var(--card);
  color: var(--text);
}

#ops-admin-name {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ── Content Tabs ── */
.ops-content-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--card-light);
  margin-bottom: 20px;
}
.ops-content-tab {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ops-content-tab:hover {
  color: var(--text);
}
.ops-content-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ── Shell Layout ── */
.ops-main {
  margin-left: 64px;
  margin-top: 54px;
  min-height: calc(100vh - 54px);
}

/* ── Dark/High Contrast active state overrides ── */
[data-theme="dark"] .ops-rail-section.verwaltung .ops-rail-item.active,
[data-theme="high-contrast"] .ops-rail-section.verwaltung .ops-rail-item.active {
  background: var(--card);
  color: var(--text);
}

/* Light theme overrides */
[data-theme="light"] .ops-rail-section.verwaltung .ops-rail-item.active {
  background: var(--surface-hover);
  color: var(--text-primary);
}
[data-theme="light"] .ops-rail-section.cockpit .ops-rail-item.active {
  background: var(--brand);
  color: #fff;
}
[data-theme="light"] .ops-rail-section.verwaltung .ops-rail-item {
  color: var(--text-muted);
}

/* ── Toast System ── */
.ops-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}
.ops-toast {
  pointer-events: auto;
  background: var(--card);
  border: 1px solid var(--card-light);
  border-left: 3px solid var(--text-muted);
  border-radius: 8px;
  padding: 12px 16px;
  min-width: 320px;
  max-width: 480px;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  opacity: 0;
  transform: translateX(40px);
  transition: opacity .25s, transform .25s;
}
.ops-toast.ops-toast-show {
  opacity: 1;
  transform: translateX(0);
}
.ops-toast.ops-toast-hide {
  opacity: 0;
  transform: translateX(40px);
}
.ops-toast-success { border-left-color: var(--success); }
.ops-toast-error   { border-left-color: var(--error); }
.ops-toast-warning { border-left-color: var(--warn, #d97706); }
.ops-toast-info    { border-left-color: var(--blue, #3b82f6); }

.ops-toast-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ops-toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.ops-toast-success .ops-toast-icon { color: var(--success); }
.ops-toast-error .ops-toast-icon   { color: var(--error); }
.ops-toast-warning .ops-toast-icon { color: var(--warn, #d97706); }
.ops-toast-info .ops-toast-icon    { color: var(--blue, #3b82f6); }

.ops-toast-msg {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.ops-toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.ops-toast-close:hover { color: var(--text); }
.ops-toast-expand {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
}
.ops-toast-expand:hover { color: var(--text); }
.ops-toast-copy {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
}
.ops-toast-copy:hover { color: var(--text); }
.ops-toast-detail {
  margin-top: 8px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: 6px;
  font-family: 'SF Mono','Consolas',monospace;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 160px;
  overflow-y: auto;
  line-height: 1.5;
}

/* ── Notification History Bell ── */
.ops-bell-wrap {
  position: relative;
}
.ops-bell-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s;
}
.ops-bell-btn:hover {
  background: var(--card);
  color: var(--text);
}
.ops-bell-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--error);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ops-bell-badge:empty { display: none; }
.ops-bell-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  width: 340px;
  max-height: 400px;
  background: var(--card);
  border: 1px solid var(--card-light);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 210;
  overflow: hidden;
  display: none;
}
.ops-bell-dropdown.open { display: block; }
.ops-bell-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--card-light);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.ops-bell-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
}
.ops-bell-clear:hover { color: var(--error); background: rgba(239,68,68,.08); }
.ops-bell-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 4px 0;
}
.ops-bell-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--card-light);
}
.ops-bell-item:last-child { border-bottom: none; }
.ops-bell-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.ops-bell-dot-success { background: var(--success); }
.ops-bell-dot-error { background: var(--error); }
.ops-bell-dot-warning { background: var(--warn, #d97706); }
.ops-bell-dot-info { background: var(--blue, #3b82f6); }
.ops-bell-msg { flex: 1; line-height: 1.4; }
.ops-bell-time { color: var(--text-muted); font-size: 10px; white-space: nowrap; }
.ops-bell-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* ── Connection Status ── */
.ops-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ops-status-dot-online { background: var(--success); }
.ops-status-dot-degraded { background: var(--warn, #d97706); }
.ops-status-dot-offline { background: var(--error); animation: ops-pulse-dot 2s infinite; }
@keyframes ops-pulse-dot { 0%,100%{opacity:1} 50%{opacity:.4} }

.ops-offline-banner {
  position: fixed;
  top: 54px;
  left: 64px;
  right: 0;
  z-index: 45;
  background: var(--warn, #d97706);
  color: #fff;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
}
.ops-main[data-stale] {
  opacity: 0.6;
  pointer-events: none;
}

/* ── Sub-Navigation ── */
.ops-subnav {
  position: fixed;
  top: 54px;
  left: 64px;
  right: 0;
  height: 44px;
  z-index: 39;
  background: var(--bg);
  border-bottom: 1px solid var(--card-light);
  display: flex;
  align-items: center;
}
.ops-subnav-back {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.ops-subnav-back:hover { color: var(--text); }
.ops-subnav-back svg { flex-shrink: 0; }
.ops-subnav-divider {
  width: 1px;
  height: 24px;
  background: var(--card-light);
  flex-shrink: 0;
}
.ops-subnav-items {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.ops-subnav-items::-webkit-scrollbar { display: none; }
.ops-subnav-item {
  padding: 0 16px;
  height: 44px;
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  scroll-snap-align: start;
  transition: color .15s, border-color .15s;
}
.ops-subnav-item:hover { color: var(--text); }
.ops-subnav-item.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.ops-has-subnav .ops-offline-banner { top: 98px; }
