/* ============================================================
   ATLAS OPS THEME
   Opt-in MSP service-board layout. Existing themes are untouched.
   ============================================================ */

body.theme-atlas {
  --atlas-bg: #eef3f8;
  --atlas-ink: #172033;
  --atlas-muted: #667085;
  --atlas-line: #d7dee8;
  --atlas-line-strong: #b9c4d3;
  --atlas-surface: #ffffff;
  --atlas-surface-2: #f7fafc;
  --atlas-navy: #111827;
  --atlas-teal: #0f9f94;
  --atlas-blue: #2563eb;
  --atlas-green: #16a34a;
  --atlas-amber: #d97706;
  --atlas-red: #dc2626;
  --atlas-violet: #7c3aed;
  --bg-main: var(--atlas-bg);
  --bg-alt: var(--atlas-surface);
  --card-bg: var(--atlas-surface);
  --text-main: var(--atlas-ink);
  --text-muted: var(--atlas-muted);
  --border-subtle: var(--atlas-line);
  --accent: var(--atlas-teal);
  --accent-blue: var(--atlas-blue);
  --glass-bg: var(--atlas-surface);
  --glass-bg-hover: #f8fbfe;
  --glass-border: var(--atlas-line);
  --glass-shadow: 0 18px 42px rgba(18, 32, 51, 0.12);
  background:
    linear-gradient(180deg, #f8fbfe 0%, #eef3f8 38%, #e8eef5 100%);
  color: var(--atlas-ink);
}

body.theme-atlas .app-shell {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  grid-template-rows: 62px 76px minmax(0, 1fr) 34px;
  height: 100vh;
  gap: 0;
  padding: 0;
  background: var(--atlas-bg);
}

body.theme-atlas .app-header {
  grid-column: 1 / 3;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 18px;
  border: 0;
  border-bottom: 1px solid #0f172a;
  border-radius: 0;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(17, 24, 39, 0.22);
}

body.theme-atlas .header-logo-overlay {
  position: static;
  transform: none;
  width: auto;
  flex: 0 0 auto;
  order: -1;
}

body.theme-atlas .header-logo-overlay img {
  width: 34px;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.28));
}

body.theme-atlas .logo-title {
  flex: 1 1 auto;
  min-width: 0;
  gap: 10px;
}

body.theme-atlas .logo-circle {
  width: 8px;
  height: 36px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--atlas-teal), var(--atlas-blue));
  box-shadow: none;
}

body.theme-atlas h1 {
  font-size: 17px;
  line-height: 1.1;
  letter-spacing: 0;
  color: #ffffff;
  text-transform: none;
}

body.theme-atlas .header-subline {
  margin-top: 3px;
  color: #a7b3c5;
  font-size: 12px;
}

body.theme-atlas .header-right {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

body.theme-atlas .header-badge {
  height: 34px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.08);
  color: #dbeafe;
}

body.theme-atlas .header-pill,
body.theme-atlas .btn-icon,
body.theme-atlas .btn-new-interface {
  height: 34px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 6px;
  background: rgba(255,255,255,0.08);
  color: #f8fafc;
  box-shadow: none;
}

body.theme-atlas .header-pill:hover,
body.theme-atlas .btn-icon:hover,
body.theme-atlas .btn-new-interface:hover {
  background: rgba(255,255,255,0.14);
  transform: none;
}

body.theme-atlas #currentUserEmail {
  color: #cbd5e1 !important;
}

body.theme-atlas .services-toolbar {
  grid-column: 1;
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 14px;
  border-right: 1px solid var(--atlas-line);
  background: #f7fafc;
  overflow: auto;
}

