/* ═══════════════════════════════════════════════════
   TELNYX COMMS DASHBOARD — COMPLETE STYLESHEET
   ═══════════════════════════════════════════════════ */

/* --- 1. CSS Custom Properties -------------------- */
:root {
    --bg-dark: #05090f;
    --glass-bg: rgba(13, 19, 32, 0.75);
    --glass-border: rgba(255, 255, 255, 0.09);
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --accent: #06b6d4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --gold: #fbbf24;
    --text-main: #f1f5f9;
    --text-muted: #64748b;
    --sidebar-width: 250px;
    --radius: 18px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --glow-primary: rgba(99, 102, 241, 0.35);
    --glow-accent: rgba(6, 182, 212, 0.3);
}

/* --- 2. Reset & Base ----------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
    font-family: inherit;
}

input, textarea, select {
    font-family: inherit;
}

/* --- 3. Animated Background Blobs ---------------- */
.background-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    filter: blur(110px);
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    animation: blobFloat 20s infinite alternate ease-in-out;
}

.blob-1 { width: 550px; height: 550px; background: #3730a3; top: -120px; left: -120px; opacity: 0.4; }
.blob-2 { width: 450px; height: 450px; background: #0284c7; bottom: -80px; right: 0; opacity: 0.35; animation-delay: -6s; }
.blob-3 { width: 600px; height: 600px; background: #7c3aed; top: 35%; left: 45%; opacity: 0.25; animation-delay: -11s; }

@keyframes blobFloat {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(80px, 60px) scale(1.12); }
}

/* --- 4. Reusable Glass Components ---------------- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.65);
}

.padded-panel {
    padding: 30px;
}

.glass-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 20px;
    border-radius: 10px;
    border: none;
    transition: var(--transition);
}
.glass-btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 8px 20px var(--glow-primary); }
.glass-btn:active { transform: translateY(0); }

.glass-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-main);
    padding: 11px 15px;
    outline: none;
    font-size: 0.95rem;
    transition: var(--transition);
}
.glass-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

select.glass-input option { background: #0d1320; }

/* --- 5. App Shell Layout ------------------------- */
.app-container {
    display: flex;
    height: 100vh;
    padding: 16px;
    gap: 16px;
    overflow: hidden;
}

/* --- 6. Sidebar ---------------------------------- */
.sidebar {
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    padding: 24px 14px;
    flex-shrink: 0;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin-bottom: 36px;
    padding-left: 10px;
}
.logo i { color: var(--accent); font-size: 1.4rem; }

.nav-links { list-style: none; display: flex; flex-direction: column; gap: 6px; flex-grow: 1; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.nav-item i { font-size: 1.1rem; width: 18px; text-align: center; }
.nav-item:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-item.active { color: white; background: rgba(99,102,241,0.12); border-left-color: var(--primary); }

.badge {
    margin-left: auto;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 100px;
}

.sidebar-bottom { margin-top: auto; }

/* --- 7. Main Content ----------------------------- */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
    min-width: 0;
    overflow: hidden;
}

/* --- 8. Topbar ----------------------------------- */
.topbar {
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    flex-shrink: 0;
}

.current-profile { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 0.95rem; }
.current-profile i { font-size: 1.4rem; color: var(--accent); }

.status-indicator { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); transition: var(--transition); }
.status-indicator.connected .dot { background: var(--success); box-shadow: 0 0 8px var(--success); }

/* --- 9. Sections Wrapper ------------------------- */
.sections-wrapper {
    flex-grow: 1;
    position: relative;
    overflow: hidden;
}

.app-section {
    display: none;
    height: 100%;
    width: 100%;
    overflow-y: auto;
    animation: fadeIn 0.35s ease-out;
}
.app-section.active { display: flex; flex-direction: column; }

/* Custom scrollbar */
.app-section::-webkit-scrollbar { width: 5px; }
.app-section::-webkit-scrollbar-track { background: transparent; }
.app-section::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.07); border-radius: 10px; }

/* ═══════════════════════════════════════════════════
   10. DIALPAD SECTION
   Layout: Dialpad (top center) → AI Panels (below, side-by-side)
   Full height, scrollable
   ═══════════════════════════════════════════════════ */
#dialpad-section {
    overflow-y: auto;
    height: 100%;
}

