/* ── VitalBot — Design System CSS ──────────────────────────── */
/* Applies rules from UI/UX Pro Max skill:                      */
/* - Contrast 4.5:1 (accessibility #1)                          */
/* - cursor-pointer on interactive (touch #2)                   */
/* - duration 150-300ms animations (animation #6)               */
/* - No gray-on-gray (typography/color #5)                      */
/* ────────────────────────────────────────────────────────────── */

/* ── Nav items ───────────────────────────────────────────────── */
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 8px;
    color: #94a3b8;          /* slate-400 */
    font-size: 13.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease;
    cursor: pointer;
}
.nav-item:hover {
    background-color: #1e293b;  /* slate-800 */
    color: #f1f5f9;             /* slate-100 */
}
.nav-item.active {
    background-color: #059669;  /* emerald-600 */
    color: #ffffff;
}

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1.5px solid #e2e8f0;   /* slate-200 — enough contrast against slate-100 bg */
    padding: 20px;
    transition: box-shadow 150ms ease, transform 150ms ease;
}
.stat-card:hover {
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
    transform: translateY(-1px);
}
/* Dark mode */
.dark .stat-card {
    background: #1e293b;        /* slate-800 */
    border-color: #334155;      /* slate-700 */
}

/* ── Badge ─────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background-color: #059669;
    color: #fff;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease;
}
.btn-primary:hover { background-color: #047857; }
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #64748b;
    padding: 9px 16px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background: transparent;
    transition: background-color 150ms ease;
}
.btn-ghost:hover { background-color: #f1f5f9; }
.dark .btn-ghost:hover { background-color: #1e293b; }

/* ── Kanban ────────────────────────────────────────────────── */
.kanban-card {
    transition: box-shadow 150ms ease, transform 150ms ease;
    cursor: pointer;
}
.kanban-card:active {
    transform: scale(0.97);
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}
.kanban-column {
    transition: background-color 150ms ease;
    border-radius: 10px;
    border: 2px solid transparent;
}

/* ── Page transitions ───────────────────────────────────────── */
main {
    animation: vb-fade 0.18s ease;
}
@keyframes vb-fade {
    from { opacity: 0; transform: translateY(5px); }
    to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    main, .stat-card, .kanban-card { animation: none; transition: none; }
}

/* ── Scrollbars ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: #475569; }

/* ── Chat ───────────────────────────────────────────────────── */
#chatHistory::-webkit-scrollbar { width: 4px; }
#chatHistory::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
.dark #chatHistory::-webkit-scrollbar-thumb { background: #475569; }

/* ── Table hover ─────────────────────────────────────────────── */
tbody tr { cursor: pointer; }

/* ── Form inputs (dark) ─────────────────────────────────────── */
.dark input, .dark select, .dark textarea {
    background-color: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}
.dark input::placeholder { color: #64748b; }

/* ── Premium Design Tokens ─────────────────────────────────── */

/* Glass morphism cards */
.glass-card {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
}
.dark .glass-card {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Gradient accent backgrounds */
.gradient-emerald { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.gradient-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }
.gradient-violet { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); }
.gradient-amber { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.gradient-indigo { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); }
.gradient-teal { background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); }
.gradient-rose { background: linear-gradient(135deg, #f43f5e 0%, #e11d48 100%); }

/* Animated number counter */
@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.count-up { animation: countUp 0.6s ease-out forwards; }

/* Smooth page entrance */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.5s ease-out forwards; }

/* Staggered delays */
.delay-100 { animation-delay: 0.1s; opacity: 0; }
.delay-200 { animation-delay: 0.2s; opacity: 0; }
.delay-300 { animation-delay: 0.3s; opacity: 0; }
.delay-400 { animation-delay: 0.4s; opacity: 0; }
.delay-500 { animation-delay: 0.5s; opacity: 0; }

/* Skeleton loader */
.skeleton {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}
.dark .skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Card hover lift */
.hover-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}
.dark .hover-lift:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

/* Nav item active glow */
.nav-item.active { position: relative; }
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #10b981;
    border-radius: 0 4px 4px 0;
}