body.theme-atlas .services-toolbar::before {
  content: "Service Board";
  color: var(--atlas-ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

body.theme-atlas .services-toolbar-actions {
  width: 100%;
}

body.theme-atlas .services-bar {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  width: 100%;
}

body.theme-atlas .service-pill {
  width: 100%;
  justify-content: flex-start;
  min-height: 38px;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  background: var(--atlas-surface);
  color: var(--atlas-ink);
  box-shadow: 0 8px 18px rgba(18, 32, 51, 0.05);
}

body.theme-atlas .service-pill:hover {
  border-color: var(--atlas-teal);
  background: #f0fdfa;
  transform: none;
}

body.theme-atlas .search-panel {
  grid-column: 2;
  grid-row: 2;
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 0;
  border-bottom: 1px solid var(--atlas-line);
  border-radius: 0;
  background: var(--atlas-surface);
  box-shadow: none;
}

body.theme-atlas .search-panel::before {
  content: "Dispatch";
  align-self: center;
  color: var(--atlas-muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0;
}

body.theme-atlas .search-input-group {
  min-width: 0;
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  background: #f8fafc;
}

body.theme-atlas .search-input {
  color: var(--atlas-ink);
}

body.theme-atlas .search-input::placeholder {
  color: #94a3b8;
}

body.theme-atlas .severity-sort,
body.theme-atlas .search-actions .btn,
body.theme-atlas .btn,
body.theme-atlas .d-btn {
  border-radius: 7px;
  border: 1px solid var(--atlas-line);
  background: var(--atlas-surface);
  color: var(--atlas-ink);
  box-shadow: none;
}

body.theme-atlas .search-actions {
  justify-self: end;
}

body.theme-atlas .btn-primary,
body.theme-atlas .d-btn-primary {
  border-color: var(--atlas-teal);
  background: var(--atlas-teal);
  color: #ffffff;
}

body.theme-atlas .main-layout {
  grid-column: 2;
  grid-row: 3;
  display: grid;
  grid-template-columns: minmax(520px, 1.24fr) 8px minmax(360px, 0.76fr);
  min-height: 0;
  gap: 0;
  padding: 0;
  overflow: hidden;
  background: var(--atlas-bg);
}

body.theme-atlas .pane {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: var(--atlas-surface);
  box-shadow: none;
}

body.theme-atlas .pane-left {
  border-right: 1px solid var(--atlas-line);
}

body.theme-atlas .pane-right {
  border-left: 1px solid var(--atlas-line);
}

body.theme-atlas .pane-divider {
  background: var(--atlas-bg);
}

body.theme-atlas .pane-divider::after {
  background: var(--atlas-line-strong);
}

body.theme-atlas .pane-header {
  min-height: 56px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--atlas-line);
  background: #fbfdff;
}

body.theme-atlas .pane-asset-tabs {
  gap: 6px;
}

body.theme-atlas .pane-asset-tab {
  height: 32px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--atlas-muted);
  background: transparent;
}

body.theme-atlas .pane-asset-tab.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: var(--atlas-blue);
}

body.theme-atlas .stats-bar {
  gap: 6px;
}

body.theme-atlas .stats-pill {
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--atlas-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--atlas-muted);
}

body.theme-atlas .stats-count {
  font-size: 16px;
  color: var(--atlas-ink);
}

body.theme-atlas .stats-red { color: var(--atlas-red); }
body.theme-atlas .stats-amber { color: var(--atlas-amber); }
body.theme-atlas .stats-green { color: var(--atlas-green); }
body.theme-atlas .stats-offline { color: var(--atlas-violet); }

body.theme-atlas .list-header {
  border-bottom: 1px solid var(--atlas-line);
  background: #f8fafc;
  color: var(--atlas-muted);
}

body.theme-atlas .card-list.list-view .system-row {
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--atlas-line);
  border-radius: 0;
  background: #ffffff;
  color: var(--atlas-ink);
  box-shadow: none;
}

body.theme-atlas .card-list.list-view .system-row:hover {
  background: #f8fafc;
}

body.theme-atlas .card-list.list-view .system-row.selected {
  background: #ecfeff;
  box-shadow: inset 4px 0 0 var(--atlas-teal);
}

body.theme-atlas .card-list:not(.list-view) {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 12px;
  background: var(--atlas-bg);
}

