/* CTOPS layout and workflow adapters for the Opium-owned Orchestra foundations. */
:root {
  color-scheme: light;
  font-family: var(--ods-font-sans);
  --font-mono: var(--ods-font-mono);
  --bg: var(--ods-neutral-25);
  --surface: var(--ods-white);
  --surface-strong: var(--ods-neutral-50);
  --surface-raised: var(--ods-white);
  --text: var(--ods-neutral-800);
  --muted: var(--ods-text-muted);
  --muted-soft: var(--ods-neutral-700);
  --accent: var(--ods-violet);
  --accent-deep: var(--ods-primary);
  --accent-soft: var(--ods-violet-surface);
  --border: var(--ods-neutral-200);
  --border-strong: var(--ods-neutral-300);
  --ring: rgb(86 75 170 / 18%);
  --sidebar-bg: var(--ods-neutral-25);
  --sidebar-border: var(--ods-neutral-200);
  --sidebar-text: var(--ods-neutral-700);
  --sidebar-text-strong: var(--ods-neutral-800);
  --sidebar-muted: var(--ods-neutral-700);
  --sidebar-hover: var(--ods-violet-surface);
  --content-bg: var(--ods-neutral-25);
  --control-surface: var(--ods-white);
  --control-surface-soft: var(--ods-white);
  --control-primary: var(--ods-violet);
  --good-bg: #f0fbf4;
  --good-text: var(--ods-green-700);
  --info-bg: #f4f7ff;
  --info-text: var(--ods-blue-700);
  --warn-bg: #fff6ed;
  --warn-text: var(--ods-orange-700);
  --danger-bg: #fef5f7;
  --danger-text: var(--ods-red-700);
}

body {
  background: var(--ods-neutral-25);
  color: var(--ods-neutral-800);
  font-family: var(--ods-font-sans);
  font-size: var(--ods-font-size-body);
}

.workspace-shell { background: var(--ods-neutral-25); }
.workspace-sidebar {
  gap: 18px;
  padding: 18px 10px 12px;
  background: var(--ods-neutral-25);
}
.workspace-sidebar-main { gap: 20px; }
.workspace-brand-lockup { padding: 0 9px; }
.workspace-brand { width: 126px; }
.sidebar-mobile-toggle { display: none; }
.workspace-nav { gap: 16px; }
.sidebar-section { gap: 6px; }
.sidebar-section-title {
  color: var(--ods-neutral-700);
  font-size: 11px;
  font-weight: 600;
}
.sidebar-nav-button,
.sidebar-nav-child-button {
  min-height: 34px;
  padding: 6px 9px;
  border-radius: var(--ods-radius-sm);
  font-size: var(--ods-font-size-nav);
  font-weight: 500;
}
.sidebar-nav-button:hover { border-color: var(--ods-violet-border); color: var(--ods-violet); }
.sidebar-nav-button.is-current {
  border-color: var(--ods-violet-border);
  background: var(--ods-white);
  color: var(--ods-violet);
  font-weight: 600;
  box-shadow: var(--ods-shadow-1);
}
.sidebar-nav-button.is-group-active { color: var(--ods-violet); }
.sidebar-nav-icon,
.sidebar-nav-icon svg { width: 17px; height: 17px; }
.sidebar-nav-sublist { padding-left: 24px; }
.sidebar-nav-child-marker { background: var(--ods-violet-muted); }
.sidebar-nav-child-button.is-current .sidebar-nav-child-marker { background: var(--ods-violet); }
.sidebar-footer { border-top: 1px solid var(--ods-neutral-200); padding-top: 9px; }
.sidebar-footer-title,
.sidebar-footer-copy,
.sidebar-signout { font-size: 13px; }

.workspace-content { background: var(--ods-neutral-25); }
.workspace-topbar {
  min-height: 42px;
  padding: 0 16px;
  background: var(--ods-white);
}
.breadcrumbs { color: var(--ods-neutral-700); font-size: 13px; font-weight: 400; }
.breadcrumbs strong { font-weight: 500; }
.breadcrumb-segment { gap: 7px; }
.bug-report-button {
  min-height: 28px;
  padding: 0 9px;
  border-color: var(--ods-neutral-200);
  background: var(--ods-white);
  color: var(--ods-neutral-700);
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
}
.bug-report-button:hover { border-color: var(--ods-violet-border); background: var(--ods-violet-surface); color: var(--ods-violet); transform: none; box-shadow: none; }
.bug-report-button svg { width: 14px; height: 14px; }

