/* ========================================
   ArthOps – AI Voice Control System
   Design System & Core Styles
   ======================================== */

/* ---- CSS Custom Properties ---- */
:root {
  /* Backgrounds */
  --bg-primary: #f4f7fb;
  --bg-secondary: #ffffff;
  --bg-tertiary: #eef2f6;
  --bg-card: #ffffff;
  --bg-hover: #e8eef4;
  --bg-active: #dce5ee;
  --bg-input: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.85);

  /* Borders */
  --border-color: #e2e8f0;
  --border-light: #cbd5e1;

  /* Text */
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Accent Colors */
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --red: #ed1c24;
  --red-dim: rgba(237, 28, 36, 0.15);
  --yellow: #f59e0b;
  --yellow-dim: rgba(245, 158, 11, 0.15);
  --blue: #004b87;
  --blue-dim: rgba(0, 75, 135, 0.2);
  --purple: #8b5cf6;
  --purple-dim: rgba(139, 92, 246, 0.15);
  --orange: #f97316;
  --orange-dim: rgba(249, 115, 22, 0.15);
  --indigo: #004b87;
  --indigo-dim: rgba(0, 75, 135, 0.2);

  /* HDFC Brand Colors */
  --hdfc-blue: #004b87;
  --hdfc-blue-light: #0068b8;
  --hdfc-blue-dark: #003a6a;
  --hdfc-red: #ed1c24;
  --hdfc-red-light: #f04048;
  --hdfc-red-dim: rgba(237, 28, 36, 0.15);
  --hdfc-blue-dim: rgba(0, 75, 135, 0.2);

  /* Gradients */
  --gradient-blue: linear-gradient(135deg, #004b87 0%, #0068b8 100%);
  --gradient-green: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  --gradient-purple: linear-gradient(135deg, #004b87 0%, #0068b8 100%);
  --gradient-hdfc: linear-gradient(135deg, #004b87 0%, #0068b8 100%);
  --gradient-hdfc-red: linear-gradient(135deg, #ed1c24 0%, #f04048 100%);

  /* Spacing */
  --sidebar-width: 220px;
  --topnav-height: 56px;
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 250ms ease;
  --transition-slow: 400ms ease;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.35);
  --shadow-glow-blue: 0 0 20px rgba(0, 75, 135, 0.3);
  --shadow-glow-green: 0 0 20px rgba(34, 197, 94, 0.2);
  --shadow-glow-red: 0 0 20px rgba(237, 28, 36, 0.25);
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family:
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
}

::selection {
  background: var(--blue);
  color: var(--text-primary);
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---- Top Navigation ---- */
.topnav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topnav-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.topnav__left,
.topnav__center,
.topnav__right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo__text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #0068b8, #004b87);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.logo__img {
  height: 30px;
  width: auto;
}
.logo__brand {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.logo__sub {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ed1c24;
  margin-top: 2px;
}

.env-selector {
  display: flex;
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.env-btn {
  padding: 5px 16px;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.env-btn:hover {
  color: var(--text-primary);
}
.env-btn.active {
  background: var(--hdfc-blue);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 75, 135, 0.4);
}

.icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--gradient-hdfc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: transform var(--transition-fast);
}
.avatar:hover {
  transform: scale(1.08);
}

/* ---- App Layout ---- */
.app-layout {
  display: flex;
  margin-top: var(--topnav-height);
  height: calc(100vh - var(--topnav-height));
}

/* ---- Sidebar ---- */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 0;
  overflow-y: auto;
}

.sidebar__menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 8px;
}

.sidebar__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
}
.sidebar__item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.sidebar__item.active {
  background: var(--hdfc-blue-dim);
  color: var(--hdfc-blue-light);
}
.sidebar__item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--hdfc-blue-light);
  border-radius: 0 3px 3px 0;
}
.sidebar__item.active svg {
  stroke: var(--hdfc-blue-light);
}

.sidebar__footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}

.system-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.status-dot--green {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: pulse-green 2s ease-in-out infinite;
}

@keyframes pulse-green {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ---- Main Content ---- */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  padding-bottom: 40px;
  background: var(--bg-primary);
}

/* ---- Screens ---- */
.screen {
  display: none;
  animation: fadeIn 0.3s ease;
}
.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.screen__header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.screen__header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-range-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
}

.env-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: var(--hdfc-blue-dim);
  color: var(--hdfc-blue-light);
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn--sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}
.btn--xs {
  padding: 4px 10px;
  font-size: 0.75rem;
}
.btn--full {
  width: 100%;
  justify-content: center;
}

.btn--primary {
  background: var(--gradient-hdfc);
  color: white;
  box-shadow: 0 2px 8px rgba(0, 75, 135, 0.35);
}
.btn--primary:hover {
  box-shadow: 0 4px 16px rgba(0, 75, 135, 0.5);
  transform: translateY(-1px);
}

.btn--success {
  background: var(--gradient-green);
  color: white;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}
.btn--success:hover {
  box-shadow: 0 4px 16px rgba(34, 197, 94, 0.4);
  transform: translateY(-1px);
}

.btn--warning {
  background: var(--yellow);
  color: var(--text-inverse);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}
