:root {
  --bg: #060b1d;
  --panel: rgba(20, 29, 61, 0.82);
  --panel-soft: rgba(38, 51, 95, 0.45);
  --line: rgba(129, 163, 255, 0.24);
  --text: #ecf1ff;
  --muted: #98abd9;
  --accent: #63bdff;
  --accent-2: #79ffd8;
  --warn: #ffbf69;
  --danger: #ff5e7d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: radial-gradient(1200px 600px at 20% -10%, #24438b 0%, transparent 55%),
    radial-gradient(800px 500px at 100% 100%, #215b5d 0%, transparent 50%), var(--bg);
}

.bg {
  position: fixed;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(85px);
  z-index: 0;
}

.bg-1 {
  width: 240px;
  height: 240px;
  left: 6%;
  top: 10%;
  background: rgba(99, 189, 255, 0.3);
}

.bg-2 {
  width: 300px;
  height: 300px;
  right: 4%;
  bottom: 4%;
  background: rgba(121, 255, 216, 0.24);
}

.layout {
  position: relative;
  z-index: 1;
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 18px clamp(10px, 1.6vw, 24px);
  display: grid;
  gap: 10px;
}

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

.eyebrow {
  margin: 0;
  color: var(--accent-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 0.75rem;
}

h1 {
  margin: 4px 0 6px;
  font-family: "Manrope", sans-serif;
}

.subtitle {
  margin: 0;
  color: var(--muted);
}

.status-pill {
  border: 1px solid var(--line);
  background: rgba(13, 20, 45, 0.7);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.85rem;
}

.status-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
}

.layout-panel {
  border-style: dashed;
}

.layout-widget-list {
  display: grid;
  gap: 8px;
}

.layout-widget-row {
  border: 1px solid rgba(123, 160, 255, 0.2);
  border-radius: 12px;
  background: rgba(12, 18, 44, 0.62);
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(130px, 190px) minmax(130px, 190px);
  gap: 8px;
  align-items: center;
}

.layout-widget-visibility {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 0.88rem;
}

.layout-widget-row select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(10, 16, 40, 0.75);
  color: var(--text);
  border-radius: 10px;
  padding: 8px 9px;
}

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

.panel-head h2 {
  margin: 0;
  font-family: "Manrope", sans-serif;
  font-size: 1.1rem;
}

.widget-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.widget-control-btn {
  border: 1px solid var(--line);
  background: rgba(19, 28, 61, 0.8);
  color: var(--text);
  border-radius: 8px;
  min-width: 26px;
  height: 26px;
  padding: 0 6px;
  font-size: 0.8rem;
  cursor: pointer;
}

.dashboard-widget {
  position: relative;
}

.dashboard-widget .panel-head {
  cursor: grab;
  user-select: none;
  touch-action: none;
}

.dashboard-widget .panel-head:active,
.dashboard-widget.widget-dragging .panel-head {
  cursor: grabbing;
}

.widget-resize-handle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background: linear-gradient(135deg, transparent 50%, rgba(121, 255, 216, 0.6) 50%, rgba(121, 255, 216, 0.6) 70%, transparent 70%);
  border-radius: 0 0 12px 0;
  z-index: 2;
  touch-action: none;
}

.dashboard-widget.widget-resizing {
  outline: 1px dashed rgba(121, 255, 216, 0.6);
}

.dashboard-widget.widget-hidden {
  display: none !important;
}

.dashboard-widget.widget-collapsed > :not(.panel-head) {
  display: none;
}

.dashboard-widget.widget-dragging {
  opacity: 0.45;
  border-style: dashed;
}

.dashboard-widget.height-s {
  min-height: 170px;
}

.dashboard-widget.height-m {
  min-height: 260px;
}

.dashboard-widget.height-l {
  min-height: 360px;
}

