/* ============================================================
   Radiant Insurance VOI Agent — Design System
   Dark / glass theme, teal-cyan accent, animated.
   ============================================================ */

:root {
  --bg-deep: #0a0e1a;
  --bg-mid: #0f1524;
  --bg-panel: rgba(22, 30, 48, 0.55);
  --bg-panel-solid: #131c2e;
  --border-glass: rgba(255, 255, 255, 0.08);
  --border-glass-strong: rgba(255, 255, 255, 0.14);

  --accent: #22d3ee;
  --accent-2: #6366f1;
  --accent-glow: rgba(34, 211, 238, 0.45);

  --text-primary: #eaf1fb;
  --text-secondary: #9fb0c9;
  --text-faint: #5c6c85;

  --success: #34d399;
  --danger: #f87171;
  --warning: #fbbf24;

  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  --shadow-soft: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 40px -8px var(--accent-glow);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-primary);
  background:
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.12), transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(34, 211, 238, 0.10), transparent 45%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-mid) 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.screen { min-height: 100vh; }

/* ---------------- Glass panel ---------------- */
.glass {
  background: var(--bg-panel);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-soft);
}

/* ---------------- Logo mark ---------------- */
.logo-mark {
  display: inline-block;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: conic-gradient(from 210deg, var(--accent), var(--accent-2), var(--accent));
  box-shadow: 0 0 18px var(--accent-glow);
  position: relative;
  animation: pulse-glow 3.2s ease-in-out infinite;
  flex-shrink: 0;
}
.logo-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 6px;
  background: var(--bg-panel-solid);
}
.logo-mark.small { width: 26px; height: 26px; border-radius: 8px; }
.logo-mark.small::after { inset: 4px; border-radius: 5px; }

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 14px var(--accent-glow); transform: scale(1); }
  50% { box-shadow: 0 0 26px var(--accent-glow); transform: scale(1.05); }
}

/* ============================================================
   LOGIN SCREEN
   ============================================================ */
#login-screen[hidden], #app-shell[hidden] { display: none !important; }

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 24px;
}

.bg-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 30% 30%, rgba(34, 211, 238, 0.10), transparent 40%),
    radial-gradient(circle at 70% 70%, rgba(99, 102, 241, 0.12), transparent 40%);
  animation: drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes drift {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(2%, -2%) scale(1.05); }
}

.login-card {
  width: 100%;
  max-width: 400px;
  border-radius: var(--radius-lg);
  padding: 36px 32px 28px;
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.brand-text h1 {
  font-size: 1.15rem;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.login-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}
.login-tab {
  flex: 1;
  padding: 9px 0;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.25s var(--ease-out), background 0.25s var(--ease-out);
}
.login-tab.active {
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--accent), #67e8f9);
  box-shadow: 0 4px 16px -4px var(--accent-glow);
}
.login-tab:not(.active):hover { color: var(--text-primary); }

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: fade-in 0.35s var(--ease-out);
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.field input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text-primary);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s;
}
.field input::placeholder { color: var(--text-faint); }
.field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.btn-primary {
  position: relative;
  margin-top: 4px;
  padding: 12px 0;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06121a;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform 0.15s var(--ease-out), box-shadow 0.2s var(--ease-out), filter 0.2s;
  box-shadow: 0 8px 24px -8px var(--accent-glow);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-primary:active { transform: translateY(0); filter: brightness(0.96); }
.btn-primary:disabled { opacity: 0.75; cursor: default; transform: none; }

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 18, 26, 0.35);
  border-top-color: #06121a;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.form-error {
  margin: 2px 0 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  font-size: 0.82rem;
  animation: shake 0.3s var(--ease-out);
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.login-footnote {
  text-align: center;
  margin: 22px 0 0;
  font-size: 0.72rem;
  color: var(--text-faint);
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fade-in 0.5s var(--ease-out); }

/* ============================================================
   APP SHELL
   ============================================================ */
#app-shell { display: flex; flex-direction: column; }

.navbar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.98rem;
  white-space: nowrap;
}
.navbar-brand em { color: var(--accent); font-style: normal; font-weight: 600; }

.app-tabs {
  display: flex;
  gap: 6px;
  flex: 1;
}
.app-tab {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out), border-color 0.2s;
}
.app-tab:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.04); }
.app-tab.active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
  border-color: rgba(34, 211, 238, 0.25);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  white-space: nowrap;
}