.btn--warning:hover {
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
  transform: translateY(-1px);
}

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
.btn--ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}
.btn--ghost.active {
  background: var(--hdfc-blue-dim);
  color: var(--hdfc-blue-light);
  border-color: var(--hdfc-blue);
}

.btn--danger {
  background: transparent;
  color: var(--red);
  border: 1px solid var(--red-dim);
}
.btn--danger:hover {
  background: var(--red-dim);
}

/* ---- Input / Select / Textarea ---- */
.input,
.select,
.textarea {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 9px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition:
    border-color var(--transition-fast),
    box-shadow var(--transition-fast);
  outline: none;
  width: 100%;
}
.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--hdfc-blue);
  box-shadow: 0 0 0 3px var(--hdfc-blue-dim);
}
.input::placeholder,
.textarea::placeholder {
  color: var(--text-muted);
}
.select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6A7A' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}
.textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.6;
}

/* ---- Form ---- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ---- Panel Title ---- */
.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

/* ---- Table ---- */
.table-wrapper {
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.table th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.table tr:hover td {
  background: var(--bg-hover);
}
.table tr:last-child td {
  border-bottom: none;
}

/* ---- Toggle Switch ---- */
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  cursor: pointer;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle__slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: 11px;
  transition: all var(--transition-fast);
}
.toggle__slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background: var(--text-secondary);
  border-radius: 50%;
  transition: all var(--transition-fast);
}
.toggle input:checked + .toggle__slider {
  background: var(--green-dim);
  border-color: var(--green);
}
.toggle input:checked + .toggle__slider::before {
  transform: translateX(18px);
  background: var(--green);
}

/* ================================
   SCREEN 1: DASHBOARD
   ================================ */

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all var(--transition);
}
.kpi-card:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.kpi-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kpi-card__icon--blue {
  background: var(--hdfc-blue-dim);
  color: var(--hdfc-blue-light);
}
.kpi-card__icon--green {
  background: var(--green-dim);
  color: var(--green);
}
.kpi-card__icon--purple {
  background: var(--hdfc-red-dim);
  color: var(--hdfc-red);
}
.kpi-card__icon--orange {
  background: var(--orange-dim);
  color: var(--orange);
}

.kpi-card__icon svg {
  stroke: currentColor;
}

.kpi-card__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-card__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.kpi-card__value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.kpi-card__change {
  font-size: 0.75rem;
  font-weight: 600;
}
.kpi-card__change--up {
  color: var(--green);
}
.kpi-card__change--down {
  color: var(--red);
}

/* Charts Grid */
.charts-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

.chart-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}
.chart-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.chart-panel__header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}
.chart-panel__actions {
  display: flex;
  gap: 4px;
}
.chart-panel__body {
  position: relative;
}

/* Alerts Panel */
.alerts-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}
.alerts-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.alerts-panel__header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

.alert-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  margin-bottom: 8px;
  transition: background var(--transition-fast);
}
.alert-item:hover {
  background: var(--bg-hover);
}
.alert-item:last-child {
  margin-bottom: 0;
}

.alert-item__icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.85rem;
}
.alert-item__icon--red {
  background: var(--red-dim);
  color: var(--red);
}
.alert-item__icon--yellow {
  background: var(--yellow-dim);
  color: var(--yellow);
}
.alert-item__icon--blue {
  background: var(--blue-dim);
  color: var(--blue);
}

.alert-item__content {
  flex: 1;
}
.alert-item__title {
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 2px;
}
.alert-item__time {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.alert-item__severity {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.alert-item__severity--critical {
  background: var(--red-dim);
  color: var(--red);
}
.alert-item__severity--warning {
  background: var(--yellow-dim);
  color: var(--yellow);
}
.alert-item__severity--info {
  background: var(--blue-dim);
  color: var(--blue);
}

/* ================================
   SCREEN 2: AGENT CONTROL
   ================================ */
.agent-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  height: calc(100vh - var(--topnav-height) - 100px);
}

.agent-list-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  overflow-y: auto;
}

.agent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.agent-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.agent-list__item:hover {
  background: var(--bg-hover);
}
.agent-list__item.active {
  background: var(--hdfc-blue-dim);
  border: 1px solid rgba(0, 75, 135, 0.35);
}

.agent-list__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.agent-list__dot--green {
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}
.agent-list__dot--yellow {
  background: var(--yellow);
  box-shadow: 0 0 6px var(--yellow);
}
.agent-list__dot--red {
  background: var(--red);
  box-shadow: 0 0 6px var(--red);
}

.agent-list__info {
  display: flex;
  flex-direction: column;
}
.agent-list__name {
  font-size: 0.88rem;
  font-weight: 500;
}
.agent-list__status {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Agent Config Panel */
.agent-config-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  overflow-x: auto;
}
.tab {
  padding: 12px 18px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
  position: relative;
}
.tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.tab.active {
  color: var(--hdfc-blue-light);
}
.tab.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--hdfc-blue-light);
}

/* Editor Area */
.editor-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}
.editor-toolbar__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  font-family: "Consolas", "Monaco", monospace;
}
.editor-toolbar__right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.token-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 3px 8px;
  background: var(--bg-primary);
  border-radius: 4px;
}

