/* Zendesk Agent Workspace Theme - Minimalist & Functional */

:root {
  --zd-bg-canvas: #F8F9FA;
  --zd-surface: #FFFFFF;
  --zd-border: #D8DCDE;
  --zd-border-subtle: #E9EBED;
  
  --zd-text-main: #2F3941;
  --zd-text-muted: #68737D;
  --zd-text-dim: #87929D;
  
  --zd-brand-teal: #17494D;
  --zd-brand-dark: #03363D;
  --zd-accent-blue: #1F73B7;
  --zd-accent-blue-hover: #144A75;
  --zd-accent-blue-light: #EBF4FB;
  
  --zd-status-open: #E35B00;
  --zd-status-open-bg: #FFF0E6;
  --zd-status-pending: #337F67;
  --zd-status-solved: #5E6977;
  
  --zd-call-green: #10B981;
  --zd-call-red: #EF4444;
  --zd-call-amber: #F59E0B;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--zd-bg-canvas);
  color: var(--zd-text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.45;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.zd-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-color: var(--zd-bg-canvas);
}

/* ==========================================================================
   1. Zendesk Top Navigation Bar
   ========================================================================== */
.zd-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  background-color: var(--zd-brand-dark);
  color: #FFFFFF;
  padding: 0 16px;
  user-select: none;
  border-bottom: 1px solid rgba(0, 0, 0, 0.15);
}

.zd-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 100%;
}

.zd-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #A5C2C4;
  cursor: pointer;
}

.zd-tabs {
  display: flex;
  align-items: flex-end;
  height: 100%;
  gap: 4px;
}

.zd-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 500;
  border-top-left-radius: 6px;
  border-top-right-radius: 6px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.zd-tab.active {
  background-color: var(--zd-bg-canvas);
  color: var(--zd-text-main);
}

.zd-tab.inactive {
  background-color: rgba(255, 255, 255, 0.08);
  color: #A5C2C4;
}

.zd-tab.inactive:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.zd-tab-ticket {
  font-family: var(--font-mono);
  font-size: 11px;
  opacity: 0.8;
}

.zd-tab-close {
  background: none;
  border: none;
  color: var(--zd-text-dim);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 3px;
}

.zd-tab-close:hover {
  background-color: rgba(0, 0, 0, 0.08);
  color: var(--zd-text-main);
}

.zd-tab-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: none;
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  color: #A5C2C4;
  cursor: pointer;
  font-size: 16px;
  margin-bottom: 4px;
}

.zd-tab-add:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

/* Center Search */
.zd-topbar-center {
  flex: 1;
  max-width: 440px;
  margin: 0 24px;
}

.zd-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 0 10px;
  color: #FFFFFF;
}

.zd-search-bar input {
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 12px;
  width: 100%;
  outline: none;
}

.zd-search-bar input::placeholder {
  color: #A5C2C4;
}

/* Right Softphone Area */
.zd-topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.zd-softphone-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.status-online,
.status-idle {
  background: var(--zd-call-green);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.8);
}

.status-away {
  background: var(--zd-call-amber);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.8);
}

.status-offline {
  background: #9CA3AF;
  box-shadow: none;
}

.status-ringing {
  background: var(--zd-call-amber);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.9);
  animation: zdPulseRinging 0.5s infinite alternate ease-in-out;
}

.status-live {
  background: var(--zd-call-red);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.9);
  animation: zdPulseLive 1.5s infinite;
}

.status-hold {
  background: #E35B00;
  box-shadow: 0 0 8px rgba(227, 91, 0, 0.9);
  animation: zdPulseLive 2s infinite;
}

@keyframes zdPulseRinging {
  from { transform: scale(0.9); opacity: 0.7; }
  to { transform: scale(1.3); opacity: 1; }
}

@keyframes zdPulseLive {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.zd-agent-profile {
  cursor: pointer;
}

.zd-avatar-small {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--zd-brand-teal);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #FFFFFF;
}

.agent-online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 8px;
  height: 8px;
  background-color: var(--zd-call-green);
  border: 1.5px solid var(--zd-brand-dark);
  border-radius: 50%;
}

/* ==========================================================================
   2. Zendesk Ticket Subheader Bar
   ========================================================================== */
.zd-ticket-subbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 38px;
  background-color: var(--zd-surface);
  border-bottom: 1px solid var(--zd-border);
  padding: 0 16px;
}

.zd-subbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.zd-crumb-org {
  color: var(--zd-text-muted);
  font-weight: 500;
}

.zd-crumb-divider {
  color: var(--zd-border);
}

.zd-crumb-user {
  font-weight: 600;
  color: var(--zd-text-main);
}

.zd-status-badge {
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  transition: all 0.2s ease;
}

.zd-status-badge.open {
  background-color: var(--zd-status-open);
}

.zd-status-badge.pending {
  background-color: #2563EB;
}

.zd-status-badge.solved {
  background-color: #059669;
}

.zd-crumb-ticket {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--zd-text-muted);
}