body.theme-atlas .system-card {
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--atlas-ink);
  box-shadow: 0 10px 22px rgba(18, 32, 51, 0.07);
}

body.theme-atlas .system-card:hover {
  border-color: #93c5fd;
  transform: translateY(-1px);
}

body.theme-atlas .system-card.selected {
  border-color: var(--atlas-teal);
  box-shadow: 0 0 0 2px rgba(15, 159, 148, 0.16), 0 12px 24px rgba(18, 32, 51, 0.08);
}

body.theme-atlas .details-wrapper {
  background: #ffffff;
}

body.theme-atlas .details-header {
  min-height: 58px;
  border-bottom: 1px solid var(--atlas-line);
  background: #fbfdff;
}

body.theme-atlas .details-title {
  color: var(--atlas-ink);
}

body.theme-atlas .details-tab-btn {
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--atlas-muted);
  background: transparent;
}

body.theme-atlas .details-tab-btn.active {
  border-color: #ccfbf1;
  background: #f0fdfa;
  color: var(--atlas-teal);
}

body.theme-atlas .details-bubble,
body.theme-atlas .details-section,
body.theme-atlas .capability-summary,
body.theme-atlas .diagnostic-popover,
body.theme-atlas .settings-panel,
body.theme-atlas .user-panel,
body.theme-atlas #lookupPanel {
  border: 1px solid var(--atlas-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--atlas-ink);
  box-shadow: 0 14px 30px rgba(18, 32, 51, 0.08);
}

body.theme-atlas .detail-row {
  border-bottom-color: var(--atlas-line);
}

body.theme-atlas .d-label,
body.theme-atlas .metric-label,
body.theme-atlas .status-explanation-line strong {
  color: var(--atlas-muted);
}

body.theme-atlas .d-value {
  color: var(--atlas-ink);
}

body.theme-atlas input,
body.theme-atlas select,
body.theme-atlas textarea {
  border: 1px solid var(--atlas-line);
  border-radius: 7px;
  background: #ffffff;
  color: var(--atlas-ink);
}

body.theme-atlas input:focus,
body.theme-atlas select:focus,
body.theme-atlas textarea:focus {
  border-color: var(--atlas-teal);
  box-shadow: 0 0 0 3px rgba(15, 159, 148, 0.14);
}

body.theme-atlas .app-footer {
  grid-column: 1 / 3;
  grid-row: 4;
  border-top: 1px solid var(--atlas-line);
  background: #ffffff;
  color: var(--atlas-muted);
}

body.theme-atlas ::-webkit-scrollbar-thumb {
  background: #b8c3d2;
}

body.theme-atlas ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

@media (max-width: 1180px) {
  body.theme-atlas .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }

  body.theme-atlas .app-header,
  body.theme-atlas .search-panel,
  body.theme-atlas .services-toolbar,
  body.theme-atlas .main-layout,
  body.theme-atlas .app-footer {
    grid-column: 1;
  }

  body.theme-atlas .app-header {
    grid-row: 1;
    flex-wrap: wrap;
    min-height: 68px;
    padding: 10px 14px;
  }

  body.theme-atlas .services-toolbar {
    grid-row: 3;
    border-right: 0;
    border-bottom: 1px solid var(--atlas-line);
  }

  body.theme-atlas .services-toolbar::before {
    font-size: 15px;
  }

  body.theme-atlas .services-bar {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  body.theme-atlas .search-panel {
    grid-row: 2;
    grid-template-columns: 1fr;
  }

  body.theme-atlas .main-layout {
    grid-row: 4;
    grid-template-columns: 1fr;
  }

  body.theme-atlas .app-footer {
    grid-row: 5;
  }
}

@media (max-width: 720px) {
  body.theme-atlas .header-right,
  body.theme-atlas .pane-header-right,
  body.theme-atlas .search-actions {
    justify-content: flex-start;
    width: 100%;
  }

  body.theme-atlas .stats-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
  }
}
