/* CRM White Label - App.css */
/* Tailwind custom components e overrides */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #030712;
    color: #f9fafb;
}

/* =============================================
   SCROLLBAR CUSTOMIZADA
   ============================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #111827; }
::-webkit-scrollbar-thumb { background: #374151; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4B5563; }

/* =============================================
   ANIMAÇÕES
   ============================================= */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.animate-fade-in { animation: fadeIn 0.3s ease-out; }
.animate-slide-in-right { animation: slideInRight 0.3s ease-out; }

/* =============================================
   COMPONENTES DE CARD
   ============================================= */
.card {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 24px;
}

.card-sm {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 10px;
    padding: 16px;
}

.card:hover {
    border-color: #374151;
    transition: border-color 0.2s;
}

/* =============================================
   MÉTRICAS / KPI CARDS
   ============================================= */
.metric-card {
    background: linear-gradient(135deg, #111827 0%, #1a2332 100%);
    border: 1px solid #1f2937;
    border-radius: 12px;
    padding: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    border-color: #374151;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.metric-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand-color, #4F46E5);
    opacity: 0.6;
}

/* =============================================
   BOTÕES
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--brand-color, #4F46E5);
    color: white;
}

.btn-primary:hover {
    background: color-mix(in srgb, var(--brand-color) 80%, black);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--brand-color) 40%, transparent);
}

.btn-secondary {
    background: #1f2937;
    color: #d1d5db;
    border: 1px solid #374151;
}

.btn-secondary:hover {
    background: #374151;
    color: white;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
    border-radius: 10px;
}

/* =============================================
   INPUTS E FORMULÁRIOS
   ============================================= */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    background: #111827;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    color: #f9fafb;
    transition: border-color 0.2s;
    outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    border-color: var(--brand-color, #4F46E5);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-color) 20%, transparent);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    margin-bottom: 6px;
}

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

/* =============================================
   BADGES E TAGS
   ============================================= */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
}

.badge-green  { background: #065f46; color: #10b981; }
.badge-red    { background: #7f1d1d; color: #f87171; }
.badge-yellow { background: #78350f; color: #fbbf24; }
.badge-blue   { background: #1e3a5f; color: #60a5fa; }
.badge-gray   { background: #1f2937; color: #9ca3af; }
.badge-purple { background: #4c1d95; color: #a78bfa; }

/* =============================================
   STATUS DOTS
   ============================================= */
.status-online { color: #10b981; }
.status-offline { color: #6b7280; }
.status-away { color: #f59e0b; }
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* =============================================
   TABELAS
   ============================================= */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #1f2937;
    background: #0f172a;
}

.table td {
    padding: 14px 16px;
    font-size: 14px;
    color: #e5e7eb;
    border-bottom: 1px solid #111827;
}

.table tr:hover td {
    background: #111827;
}

/* =============================================
   INBOX / CHAT
   ============================================= */
.conversation-item {
    padding: 14px 16px;
    border-bottom: 1px solid #1f2937;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.conversation-item:hover,
.conversation-item.active {
    background: #111827;
}

.conversation-item.unread::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 50%;
    background: var(--brand-color);
    border-radius: 0 2px 2px 0;
}

.message-bubble-in {
    background: #1f2937;
    border-radius: 18px 18px 18px 4px;
    padding: 10px 14px;
    max-width: 70%;
    align-self: flex-start;
}

.message-bubble-out {
    background: var(--brand-color);
    border-radius: 18px 18px 4px 18px;
    padding: 10px 14px;
    max-width: 70%;
    align-self: flex-end;
    color: white;
}

.message-bubble-bot {
    background: linear-gradient(135deg, #312e81, #1e3a5f);
    border-radius: 18px 18px 18px 4px;
    padding: 10px 14px;
    max-width: 70%;
    align-self: flex-start;
    border: 1px solid #4338ca;
}

/* =============================================
   PIPELINE KANBAN
   ============================================= */
.kanban-column {
    min-width: 280px;
    max-width: 280px;
    background: #111827;
    border-radius: 12px;
    border: 1px solid #1f2937;
    display: flex;
    flex-direction: column;
}

.kanban-card {
    background: #1f2937;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 12px;
    cursor: grab;
    transition: all 0.2s;
}

.kanban-card:hover {
    border-color: var(--brand-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.kanban-card.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

/* =============================================
   LOADING SPINNER
   ============================================= */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #374151;
    border-top-color: var(--brand-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* =============================================
   TOOLTIPS
   ============================================= */
[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    left: 50%;
    transform: translateX(-50%);
    background: #1f2937;
    color: #f9fafb;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
    border: 1px solid #374151;
    z-index: 100;
}

/* =============================================
   META CHANNELS COLORS
   ============================================= */
.channel-whatsapp { color: #25D366; }
.channel-instagram { color: #E1306C; }
.channel-facebook { color: #1877F2; }
.channel-icon-wa { background: #25D366; }
.channel-icon-ig { background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.channel-icon-fb { background: #1877F2; }

/* =============================================
   ALERTAS / FLASH
   ============================================= */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease-out;
}

.alert-success { background: #064e3b; border: 1px solid #10b981; color: #6ee7b7; }
.alert-error   { background: #7f1d1d; border: 1px solid #ef4444; color: #fca5a5; }
.alert-warning { background: #78350f; border: 1px solid #f59e0b; color: #fcd34d; }
.alert-info    { background: #1e3a5f; border: 1px solid #3b82f6; color: #93c5fd; }

/* =============================================
   RESPONSIVO
   ============================================= */
@media (max-width: 1024px) {
    #sidebar {
        transform: translateX(-100%);
    }
    #sidebar.open {
        transform: translateX(0);
    }
    #main-content {
        margin-left: 0 !important;
    }
}
