﻿/* ==========================================================================
   Nexus Bot — Modern Operator Dashboard Stylesheet
   Theme: High-Tech Glassmorphism & Cyber Emerald
   ========================================================================== */

:root {
    /* Brand Palette */
    --primary: #00d4aa;
    --primary-light: #2ee6be;
    --primary-dark: #00a884;
    --primary-glow: rgba(0, 212, 170, 0.25);
    
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.25);
    
    --violet: #818cf8;
    --violet-glow: rgba(129, 140, 248, 0.25);

    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.25);

    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.25);

    --danger: #ff4757;
    --danger-glow: rgba(255, 71, 87, 0.25);

    /* Backgrounds & Surfaces */
    --bg-dark: #060b14;
    --bg-surface: #0a1120;
    --bg-card: rgba(13, 23, 42, 0.75);
    --bg-card-hover: rgba(21, 35, 62, 0.85);
    --bg-input: rgba(7, 13, 25, 0.85);
    
    /* Text & Contrasts */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-highlight: #ffffff;

    /* Borders & Dividers */
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --border-glow: rgba(0, 212, 170, 0.35);

    /* Radii & Shadows */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(0, 212, 170, 0.2);

    --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at 10% 0%, rgba(0, 212, 170, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 100%, rgba(56, 189, 248, 0.06) 0%, transparent 50%),
                var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ==================== HEADER ==================== */
.header {
    background: rgba(8, 14, 26, 0.85);
    border-bottom: 1px solid var(--border);
    padding: 0.85rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(0, 212, 170, 0.4));
    animation: float 4s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

.logo-text-group {
    display: flex;
    flex-direction: column;
}

.brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #ffffff 0%, #a7f3d0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.company-badge {
    font-size: 0.72rem;
    background: rgba(0, 212, 170, 0.12);
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: var(--primary);
    padding: 3px 9px;
    border-radius: 99px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.brand-caption {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Server Status Chip */
.server-status-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transition: var(--transition);
}

.status-dot.connected {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
    animation: pulseGlow 2s infinite;
}

.status-dot.disconnected {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

@keyframes pulseGlow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.15); }
}

/* WhatsApp Status */
.whatsapp-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

.wa-info {
    display: flex;
    flex-direction: column;
}

.status-text {
    font-size: 0.82rem;
    font-weight: 700;
}

.wa-sub {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.btn-qr {
    background: linear-gradient(135deg, #10b981, #059669);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-qr:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(16, 185, 129, 0.4);
}

/* Clock */
.datetime {
    text-align: right;
    padding-left: 8px;
    border-left: 1px solid var(--border);
}

.clock-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
}

.clock-date {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

/* Operator User Section */
.user-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-left: 16px;
    border-left: 1px solid var(--border);
}

.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(56, 189, 248, 0.2));
    border: 1px solid rgba(0, 212, 170, 0.4);
    color: var(--primary);
    font-weight: 800;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-meta {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
}

.user-role-badge {
    font-size: 0.68rem;
    color: var(--accent);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.btn-logout {
    background: rgba(255, 71, 87, 0.12);
    border: 1px solid rgba(255, 71, 87, 0.25);
    color: #ff6b7a;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
}

.btn-logout:hover {
    background: rgba(255, 71, 87, 0.25);
    border-color: rgba(255, 71, 87, 0.4);
    transform: translateY(-1px);
}

/* ==================== STATS BAR ==================== */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    padding: 1.25rem 2rem;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-md);
}

.stat-card.pending:hover { border-color: rgba(245, 158, 11, 0.5); }
.stat-card.attention:hover { border-color: rgba(56, 189, 248, 0.5); }
.stat-card.completed:hover { border-color: rgba(16, 185, 129, 0.5); }
.stat-card.total:hover { border-color: rgba(129, 140, 248, 0.5); }

.stat-icon-wrapper {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    flex-shrink: 0;
    transition: var(--transition);
}