.call-timer-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--zd-text-muted);
}

.timer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--zd-border);
}

/* ==========================================================================
   3. Main 3-Column Workspace Layout
   ========================================================================== */
.zd-workspace {
  display: grid;
  grid-template-columns: 240px 1fr 340px;
  height: calc(100vh - 82px);
  overflow: hidden;
}

/* ==========================================================================
   LEFT COLUMN: Ticket Fields Sidebar
   ========================================================================== */
.zd-sidebar-left {
  background-color: var(--zd-surface);
  border-right: 1px solid var(--zd-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.zd-panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--zd-border-subtle);
}

.zd-panel-header h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--zd-text-muted);
}

.zd-form-fields {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.zd-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zd-field label {
  font-size: 11px;
  font-weight: 600;
  color: var(--zd-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.zd-field-value {
  padding: 6px 10px;
  background-color: var(--zd-bg-canvas);
  border: 1px solid var(--zd-border);
  border-radius: 4px;
  font-size: 12px;
  color: var(--zd-text-main);
  font-weight: 500;
}

.zd-field-value.requester-name {
  font-weight: 600;
  color: var(--zd-accent-blue);
}

.channel-voice {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--zd-accent-blue);
  font-weight: 600;
}

.zd-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.zd-tag {
  padding: 3px 8px;
  background-color: var(--zd-bg-canvas);
  border: 1px solid var(--zd-border);
  border-radius: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--zd-text-muted);
}

/* ==========================================================================
   CENTER COLUMN: Live Call & Transcript Stream
   ========================================================================== */
.zd-main-pane {
  display: flex;
  flex-direction: column;
  background-color: var(--zd-surface);
  border-right: 1px solid var(--zd-border);
  height: 100%;
  overflow: hidden;
}

.zd-conversation-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--zd-border);
  background-color: #FAFAFB;
}

.zd-call-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.caller-avatar {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #E2E8F0;
  border: 2px solid var(--zd-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: var(--zd-text-main);
}

.pulse-ring {
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 50%;
  border: 2px solid var(--zd-accent-blue);
  opacity: 0;
  transition: all 0.3s;
}

.caller-avatar.ringing {
  border-color: var(--zd-call-amber);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.caller-avatar.ringing .pulse-ring {
  border-color: var(--zd-call-amber);
  animation: zdRippleRing 0.8s infinite;
}

.caller-avatar.speaking .pulse-ring {
  border-color: var(--zd-call-green);
  animation: zdRippleRing 1.4s infinite;
}

@keyframes zdRippleRing {
  0% { transform: scale(0.95); opacity: 0.9; }
  100% { transform: scale(1.35); opacity: 0; }
}

.caller-title {
  font-size: 14px;
  font-weight: 600;
}

.caller-subtitle {
  font-size: 11px;
  color: var(--zd-text-muted);
}

.btn-zd-subtle {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--zd-text-muted);
  cursor: pointer;
}

.btn-zd-subtle:hover {
  color: var(--zd-text-main);
  text-decoration: underline;
}

/* Transcript Stream */
.zd-transcript-stream {
  flex: 1;
  padding: 16px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: #FFFFFF;
}

.zd-empty-call {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  padding: 30px;
  color: var(--zd-text-muted);
}

.zd-phone-callout {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--zd-accent-blue-light);
  color: var(--zd-accent-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.zd-empty-call h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--zd-text-main);
  margin-bottom: 6px;
}

.zd-empty-call p {
  font-size: 13px;
  max-width: 380px;
  line-height: 1.4;
}

.zd-empty-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--zd-text-dim);
}

/* Chat Message Bubbles */
.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  animation: zdFadeIn 0.2s ease forwards;
}

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

.chat-bubble.agent {
  align-self: flex-end;
  background-color: var(--zd-accent-blue-light);
  border: 1px solid #C2DCF2;
  color: #12344D;
  border-bottom-right-radius: 2px;
}

.chat-bubble.caller {
  align-self: flex-start;
  background-color: var(--zd-bg-canvas);
  border: 1px solid var(--zd-border);
  color: var(--zd-text-main);
  border-bottom-left-radius: 2px;
}

.bubble-meta {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  opacity: 0.75;
}

.bubble-text {
  font-size: 13px;
}

/* Interim Listening Bar */
.interim-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background-color: #FAFAFB;
  border-top: 1px solid var(--zd-border-subtle);
  font-size: 11px;
  color: var(--zd-accent-blue);
  font-family: var(--font-mono);
}

.typing-dot {
  width: 6px;
  height: 6px;
  background-color: var(--zd-accent-blue);
  border-radius: 50%;
  animation: zdBlink 1s infinite;
}

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

/* Visualizer Waveform Bar */
.visualizer-container {
  position: relative;
  height: 32px;
  background-color: #F8F9FA;
  border-top: 1px solid var(--zd-border);
  overflow: hidden;
}

#audioVisualizer {
  width: 100%;
  height: 100%;
  display: block;
}

