/* ================= CUSTOM VARIABLES & BASE ================= */
:root {
    --bg-main: #07070e;
    --bg-gradient: linear-gradient(135deg, #07070e 0%, #0d0f21 100%);
    --panel-bg: rgba(15, 15, 30, 0.5);
    --panel-border: rgba(255, 255, 255, 0.05);
    --panel-glow: rgba(99, 102, 241, 0.15);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --accent-indigo: #6366f1;
    --accent-indigo-glow: rgba(99, 102, 241, 0.4);
    --accent-emerald: #10b981;
    --accent-rose: #ef4444;
    --accent-amber: #f59e0b;
    --accent-purple: #a855f7;

    --font-main: 'Outfit', sans-serif;
    
    --sidebar-width: 280px;
    --chats-width: 320px;
    --right-width: 340px;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

body {
    background: var(--bg-main);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

/* ================= UTILITY GLASS STYLING ================= */
.glass {
    background: var(--panel-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--panel-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-inset {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.hidden {
    display: none !important;
}

.text-gradient {
    background: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ================= BUTTONS ================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: all var(--transition-speed) ease;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, #4f46e5 100%);
    color: #fff;
    box-shadow: 0 4px 14px 0 var(--accent-indigo-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 var(--accent-indigo-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background: linear-gradient(135deg, var(--accent-emerald) 0%, #059669 100%);
    color: #fff;
}

.btn-success:hover {
    transform: translateY(-2px);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: 6px;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-indigo);
}

/* ================= AUTH OVERLAY (LOGIN) ================= */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 50%, #0f102a 0%, #05050f 100%);
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
    border-radius: 16px;
    padding: 40px 30px;
}

.auth-header {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 8px;
}

.logo i {
    font-size: 2.2rem;
}

.logo h2 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo h2 span {
    font-weight: 300;
    opacity: 0.8;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

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

.input-icon i {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
}

.input-icon input, .form-control {
    width: 100%;
    padding: 12px 16px 12px 42px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-speed) ease;
}

.form-control {
    padding-left: 16px;
}

.input-icon input:focus, .form-control:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 10px 0 var(--panel-glow);
}

.error-text {
    color: var(--accent-rose);
    font-size: 0.85rem;
    margin-bottom: 15px;
    min-height: 20px;
}

.success-text {
    color: var(--accent-emerald);
    font-size: 0.85rem;
    margin-bottom: 15px;
    min-height: 20px;
}

/* ================= SYSTEM APP LAYOUT ================= */
.app-layout {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 1. LEFT SIDEBAR PANEL */
.sidebar-panel {
    width: var(--sidebar-width);
    flex-shrink: 0;
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    padding: 20px 0;
}

.sidebar-header {
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid var(--panel-border);
}

.sidebar-header .logo {
    justify-content: flex-start;
    margin-bottom: 15px;
}

.user-badge {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    padding: 10px 12px;
    border-radius: 8px;
}

.user-badge #user-display-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.user-badge #user-role-label {
    font-size: 0.75rem;
    color: var(--accent-indigo);
    text-transform: uppercase;
    font-weight: 700;
}

.device-status-box {
    margin: 15px 20px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
}

.status-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator-dot.connected {
    background-color: var(--accent-emerald);
    box-shadow: 0 0 10px var(--accent-emerald);
}

.status-indicator-dot.disconnected {
    background-color: var(--accent-rose);
    box-shadow: 0 0 10px var(--accent-rose);
}

.status-indicator-dot.initializing {
    background-color: var(--accent-amber);
    box-shadow: 0 0 10px var(--accent-amber);
    animation: pulse 1.5s infinite;
}

.status-info {
    flex-grow: 1;
}

.status-info h4 {
    font-size: 0.85rem;
    font-weight: 600;
}

.status-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.sidebar-menu {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 10px;
}

.sidebar-menu h3 {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    padding: 15px 10px 5px 10px;
    text-transform: uppercase;
}

.menu-item {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-speed) ease;
    margin-bottom: 4px;
}

.menu-item:hover, .menu-item.active {
    background: rgba(99, 102, 241, 0.1);
    color: #fff;
}

.menu-item.active {
    border-left: 3px solid var(--accent-indigo);
    border-radius: 0 8px 8px 0;
}

.menu-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.menu-item .badge {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2) !important;
    color: var(--accent-amber) !important;
}

.sidebar-footer {
    padding: 15px 20px 0 20px;
    border-top: 1px solid var(--panel-border);
}

/* 2. CHATS COLUMN */
.chats-column {
    width: var(--chats-width);
    flex-shrink: 0;
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
}

.column-header {
    padding: 20px;
    border-bottom: 1px solid var(--panel-border);
}

.column-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.search-bar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
}

.search-bar i {
    color: var(--text-muted);
    margin-right: 10px;
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.9rem;
    width: 100%;
}

.chats-list {
    flex-grow: 1;
    overflow-y: auto;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.chat-item:hover, .chat-item.active {
    background: rgba(255, 255, 255, 0.02);
}

.chat-item.active {
    background: rgba(99, 102, 241, 0.05);
}

.chat-item .chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-indigo);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.chat-item-details {
    flex-grow: 1;
    min-width: 0;
}

.chat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

.chat-item-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-header .time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.chat-item-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-details .assignment-tag {
    display: inline-block;
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 4px;
    color: var(--text-muted);
}

.chat-item-details .assignment-tag.assigned {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
}

.empty-state {
    padding: 50px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

/* 3. CENTRAL CHAT ROOM PANEL */
.chat-room-panel {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--panel-border);
    position: relative;
}

.chat-welcome {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.welcome-box {
    max-width: 450px;
}

.welcome-box .main-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.welcome-box h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.welcome-box p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.chat-active-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.customer-profile .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.customer-info h3 {
    font-size: 1rem;
    font-weight: 600;
}

.customer-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

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

.assignment-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    padding: 4px 12px;
    border-radius: 6px;
}

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

.assigned-name {
    font-weight: 600;
    color: var(--accent-indigo);
}

.messages-stream {
    flex-grow: 1;
    overflow-y: auto;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* MESSAGE BUBBLES */
.message-bubble {
    display: flex;
    flex-direction: column;
    max-width: 65%;
}

.message-bubble.incoming {
    align-self: flex-start;
}

.message-bubble.outgoing {
    align-self: flex-end;
}

.message-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    padding: 0 4px;
}

.message-bubble.outgoing .message-meta {
    text-align: right;
}

.message-content {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.45;
    word-break: break-word;
}

.message-bubble.incoming .message-content {
    background: rgba(255, 255, 255, 0.05);
    border-top-left-radius: 2px;
}

.message-bubble.outgoing .message-content {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, #4f46e5 100%);
    color: #fff;
    border-top-right-radius: 2px;
    box-shadow: 0 2px 10px 0 rgba(99, 102, 241, 0.2);
}

.message-media-attachment {
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 6px;
}

.message-media-attachment img {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    display: block;
}

.document-attachment {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    color: #fff;
    text-decoration: none;
    font-size: 0.85rem;
}

.document-attachment i {
    font-size: 1.5rem;
    color: var(--accent-amber);
}

.system-event-message {
    align-self: center;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 10px 0;
}

/* TYPING INDICATOR */
.typing-indicator-wrapper {
    padding: 10px 25px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.typing-indicator-wrapper .dots {
    display: flex;
    gap: 3px;
}

.typing-indicator-wrapper .dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-indigo);
    animation: bounce 1.4s infinite ease-in-out both;
}

.typing-indicator-wrapper .dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator-wrapper .dots span:nth-child(2) { animation-delay: -0.16s; }

/* INPUT FOOTER */
.chat-footer {
    padding: 15px 25px 25px 25px;
    border-top: 1px solid var(--panel-border);
}

.media-preview-container {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid var(--panel-border);
}

.media-preview-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.media-preview-card span {
    max-width: 80%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.media-preview-card button {
    background: transparent;
    border: none;
    color: var(--accent-rose);
    cursor: pointer;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-attach {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--panel-border);
    color: var(--text-secondary);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-speed) ease;
}

.btn-attach:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-indigo);
    border-color: var(--accent-indigo);
}

