:root {
  --bg: #06111d;
  --bg-elevated: #0b1726;
  --panel: rgba(12, 24, 39, 0.94);
  --panel-soft: rgba(18, 34, 54, 0.82);
  --panel-strong: #11233a;
  --line: rgba(53, 79, 111, 0.42);
  --line-strong: rgba(95, 142, 195, 0.55);
  --text: #ebf2fb;
  --text-soft: #9eb2cb;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.36);
  --ok: #22c55e;
  --warning: #f59e0b;
  --critical: #ef4444;
  --info: #38bdf8;
  --muted: #64748b;
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(20, 184, 166, 0.13), transparent 20%),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.14), transparent 24%),
    linear-gradient(180deg, #08111c 0%, #06111d 44%, #030a12 100%);
}

a {
  color: inherit;
}

.tooltip-layer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 140;
  pointer-events: none;
  width: max-content;
  max-width: min(360px, calc(100vw - 28px));
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(95, 142, 195, 0.42);
  background: rgba(4, 12, 20, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  color: var(--text);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.tooltip-layer.visible {
  opacity: 1;
  transform: translateY(0);
}

[data-tooltip]:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.58);
  outline-offset: 2px;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 10px 24px;
  background: rgba(5, 14, 24, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(53, 79, 111, 0.45);
}

.brand-block {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

.brand-kicker,
.eyebrow,
.sidebar-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: var(--text-soft);
  font-weight: 700;
}

.brand-kicker {
  display: none;
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar p {
  display: none;
}

.topbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.topbar-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 12px;
}

.topbar-meta,
.live-badge,
.pill,
.sidebar-card,
.warning-banner,
.kpi-card,
.board-shell,
.queue-card,
.notification-panel,
.modal,
.slideover,
.loading-state,
.error-state,
.operator-hero,
.feature-panel,
.quick-link,
.tab-panel,
.monitor-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.topbar-meta {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  color: var(--text-soft);
}

.topbar-meta span {
  display: inline;
  font-size: inherit;
  color: inherit;
  text-transform: none;
  letter-spacing: 0;
}

.topbar-meta strong {
  display: inline;
  margin-top: 0;
  font-size: inherit;
  color: var(--text);
}

.topbar-divider {
  color: var(--text-soft);
  font-size: 12px;
}

.topbar-refresh {
  padding: 10px 14px;
}

.live-badge,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-color: transparent;
}

.tone-ok,
.pill-ok {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.3);
}

.tone-warning,
.pill-warning {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.3);
}

.tone-critical,
.pill-critical {
  color: #fee2e2;
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.3);
}

.tone-info,
.pill-info {
  color: #dbeafe;
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.3);
}

.pill-muted {
  color: var(--text-soft);
  background: rgba(100, 116, 139, 0.12);
  border-color: rgba(100, 116, 139, 0.18);
}

.nav-strip {
  position: sticky;
  top: 56px;
  z-index: 50;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 24px 12px;
  background: rgba(6, 17, 29, 0.76);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(53, 79, 111, 0.28);
}

.nav-strip a {
  text-decoration: none;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.nav-strip a:hover,
.nav-strip a.active {
  color: var(--text);
  background: rgba(16, 31, 49, 0.95);
  border-color: rgba(56, 189, 248, 0.24);
}

.page-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 24px;
  padding: 28px;
}

.page-main,
.page-single {
  min-width: 0;
}

.page-single {
  padding: 28px;
}

.sidebar {
  position: sticky;
  top: 178px;
  align-self: start;
}

.sidebar-card {
  padding: 18px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 10px 0;
  color: var(--text-soft);
}

.sidebar-link:hover {
  color: var(--text);
}

.sidebar-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.sidebar-count,
.queue-count {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(6, 17, 29, 0.9);
  font-size: 12px;
}

.warning-banner {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.14), rgba(16, 31, 49, 0.96));
}

.warning-banner strong {
  display: block;
  margin-bottom: 8px;
}