/* Zendesk Call Action Footer */
.zd-composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background-color: #F1F3F5;
  border-top: 1px solid var(--zd-border);
}

.zd-call-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-zd-call {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 4px;
  background-color: var(--zd-call-green);
  color: #FFFFFF;
  border: none;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: background-color 0.15s;
}

.btn-zd-call:hover {
  background-color: #059669;
}

.btn-zd-call.active-call {
  background-color: var(--zd-call-red);
}

.btn-zd-call.active-call:hover {
  background-color: #DC2626;
}

.btn-zd-secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 4px;
  background-color: var(--zd-surface);
  border: 1px solid var(--zd-border);
  color: var(--zd-text-main);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}

.btn-zd-secondary:hover:not(:disabled) {
  background-color: #F8F9FA;
  border-color: #B5BBC0;
}

.btn-zd-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-zd-secondary.active-hold {
  background-color: #FFF0D4;
  border-color: #E35B00;
  color: #8C3B00;
  font-weight: 600;
}

.btn-zd-secondary.active-hold svg {
  stroke: #E35B00;
}

.zd-footer-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zd-ticket-state {
  font-size: 12px;
  color: var(--zd-text-muted);
}

/* ==========================================================================
   RIGHT COLUMN: Customer Context & Zendesk Apps
   ========================================================================== */
.zd-sidebar-right {
  background-color: var(--zd-surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  gap: 1px;
}

/* Requester Profile Card */
.zd-user-card {
  padding: 16px;
  border-bottom: 1px solid var(--zd-border);
  background-color: #FFFFFF;
}

.zd-user-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.zd-user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background-color: #17494D;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.zd-user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--zd-text-main);
}

.zd-user-role {
  font-size: 11px;
  color: var(--zd-text-muted);
}

.zd-user-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zd-detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.zd-dt-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--zd-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.zd-dt-value {
  font-size: 12px;
  color: var(--zd-text-main);
}

.zd-dt-value.link {
  color: var(--zd-accent-blue);
  cursor: pointer;
}

.zd-dt-value.link:hover {
  text-decoration: underline;
}

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

/* Zendesk Apps Container */
.zd-app-box {
  padding: 14px 16px;
  border-bottom: 1px solid var(--zd-border);
  background-color: #FFFFFF;
}

.zd-app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.zd-app-header h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--zd-text-muted);
}

.badge-active {
  font-size: 10px;
  font-weight: 700;
  color: var(--zd-call-green);
  background-color: #ECFDF5;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #A7F3D0;
}

/* RAG Search */
.zd-rag-search {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zd-input-btn-group {
  display: flex;
  gap: 4px;
}

.zd-input-btn-group input {
  flex: 1;
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  border: 1px solid var(--zd-border);
  border-radius: 4px;
  outline: none;
  font-family: var(--font-sans);
}

.zd-input-btn-group input:focus {
  border-color: var(--zd-accent-blue);
  box-shadow: 0 0 0 2px rgba(31, 115, 183, 0.15);
}

.btn-zd-search {
  width: 32px;
  height: 30px;
  border: 1px solid var(--zd-border);
  border-radius: 4px;
  background-color: var(--zd-bg-canvas);
  color: var(--zd-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-zd-search:hover {
  background-color: #EAECEE;
  color: var(--zd-text-main);
}

.rag-results-container {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rag-card {
  padding: 8px 10px;
  border-radius: 4px;
  background-color: var(--zd-bg-canvas);
  border: 1px solid var(--zd-border-subtle);
  font-size: 11px;
}

.rag-card-title {
  font-weight: 600;
  color: var(--zd-accent-blue);
  margin-bottom: 2px;
}

.rag-card-content {
  color: var(--zd-text-muted);
  line-height: 1.35;
}

/* QA Checklist */
.zd-checklist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.zd-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--zd-text-main);
  cursor: pointer;
  line-height: 1.35;
}

.zd-check-item input[type="checkbox"] {
  margin-top: 2px;
  accent-color: var(--zd-accent-blue);
}

/* ==========================================================================
   Zendesk Talk Telephony Presence Selector
   ========================================================================== */
.zd-presence-selector {
  position: relative;
}

.zd-presence-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  background-color: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.zd-presence-btn:hover {
  background-color: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.zd-presence-btn .chevron-icon {
  margin-left: 2px;
  opacity: 0.8;
  transition: transform 0.2s ease;
}

.zd-presence-selector.open .zd-presence-btn .chevron-icon {
  transform: rotate(180deg);
}

.zd-presence-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  background-color: #FFFFFF;
  border: 1px solid var(--zd-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  padding: 6px;
  z-index: 1000;
  animation: zdFadeIn 0.15s ease forwards;
}

.zd-presence-selector.open .zd-presence-menu {
  display: block;
}

.presence-menu-header {
  padding: 6px 10px 4px 10px;
  font-size: 10px;
  font-weight: 700;
  color: var(--zd-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--zd-border-subtle);
  margin-bottom: 4px;
}

.presence-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s;
}

.presence-option:hover {
  background-color: var(--zd-bg-canvas);
}

.presence-option.active {
  background-color: var(--zd-accent-blue-light);
}

.presence-option .option-details {
  display: flex;
  flex-direction: column;
}

.presence-option .option-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--zd-text-main);
}

