/* —— Agent Studio theme (gradient xanh) —— */
:root {
  --studio-gradient: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 48%, #3d8fd6 100%);
  --studio-gradient-sidebar: linear-gradient(180deg, #1a3352 0%, #234a73 55%, #2d6a9f 100%);
  --studio-bg: #eef2f7;
  --studio-surface: #ffffff;
  --studio-border: #e2e8f0;
  --studio-primary: #2d6a9f;
  --studio-primary-hover: #1e3a5f;
  --studio-accent: #3d8fd6;
  --studio-radius: 14px;
  --studio-radius-lg: 16px;
  --bs-primary: #2d6a9f;
  --bs-primary-rgb: 45, 106, 159;
}

body.studio-body {
  background: var(--studio-bg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.btn-primary {
  --bs-btn-bg: var(--studio-primary);
  --bs-btn-border-color: var(--studio-primary);
  --bs-btn-hover-bg: var(--studio-primary-hover);
  --bs-btn-hover-border-color: var(--studio-primary-hover);
}

.studio-shell {
  background: var(--studio-bg);
}

.studio-sidebar {
  width: 248px;
  min-width: 248px;
  background: var(--studio-gradient-sidebar);
  box-shadow: 2px 0 12px rgba(30, 58, 95, 0.12);
}

.studio-sidebar .nav-link {
  color: rgba(255, 255, 255, 0.88);
  padding: 0.55rem 0.75rem;
  margin-bottom: 0.15rem;
  border-radius: 10px;
  transition: background 0.15s;
}

.studio-sidebar .nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.studio-sidebar .nav-link.active {
  font-weight: 600;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.studio-hero,
.zns-hero {
  background: var(--studio-gradient);
  flex-shrink: 0;
}

.studio-hero-sub,
.zns-hero-sub {
  color: rgba(255, 255, 255, 0.88);
  max-width: 40rem;
}

.studio-hero-sub a,
.zns-hero-link {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.studio-btn-pill {
  border-radius: 999px !important;
  padding-left: 1rem !important;
  padding-right: 1rem !important;
  font-weight: 500;
}

.studio-btn-light {
  background: #fff;
  border: none;
  color: #1e3a5f;
}

.studio-btn-light:hover {
  background: #f8fafc;
  color: #1e3a5f;
}

.studio-btn-outline-light {
  border: 1px solid rgba(255, 255, 255, 0.65);
  color: #fff;
  background: transparent;
}

.studio-btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: #fff;
}

.studio-badge-hero {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-weight: 500;
}

.studio-content {
  padding: 1.25rem 1.5rem 1.5rem;
}

.studio-card {
  border: none;
  border-radius: var(--studio-radius-lg);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.studio-card .card-header {
  background: var(--studio-surface);
  border-bottom: 1px solid var(--studio-border);
  border-radius: var(--studio-radius-lg) var(--studio-radius-lg) 0 0 !important;
  font-weight: 600;
}

.studio-card-accent {
  border: 1px solid rgba(61, 143, 214, 0.35) !important;
  box-shadow: 0 4px 14px rgba(45, 106, 159, 0.08);
}

.pron-dict-help code {
  font-size: 0.85em;
  color: var(--studio-primary, #2d6a9f);
}

.pron-dict-head {
  padding-left: 0.25rem;
}

.studio-sticky-footer {
  position: sticky;
  bottom: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--studio-border);
}

.studio-login-page {
  min-height: 100vh;
  background: var(--studio-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.studio-login-card {
  width: 100%;
  max-width: 420px;
  border: none;
  border-radius: var(--studio-radius-lg);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
}

.studio-login-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #2d6a9f, #3d8fd6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.form-control,
.form-select {
  border-radius: 10px;
  border-color: var(--studio-border);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 0.2rem rgba(61, 143, 214, 0.2);
}

.voice-call-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 7.5rem;
}

.voice-call-btn {
  position: relative;
  z-index: 2;
  background: var(--studio-gradient);
  border: none;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.voice-call-btn:hover,
.voice-call-btn:focus {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d6a9f 100%);
  border: none;
  filter: brightness(1.05);
}

.voice-call-stage.is-active .voice-call-btn {
  background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
}

.voice-ripple {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 4.5rem;
  height: 4.5rem;
  margin-left: -2.25rem;
  margin-top: -2.25rem;
  border-radius: 50%;
  border: 2px solid rgba(45, 106, 159, 0.45);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.voice-call-stage.is-active .voice-ripple {
  animation: voice-ripple-pulse 2.4s ease-out infinite;
}

.voice-call-stage.is-active .voice-ripple-2 {
  animation-delay: 0.8s;
}

.voice-call-stage.is-active .voice-ripple-3 {
  animation-delay: 1.6s;
}

@keyframes voice-ripple-pulse {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  100% {
    transform: scale(2.35);
    opacity: 0;
  }
}

.voice-transcript {
  max-height: 280px;
  overflow-y: auto;
}

.voice-transcript-line {
  margin-bottom: 0.5rem;
  line-height: 1.45;
}

.voice-transcript-live .voice-transcript-text {
  color: var(--studio-primary);
}

.voice-transcript-live.voice-transcript-user .voice-transcript-text {
  font-style: italic;
  opacity: 0.92;
}

.font-monospace {
  font-size: 0.85rem;
}

/* —— Lịch sử cuộc gọi —— */
.call-history-page,
.zns-page {
  background: var(--studio-bg);
}

.call-history-list-panel {
  width: 400px;
  min-width: 340px;
  max-width: 42%;
  background: var(--studio-surface);
  border-right: 1px solid var(--studio-border);
}

.call-history-search {
  border-radius: 999px;
  padding-left: 2.25rem;
  font-size: 0.875rem;
}

.call-history-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.call-history-agent-toggle {
  border: 1px solid var(--studio-accent);
  border-radius: 999px;
  overflow: hidden;
  padding: 2px;
}

.call-history-agent-toggle .btn {
  border: none;
  border-radius: 999px !important;
  color: var(--studio-primary);
  font-weight: 500;
  flex: 1;
}

.call-history-agent-toggle .btn.active {
  box-shadow: inset 0 0 0 1px var(--studio-accent);
  color: var(--studio-primary);
}

.call-history-select {
  border-radius: 12px;
  font-size: 0.875rem;
}

.call-history-cards {
  max-height: calc(100vh - 300px);
  overflow-y: auto;
}

.call-history-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--studio-border);
  border-radius: var(--studio-radius);
  background: #fff;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.call-history-card:hover {
  border-color: #93c5fd;
}

.call-history-card.is-selected {
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 1px var(--studio-accent);
}

.call-card-time {
  font-size: 0.8rem;
  color: #64748b;
}

.call-card-duration {
  font-size: 0.8rem;
  font-weight: 600;
}

.call-badge-end {
  background: #f1f5f9;
  color: #475569;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 6px;
}

.call-badge-transfer {
  background: var(--studio-accent);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 6px;
}

.call-badge-error {
  background: #dc3545;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  border-radius: 6px;
}

.call-card-meta {
  font-size: 0.8rem;
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.call-card-slug {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.35rem;
  font-family: ui-monospace, monospace;
}

.call-history-detail {
  background: #f8fafc;
}

.call-transcript-box {
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.875rem;
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: #fff;
}

.call-transcript-line {
  margin-bottom: 0.5rem;
}

/* —— Lịch sử ZNS —— */
.zns-status-card {
  border-radius: var(--studio-radius);
  padding: 1rem 1.15rem;
  border: 1px solid transparent;
}

.zns-status-ok {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.zns-status-warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.zns-status-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.zns-status-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.zns-search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 0.85rem;
}

.zns-search-input {
  padding-left: 2.1rem;
  border-radius: 10px;
}

.zns-filter-select {
  border-radius: 10px;
}

.zns-panel {
  border-radius: var(--studio-radius-lg) !important;
  min-height: 280px;
}

.zns-list-body {
  max-height: calc(100vh - 320px);
}

.zns-log-item {
  border: 1px solid var(--studio-border);
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.5rem;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.zns-log-item:hover {
  border-color: #93c5fd;
}

.zns-log-item.is-active {
  border-color: var(--studio-accent);
  box-shadow: 0 0 0 1px var(--studio-accent);
}

.zns-log-time {
  font-size: 0.75rem;
  color: #64748b;
}

.zns-log-phone {
  font-weight: 600;
  font-size: 0.95rem;
}

.zns-log-meta {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.zns-empty-icon {
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: #94a3b8;
}

.zns-code {
  background: #f8fafc;
  border: 1px solid var(--studio-border);
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 0.75rem;
  max-height: 200px;
  overflow: auto;
}