.editor-wrapper {
  flex: 1;
  overflow: auto;
}

.code-editor {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.7;
  padding: 16px;
  min-height: 300px;
  color: var(--text-primary);
  background: var(--bg-primary);
  outline: none;
  white-space: pre-wrap;
  tab-size: 2;
}

/* Diff View */
.diff-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 100%;
}
.diff-editor.hidden {
  display: none;
}

.diff-col {
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.diff-col--old {
  border-right: 1px solid var(--border-color);
}
.diff-col__header {
  padding: 8px 14px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
}
.diff-col__content {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  padding: 14px;
  flex: 1;
  background: var(--bg-primary);
  color: var(--text-secondary);
}

.diff-line--added {
  background: var(--green-dim);
  color: var(--green);
}
.diff-line--removed {
  background: var(--red-dim);
  color: var(--red);
  text-decoration: line-through;
}

/* Agent Actions */
.agent-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

/* ================================
   SCREEN 3: CALL SIMULATOR
   ================================ */
.sim-input-section {
  margin-bottom: 28px;
}
.sim-input-group {
  display: flex;
  gap: 10px;
}
.sim-input {
  flex: 1;
}

/* Flow Diagram */
.sim-flow {
  display: flex;
  align-items: center;
  justify-content: center; /* Fixes left-cutoff on overflow */
  gap: 0;
  padding: 50px 30px;
  background: linear-gradient(to right, #fafcff, #ffffff, #fafcff);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Custom horizontal scrollbar */
.sim-flow::-webkit-scrollbar {
  height: 8px;
}
.sim-flow::-webkit-scrollbar-track {
  background: var(--bg-tertiary);
  border-radius: 4px;
  margin: 0 16px;
}
.sim-flow::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
.sim-flow::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.sim-flow__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px; /* Slightly more space */
  flex-shrink: 0;
  position: relative;
  z-index: 2; /* keep above lines */
}
.sim-flow__node {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-primary); /* Less grey */
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.05s ease;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.02),
    0 2px 5px rgba(0, 0, 0, 0.04);
}
.sim-flow__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color var(--transition);
  text-transform: capitalize;
  white-space: nowrap;
}

.sim-flow__step.active .sim-flow__node {
  border-color: var(--hdfc-blue);
  background: var(--bg-card);
  color: var(--hdfc-blue);
  box-shadow: 0 0 0 4px var(--hdfc-blue-dim);
  animation: node-pulse 2s infinite;
}
.sim-flow__step.active .sim-flow__label {
  color: var(--hdfc-blue);
}
.sim-flow__step.completed .sim-flow__node {
  border-color: var(--green);
  background: var(--green-dim);
  color: var(--green);
}
.sim-flow__step.blocked .sim-flow__node {
  border-color: var(--hdfc-red);
  background: var(--bg-card);
  color: var(--hdfc-red);
  box-shadow: 0 0 0 4px var(--hdfc-red-dim);
}
.sim-flow__step.blocked .sim-flow__label {
  color: var(--hdfc-red);
  font-weight: 700;
}
.sim-flow__step.completed .sim-flow__label {
  color: var(--green);
}

@keyframes node-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(0, 75, 135, 0.4);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(0, 75, 135, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(0, 75, 135, 0);
  }
}

.sim-flow__connector {
  width: 38px; /* Slightly tighter connections */
  height: 4px; /* Thicker horizontal line */
  position: relative;
  flex-shrink: 0;
  z-index: 1; /* behind nodes */
  transform: translateY(-12px); /* Align with nodes visually */
}
.sim-flow__line {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  position: relative;
  transition: background 0.05s ease;
  border-radius: 2px;
}
.sim-flow__connector.active .sim-flow__line {
  background: var(--hdfc-blue-light);
  box-shadow: 0 0 10px rgba(0, 75, 135, 0.3);
}
.sim-flow__connector.completed .sim-flow__line {
  background: var(--green);
}

/* Step Details */
.sim-details {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  animation: slideUp 0.3s ease;
}
.sim-details.hidden {
  display: none;
}
.sim-details h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mic Recording Pulse */
@keyframes micPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(237, 28, 36, 0.4);
    color: var(--hdfc-red);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(237, 28, 36, 0);
    color: var(--hdfc-red);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(237, 28, 36, 0);
    color: var(--hdfc-red);
  }
}
.sim-mic--recording {
  animation: micPulse 1.5s infinite;
  color: var(--hdfc-red) !important;
}
/* ================================
   CHAT CONVERSATION UI
   ================================ */
.chat-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  border-end-start-radius: 0px;
  border-end-end-radius: 0px;
  padding: 24px;
  max-height: 80dvh;
  overflow-y: auto;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}
.chat-container.hidden {
  display: none;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-turn {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 80%;
  position: relative;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.chat-bubble--user {
  align-self: flex-end;
  background: var(--gradient-blue);
  color: #fff;
}

.chat-bubble--agent {
  align-self: flex-start;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.chat-bubble-agent-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--hdfc-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.chat-system-trace {
  margin: 10px 40px;
  padding: 16px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
}

/* Internal Trace List overriding */
.chat-system-trace .execution-trace-list {
  max-height: none;
  overflow-y: visible;
  padding-right: 0;
}

/* Execution Trace List */
.execution-trace-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 440px;
  overflow-y: auto;
  padding-right: 8px;
}

.trace-item {
  display: flex;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  /* Animation removed for instant rendering */
}
.trace-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trace-item__icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--hdfc-blue);
}