.presence-option .option-desc {
  font-size: 10px;
  color: var(--zd-text-muted);
}

/* ==========================================================================
   Zendesk Talk Floating Incoming Call Notification (Toast)
   ========================================================================== */
.zd-incoming-toast {
  position: fixed;
  top: 56px;
  right: 20px;
  width: 320px;
  background-color: #FFFFFF;
  border: 1px solid var(--zd-border);
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 1200;
  overflow: hidden;
  animation: zdSlideDownToast 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes zdSlideDownToast {
  from {
    transform: translateY(-20px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.toast-indicator {
  height: 4px;
  background: linear-gradient(90deg, #10B981, #059669);
  animation: zdToastIndicatorPulse 1.2s infinite ease-in-out alternate;
}

@keyframes zdToastIndicatorPulse {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.toast-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px 6px 14px;
}

.toast-badge {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #059669;
  letter-spacing: 0.04em;
}

.toast-ringing-icon {
  display: inline-block;
  animation: zdShakePhone 0.6s infinite ease-in-out;
}

@keyframes zdShakePhone {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-14deg); }
  75% { transform: rotate(14deg); }
}

.toast-queue {
  font-size: 10px;
  font-weight: 500;
  color: var(--zd-text-muted);
  background-color: var(--zd-bg-canvas);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--zd-border-subtle);
}

.toast-body {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 14px 12px 14px;
}

.toast-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: #2F3941;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.toast-info {
  flex: 1;
  min-width: 0;
}

.toast-caller-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--zd-text-main);
  margin-bottom: 2px;
}

.toast-caller-sub {
  font-size: 11px;
  color: var(--zd-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-caller-phone {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--zd-accent-blue);
  margin-top: 2px;
}

.toast-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background-color: #F8F9FA;
  border-top: 1px solid var(--zd-border-subtle);
}

.toast-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.toast-btn.decline {
  background-color: #FFFFFF;
  border: 1px solid var(--zd-border);
  color: #DC2626;
}

.toast-btn.decline:hover {
  background-color: #FEE2E2;
  border-color: #FCA5A5;
}

.toast-btn.accept {
  background-color: #10B981;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.toast-btn.accept:hover {
  background-color: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
  transform: translateY(-1px);
}

/* Empty State Go Online Button */
.btn-zd-go-online {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background-color: #10B981;
  color: #FFFFFF;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.btn-zd-go-online:hover {
  background-color: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.4);
}

/* Standby / Offline button state in footer */
.btn-zd-call.btn-standby {
  background-color: #9CA3AF;
  cursor: not-allowed;
  opacity: 0.8;
}