.conn-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.conn-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.3s, box-shadow 0.3s;
}
.conn-indicator.online .conn-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}
.conn-indicator.offline .conn-dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.current-user {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
}

/* ============================================================
   NOTIFICATION BELL
   ============================================================ */
.notif-bell-wrap[hidden] { display: none !important; }
.notif-bell-wrap {
  position: relative;
}

.notif-bell {
  position: relative;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.notif-bell:hover { color: var(--text-primary); border-color: var(--border-glass-strong); background: rgba(255, 255, 255, 0.07); }
.notif-bell.has-due { color: var(--accent); border-color: rgba(34, 211, 238, 0.35); }
.notif-bell.ring {
  animation: bell-ring 0.6s var(--ease-in-out);
}
@keyframes bell-ring {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-14deg); }
  40% { transform: rotate(12deg); }
  60% { transform: rotate(-8deg); }
  80% { transform: rotate(5deg); }
}

.notif-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--danger), #ef4444);
  color: #2b0a0a;
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg-panel-solid), 0 0 8px rgba(248, 113, 113, 0.5);
}
.notif-badge[hidden] { display: none !important; }

.notif-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  max-width: min(320px, 88vw);
  border-radius: var(--radius-md);
  padding: 10px;
  z-index: 40;
  animation: panel-in 0.2s var(--ease-out);
}
.notif-dropdown[hidden] { display: none !important; }

.notif-dropdown-header {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  padding: 4px 8px 8px;
}

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 9px 10px;
  background: rgba(248, 113, 113, 0.07);
  border: 1px solid rgba(248, 113, 113, 0.22);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.notif-item:hover { background: rgba(248, 113, 113, 0.14); border-color: rgba(248, 113, 113, 0.4); }
.notif-item-name { font-size: 0.86rem; font-weight: 700; }
.notif-item-time { font-size: 0.74rem; color: #fca5a5; font-weight: 600; }
.notif-item-phone { font-size: 0.76rem; color: var(--text-secondary); }

.notif-empty {
  margin: 6px 0 2px;
  padding: 14px 8px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.82rem;
}
.notif-empty[hidden] { display: none !important; }

/* ---------------- Toasts ---------------- */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 340px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  pointer-events: auto;
  cursor: default;
  animation: toast-in 0.3s var(--ease-out);
  border-color: rgba(34, 211, 238, 0.3);
}
.toast.clickable { cursor: pointer; }
.toast.clickable:hover { border-color: rgba(34, 211, 238, 0.5); background: rgba(34, 211, 238, 0.06); }
.toast.toast-out {
  animation: toast-out 0.25s var(--ease-in-out) forwards;
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(24px) scale(0.98); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateX(24px) scale(0.98); }
}

.toast-icon {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(34, 211, 238, 0.14);
  color: var(--accent);
}
.toast-content { flex: 1; min-width: 0; }
.toast-title { font-size: 0.86rem; font-weight: 700; color: var(--text-primary); }
.toast-body {
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.toast-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-faint);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
}
.toast-close:hover { color: var(--text-primary); background: rgba(255, 255, 255, 0.08); }

.btn-ghost {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid var(--border-glass-strong);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.btn-ghost:hover {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.08);
}

.app-main {
  flex: 1;
  padding: 28px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

.panel {
  border-radius: var(--radius-lg);
  padding: 40px;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  animation: panel-in 0.35s var(--ease-out);
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(10px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.panel-icon {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(99, 102, 241, 0.18));
  border: 1px solid var(--border-glass-strong);
  margin-bottom: 8px;
}

.panel h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}
.panel p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.92rem;
  max-width: 420px;
}
.panel .panel-tag {
  margin-top: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ============================================================
   PHONE PANEL (softphone)
   ============================================================ */
.phone-shell { display: flex; justify-content: center; }
.phone-panel [hidden] { display: none !important; }

.phone-panel {
  width: 100%;
  max-width: 460px;
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: panel-in 0.35s var(--ease-out);
}

.phone-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.reg-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.reg-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-faint);
  transition: background 0.3s, box-shadow 0.3s;
}
.reg-indicator.reg-registering .reg-dot {
  background: var(--warning);
  box-shadow: 0 0 8px var(--warning);
  animation: pulse-dot 1.2s ease-in-out infinite;
}
.reg-indicator.reg-ready .reg-dot {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-dot 2s ease-in-out infinite;
}
.reg-indicator.reg-failed .reg-dot {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}
.reg-retry {
  padding: 4px 10px;
  font-size: 0.72rem;
}

