:root {
    --wa-green: #25d366;
    --wa-green-dark: #128c7e;
    --wa-green-darker: #075e54;
    --sidebar-bg: #0f172a;
    --sidebar-active: #1e293b;
    --content-bg: #f1f5f9;
    --accent: #10b981;
}

* {
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--content-bg);
    min-height: 100vh;
}

/* ---------- App shell ---------- */
.app-shell {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: 250px;
    background: linear-gradient(180deg, #05372f 0%, #0b3b33 100%);
    color: rgba(255, 255, 255, 0.85);
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
}

.app-main {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-content {
    flex: 1;
    padding: 1.75rem 2rem 3rem;
}

/* ---------- Sidebar ---------- */
.brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 1.25rem 1.5rem;
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand:hover {
    color: #fff;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--wa-green) 0%, #128c7e 100%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.nav-side .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1.25rem;
    margin: 0.15rem 0.75rem;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.92rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-side .nav-link i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.nav-side .nav-link:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.nav-side .nav-link.active {
    background: var(--wa-green);
    color: #07312b;
    font-weight: 600;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.35);
}

.nav-heading {
    padding: 1rem 1.5rem 0.35rem;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
}

.sidebar-user {
    margin-top: auto;
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-user .avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wa-green), #128c7e);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #063030;
    font-weight: 700;
}

/* ---------- Topbar ---------- */
.topbar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.75rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1020;
}

.topbar-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
}

/* ---------- Cards ---------- */
.card {
    border: 0;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid #eef2f7;
    font-weight: 600;
    padding: 1rem 1.25rem;
}

.stat-card {
    border: 0;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    color: #0f172a;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.10);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
}

/* ---------- Buttons ---------- */
.btn {
    border-radius: 9px;
    font-weight: 600;
}

.btn-wa {
    background: linear-gradient(135deg, var(--wa-green) 0%, #128c7e 100%);
    border: 0;
    color: #05312c;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.3);
}

.btn-wa:hover {
    color: #02221e;
    filter: brightness(1.05);
}

/* ---------- Forms ---------- */
.form-control, .form-select {
    border-radius: 9px;
    border-color: #d8dfea;
    padding: 0.55rem 0.8rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--wa-green);
    box-shadow: 0 0 0 0.2rem rgba(37, 211, 102, 0.15);
}

.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: #334155;
    margin-bottom: 0.35rem;
}

/* ---------- Tables ---------- */
.table thead th {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    color: #64748b;
    border-bottom-width: 1px;
    font-weight: 700;
}

.table td {
    vertical-align: middle;
}

/* ---------- Badges ---------- */
.badge-pill-soft {
    padding: 0.45em 0.85em;
    font-weight: 600;
    border-radius: 999px;
}

/* ---------- Auth ---------- */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #075e54 0%, #128c7e 55%, #25d366 130%);
    padding: 2rem 1rem;
}

.auth-card {
    width: 100%;
    max-width: 430px;
    border-radius: 20px;
    border: 0;
    box-shadow: 0 24px 60px rgba(4, 46, 40, 0.45);
}

.auth-logo {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--wa-green), #128c7e);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #04312c;
    box-shadow: 0 10px 24px rgba(37, 211, 102, 0.4);
}

/* ---------- Misc ---------- */
.pagination .page-link {
    border-radius: 8px;
    margin: 0 2px;
    border: 0;
    color: #0f172a;
    font-weight: 500;
}

.pagination .page-item.active .page-link {
    background: var(--wa-green);
    color: #05312c;
}

.progress-wa {
    height: 10px;
    border-radius: 999px;
    background: #e2e8f0;
}

.progress-wa .progress-bar {
    background: linear-gradient(90deg, var(--wa-green), #128c7e);
    border-radius: 999px;
}

.progress-wa .progress-bar-live {
    transition: width 0.6s ease;
}

.campaign-live-bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2000;
    width: 100%;
    height: 3px;
    pointer-events: none;
    visibility: hidden;
}

.campaign-live-bar.active {
    visibility: visible;
}

.campaign-live-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--wa-green), #25d366);
    transition: width 0.4s ease;
}

.campaign-live-bar.active .campaign-live-bar-fill {
    width: 55%;
    animation: campaign-live-pulse 1.3s ease-in-out infinite;
}

.campaign-live-bar.done .campaign-live-bar-fill {
    width: 100%;
    animation: none;
}

@keyframes campaign-live-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.45; }
    100% { opacity: 1; }
}

.text-muted-sm {
    font-size: 0.8rem;
    color: #94a3b8;
}

.avatar-sm {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
}

@media (max-width: 991.98px) {
    .app-sidebar {
        width: 210px;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }

    .app-main {
        margin-left: 0;
    }

    .app-sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 40px rgba(0, 0, 0, 0.3);
    }
}