/* Telephony System Event Notice in Transcript */
.chat-system-notice {
  align-self: center;
  background-color: #F8F9FA;
  border: 1px solid var(--zd-border-subtle);
  border-radius: 12px;
  padding: 5px 14px;
  font-size: 11px;
  font-weight: 500;
  color: var(--zd-text-muted);
  margin: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Zendesk Customer Actions & Rating
   ========================================================================== */
.zd-user-actions {
  display: flex;
  gap: 6px;
  margin: 10px 0 12px 0;
}

.btn-zd-user-action {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-zd-user-action.primary {
  background-color: #EAF2F8;
  border: 1px solid #C2DCF2;
  color: #1F73B7;
}

.btn-zd-user-action.primary:hover {
  background-color: #D4E5F4;
  color: #144A75;
}

.btn-zd-user-action.secondary {
  background-color: #F8F9FA;
  border: 1px solid var(--zd-border);
  color: var(--zd-text-main);
}

.btn-zd-user-action.secondary:hover {
  background-color: #EAECEE;
}

.highlight-rating {
  color: #D97706 !important;
  font-weight: 700 !important;
}

/* ==========================================================================
   Zendesk Ticket Composer (Internal Note vs Public Email Reply)
   ========================================================================== */
.zd-composer-container {
  display: flex;
  flex-direction: column;
  background-color: #FFFFFF;
  border-top: 1px solid var(--zd-border);
  transition: all 0.2s ease;
}

.zd-composer-tabs {
  display: flex;
  background-color: #F8F9FA;
  border-bottom: 1px solid var(--zd-border-subtle);
  padding: 0 8px;
}

.composer-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--zd-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.composer-tab:hover {
  color: var(--zd-text-main);
}

.composer-tab.active[data-mode="internal"] {
  color: #B45309;
  border-bottom-color: #F59E0B;
  background-color: #FFFDF5;
}

.composer-tab.active[data-mode="public"] {
  color: #1F73B7;
  border-bottom-color: #1F73B7;
  background-color: #FFFFFF;
}

.zd-composer-container.mode-internal {
  background-color: #FFFDF5;
  border-left: 3px solid #F59E0B;
}

.zd-composer-container.mode-public {
  background-color: #FFFFFF;
  border-left: 3px solid #1F73B7;
}

.zd-composer-email-target {
  padding: 4px 14px;
  font-size: 11px;
  background-color: #F1F5F9;
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  gap: 6px;
  align-items: center;
}

.email-to-label {
  font-weight: 600;
  color: #64748B;
}

.email-recipient {
  font-family: var(--font-mono);
  color: #0F172A;
}

.zd-composer-body {
  padding: 10px 14px;
}

#composerTextarea {
  width: 100%;
  height: 64px;
  min-height: 48px;
  max-height: 140px;
  resize: vertical;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  color: var(--zd-text-main);
}

  #composerTextarea::placeholder {
    color: #9CA3AF;
    font-style: italic;
  }

  /* Los motivos de contacto (P3.9): van en la ficha del ticket, con el
     resto de campos (prioridad, formulario, tags). No son un adorno: son el
     campo por el que el cliente clasifica despues la llamada. */
  .zd-reason-select {
    width: 100%;
    padding: 6px 10px;
    background-color: var(--zd-bg-canvas);
    border: 1px solid var(--zd-border);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 500;
    color: var(--zd-text-main);
    cursor: pointer;
  }

  .zd-reason-select:focus {
    outline: none;
    border-color: var(--zd-accent-blue);
    box-shadow: 0 0 0 2px rgba(31, 115, 183, 0.15);
  }

  /* Sin motivo elegido, el select avisa: enviar un ticket sin clasificar es
     un ticket que el cliente no puede encontrar despues. */
  .zd-reason-select.invalid {
    border-color: #EF4444;
  }

  /* Y el campo entero llama la atencion: el trainee puede tener la vista
     puesta en la conversacion, no en la ficha del ticket. */
  .zd-field-attention .zd-reason-select {
    animation: zd-reason-pulse 0.45s ease-in-out 3;
  }

  @keyframes zd-reason-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
    50% { box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25); }
  }


/* ==========================================================================
   Zendesk Ticket Submit Split Button
   ========================================================================== */
.zd-submit-group {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  height: 32px;
  box-sizing: border-box;
}

.btn-zd-submit {
  height: 32px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  background-color: #1F73B7;
  color: #FFFFFF;
  border: none;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  border-right: 1px solid rgba(255, 255, 255, 0.25);
  transition: background-color 0.15s ease;
  white-space: nowrap;
}

.btn-zd-submit:hover {
  background-color: #144A75;
}

.btn-zd-submit-toggle {
  height: 32px;
  width: 28px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background-color: #1F73B7;
  color: #FFFFFF;
  border: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.btn-zd-submit-toggle:hover {
  background-color: #144A75;
}

.btn-zd-submit-toggle svg {
  width: 10px;
  height: 10px;
  stroke: currentColor;
  transition: transform 0.15s ease;
}

.zd-submit-group.open .btn-zd-submit-toggle svg {
  transform: rotate(180deg);
}

/* Status colors across both halves of the split button */
.btn-zd-submit.status-open,
.btn-zd-submit.status-open + .btn-zd-submit-toggle {
  background-color: #1F73B7;
}
.btn-zd-submit.status-open:hover,
.btn-zd-submit.status-open + .btn-zd-submit-toggle:hover {
  background-color: #144A75;
}

.btn-zd-submit.status-pending,
.btn-zd-submit.status-pending + .btn-zd-submit-toggle {
  background-color: #2563EB;
}
.btn-zd-submit.status-pending:hover,
.btn-zd-submit.status-pending + .btn-zd-submit-toggle:hover {
  background-color: #1D4ED8;
}

.btn-zd-submit.status-solved,
.btn-zd-submit.status-solved + .btn-zd-submit-toggle {
  background-color: #059669;
}
.btn-zd-submit.status-solved:hover,
.btn-zd-submit.status-solved + .btn-zd-submit-toggle:hover {
  background-color: #047857;
}

.zd-submit-menu {
  display: none;
  position: absolute;
  bottom: calc(100% + 4px);
  right: 0;
  width: 175px;
  background-color: #FFFFFF;
  border: 1px solid var(--zd-border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  padding: 4px;
  z-index: 1000;
}

.zd-submit-group.open .zd-submit-menu {
  display: block;
}

.submit-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 7px 10px;
  background: none;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  color: var(--zd-text-main);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s;
}

.submit-option:hover {
  background-color: var(--zd-bg-canvas);
}

.submit-option.active {
  background-color: var(--zd-accent-blue-light);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.open {
  background-color: #D97706;
}

.status-indicator.pending {
  background-color: #2563EB;
}

.status-indicator.solved {
  background-color: #059669;
}

/* ==========================================================================
   Chat Bubbles for Internal Note & Email Reply
   ========================================================================== */
.chat-bubble.internal-note {
  align-self: stretch;
  background-color: #FFFDF0;
  border: 1px solid #FDE68A;
  border-left: 4px solid #F59E0B;
  color: #78350F;
  border-radius: 6px;
}

.chat-bubble.internal-note .bubble-meta {
  color: #B45309;
  font-weight: 600;
}

.chat-bubble.email-reply {
  align-self: stretch;
  background-color: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-left: 4px solid #1F73B7;
  color: #0F172A;
  border-radius: 6px;
}

.chat-bubble.email-reply .bubble-meta {
  color: #1F73B7;
  font-weight: 600;
}

/* ==========================================================================
   Ride Partner Profile & Ride History Slide-Over Drawer
   ========================================================================== */
.zd-drawer-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  z-index: 1500;
  backdrop-filter: blur(1.5px);
  animation: zdFadeIn 0.2s ease forwards;
}

.zd-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 560px;
  max-width: 92vw;
  background-color: #FFFFFF;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.22);
  z-index: 1501;
  display: flex;
  flex-direction: column;
  animation: zdDrawerSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes zdDrawerSlideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background-color: #2F3941;
  color: #FFFFFF;
}

