:root {
    --wa-green: #25D366;
    --wa-dark-green: #128C7E;
    --wa-teal: #075E54;
    --wa-light-green: #DCF8C6;
    --bg-primary: #111827;
    --bg-secondary: #1F2937;
    --bg-tertiary: #374151;
    --border-color: #374151;
    --text-primary: #F3F4F6;
    --text-secondary: #9CA3AF;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #4B5563 transparent;
}
*::-webkit-scrollbar { width: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: #4B5563; border-radius: 3px; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    color: #9CA3AF;
    font-size: 0.875rem;
    transition: all 0.15s;
    text-decoration: none;
}
.nav-link:hover { background: #374151; color: #F3F4F6; }
.nav-link.active { background: #065F46; color: #6EE7B7; }

.badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.4rem;
    border-radius: 9999px;
    font-weight: 600;
}

.card {
    background: #1F2937;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.25rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    outline: none;
    white-space: nowrap;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: #059669; color: white; }
.btn-primary:hover:not(:disabled) { background: #047857; }
.btn-danger { background: #DC2626; color: white; }
.btn-danger:hover:not(:disabled) { background: #B91C1C; }
.btn-secondary { background: #374151; color: #D1D5DB; }
.btn-secondary:hover:not(:disabled) { background: #4B5563; }
.btn-warning { background: #D97706; color: white; }
.btn-warning:hover:not(:disabled) { background: #B45309; }
.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.75rem; }

.input {
    width: 100%;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    color: #F3F4F6;
    font-size: 0.875rem;
    outline: none;
    transition: border-color 0.15s;
}
.input:focus { border-color: #059669; }
textarea.input { resize: vertical; min-height: 80px; }

select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239CA3AF' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #9CA3AF;
    margin-bottom: 0.3rem;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #374151;
    border-radius: 0.75rem;
    -webkit-overflow-scrolling: touch;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
thead { background: #111827; }
th { padding: 0.75rem 1rem; text-align: left; font-weight: 600; color: #9CA3AF; white-space: nowrap; }
td { padding: 0.6rem 1rem; border-top: 1px solid #374151; white-space: nowrap; }
tr:hover td { background: rgba(255,255,255,0.02); }

.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}
.status-dot.connected { background: #22C55E; box-shadow: 0 0 6px #22C55E; }
.status-dot.connecting, .status-dot.qr { background: #F59E0B; animation: pulse 1.5s infinite; }
.status-dot.disconnected { background: #EF4444; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.msg-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}
.msg-status.pending { color: #9CA3AF; }
.msg-status.sending { color: #F59E0B; }
.msg-status.sent { color: #9CA3AF; }
.msg-status.delivered { color: #9CA3AF; }
.msg-status.read { color: #3B82F6; }
.msg-status.failed { color: #EF4444; }

.tick-icon { font-size: 0.8rem; }

.stat-card {
    background: linear-gradient(135deg, #1F2937 0%, #111827 100%);
    border: 1px solid #374151;
    border-radius: 0.75rem;
    padding: 1.25rem;
}
.stat-card .stat-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.625rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}
.stat-card .stat-value { font-size: 1.75rem; font-weight: 700; }
.stat-card .stat-label { font-size: 0.8rem; color: #9CA3AF; }

.qr-container {
    background: white;
    padding: 1rem;
    border-radius: 0.75rem;
    display: inline-block;
}
.qr-container img { width: 250px; height: 250px; max-width: 100%; height: auto; }

.progress-bar-bg {
    background: #374151;
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    border-radius: 9999px;
    background: linear-gradient(90deg, #059669, #34D399);
    transition: width 0.3s;
}

.toast {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: slideIn 0.3s ease;
    max-width: 100%;
    pointer-events: auto;
}
.toast.success { background: #065F46; border: 1px solid #059669; color: #A7F3D0; }
.toast.error { background: #7F1D1D; border: 1px solid #DC2626; color: #FECACA; }
.toast.info { background: #1E3A5F; border: 1px solid #3B82F6; color: #BFDBFE; }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.checkbox-cell { width: 2.5rem; }
.checkbox-cell input[type="checkbox"] {
    accent-color: #059669;
    width: 1rem;
    height: 1rem;
    cursor: pointer;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6B7280;
}
.empty-state i { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 0.9rem; }

.file-drop {
    border: 2px dashed #374151;
    border-radius: 0.75rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.file-drop:hover, .file-drop.dragover { border-color: #059669; background: rgba(5,150,105,0.05); }

.limit-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: #374151;
    padding: 0.2rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    color: #D1D5DB;
}
.limit-pill.warn { background: #7F1D1D; color: #FCA5A5; }

@media (max-width: 640px) {
    .stat-card .stat-value { font-size: 1.25rem; }
    .stat-card { padding: 0.875rem; }
    th, td { padding: 0.5rem 0.625rem; font-size: 0.8rem; }
    .card { padding: 1rem; }
    .btn { padding: 0.4rem 0.75rem; font-size: 0.8rem; }
}

.mobile-card {
    display: none;
}
@media (max-width: 768px) {
    .desktop-table { display: none !important; }
    .mobile-card { display: block !important; }
}
@media (min-width: 769px) {
    .desktop-table { display: block !important; }
    .mobile-card { display: none !important; }
}

/* Inbox chat styles */
.inbox-chat-item {
    border-bottom: 1px solid #1F2937;
    transition: background 0.15s;
}
.inbox-chat-item:hover { background: #1F2937; }
.inbox-chat-item.active { background: #065F46; }

.inbox-chat-list::-webkit-scrollbar { width: 4px; }
.inbox-chat-list::-webkit-scrollbar-thumb { background: #374151; border-radius: 2px; }

#inbox-messages-area::-webkit-scrollbar { width: 6px; }
#inbox-messages-area::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }

@media (max-width: 1023px) {
    .inbox-container { flex-direction: column; }
    .inbox-session-bar { width: 100% !important; max-height: 100%; }
}

.inbox-audio-player audio {
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
}
.inbox-audio-player audio::-webkit-media-controls-panel {
    background: rgba(30,41,59,0.9);
}
.inbox-audio-player audio::-webkit-media-controls-play-button {
    transform: scale(1.3);
}

.spintax-chip {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 9999px;
    background: #1E293B;
    border: 1px solid #334155;
    color: #93C5FD;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.spintax-chip:hover {
    background: #334155;
    border-color: #60A5FA;
    color: #BFDBFE;
}