.trace-item__icon--output {
  background: var(--green-dim);
  color: var(--green);
}

.trace-item__icon--user {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.trace-item__content {
  flex: 1;
}

.trace-item__header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.trace-item__header span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 8px;
}

.trace-item__body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.trace-item__body pre {
  background: var(--bg-primary);
  padding: 8px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
  border: 1px solid var(--border-light);
  white-space: pre-wrap;
}

.trace-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.trace-action-btn {
  font-size: 0.75rem;
  padding: 6px 12px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid;
}
.trace-action-btn--accept {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.4);
}
.trace-action-btn--accept:hover {
  background: rgba(34, 197, 94, 0.2);
}
.trace-action-btn--decline {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border-color: var(--border-light);
}
.trace-action-btn--decline:hover {
  background: var(--bg-tertiary);
}

/* ================================
   SCREEN 4: COMPLIANCE
   ================================ */
.compliance-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compliance-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}

.blocklist-form {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.blocklist-form .input {
  flex: 1;
}
.blocklist-form .select {
  width: 150px;
  flex-shrink: 0;
}

.compliance-sim__input-group {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.compliance-sim__input-group .input {
  flex: 1;
}

.compliance-sim__result {
  padding: 16px;
  border-radius: var(--radius-sm);
  animation: fadeIn 0.3s ease;
}
.compliance-sim__result.hidden {
  display: none;
}
.compliance-sim__result--pass {
  background: var(--green-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.compliance-sim__result--fail {
  background: var(--red-dim);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.compliance-sim__result-text {
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.compliance-sim__result--pass .compliance-sim__result-text {
  color: var(--green);
}
.compliance-sim__result--fail .compliance-sim__result-text {
  color: var(--red);
}

/* ================================
   SCREEN 5: CAMPAIGNS
   ================================ */
.campaigns-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 16px;
}

.campaign-form-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}
.campaign-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.campaign-table-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
}

/* Campaign Status */
.campaign-status {
  display: flex;
  align-items: center;
  gap: 8px;
}
.campaign-status__label {
  font-size: 0.75rem;
  font-weight: 600;
}
.campaign-status__label--on {
  color: var(--green);
}
.campaign-status__label--off {
  color: var(--text-muted);
}

/* Campaign Actions */
.campaign-actions {
  display: flex;
  gap: 6px;
}

/* ================================
   TOAST
   ================================ */
#toast-container {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 420px;
  animation:
    toastIn 0.35s ease,
    toastOut 0.3s ease 3s forwards;
  font-size: 0.85rem;
}
.toast--success {
  border-left: 3px solid var(--green);
}
.toast--error {
  border-left: 3px solid var(--red);
}
.toast--warning {
  border-left: 3px solid var(--yellow);
}
.toast--info {
  border-left: 3px solid var(--blue);
}

.toast__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.toast--success .toast__icon {
  color: var(--green);
}
.toast--error .toast__icon {
  color: var(--red);
}
.toast--warning .toast__icon {
  color: var(--yellow);
}
.toast--info .toast__icon {
  color: var(--blue);
}

.toast__message {
  flex: 1;
  color: var(--text-primary);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* ================================
   MODAL
   ================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 540px;
  max-width: 90vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.modal__title {
  font-size: 1rem;
  font-weight: 600;
}
.modal__close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.modal__close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.modal__body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}
.modal__body .form-group {
  margin-bottom: 14px;
}
.modal__body .form-group:last-child {
  margin-bottom: 0;
}
.modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
}
.modal__footer:empty {
  display: none;
}

/* ================================
   DROPDOWN
   ================================ */
.dropdown {
  position: fixed;
  top: 52px;
  right: 60px;
  width: 380px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  animation: slideUp 0.2s ease;
}
.dropdown.hidden {
  display: none;
}
.dropdown--sm {
  width: 260px;
  right: 16px;
}

.dropdown__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}
.dropdown__header h4 {
  font-size: 0.88rem;
  font-weight: 600;
}
.dropdown__list {
  max-height: 320px;
  overflow-y: auto;
}
.dropdown__footer {
  padding: 8px;
  border-top: 1px solid var(--border-color);
}
.dropdown__divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 0;
}

.dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}
.dropdown__item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.dropdown__item--danger {
  color: var(--red);
}
.dropdown__item--danger:hover {
  background: var(--red-dim);
  color: var(--red);
}

