:root {
  --bg: #f8f9fa;
  --bg-2: #e9ecef;
  --card: #ffffff;
  --card-2: #f1f3f5;
  --border: #dee2e6;
  --text: #212529;
  --muted: #6c757d;
  --accent: #2f9e7f;
  --accent-2: #20c997;
  --danger: #e03131;
  --warn: #f08c00;
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.topbar {
  background: var(--bg-2);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}

.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo {
  height: 28px;
  width: auto;
  display: inline-block;
  vertical-align: middle;
}

.topbar h1 {
  font-size: 18px;
  margin: 0;
}

.tag {
  margin-inline-start: auto;
  font-size: 12px;
  color: var(--muted);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

.hero {
  margin-bottom: 24px;
}

.hero h2 {
  font-size: 26px;
  margin: 0 0 8px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 13px;
}

.alert {
  background: rgba(224, 49, 49, 0.08);
  border: 1px solid var(--danger);
  color: #c92a2a;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

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

.scenario-card h3 {
  margin: 6px 0 4px;
  font-size: 18px;
}

.scenario-card p {
  font-size: 14px;
}

.scenario-badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 3px 10px;
}

.badge-persona {
  display: inline-block;
  background: #1f6ebf;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  padding: 2px 9px;
  margin-inline-start: 6px;
}

.badge-dialect {
  background: #3d9970;
}

.queue-badge {
  background: #7c5cff !important;
  margin-inline-start: 6px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
  overflow: hidden;
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #052e22;
  width: 100%;
  margin-top: 10px;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: var(--card-2);
  color: var(--text);
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  background: var(--bg-2);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.btn-ghost:active {
  transform: translateY(1px);
}

.btn-ghost.is-muted {
  color: var(--warn);
}

.callout {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.callout ol {
  margin: 8px 0 0;
  padding-inline-start: 20px;
}

.callout li {
  margin-bottom: 6px;
  font-size: 14px;
}

/* Custom scenario form */
.section-title {
  font-size: 20px;
  margin: 0 0 14px;
}

.custom-card {
  margin-bottom: 28px;
}

.btn-secondary {
  background: linear-gradient(135deg, #1f6feb, #4c9aff);
  color: #fff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.form-grid .full {
  grid-column: 1 / -1;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 9px 11px;
  font-size: 14px;
  font-family: inherit;
}

.form-grid textarea {
  resize: vertical;
}

.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  outline: none;
  border-color: var(--accent-2);
}

/* Call screen */
.call-screen {
  display: flex;
  justify-content: center;
}

.call-card {
  width: 100%;
  max-width: 560px;
  text-align: center;
}

.call-header {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
}

.call-header h2 {
  margin: 0;
  font-size: 22px;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #1f6feb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
}

.call-meta {
  margin-inline-start: auto;
  text-align: start;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}

.dot-live {
  background: var(--danger);
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.status {
  margin: 22px 0;
  font-size: 15px;
  color: var(--accent-2);
}

.call-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 6px;
}

.call-controls .btn {
  width: auto;
  margin-top: 0;
}

.meter-wrap {
  width: 100%;
  height: 10px;
  background: var(--border);
  border-radius: 5px;
  overflow: hidden;
  margin: 4px 0 18px;
}

.meter {
  width: 0%;
  height: 100%;
  background: var(--accent-2);
  border-radius: 5px;
  transition: width 0.12s linear;
}

.meter.meter-live {
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.center {
  text-align: center;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--border);
  border-top-color: var(--accent-2);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 0.9s linear infinite;
}

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

/* Scorecard */
.score-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
}

.score-header .btn {
  width: auto;
  margin-top: 0;
  margin-inline-start: auto;
}

.overall {
  display: flex;
  align-items: center;
  gap: 20px;
}

.overall-ring {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 6px solid var(--accent);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.overall-num {
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
}

.overall-max {
  font-size: 13px;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 760px) {
  .grid {
    grid-template-columns: 1fr;
  }
  .score-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .score-header .btn {
    margin-left: 0;
  }
}

.score-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.score-label {
  width: 160px;
  font-size: 14px;
  flex-shrink: 0;
}

.bar {
  flex: 1;
  height: 10px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 999px;
}

.score-value {
  width: 44px;
  text-align: right;
  font-size: 13px;
  color: var(--muted);
}

.lead-banner {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  margin-top: 16px;
  border: 1px solid var(--border);
}

.lead-banner span {
  color: var(--muted);
  font-size: 13px;
}

.lead-mql {
  background: rgba(47, 158, 127, 0.15);
  border-color: var(--accent);
}

.lead-followup {
  background: rgba(245, 166, 35, 0.12);
  border-color: var(--warn);
}

.lead-disq {
  background: rgba(229, 72, 77, 0.12);
  border-color: var(--danger);
}

ul.checks li,
ul.warnings li {
  margin-bottom: 8px;
  font-size: 14px;
}

ul.checks {
  list-style: none;
  padding-left: 0;
}

ul.checks li::before {
  content: "✔ ";
  color: var(--accent-2);
}

ul.warnings {
  list-style: none;
  padding-left: 0;
}

ul.warnings li::before {
  content: "▲ ";
  color: var(--warn);
}

.mt {
  margin-top: 18px;
}

.action {
  background: var(--bg-2);
  border-left: 3px solid var(--accent-2);
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
}

details {
  font-size: 14px;
}

details summary {
  cursor: pointer;
  color: var(--accent-2);
  margin-bottom: 8px;
}

.transcript-line {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.transcript-line:last-child {
  border-bottom: none;
}

.who {
  flex-shrink: 0;
  font-weight: 700;
  min-width: 90px;
}

.who-sdr {
  color: var(--accent-2);
}

.who-customer {
  color: #f0a35e;
}

/* Auth + roles */
.login-card {
  max-width: 420px;
  margin: 0 auto;
  text-align: center;
  padding-top: 36px;
}

.login-card-logo {
  height: 56px;
  width: auto;
  display: block;
  margin: 0 auto 20px;
}

.topbar-inner-center {
  justify-content: center;
}

.login-card .form-grid {
  text-align: start;
}

.topbar-user {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.role-badge {
  font-size: 12px;
  font-weight: 600;
  color: #052e22;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  padding: 3px 10px;
}

.btn-logout {
  background: var(--card-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}

.btn-logout:hover {
  filter: brightness(1.15);
}

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

.section-actions .section-title {
  margin: 0;
}

.btn-inline {
  width: auto;
  margin: 0;
  padding: 9px 16px;
  font-size: 14px;
}

.btn-big {
  width: auto;
  margin: 18px auto 0;
  display: block;
  font-size: 18px;
  padding: 16px 40px;
  border-radius: 14px;
}

.random-card {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 28px;
}

.users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 14px 0;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
}

.user-row .user-name {
  font-weight: 700;
}

.user-row .user-role {
  color: var(--muted);
  font-size: 12px;
}

.user-row .btn-inline {
  margin-inline-start: auto;
}

.btn-danger-ghost {
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger-ghost:hover {
  background: rgba(229, 72, 77, 0.12);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(229, 72, 77, 0.2);
}

.btn-danger-ghost:active {
  transform: translateY(1px);
}

.btn-danger-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.temperature-tag {
  font-size: 12px;
  color: var(--muted);
  margin-inline-start: 8px;
}

.scenario-badge.cold {
  background: #e5484d;
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0;
}

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

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 8px;
  margin-bottom: 8px;
}

.form-grid textarea {
  min-height: 110px;
  resize: vertical;
}

.bulk-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: 14px;
}

.bulk-table th,
.bulk-table td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: start;
}

.bulk-table th {
  background: var(--card);
  color: var(--muted);
  font-weight: 600;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

/* =============================================================================
   Admin Dashboard Styles
   ============================================================================= */

.admin-layout {
  display: flex;
  min-height: calc(100vh - 60px);
}

.admin-sidebar {
  width: 260px;
  background: var(--card);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 60px;
  bottom: 0;
  inset-inline-start: 0;
  overflow-y: auto;
}

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

.admin-logo h2 {
  margin: 0;
  font-size: 18px;
}

.admin-nav {
  flex: 1;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  text-align: start;
  width: 100%;
  transition: background 0.15s;
}

.nav-item:hover {
  background: var(--bg-2);
}

.nav-item.active {
  background: var(--accent);
  color: white;
}

.admin-nav-bottom {
  padding: 12px;
  border-top: 1px solid var(--border);
}

.admin-content {
  flex: 1;
  margin-inline-start: 260px;
  padding: 24px;
}

.dashboard-header {
  margin-bottom: 24px;
}

.dashboard-header h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  font-size: 32px;
}

.stat-info h3 {
  margin: 0;
  font-size: 28px;
}

.stat-info p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.dashboard-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.dashboard-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.dashboard-section:hover {
  border-color: var(--accent);
}

.dashboard-section h3 {
  margin: 0 0 8px;
}

.dashboard-section p {
  margin: 0 0 16px;
  color: var(--muted);
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.view-header h1 {
  margin: 0;
}

.classifications-grid,
.ai-clients-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.classification-card,
.ai-client-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-header h3 {
  margin: 0;
}

.badge {
  background: var(--accent);
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
}

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

.btn-start-call {
  background: var(--accent);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}

.btn-start-call:hover {
  background: var(--accent-2);
  transform: translateY(-1px);
}

.btn-start-call:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.filter-bar {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 700px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.test-sessions-list,
.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-sections {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.settings-section h3 {
  margin: 0 0 8px;
}

.settings-section p {
  margin: 0 0 16px;
  color: var(--muted);
}

/* Responsive */
@media (max-width: 768px) {
  .admin-sidebar {
    width: 60px;
    overflow: hidden;
  }
  
  .admin-logo h2,
  .nav-item span {
    display: none;
  }
  
  .admin-content {
    margin-inline-start: 60px;
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr 1fr;
  }
}

/* Test Session Cards */
.test-session-card,
.result-card,
.call-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.badge-pending {
  background: var(--warn);
}

.badge-used {
  background: var(--accent);
}

.badge-completed {
  background: var(--muted);
}

/* Result Details */
.result-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.details-content h4 {
  margin: 12px 0 8px;
  color: var(--text);
  font-size: 14px;
}

.details-content ul {
  margin: 0;
  padding-inline-start: 20px;
}

.details-content li {
  margin-bottom: 4px;
  color: var(--text-secondary);
}

.details-content p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.transcript {
  max-height: 300px;
  overflow-y: auto;
  padding: 12px;
  background: var(--bg);
  border-radius: var(--radius);
}

.transcript p {
  margin-bottom: 8px;
}

/* Topbar user section */
.topbar-user {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.role-badge {
  background: var(--accent);
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}

.btn-logout:hover {
  background: var(--bg-2);
}

/* Language Selector */
.language-selector {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.language-selector .btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  margin-top: 16px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
}

/* Button loading state */
.btn.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.7;
}

.btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}
}

/* Settings → AI & API keys */
.btn-small {
  padding: 4px 10px;
  font-size: 13px;
}

.ai-provider {
  margin: 16px 0;
}

.ai-provider h4,
.ai-add-key h4,
.ai-models h4 {
  margin: 0 0 8px;
}

.ai-key-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) minmax(200px, 1.5fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-2);
  margin-bottom: 8px;
}

.ai-key-row.disabled {
  opacity: 0.6;
}

.ai-key-row.editing {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.ai-key-row label,
.ai-add-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--muted);
}

.ai-key-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ai-last4 {
  font-size: 12px;
  color: var(--muted);
}

.ai-chip {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
}

.ok-chip { background: #d3f9d8; color: #2b8a3e; }
.danger-chip { background: #ffe3e3; color: var(--danger); }
.muted-chip { background: var(--bg-2); color: var(--muted); }

.ai-key-usage {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ai-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-2);
  overflow: hidden;
}

.ai-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.ai-bar-fill.warn { background: var(--warn); }
.ai-bar-fill.danger { background: var(--danger); }

.ai-key-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.ai-add-key,
.ai-models {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 16px;
}

.ai-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.ai-model-area {
  margin-bottom: 16px;
}

.ai-model-area h5 {
  margin: 0 0 8px;
}

.ai-model-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}

.ai-model-rank {
  width: 22px;
  text-align: center;
  font-weight: 700;
  color: var(--muted);
}

.ai-model-name {
  flex: 1 1 220px;
}

@media (max-width: 720px) {
  .ai-key-row {
    grid-template-columns: 1fr;
  }
}

/* Candidate test-call instructions (scheduled link screen). */
.test-call-card { max-width: 560px; text-align: left; }
.test-call-card h2, .test-call-card > .muted, .test-call-card .login-card-logo, #scheduled-call-info { text-align: center; }
.test-call-card .login-card-logo { display: block; margin-left: auto; margin-right: auto; }
.test-call-instructions { margin: 1.25rem 0; padding: 1rem 1.25rem; border: 1px solid #e3e8ef; border-radius: 10px; background: #f8fafc; }
.test-call-instructions h3 { margin: 0 0 .6rem; font-size: 1rem; }
.test-call-instructions ul { margin: 0; padding-left: 1.2rem; }
.test-call-instructions li { margin: .35rem 0; line-height: 1.5; font-size: .92rem; color: #334155; }

/* Candidate test-call completion screen. */
.test-call-done { max-width: 560px; text-align: center; }
.test-call-done p { line-height: 1.6; }
.test-call-done #hiring-platform-cta { margin: 1.25rem 0; }
.test-call-done #hiring-platform-cta .btn { margin-top: .75rem; text-decoration: none; display: inline-block; }

/* Pass / fail against the call's Pass Rate */
.badge-passed {
  background: var(--accent);
}

.badge-failed {
  background: var(--danger);
}

/* Queues inside a classification card */
.queues-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.queues-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.queues-section-header h4 {
  margin: 0;
}

.queue-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--card-2);
  border-radius: 8px;
}

.queue-row-info,
.queue-row-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* A queue's instructions shown on an AI client's profile */
.queue-instructions-hint {
  padding: 10px 12px;
  background: var(--card-2);
  border-inline-start: 3px solid var(--accent);
  border-radius: 8px;
  font-size: 14px;
}

.queue-instructions-text {
  margin-top: 6px;
  white-space: pre-wrap;
}

/* Classifications as folders → queues as sub-folders */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 14px;
}

.crumb {
  background: none;
  border: none;
  padding: 2px 4px;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
}

.crumb:hover {
  text-decoration: underline;
}

.crumb-current {
  font-weight: 600;
}

.crumb-sep {
  color: var(--muted);
}

.folder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.folders-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.folder-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  text-align: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.folder-card:hover,
.folder-card:focus-visible {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.folder-icon {
  font-size: 32px;
  line-height: 1;
}

.folder-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.folder-name {
  font-size: 17px;
}

.folder-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.folder-checklist-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.folder-footnote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.queue-clients {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.settings-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.settings-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 120px;
}

.badge-muted {
  background: var(--muted);
}

/* Checklist editor */
.modal-xl {
  max-width: 1100px;
}

.checklist-table-wrap {
  overflow-x: auto;
  margin: 12px 0;
}

.checklist-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.checklist-table th {
  text-align: start;
  font-size: 13px;
  color: var(--muted);
  padding: 6px;
  border-bottom: 1px solid var(--border);
}

.checklist-table td {
  padding: 6px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.checklist-table td.center {
  text-align: center;
  vertical-align: middle;
}

.checklist-table input:not([type="checkbox"]),
.checklist-table textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}

.checklist-table .weight-input {
  max-width: 80px;
}

.checklist-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Customer persona on the evaluation */
.persona-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}

.persona-row {
  padding: 8px 12px;
  background: var(--card-2);
  border-radius: 8px;
}

.persona-row dt {
  font-size: 12px;
  color: var(--muted);
}

.persona-row dd {
  margin: 2px 0 0;
  font-weight: 600;
}

/* After-call survey (candidates) */
.survey-card {
  margin-top: 16px;
}

.star-rating {
  display: flex;
  gap: 6px;
  margin: 8px 0 16px;
}

.star {
  background: none;
  border: none;
  padding: 0 2px;
  font-size: 34px;
  line-height: 1;
  color: var(--border);
  cursor: pointer;
  transition: color 0.1s, transform 0.1s;
}

.star.on {
  color: #f5b301;
}

.star:hover {
  transform: scale(1.1);
}

.star:focus-visible {
  outline: 2px solid var(--accent);
  border-radius: 4px;
}

.survey-comment {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.survey-comment textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.survey-card .error {
  color: var(--danger);
}
