:root {
    --brand-primary: #059669;
    --brand-primary-hover: #047857;
    --brand-light: #ecfdf5;
    --surface-bg: #f8fafc;
    --card-bg: #ffffff;
    --border-subtle: #e2e8f0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--surface-bg);
    color: #0f172a;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .font-display {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

/* Custom Sleek Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Sidebar Nav Item States */
.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    transition: all 0.15s ease;
    cursor: pointer;
    user-select: none;
}
.nav-item:hover {
    background-color: #f1f5f9;
    color: #0f172a;
}
.nav-item.active {
    background-color: #ecfdf5;
    color: #047857;
    font-weight: 600;
}
.nav-item.active svg {
    color: #059669;
}

/* SaaS Cards & Tables */
.erp-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.85);
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(15, 23, 42, 0.03);
}

.erp-table th {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #64748b;
    background-color: #f8fafc;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

.erp-table td {
    padding: 0.85rem 1rem;
    font-size: 0.85rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.erp-table tbody tr:hover {
    background-color: #f8fafc;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
}
.badge-paid, .badge-active, .badge-connected, .badge-sent, .badge-delivered, .badge-read {
    background-color: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.badge-pending, .badge-scheduled, .badge-queued {
    background-color: #f0f9ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
}
.badge-overdue, .badge-failed, .badge-error {
    background-color: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}
.badge-partially_paid, .badge-paused, .badge-warning, .badge-opened_wa_link {
    background-color: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.badge-waived, .badge-inactive, .badge-cancelled, .badge-disconnected, .badge-expired {
    background-color: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}

/* Form Controls */
.erp-input {
    width: 100%;
    padding: 0.575rem 0.85rem;
    border-radius: 0.75rem;
    border: 1px solid #cbd5e1;
    background-color: #ffffff;
    font-size: 0.875rem;
    color: #0f172a;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.erp-input:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}
.erp-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.35rem;
}

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 0.75rem;
    background-color: #059669;
    color: #ffffff;
    font-size: 0.84rem;
    font-weight: 600;
    transition: background-color 0.15s ease, transform 0.1s ease;
    box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
}
.btn-primary:hover {
    background-color: #047857;
}
.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 0.75rem;
    background-color: #ffffff;
    color: #334155;
    border: 1px solid #cbd5e1;
    font-size: 0.84rem;
    font-weight: 600;
    transition: all 0.15s ease;
}
.btn-secondary:hover {
    background-color: #f8fafc;
    border-color: #94a3b8;
    color: #0f172a;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 0.9rem;
    border-radius: 0.75rem;
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    font-size: 0.82rem;
    font-weight: 600;
    transition: all 0.15s ease;
}
.btn-danger:hover {
    background-color: #fee2e2;
}

/* WhatsApp Bubble Preview */
.wa-preview-box {
    background-color: #efeae2;
    background-image: radial-gradient(rgba(15, 23, 42, 0.04) 1px, transparent 0);
    background-size: 16px 16px;
    border-radius: 0.875rem;
    padding: 1rem;
}
.wa-bubble {
    background-color: #d9fdd3;
    color: #111b21;
    border-radius: 0.75rem 0.75rem 0.2rem 0.75rem;
    padding: 0.75rem 0.9rem;
    font-size: 0.84rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* Subtle Skeleton Loading */
@keyframes pulseSoft {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.skeleton {
    animation: pulseSoft 1.5s ease-in-out infinite;
    background-color: #e2e8f0;
    border-radius: 0.5rem;
}