.dropdown__alert-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-color);
}
.dropdown__alert-item:hover {
  background: var(--bg-hover);
}
.dropdown__alert-item:last-child {
  border-bottom: none;
}
.dropdown__alert-item.unread {
  background: var(--bg-tertiary);
}
.dropdown__alert-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.dropdown__alert-dot--red {
  background: var(--red);
}
.dropdown__alert-dot--yellow {
  background: var(--yellow);
}
.dropdown__alert-dot--blue {
  background: var(--blue);
}
.dropdown__alert-info {
  flex: 1;
}
.dropdown__alert-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.dropdown__alert-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.dropdown__profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.dropdown__profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gradient-hdfc);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}
.dropdown__profile-info {
  display: flex;
  flex-direction: column;
}
.dropdown__profile-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}
.dropdown__profile-email {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ================================
   BUTTON STATES
   ================================ */
.btn:disabled,
.btn.btn--loading {
  opacity: 0.6;
  pointer-events: none;
  cursor: not-allowed;
}
.btn--loading {
  position: relative;
}
.btn--loading::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 6px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Alert dismiss */
.alert-item__dismiss {
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  transition: all var(--transition-fast);
}
.alert-item__dismiss:hover {
  background: var(--red-dim);
  color: var(--red);
}

/* Alert clickable */
.alert-item {
  cursor: pointer;
}

/* ================================
   SCREEN 6: OBSERVABILITY
   ================================ */
.observability-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  height: calc(100vh - var(--topnav-height) - 120px);
}

.observability-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  padding-right: 8px;
}

.obs-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.obs-chart-container,
.obs-logs-container {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

/* ================================
   HAMBURGER (hidden on desktop)
   ================================ */
.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.hamburger:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 89;
}
.sidebar-overlay.hidden {
  display: none;
}

/* ================================
   RESPONSIVE: TABLET (≤1200px)
   ================================ */
@media (max-width: 1200px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .compliance-layout {
    grid-template-columns: 1fr;
  }
  .campaigns-layout {
    grid-template-columns: 1fr;
  }
  .sim-details__grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .sim-flow {
    gap: 0;
    padding: 24px 10px;
  }
  .sim-flow__connector {
    width: 30px;
  }
}

/* ================================
   RESPONSIVE: SMALL TABLET (≤900px)
   ================================ */
@media (max-width: 900px) {
  .agent-layout {
    grid-template-columns: 1fr;
  }
  .agent-layout {
    height: auto;
  }
  .agent-list-panel {
    max-height: 200px;
  }
  .diff-editor {
    grid-template-columns: 1fr;
  }
}

/* ================================
   RESPONSIVE: MOBILE (≤768px)
   ================================ */
@media (max-width: 768px) {
  /* Show hamburger */
  .hamburger {
    display: flex;
  }

  /* Collapse sidebar */
  .sidebar {
    position: fixed;
    top: var(--topnav-height);
    left: 0;
    bottom: 0;
    z-index: 90;
    transform: translateX(-100%);
    transition: transform var(--transition);
    width: var(--sidebar-width);
  }
  .sidebar.open {
    transform: translateX(0);
  }

  /* Main content takes full width */
  .main-content {
    margin-left: 0;
    width: 100%;
  }

  /* Topnav adjustments */
  .topnav {
    padding: 0 12px;
  }
  .topnav__center {
    display: none;
  }
  .logo__text {
    font-size: 1rem;
  }

  /* Screen padding */
  .screen {
    padding: 16px;
    padding-bottom: 60px;
  }
  .screen__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }
  .screen__header h1 {
    font-size: 1.2rem;
  }

  /* KPIs */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
  }
  .kpi-card {
    padding: 14px;
    gap: 10px;
  }
  .kpi-card__icon {
    width: 36px;
    height: 36px;
  }
  .kpi-card__value {
    font-size: 1.3rem;
  }
  .kpi-card__label {
    font-size: 0.68rem;
  }

  /* Charts */
  .charts-grid {
    gap: 10px;
    margin-bottom: 16px;
  }
  .chart-panel {
    padding: 14px;
  }
  .chart-panel__header h3 {
    font-size: 0.85rem;
  }

  /* Alerts */
  .alerts-panel {
    padding: 14px;
  }
  .alert-item {
    padding: 10px;
    gap: 8px;
  }
  .alert-item__icon {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
  }
  .alert-item__title {
    font-size: 0.8rem;
  }
  .alert-item__severity {
    font-size: 0.65rem;
    padding: 2px 6px;
  }

  /* Simulator flow */
  .sim-flow {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 30px 20px;
  }
  .sim-flow__node {
    width: 44px;
    height: 44px;
  }
  .sim-flow__label {
    font-size: 0.7rem;
  }
  .sim-flow__connector {
    width: 24px;
  }
  .sim-details__grid {
    grid-template-columns: 1fr;
  }
  .sim-detail-card {
    padding: 12px;
  }
  .sim-input-group {
    flex-direction: column;
  }

  /* Agent control */
  .agent-list-panel {
    padding: 14px;
  }
  .agent-list__item {
    padding: 10px 12px;
  }
  .agent-config-panel {
    min-height: 400px;
  }
  .tabs {
    overflow-x: auto;
  }
  .tab {
    padding: 10px 14px;
    font-size: 0.75rem;
  }
  .agent-actions {
    flex-wrap: wrap;
    padding: 10px;
  }
  .editor-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }

  /* Compliance */
  .compliance-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .compliance-section {
    padding: 14px;
  }
  .blocklist-form {
    flex-direction: column;
  }
  .blocklist-form .input {
    width: 100%;
  }
  .blocklist-form .select {
    width: 100%;
  }
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .compliance-section .table {
    min-width: 400px;
  }
  .compliance-sim__input-group {
    flex-direction: column;
  }
  .compliance-sim__input-group .input {
    width: 100%;
  }

  /* Campaigns */
  .campaign-form-panel {
    padding: 14px;
  }
  .campaign-form {
    gap: 12px;
  }
  .campaign-table-panel {
    padding: 14px;
    overflow-x: auto;
  }
  .table {
    font-size: 0.78rem;
    min-width: 500px;
  }
  .table th,
  .table td {
    padding: 8px 10px;
  }

  /* Dropdowns */
  .dropdown {
    width: calc(100vw - 24px);
    right: 12px;
  }
  .dropdown--sm {
    width: calc(100vw - 24px);
    right: 12px;
  }

  /* Modal */
  .modal {
    width: calc(100vw - 24px);
    max-height: 85vh;
  }
  .modal__header {
    padding: 12px 16px;
  }
  .modal__body {
    padding: 16px;
  }
  .modal__footer {
    padding: 10px 16px;
  }
}