.presence-select-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.presence-select-wrap select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
}

.phone-message {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.25);
  color: var(--text-primary);
  font-size: 0.82rem;
}
.mic-warning {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  font-size: 0.82rem;
}

.dial-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-size: 1.05rem;
  text-align: center;
  outline: none;
  letter-spacing: 0.04em;
}
.dial-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.dial-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.dial-key {
  padding: 14px 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.1s;
}
.dial-key:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--border-glass-strong); }
.dial-key:active { transform: scale(0.96); }

.dial-actions {
  display: flex;
  gap: 10px;
}
.dial-actions .btn-ghost { flex: 1; }

.btn-call {
  flex: 2;
  padding: 12px 0;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--success), #10b981);
  color: #04241a;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s;
}
.btn-call:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn-call:active { transform: translateY(0); }

.btn-hangup {
  flex: 1;
  padding: 12px 0;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--danger), #ef4444);
  color: #2b0a0a;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s;
}
.btn-hangup:hover { transform: translateY(-1px); filter: brightness(1.06); }

.incoming-call {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.3);
  animation: pulse-dot 1.4s ease-in-out infinite;
}
.incoming-caller {
  font-size: 1.02rem;
  font-weight: 700;
}
.incoming-actions {
  display: flex;
  gap: 12px;
  width: 100%;
}

.in-call {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.in-call-target {
  font-size: 1.05rem;
  font-weight: 700;
}
.in-call-timer {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.call-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: 100%;
}
.call-btn {
  padding: 12px 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.call-btn:hover:not(:disabled) { background: rgba(255, 255, 255, 0.08); }
.call-btn:disabled { opacity: 0.4; cursor: default; }
.call-btn.active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.35);
}
.call-btn.danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}
.call-btn.danger:hover { background: rgba(248, 113, 113, 0.16); }

.dtmf-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: 100%;
}

.transfer-row {
  display: flex;
  gap: 8px;
  width: 100%;
}
.transfer-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
}

.call-volume-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.call-volume-row input[type="range"] { flex: 1; }

/* ============================================================
   HISTORY PANEL (call log, filters, after-call work)
   ============================================================ */
.history-shell { display: flex; justify-content: center; }
.history-panel [hidden] { display: none !important; }

.history-panel {
  width: 100%;
  max-width: 1180px;
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: panel-in 0.35s var(--ease-out);
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.history-header h2 { margin: 0; font-size: 1.2rem; font-weight: 700; }
.history-actions { display: flex; gap: 10px; }

.btn-primary.btn-sm {
  flex: none;
  margin-top: 0;
  padding: 9px 18px;
  font-size: 0.82rem;
  box-shadow: none;
}
.btn-primary.btn-sm:disabled { opacity: 0.6; cursor: default; transform: none; }

.history-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.date-presets {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 4px;
}
.preset-pill {
  padding: 7px 13px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}
.preset-pill:hover { color: var(--text-primary); }
.preset-pill.active {
  color: var(--bg-deep);
  background: linear-gradient(135deg, var(--accent), #67e8f9);
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.45;
  pointer-events: none;
  transition: opacity 0.2s var(--ease-out);
}
.date-range-inputs.is-custom { opacity: 1; pointer-events: auto; }
.date-range-inputs input[type="date"] {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 0.82rem;
  outline: none;
  color-scheme: dark;
}
.date-range-inputs input[type="date"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.date-range-sep { color: var(--text-faint); font-size: 0.78rem; }

.history-search { flex: 1; min-width: 220px; }
.history-search input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out), background 0.2s;
}
.history-search input::placeholder { color: var(--text-faint); }
.history-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
  background: rgba(255, 255, 255, 0.06);
}

.history-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.82rem;
}
.history-status-error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}
.history-status-error .btn-ghost { padding: 5px 12px; font-size: 0.76rem; }

.history-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}
.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  min-width: 860px;
}
.history-table thead th {
  text-align: left;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-glass);
  white-space: nowrap;
}
.history-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-glass);
  color: var(--text-primary);
  vertical-align: middle;
  white-space: nowrap;
}
.history-table tbody tr:last-child td { border-bottom: none; }
.history-table tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.col-notes {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}
.col-duration { font-variant-numeric: tabular-nums; color: var(--text-secondary); }