.warning-banner ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-soft);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.kpi-card {
  padding: 18px;
}

.kpi-value {
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 800;
}

.kpi-label {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.operator-view {
  display: grid;
  gap: 20px;
}

.summary-bar,
.instruction-strip,
.next-actions-panel {
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  font-size: 14px;
  border-left: 3px solid transparent;
}

.summary-bar.summary-bar-critical {
  border-left-color: var(--critical);
}

.summary-bar.summary-bar-warning {
  border-left-color: var(--warning);
}

.summary-bar.summary-bar-ok {
  border-left-color: var(--ok);
}

.summary-metric strong {
  color: var(--text);
}

.summary-past-sla.is-hot {
  color: #fca5a5;
  font-weight: 700;
}

.summary-past-sla.is-clear {
  color: #86efac;
  font-weight: 700;
}

.summary-oldest {
  color: #fbbf24;
  font-weight: 700;
}

.summary-clear {
  color: #86efac;
  font-weight: 700;
}

.instruction-strip {
  color: var(--text-soft);
  font-weight: 600;
  line-height: 1.6;
}

.next-actions-panel {
  border-left: 4px solid var(--critical);
}

.next-actions-panel.tone-ok {
  color: var(--text);
  background: var(--panel);
  border-color: var(--line);
  border-left-color: var(--ok);
}

.next-actions-panel.tone-critical {
  color: var(--text);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), rgba(12, 24, 39, 0.96));
  border-color: rgba(239, 68, 68, 0.28);
}

.next-actions-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.next-actions-head h3 {
  margin: 6px 0 0;
  font-size: 24px;
}

.next-actions-list {
  display: grid;
  gap: 12px;
}

.next-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(53, 79, 111, 0.28);
  background: rgba(11, 23, 38, 0.78);
}

.next-action-copy {
  display: grid;
  gap: 6px;
}

.next-action-copy strong {
  font-size: 15px;
  line-height: 1.5;
}

.next-action-copy span {
  color: var(--text-soft);
  line-height: 1.5;
}

.operator-hero {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 16px;
  border-left: 4px solid var(--hero-accent, #38bdf8);
}

.operator-avatar-large,
.board-avatar {
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: linear-gradient(135deg, color-mix(in srgb, var(--hero-accent, #38bdf8) 30%, #08111c), var(--hero-accent, #38bdf8));
}

.operator-avatar-large {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 18px;
}

.operator-copy {
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.operator-copy h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
}

.operator-role,
.operator-description,
.hero-note,
.feature-copy,
.board-title p,
.queue-note,
.muted,
.preview-text,
.notification-head span,
.notification-item span,
.result-row span,
.queue-empty,
.timeline-empty {
  color: var(--text-soft);
}

.operator-role {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.operator-description,
.hero-note,
.feature-copy,
.queue-note {
  margin: 0;
  line-height: 1.6;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.quick-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.quick-link:hover,
.queue-stat:hover,
.tab-button:hover,
.pipeline-step:hover,
.qa-card:hover,
.mini-button:hover,
.icon-button:hover,
.action-pill:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
}

.quick-link-value {
  font-size: 28px;
  font-weight: 800;
}

.quick-link-copy {
  display: grid;
  gap: 2px;
}

.quick-link-copy strong {
  font-size: 14px;
}

.quick-link-copy span {
  color: var(--text-soft);
  font-size: 12px;
}

.feature-panel,
.tab-panel {
  padding: 18px;
}

.feature-banner {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.12), rgba(12, 24, 39, 0.96));
}

.feature-head,
.queue-head,
.queue-title-row,
.queue-tools,
.modal-head,
.notification-head,
.slideover-head,
.slideover-actions,
.board-name-row,
.board-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.feature-head {
  align-items: flex-start;
  margin-bottom: 10px;
}

.feature-head h3,
.tab-panel-head h3,
.queue-head h3,
.modal h3,
.slideover h3 {
  margin: 0;
  font-size: 22px;
}

.pipeline-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pipeline-step,
.qa-card,
.tab-button {
  border: 1px solid var(--line);
  background: rgba(16, 31, 49, 0.96);
  color: inherit;
  cursor: pointer;
}

.pipeline-step {
  min-width: 170px;
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 14px;
  border-radius: 18px;
}

.pipeline-step-bottleneck {
  border-color: rgba(239, 68, 68, 0.42);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.16), rgba(16, 31, 49, 0.96));
}

.pipeline-step-count {
  font-size: 28px;
  font-weight: 800;
}

.pipeline-step-label {
  font-weight: 700;
}

.pipeline-step-sla {
  color: var(--text-soft);
  font-size: 12px;
}

.pipeline-arrow {
  font-size: 24px;
  color: var(--text-soft);
}

.qa-grid,
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.monitor-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
}

