:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4fb;
  --text: #17202a;
  --muted: #637083;
  --border: #d9e1ea;
  --accent: #0038ec;
  --good: #087a3b;
  --good-bg: #e3f5e9;
  --bad: #a32222;
  --bad-bg: #fde8e8;
  --neutral: #4a5568;
  --neutral-bg: #edf2f7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

.app-frame {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #f4f7fb 0%, #eef4fb 100%);
}

.login-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 16px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 60px rgba(23, 32, 42, 0.12);
}

.login-panel img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
}

.login-panel p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.login-panel label,
.user-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.login-panel input,
.user-form input,
.user-form select {
  min-height: 38px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  text-transform: none;
}

.login-error,
.form-status {
  min-height: 18px;
  color: var(--bad);
  font-size: 12px;
  font-weight: 700;
}

.session-user {
  max-width: 190px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 16px;
  border-right: 1px solid var(--border);
  background: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand span,
.section-head span,
small {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: grid;
  gap: 4px;
  margin-top: 18px;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 650;
}

.nav a.active,
.nav a:hover {
  color: var(--accent);
  background: var(--surface-soft);
}

.shell {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  font-weight: 760;
}

h2 {
  font-size: 17px;
}

.topbar p {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-filter {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.topbar-filter select,
.date-controls input {
  min-height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 0 14px;
  color: #ffffff;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  filter: brightness(0.94);
}

.hidden {
  display: none !important;
}

.operation-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.operation-alert div {
  display: grid;
  gap: 4px;
}

.operation-alert span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.operation-alert strong {
  color: var(--text);
  font-size: 15px;
}

.operation-alert p {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.operation-alert.warn {
  border-color: #f2b84b;
  background: #fff8e8;
}

.operation-alert.bad {
  border-color: #d92d20;
  background: #fff1f0;
}

.operation-alert.bad span,
.operation-alert.bad strong {
  color: #b42318;
}

.operation-alert.warn span,
.operation-alert.warn strong {
  color: #9a6700;
}

.section {
  margin-bottom: 24px;
  scroll-margin-top: 16px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(5, minmax(160px, 1fr));
  gap: 10px;
}

.analytics-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.analytics-controls strong,
.analytics-controls span {
  display: block;
}

.analytics-controls strong {
  font-size: 14px;
}

.analytics-controls span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.date-controls {
  display: flex;
  align-items: end;
  gap: 8px;
}

.date-controls label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.live-funnel-section {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.live-funnel {
  display: grid;
  gap: 14px;
}

.live-funnel-main {
  display: grid;
  gap: 12px;
}

.live-funnel-headline {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.live-funnel-headline span,
.live-funnel-headline strong {
  display: block;
}

.live-funnel-headline span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.live-funnel-headline strong {
  margin-top: 5px;
  font-size: 18px;
  line-height: 1.25;
}

.live-funnel-headline.good {
  border-color: #9bd7b3;
  background: var(--good-bg);
}

.live-funnel-headline.warn {
  border-color: #f5c188;
  background: #fff6e8;
}

.live-funnel-headline.bad {
  border-color: #efaaa8;
  background: var(--bad-bg);
}

.live-metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 10px;
}

.live-metric {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.live-metric span,
.live-metric strong,
.live-metric small {
  display: block;
}

.live-metric span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.live-metric strong {
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
}

.live-metric small {
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-metric.good {
  border-color: #aedfc0;
}

.live-metric.warn {
  border-color: #f1c27d;
}

.live-metric.bad {
  border-color: #efb0ad;
}

.live-funnel-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.live-list-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding-bottom: 9px;
}

.live-list-row div {
  min-width: 0;
}

.live-list-row span,
.live-list-row small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-list-row span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.live-list-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.live-list-row strong {
  color: var(--text);
  font-size: 13px;
}

.live-list-row i {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 4px;
  border-radius: 999px;
}

.queue-strip {
  display: grid;
  gap: 8px;
}

.queue-strip span {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
}

.queue-strip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 16px;
}

.agent-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(180px, 1fr));
  gap: 12px;
}

.agent-card {
  min-width: 0;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.agent-card.good {
  border-color: #9bd7b3;
}

.agent-card.warn {
  border-color: #f1c27d;
}

.agent-card.bad {
  border-color: #efb0ad;
}

.agent-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.agent-card-head span,
.agent-card-body small {
  color: var(--muted);
  font-size: 11px;
}

.agent-card-head span {
  display: block;
  font-weight: 850;
  text-transform: uppercase;
}

.agent-card-head strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.2;
}

.agent-status {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  color: var(--neutral);
  background: var(--neutral-bg);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.agent-card.good .agent-status {
  color: var(--good);
  background: var(--good-bg);
}

.agent-card.warn .agent-status {
  color: #9a6700;
  background: #fff6e8;
}

.agent-card-body strong,
.agent-card-body small {
  display: block;
}

.agent-card-body strong {
  font-size: 20px;
  line-height: 1.15;
}

.agent-card-body small {
  margin-top: 6px;
  line-height: 1.35;
}

.agent-queue {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.agent-queue span {
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 10px;
  line-height: 1.2;
}

.agent-queue b {
  display: block;
  color: var(--text);
  font-size: 15px;
}

.analytics-panel {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

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

.analytics-panel h3 {
  margin: 0;
  font-size: 14px;
}

.analytics-panel-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.analytics-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.analytics-kpi {
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8fafc;
}

.analytics-kpi span,
.analytics-kpi strong {
  display: block;
}

.analytics-kpi span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.analytics-kpi strong {
  margin-top: 5px;
  font-size: 20px;
}

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

.production-strip span {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: #ffffff;
  font-size: 12px;
}

.production-strip strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 16px;
}

.chart-empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}

.donut-layout {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 142px;
}

.donut {
  width: 132px;
  height: 132px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--donut-stops));
}

.donut::after {
  content: "";
  grid-area: 1 / 1;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--surface);
}

.donut > span {
  z-index: 1;
  grid-area: 1 / 1;
  display: grid;
  justify-items: center;
  font-size: 22px;
  font-weight: 800;
}

.donut small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.chart-legend {
  display: grid;
  gap: 8px;
}

.legend-row {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.legend-row span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-row strong {
  color: var(--text);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.bar-chart {
  display: grid;
  gap: 12px;
  padding: 5px 0;
}

.bar-row,
.funnel-row {
  display: grid;
  gap: 5px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.bar-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-label strong {
  color: var(--text);
}

.bar-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--neutral-bg);
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.funnel-chart {
  display: grid;
  gap: 12px;
}

.funnel-row {
  display: grid;
  gap: 7px;
}

.funnel-row-head {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto 52px;
  align-items: center;
  gap: 10px;
}

.funnel-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.funnel-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.funnel-row-head strong {
  color: var(--text);
  font-size: 13px;
}

.funnel-row-head small {
  color: var(--muted);
  text-align: right;
  font-size: 11px;
  font-weight: 700;
}

.funnel-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--neutral-bg);
}

.funnel-fill {
  display: block;
  min-width: 2px;
  height: 100%;
  border-radius: inherit;
}

.line-chart {
  width: 100%;
}

.line-chart svg {
  width: 100%;
  height: 178px;
  overflow: visible;
}

.chart-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-point {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}

.line-labels {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 10px;
}

.line-labels:nth-child(2) {
  text-align: center;
}

.line-labels span:last-child {
  text-align: right;
}

.line-labels strong {
  color: var(--text);
  font-size: 11px;
}

.support-cards {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  margin-bottom: 12px;
}

.filter-row {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
}

.filter-row label {
  display: grid;
  flex: 1 1 160px;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.filter-row select {
  min-height: 36px;
  width: 100%;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}

.link-button {
  min-height: auto;
  max-width: 260px;
  padding: 0;
  border: 0;
  color: var(--accent);
  background: transparent;
  font: inherit;
  font-weight: 800;
  text-align: left;
  overflow-wrap: anywhere;
}

.case-link-cell {
  display: flex;
  align-items: center;
  gap: 7px;
}

.term-actions {
  display: flex;
  align-items: start;
  gap: 10px;
  min-width: 220px;
}

.term-actions > div {
  min-width: 0;
}

.chat-modal-link,
.support-chat-link {
  margin-top: 8px;
  font-size: 13px;
}

.compact-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 12px;
}

.table-filter-head {
  display: grid;
  gap: 5px;
}

.table-filter-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.table-filter-head select {
  min-height: 30px;
  width: 100%;
  min-width: 150px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  font-size: 12px;
  text-transform: none;
}

.unread-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  border-radius: 50%;
  background: #f08a24;
  box-shadow: 0 0 0 3px rgba(240, 138, 36, 0.18);
}

