.ai-voice-console {
  --av-primary: #4f46e5;
  --av-primary-light: #eef2ff;
  --av-blue: #2563eb;
  --av-cyan: #0891b2;
  --av-green: #059669;
  --av-amber: #d97706;
  --av-red: #dc2626;
  --av-ink: #13213a;
  --av-text: #344054;
  --av-muted: #667085;
  --av-border: #e4e9f2;
  --av-soft: #f6f8fc;
  --av-card: #ffffff;
  --av-shadow:
    0 1px 2px rgba(16, 24, 40, .03),
    0 12px 30px rgba(43, 55, 91, .065);
  width: 100%;
  margin-top: 20px;
  color: var(--av-text);
}

.ai-voice-console *,
.ai-voice-console *::before,
.ai-voice-console *::after {
  box-sizing: border-box;
}

.voice-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 28px 30px;
  border: 1px solid rgba(79, 70, 229, .13);
  border-radius: 20px;
  background:
    radial-gradient(
      circle at 95% 5%,
      rgba(96, 165, 250, .22),
      transparent 33%
    ),
    radial-gradient(
      circle at 72% 110%,
      rgba(129, 140, 248, .16),
      transparent 36%
    ),
    linear-gradient(
      135deg,
      #ffffff 0%,
      #f7f8ff 54%,
      #f0f5ff 100%
    );
  box-shadow: var(--av-shadow);
}

.voice-hero::after {
  position: absolute;
  top: -72px;
  right: -58px;
  width: 190px;
  height: 190px;
  border: 34px solid rgba(255, 255, 255, .48);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.voice-hero-copy {
  position: relative;
  z-index: 1;
}

.voice-hero h3 {
  margin: 5px 0 7px;
  color: var(--av-ink);
  font-size: clamp(22px, 2vw, 29px);
  letter-spacing: -.03em;
}

.voice-hero p {
  max-width: 720px;
  margin: 0;
  color: #5d6b85;
  font-size: 14px;
  line-height: 1.65;
}

.voice-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--av-primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.voice-eyebrow::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.voice-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
  margin: 0;
}

.voice-button {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  transition:
    transform .15s ease,
    box-shadow .15s ease,
    border-color .15s ease,
    background .15s ease;
}

.voice-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.voice-button.primary {
  color: #fff;
  background:
    linear-gradient(
      135deg,
      #635bdf 0%,
      #315efb 100%
    );
  box-shadow:
    0 8px 18px rgba(49, 94, 251, .2);
}

.voice-button.primary:hover:not(:disabled) {
  box-shadow:
    0 10px 24px rgba(49, 94, 251, .28);
}

.voice-button.secondary {
  color: #34405a;
  border-color: #d7deea;
  background: rgba(255, 255, 255, .92);
}

.voice-button.secondary:hover:not(:disabled) {
  border-color: #aebbd1;
  background: #fff;
}

.voice-button.danger {
  color: #b42335;
  border-color: #fecdd3;
  background: #fff5f6;
}

.voice-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.voice-safety-banner {
  position: relative;
  z-index: 1;
  grid-column: 1 / -1;
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: -7px;
  padding: 10px 13px;
  border: 1px solid #f4dfaa;
  border-radius: 10px;
  color: #785a16;
  background: rgba(255, 250, 235, .82);
  font-size: 12px;
  line-height: 1.5;
}

.voice-workspace-tabs {
  position: sticky;
  z-index: 5;
  top: 0;
  display: flex;
  gap: 5px;
  margin: 16px 0;
  padding: 6px;
  overflow-x: auto;
  border: 1px solid var(--av-border);
  border-radius: 14px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 7px 24px rgba(31, 42, 68, .055);
  backdrop-filter: blur(12px);
  scrollbar-width: none;
}

.voice-workspace-tabs::-webkit-scrollbar {
  display: none;
}

.voice-tab-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 16px;
  border: 0;
  border-radius: 9px;
  color: #667085;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.voice-tab-button:hover {
  color: var(--av-ink);
  background: #f5f7fb;
}

.voice-tab-button.active {
  color: #fff;
  background:
    linear-gradient(
      135deg,
      #5b55dd,
      #315efb
    );
  box-shadow: 0 5px 12px rgba(49, 94, 251, .18);
}

.voice-tab-panel {
  display: none;
  animation: voiceFadeIn .18s ease;
}

.voice-tab-panel.active {
  display: block;
}