.dialpad-layout-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    min-height: 100%;
    padding: 16px 20px 30px;
}

/* Compact Dialpad Card — centered at top */
.dialpad-container {
    width: 320px;
    flex-shrink: 0;
    padding: 22px;
    display: flex;
    flex-direction: column;
}

.display {
    display: flex;
    align-items: center;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0 16px;
    height: 58px;
    margin-bottom: 20px;
}

#phone-number {
    flex-grow: 1;
    background: transparent;
    border: none;
    outline: none;
    color: white;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-align: center;
    width: 100%;
}
#phone-number::placeholder { color: var(--text-muted); font-size: 1rem; letter-spacing: normal; }

.backspace { color: var(--text-muted); font-size: 1.1rem; transition: var(--transition); flex-shrink: 0; }
.backspace:hover { color: white; transform: scale(1.15); }

.keypad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.key {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 58px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 14px;
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}
.key span { font-size: 0.58rem; color: var(--text-muted); letter-spacing: 1.5px; font-weight: 600; margin-top: 1px; }
.key:hover { background: rgba(255,255,255,0.1); transform: translateY(-2px); border-color: rgba(99,102,241,0.4); }
.key:active { transform: translateY(0) scale(0.93); background: rgba(99,102,241,0.15); }

.actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 14px;
}

.action-btn {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    transition: var(--transition);
    border: none;
}
.action-btn:disabled { opacity: 0.35; pointer-events: none; filter: grayscale(0.5); }

.action-btn.call { background: var(--success); box-shadow: 0 4px 16px rgba(16,185,129,0.35); }
.action-btn.call:hover:not(:disabled) { background: #059669; transform: scale(1.1) rotate(6deg); box-shadow: 0 8px 24px rgba(16,185,129,0.5); }

.action-btn.hangup { background: var(--danger); box-shadow: 0 4px 16px rgba(239,68,68,0.35); }
.action-btn.hangup:hover:not(:disabled) { background: #dc2626; transform: scale(1.1) rotate(-6deg); box-shadow: 0 8px 24px rgba(239,68,68,0.5); }

.active-call-info {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-height: 20px;
}
#call-number-info { font-weight: 700; color: white; display: block; }
#call-status-info { display: block; margin-top: 2px; }

/* ═══════════════════════════════════════════════════
   11. CONVERSATION CENTER (Side-by-Side AI Panels)
   Below the dialpad, panels fill remaining width
   ═══════════════════════════════════════════════════ */
.conversation-center {
    display: flex;
    gap: 20px;
    width: 100%;
    min-height: 700px; /* tall enough to read comfortably */
}

.transcript-panel,
.guidance-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
    /* No overflow:hidden so the panel can grow naturally */
}

/* Panel headers */
.ai-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}

.transcript-panel h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.guidance-panel h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Status Pills */
.ai-pill {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.ai-pill.offline { background: rgba(255,255,255,0.07); color: var(--text-muted); }
.ai-pill.listening { background: rgba(6,182,212,0.18); color: var(--accent); animation: pillPulse 2s infinite; }
.ai-pill.active-pill { background: rgba(251,191,36,0.18); color: var(--gold); }

/* Chat boxes (scrollable message area) */
.ai-chat-box {
    flex-grow: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 6px;
    margin-bottom: 12px;
    max-height: 400px;
}
.ai-chat-box::-webkit-scrollbar { width: 4px; }
.ai-chat-box::-webkit-scrollbar-track { background: transparent; }
.ai-chat-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }

/* Message bubbles */
.message {
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 0.95rem;
    line-height: 1.65;
    animation: fadeIn 0.35s ease-out;
    max-width: 95%;
    word-break: break-word;
}

.message.system-msg {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    color: var(--text-muted);
    font-size: 0.82rem;
    text-align: center;
    max-width: 100%;
    border-radius: 10px;
}

.message.coach-msg {
    background: rgba(6,182,212,0.07);
    border: 1px solid rgba(6,182,212,0.18);
    color: #cffafe;
    align-self: flex-start;
}

.message.suggestion-msg {
    background: rgba(251,191,36,0.09);
    border: 1px solid rgba(251,191,36,0.22);
    color: #fef3c7;
    align-self: flex-start;
    font-weight: 500;
}