.case-detail {
  display: grid;
  gap: 14px;
  min-width: 280px;
  padding: 14px;
}

.case-detail span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.case-detail strong,
.case-detail p {
  overflow-wrap: anywhere;
}

.case-detail p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(100px, 0.45fr) minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
}

.support-chat {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.support-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.support-chat-head strong {
  font-size: 13px;
}

.secondary-button {
  border-color: var(--border);
  color: var(--text);
  background: #ffffff;
}

.support-messages {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.chat-bubble {
  display: grid;
  gap: 4px;
  max-width: 86%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
}

.chat-bubble.outbound {
  justify-self: end;
  border-color: #bfd0ff;
  background: #eef4ff;
}

.chat-bubble.inbound {
  justify-self: start;
}

.chat-bubble strong {
  font-size: 11px;
}

.chat-bubble span {
  text-align: right;
  font-size: 10px;
}

.support-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 8px;
}

.support-composer textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}

.chat-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.42);
}

.chat-modal {
  width: min(960px, 100%);
  max-height: min(860px, calc(100vh - 40px));
  display: grid;
  gap: 12px;
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
}

.chat-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.chat-modal-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.chat-modal-head h2 {
  margin-top: 4px;
  font-size: 18px;
}

.chat-modal .support-messages {
  max-height: 52vh;
}