/* ================================
   RESPONSIVE: SMALL MOBILE (≤480px)
   ================================ */
@media (max-width: 480px) {
  html {
    font-size: 13px;
  }

  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .kpi-card {
    flex-direction: row;
    align-items: center;
  }

  .screen {
    padding: 12px;
  }
  .screen__header h1 {
    font-size: 1.1rem;
  }

  .chart-panel__header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .chart-panel__actions {
    align-self: flex-end;
  }

  .sim-flow__node {
    width: 38px;
    height: 38px;
  }
  .sim-flow__connector {
    width: 16px;
  }
  .sim-flow__label {
    font-size: 0.6rem;
  }

  .btn {
    padding: 7px 12px;
    font-size: 0.78rem;
  }
  .btn--sm {
    padding: 5px 10px;
  }

  .topnav {
    gap: 6px;
  }
  .avatar {
    width: 30px;
    height: 30px;
    font-size: 0.65rem;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
  }
}

/* ================================
   SCREEN 7: DECISIONING ENGINE
   ================================ */
.decisioning-layout {
  display: flex;
  flex-direction: column;
  gap: 24px;
  height: auto;
}

.decisioning-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 20px;
}

.tier-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-primary);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
  transition:
    transform var(--transition-fast),
    box-shadow var(--transition-fast);
}

.tier-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tier-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.tier-card--hot::before {
  background: var(--hdfc-red);
}
.tier-card--warm::before {
  background: var(--yellow);
}
.tier-card--cold::before {
  background: var(--hdfc-blue);
}

.tier-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tier-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.tier-card__tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-card__body {
  display: flex;
  gap: 16px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.tier-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tier-metric span:first-child {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.tier-metric-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.tier-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.decisioning-row {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 24px;
}

.decisioning-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.pipeline-graph {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0;
  padding: 20px;
  background: var(--bg-primary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  overflow-x: auto;
}

.pipeline-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 90px;
  text-align: center;
  padding: 12px;
  border: 2px solid transparent;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  transition: all var(--transition-fast);
}

.pipeline-node span {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
}

.pipeline-node--active {
  background: var(--bg-hover);
  box-shadow: var(--shadow-sm);
  transform: scale(1.05);
}

.pipeline-arrow {
  color: var(--text-muted);
  font-size: 1.2rem;
}

.pipeline-metrics {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.pipeline-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-lbl {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.context-controls {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.context-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
}

.context-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.context-info strong {
  font-size: 0.85rem;
  color: var(--text-primary);
}

.context-info span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toggle Switch Styling */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-color);
  transition: 0.4s;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
}
input:checked + .slider {
  background-color: var(--green);
}
input:focus + .slider {
  box-shadow: 0 0 1px var(--green);
}
input:checked + .slider:before {
  transform: translateX(20px);
}
.slider.round {
  border-radius: 24px;
}
.slider.round:before {
  border-radius: 50%;
}

.token-savings-kpi {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
  padding: 16px;
  background: rgba(34, 197, 94, 0.05);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--radius);
}

.token-kpi-ring {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 4px solid var(--green);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--green);
  font-weight: 700;
  font-size: 1.1rem;
}

.token-kpi-ring small {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.token-kpi-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.token-kpi-details strong {
  color: var(--text-primary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-badge--success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--green);
}
.status-badge--dark {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* ================================
   SCREEN 3: CALL SIMULATOR (CHAT UI)
   ================================ */

#screen-call-simulator.screen.active {
  display: flex;
  flex-direction: column;
  height: calc(
    100vh - var(--topnav-height) - 64px
  ); /* exact space after 24px top / 40px bottom padding */
}

.sim-chat-header {
  flex-shrink: 0;
  margin-bottom: 0px;
  padding-bottom: 0px;
}

.sim-header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  width: 100%;
}

/* ================================
   Agent Flow Timeline (AFT)
   ================================ */
.agent-flow-timeline {
  flex: 1;
  background: transparent;
  padding: 0 16px;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--hdfc-blue-dim) transparent;
  display: flex;
  justify-content: center;
}