.stat-icon-wrapper.pending {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.stat-icon-wrapper.attention {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.stat-icon-wrapper.completed {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.stat-icon-wrapper.total {
    background: rgba(129, 140, 248, 0.15);
    border: 1px solid rgba(129, 140, 248, 0.3);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.stat-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 2px;
}

/* ==================== MAIN CONTENT LAYOUT ==================== */
.main-content {
    display: grid;
    grid-template-columns: 1fr 520px;
    gap: 1.25rem;
    padding: 0 2rem 1.5rem;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
    min-height: 0;
}

.main-content.chat-active {
    grid-template-columns: 360px 480px 1fr;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.02em;
}

.queue-caption {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.btn-refresh,
.btn-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-refresh:hover,
.btn-close:hover {
    background: var(--primary);
    color: #04101d;
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

/* ==================== QUEUE SECTION ==================== */
.queue-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    max-height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
}

/* Queue Search & Filters Toolbar */
.queue-toolbar {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-input-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-box .search-icon {
    position: absolute;
    left: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-box input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 36px 10px 36px;
    color: #fff;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: var(--transition);
}

.search-input-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
}

.clear-search-btn:hover {
    color: #fff;
}

.queue-filter-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.filter-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.filter-pill.active {
    background: rgba(0, 212, 170, 0.15);
    border-color: rgba(0, 212, 170, 0.4);
    color: var(--primary);
}

.pill-badge {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 6px;
    border-radius: 99px;
}

.filter-pill.active .pill-badge {
    background: rgba(0, 212, 170, 0.3);
    color: #fff;
}

.queue-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

/* ==================== TURNO CARD ==================== */
.turno-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    transition: var(--transition);
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 14px;
    align-items: center;
    position: relative;
    border-left: 4px solid #64748b;
}

.turno-card:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
    border-color: var(--border-light);
    box-shadow: var(--shadow-sm);
}

.turno-card.active {
    border-color: var(--primary);
    background: rgba(0, 212, 170, 0.08);
    box-shadow: 0 0 20px rgba(0, 212, 170, 0.15);
}

.turno-card.pendiente {
    border-left-color: var(--warning);
}

.turno-card.en-atencion {
    border-left-color: var(--primary);
}

.turno-card.assigned-to-me {
    border-left-color: var(--accent);
}

.turno-codigo-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.turno-codigo {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    letter-spacing: -0.02em;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.turno-card.active .turno-codigo {
    background: rgba(0, 212, 170, 0.2);
    color: var(--primary-light);
    border-color: rgba(0, 212, 170, 0.4);
}

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

.turno-nombre {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.turno-subrow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.turno-servicio {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.turno-doc {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--accent);
    background: rgba(56, 189, 248, 0.1);
    padding: 1px 6px;
    border-radius: 4px;
}

.turno-meta-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.turno-status-badge {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
}

.turno-status-badge.pendiente {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.turno-status-badge.en_atencion {
    background: rgba(0, 212, 170, 0.15);
    color: var(--primary);
    border: 1px solid rgba(0, 212, 170, 0.3);
    animation: pulse 1.5s infinite;
}

.turno-time-pill {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== DETAIL SECTION ==================== */
.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px;
    max-height: calc(100vh - 250px);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
}

.detail-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

/* Hero Ticket Header */
.detail-hero-box {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.12), rgba(56, 189, 248, 0.08));
    border: 1px solid rgba(0, 212, 170, 0.25);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    margin-bottom: 18px;
    position: relative;
    overflow: hidden;
}

.detail-hero-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.8rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
    text-shadow: 0 0 25px rgba(0, 212, 170, 0.3);
}

.detail-hero-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.detail-hero-status.pendiente {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.4);
}

.detail-hero-status.en_atencion {
    background: rgba(0, 212, 170, 0.2);
    color: var(--primary);
    border: 1px solid rgba(0, 212, 170, 0.4);
}

.detail-hero-status.completado {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Detail Information Cards */
.detail-block {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 14px;
}

.detail-block-title {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.detail-patient-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.detail-patient-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(0, 212, 170, 0.2));
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #fff;
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.detail-patient-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

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

.detail-item-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-item-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-copy-mini {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 2px 4px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-copy-mini:hover {
    color: var(--primary);
    background: rgba(0, 212, 170, 0.1);
}

.btn-wa-direct {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
    padding: 4px 10px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 6px;
    width: fit-content;
}

.btn-wa-direct:hover {
    background: rgba(16, 185, 129, 0.25);
}

/* Operator Notes Box */
.notes-textarea {
    width: 100%;
    min-height: 70px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: #fff;
    padding: 12px;
    font-family: inherit;
    font-size: 0.85rem;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

.notes-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-save-notes {
    margin-top: 8px;
    padding: 7px 16px;
    font-size: 0.82rem;
    background: rgba(0, 212, 170, 0.15);
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: var(--primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-save-notes:hover {
    background: var(--primary);
    color: #04101d;
}

/* Detail Action Buttons */
.detail-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.btn-action-hero {
    flex: 1;
    min-width: 140px;
    padding: 13px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 800;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-action-hero.attend {
    background: linear-gradient(135deg, #00d4aa 0%, #0284c7 100%);
    color: #04101d;
    box-shadow: 0 8px 20px var(--primary-glow);
}

.btn-action-hero.attend:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-action-hero.complete {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: #fff;
    box-shadow: 0 8px 20px var(--success-glow);
}

.btn-action-hero.complete:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-action-hero.transfer {
    background: rgba(245, 158, 11, 0.18);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #fbbf24;
}

.btn-action-hero.transfer:hover {
    background: rgba(245, 158, 11, 0.3);
}

.btn-action-hero.cancel {
    background: rgba(255, 71, 87, 0.15);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: #ff6b7a;
    flex: 0 0 auto;
}

.btn-action-hero.cancel:hover {
    background: rgba(255, 71, 87, 0.25);
}

/* ==================== CHAT PANEL ==================== */
.chat-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    max-height: calc(100vh - 250px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow-md);
}

.chat-panel.visible {
    display: flex;
}

.chat-panel-header {
    padding: 14px 18px;
    border-bottom: 1px solid var(--border);
    background: rgba(8, 14, 26, 0.6);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chat-patient-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-patient-avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(56, 189, 248, 0.2));
    border: 1px solid rgba(0, 212, 170, 0.3);
    color: var(--primary);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-patient-name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.chat-phone-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.btn-icon-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
}

.btn-icon-close:hover {
    color: #fff;
}

.chat-panel-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: radial-gradient(circle at 50% 50%, rgba(13, 23, 42, 0.6) 0%, #060b14 100%);
}

.chat-empty-hint {
    text-align: center;
    color: var(--text-muted);
    margin: auto;
    font-size: 0.9rem;
}

.chat-empty-hint span {
    font-size: 2.4rem;
    display: block;
    margin-bottom: 8px;
}

/* Chat Bubbles */
.chat-bubble {
    max-width: 78%;
    padding: 10px 15px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.45;
    position: relative;
    word-break: break-word;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    animation: fadeInBubble 0.2s ease;
}

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

.chat-bubble.incoming {
    align-self: flex-start;
    background: #152238;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #f1f5f9;
    border-bottom-left-radius: 4px;
}

.chat-bubble.outgoing {
    align-self: flex-end;
    background: rgba(0, 212, 170, 0.16);
    border: 1px solid rgba(0, 212, 170, 0.35);
    color: #f8fafc;
    border-bottom-right-radius: 4px;
}

.bubble-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.chat-bubble.outgoing .bubble-meta {
    color: rgba(255, 255, 255, 0.6);
}

.bubble-text {
    color: inherit;
}

/* Quick Responses Bar */
.chat-quick-responses {
    padding: 10px 14px;
    border-top: 1px solid var(--border);
    background: rgba(8, 14, 26, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
}

.quick-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    white-space: nowrap;
}

.chat-quick-responses button {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.chat-quick-responses button:hover {
    background: var(--primary);
    color: #04101d;
    border-color: var(--primary);
    transform: translateY(-1px);
}

/* Chat Input Composer */
.chat-panel-input {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: var(--bg-surface);
}

.btn-attach {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-attach:hover {
    background: var(--bg-card-hover);
    color: var(--primary);
    border-color: var(--primary);
}

.chat-panel-input textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 11px 16px;
    border: 1px solid var(--border);
    border-radius: 14px;
    font-size: 0.88rem;
    font-family: inherit;
    resize: none;
    background: var(--bg-input);
    color: #fff;
    outline: none;
    transition: var(--transition);
}

.chat-panel-input textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-send {
    height: 44px;
    padding: 0 18px;
    background: linear-gradient(135deg, #00d4aa 0%, #0284c7 100%);
    border: none;
    border-radius: 12px;
    color: #04101d;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-send:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.file-preview-bar {
    background: rgba(0, 212, 170, 0.12);
    border: 1px solid rgba(0, 212, 170, 0.3);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    margin: 8px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
}

#file-preview-name {
    color: var(--primary-light);
    font-weight: 600;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state-graphic {
    width: 72px;
    height: 72px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-icon {
    font-size: 2.4rem;
}

.empty-state h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
}

.empty-state p {
    font-size: 0.85rem;
    max-width: 320px;
    line-height: 1.5;
}

/* ==================== MODAL STYLING ==================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 16, 0.85);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.modal.show {
    display: flex;
    animation: fadeInModal 0.25s ease forwards;
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

.modal-content {
    background: #0d172a;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 28px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    color: #fff;
}

.modal-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(0, 212, 170, 0.15);
    border: 1px solid rgba(0, 212, 170, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 12px;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 24px;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(13, 23, 42, 0.95);
    border: 1px solid var(--border-light);
    border-radius: 14px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    animation: slideUpToast 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    backdrop-filter: blur(12px);
    font-size: 0.88rem;
    font-weight: 600;
}

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

.toast.success { border-left: 4px solid var(--primary); }
.toast.warning { border-left: 4px solid var(--warning); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--accent); }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ==================== RESPONSIVE RULES ==================== */
@media (max-width: 1200px) {
    .main-content,
    .main-content.chat-active {
        grid-template-columns: 1fr;
    }

    .detail-section,
    .chat-panel {
        max-height: 500px;
    }

    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .header-content {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .header-right {
        width: 100%;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .stats-bar {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .main-content {
        padding: 0 1rem 1rem;
    }
}