.drawer-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--zd-accent-blue);
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.drawer-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.drawer-title-row h3 {
  font-size: 16px;
  font-weight: 700;
  color: #FFFFFF;
}

.badge-status-active {
  background-color: #10B981;
  color: #FFFFFF;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.03em;
}

.drawer-subtitle {
  font-size: 11px;
  color: #A5C2C4;
  margin-top: 2px;
}

.btn-drawer-close {
  background: none;
  border: none;
  color: #A5C2C4;
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-drawer-close:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #FFFFFF;
}

.drawer-tabs {
  display: flex;
  background-color: #F8F9FA;
  border-bottom: 1px solid var(--zd-border);
  padding: 0 16px;
}

.drawer-tab {
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--zd-text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.drawer-tab:hover {
  color: var(--zd-text-main);
}

.drawer-tab.active {
  color: #1F73B7;
  border-bottom-color: #1F73B7;
  background-color: #FFFFFF;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  background-color: var(--zd-bg-canvas);
}

.ride-history-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background-color: #EFF6FF;
  border: 1px solid #BFDBFE;
  border-radius: 6px;
  font-size: 11px;
  color: #1E40AF;
  margin-bottom: 14px;
}

.ride-card {
  background-color: #FFFFFF;
  border: 1px solid var(--zd-border);
  border-radius: 8px;
  margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ride-card:hover {
  border-color: #CBD5E1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.ride-card.expanded {
  border-color: #1F73B7;
  box-shadow: 0 3px 10px rgba(31, 115, 183, 0.12);
}

.ride-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}

.ride-header-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ride-header-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ride-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--zd-text-main);
}

.payout-status.completed {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  color: #059669;
  background-color: #D1FAE5;
  padding: 1px 6px;
  border-radius: 3px;
}

.ride-date {
  font-size: 11px;
  color: var(--zd-text-muted);
}

.ride-summary-line {
  font-size: 11px;
  color: var(--zd-text-main);
  font-weight: 500;
}

.ride-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.payout-amount {
  font-size: 15px;
  font-weight: 800;
  color: #059669;
}

.ride-expand-prompt {
  font-size: 10px;
  color: #1F73B7;
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 600;
}

.ride-chevron {
  transition: transform 0.2s ease;
}

.ride-card.expanded .ride-chevron {
  transform: rotate(180deg);
}

.ride-details {
  padding: 12px 14px 14px 14px;
  border-top: 1px solid var(--zd-border-subtle);
  background-color: #FAFAFA;
}

.ride-route-box {
  background-color: #FFFFFF;
  border: 1px solid var(--zd-border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}

.route-stop {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.stop-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 3px;
  flex-shrink: 0;
}

.stop-dot.pickup {
  background-color: #10B981;
}

.stop-dot.dropoff {
  background-color: #EF4444;
}

.route-line {
  width: 2px;
  height: 14px;
  background-color: #D8DCDE;
  margin-left: 4px;
  margin-top: 2px;
  margin-bottom: 2px;
}

.stop-details {
  display: flex;
  flex-direction: column;
}

.stop-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--zd-text-main);
}

.stop-addr {
  font-size: 11px;
  color: var(--zd-text-muted);
}

.ride-telemetry-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.telemetry-stat {
  background-color: #FFFFFF;
  border: 1px solid var(--zd-border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 10px;
  color: var(--zd-text-muted);
  margin-bottom: 2px;
}

.stat-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--zd-text-main);
}

.stat-sub {
  font-size: 9px;
  color: var(--zd-text-dim);
  margin-top: 2px;
}

.fare-audit-breakdown {
  background-color: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 10px 12px;
}

.fare-audit-breakdown h5 {
  font-size: 11px;
  font-weight: 700;
  color: var(--zd-text-main);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 8px;
  border-bottom: 1px solid #E2E8F0;
  padding-bottom: 4px;
}