.timeline {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.timeline-item {
  display: grid;
  gap: 4px;
  padding-left: 12px;
  border-left: 3px solid var(--border);
}

.timeline-item span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.timeline-item strong {
  font-size: 13px;
}

.timeline-item p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.timeline-item small {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.timeline-empty {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: #f8fafc;
  font-size: 12px;
}

.card,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.card {
  min-height: 108px;
  padding: 14px;
  display: grid;
  align-content: space-between;
}

.card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.card strong {
  font-size: 28px;
  line-height: 1;
}

.card small {
  overflow-wrap: anywhere;
}

.table-wrap {
  overflow: auto;
}

.user-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin-bottom: 8px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

table {
  width: 100%;
  min-width: 1040px;
  border-collapse: collapse;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  white-space: nowrap;
}

th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 2px;
}

.table-link {
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

.table-url {
  max-width: 300px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.pill.good {
  color: var(--good);
  background: var(--good-bg);
}

.pill.bad {
  color: var(--bad);
  background: var(--bad-bg);
}

.pill.neutral {
  color: var(--neutral);
  background: var(--neutral-bg);
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 12px;
}

.empty {
  color: var(--muted);
  padding: 18px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .cards {
    grid-template-columns: repeat(3, minmax(160px, 1fr));
  }

  .live-metrics-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

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

  .agent-board {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
  }

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

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

@media (max-width: 760px) {
  .app-frame {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

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

  .shell {
    padding: 16px;
  }

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

  .analytics-controls {
    align-items: flex-start;
    flex-direction: column;
  }

  .date-controls {
    width: 100%;
    flex-wrap: wrap;
  }

  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .user-form {
    grid-template-columns: 1fr;
  }

  .form-actions,
  .user-actions {
    flex-wrap: wrap;
  }

  .date-controls label {
    flex: 1 1 130px;
  }

  .date-controls button {
    flex: 1 1 100%;
  }

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

  .live-metrics-grid,
  .live-funnel-grid,
  .agent-board {
    grid-template-columns: 1fr;
  }

  .donut-layout {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .chart-legend {
    width: 100%;
  }
}