.badge {
  border: 1px solid rgba(121, 255, 216, 0.4);
  color: var(--accent-2);
  background: rgba(121, 255, 216, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.75rem;
}

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

.grid article {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.grid span {
  color: var(--muted);
  font-size: 0.8rem;
}

.grid strong {
  font-size: 0.95rem;
}

.presence-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 12px;
}

.presence-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
}

.presence-row input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(10, 16, 40, 0.75);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
}

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

.outcome-grid label,
.outcome-notes {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
}

.outcome-grid select,
.outcome-grid input,
.outcome-notes textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(10, 16, 40, 0.75);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.outcome-notes {
  margin-top: 10px;
}

.outcome-hint {
  margin: 14px 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.outcome-dispositions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.outcome-dispositions .btn {
  width: 100%;
  justify-content: center;
}

.badge-offline {
  color: #ffb0c0;
  border-color: rgba(255, 94, 125, 0.45);
  background: rgba(255, 94, 125, 0.08);
}

.badge-online {
  color: #9dfadf;
  border-color: rgba(121, 255, 216, 0.45);
  background: rgba(121, 255, 216, 0.08);
}

.actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.softphone {
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 20, 46, 0.62);
}

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

.softphone__detail {
  color: #b6c4eb;
  font-size: 0.88rem;
}

.softphone .actions {
  margin-top: 10px;
}

.btn {
  border: 1px solid var(--line);
  background: rgba(19, 28, 61, 0.8);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary {
  border: 0;
  background: linear-gradient(120deg, var(--accent), #86ceff);
  color: #04203d;
}

.btn.warning {
  border-color: rgba(255, 191, 105, 0.45);
  color: #ffd59b;
}

.btn.danger {
  border-color: rgba(255, 94, 125, 0.45);
  color: #ff9db0;
}

.feed ul,
.feed {
  margin: 0;
}

#eventFeed {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

#eventFeed li {
  background: rgba(12, 18, 44, 0.62);
  border: 1px solid rgba(123, 160, 255, 0.2);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

#eventFeed li small {
  color: var(--muted);
}

#queueByStageFeed,
#agentBoardFeed,
#activeCallsFeed,
#callHistoryFeed,
#callsVolumeLegend,
#sipRamaisFeed {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

#queueByStageFeed li,
#agentBoardFeed li,
#activeCallsFeed li,
#callHistoryFeed li,
#callsVolumeLegend li,
#sipRamaisFeed li {
  background: rgba(12, 18, 44, 0.62);
  border: 1px solid rgba(123, 160, 255, 0.2);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 4px;
}

.item-title {
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
}

.item-sub {
  color: var(--muted);
  font-size: 0.82rem;
}

.history-call-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.call-history-audio {
  width: 100%;
  margin-top: 8px;
}

#leadPhone {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  color: var(--accent);
  overflow-wrap: anywhere;
}

.agent-history .presence-row {
  display: flex;
  flex-wrap: wrap;
}

.agent-history .presence-row label {
  flex: 1;
  min-width: 160px;
}

.agent-history select {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid rgba(123, 160, 255, 0.3);
  background: #0c122c;
  color: var(--text);
  font: inherit;
}

.agent-transcription-dialog:not([open]) {
  display: none;
}

.agent-transcription-dialog::backdrop {
  background: rgba(4, 8, 20, 0.7);
}

.agent-transcription-dialog .transcription-modal-head {
  flex-wrap: wrap;
}

.agent-history .item-sub {
  overflow-wrap: anywhere;
}


.transcription-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}

.transcription-modal[hidden] {
  display: none;
}

.transcription-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(4, 8, 20, 0.7);
  cursor: pointer;
}

.transcription-modal-panel {
  position: relative;
  z-index: 1;
  width: min(880px, 96vw);
  max-height: 88vh;
  background: rgba(10, 16, 40, 0.95);
  border: 1px solid rgba(123, 160, 255, 0.35);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

#transcriptionModal .transcription-modal-panel {
  width: min(1180px, 96vw);
}