/* Guidance Spotlight box */
.guidance-spotlight {
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(251,191,36,0.13) 0%, rgba(245,158,11,0.04) 100%);
    border-radius: 14px;
    border-left: 5px solid var(--gold);
    padding: 18px 20px;
    margin-bottom: 14px;
}

.spotlight-header {
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.spotlight-text {
    font-size: 1.1rem;
    line-height: 1.55;
    color: #fff;
    font-weight: 600;
}

/* AI Strategy textarea section */
.ai-strategy-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
    padding: 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
}

.ai-strategy-section label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.glass-textarea {
    width: 100%;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: white;
    padding: 10px 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    resize: vertical;
    outline: none;
    min-height: 60px;
    transition: var(--transition);
}
.glass-textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(251,191,36,0.1); }

.apply-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, var(--gold) 0%, #f59e0b 100%);
    color: #09090b;
    font-weight: 700;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 9px;
    border-radius: 8px;
    transition: var(--transition);
}
.apply-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(251,191,36,0.3); }

/* Panel footer */
.ai-panel-footer {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.ai-latency { display: flex; align-items: center; gap: 5px; }

/* Debug terminal */
.debug-glass {
    margin: 0 20px 20px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 12px;
    padding: 14px 18px;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.debug-glass h3 { font-size: 0.72rem; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 8px; }
#debug-log { max-height: 80px; overflow-y: auto; font-family: 'Courier New', monospace; line-height: 1.5; }

/* ═══════════════════════════════════════════════════
   12. MESSAGES / INBOX SECTION
   ═══════════════════════════════════════════════════ */
#inbox-section { padding: 0; overflow: hidden; }

.inbox-layout {
    display: flex;
    height: 100%;
    overflow: hidden;
}

.inbox-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--glass-border);
    padding: 20px 16px;
}

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 16px;
}
.search-bar i { color: var(--accent); flex-shrink: 0; }
.search-bar input { background: transparent; border: none; outline: none; color: white; flex-grow: 1; font-size: 0.9rem; }
.search-bar input::placeholder { color: var(--text-muted); }

.conversation-list { display: flex; flex-direction: column; gap: 6px; overflow-y: auto; flex-grow: 1; }

.convo-item {
    display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 12px; cursor: pointer;
    transition: var(--transition); border: 1px solid transparent;
}
.convo-item:hover { background: rgba(255,255,255,0.05); border-color: var(--glass-border); }
.convo-item.active { background: rgba(99,102,241,0.12); border-color: rgba(99,102,241,0.25); }

.avatar {
    width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 1rem;
}

.convo-info { flex-grow: 1; overflow: hidden; }
.convo-info h4 { font-size: 0.9rem; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 3px; }
.convo-info p { font-size: 0.8rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.time { font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }

.inbox-content {
    flex-grow: 1; display: flex; flex-direction: column; min-width: 0;
}

.chat-header {
    padding: 20px 24px; border-bottom: 1px solid var(--glass-border);
    display: flex; justify-content: space-between; align-items: center; flex-shrink: 0;
}
.chat-header h3 { font-size: 1rem; color: white; }

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.icon-btn { font-size: 1.2rem; color: var(--accent); opacity: 0.7; transition: var(--transition); }
.icon-btn:hover { opacity: 1; transform: scale(1.12); }

.chat-messages { flex-grow: 1; padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }

.chat-messages .message { max-width: 72%; box-shadow: 0 2px 8px rgba(0,0,0,0.2); }
.received { background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.05); align-self: flex-start; }
.sent { background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%); align-self: flex-end; }

.chat-input {
    padding: 16px 20px; border-top: 1px solid var(--glass-border); display: flex; gap: 12px; flex-shrink: 0;
}
.chat-input .glass-input { flex-grow: 1; }

.send-btn {
    width: 46px; height: 46px; background: var(--primary); border-radius: 12px;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem; color: white; transition: var(--transition);
}
.send-btn:hover { background: var(--primary-hover); transform: scale(1.06); box-shadow: 0 4px 14px var(--glow-primary); }

/* ═══════════════════════════════════════════════════
   13. CALL HISTORY SECTION
   ═══════════════════════════════════════════════════ */
#history-section { padding: 20px; }

.data-table {
    width: 100%; border-collapse: separate; border-spacing: 0 8px; margin-top: 20px;
}