@keyframes voiceFadeIn {
  from {
    opacity: 0;
    transform: translateY(3px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.voice-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(125px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.voice-stat {
  position: relative;
  overflow: hidden;
  min-height: 104px;
  padding: 17px 18px;
  border: 1px solid var(--av-border);
  border-radius: 15px;
  background: var(--av-card);
  box-shadow:
    0 5px 18px rgba(31, 42, 68, .045);
}

.voice-stat::after {
  position: absolute;
  right: -12px;
  bottom: -15px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--av-primary-light);
  content: "";
}

.voice-stat span {
  position: relative;
  z-index: 1;
  display: block;
  margin-bottom: 9px;
  color: var(--av-muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.voice-stat strong {
  position: relative;
  z-index: 1;
  color: var(--av-ink);
  font-size: 27px;
  line-height: 1;
}

.voice-layout {
  display: grid;
  grid-template-columns:
    minmax(0, 1.18fr)
    minmax(330px, .82fr);
  gap: 16px;
}

.voice-card {
  margin: 0 0 16px;
  padding: 21px;
  border: 1px solid var(--av-border);
  border-radius: 17px;
  background: var(--av-card);
  box-shadow: var(--av-shadow);
}

.voice-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding-bottom: 15px;
  border-bottom: 1px solid #edf0f5;
}

.voice-card-head h4 {
  margin: 4px 0 5px;
  color: var(--av-ink);
  font-size: 17px;
  letter-spacing: -.015em;
}

.voice-card-head p {
  max-width: 680px;
  margin: 0;
  color: var(--av-muted);
  font-size: 12px;
  line-height: 1.55;
}

.voice-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .025em;
}

.voice-badge.success {
  color: #067351;
  background: #e5f8f1;
}

.voice-badge.warning {
  color: #995d00;
  background: #fff2d2;
}

.voice-badge.danger {
  color: #b42335;
  background: #ffe8eb;
}

.voice-badge.neutral {
  color: #53627d;
  background: #edf1f6;
}

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

.voice-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.voice-field.full {
  grid-column: 1 / -1;
}

.voice-field label,
.voice-field > span {
  color: #46536a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .025em;
}

.voice-field input,
.voice-field select,
.voice-template textarea {
  width: 100%;
  border: 1px solid #d6deea;
  border-radius: 9px;
  color: var(--av-ink);
  background: #fbfcfe;
  font: inherit;
  font-size: 13px;
  outline: none;
  transition:
    border-color .15s ease,
    box-shadow .15s ease,
    background .15s ease;
}

.voice-field input,
.voice-field select {
  min-height: 41px;
  padding: 8px 10px;
}

.voice-field input:hover,
.voice-field select:hover,
.voice-template textarea:hover {
  border-color: #b9c5d7;
  background: #fff;
}

.voice-field input:focus,
.voice-field select:focus,
.voice-template textarea:focus {
  border-color: var(--av-primary);
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(79, 70, 229, .09);
}

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

.voice-toggle-row label,
.voice-day-grid label {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 7px 10px;
  border: 1px solid #e0e5ed;
  border-radius: 9px;
  color: #445169;
  background: #f8f9fc;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.voice-toggle-row input,
.voice-day-grid input,
.voice-template-header input {
  width: 15px;
  height: 15px;
  accent-color: var(--av-primary);
}

.voice-day-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voice-day-grid label:has(input:checked),
.voice-toggle-row label:has(input:checked) {
  color: #3730a3;
  border-color: #c7d2fe;
  background: #eef2ff;
}

.voice-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 16px;
}

.voice-template {
  margin-bottom: 11px;
  padding: 14px;
  border: 1px solid #e3e8f0;
  border-radius: 12px;
  background: #fafbfe;
}

.voice-template:last-child {
  margin-bottom: 0;
}

.voice-template-header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 9px;
}

.voice-template-header strong {
  display: block;
  color: var(--av-ink);
  font-size: 13px;
}

.voice-template-header small {
  margin-left: 7px;
  color: var(--av-muted);
  font-size: 10px;
  text-transform: uppercase;
}

.voice-template-header label {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 11px;
}

.voice-template textarea {
  min-height: 116px;
  padding: 11px;
  resize: vertical;
  line-height: 1.55;
}

.voice-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #e3e7ee;
  border-radius: 11px;
  background: #fff;
}

.voice-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 11px;
}

.voice-table th,
.voice-table td {
  padding: 10px 11px;
  border-bottom: 1px solid #edf0f4;
  text-align: left;
  vertical-align: middle;
}

.voice-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #667085;
  background: #f7f8fb;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.voice-table tbody tr {
  transition: background .12s ease;
}

.voice-table tbody tr:hover {
  background: #fafbff;
}

.voice-table tr:last-child td {
  border-bottom: 0;
}

.voice-table small {
  color: var(--av-muted);
}

.voice-empty,
.voice-loading {
  padding: 36px 20px;
  color: var(--av-muted);
  text-align: center;
  font-size: 13px;
}

.voice-loading::before {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto 12px;
  border: 3px solid #e5e7eb;
  border-top-color: var(--av-primary);
  border-radius: 50%;
  content: "";
  animation: voiceSpin .75s linear infinite;
}

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

.voice-error {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid #fecdd3;
  border-radius: 11px;
  color: #b42335;
  background: #fff5f6;
  font-size: 13px;
}

.voice-provider {
  display: grid;
  gap: 5px;
  margin-top: 13px;
  padding: 12px 13px;
  border: 1px solid #e1e7f0;
  border-radius: 10px;
  color: #46536a;
  background: #f7f9fc;
  font-size: 11px;
  line-height: 1.5;
}

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

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

@media (max-width: 760px) {
  .ai-voice-console {
    margin-top: 14px;
  }

  .voice-hero {
    grid-template-columns: 1fr;
    padding: 21px;
    border-radius: 16px;
  }

  .voice-hero-actions {
    justify-content: flex-start;
  }

  .voice-safety-banner {
    align-items: flex-start;
  }

  .voice-workspace-tabs {
    margin: 12px 0;
    border-radius: 12px;
  }

  .voice-stat-grid {
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .voice-stat {
    min-height: 91px;
    padding: 14px;
  }

  .voice-card {
    padding: 16px;
    border-radius: 14px;
  }

  .voice-card-head {
    flex-direction: column;
  }

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

  .voice-field.full {
    grid-column: auto;
  }
}

@media (max-width: 440px) {
  .voice-stat-grid {
    grid-template-columns: 1fr;
  }

  .voice-button {
    width: 100%;
  }

  .voice-hero-actions,
  .voice-card-actions {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .voice-button,
  .voice-tab-panel,
  .voice-table tbody tr {
    transition: none;
    animation: none;
  }
}

.voice-log-shortcut {
  justify-content: flex-end;
  margin: 0 0 14px;
}

.voice-tab-panel[data-voice-tab-panel="overview"] > .voice-card {
  margin-bottom: 16px;
}

@media (max-width: 760px) {
  .voice-log-shortcut {
    justify-content: stretch;
  }

  .voice-log-shortcut .voice-button {
    flex: 1 1 180px;
  }
}