.direction-icon { vertical-align: middle; margin-right: 6px; }
.direction-icon.direction-in { color: var(--success); }
.direction-icon.direction-out { color: var(--accent); }
.direction-text { text-transform: capitalize; color: var(--text-secondary); font-size: 0.8rem; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.status-badge.status-answered .status-dot { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-badge.status-answered { color: var(--success); }
.status-badge.status-missed .status-dot,
.status-badge.status-busy .status-dot { background: var(--warning); box-shadow: 0 0 6px var(--warning); }
.status-badge.status-missed,
.status-badge.status-busy { color: var(--warning); }
.status-badge.status-declined .status-dot,
.status-badge.status-failed .status-dot { background: var(--danger); box-shadow: 0 0 6px var(--danger); }
.status-badge.status-declined,
.status-badge.status-failed { color: #fca5a5; }

.disp-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.disp-badge.disp-none { color: var(--text-faint); background: transparent; border-style: dashed; border-color: var(--border-glass-strong); }
.disp-badge.disp-qualified { color: var(--success); background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.35); }
.disp-badge.disp-not-interested { color: #fca5a5; background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.35); }
.disp-badge.disp-callback-requested { color: var(--accent); background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.35); }
.disp-badge.disp-wrong-number { color: var(--text-secondary); background: rgba(255, 255, 255, 0.06); border-color: var(--border-glass-strong); }
.disp-badge.disp-no-answer,
.disp-badge.disp-busy { color: var(--warning); background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.35); }
.disp-badge.disp-voicemail,
.disp-badge.disp-rescheduled { color: #a5b4fc; background: rgba(99, 102, 241, 0.14); border-color: rgba(99, 102, 241, 0.35); }

.row-edit-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.row-edit-btn:hover { color: var(--accent); border-color: rgba(34, 211, 238, 0.35); background: rgba(34, 211, 238, 0.08); }

.history-empty {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 20px 0 4px;
}

/* ---------------- Modal (after-call work) ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(6, 10, 20, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
  animation: fade-in 0.2s var(--ease-out);
}
.modal {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: panel-in 0.25s var(--ease-out);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; font-size: 1.05rem; font-weight: 700; }
.modal-close {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.modal-close:hover { color: var(--text-primary); border-color: var(--border-glass-strong); }
.modal-body { display: flex; flex-direction: column; gap: 14px; }
.acw-call-meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
}
.modal-body select,
.modal-body textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.modal-body select:focus,
.modal-body textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-footer .btn-primary { flex: none; padding: 10px 20px; }
.modal-footer .btn-ghost { flex: none; }

/* ============================================================
   REMINDERS PANEL
   ============================================================ */
.reminders-shell { display: flex; justify-content: center; }
.reminders-panel [hidden] { display: none !important; }

.reminders-panel {
  width: 100%;
  max-width: 880px;
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: panel-in 0.35s var(--ease-out);
}

.reminders-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reminders-header h2 { margin: 0; font-size: 1.2rem; font-weight: 700; }

.reminder-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
}
.reminder-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.reminder-form-grid .field-note { grid-column: 1 / -1; }
.reminder-form-grid textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  resize: vertical;
  min-height: 42px;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.reminder-form-grid textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.reminder-form-grid select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.reminder-form-grid select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.reminder-form-grid input[type="datetime-local"] {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 0.88rem;
  outline: none;
  color-scheme: dark;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}
.reminder-form-grid input[type="datetime-local"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}
.reminder-form-actions {
  display: flex;
  justify-content: flex-end;
}
.reminder-form-actions .btn-primary { flex: none; padding: 10px 22px; }

.reminders-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 0.82rem;
}
.reminders-status.reminders-status-error {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.35);
  color: #fca5a5;
}

.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.reminder-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  transition: border-color 0.2s, background 0.2s;
  flex-wrap: wrap;
}
.reminder-card:hover { border-color: var(--border-glass-strong); }
.reminder-card.is-due { border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.05); }

.reminder-card-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  flex: 1;
}
.reminder-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.reminder-name { font-size: 0.98rem; font-weight: 700; color: var(--text-primary); }

.recurring-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid transparent;
}
.recurring-badge.recurring-none { color: var(--text-faint); background: transparent; border-style: dashed; border-color: var(--border-glass-strong); }
.recurring-badge.recurring-daily { color: #a5b4fc; background: rgba(99, 102, 241, 0.14); border-color: rgba(99, 102, 241, 0.35); }
.recurring-badge.recurring-weekly { color: var(--accent); background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.35); }