/* ApexCharts overrides for glass card containers */
.glass-card .apexcharts-canvas { background: transparent !important; }
.apexcharts-tooltip { border-radius: 10px !important; border: none !important; box-shadow: 0 4px 20px rgba(0,0,0,0.12) !important; }
.dark .apexcharts-tooltip { background: #1e293b !important; color: #f1f5f9 !important; box-shadow: 0 4px 20px rgba(0,0,0,0.4) !important; }
.apexcharts-tooltip-title { display: none !important; }

/* Gradient icon container */
.icon-gradient {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.icon-gradient svg { width: 18px; height: 18px; color: #fff; }

/* Premium stat card override */
.stat-card-premium {
    border-radius: 16px;
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.stat-card-premium .sparkline-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    opacity: 0.5;
}

/* Section divider */
.section-divider {
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}
.dark .section-divider::after {
    background: #334155;
}

/* ═══════════════════════════════════════════════════════════════
   POLISH LAYER — Settings · Segments · Imports · Login
   ═══════════════════════════════════════════════════════════════ */

/* ── Toggle indicator (CSS-only, visual) ────────────────────── */
.toggle-indicator {
    display: inline-block;
    width: 36px;
    height: 20px;
    border-radius: 10px;
    position: relative;
    flex-shrink: 0;
    transition: background 0.3s ease;
}
.toggle-indicator.on  { background: #10b981; }
.toggle-indicator.off { background: #94a3b8; }
.dark .toggle-indicator.off { background: #475569; }
.toggle-indicator::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    top: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    transition: left 0.3s ease;
}
.toggle-indicator.on::after  { left: 18px; }
.toggle-indicator.off::after { left: 2px; }

/* ── Connected dot pulse ────────────────────────────────────── */
@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.5); }
    50%       { box-shadow: 0 0 0 4px rgba(16, 185, 129, 0); }
}
.connected-dot {
    animation: pulse-dot 2.5s ease-in-out infinite;
}

/* ── Webhook copy button flash ──────────────────────────────── */
@keyframes copy-flash {
    0%   { background: #10b981; color: #fff; transform: scale(1.1); }
    80%  { background: #10b981; color: #fff; transform: scale(1); }
    100% { background: inherit; color: inherit; }
}
.copy-btn-flash {
    animation: copy-flash 1.2s ease forwards;
}

/* ── Settings section headers ───────────────────────────────── */
.settings-section-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
    padding: 0 2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.dark .settings-section-label { color: #94a3b8; }
.settings-section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
    border-radius: 1px;
}
.dark .settings-section-label::after { background: #334155; }

/* ── JSON editor (monospace code textarea) ──────────────────── */
.json-editor {
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 12px;
    background: #0f172a;
    color: #10b981;
    border: 1px solid #1e293b;
    border-radius: 12px;
    padding: 16px;
    line-height: 1.6;
    width: 100%;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    caret-color: #10b981;
}
.json-editor::placeholder { color: #334155; }
.json-editor:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

/* ── Segment glass card ─────────────────────────────────────── */
.segment-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 16px;
    box-shadow: 0 2px 20px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.04);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
.dark .segment-card {
    background: rgba(30, 41, 59, 0.82);
    border: 1px solid rgba(255,255,255,0.07);
    box-shadow: 0 2px 20px rgba(0,0,0,0.25);
}
.segment-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 36px rgba(0,0,0,0.10);
}
.dark .segment-card:hover {
    box-shadow: 0 8px 36px rgba(0,0,0,0.4);
}

/* ── Segment count badge (large number) ─────────────────────── */
.segment-count-number {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    color: #10b981;
    letter-spacing: -0.02em;
}
.dark .segment-count-number { color: #34d399; }

/* ── Filter pill tags ───────────────────────────────────────── */
.filter-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: rgba(16,185,129,0.1);
    color: #059669;
    border: 1px solid rgba(16,185,129,0.2);
}
.dark .filter-pill {
    background: rgba(16,185,129,0.15);
    color: #34d399;
    border-color: rgba(52,211,153,0.2);
}

/* ── Modal scale-in animation ───────────────────────────────── */
@keyframes modal-scale-in {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}
.modal-animate {
    animation: modal-scale-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── Empty state illustration ───────────────────────────────── */
.empty-state-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(16,185,129,0.12) 0%, rgba(16,185,129,0.06) 100%);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    border: 1.5px solid rgba(16,185,129,0.18);
}
.dark .empty-state-icon {
    background: linear-gradient(135deg, rgba(16,185,129,0.15) 0%, rgba(16,185,129,0.07) 100%);
    border-color: rgba(16,185,129,0.2);
}

/* ── Upload zone enhancements ───────────────────────────────── */
@keyframes bounce-icon {
    0%, 100% { transform: translateY(0); }
    40%       { transform: translateY(-6px); }
    60%       { transform: translateY(-3px); }
}
.drop-zone-icon-bounce {
    animation: bounce-icon 0.7s ease infinite;
}

.drop-zone-selected {
    border-style: solid !important;
    border-color: #10b981 !important;
    background-color: rgba(16,185,129,0.04) !important;
}
.dark .drop-zone-selected {
    border-color: #34d399 !important;
    background-color: rgba(52,211,153,0.06) !important;
}

/* File selected checkmark animation */
@keyframes check-pop {
    0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
    70%  { transform: scale(1.15) rotate(3deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg);   opacity: 1; }
}
.check-pop { animation: check-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

/* ── Upload progress bar ─────────────────────────────────────── */
.progress-bar-track {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 9999px;
    overflow: hidden;
}
.dark .progress-bar-track { background: #334155; }

@keyframes progress-indeterminate {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(300%); }
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 9999px;
    transition: width 0.4s ease;
}
.progress-bar-fill.indeterminate {
    width: 40% !important;
    animation: progress-indeterminate 1.4s ease-in-out infinite;
}

/* ── Import result stat counter animation ───────────────────── */
@keyframes stat-count-in {
    from { opacity: 0; transform: translateY(12px) scale(0.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.stat-count-animate {
    animation: stat-count-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── Success confetti (CSS pseudo-elements) ─────────────────── */
@keyframes confetti-float {
    0%   { transform: translateY(0) rotate(0deg);  opacity: 1; }
    100% { transform: translateY(-30px) rotate(180deg); opacity: 0; }
}
.results-success-card { position: relative; overflow: hidden; }
.results-success-card::before,
.results-success-card::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: confetti-float 1.8s ease-out forwards;
}
.results-success-card::before {
    background: #10b981;
    top: 60%;
    left: 20%;
    animation-delay: 0.1s;
}
.results-success-card::after {
    background: #3b82f6;
    top: 70%;
    left: 75%;
    animation-delay: 0.3s;
}

/* ── Error table row style ───────────────────────────────────── */
.error-row {
    border-left: 3px solid #ef4444;
}
.dark .error-row { border-left-color: #f87171; }
.error-row:nth-child(odd) {
    background: rgba(239,68,68,0.03);
}
.dark .error-row:nth-child(odd) {
    background: rgba(248,113,113,0.05);
}

/* ── Login page background mesh ─────────────────────────────── */
.login-bg {
    background:
        radial-gradient(ellipse at 20% 50%, rgba(16, 185, 129, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0d2438 100%);
}

/* ── Login card emerald header bar ──────────────────────────── */
.login-card-header {
    background: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
    border-radius: 18px 18px 0 0;
    padding: 28px 24px 20px;
    position: relative;
    overflow: hidden;
}
.login-card-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Ccircle fill='rgba(255,255,255,0.05)' cx='20' cy='20' r='18'/%3E%3C/g%3E%3C/svg%3E") repeat;
    opacity: 0.4;
}

/* ── Login floating label inputs ────────────────────────────── */
.float-label-wrap {
    position: relative;
}
.float-label-wrap input {
    padding-top: 20px;
    padding-bottom: 8px;
}
.float-label-wrap label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #94a3b8;
    pointer-events: none;
    transition: top 0.2s ease, font-size 0.2s ease, color 0.2s ease, transform 0.2s ease;
    transform-origin: left center;
}
.float-label-wrap input:focus + label,
.float-label-wrap input:not(:placeholder-shown) + label {
    top: 10px;
    transform: translateY(0) scale(0.78);
    color: #10b981;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.dark .float-label-wrap input:focus + label,
.dark .float-label-wrap input:not(:placeholder-shown) + label {
    color: #34d399;
}

/* ── Login button loading spinner ───────────────────────────── */
@keyframes spin-login {
    to { transform: rotate(360deg); }
}
.login-btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin-login 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 8px;
}

/* ── Login fade-in animation ─────────────────────────────────── */
@keyframes login-rise {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.login-card-animate {
    animation: login-rise 0.55s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

/* ── Reduced motion overrides ─────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .connected-dot, .drop-zone-icon-bounce, .progress-bar-fill.indeterminate,
    .results-success-card::before, .results-success-card::after,
    .login-card-animate, .modal-animate, .check-pop, .stat-count-animate,
    .typing-dot, .needs-human-pulse, .needs-human-dot-pulse,
    .avatar-ring-pulse, .referral-dot-pulse, .handoff-check-animate,
    .handoff-dialog, .chat-msg-in, .chat-msg-out, .kanban-card-anim,
    .kanban-column-anim {
        animation: none !important;
        transition: none !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   PREMIUM UI — Chat Bubbles · Pipeline Kanban · Contact Detail
   ═══════════════════════════════════════════════════════════════ */

/* ── WhatsApp-Style Chat Bubbles ──────────────────────────────── */

.chat-bubble-in {
    background: #f1f5f9;
    border-radius: 4px 16px 16px 16px;
    max-width: 80%;
    padding: 10px 14px;
    margin-bottom: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
}
.dark .chat-bubble-in {
    background: #334155;
}

.chat-bubble-out {
    background: #dcfce7;
    border-radius: 16px 4px 16px 16px;
    max-width: 80%;
    padding: 10px 14px;
    margin-bottom: 4px;
    margin-left: auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    position: relative;
}
.dark .chat-bubble-out {
    background: #064e3b;
}

/* Message entrance animation */
.chat-msg-in, .chat-msg-out {
    animation: chatBubbleIn 0.25s ease-out;
}
@keyframes chatBubbleIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Date separator pill */
.chat-date-separator {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 9999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: #e2e8f0;
    color: #64748b;
}
.dark .chat-date-separator {
    background: #334155;
    color: #94a3b8;
}

/* Typing indicator dots */
.typing-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    animation: typingPulse 1.2s ease-in-out infinite;
}
.dark .typing-dot {
    background: #64748b;
}
@keyframes typingPulse {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30%           { opacity: 1;   transform: translateY(-3px); }
}

/* Chat scroll area thin scrollbar */
.chat-scroll-area::-webkit-scrollbar { width: 4px; }
.chat-scroll-area::-webkit-scrollbar-track { background: transparent; }
.chat-scroll-area::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 2px; }
.dark .chat-scroll-area::-webkit-scrollbar-thumb { background: #475569; }


/* ── Avatar Gradients ─────────────────────────────────────────── */

.avatar-gradient-emerald {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
}
.avatar-gradient-blue {
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
}
.avatar-gradient-violet {
    background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 50%, #7c3aed 100%);
}
.avatar-gradient-amber {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
}

/* Pulsing ring for needs_human contacts */
.avatar-ring-pulse {
    position: relative;
}
.avatar-ring-pulse::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 18px;
    border: 2px solid #ef4444;
    animation: avatarRingPulse 2s ease-in-out infinite;
}
@keyframes avatarRingPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(1.06); }
}

/* Needs human badge pulse */
.needs-human-pulse {
    animation: needsHumanGlow 2.5s ease-in-out infinite;
}
@keyframes needsHumanGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); }
    50%      { box-shadow: 0 0 0 4px rgba(239,68,68,0); }
}

/* Needs human dot pulse on kanban cards */
.needs-human-dot-pulse {
    animation: needsHumanDotPulse 2s ease-in-out infinite;
}
@keyframes needsHumanDotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(248,113,113,0.5); }
    50%      { box-shadow: 0 0 0 3px rgba(248,113,113,0); }
}