.fare-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--zd-text-muted);
  padding: 3px 0;
}

.fare-row.total-row {
  border-top: 1px solid #E2E8F0;
  padding-top: 6px;
  margin-top: 4px;
  font-weight: 700;
  color: var(--zd-text-main);
}

.fare-row .total-val {
  font-size: 13px;
  color: #059669;
}

.fare-row.upfront-ref-row {
  font-style: italic;
  border-top: 1px dashed #E2E8F0;
  margin-top: 4px;
  padding-top: 4px;
}

/* Ride Partner Overview Tab Metrics & Actions */
.drawer-section {
  background-color: #FFFFFF;
  border: 1px solid var(--zd-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}

.drawer-section h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--zd-text-main);
  margin-bottom: 10px;
  border-bottom: 1px solid var(--zd-border-subtle);
  padding-bottom: 6px;
}

.drawer-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.metric-card {
  background-color: #F8F9FA;
  border: 1px solid var(--zd-border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.metric-label {
  font-size: 10px;
  color: var(--zd-text-muted);
  text-transform: uppercase;
  margin-bottom: 3px;
}

.metric-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--zd-text-main);
}

.metric-sub {
  font-size: 10px;
  color: var(--zd-text-dim);
  margin-top: 2px;
}

.drawer-action-card {
  background-color: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
}

.action-card-text h5 {
  font-size: 12px;
  font-weight: 700;
  color: #166534;
  margin-bottom: 2px;
}

.action-card-text p {
  font-size: 11px;
  color: #15803D;
  line-height: 1.3;
}

.btn-drawer-switch-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background-color: #16A34A;
  color: #FFFFFF;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s;
}

.btn-drawer-switch-tab:hover {
  background-color: #15803D;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.drawer-item {
  display: flex;
  flex-direction: column;
}