/*
 * Transcrição e insights ficam na mesma área flexível. Antes os insights
 * ficavam fora da região de rolagem e eram cortados em conversas longas.
 */
.transcription-modal-content {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 10px;
  overflow: auto;
}

@media (min-width: 1000px) {
  .transcription-modal-content {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    align-items: stretch;
    overflow: hidden;
  }

  .transcription-modal-content > .transcription-modal-body,
  .transcription-modal-content > .transcription-insights {
    min-height: 0;
    overflow: auto;
  }

  /* Sem insights carregados, a transcrição usa a largura inteira. */
  .transcription-modal-content:has(> .transcription-insights[hidden]) {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

.transcription-modal-head h3 {
  margin: 0;
  font-family: "Manrope", sans-serif;
}

.transcription-modal-head .actions {
  margin-top: 0;
}

.transcription-modal-body {
  margin: 0;
  min-height: 0;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 0.88rem;
  color: var(--text);
  background: rgba(8, 13, 35, 0.82);
  border: 1px solid rgba(123, 160, 255, 0.2);
  border-radius: 10px;
  padding: 10px;
}

/* A transcrição precisa abrir acima do histórico completo. */
#transcriptionModal {
  z-index: 40;
}

#callHistoryModal .transcription-modal-panel {
  width: min(1080px, 96vw);
}

#callHistoryModal .transcription-modal-body {
  flex: 1;
  min-height: 0;
  white-space: normal;
}

.history-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
}

.history-filters label {
  display: grid;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--muted);
}

.history-filters input,
.history-filters select {
  background: rgba(8, 13, 35, 0.82);
  border: 1px solid rgba(123, 160, 255, 0.28);
  border-radius: 8px;
  color: var(--text);
  padding: 6px 8px;
  font-size: 0.82rem;
  min-width: 140px;
}

.history-filters-actions {
  display: flex;
  gap: 8px;
}