.agent-flow-timeline::-webkit-scrollbar {
  height: 4px;
}
.agent-flow-timeline::-webkit-scrollbar-track {
  background: transparent;
}
.agent-flow-timeline::-webkit-scrollbar-thumb {
  background: var(--hdfc-blue-dim);
  border-radius: 4px;
}

.aft-track {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: max-content;
}

/* ── Individual Node ── */
.aft-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
  background: transparent;
  min-width: 50px;
  cursor: default;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.aft-node--start,
.aft-node--end {
  background: transparent;
}

/* ── Node Icon ── */
.aft-node__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hdfc-blue-dim);
  color: var(--hdfc-blue);
  border: 1.5px solid transparent;
  transition: all 0.3s ease;
}

/* ── Optional Node (Handoff) ── */
.aft-node--optional .aft-node__icon {
  border: 1px dashed var(--text-muted);
  background: transparent;
  color: var(--text-muted);
  opacity: 0.8;
}

.aft-node--optional .aft-node__label {
  color: var(--text-muted);
}

/* Color Variants */
.aft-node__icon--blue {
  background: var(--hdfc-blue-dim);
  color: var(--hdfc-blue);
}
.aft-node__icon--green {
  background: var(--green-dim);
  color: var(--green);
}
.aft-node__icon--purple {
  background: var(--purple-dim);
  color: var(--purple);
}
.aft-node__icon--orange {
  background: var(--orange-dim);
  color: var(--orange);
}
.aft-node__icon--red {
  background: var(--red-dim);
  color: var(--hdfc-red);
}
.aft-node__icon--shield {
  background: rgba(245, 158, 11, 0.12);
  color: var(--yellow);
}

/* ── Node Label ── */
.aft-node__label {
  font-size: 0.55rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* ── Connector ── */
.aft-connector {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  width: 16px;
  position: relative;
}

.aft-connector__line {
  flex: 1;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--border-light) 0%,
    var(--hdfc-blue-dim) 50%,
    var(--border-light) 100%
  );
  border-radius: 1px;
  position: relative;
  overflow: hidden;
}

.aft-connector__line::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    var(--hdfc-blue),
    transparent
  );
  animation: aft-flow 3s ease-in-out infinite;
}

@keyframes aft-flow {
  0% {
    left: -100%;
  }
  100% {
    left: 200%;
  }
}

.aft-connector__arrow {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1;
  margin-left: -2px;
}

/* ── Active State (fires during simulation) ── */
.aft-node.aft-node--active {
  background: rgba(0, 75, 135, 0.08);
  border-color: var(--hdfc-blue);
  transform: translateY(-3px);
  box-shadow:
    0 6px 24px rgba(0, 75, 135, 0.18),
    0 0 0 3px rgba(0, 75, 135, 0.08);
}

.aft-node.aft-node--active .aft-node__icon {
  background: var(--hdfc-blue);
  color: white;
  box-shadow: 0 0 12px rgba(0, 75, 135, 0.4);
  animation: aft-pulse 1.2s ease-in-out infinite;
}

.aft-node.aft-node--active .aft-node__label {
  color: var(--hdfc-blue);
  font-weight: 700;
}

@keyframes aft-pulse {
  0%,
  100% {
    box-shadow: 0 0 6px rgba(0, 75, 135, 0.3);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 18px rgba(0, 75, 135, 0.5);
    transform: scale(1.08);
  }
}

/* ── Completed State ── */
.aft-node.aft-node--done {
  background: rgba(34, 197, 94, 0.06);
  border-color: rgba(34, 197, 94, 0.3);
}

.aft-node.aft-node--done .aft-node__icon {
  background: var(--green);
  color: white;
}

.aft-node.aft-node--done .aft-node__label {
  color: var(--green);
}

/* ── Error State ── */
.aft-node.aft-node--error {
  background: rgba(237, 28, 36, 0.06);
  border-color: rgba(237, 28, 36, 0.3);
}

.aft-node.aft-node--error .aft-node__icon {
  background: var(--hdfc-red);
  color: white;
  animation: aft-shake 0.5s ease;
}

.aft-node.aft-node--error .aft-node__label {
  color: var(--hdfc-red);
}

@keyframes aft-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  50% {
    transform: translateX(3px);
  }
  75% {
    transform: translateX(-2px);
  }
}

/* ── Completed connector glow ── */
.aft-connector.aft-connector--done .aft-connector__line {
  background: var(--green);
  height: 2.5px;
}

.aft-connector.aft-connector--done .aft-connector__arrow {
  color: var(--green);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .agent-flow-timeline {
    padding: 10px 12px;
  }
  .aft-node {
    min-width: 60px;
    padding: 6px 8px;
  }
  .aft-node__icon {
    width: 26px;
    height: 26px;
  }
  .aft-node__icon svg {
    width: 12px;
    height: 12px;
  }
  .aft-node__label {
    font-size: 0.6rem;
  }
  .aft-connector {
    width: 20px;
  }
}

.sim-chat-layout {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
  min-height: 0;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 24px;
}