.drawer-item label {
  font-size: 10px;
  color: var(--zd-text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.drawer-item span {
  font-size: 12px;
  font-weight: 600;
  color: var(--zd-text-main);
}

/* ---------------------------------------------------------------------------
 * El debrief: el veredicto de la llamada.
 * Un modal, no otra pantalla: el trainee cierra la llamada y el resultado
 * tiene que estar delante de el, no en un menu.
 * ------------------------------------------------------------------------ */
.debrief-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.debrief-modal {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
  padding: 24px 28px;
  width: min(560px, calc(100vw - 48px));
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  font-family: var(--zd-font, system-ui, sans-serif);
  color: var(--zd-text-main, #1f2937);
}

.debrief-modal h3 {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.debrief-scores {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--zd-text-muted, #6b7280);
  margin-bottom: 16px;
}

.debrief-rules {
  margin: 0 0 20px;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}

.debrief-rules li {
  margin-bottom: 12px;
}

.debrief-rule-detail {
  display: block;
  color: var(--zd-text-main, #1f2937);
}

.debrief-cue {
  margin-top: 4px;
  padding: 6px 10px;
  border-left: 3px solid #0a7d55;
  background: #f4faf7;
  border-radius: 0 4px 4px 0;
  font-style: italic;
  color: #0f5132;
}

  /* Las reglas que no se pudieron evaluar: ni fallos ni aciertos. Van con
     otro tono para que el trainee no las lea como suspensiones. */
  /* La burbuja de una frase que le cortaron a Sarah: se marca el corte para
     que se vea que no la termino (y no se lea como que ya lo dijo todo). */
  .bubble-cut .bubble-text {
    color: #6B7280;
    font-style: italic;
  }

  /* ---------------------------------------------------------------------------
     P4 · La remediacion en caliente: el widget que no se abrio se ilumina y el
     Shadow Coach susurra que decir. La correccion diferida no consolida nada;
     por eso el drill sale del debrief, no de un informe aparte.
     --------------------------------------------------------------------------- */

  /* Como termino Sarah (P5.1/P5.2): el efecto del trato del trainee. */
  .debrief-frustration {
    margin: 10px 0 2px;
    font-size: 11px;
    line-height: 1.4;
    color: #6B7280;
  }

  /* El resultado del ensayo dirigido (P4.5): lo primero que se lee. */
  .debrief-drill {
    margin: 10px 0 4px;
    padding: 9px 12px;
    border-radius: 5px;
    border: 1px solid transparent;
  }

  .debrief-drill-passed {
    background: #ECFDF5;
    border-color: #A7F3D0;
  }

  .debrief-drill-failed {
    background: #FEF2F2;
    border-color: #FECACA;
  }

  /* El juez no se pronuncio: ni bien ni mal. */
  .debrief-drill-pending {
    background: #F9FAFB;
    border-color: #E5E7EB;
  }

  .debrief-drill-label {
    display: block;
    margin-bottom: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.09em;
  }

  .debrief-drill-passed .debrief-drill-label {
    color: #047857;
  }

  .debrief-drill-failed .debrief-drill-label {
    color: #B91C1C;
  }

  .debrief-drill-pending .debrief-drill-label {
    color: #6B7280;
  }

  .debrief-drill-detail {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: #374151;
  }

  /* El boton de ensayo en vivo (P4.4). */
  .coach-hud-live {
    margin-right: 8px;
    padding: 6px 12px;
    background: #1F73B7;
    color: #FFFFFF;
    border: none;
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
  }

  .coach-hud-live:hover {
    background: #1558a0;
  }

  /* La trampa de la proxima llamada (P5.6): el debrief no solo dice lo que
     fallo, dice lo que espera. Es el bucle hecho visible. */
  .debrief-next-call {
    margin-top: 14px;
    padding: 10px 12px;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 5px;
  }

  .debrief-next-call-label {
    display: block;
    margin-bottom: 5px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.09em;
    color: #92400E;
  }

  .debrief-next-call-objection {
    margin: 0 0 5px;
    font-size: 12px;
    line-height: 1.45;
    color: #78350F;
  }

  .debrief-next-call-cue {
    margin: 0;
    font-size: 11px;
    line-height: 1.4;
    color: #6B7280;
    font-style: italic;
  }

  /* El boton de la reconstruccion: es la salida del debrief suspenso. */
  .debrief-guide-button {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 11px 16px;
    background: #1F73B7;
    color: #FFFFFF;
    border: none;
    border-radius: 5px;
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
  }

  .debrief-guide-button:hover {
    background: #1558a0;
  }

  /* El widget que el trainee no abrio: borde pulsante (P4.2). */
  .coach-pulse-highlight {
    position: relative;
    animation: coach-pulse 1.1s ease-in-out infinite;
    border-radius: 6px;
  }

  @keyframes coach-pulse {
    0%, 100% {
      box-shadow: 0 0 0 0 rgba(31, 115, 183, 0.55);
    }
    50% {
      box-shadow: 0 0 0 6px rgba(31, 115, 183, 0);
    }
  }

  /* Y cuando ya lo ha abierto, se apaga en verde. */
  .coach-done {
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.5) !important;
    animation: none;
  }

  /* El Shadow Coach (P4.3). */
  /* El Shadow Coach va por encima del drawer (1501): el trainee abre el
     widget que le han MARKADO y el drawer se le echa encima. Si el coach
     quedase debajo, desapareceria justo cuando mas lo necesita. */
  .coach-hud {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 340px;
    max-width: calc(100vw - 36px);
    background: #101828;
    color: #F2F4F7;
    border-radius: 8px;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.35);
    font-family: var(--font-sans);
    overflow: hidden;
    z-index: 1600;
  }

  .coach-hud-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 14px;
    background: #1F73B7;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
  }

  .coach-hud-timer {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
  }

  .coach-hud-body {
    padding: 12px 14px;
  }

  .coach-hud-failed {
    margin: 0 0 10px;
    font-size: 12px;
    color: #FCA5A5;
    line-height: 1.45;
  }

  .coach-hud-label {
    display: block;
    margin-bottom: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #98A2B3;
  }

  .coach-hud-cue p,
  .coach-hud-trap p {
    margin: 0 0 10px;
    font-size: 12px;
    line-height: 1.5;
    color: #EAECF0;
  }

  .coach-hud-cue p {
    font-style: italic;
    color: #A6F4C5;
  }

  .coach-hud-trap p {
    color: #FDE68A;
  }

  .coach-hud-steps {
    margin: 4px 0 0;
    padding-left: 18px;
    font-size: 11px;
    color: #D0D5DD;
  }

  .coach-hud-steps li {
    margin-bottom: 3px;
  }

  .coach-step-done {
    color: #6EE7B7;
    text-decoration: line-through;
  }

  .coach-hud-footer {
    padding: 10px 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 11px;
    color: #98A2B3;
  }

  .coach-hud-end {
    padding: 6px 12px;
    background: transparent;
    color: #D0D5DD;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
    font-family: var(--font-sans);
    font-size: 11px;
    cursor: pointer;
  }

  .coach-hud-end:hover {
    background: rgba(255, 255, 255, 0.08);
  }

  .debrief-pending-note {
    margin: 12px 0 6px;
    font-size: 11px;
    color: #6B7280;
    font-style: italic;
  }

  .debrief-rules-pending {
    opacity: 0.62;
  }

  .debrief-rules-pending .debrief-rule-detail {
    font-family: var(--font-mono);
    font-size: 10px;
    color: #6B7280;
  }

  /* El diagnostico de ICE (P1.7.4): el trainee ve por que no conecto. */
  .debrief-rules .debrief-rule-detail {
    font-family: var(--font-mono);
  }

  .debrief-allgood {
  font-size: 14px;
  color: #0a7d55;
  margin: 0 0 20px;
}

.debrief-close {
  background: #0a7d55;
  color: #fff;
  border: 0;
  border-radius: 4px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.debrief-close:hover {
  background: #086243;
}