.reminder-phone { font-size: 0.84rem; color: var(--text-secondary); }
.reminder-time { font-size: 0.82rem; color: var(--text-secondary); font-weight: 600; }
.reminder-time.is-due { color: #fca5a5; }
.reminder-note {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  max-width: 480px;
}

.reminder-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-xs {
  padding: 7px 12px;
  font-size: 0.76rem;
}
.btn-ghost.danger {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.3);
}
.btn-ghost.danger:hover {
  background: rgba(248, 113, 113, 0.12);
  border-color: rgba(248, 113, 113, 0.45);
}

.call-btn-sm {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--success), #10b981);
  color: #04241a;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: transform 0.15s, filter 0.2s;
}
.call-btn-sm:hover { transform: translateY(-1px); filter: brightness(1.06); }

.snooze-wrap { position: relative; }
.snooze-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 130px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-panel-solid);
  border: 1px solid var(--border-glass-strong);
  box-shadow: var(--shadow-soft);
  z-index: 20;
  animation: panel-in 0.15s var(--ease-out);
}
.snooze-menu[hidden] { display: none !important; }
.snooze-menu button {
  text-align: left;
  padding: 7px 9px;
  background: transparent;
  border: none;
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.snooze-menu button:hover { background: rgba(34, 211, 238, 0.1); color: var(--accent); }

.reminders-empty {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.85rem;
  padding: 20px 0 4px;
}
.reminders-empty[hidden] { display: none !important; }

/* ============================================================
   DASHBOARD PANEL (admin KPI stat cards + live call monitor)
   ============================================================ */
.dashboard-shell { display: flex; justify-content: center; }

.dashboard-panel {
  width: 100%;
  max-width: 1180px;
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  animation: panel-in 0.35s var(--ease-out);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dashboard-header h2 { margin: 0; font-size: 1.2rem; font-weight: 700; }

.dashboard-note {
  margin: 0;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  color: var(--warning);
  font-size: 0.82rem;
}
.dashboard-note[hidden] { display: none !important; }

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr)) minmax(320px, 2fr);
  gap: 14px;
}

.kpi-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
}
.kpi-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}
.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.kpi-sub { font-size: 0.76rem; color: var(--text-faint); }

.kpi-card-wide { gap: 12px; }
.campaign-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.campaign-mini {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
}
.campaign-mini-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.campaign-mini-label {
  font-size: 0.68rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.live-monitor { display: flex; flex-direction: column; gap: 12px; }
.live-monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.live-monitor-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.live-monitor-refresh-tag { font-size: 0.74rem; color: var(--text-faint); }

.ai-status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.ai-status-badge.ai-status-ai { color: var(--accent); background: rgba(34, 211, 238, 0.12); border-color: rgba(34, 211, 238, 0.35); }
.ai-status-badge.ai-status-agent { color: #a5b4fc; background: rgba(99, 102, 241, 0.14); border-color: rgba(99, 102, 241, 0.35); }
.ai-status-badge.ai-status-connected { color: var(--success); background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.35); }

.btn-ghost.btn-xs { padding: 5px 12px; font-size: 0.76rem; }
.listen-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.listen-btn:disabled:hover { color: var(--text-secondary); border-color: var(--border-glass-strong); background: transparent; }

/* ---------------- Responsive ---------------- */
@media (max-width: 720px) {
  .navbar { flex-wrap: wrap; gap: 12px; }
  .app-tabs { order: 3; width: 100%; justify-content: center; }
  .current-user { display: none; }
  .history-panel { padding: 18px; }
  .history-header { flex-direction: column; align-items: flex-start; }
  .history-filters { flex-direction: column; align-items: stretch; }
  .date-range-inputs { flex-wrap: wrap; }
  .reminders-panel { padding: 18px; }
  .reminder-form-grid { grid-template-columns: 1fr; }
  .reminder-card { flex-direction: column; }
  .notif-dropdown { right: -60px; }
  .toast-container { left: 12px; right: 12px; max-width: none; }
  .dashboard-panel { padding: 18px; }
  .dashboard-kpis { grid-template-columns: 1fr; }
  .campaign-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Claude Features Set A — whisper, CRM, licensing, KB, rating, quote
   ============================================================ */

.phone-shell { justify-content: flex-start; }
.phone-layout {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  width: 100%;
}

.phone-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 380px;
}

.btn-ghost.btn-xs { padding: 4px 10px; font-size: 0.72rem; }

.side-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.side-panel-header h3 { margin: 0; font-size: 0.98rem; font-weight: 700; }
.side-panel-hint { font-size: 0.7rem; color: var(--text-faint); }

.crm-panel,
.kb-panel,
.handoff-rating,
.quote-panel {
  border-radius: var(--radius-lg);
  padding: 18px;
}

.licensing-banner {
  margin-bottom: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
}
.licensing-banner.licensing-warning {
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: var(--warning);
}

.crm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.crm-field-wide { grid-column: 1 / -1; }
.crm-grid input,
.crm-panel textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
}
.crm-panel textarea { width: 100%; resize: vertical; }
.crm-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.crm-save-status { font-size: 0.76rem; color: var(--text-secondary); }