.chat-input-bar input {
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    padding: 12px 18px;
    border-radius: 24px;
    color: #fff;
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-speed) ease;
}

.chat-input-bar input:focus {
    border-color: var(--accent-indigo);
}

.btn-send {
    background: linear-gradient(135deg, var(--accent-indigo) 0%, #4f46e5 100%);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px 0 var(--accent-indigo-glow);
    transition: all var(--transition-speed) ease;
}

.btn-send:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px 0 var(--accent-indigo-glow);
}

/* 4. RIGHT PANEL (COLLABORATION) */
.right-panel {
    width: var(--right-width);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.panel-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: var(--text-muted);
}

.panel-welcome i {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.panel-active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.section-title {
    margin-bottom: 15px;
    margin-top: 15px;
}

.section-title:first-child {
    margin-top: 0;
}

.section-title h3 {
    font-size: 1rem;
    font-weight: 600;
}

.section-title .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
}

.crm-details-box {
    padding: 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.detail-row .label {
    color: var(--text-secondary);
}

.detail-row .value {
    font-weight: 500;
}

.badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.badge.resolved {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
}

.form-control-sm {
    padding: 4px 8px;
    font-size: 0.8rem;
    border-radius: 6px;
    width: auto;
    background: rgba(0, 0, 0, 0.2);
}

.notes-container {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.notes-list {
    flex-grow: 1;
    overflow-y: auto;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 4px;
}

.note-card {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.15);
    padding: 10px 12px;
    border-radius: 8px;
}

.note-card-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-amber);
    margin-bottom: 6px;
}