.monitor-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
}

.qa-card {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 18px;
  text-align: left;
}

.qa-card strong {
  font-size: 30px;
}

.qa-card em {
  font-style: normal;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.qa-oversight-panel {
  border-left: 4px solid rgba(245, 158, 11, 0.6);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), rgba(12, 24, 39, 0.96));
}

.monitor-card {
  padding: 14px;
  display: grid;
  gap: 8px;
}

.monitor-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 13px;
}

.tab-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-button {
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
}

.tab-button.active {
  color: var(--text);
  border-color: rgba(192, 132, 252, 0.38);
  background: rgba(192, 132, 252, 0.16);
}

.tab-panel-head {
  margin-bottom: 12px;
}

.tab-panel-head p {
  margin: 4px 0 0;
  color: var(--text-soft);
}

.board-list {
  display: grid;
  gap: 22px;
  min-width: 0;
}

.board-shell {
  min-width: 0;
}

.board-shell.collapsed .board-body {
  display: none;
}

.board-header {
  width: 100%;
  display: grid;
  grid-template-columns: 6px 44px minmax(0, 1fr) auto 20px;
  padding: 12px 16px;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.board-accent {
  width: 6px;
  height: 44px;
  border-radius: 999px;
}

.board-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  font-size: 18px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent, #38bdf8) 24%, #07111f), var(--accent, #38bdf8));
}

.board-title {
  min-width: 0;
}

.board-title h2 {
  margin: 0;
  font-size: 20px;
  display: inline;
}

.board-title p {
  display: inline;
  margin-left: 8px;
  font-size: 13px;
}

.board-priority {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.board-priority strong {
  font-size: 14px;
}

.board-chevron {
  font-size: 24px;
  color: var(--text-soft);
}

.board-body {
  padding: 0 20px 20px;
  min-width: 0;
}

.board-content-block {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.board-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.toolbar-field,
.toolbar-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(18, 34, 54, 0.82);
  border: 1px solid var(--line);
}

.toolbar-field {
  flex: 1 1 280px;
}

.toolbar-field span,
.toolbar-toggle span,
.drift-label {
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.toolbar-field input {
  width: 100%;
  min-width: 0;
  background: transparent;
  border: 0;
  color: var(--text);
  outline: none;
}

.toolbar-toggle input {
  accent-color: var(--info);
}

.card-section,
.table-section {
  display: grid;
  gap: 14px;
}

.card-section + .card-section,
.table-section + .table-section {
  margin-top: 4px;
}

.card-section-title,
.table-section-title,
.card-group-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card-section-title-sales,
.table-section-title-sales {
  color: var(--text-soft);
}

.card-section-title-qa,
.table-section-title-qa {
  color: #7dd3fc;
}

.card-section-qa,
.table-section-qa {
  padding-top: 16px;
  padding-left: 2px;
  border-top: 3px solid rgba(56, 189, 248, 0.55);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.05), rgba(12, 24, 39, 0) 70%);
}

.card-group {
  display: grid;
  gap: 10px;
}