.dashboard-body,
.page-body,
.detail-page-body { gap: 16px; padding: 20px; }
.dashboard-heading h1 { font-size: 24px; font-weight: 600; }
.panel-heading h2 { font-size: 17px; font-weight: 600; }
.eyebrow { color: var(--ods-violet); font-size: 10px; font-weight: 600; }
.metric-tile,
.detail-panel,
.dashboard-panel,
.ods-panel {
  border-color: var(--ods-neutral-200);
  border-radius: var(--ods-radius-md);
  background: var(--ods-white);
  box-shadow: var(--ods-shadow-1);
}
.metric-tile { min-height: 110px; padding: 13px; }
.metric-tile strong { font-size: 27px; }
.rvm-summary-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }


.workspace-shell.is-live-view { height: 100vh; min-height: 0; overflow: hidden; }
.workspace-shell.is-live-view .workspace-content { min-height: 0; }
.flashtronix-live-board-all .flashtronix-slot {
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 2px;
  padding: 5px;
}
.flashtronix-live-board-all .flashtronix-slot-note,
.flashtronix-live-board-all .flashtronix-slot-detail { display: none; }
.flashtronix-live-board-all .flashtronix-slot.has-attention {
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.flashtronix-live-board-all .flashtronix-slot.has-attention .flashtronix-slot-target {
  display: none;
}
.flashtronix-live-board-all .flashtronix-slot.has-attention .flashtronix-slot-detail {
  display: block;
}
.flashtronix-live-board-all .flashtronix-slot-progress-stack { gap: 2px; }
.flashtronix-live-board-all .flashtronix-slot-progress-row { gap: 1px; }

.field > span,
.table-search-field span,
.table-filter-field span,
.page-size-field span {
  color: var(--ods-neutral-700);
  font-size: var(--ods-font-size-label);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}
:is(.field, .table-filter-field, .table-search-field) :is(input, select, textarea),
.page-size-field select {
  min-height: 36px;
  padding: 7px 11px;
  border: 1px solid var(--ods-neutral-200);
  border-radius: var(--ods-radius-sm);
  background-color: var(--ods-white);
  color: var(--ods-neutral-800);
  font-size: 13px;
  font-weight: 400;
  box-shadow: 0 1px 2px rgb(27 27 31 / 5%);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
:is(.field, .table-filter-field, .table-search-field) :is(input, select, textarea):hover { transform: none; }
:is(.field, .table-filter-field, .table-search-field) :is(input, select, textarea):focus-visible,
.page-size-field select:focus-visible {
  border-color: var(--ods-violet);
  box-shadow: var(--ods-focus);
}
.readonly-field-value { min-height: 36px; border-radius: var(--ods-radius-sm); background: var(--ods-neutral-25); box-shadow: none; }

:is(.primary-button, .ghost-button, .icon-button, .danger-button, .table-toolbar-action-button):not(.auth-screen *) {
  min-height: 34px;
  border-radius: var(--ods-radius-sm);
  font-size: 12px;
  font-weight: 500;
  box-shadow: none;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease,
    box-shadow 140ms ease;
}
.primary-button:not(.auth-screen *) { border-color: var(--ods-violet); background: var(--ods-violet); color: var(--ods-white); }
.primary-button:not(.auth-screen *):hover:not(:disabled) { border-color: var(--ods-violet-hover); background: var(--ods-violet-hover); transform: none; }
.ghost-button:not(.auth-screen *),
.icon-button:not(.auth-screen *) { border-color: var(--ods-neutral-300); background: var(--ods-white); color: var(--ods-neutral-800); }
.ghost-button:not(.auth-screen *):hover:not(:disabled),
.icon-button:not(.auth-screen *):hover:not(:disabled) { border-color: var(--ods-violet-border); background: var(--ods-violet-surface); color: var(--ods-violet); transform: none; }
.danger-button:not(.auth-screen *) { border-color: var(--ods-red-700); background: var(--ods-red-700); color: var(--ods-white); }

.operations-table-wrap,
.ods-table-frame { border-color: var(--ods-neutral-200); border-radius: var(--ods-radius-md); box-shadow: var(--ods-shadow-1); }
.operations-table th,
.operations-table td { height: 40px; padding: 7px 12px; border-bottom-color: var(--ods-neutral-200); }
.operations-table th { background: var(--ods-neutral-25); color: var(--ods-neutral-700); font-size: var(--ods-font-size-table-heading); font-weight: 600; text-transform: none; }
.operations-table td { color: var(--ods-neutral-800); font-size: var(--ods-font-size-table); }
.operations-table tbody tr:hover td { background: var(--ods-violet-surface); }
.operations-table-sort-button { font-weight: 500; text-transform: none; }
.operations-table tbody tr.is-selected td { background: var(--ods-violet-surface); }

.modal-backdrop { z-index: 100; background: rgb(18 18 27 / 42%); backdrop-filter: none; }
.modal-panel {
  padding: 20px;
  border-color: var(--ods-neutral-200);
  border-radius: var(--ods-radius-md);
  box-shadow: var(--ods-shadow-2);
}
.modal-heading h2 { font-size: 18px; font-weight: 600; }
.modal-close-button { border-radius: var(--ods-radius-sm); }

:is(.user-tag, .role-tag, .lifecycle-tag, .resource-lifecycle-tag,
  .resource-tag, .smart-pole-status-tag, .flashtronix-connection-state) {
  min-height: 22px;
  padding: 2px 7px;
  border-radius: var(--ods-radius-sm);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
}
.user-tag-status-active,
.resource-lifecycle-tag-active { border-color: var(--ods-green-100); background: #f0fbf4; color: var(--ods-green-700); }
.user-tag-status-invited { border-color: var(--ods-orange-100); background: #fff6ed; color: var(--ods-orange-700); }
.user-tag-status-disabled,
.resource-lifecycle-tag-decommissioned { border-color: var(--ods-red-100); background: #fef5f7; color: var(--ods-red-700); }

.auth-form-region .ods-field input { box-shadow: none; }
.auth-form-region .ods-field input:focus-visible { border-color: var(--ods-violet-muted); box-shadow: 0 1px 0 var(--ods-violet-muted); }
.auth-form-region .ods-button--primary {
  border-color: var(--ods-violet-muted);
  background: rgb(86 75 170 / 18%);
  color: #f5f5f6;
  box-shadow: none;
}
.auth-form-region .ods-button--primary:hover:not(:disabled) { border-color: var(--ods-violet-muted); background: var(--ods-violet); color: white; }

@media (max-width: 760px) {
  .workspace-shell.is-live-view { height: auto; min-height: 100vh; overflow: visible; }
  .workspace-sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    gap: 0;
    padding: 10px 12px;
    box-shadow: var(--ods-shadow-1);
  }
  .workspace-sidebar-main { gap: 0; grid-template-rows: auto auto; }
  .workspace-brand-lockup {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    padding: 0 4px;
  }
  .workspace-brand { width: 110px; }
  .sidebar-mobile-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--ods-neutral-300);
    border-radius: var(--ods-radius-sm);
    background: var(--ods-white);
    color: var(--ods-neutral-800);
    font: 500 12px/1 var(--ods-font-sans);
    cursor: pointer;
  }
  .sidebar-mobile-toggle:focus-visible { outline: 0; box-shadow: var(--ods-focus); }
  .workspace-sidebar:not(.is-mobile-nav-open) :is(.workspace-nav, .sidebar-footer) {
    display: none;
  }
  .workspace-sidebar.is-mobile-nav-open { gap: 12px; }
  .workspace-sidebar.is-mobile-nav-open .workspace-sidebar-main { gap: 12px; }
  .workspace-sidebar.is-mobile-nav-open .workspace-nav {
    max-height: min(58vh, 520px);
    overflow-y: auto;
    padding: 4px 0;
  }
  .workspace-sidebar.is-mobile-nav-open .sidebar-footer {
    border-top: 1px solid var(--ods-neutral-200);
    padding: 10px 4px 0;
  }
  .flashtronix-live-page {
    height: auto;
    min-height: calc(100svh - 120px);
    overflow: visible;
    grid-template-rows: auto auto auto;
  }
  .flashtronix-live-board-all,
  .flashtronix-live-board-solo {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .flashtronix-section {
    display: block;
    overflow-x: auto;
    padding: 8px;
  }
  .flashtronix-section-heading { margin-bottom: 7px; }
  .flashtronix-slot-grid-red,
  .flashtronix-slot-grid-blue {
    width: max-content;
    grid-template-columns: repeat(4, 114px);
    grid-template-rows: repeat(6, 88px);
  }
  .flashtronix-slot-grid-air {
    width: max-content;
    grid-template-columns: repeat(12, 98px);
    grid-template-rows: repeat(2, 88px);
  }
  .dashboard-body,
  .page-body,
  .detail-page-body { padding: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  :is(.primary-button, .ghost-button, .icon-button) { transition: none; }
}