.data-table th {
    text-align: left; padding: 12px 20px; color: var(--accent);
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
    border-bottom: 1px solid var(--glass-border);
}

.data-table td {
    padding: 16px 20px; font-size: 0.9rem; color: var(--text-main);
    background: rgba(255,255,255,0.03); transition: var(--transition);
}
.data-table td:first-child { border-radius: 10px 0 0 10px; }
.data-table td:last-child  { border-radius: 0 10px 10px 0; }
.data-table tr:hover td { background: rgba(255,255,255,0.06); }

.outbound-icon { color: var(--accent); margin-right: 8px; }
.inbound-icon  { color: var(--success); margin-right: 8px; }

.status-badge { padding: 4px 12px; border-radius: 100px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; }
.status-badge.success { background: rgba(16,185,129,0.15); color: #34d399; }
.status-badge.danger  { background: rgba(239,68,68,0.15);  color: #fca5a5; }

/* ═══════════════════════════════════════════════════
   14. RECORDINGS SECTION
   ═══════════════════════════════════════════════════ */
#recordings-section { padding: 20px; }

.recordings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.recording-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 22px;
    transition: var(--transition);
}
.recording-card:hover { transform: translateY(-4px); border-color: var(--primary); box-shadow: 0 16px 32px rgba(0,0,0,0.35); }

.recording-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.recording-header h4 { font-size: 1rem; color: white; font-weight: 600; }
.recording-header .date, .recording-header .dur { font-size: 0.8rem; color: var(--text-muted); }

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

.play-btn {
    width: 40px; height: 40px; border-radius: 10px; background: var(--primary); color: white;
    display: flex; align-items: center; justify-content: center; font-size: 0.9rem; flex-shrink: 0; transition: var(--transition);
}
.play-btn:hover { background: var(--primary-hover); transform: scale(1.08); }

.progress-bar {
    flex-grow: 1; height: 5px; background: rgba(255,255,255,0.08); border-radius: 3px; overflow: hidden;
}
.progress-bar .fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); }

.recording-actions { display: flex; justify-content: flex-end; gap: 14px; }
.recording-actions button { color: var(--text-muted); font-size: 1rem; transition: var(--transition); }
.recording-actions button:hover { color: white; transform: scale(1.15); }

/* ═══════════════════════════════════════════════════
   15. SETTINGS SECTION
   ═══════════════════════════════════════════════════ */
#settings-section { padding: 20px; }

.settings-layout {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 4px 0 30px;
}

.settings-layout h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }

.settings-group {
    padding: 26px;
    background: rgba(255,255,255,0.025);
    border-radius: 14px;
    border: 1px solid var(--glass-border);
}

.settings-group h3 {
    display: flex; align-items: center; gap: 10px;
    font-size: 1rem; font-weight: 700; color: var(--accent); margin-bottom: 22px;
}

.input-group { margin-bottom: 20px; }
.input-group:last-child { margin-bottom: 0; }
.input-group label { display: block; font-size: 0.88rem; font-weight: 600; color: var(--text-main); margin-bottom: 8px; }
.input-group small { display: block; margin-top: 7px; font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }

/* ═══════════════════════════════════════════════════
   16. INCOMING CALL MODAL
   ═══════════════════════════════════════════════════ */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }

.modal-content {
    padding: 40px;
    text-align: center;
    min-width: 300px;
    position: relative;
}
.modal-content h2 { font-size: 1.4rem; margin-bottom: 10px; }
.modal-content p { color: var(--text-muted); margin-bottom: 28px; font-size: 1rem; }

.pulse-ring {
    width: 80px; height: 80px; border-radius: 50%;
    border: 3px solid var(--success);
    margin: 0 auto 24px;
    animation: ringPulse 1.5s infinite;
}

.modal-actions { display: flex; justify-content: center; gap: 28px; }

/* ═══════════════════════════════════════════════════
   17. ANIMATIONS
   ═══════════════════════════════════════════════════ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.88) translateY(16px); }
    60%  { transform: scale(1.03) translateY(-2px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes pillPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.55; }
}

@keyframes ringPulse {
    0%   { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

/* ═══════════════════════════════════════════════════
   18. AI COACH PAGE
   ═══════════════════════════════════════════════════ */