/* ── Floating Labels (Handoff Modal) ──────────────────────────── */

.floating-field {
    position: relative;
}
.floating-label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    pointer-events: none;
    transition: all 0.2s ease;
    transform-origin: left center;
}
/* For textarea, position label at top */
textarea.floating-input ~ .floating-label {
    top: 14px;
    transform: translateY(0);
}
.floating-input:focus ~ .floating-label,
.floating-input:not(:placeholder-shown) ~ .floating-label {
    top: 6px;
    transform: translateY(0) scale(0.75);
    color: #059669;
    font-weight: 600;
}
.dark .floating-input:focus ~ .floating-label,
.dark .floating-input:not(:placeholder-shown) ~ .floating-label {
    color: #34d399;
}

/* Handoff modal scale-in animation */
.handoff-dialog {
    animation: handoffDialogIn 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.handoff-dialog-enter {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
}
@keyframes handoffDialogIn {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Handoff success check animation */
.handoff-check-animate {
    animation: handoffCheckPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes handoffCheckPop {
    0%   { transform: scale(0); opacity: 0; }
    60%  { transform: scale(1.15); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}


/* ── Referral Timeline ────────────────────────────────────────── */

.referral-dot-pulse {
    animation: referralDotPulse 2.5s ease-in-out infinite;
}
@keyframes referralDotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(251,191,36,0.5); }
    50%      { box-shadow: 0 0 0 4px rgba(251,191,36,0); }
}


/* ── Intake Q&A Cards ──────────────────────────────────────────── */

.intake-qa-card {
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.intake-qa-card:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.dark .intake-qa-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Progress ring animation */
.progress-ring-circle {
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
}


/* ── Pipeline Kanban — Glass Morphism Cards ───────────────────── */

.kanban-card-glass {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
    position: relative;
    overflow: hidden;
}
.dark .kanban-card-glass {
    background: rgba(30, 41, 59, 0.75);
    border-color: rgba(51, 65, 85, 0.8);
}
.kanban-card-glass:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    border-color: #cbd5e1;
}
.dark .kanban-card-glass:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    border-color: #475569;
}
.kanban-card-glass:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Urgency left border */
.kanban-card-normal {
    border-left: 3px solid #10b981;
}
.kanban-card-warning {
    border-left: 3px solid #f59e0b;
}
.kanban-card-urgent {
    border-left: 3px solid #ef4444;
}

/* Card entrance animation */
.kanban-card-anim {
    animation: kanbanCardIn 0.3s ease-out backwards;
}
@keyframes kanbanCardIn {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Stagger card animations */
.kanban-card-glass:nth-child(1) { animation-delay: 0s; }
.kanban-card-glass:nth-child(2) { animation-delay: 0.05s; }
.kanban-card-glass:nth-child(3) { animation-delay: 0.1s; }
.kanban-card-glass:nth-child(4) { animation-delay: 0.15s; }
.kanban-card-glass:nth-child(5) { animation-delay: 0.2s; }
.kanban-card-glass:nth-child(6) { animation-delay: 0.25s; }

/* Quick action buttons on hover */
.kanban-card-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}
.kanban-card-glass:hover .kanban-card-actions {
    opacity: 1;
}
.kanban-action-btn {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(255,255,255,0.9);
    border: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}
.dark .kanban-action-btn {
    background: rgba(30,41,59,0.9);
    border-color: #475569;
    color: #94a3b8;
}
.kanban-action-btn:hover {
    background: #059669;
    border-color: #059669;
    color: white;
}

/* Column entrance animation */
.kanban-column-anim {
    animation: kanbanColIn 0.35s ease-out backwards;
}
.kanban-column-anim:nth-child(1) { animation-delay: 0s; }
.kanban-column-anim:nth-child(2) { animation-delay: 0.06s; }
.kanban-column-anim:nth-child(3) { animation-delay: 0.12s; }
.kanban-column-anim:nth-child(4) { animation-delay: 0.18s; }
.kanban-column-anim:nth-child(5) { animation-delay: 0.24s; }
.kanban-column-anim:nth-child(6) { animation-delay: 0.3s; }
@keyframes kanbanColIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Drop zone active state */
.kanban-drop-active {
    background-color: rgba(16, 185, 129, 0.06) !important;
    border: 2px dashed #10b981 !important;
    border-radius: 10px;
}
.dark .kanban-drop-active {
    background-color: rgba(16, 185, 129, 0.08) !important;
    border-color: #34d399 !important;
}

/* Column count badge */
.kanban-count-badge {
    font-size: 11px;
    font-weight: 700;
    color: #64748b;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.dark .kanban-count-badge {
    color: #94a3b8;
    background: #334155;
    border-color: #475569;
}

/* Column gradient bars */
.kanban-gradient-emerald {
    background: linear-gradient(90deg, #10b981, #34d399);
}
.kanban-gradient-blue {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}
.kanban-gradient-amber {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.kanban-gradient-indigo {
    background: linear-gradient(90deg, #6366f1, #818cf8);
}
.kanban-gradient-violet {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}
.kanban-gradient-slate {
    background: linear-gradient(90deg, #94a3b8, #cbd5e1);
}
.dark .kanban-gradient-slate {
    background: linear-gradient(90deg, #475569, #64748b);
}


/* ── Pipeline Skeleton Loaders ────────────────────────────────── */

.skeleton-bar {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.dark .skeleton-bar {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

.skeleton-card {
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}
.dark .skeleton-card {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}

/* ── Empty column state ───────────────────────────────────────── */
.kanban-empty-col {
    opacity: 0;
    animation: fadeInEmpty 0.4s ease forwards 0.3s;
}
@keyframes fadeInEmpty {
    to { opacity: 1; }
}


/* ═══════════════════════════════════════════════════════════════
   SONNER-STYLE TOAST NOTIFICATION SYSTEM
   ═══════════════════════════════════════════════════════════════ */

/* ── Toast container (bottom-right, stacked) ─────────────────── */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-end;
    gap: 0;
    pointer-events: none;
    max-width: 420px;
    width: 100%;
}
@media (max-width: 480px) {
    .toast-container {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: calc(100vw - 32px);
    }
}

/* ── Individual toast ─────────────────────────────────────────── */
.toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-width: 320px;
    max-width: 420px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.45;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.12),
        0 1px 4px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    transform: translateY(100%) scale(0.95);
    opacity: 0;
    transition: transform 0.36s cubic-bezier(0.21, 1.02, 0.73, 1),
                opacity 0.28s ease,
                margin-bottom 0.36s ease;
    margin-bottom: 0;
    touch-action: pan-x;
    cursor: default;
    border: 1px solid transparent;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
.toast.toast-visible {
    transform: translateY(0) scale(1);
    opacity: 1;
    margin-bottom: 8px;
}
.toast.toast-exit {
    transform: translateX(110%) scale(0.95);
    opacity: 0;
    margin-bottom: 0;
    transition: transform 0.3s cubic-bezier(0.36, 0, 0.66, -0.56),
                opacity 0.2s ease,
                margin-bottom 0.3s ease;
}
/* Swipe-left dismiss (mobile) */
.toast.toast-swiping {
    transition: none;
}

/* ── Stacking transforms (older toasts compress) ──────────────── */
.toast.toast-stacked-1 {
    transform: translateY(6px) scale(0.96);
    opacity: 0.7;
    pointer-events: none;
}
.toast.toast-stacked-2 {
    transform: translateY(12px) scale(0.92);
    opacity: 0.4;
    pointer-events: none;
}
.toast.toast-stacked-hidden {
    transform: translateY(16px) scale(0.88);
    opacity: 0;
    pointer-events: none;
    margin-bottom: 0;
}

/* ── Toast type colors ─────────────────────────────────────────── */

/* Success */
.toast-success {
    background: #f0fdf4;
    border-color: rgba(16, 185, 129, 0.25);
    color: #166534;
}
.toast-success .toast-icon { color: #16a34a; }
.dark .toast-success {
    background: rgba(5, 46, 22, 0.92);
    border-color: rgba(16, 185, 129, 0.2);
    color: #bbf7d0;
}
.dark .toast-success .toast-icon { color: #4ade80; }

/* Error */
.toast-error {
    background: #fef2f2;
    border-color: rgba(239, 68, 68, 0.25);
    color: #991b1b;
}
.toast-error .toast-icon { color: #dc2626; }
.dark .toast-error {
    background: rgba(69, 10, 10, 0.92);
    border-color: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}
.dark .toast-error .toast-icon { color: #f87171; }

/* Warning */
.toast-warning {
    background: #fffbeb;
    border-color: rgba(245, 158, 11, 0.25);
    color: #92400e;
}
.toast-warning .toast-icon { color: #d97706; }
.dark .toast-warning {
    background: rgba(69, 40, 2, 0.92);
    border-color: rgba(245, 158, 11, 0.2);
    color: #fde68a;
}
.dark .toast-warning .toast-icon { color: #fbbf24; }

/* Info */
.toast-info {
    background: #eff6ff;
    border-color: rgba(59, 130, 246, 0.25);
    color: #1e40af;
}
.toast-info .toast-icon { color: #2563eb; }
.dark .toast-info {
    background: rgba(12, 24, 56, 0.92);
    border-color: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
}
.dark .toast-info .toast-icon { color: #60a5fa; }

/* ── Toast inner elements ──────────────────────────────────────── */
.toast-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
}
.toast-content {
    flex: 1;
    min-width: 0;
}
.toast-message {
    word-break: break-word;
}
.toast-dismiss {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: currentColor;
    opacity: 0.4;
    cursor: pointer;
    padding: 0;
    margin-top: 1px;
    transition: opacity 0.15s ease, background 0.15s ease;
}
.toast-dismiss:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.06);
}
.dark .toast-dismiss:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ── Progress bar (auto-dismiss timer) ─────────────────────────── */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 12px 12px;
    opacity: 0.5;
    transition: none;
}
.toast-progress.toast-progress-animate {
    transition: width linear;
}
.toast-success .toast-progress { background: #16a34a; }
.dark .toast-success .toast-progress { background: #4ade80; }
.toast-error .toast-progress { background: #dc2626; }
.dark .toast-error .toast-progress { background: #f87171; }
.toast-warning .toast-progress { background: #d97706; }
.dark .toast-warning .toast-progress { background: #fbbf24; }
.toast-info .toast-progress { background: #2563eb; }
.dark .toast-info .toast-progress { background: #60a5fa; }

/* ── Reduced motion ────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .toast,
    .toast.toast-visible,
    .toast.toast-exit,
    .toast.toast-stacked-1,
    .toast.toast-stacked-2,
    .toast.toast-stacked-hidden,
    .toast-progress.toast-progress-animate {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}


/* ═══════════════════════════════════════════════════════════════
   LANDING PAGE — doctorbot.online
   ═══════════════════════════════════════════════════════════════ */

/* ── Landing background mesh ──────────────────────────────────── */
.landing-bg {
    background:
        radial-gradient(ellipse at 15% 30%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 85% 70%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 60%),
        #020617;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}
/* Subtle dot grid texture */
.landing-bg::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

/* ── Landing nav ──────────────────────────────────────────────── */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.3s ease;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.landing-hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    position: relative;
    z-index: 1;
}
.landing-hero-title {
    font-size: clamp(2.4rem, 6vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -0.035em;
    line-height: 1.1;
    color: #f8fafc;
    margin-bottom: 20px;
}
.landing-hero-title .brand-dot {
    color: #10b981;
}
.landing-hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    color: #94a3b8;
    max-width: 580px;
    line-height: 1.6;
    margin: 0 auto 40px;
    font-weight: 400;
}
.landing-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    background: rgba(16, 185, 129, 0.1);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.15);
    margin-bottom: 32px;
}
.landing-hero-badge .pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse-dot 2.5s ease-in-out infinite;
}

/* ── CTA buttons ──────────────────────────────────────────────── */
.landing-cta-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}
.landing-cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    border: none;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    position: relative;
    overflow: hidden;
}
.landing-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.45);
}
.landing-cta-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}
.landing-cta-primary:hover::after { transform: translateX(100%); }

.landing-cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    color: #94a3b8;
    background: transparent;
    border: 1.5px solid rgba(148, 163, 184, 0.2);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}
.landing-cta-secondary:hover {
    color: #f1f5f9;
    border-color: rgba(241, 245, 249, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

/* ── Feature cards ────────────────────────────────────────────── */
.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px 100px;
    position: relative;
    z-index: 1;
}
.landing-feature-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 28px;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    overflow: hidden;
}
.landing-feature-card:hover {
    transform: translateY(-4px);
    border-color: rgba(16, 185, 129, 0.2);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.landing-feature-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.landing-feature-icon svg { width: 22px; height: 22px; color: #fff; }
.landing-feature-card h3 {
    font-size: 15px;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 8px;
}
.landing-feature-card p {
    font-size: 13.5px;
    color: #94a3b8;
    line-height: 1.6;
}

/* ── Landing scroll reveal ────────────────────────────────────── */
.landing-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.21, 1.02, 0.73, 1);
}
.landing-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}
/* Stagger children */
.landing-reveal-delay-1 { transition-delay: 0.1s; }
.landing-reveal-delay-2 { transition-delay: 0.2s; }
.landing-reveal-delay-3 { transition-delay: 0.3s; }
.landing-reveal-delay-4 { transition-delay: 0.4s; }

/* ── Landing footer ───────────────────────────────────────────── */
.landing-footer {
    text-align: center;
    padding: 40px 24px 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    z-index: 1;
}
.landing-footer p {
    font-size: 12px;
    color: #475569;
}
.landing-footer a {
    color: #64748b;
    text-decoration: none;
    transition: color 0.15s ease;
}
.landing-footer a:hover { color: #10b981; }

/* ── Reduced motion for landing ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .landing-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .landing-cta-primary::after,
    .landing-hero-badge .pulse-dot {
        animation: none !important;
        transition: none !important;
    }
}