.note-card-header .time {
    color: var(--text-muted);
    font-weight: 400;
}

.note-card p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-primary);
}

.notes-input-box {
    margin-top: auto;
}

.notes-input-box textarea {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 10px;
    color: #fff;
    font-size: 0.85rem;
    outline: none;
    resize: none;
    margin-bottom: 8px;
    transition: all var(--transition-speed) ease;
}

.notes-input-box textarea:focus {
    border-color: var(--accent-indigo);
}

/* ================= MODALS ================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 110;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 480px;
    border-radius: 16px;
    overflow: hidden;
}

.modal-header {
    padding: 15px 25px;
    border-bottom: 1px solid var(--panel-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.2rem;
    font-weight: 600;
}

.btn-close-modal {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
}

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

.modal-body {
    padding: 25px;
}

.text-center {
    text-align: center;
}

.qr-container-box {
    margin: 25px auto;
    width: 250px;
    height: 250px;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.qr-container-box canvas {
    max-width: 100%;
    height: auto;
}

.modal-status-text {
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ================= ANIMATIONS ================= */
@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1.0); }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--accent-indigo);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

.fs-xl {
    font-size: 3rem;
}

/* ================= ENTERPRISE CRM ADDITIONS ================= */
.modal-lg {
    max-width: 800px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 16px;
    border-radius: 12px;
    text-align: center;
    position: relative;
}

.stat-card .icon {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.stat-card .stat-num {
    font-size: 1.6rem;
    font-weight: 700;
}

.stat-card .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.tags-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

.tag-chip .btn-remove-tag {
    cursor: pointer;
    opacity: 0.75;
}

.tag-chip .btn-remove-tag:hover {
    opacity: 1;
}

.canned-popup-menu {
    position: absolute;
    bottom: 70px;
    left: 20px;
    width: 320px;
    max-height: 220px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.canned-popup-menu .popup-header {
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--panel-border);
}

.canned-popup-menu .popup-list {
    overflow-y: auto;
}

.canned-item {
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.canned-item:hover {
    background: rgba(99, 102, 241, 0.2);
}

.canned-item .shortcut {
    font-weight: 600;
    color: var(--accent-indigo);
    font-size: 0.8rem;
}

.canned-item .title {
    font-size: 0.8rem;
    color: var(--text-primary);
}

.btn-icon-input {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 6px;
    transition: color 0.15s ease;
}

.btn-icon-input:hover {
    color: var(--accent-emerald);
}

.voice-recording-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.table th, .table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--panel-border);
}

.table th {
    color: var(--text-muted);
    font-weight: 600;
}