#ai-section {
    padding: 20px;
    overflow-y: auto;
}

.ai-page-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    height: 100%;
    min-height: 0;
}

.ai-page-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-height: 0;
}

.transcript-msg {
    text-align: left;
    margin-bottom: 10px;
}
.transcript-speaker {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
    color: var(--text-muted);
}
.transcript-msg-agent .transcript-speaker {
    color: var(--accent);
}
.transcript-msg-customer .transcript-speaker {
    color: var(--primary);
}

/* ═══════════════════════════════════════════════════
   Admin user management & feature flags
   ═══════════════════════════════════════════════════ */
.is-hidden {
    display: none !important;
}

.ai-page-layout.ai-single-col {
    grid-template-columns: 1fr;
}

.admin-module {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-lead {
    color: var(--text-muted);
    margin-bottom: 20px;
    font-size: 0.95rem;
    line-height: 1.45;
}

.admin-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
    align-items: end;
}

.admin-toggle-row {
    grid-column: 1 / -1;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.admin-switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
}

.admin-form-actions {
    grid-column: 1 / -1;
}

.admin-msg {
    min-height: 1.5em;
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-user-email {
    font-weight: 600;
}

.admin-user-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.admin-nums-cell {
    min-width: 220px;
    vertical-align: top;
}

.admin-num-list {
    margin-bottom: 10px;
}

.admin-num-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
    font-size: 0.88rem;
}

.admin-num-row .mono {
    font-family: ui-monospace, monospace;
}

.admin-pill {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    font-weight: 700;
}

.admin-pill.ok {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.admin-pill.off {
    background: rgba(100, 116, 139, 0.25);
    color: var(--text-muted);
}

.admin-add-num {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.admin-add-num .glass-input {
    max-width: 150px;
}

.icon-link.admin-remove-num {
    background: transparent;
    color: var(--danger);
    font-size: 1.15rem;
    line-height: 1;
    padding: 0 4px;
}

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

.status-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

/* Generic card used for transcript & suggestion history */
.ai-page-card {
    display: flex;
    flex-direction: column;
    padding: 20px;
    flex: 1;
    min-height: 260px;
}

/* Shared card header */
.ai-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-shrink: 0;
}

.ai-card-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

/* Shared card footer */
.ai-card-footer {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.68rem;
    color: var(--text-muted);
    padding-top: 12px;
    margin-top: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
}

/* ---- Latest Advice Spotlight ---- */
.ai-spotlight-card {
    padding: 20px 22px;
    border-left: 4px solid var(--gold);
    background: linear-gradient(135deg, rgba(251,191,36,0.10) 0%, rgba(245,158,11,0.03) 100%);
    flex-shrink: 0;
}

.ai-spotlight-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 1.8px;
    margin-bottom: 12px;
}

.ai-spotlight-text {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.6;
    color: #fff;
    min-height: 32px;
}

/* ---- Strategy Card ---- */
.ai-strategy-card {
    padding: 20px;
    flex-shrink: 0;
}

/* Override chat-box max-height inside ai-page-card so it stretches */
.ai-page-card .ai-chat-box {
    max-height: none;
    flex: 1;
}

/* ---- Streaming Cursor (LLM typing indicator) ---- */
.streaming-cursor {
    display: inline;
    color: var(--gold);
    font-weight: 400;
    animation: cursorBlink 0.6s infinite step-end;
}

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

/* ---- Dialpad contact hint & Contacts module ---- */
.dialpad-contact-hint {
    min-height: 1.25em;
    font-size: 0.85rem;
    color: var(--accent);
    margin: 8px 0 10px;
    padding: 0 4px;
}

.dialpad-contact-actions {
    margin-bottom: 14px;
}

.dialpad-save-contact-btn {
    padding: 8px 14px;
    font-size: 0.85rem;
    width: 100%;
}

.contacts-lead {
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.45;
    font-size: 0.95rem;
}

.contact-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    align-items: end;
}

.contact-form-actions {
    grid-column: 1 / -1;
}

.contacts-table-wrap {
    overflow-x: auto;
}

#contacts-table .mono {
    font-family: ui-monospace, monospace;
    font-size: 0.88rem;
}

.transcript-partial-preview {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    min-height: 1.2em;
    margin-bottom: 8px;
    padding: 0 4px;
}