.kb-panel { padding: 0; overflow: hidden; }
.side-panel-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}
.side-panel-toggle .chev { color: var(--text-faint); transition: transform 0.2s; }
.kb-body { padding: 0 18px 18px; display: flex; flex-direction: column; gap: 12px; }
.kb-body input[type="search"] {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
}
.kb-results { display: flex; flex-direction: column; gap: 10px; max-height: 280px; overflow-y: auto; }
.kb-entry {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
}
.kb-entry-title { font-size: 0.85rem; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.kb-entry-body { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.4; }
.kb-empty { font-size: 0.8rem; color: var(--text-faint); margin: 0; }

.handoff-rating-call { font-size: 0.8rem; color: var(--text-secondary); margin: 0 0 12px; }
.handoff-rating-actions { display: flex; gap: 10px; margin-bottom: 10px; }
.thumb-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.thumb-btn:hover { border-color: var(--border-glass-strong); }
.thumb-btn.active { border-color: var(--accent); background: rgba(34, 211, 238, 0.12); color: var(--accent); }
.handoff-rating textarea {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--text-primary);
  font-size: 0.82rem;
  resize: vertical;
}

.estimate-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border: 1px solid var(--border-glass-strong);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
  vertical-align: middle;
}
.quote-panel .btn-primary.btn-sm { width: 100%; margin-bottom: 12px; }
.quote-result {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.35);
  color: var(--success);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 8px;
}
.quote-result-tag { font-size: 0.7rem; color: var(--text-faint); margin-left: 6px; }
.quote-disclaimer { margin: 0; font-size: 0.7rem; color: var(--text-faint); }

/* Whisper handoff overlay (A1) */
.whisper-overlay-host {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 18, 0.72);
  backdrop-filter: blur(6px);
  animation: whisper-fade-in 0.25s ease-out;
}
@keyframes whisper-fade-in { from { opacity: 0; } to { opacity: 1; } }

.whisper-card {
  width: 100%;
  max-width: 420px;
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 16px;
  animation: whisper-slide-in 0.4s var(--ease-out);
}
@keyframes whisper-slide-in {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.whisper-badge {
  display: inline-block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  padding: 4px 10px;
  margin-bottom: 10px;
}
.whisper-card h3 { margin: 0 0 14px; font-size: 1.1rem; }

.whisper-progress {
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 18px;
}
.whisper-progress-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform linear;
}

.whisper-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.whisper-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-glass);
}
.whisper-field span { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); }
.whisper-field strong { font-size: 0.88rem; color: var(--text-primary); }

.whisper-summary { font-size: 0.84rem; color: var(--text-secondary); line-height: 1.5; margin: 0 0 18px; }

@media (max-width: 900px) {
  .phone-layout { justify-content: center; }
  .phone-sidebar { max-width: 460px; }
}

/* ---------------- Focus states (keyboard accessibility) ---------------- */
.login-tab:focus-visible,
.app-tab:focus-visible,
.btn-primary:focus-visible,
.btn-ghost:focus-visible,
.preset-pill:focus-visible,
.row-edit-btn:focus-visible,
.modal-close:focus-visible,
.notif-bell:focus-visible,
.notif-item:focus-visible,
.call-btn-sm:focus-visible,
.snooze-menu button:focus-visible,
.listen-btn:focus-visible,
.thumb-btn:focus-visible,
.side-panel-toggle:focus-visible,
.toast-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.field input:focus-visible {
  outline: none; /* box-shadow ring above already provides the indicator */
}

/* ---------------- Reduced motion ---------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