.history-summary {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.history-results {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 8px;
}

.history-results li {
  border: 1px solid rgba(123, 160, 255, 0.18);
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  gap: 3px;
  background: rgba(12, 18, 44, 0.7);
}

.history-results .history-row-title {
  font-weight: 600;
  font-size: 0.86rem;
}

.history-results .history-row-meta {
  font-size: 0.75rem;
  color: var(--muted);
}

.transcription-modal-body.as-chat {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.transcription-chat-row {
  display: grid;
  gap: 4px;
}

.transcription-chat-row.agent {
  justify-items: end;
}

.transcription-chat-row.customer,
.transcription-chat-row.unknown {
  justify-items: start;
}

.transcription-chat-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.transcription-chat-bubble {
  margin: 0;
  max-width: min(88%, 760px);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(123, 160, 255, 0.25);
  background: rgba(16, 26, 58, 0.82);
  line-height: 1.35;
}

.transcription-chat-row.agent .transcription-chat-bubble {
  border-color: rgba(121, 255, 216, 0.35);
  background: rgba(24, 53, 54, 0.78);
}

.transcription-chat-row.customer .transcription-chat-bubble {
  border-color: rgba(99, 189, 255, 0.35);
  background: rgba(14, 34, 64, 0.82);
}

.transcription-insights {
  border: 1px solid rgba(123, 160, 255, 0.2);
  border-radius: 10px;
  background: rgba(8, 13, 35, 0.64);
  padding: 10px;
  display: grid;
  gap: 8px;
  align-content: start;
}

@media (min-width: 1000px) {
  .transcription-insights-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.transcription-insights[hidden] {
  display: none;
}

.transcription-insights h4 {
  margin: 0;
  font-size: 0.95rem;
  font-family: "Manrope", sans-serif;
}

.transcription-insights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.transcription-insight-card {
  border: 1px solid rgba(123, 160, 255, 0.2);
  background: rgba(13, 20, 45, 0.68);
  border-radius: 10px;
  padding: 8px;
  display: grid;
  gap: 6px;
}

.transcription-insight-card strong {
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--accent-2);
}

.transcription-insight-card p,
.transcription-insight-card ul {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.transcription-insight-card ul {
  padding-left: 18px;
}

.transcription-insight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.transcription-insight-tag {
  border: 1px solid rgba(123, 160, 255, 0.26);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  color: var(--text);
}

.transcription-alert-tag {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  justify-self: start;
}

.transcription-alert-tag.low {
  border: 1px solid rgba(123, 160, 255, 0.35);
  color: #b8caf8;
}

.transcription-alert-tag.medium {
  border: 1px solid rgba(255, 191, 105, 0.45);
  color: #ffd59b;
}

.transcription-alert-tag.high {
  border: 1px solid rgba(255, 94, 125, 0.45);
  color: #ffb0c0;
}

.recording-chip {
  justify-self: start;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 2px 8px;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.recording-chip.ready {
  border-color: rgba(121, 255, 216, 0.45);
  color: #9dfadf;
}

.recording-chip.processing {
  border-color: rgba(255, 191, 105, 0.45);
  color: #ffd59b;
}

.recording-chip.missing,
.recording-chip.failed {
  border-color: rgba(255, 94, 125, 0.45);
  color: #ffb0c0;
}

.recording-chip.unknown {
  border-color: rgba(152, 171, 217, 0.45);
  color: #c6d5f9;
}

.state-chip {
  justify-self: start;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 2px 8px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.state-chip.online,
.state-chip.in-progress {
  border-color: rgba(121, 255, 216, 0.45);
  color: #9dfadf;
}

.state-chip.paused,
.state-chip.ringing,
.state-chip.initiated {
  border-color: rgba(255, 191, 105, 0.45);
  color: #ffd59b;
}

.state-chip.offline,
.state-chip.completed,
.state-chip.no-answer,
.state-chip.busy,
.state-chip.failed {
  border-color: rgba(255, 94, 125, 0.45);
  color: #ffb0c0;
}

.volume-chart {
  width: 100%;
  height: 170px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(99, 189, 255, 0.09), rgba(99, 189, 255, 0.02));
}

.volume-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
}

.volume-area {
  fill: rgba(121, 255, 216, 0.15);
}

.volume-dot {
  fill: var(--accent-2);
  stroke: rgba(6, 11, 29, 0.9);
  stroke-width: 1;
}

.volume-legend {
  margin-top: 10px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.volume-legend li {
  padding: 8px;
}

.volume-legend strong {
  font-size: 1rem;
}

.volume-legend span {
  color: var(--muted);
  font-size: 0.78rem;
}

.funnel-board {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.funnel-item {
  background: rgba(12, 18, 44, 0.68);
  border: 1px solid rgba(123, 160, 255, 0.2);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.funnel-item > span,
.funnel-item > small {
  color: var(--muted);
}

.funnel-bar {
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(10, 16, 40, 0.7);
}

.funnel-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
}

.heatmap-board {
  overflow-x: auto;
}

.heatmap-table {
  min-width: 620px;
  display: grid;
  gap: 8px;
}

.heatmap-row {
  display: grid;
  grid-template-columns: minmax(120px, 170px) repeat(6, minmax(56px, 1fr));
  gap: 6px;
  align-items: center;
}

.heatmap-head span {
  color: var(--muted);
  font-size: 0.75rem;
}

.heatmap-agent {
  color: var(--text);
  font-weight: 600;
}

.heatmap-cell {
  min-height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(123, 160, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  color: #eaf6ff;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.ops-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: stretch;
}

.span-3 {
  grid-column: span 3;
}

.span-2 {
  grid-column: span 2;
}

.span-6 {
  grid-column: span 6;
}

.span-9 {
  grid-column: span 9;
}

.span-12 {
  grid-column: 1 / -1;
}

#queueByStageFeed,
#agentBoardFeed,
#activeCallsFeed,
#callHistoryFeed,
#agentRankingFeed,
#slaAlertsFeed,
#eventFeed,
#sipRamaisFeed {
  max-height: 240px;
  overflow: auto;
  padding-right: 4px;
}

.sip-ramal-item {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.sip-ramal-info {
  display: grid;
  gap: 4px;
}

.sip-ramal-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

#stageFunnelBoard,
#agentHeatmapBoard,
#strategyFlowBoard {
  max-height: 320px;
  overflow: auto;
}

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

.health-grid > div {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.health-grid span {
  color: var(--muted);
  font-size: 0.8rem;
}

.health-grid strong {
  font-family: "Manrope", sans-serif;
  font-size: 1.1rem;
}

.bar-row {
  display: grid;
  grid-template-columns: 72px 1fr 42px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.bar-row span {
  color: var(--muted);
  font-size: 0.85rem;
}

.bar-row strong {
  font-size: 0.8rem;
  color: var(--text);
}

.bar-track {
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(13, 19, 42, 0.8);
  overflow: hidden;
}

.bar-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.hint {
  color: var(--muted);
  font-size: 0.8rem;
  margin: 10px 0 0;
}

.panel-wide:not(.dashboard-widget) {
  grid-column: 1 / -1;
}

.strategy-flow-board {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-top: 10px;
}

.strategy-step {
  min-width: 180px;
  background: rgba(12, 18, 44, 0.75);
  border: 1px solid rgba(123, 160, 255, 0.25);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.strategy-step label {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted);
}

.strategy-step input,
.strategy-step select {
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(10, 15, 34, 0.9);
  color: var(--text);
  padding: 6px 8px;
  font-size: 0.82rem;
}

.strategy-step .btn {
  width: 100%;
}

.ops-input {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.ops-input input {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(10, 16, 40, 0.75);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
}

.ops-input select {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(10, 16, 40, 0.75);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 10px;
}

.ramal-selector {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.ramal-selector legend {
  padding: 0 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

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

.ramal-option {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
}

.ramal-option input {
  width: auto;
  margin: 0;
}

.feed-ramal {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #c7d2fe;
  font-size: 0.72rem;
  font-weight: 600;
  vertical-align: middle;
}

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

#slaAlertsFeed {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

#slaAlertsFeed .sla-item {
  border-radius: 12px;
  border: 1px solid rgba(123, 160, 255, 0.2);
  padding: 10px;
  display: grid;
  gap: 5px;
  background: rgba(12, 18, 44, 0.62);
}

#slaAlertsFeed .sla-item span {
  color: var(--muted);
  font-size: 0.84rem;
}

#slaAlertsFeed .sla-ok {
  border-color: rgba(121, 255, 216, 0.35);
  background: rgba(121, 255, 216, 0.08);
}

#slaAlertsFeed .sla-warning {
  border-color: rgba(255, 191, 105, 0.45);
  background: rgba(255, 191, 105, 0.08);
}

#slaAlertsFeed .sla-danger {
  border-color: rgba(255, 94, 125, 0.45);
  background: rgba(255, 94, 125, 0.08);
}

.metric-card {
  display: grid;
  gap: 8px;
}

.metric-card span {
  color: var(--muted);
}

.metric-card strong {
  font-family: "Manrope", sans-serif;
  font-size: 1.6rem;
}

@media (max-width: 780px) {
  .layout {
    padding: 16px;
  }

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

  .span-2,
  .span-3,
  .span-6,
  .span-9,
  .span-12 {
    grid-column: auto;
  }

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

  .layout-widget-row {
    grid-template-columns: 1fr;
  }

  .status-group {
    width: 100%;
    flex-wrap: wrap;
  }

  .volume-legend {
    grid-template-columns: 1fr;
  }

  .presence-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }
}
.manual-dial { margin: 18px 0; }
.manual-dial input { min-width: 220px; max-width: 100%; padding: 10px; font: inherit; }
.manual-dial p { margin: 8px 0; font-size: 0.9rem; }
.manual-dial button:disabled { opacity: 0.6; cursor: wait; }