.card-group-label-urgent {
  color: #fca5a5;
}

.card-group-label-backlog {
  color: #fcd34d;
}

.card-group-label-qa {
  color: #7dd3fc;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.queue-stat {
  display: grid;
  gap: 12px;
  text-decoration: none;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  background: linear-gradient(180deg, rgba(18, 35, 58, 0.96), rgba(10, 23, 38, 0.98));
}

.queue-stat.queue-stat-urgent {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.42), rgba(17, 24, 39, 0.96));
  border-color: rgba(239, 68, 68, 0.3);
}

.queue-stat.severity-critical {
  border-left-color: rgba(239, 68, 68, 0.9);
}

.queue-stat.severity-warning {
  border-left-color: rgba(245, 158, 11, 0.85);
}

.queue-stat.severity-ok {
  border-left-color: rgba(34, 197, 94, 0.75);
}

.queue-stat-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.queue-stat-label {
  font-weight: 700;
}

.queue-stat-sla {
  color: var(--text-soft);
  font-size: 12px;
}

.queue-stat-value {
  font-size: 34px;
  font-weight: 800;
}

.queue-stat-meta {
  display: grid;
  gap: 6px;
}

.queue-stat-breach,
.queue-stat-oldest {
  font-size: 13px;
  font-weight: 700;
}

.queue-stat-breach {
  color: var(--text-soft);
}

.queue-stat-breach-hot {
  color: #fca5a5;
}

.queue-stat-breach-clear {
  color: #86efac;
}

.queue-stat-oldest {
  color: var(--text-soft);
}

.queue-stat-bottom {
  min-height: 34px;
}

.sparkline {
  width: 100%;
  height: 32px;
}

.drift-box {
  padding: 16px;
  border-left: 3px solid rgba(56, 189, 248, 0.45);
  background: rgba(14, 28, 44, 0.96);
}

.drift-box summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.drift-box summary::-webkit-details-marker {
  display: none;
}

.drift-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.drift-metric {
  padding: 12px;
  border-radius: 16px;
  background: rgba(18, 34, 54, 0.82);
  border: 1px solid var(--line);
}

.drift-metric span {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
  margin-bottom: 6px;
}

.drift-metric strong {
  font-size: 20px;
}

