/* Custom styles beyond Tailwind CDN */
:root {
    --meta-blue: #1877F2;
    --meta-blue-hover: #166FE5;
    --meta-bg: #F0F2F5;
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--meta-bg);
}

.sidebar {
    width: var(--sidebar-width);
    min-height: 100vh;
    transition: width 0.2s;
}

.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: #65676B;
    border-radius: 8px;
    margin: 2px 12px;
    transition: all 0.15s;
    font-size: 0.935rem;
    font-weight: 500;
    text-decoration: none;
}

.sidebar-link:hover {
    background: #E4E6EB;
    color: #1C1E21;
}

.sidebar-link.active {
    background: #E7F3FF;
    color: var(--meta-blue);
}

.sidebar-link svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

.btn-primary {
    background: var(--meta-blue);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: var(--meta-blue-hover);
}

.btn-secondary {
    background: #E4E6EB;
    color: #1C1E21;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #D8DADF;
}

.btn-danger {
    background: #FA383E;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}

.btn-danger:hover {
    background: #E4363B;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
}

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    display: inline-block;
}

.badge-green { background: #E6F4EA; color: #137333; }
.badge-red { background: #FCE8E6; color: #C5221F; }
.badge-blue { background: #E8F0FE; color: #1A73E8; }
.badge-yellow { background: #FEF7E0; color: #B06000; }
.badge-gray { background: #E8EAED; color: #5F6368; }

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #65676B;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 2px solid #E4E6EB;
    white-space: nowrap;
}

table td {
    padding: 12px 16px;
    font-size: 0.9rem;
    color: #1C1E21;
    border-bottom: 1px solid #F0F2F5;
}

table tr:hover td {
    background: #F8F9FA;
}

.input-field {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #DDD;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.15s;
    outline: none;
}

.input-field:focus {
    border-color: var(--meta-blue);
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.15);
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #1C1E21;
    line-height: 1.2;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #65676B;
    margin-top: 4px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.progress-bar-bg {
    background: #E4E6EB;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}

.progress-bar-fill {
    background: var(--meta-blue);
    height: 100%;
    border-radius: 999px;
    transition: width 0.5s ease;
}

.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100;
    padding: 14px 24px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s, transform 0.3s;
}

.toast-success { background: #137333; color: white; }
.toast-error { background: #C5221F; color: white; }

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Preview modal — estilo lembrando bolha WhatsApp */
.wa-preview-phone {
    max-width: 340px;
    margin: 0 auto;
    background: #E5DDD5;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23c9c5bd' fill-opacity='0.35'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #e0e0e0;
}

.wa-preview-bubble {
    background: #DCF8C6;
    border-radius: 0 8px 8px 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #111;
    box-shadow: 0 1px 1px rgba(0,0,0,0.08);
    word-break: break-word;
}

.wa-preview-bubble .wa-line {
    margin-bottom: 8px;
}

.wa-preview-bubble .wa-line:last-child {
    margin-bottom: 0;
}

.wa-preview-meta {
    font-size: 0.75rem;
    color: #667781;
    margin-top: 8px;
    text-align: right;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: none;
    background: #E7F3FF;
    color: #1877F2;
    cursor: pointer;
    transition: background 0.15s;
}

.icon-btn:hover {
    background: #D4E8FC;
}