.chat-turn {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-bubble {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 85%;
  box-shadow: var(--shadow-sm);
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  0% {
    opacity: 0;
    transform: translateY(12px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble--user {
  align-self: flex-end;
  background: var(--hdfc-blue);
  color: white;
}

.chat-bubble--user strong {
  font-weight: 600;
  color: white;
}

.chat-bubble--agent {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.chat-bubble-agent-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--hdfc-blue-dim);
  color: var(--hdfc-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

/* System Trace Logs inside the chat */
.chat-system-trace {
  margin-top: 4px;
  margin-bottom: 8px;
  margin-left: 20px;
  max-width: 85%;
  align-self: flex-start;
}

.execution-trace-list {
  list-style: none;
  font-family: monospace;
  font-size: 0.75rem;
  border-left: 2px dashed var(--border-light);
  margin: 0;
  padding: 0 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.trace-item {
  position: relative;
  display: flex;
  gap: 12px;
  color: var(--text-secondary);
  animation: fadeIn 0.4s ease;
}

.trace-item__icon {
  position: absolute;
  left: -24.5px; /* Aligns dot on the dashed line */
  top: 2px;
  width: 16px;
  height: 16px;
  background: var(--bg-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.trace-item__content {
  flex: 1;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}

.trace-item__header {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.trace-item__header span {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.trace-item__body pre {
  margin-top: 6px;
  padding: 8px;
  background: var(--bg-tertiary);
  border-radius: 4px;
  overflow-x: auto;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Trace Action Buttons */
.trace-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.trace-action-btn {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s;
}
.trace-action-btn--accept {
  background: #000;
  color: #fff;
}
.trace-action-btn--accept:hover {
  background: #333;
}
.trace-action-btn--decline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.trace-action-btn--decline:hover {
  background: var(--bg-hover);
}

/* Voice Input Footer */
.sim-input-footer {
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  position: sticky;
  bottom: 0;
  z-index: 10;
  flex-shrink: 0;
  height: 20dvh;
  border-radius: 10px;
  border-top-left-radius: 0px;
  border-top-right-radius: 0px;
  border: 1px solid var(--border-color);
}

.sim-input-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.sim-mic-btn {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: var(--hdfc-blue);
  color: white;
  border: none;
  border-radius: 50%;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 75, 135, 0.4);
}

.sim-mic-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 75, 135, 0.5);
}

.sim-mic-btn.sim-mic--recording {
  background: var(--hdfc-red);
  box-shadow: 0 0 0 0 rgba(237, 28, 36, 0.7);
  animation: pulse-mic 1.5s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulse-mic {
  to {
    box-shadow: 0 0 0 25px rgba(237, 28, 36, 0);
  }
}

.sim-voice-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-style: italic;
  font-weight: 500;
  min-height: 20px;
}

/* ================================
   SCREEN 6: OBSERVABILITY (AGENT ANALYTICS)
   ================================ */

.obs-header-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.obs-header-info h3 {
  margin: 0 0 12px 0;
  font-size: 1.4rem;
  color: var(--hdfc-blue);
}

.obs-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.obs-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.obs-badge--status {
  background: var(--green-dim);
  color: var(--green);
  border-color: rgba(34, 197, 94, 0.2);
}

.obs-badge--model {
  background: var(--hdfc-blue-dim);
  color: var(--hdfc-blue);
  border-color: rgba(0, 75, 135, 0.2);
}

.obs-header-owner {
  display: flex;
  align-items: center;
  gap: 8px;
}
.obs-header-owner span {
  font-size: 0.8rem;
  border-radius: 4px;
  background: var(--bg-tertiary);
  padding: 4px 8px;
  font-weight: 600;
}

.obs-content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 24px;
}

@media (max-width: 1024px) {
  .obs-content-grid {
    grid-template-columns: 1fr;
  }
}

.obs-traces-container {
  display: flex;
  flex-direction: column;
}

.obs-trace-table tbody tr {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.2s;
}

.obs-trace-table tbody tr:hover {
  background: var(--bg-hover);
}

.obs-trace-table td {
  padding: 10px 8px;
  color: var(--text-primary);
  font-family: monospace;
}

/* ============================================================
   TTS Controls — Mute & Voice Selector
   ============================================================ */

.tts-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 8px;
}

.tts-mute-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px !important;
  border-radius: 8px;
  transition: all 0.2s ease;
  position: relative;
}

.tts-mute-btn:hover {
  background: var(--bg-hover);
}

/* Show/hide the correct icon based on mute state */
.tts-mute-btn .tts-icon-unmuted {
  display: block;
}
.tts-mute-btn .tts-icon-muted {
  display: none;
}

.tts-mute-btn.tts-muted .tts-icon-unmuted {
}
.tts-mute-btn.tts-muted .tts-icon-muted {
  display: block;
}

.tts-mute-btn.tts-muted {
  color: var(--hdfc-red, #eb1c2d);
  opacity: 0.85;
}

.tts-voice-select {
  font-size: 0.72rem;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  max-width: 180px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.tts-voice-select:focus {
  outline: none;
  border-color: var(--hdfc-blue);
}

@media (max-width: 768px) {
  .tts-controls {
    gap: 4px;
  }
  .tts-voice-select {
    max-width: 120px;
    font-size: 0.65rem;
  }
}