.drift-lists {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.drift-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.drift-tag-missing {
  background: rgba(245, 158, 11, 0.14);
  border-color: rgba(245, 158, 11, 0.28);
}

.drift-tag-extra {
  background: rgba(56, 189, 248, 0.14);
  border-color: rgba(56, 189, 248, 0.28);
}

.drift-note {
  margin: 14px 0 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.queue-card {
  padding: 16px;
  min-width: 0;
}

.queue-head {
  align-items: flex-start;
  margin-bottom: 14px;
}

.queue-title-row {
  flex-wrap: wrap;
}

.queue-head h3 {
  font-size: 22px;
}

.mini-button,
.icon-button,
.action-pill {
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.mini-button,
.icon-button {
  border-radius: 14px;
  padding: 10px 12px;
}

.icon-button-bell {
  position: relative;
}

.bell-glyph {
  font-size: 16px;
  line-height: 1;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  background: color-mix(in srgb, var(--action-accent, #38bdf8) 16%, rgba(17, 35, 58, 0.96));
  border-color: color-mix(in srgb, var(--action-accent, #38bdf8) 36%, rgba(53, 79, 111, 0.52));
}

.action-pill-urgent {
  padding: 13px 20px;
  font-size: 14px;
}

.action-pill-large {
  width: 100%;
}

.action-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.table-wrap {
  max-width: 100%;
  overflow: auto;
  overscroll-behavior-x: contain;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: fixed;
}

.data-table th,
.data-table td {
  padding: 12px 10px;
  border-top: 1px solid rgba(53, 79, 111, 0.26);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.data-table td {
  font-size: 13px;
}

.data-table th {
  position: sticky;
  top: 0;
  background: rgba(11, 23, 38, 0.98);
  z-index: 1;
}

.sort-button {
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--text-soft);
  text-align: left;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 11px;
  padding: 0;
}

.data-row {
  cursor: pointer;
}

.data-row.row-critical td {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.08), rgba(239, 68, 68, 0) 30%);
}

.data-row.row-warning td {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0) 30%);
}

.data-row:hover td {
  background: rgba(18, 34, 54, 0.65);
  border-left: 3px solid var(--row-accent, #38bdf8);
}

.contact-link {
  font-weight: 700;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.mono {
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 13px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.age-chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  font-weight: 700;
}

.age-ok {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.16);
}

.age-warning {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.16);
}

.age-critical {
  color: #fee2e2;
  background: rgba(239, 68, 68, 0.16);
}

.sla-chip {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 12px;
  font-weight: 700;
}

.sla-ok {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.16);
}

.sla-warning {
  color: #fef3c7;
  background: rgba(245, 158, 11, 0.16);
}

.sla-critical {
  color: #fee2e2;
  background: rgba(239, 68, 68, 0.18);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.24);
  color: #dbeafe;
  font-size: 12px;
}

.preview-text {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.monitor-card,
.queue-note,
.feature-copy {
  overflow-wrap: anywhere;
}

.column-contact {
  width: 13%;
}

.column-phone {
  width: 10%;
}

.column-owner,
.column-calendar,
.column-stage,
.column-status,
.column-source,
.column-queue-source,
.column-channel,
.column-tags,
.column-appointment-status {
  width: 8%;
}

.column-date-added,
.column-last-inbound-at,
.column-last-activity-at,
.column-stage-changed-at,
.column-appointment-at {
  width: 10%;
}

.column-unresolved-reason {
  width: 14%;
}

.column-last-message-preview,
.column-latest-message-preview {
  width: 18%;
}

.column-sla-status {
  width: 10%;
}

.column-age,
.column-action {
  width: 8%;
  white-space: nowrap;
}

.channel-sms {
  color: #dcfce7;
  background: rgba(34, 197, 94, 0.16);
  border-color: rgba(34, 197, 94, 0.3);
}

.channel-email {
  color: #dbeafe;
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.3);
}

.channel-social {
  color: #ede9fe;
  background: rgba(167, 139, 250, 0.16);
  border-color: rgba(167, 139, 250, 0.3);
}

.channel-info {
  color: #ffedd5;
  background: rgba(251, 146, 60, 0.16);
  border-color: rgba(251, 146, 60, 0.3);
}

.channel-muted {
  color: var(--text-soft);
  background: rgba(100, 116, 139, 0.16);
  border-color: rgba(100, 116, 139, 0.3);
}

.queue-empty {
  padding: 16px;
  border-radius: 16px;
  background: rgba(18, 34, 54, 0.56);
  border: 1px dashed rgba(53, 79, 111, 0.46);
  text-align: center;
}

.queue-empty-clear {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: #dcfce7;
}

.queue-empty-clear div {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.queue-empty-clear strong {
  color: #86efac;
}

.empty-check {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.16);
  color: #dcfce7;
  font-weight: 800;
}

@keyframes breach-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.22);
  }
  50% {
    box-shadow: 0 0 12px 4px rgba(239, 68, 68, 0.14);
  }
}

.queue-stat.has-breach,
.next-actions-panel.has-breach .next-actions-head h3,
.icon-count {
  animation: breach-pulse 2s infinite;
}

.notification-wrap {
  position: relative;
}

.icon-count {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fee2e2;
  font-size: 12px;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(380px, 92vw);
  padding: 16px;
  display: none;
}

.notification-wrap.open .notification-panel {
  display: block;
}

.notification-item,
.result-row {
  width: 100%;
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(11, 23, 38, 0.92);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(4, 10, 18, 0.74);
  backdrop-filter: blur(6px);
}

.overlay-dismiss {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: transparent;
}

.modal {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 24px));
  max-height: min(72vh, 760px);
  overflow: auto;
  padding: 18px;
}

.toolbar-field-modal {
  margin: 16px 0;
}

.modal-results {
  display: grid;
  gap: 12px;
}

.result-group-label {
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.slideover {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 95;
  width: min(460px, 100vw);
  height: 100vh;
  display: none;
  border-radius: 0;
  border-left: 1px solid var(--line);
}

.slideover.open {
  display: flex;
  flex-direction: column;
}

.slideover-head,
.slideover-actions {
  padding: 18px;
  border-bottom: 1px solid rgba(53, 79, 111, 0.28);
}

.slideover-head {
  align-items: flex-start;
}

.slideover-head p {
  margin: 8px 0 0;
  color: var(--text-soft);
}

.slideover-actions {
  display: grid;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid rgba(53, 79, 111, 0.28);
  border-bottom: 0;
}

.slideover-body {
  flex: 1;
  overflow: auto;
  padding: 18px;
}

.slideover-section + .slideover-section {
  margin-top: 18px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-item,
.message-card,
.timeline-item {
  padding: 12px;
  border-radius: 16px;
  background: rgba(18, 34, 54, 0.74);
  border: 1px solid rgba(53, 79, 111, 0.28);
}

.detail-item span {
  display: block;
  color: var(--text-soft);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-item strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.message-card p,
.timeline-item p {
  margin: 10px 0 0;
  line-height: 1.6;
  white-space: pre-wrap;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-soft);
  font-size: 12px;
}

.loading-state,
.error-state {
  width: min(640px, calc(100vw - 32px));
  margin: 12vh auto 0;
  padding: 28px;
  text-align: center;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  margin: 0 auto 18px;
  border-radius: 999px;
  border: 4px solid rgba(56, 189, 248, 0.18);
  border-top-color: var(--info);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .page-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .operator-hero {
    grid-template-columns: 1fr;
  }

  .hero-metrics {
    justify-content: flex-start;
  }
}

@media (max-width: 1320px) {
  .column-last-message-preview,
  .column-latest-message-preview,
  .column-stage-changed-at,
  .column-source,
  .column-queue-source {
    display: none;
  }
}

@media (max-width: 1120px) {
  .column-appointment-status,
  .column-unresolved-reason,
  .column-channel,
  .column-tags {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar,
  .page-grid,
  .page-single {
    padding-left: 16px;
    padding-right: 16px;
  }

  .nav-strip {
    top: 88px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-header {
    grid-template-columns: 6px 44px minmax(0, 1fr) 18px;
  }

  .board-priority {
    display: none;
  }

  .detail-grid,
  .drift-grid,
  .drift-lists {
    grid-template-columns: 1fr;
  }

  .data-table {
    table-layout: auto;
  }

  .next-action-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    gap: 18px;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .topbar h1 {
    white-space: normal;
  }

  .topbar-meta-row {
    width: 100%;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }

  .feature-head,
  .queue-head,
  .next-actions-head,
  .modal-head,
  .slideover-head,
  .slideover-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
  }

  .pipeline-strip {
    flex-direction: column;
    align-items: stretch;
  }

  .pipeline-arrow {
    display: none;
  }

  .data-table,
  .data-table thead,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }

  .data-table {
    min-width: 0;
  }

  .data-table thead {
    display: none;
  }

  .data-table tbody {
    display: grid;
    gap: 12px;
  }

  .data-row {
    padding: 6px;
    border-radius: 16px;
    border: 1px solid rgba(53, 79, 111, 0.24);
    background: rgba(11, 22, 36, 0.92);
  }

  .data-table td {
    border-top: 1px solid rgba(53, 79, 111, 0.24);
    padding: 10px 12px;
  }

  .data-table td:first-child {
    border-top: 0;
  }

  .data-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 6px;
    color: var(--text-soft);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }

  .slideover {
    width: 100vw;
  }
}
