:root {
    --wa-bg: #edf7f5;
    --wa-ink: #10201d;
    --wa-muted: #667b75;
    --wa-glass: rgba(255, 255, 255, 0.66);
    --wa-glass-strong: rgba(255, 255, 255, 0.86);
    --wa-border: rgba(255, 255, 255, 0.72);
    --wa-shadow: 0 24px 70px rgba(24, 49, 44, 0.14);
    --wa-green: #0aae5c;
    --wa-blue: #3478f6;
    --wa-violet: #7457ff;
    --wa-amber: #f6a63a;
    --wa-danger: #de3d46;
}

[data-bs-theme="dark"] {
    --wa-bg: #0c1110;
    --wa-ink: #eefaf6;
    --wa-muted: #9fb3ad;
    --wa-glass: rgba(20, 28, 26, 0.72);
    --wa-glass-strong: rgba(21, 29, 27, 0.9);
    --wa-border: rgba(255, 255, 255, 0.11);
    --wa-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--wa-ink);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 8% 12%, rgba(10, 174, 92, 0.20), transparent 28%),
        radial-gradient(circle at 82% 10%, rgba(52, 120, 246, 0.18), transparent 30%),
        linear-gradient(135deg, #f9fffd 0%, var(--wa-bg) 48%, #eef2ff 100%);
    letter-spacing: 0;
}

[data-bs-theme="dark"] body {
    background:
        radial-gradient(circle at 8% 12%, rgba(10, 174, 92, 0.16), transparent 28%),
        radial-gradient(circle at 82% 10%, rgba(116, 87, 255, 0.16), transparent 30%),
        linear-gradient(135deg, #0b1110 0%, var(--wa-bg) 58%, #101326 100%);
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
    gap: 24px;
    padding: 20px;
}

.glass-sidebar,
.glass-header,
.glass-card {
    border: 1px solid var(--wa-border);
    background: var(--wa-glass);
    box-shadow: var(--wa-shadow);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.glass-sidebar {
    position: sticky;
    top: 20px;
    display: flex;
    min-height: calc(100vh - 40px);
    flex-direction: column;
    border-radius: 24px;
    padding: 18px;
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--wa-ink);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 16px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--wa-green), #08d784);
    box-shadow: 0 14px 34px rgba(10, 174, 92, 0.35);
}

.brand-name,
.brand-subtitle {
    display: block;
}

.brand-name {
    font-size: 0.98rem;
    font-weight: 800;
}

.brand-subtitle,
.eyebrow,
.metric-row span,
.metric-grid span {
    color: var(--wa-muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.sidebar-nav {
    display: grid;
    gap: 8px;
    margin-top: 34px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    border-radius: 16px;
    padding: 10px 12px;
    color: var(--wa-muted);
    font-weight: 700;
    text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link.active {
    color: var(--wa-ink);
    background: rgba(255, 255, 255, 0.58);
}

[data-bs-theme="dark"] .sidebar-link:hover,
[data-bs-theme="dark"] .sidebar-link.active {
    background: rgba(255, 255, 255, 0.08);
}

.nav-icon {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 8px;
    background: linear-gradient(135deg, rgba(10, 174, 92, 0.2), rgba(52, 120, 246, 0.18));
}

.nav-icon::after {
    position: absolute;
    inset: 6px;
    border: 2px solid currentColor;
    border-radius: 5px;
    content: "";
}

.sidebar-footer {
    margin-top: auto;
}

.tenant-pill {
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 16px;
    padding: 12px;
    color: var(--wa-muted);
    background: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    font-weight: 700;
}

.tenant-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--wa-green);
    box-shadow: 0 0 0 5px rgba(10, 174, 92, 0.16);
}

.app-main {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    gap: 24px;
}

.glass-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 24px;
    padding: 18px 22px;
}

.page-title {
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 800;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.header-user {
    max-width: 180px;
    overflow: hidden;
    color: var(--wa-muted);
    font-size: 0.84rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 0;
    border-radius: 14px;
    color: var(--wa-ink);
    background: rgba(255, 255, 255, 0.7);
}

[data-bs-theme="dark"] .icon-button {
    background: rgba(255, 255, 255, 0.1);
}

.moon-icon {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    box-shadow: inset -5px -4px 0 0 currentColor;
}

.app-content {
    display: grid;
    gap: 22px;
}

.foundation-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
    gap: 22px;
    align-items: stretch;
}

.hero-copy {
    min-height: 260px;
    border-radius: 28px;
    padding: clamp(26px, 5vw, 54px);
    color: #fff;
    background:
        linear-gradient(135deg, rgba(9, 70, 61, 0.96), rgba(12, 130, 95, 0.86)),
        radial-gradient(circle at 90% 15%, rgba(116, 87, 255, 0.5), transparent 34%);
    box-shadow: var(--wa-shadow);
}

.hero-copy h2 {
    max-width: 760px;
    margin: 18px 0 14px;
    font-size: clamp(2rem, 4vw, 4rem);
    font-weight: 800;
    line-height: 1.02;
}

.hero-copy p {
    max-width: 720px;
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
    line-height: 1.7;
}

.glass-card {
    border-radius: 24px;
    padding: 22px;
}

.hero-panel {
    display: grid;
    align-content: center;
    gap: 18px;
}

.status-badge,
.table-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 0.76rem;
    font-weight: 800;
}

.status-ok,
.table-status-ok {
    color: #03683a;
    background: rgba(10, 174, 92, 0.13);
}

.status-attention,
.table-status-warn {
    color: #9b3e00;
    background: rgba(246, 166, 58, 0.18);
}

.metric-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.metric-row strong {
    font-size: 2.3rem;
    font-weight: 800;
}

.glass-progress {
    height: 10px;
    border-radius: 999px;
    background: rgba(16, 32, 29, 0.08);
}

.progress-bar {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--wa-green), var(--wa-blue));
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.metric-grid > div {
    border-radius: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.54);
}

[data-bs-theme="dark"] .metric-grid > div {
    background: rgba(255, 255, 255, 0.08);
}

.metric-grid strong {
    display: block;
    margin-top: 6px;
    word-break: break-word;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
    gap: 22px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.section-heading h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 800;
}

.status-table {
    --bs-table-bg: rgba(255, 255, 255, 0.86);
    --bs-table-color: #132722;
    overflow: hidden;
    border-radius: 18px;
}

.status-table th {
    color: #55706a;
    font-size: 0.76rem;
    text-transform: uppercase;
}

.status-table td,
.status-table th {
    padding: 15px 16px;
}

.scope-list {
    display: grid;
    gap: 12px;
}

.scope-list div {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--wa-muted);
    font-weight: 650;
}

.scope-list span {
    width: 9px;
    height: 9px;
    flex: 0 0 9px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--wa-green), var(--wa-blue));
}

.ajax-panel {
    display: grid;
    gap: 12px;
    margin-top: 24px;
}

.ajax-result {
    color: var(--wa-muted);
    font-size: 0.86rem;
    font-weight: 650;
}

.error-card {
    max-width: 720px;
}

.error-card h2 {
    margin: 18px 0 12px;
    font-weight: 800;
}

.auth-body {
    min-height: 100vh;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 520px);
    min-height: 100vh;
    gap: 28px;
    padding: 22px;
}

.auth-visual {
    display: flex;
    min-height: calc(100vh - 44px);
    flex-direction: column;
    justify-content: space-between;
    border-radius: 30px;
    padding: clamp(28px, 5vw, 64px);
    color: #fff;
    background:
        linear-gradient(145deg, rgba(8, 66, 58, 0.96), rgba(10, 141, 100, 0.9)),
        radial-gradient(circle at 82% 18%, rgba(52, 120, 246, 0.54), transparent 34%),
        radial-gradient(circle at 28% 92%, rgba(246, 166, 58, 0.24), transparent 30%);
    box-shadow: var(--wa-shadow);
}

.auth-brand {
    color: #fff;
}

.auth-visual .brand-subtitle {
    color: rgba(255, 255, 255, 0.72);
}

.auth-visual h1 {
    max-width: 760px;
    margin: 18px 0 14px;
    font-size: clamp(2.2rem, 5vw, 5.4rem);
    font-weight: 800;
    line-height: 1;
}

.auth-visual p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    font-size: 1rem;
    line-height: 1.75;
}

.auth-card {
    align-self: center;
    width: 100%;
    padding: clamp(24px, 4vw, 38px);
}

.auth-card-heading h2 {
    margin: 0 0 24px;
    font-weight: 800;
}

.form-label {
    color: var(--wa-muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.form-control,
.form-select {
    border: 1px solid rgba(102, 123, 117, 0.24);
    border-radius: 14px;
    color: var(--wa-ink);
    background: rgba(255, 255, 255, 0.86);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(10, 174, 92, 0.7);
    box-shadow: 0 0 0 0.22rem rgba(10, 174, 92, 0.12);
}

.auth-switch {
    margin-top: 20px;
    color: var(--wa-muted);
    text-align: center;
    font-weight: 650;
}

.auth-switch a {
    color: var(--wa-green);
    font-weight: 800;
    text-decoration: none;
}

.dashboard-hero .hero-copy h2 {
    max-width: 900px;
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .brand-lockup span:not(.brand-mark),
    .sidebar-link span:not(.nav-icon),
    .tenant-pill span:last-child {
        display: none;
    }
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .glass-sidebar {
        position: static;
        min-height: auto;
    }

    .sidebar-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 18px;
    }

    .sidebar-link {
        justify-content: center;
    }

    .foundation-hero,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .glass-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: auto;
    }
}

@media (max-width: 560px) {
    .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hero-copy {
        min-height: auto;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* WAONPAD compact CRM interface */
body {
    background: #f4f8fb;
}

.app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 0;
    padding: 0;
    background: #f4f8fb;
}

.glass-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: 82px;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    padding: 10px 8px;
    background: linear-gradient(180deg, #003f3b 0%, #002f35 52%, #00252d 100%);
    box-shadow: 8px 0 24px rgba(0, 47, 53, 0.14);
}

.glass-sidebar .brand-lockup {
    justify-content: center;
    margin-bottom: 10px;
}

.glass-sidebar .brand-lockup > span:not(.brand-mark),
.glass-sidebar .sidebar-link > span:not(.nav-icon),
.glass-sidebar .tenant-pill,
.glass-sidebar .profile-meta {
    display: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: #05df72;
    background: rgba(0, 0, 0, 0.18);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}

.sidebar-nav {
    gap: 7px;
    margin-top: 8px;
}

.sidebar-link {
    justify-content: center;
    min-height: 48px;
    border-radius: 13px;
    padding: 7px;
    color: rgba(255, 255, 255, 0.72);
}

.sidebar-link:hover,
.sidebar-link.active {
    color: #fff;
    background: rgba(3, 176, 90, 0.22);
}

.nav-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: transparent;
    font-size: 1.05rem;
}

.nav-icon::after {
    display: none;
}

.sidebar-footer {
    display: grid;
    place-items: center;
}

.sidebar-profile {
    display: grid;
    place-items: center;
}

.profile-avatar {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, 0.34);
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #f48a8a, #895cff);
    font-size: 0.82rem;
    font-weight: 800;
}

.app-main {
    min-height: 100vh;
    margin-left: 82px;
    gap: 0;
}

.glass-header {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: 64px;
    border: 0;
    border-bottom: 1px solid #e8eef2;
    border-radius: 0;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: none;
}

.sidebar-toggle {
    display: none;
}

.page-title {
    font-size: 1.02rem;
    font-weight: 800;
}

.eyebrow {
    color: #64766f;
    font-size: 0.72rem;
}

.header-icon {
    position: relative;
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid #e6edf1;
    border-radius: 50%;
    color: #51615c;
    background: #fff;
    text-decoration: none;
}

.header-icon span {
    position: absolute;
    top: 5px;
    right: 6px;
    width: 7px;
    height: 7px;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #ef3340;
}

.icon-button {
    border: 1px solid #e6edf1;
    border-radius: 50%;
    background: #fff;
}

.app-content {
    gap: 16px;
    padding: 18px 22px 28px;
}

.glass-card {
    border: 1px solid #e8eef2;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(24, 49, 44, 0.05);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 92px;
    padding: 16px;
}

.metric-icon {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 14px;
    font-size: 1.25rem;
}

.metric-card p {
    margin: 0 0 4px;
    color: #65766f;
    font-size: 0.78rem;
    font-weight: 700;
}

.metric-card strong {
    display: block;
    color: #0e201c;
    font-size: 1.35rem;
    line-height: 1.05;
}

.metric-card small {
    color: #09a95a;
    font-size: 0.72rem;
    font-weight: 700;
}

.metric-green .metric-icon {
    color: #03a95b;
    background: #eaf9f1;
}

.metric-blue .metric-icon {
    color: #286cf0;
    background: #edf4ff;
}

.metric-orange .metric-icon {
    color: #f29a21;
    background: #fff5e8;
}

.metric-purple .metric-icon {
    color: #8d5cf6;
    background: #f3efff;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
}

.chart-card,
.channel-card,
.table-card,
.stack-card {
    padding: 18px;
}

.section-heading {
    margin-bottom: 14px;
}

.section-heading h3 {
    font-size: 0.98rem;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    color: #61736d;
    font-size: 0.76rem;
    font-weight: 700;
}

.legend-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 5px;
    border-radius: 50%;
}

.legend-dot.sent {
    background: #08ad5c;
}

.legend-dot.received {
    background: #3478f6;
}

.line-chart {
    position: relative;
    min-height: 255px;
    overflow: hidden;
}

.chart-grid-lines {
    position: absolute;
    inset: 10px 0 34px;
    background-image: linear-gradient(to bottom, #edf2f5 1px, transparent 1px);
    background-size: 100% 44px;
}

.line-chart svg {
    position: relative;
    width: 100%;
    height: 220px;
    overflow: visible;
}

.line {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sent-line {
    stroke: #09ac5d;
}

.received-line {
    stroke: #3478f6;
}

.chart-points circle {
    fill: #09ac5d;
    stroke: #fff;
    stroke-width: 3;
}

.chart-months {
    display: flex;
    justify-content: space-between;
    color: #83908c;
    font-size: 0.72rem;
    font-weight: 650;
}

.mini-link {
    color: #08a858;
    font-size: 0.76rem;
    font-weight: 800;
    text-decoration: none;
}

.channel-list {
    display: grid;
    gap: 13px;
}

.channel-list > div {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
}

.channel-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
}

.channel-list strong {
    color: #1b2b27;
    font-size: 0.84rem;
}

.channel-list em {
    color: #4d5e59;
    font-style: normal;
    font-size: 0.8rem;
    font-weight: 800;
}

.website { color: #286cf0; background: #edf4ff; }
.facebook { color: #1877f2; background: #ecf4ff; }
.whatsapp { color: #07a85b; background: #eaf9f1; }
.instagram { color: #c13584; background: #fff0f7; }
.api { color: #7b61ff; background: #f2efff; }

.chat-list,
.campaign-list {
    display: grid;
    gap: 2px;
}

.chat-row,
.campaign-row {
    display: grid;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    border-bottom: 1px solid #eff3f5;
}

.chat-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
}

.campaign-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
}

.chat-row:last-child,
.campaign-row:last-child {
    border-bottom: 0;
}

.chat-avatar,
.campaign-row > span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    color: #099b54;
    background: #eaf9f1;
    font-size: 0.78rem;
    font-weight: 800;
}

.chat-row strong,
.campaign-row strong {
    display: block;
    color: #162622;
    font-size: 0.84rem;
}

.chat-row p,
.campaign-row p {
    max-width: 100%;
    margin: 3px 0 0;
    overflow: hidden;
    color: #74827e;
    font-size: 0.76rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-row time {
    color: #74827e;
    font-size: 0.72rem;
    font-weight: 700;
}

.campaign-row em {
    border-radius: 999px;
    padding: 5px 9px;
    color: #087a44;
    background: #e8f8ef;
    font-style: normal;
    font-size: 0.7rem;
    font-weight: 800;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.quick-action {
    display: grid;
    min-height: 92px;
    place-items: center;
    border: 1px solid #e8eef2;
    border-radius: 10px;
    color: #0c9e56;
    text-align: center;
    text-decoration: none;
    font-size: 0.76rem;
    font-weight: 800;
}

.quick-action i {
    font-size: 1.35rem;
}

.tenant-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
}

.tenant-strip h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.tenant-strip span,
.tenant-strip strong {
    display: block;
    text-align: right;
}

.tenant-strip span {
    color: #65766f;
    font-size: 0.78rem;
    font-weight: 700;
}

.tenant-strip strong {
    color: #0f211d;
    text-transform: capitalize;
}

.auth-shell {
    grid-template-columns: 420px minmax(360px, 520px);
    justify-content: center;
    align-items: stretch;
    gap: 0;
    padding: 18px;
    background: #f4f8fb;
}

.auth-visual {
    min-height: calc(100vh - 36px);
    border-radius: 16px 0 0 16px;
    padding: 34px;
    background:
        radial-gradient(circle at 68% 60%, rgba(7, 223, 115, 0.20), transparent 32%),
        linear-gradient(180deg, #00453f 0%, #00353c 55%, #002b35 100%);
}

.auth-copy h1 {
    max-width: 330px;
    font-size: 1.45rem;
    line-height: 1.3;
}

.auth-copy p {
    max-width: 320px;
    font-size: 0.88rem;
    line-height: 1.65;
}

.auth-product-card {
    position: relative;
    width: min(100%, 310px);
    min-height: 210px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 20px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

.mini-window {
    display: flex;
    gap: 6px;
    margin-bottom: 24px;
}

.mini-window span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
}

.mini-chat {
    height: 34px;
    margin-bottom: 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
}

.mini-chat.outgoing {
    width: 70%;
    margin-left: auto;
    background: #d9ffd9;
}

.mini-chat.short {
    width: 62%;
}

.mini-whatsapp {
    position: absolute;
    right: 18px;
    bottom: 18px;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 4px solid #eafff0;
    border-radius: 50%;
    color: #fff;
    background: #08bf61;
    font-size: 1.5rem;
}

.auth-card {
    align-self: center;
    border-radius: 0 16px 16px 0;
    box-shadow: 0 24px 80px rgba(10, 40, 38, 0.08);
}

.auth-card-heading h2 {
    font-size: 1.35rem;
}

.form-control,
.form-select {
    min-height: 46px;
    border-radius: 9px;
    font-size: 0.92rem;
}

.btn-success {
    --bs-btn-bg: #079b52;
    --bs-btn-border-color: #079b52;
    --bs-btn-hover-bg: #058546;
    --bs-btn-hover-border-color: #058546;
}

@media (max-width: 1120px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-main-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .glass-sidebar {
        position: static;
        width: auto;
        min-height: auto;
        border-radius: 0;
    }

    .glass-sidebar .brand-lockup > span:not(.brand-mark),
    .glass-sidebar .sidebar-link > span:not(.nav-icon) {
        display: block;
    }

    .sidebar-nav {
        grid-template-columns: repeat(5, minmax(64px, 1fr));
        overflow-x: auto;
    }

    .sidebar-link {
        min-width: 64px;
        flex-direction: column;
        gap: 3px;
        font-size: 0.68rem;
    }

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

    .auth-shell {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .auth-visual,
    .auth-card {
        border-radius: 16px;
    }

    .auth-visual {
        min-height: auto;
    }
}

@media (max-width: 580px) {
    .dashboard-grid,
    .quick-actions {
        grid-template-columns: 1fr;
    }

    .app-content {
        padding: 14px;
    }

    .glass-header {
        padding: 12px 14px;
    }

    .tenant-strip {
        align-items: stretch;
        flex-direction: column;
    }

    .tenant-strip span,
    .tenant-strip strong {
        text-align: left;
    }
}

/* Dashboard layout rescue: full-width app shell with readable cards */
html,
body {
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

body:not(.auth-body) .app-shell {
    display: block;
    width: 100%;
    min-height: 100vh;
    padding: 0;
}

body:not(.auth-body) .glass-sidebar {
    position: fixed;
    top: 0;
    right: auto;
    bottom: 0;
    left: 0;
    width: 82px;
}

/* Labeled sidebar variant */
body:not(.auth-body) .glass-sidebar {
    width: 156px;
    padding: 10px 10px;
}

body:not(.auth-body) .glass-sidebar .brand-lockup {
    justify-content: flex-start;
    padding: 0 8px;
}

body:not(.auth-body) .glass-sidebar .brand-lockup > span:not(.brand-mark),
body:not(.auth-body) .glass-sidebar .sidebar-link > span:not(.nav-icon),
body:not(.auth-body) .glass-sidebar .profile-meta {
    display: block;
}

body:not(.auth-body) .glass-sidebar .brand-name {
    color: #fff;
    font-size: 0.82rem;
}

body:not(.auth-body) .glass-sidebar .brand-subtitle {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.68rem;
}

body:not(.auth-body) .sidebar-link {
    justify-content: flex-start;
    min-height: 42px;
    gap: 9px;
    padding: 7px 9px;
    border-radius: 12px;
    font-size: 0.74rem;
    line-height: 1;
}

body:not(.auth-body) .sidebar-link .nav-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    font-size: 1.45rem;
}

body:not(.auth-body) .sidebar-link > span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body:not(.auth-body) .sidebar-profile {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
}

body:not(.auth-body) .profile-avatar {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
}

body:not(.auth-body) .profile-meta {
    min-width: 0;
}

body:not(.auth-body) .profile-meta strong,
body:not(.auth-body) .profile-meta small {
    display: block;
    overflow: hidden;
    color: #fff;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body:not(.auth-body) .profile-meta strong {
    font-size: 0.72rem;
}

body:not(.auth-body) .profile-meta small {
    color: rgba(255, 255, 255, 0.58);
    font-size: 0.64rem;
    text-transform: capitalize;
}

body:not(.auth-body) .app-main {
    width: calc(100vw - 156px);
    margin-left: 156px;
}

body:not(.auth-body) .app-main {
    display: flex;
    width: calc(100vw - 82px);
    min-width: 0;
    min-height: 100vh;
    margin-left: 82px;
    flex-direction: column;
}

body:not(.auth-body) .glass-header {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 14px;
}

body:not(.auth-body) .glass-header > div:first-of-type {
    min-width: 0;
}

body:not(.auth-body) .page-title,
body:not(.auth-body) .eyebrow {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body:not(.auth-body) .header-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
}

body:not(.auth-body) .header-actions .btn-light {
    display: none;
}

body:not(.auth-body) .app-content {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 18px 24px 28px;
}

body:not(.auth-body) .app-content > * + * {
    margin-top: 16px;
}

body:not(.auth-body) .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    width: 100%;
    gap: 14px;
}

body:not(.auth-body) .metric-card {
    min-width: 0;
    min-height: 88px;
    overflow: hidden;
}

body:not(.auth-body) .metric-card > div {
    min-width: 0;
}

body:not(.auth-body) .metric-card p,
body:not(.auth-body) .metric-card strong,
body:not(.auth-body) .metric-card small {
    overflow: hidden;
    text-overflow: ellipsis;
}

body:not(.auth-body) .metric-card small {
    display: block;
    white-space: nowrap;
}

body:not(.auth-body) .dashboard-main-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
    width: 100%;
    gap: 14px;
}

body:not(.auth-body) .content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.68fr);
    width: 100%;
    gap: 14px;
}

body:not(.auth-body) .chart-card,
body:not(.auth-body) .channel-card,
body:not(.auth-body) .table-card,
body:not(.auth-body) .stack-card,
body:not(.auth-body) .tenant-strip {
    min-width: 0;
}

body:not(.auth-body) .line-chart svg {
    min-width: 520px;
}

@media (max-width: 1180px) {
    body:not(.auth-body) .dashboard-main-grid,
    body:not(.auth-body) .content-grid {
        grid-template-columns: 1fr;
    }

    body:not(.auth-body) .line-chart {
        overflow-x: auto;
    }
}

@media (max-width: 760px) {
    body:not(.auth-body) .glass-sidebar {
        position: static;
        width: 100%;
        min-height: auto;
    }

    body:not(.auth-body) .app-main {
        width: 100%;
        margin-left: 0;
    }

    body:not(.auth-body) .glass-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    body:not(.auth-body) .sidebar-toggle {
        display: none;
    }

    body:not(.auth-body) .header-user {
        display: none;
    }

    body:not(.auth-body) .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive sidebar/content contract */
:root {
    --wa-sidebar-width: 196px;
}

body:not(.auth-body) .glass-sidebar {
    width: var(--wa-sidebar-width);
    max-width: var(--wa-sidebar-width);
    overflow-x: hidden;
}

body:not(.auth-body) .app-main {
    width: calc(100% - var(--wa-sidebar-width));
    margin-left: var(--wa-sidebar-width);
}

body:not(.auth-body) .glass-header,
body:not(.auth-body) .app-content {
    width: 100%;
    max-width: 100%;
}

body:not(.auth-body) .glass-header {
    padding-left: 28px;
    padding-right: 28px;
}

body:not(.auth-body) .app-content {
    padding-left: 28px;
    padding-right: 28px;
}

body:not(.auth-body) .dashboard-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

body:not(.auth-body) .metric-card {
    min-height: 96px;
}

body:not(.auth-body) .dashboard-main-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
}

body:not(.auth-body) .content-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
}

@media (max-width: 1199px) {
    :root {
        --wa-sidebar-width: 88px;
    }

    body:not(.auth-body) .glass-sidebar {
        padding: 10px 8px;
    }

    body:not(.auth-body) .glass-sidebar .brand-lockup {
        justify-content: center;
        padding: 0;
    }

    body:not(.auth-body) .glass-sidebar .brand-lockup > span:not(.brand-mark),
    body:not(.auth-body) .glass-sidebar .sidebar-link > span:not(.nav-icon),
    body:not(.auth-body) .glass-sidebar .profile-meta,
    body:not(.auth-body) .glass-sidebar .tenant-pill {
        display: none;
    }

    body:not(.auth-body) .sidebar-link {
        justify-content: center;
        min-height: 48px;
        padding: 7px;
    }

    body:not(.auth-body) .sidebar-link .nav-icon {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }

    body:not(.auth-body) .sidebar-profile {
        justify-content: center;
        padding: 0;
        background: transparent;
    }

    body:not(.auth-body) .dashboard-main-grid,
    body:not(.auth-body) .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    body:not(.auth-body) .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body:not(.auth-body) .glass-header {
        grid-template-columns: minmax(0, 1fr) auto;
        padding-left: 20px;
        padding-right: 20px;
    }

    body:not(.auth-body) .app-content {
        padding-left: 20px;
        padding-right: 20px;
    }

    body:not(.auth-body) .glass-header .sidebar-toggle {
        display: none;
    }

    body:not(.auth-body) .header-actions {
        gap: 8px;
    }
}

@media (max-width: 760px) {
    :root {
        --wa-sidebar-width: 0px;
    }

    body:not(.auth-body) .glass-sidebar {
        position: static;
        width: 100%;
        max-width: 100%;
        min-height: auto;
        padding: 10px 12px 12px;
    }

    body:not(.auth-body) .glass-sidebar .brand-lockup {
        justify-content: flex-start;
        margin-bottom: 8px;
    }

    body:not(.auth-body) .glass-sidebar .brand-lockup > span:not(.brand-mark) {
        display: block;
    }

    body:not(.auth-body) .glass-sidebar .brand-subtitle {
        display: block;
    }

    body:not(.auth-body) .sidebar-nav {
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 8px;
        margin-top: 0;
        overflow: visible;
        padding-bottom: 2px;
    }

    body:not(.auth-body) .sidebar-link {
        min-width: 0;
        min-height: 62px;
        flex-direction: column;
        justify-content: center;
        gap: 4px;
        font-size: 0.68rem;
        padding: 7px 4px;
    }

    body:not(.auth-body) .glass-sidebar .sidebar-link > span:not(.nav-icon) {
        display: block;
        max-width: 100%;
        font-size: 0.66rem;
        line-height: 1.1;
        text-align: center;
    }

    body:not(.auth-body) .sidebar-footer {
        display: none;
    }

    body:not(.auth-body) .app-main {
        width: 100%;
        margin-left: 0;
    }

    body:not(.auth-body) .glass-header {
        position: static;
        border-bottom: 1px solid #e8eef2;
    }
}

@media (max-width: 620px) {
    body:not(.auth-body) .dashboard-grid {
        grid-template-columns: 1fr;
    }

    body:not(.auth-body) .glass-header {
        align-items: flex-start;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    body:not(.auth-body) .header-actions {
        justify-content: flex-start;
        width: 100%;
    }

    body:not(.auth-body) .chart-legend {
        align-items: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 520px) {
    body:not(.auth-body) .glass-sidebar {
        padding: 10px;
    }

    body:not(.auth-body) .glass-sidebar .brand-lockup {
        margin-bottom: 10px;
    }

    body:not(.auth-body) .brand-mark {
        width: 38px;
        height: 38px;
    }

    body:not(.auth-body) .sidebar-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 7px;
    }

    body:not(.auth-body) .sidebar-link {
        min-height: 58px;
        border-radius: 11px;
    }

    body:not(.auth-body) .sidebar-link .nav-icon {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
        font-size: 0.9rem;
    }

    body:not(.auth-body) .glass-header {
        padding: 14px 18px;
    }

    body:not(.auth-body) .header-actions {
        gap: 8px;
    }

    body:not(.auth-body) .header-actions .icon-button,
    body:not(.auth-body) .header-actions .header-icon {
        width: 38px;
        height: 38px;
    }

    body:not(.auth-body) .app-content {
        padding: 14px 18px 24px;
    }

    body:not(.auth-body) .metric-card {
        min-height: 108px;
        padding: 20px;
    }
}

@media (max-width: 390px) {
    body:not(.auth-body) .sidebar-nav {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* Mobile drawer menu */
.sidebar-backdrop {
    display: none;
}

@media (max-width: 760px) {
    body:not(.auth-body) .glass-header .sidebar-toggle {
        display: grid !important;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        border-color: #dfe9ee;
        color: #0b2a28;
        background: #fff;
    }

    body:not(.auth-body) .glass-header {
        position: sticky;
        top: 0;
        z-index: 25;
        grid-template-columns: 42px minmax(0, 1fr) auto;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    body:not(.auth-body) .glass-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: 40;
        width: min(86vw, 320px);
        max-width: min(86vw, 320px);
        min-height: 100vh;
        overflow-y: auto;
        padding: 16px;
        transform: translateX(-105%);
        transition: transform 180ms ease;
        box-shadow: 18px 0 48px rgba(0, 25, 30, 0.28);
    }

    body.sidebar-open:not(.auth-body) .glass-sidebar {
        transform: translateX(0);
    }

    body:not(.auth-body) .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: block;
        border: 0;
        padding: 0;
        pointer-events: none;
        background: rgba(0, 22, 24, 0);
        opacity: 0;
        transition: opacity 180ms ease, background 180ms ease;
    }

    body.sidebar-open:not(.auth-body) .sidebar-backdrop {
        pointer-events: auto;
        background: rgba(0, 22, 24, 0.46);
        opacity: 1;
    }

    body.sidebar-open:not(.auth-body) {
        overflow: hidden;
    }

    body:not(.auth-body) .glass-sidebar .brand-lockup {
        margin-bottom: 18px;
    }

    body:not(.auth-body) .sidebar-nav {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    body:not(.auth-body) .sidebar-link {
        min-height: 46px;
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    body:not(.auth-body) .glass-sidebar .sidebar-link > span:not(.nav-icon) {
        max-width: 100%;
        font-size: 0.82rem;
        text-align: left;
    }

    body:not(.auth-body) .sidebar-footer {
        display: grid;
        margin-top: 18px;
    }

    body:not(.auth-body) .glass-sidebar .profile-meta {
        display: block;
    }

    body:not(.auth-body) .app-main {
        width: 100%;
        margin-left: 0;
    }
}

.hamburger-lines,
.hamburger-lines::before,
.hamburger-lines::after {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
}

.hamburger-lines {
    position: relative;
}

.hamburger-lines::before,
.hamburger-lines::after {
    position: absolute;
    left: 0;
}

.hamburger-lines::before {
    top: -6px;
}

.hamburger-lines::after {
    top: 6px;
}

@media (min-width: 761px) {
    body:not(.auth-body) .glass-header .sidebar-toggle {
        display: none !important;
    }
}

/* Team module */
.team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 22px;
}

.team-header h2 {
    margin: 0 0 6px;
    font-size: 1.25rem;
    font-weight: 800;
}

.team-header p:last-child {
    margin: 0;
    color: #697a74;
    font-size: 0.88rem;
}

.team-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
    gap: 14px;
}

.team-table .member-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 180px;
}

.team-table .form-select {
    min-width: 145px;
}

.invite-list {
    display: grid;
    gap: 10px;
}

.invite-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid #edf2f4;
    border-radius: 10px;
    padding: 12px;
}

.invite-row strong {
    display: block;
    color: #10201d;
    font-size: 0.86rem;
}

.invite-row p,
.empty-note {
    margin: 3px 0 0;
    color: #71827d;
    font-size: 0.76rem;
    font-weight: 650;
}

.icon-button.tiny {
    width: 32px;
    height: 32px;
    font-size: 0.82rem;
}

.permission-card {
    padding: 18px;
}

.permission-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.permission-pills span {
    border-radius: 999px;
    padding: 7px 11px;
    color: #087a44;
    background: #e8f8ef;
    font-size: 0.74rem;
    font-weight: 800;
}

.glass-modal {
    border: 1px solid #e8eef2;
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(10, 40, 38, 0.16);
}

[data-invite-url] code {
    display: block;
    margin-top: 6px;
    white-space: normal;
    word-break: break-all;
}

@media (max-width: 1100px) {
    .team-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .team-header {
        align-items: stretch;
        flex-direction: column;
    }

    .team-table {
        min-width: 760px;
    }
}

/* Contacts module */
.contacts-card {
    padding: 18px;
}

.contact-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.contact-header-actions .btn {
    min-height: 42px;
    border-radius: 12px;
}

.contact-filters {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 180px 180px auto;
    gap: 10px;
    margin-bottom: 16px;
}

.search-field {
    position: relative;
}

.search-field i {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 1;
    color: #6d7d78;
    transform: translateY(-50%);
}

.search-field .form-control {
    padding-left: 40px;
}

.contacts-table {
    min-width: 880px;
}

.select-column {
    width: 42px;
    min-width: 42px;
    text-align: center;
}

.contacts-table .form-check-input {
    border-color: #cfdbe3;
    box-shadow: none;
}

.contacts-table .form-check-input:checked {
    border-color: #0aae5c;
    background-color: #0aae5c;
}

.bulk-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid rgba(10, 174, 92, 0.18);
    border-radius: 14px;
    margin-bottom: 14px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(10, 174, 92, 0.11), rgba(255, 255, 255, 0.82));
}

.bulk-selected-count {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    color: #047342;
    background: rgba(10, 174, 92, 0.12);
    font-size: 0.78rem;
    font-weight: 900;
}

.bulk-selected-hint {
    margin-left: 8px;
    color: #667772;
    font-size: 0.8rem;
    font-weight: 700;
}

.bulk-select-all-matching {
    border: 0;
    margin-left: 8px;
    padding: 0;
    color: #079b52;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.bulk-action-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-input-group {
    display: grid;
    grid-template-columns: minmax(190px, 0.58fr) minmax(0, 1fr);
    gap: 8px;
}

.country-code-select {
    min-width: 0;
    font-weight: 800;
}

.import-modal .modal-body {
    padding: 22px 24px;
}

.import-modal-header {
    align-items: flex-start;
    border-bottom: 1px solid #edf2f4;
    padding: 24px;
}

.import-modal-header p {
    margin: 4px 0 0;
    color: #667772;
    font-size: 0.9rem;
    font-weight: 650;
}

.import-upload-layout {
    display: grid;
    grid-template-columns: minmax(280px, 0.95fr) minmax(260px, 1fr);
    gap: 20px;
}

.import-dropzone {
    display: grid;
    min-height: 340px;
    place-items: center;
    border: 2px dashed #dbe5ec;
    border-radius: 22px;
    padding: 34px 22px;
    text-align: center;
    background:
        radial-gradient(circle at 50% 0%, rgba(10, 174, 92, 0.1), transparent 36%),
        rgba(255, 255, 255, 0.72);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.import-dropzone.is-dragging {
    border-color: #0aae5c;
    box-shadow: 0 18px 45px rgba(10, 174, 92, 0.16);
    transform: translateY(-1px);
}

.import-drop-icon {
    display: grid;
    width: 78px;
    height: 78px;
    place-items: center;
    border-radius: 24px;
    color: #079b52;
    background: rgba(10, 174, 92, 0.11);
    font-size: 2.65rem;
}

.import-dropzone h6 {
    margin: 16px 0 0;
    color: #14231f;
    font-size: 1.05rem;
    font-weight: 850;
}

.import-dropzone p {
    margin: 8px 0;
    color: #758680;
    font-weight: 750;
}

.import-dropzone small {
    margin-top: 14px;
    color: #7b8985;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.55;
}

.import-file-name {
    max-width: 100%;
    margin-top: 14px;
    overflow: hidden;
    color: #075e35;
    font-size: 0.86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-preview-button {
    display: block;
    min-width: 190px;
    margin: 18px auto 0;
    border-radius: 13px;
    padding: 12px 20px;
}

.import-guidelines {
    border: 1px solid #e7edf2;
    border-radius: 18px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.8);
}

.import-guidelines h6 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    color: #1a2925;
    font-weight: 850;
}

.import-guidelines ol {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 18px;
    color: #50615d;
    font-size: 0.84rem;
    font-weight: 700;
}

.import-help-card {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 16px;
    margin-top: 24px;
    padding: 16px;
    color: #096f41;
    background: linear-gradient(135deg, rgba(10, 174, 92, 0.13), rgba(10, 174, 92, 0.06));
    text-decoration: none;
}

.import-help-card i {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.75);
}

.import-help-card strong,
.import-help-card small {
    display: block;
}

.import-help-card small {
    color: #079b52;
    font-weight: 850;
}

.import-upload-footer,
.import-map-footer {
    border-top: 1px solid #edf2f4;
    padding: 18px 24px;
}

.import-map-footer {
    align-items: center;
    justify-content: space-between;
}

.import-map-status,
.import-footer-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.import-map-status span {
    color: #60706b;
    font-size: 0.84rem;
    font-weight: 800;
}

.import-map-toolbar {
    display: grid;
    grid-template-columns: minmax(220px, 0.42fr) minmax(0, 1fr);
    gap: 22px;
    border-bottom: 1px solid #edf2f4;
    padding-bottom: 20px;
}

.import-file-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #e7edf2;
    border-radius: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.78);
}

.import-file-card > span {
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: #0aae5c;
    font-weight: 900;
}

.import-file-card strong,
.import-file-card small {
    display: block;
}

.import-file-card small {
    color: #6c7d78;
    font-weight: 750;
}

.import-map-controls {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 0.8fr) auto;
    gap: 14px;
    align-items: end;
}

.import-map-controls label {
    display: grid;
    gap: 6px;
}

.import-map-controls label span {
    color: #667772;
    font-size: 0.77rem;
    font-weight: 850;
}

.import-map-table-wrap {
    border: 1px solid #e8eef2;
    border-radius: 16px;
    margin-top: 22px;
    max-height: 58vh;
    background: #fff;
}

.import-map-table {
    min-width: 900px;
}

.import-map-table th {
    padding: 18px 16px;
    color: #172620;
    background: #fbfcfd;
    font-size: 0.82rem;
    font-weight: 850;
}

.import-map-table td {
    border-top: 1px solid #edf2f4;
    padding: 14px 16px;
    vertical-align: middle;
}

.import-map-table .form-select {
    min-width: 260px;
}

.import-preview-value {
    max-width: 240px;
    overflow: hidden;
    color: #566862;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-arrow {
    width: 42px;
    color: #0aae5c;
    text-align: center;
}

.required-ok,
.required-empty {
    display: inline-grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 50%;
    font-size: 1rem;
}

.required-ok {
    color: #0aae5c;
    background: rgba(10, 174, 92, 0.1);
}

.required-empty {
    color: #99a7a3;
    background: #f3f6f8;
}

.import-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    border-top: 1px solid #eef3f6;
    margin-top: 20px;
    padding-top: 18px;
}

.import-section-heading.compact {
    margin-top: 8px;
}

.import-section-heading span {
    color: #0aae5c;
    font-size: 0.72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.import-section-heading h6 {
    margin: 2px 0 0;
    font-size: 1rem;
    font-weight: 850;
}

.import-section-heading p {
    margin: 0;
    color: #72817c;
    font-size: 0.82rem;
    font-weight: 700;
}

.mapping-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(130px, 1fr));
    gap: 12px;
    padding: 16px 0;
}

.import-default-country {
    display: grid;
    grid-template-columns: minmax(240px, 0.42fr);
    gap: 8px;
    padding-top: 14px;
}

.import-preview-table-wrap {
    border: 1px solid #edf2f4;
    border-radius: 16px;
    max-height: 320px;
}

.import-preview-table {
    min-width: 780px;
}

.import-result {
    border: 1px solid rgba(10, 174, 92, 0.2);
    border-radius: 14px;
    margin-top: 14px;
    padding: 12px 14px;
    color: #076c3d;
    background: rgba(10, 174, 92, 0.08);
    font-weight: 700;
}

.contact-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.contact-tags span {
    border-radius: 999px;
    padding: 4px 8px;
    color: var(--tag-color);
    background: color-mix(in srgb, var(--tag-color) 12%, #fff);
    font-size: 0.68rem;
    font-weight: 800;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pagination-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid #edf2f4;
    padding-top: 14px;
    color: #6e7e79;
    font-size: 0.78rem;
    font-weight: 700;
}

.pagination-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.pagination-actions a,
.pagination-actions span {
    display: grid;
    min-width: 32px;
    height: 32px;
    place-items: center;
    padding: 0 10px;
    border: 1px solid #e6edf1;
    border-radius: 9px;
    color: #445651;
    background: #fff;
    font-size: 0.82rem;
    font-weight: 850;
    text-decoration: none;
}

.pagination-actions span {
    min-width: 28px;
    border-color: transparent;
    background: transparent;
    padding: 0 4px;
}

.pagination-actions a.active {
    border-color: #079b52;
    color: #fff;
    background: #079b52;
}

.pagination-actions a.disabled {
    pointer-events: none;
    opacity: 0.45;
}

@media (max-width: 980px) {
    .contact-filters {
        grid-template-columns: 1fr 1fr;
    }

    .mapping-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .import-default-country {
        grid-template-columns: 1fr;
    }

    .import-upload-layout,
    .import-map-toolbar,
    .import-map-controls {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .contact-header-actions {
        justify-content: stretch;
    }

    .contact-header-actions .btn {
        flex: 1 1 100%;
    }

    .contact-filters {
        grid-template-columns: 1fr;
    }

    .pagination-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .bulk-action-bar,
    .bulk-action-buttons {
        align-items: stretch;
        flex-direction: column;
    }

    .bulk-action-buttons .btn {
        width: 100%;
    }

    .phone-input-group,
    .mapping-grid {
        grid-template-columns: 1fr;
    }

    .import-dropzone {
        min-height: 280px;
        padding: 28px 16px;
    }

    .import-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .import-map-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .import-footer-actions,
    .import-footer-actions .btn {
        width: 100%;
    }
}

/* Shared inbox */
.inbox-metrics {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.inbox-shell {
    display: grid;
    grid-template-columns: minmax(300px, 0.35fr) minmax(0, 1fr);
    min-height: 680px;
    overflow: hidden;
    padding: 0;
}

.inbox-list-pane {
    border-right: 1px solid #e7edf2;
    min-width: 0;
    padding: 18px;
}

.inbox-filters {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.conversation-list {
    display: grid;
    gap: 8px;
    max-height: 590px;
    overflow: auto;
    padding-right: 4px;
}

.conversation-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 12px;
    text-align: left;
    background: transparent;
}

.conversation-item.active,
.conversation-item:hover {
    border-color: #dfe9ef;
    background: rgba(255, 255, 255, 0.8);
}

.conversation-copy {
    display: grid;
    min-width: 0;
}

.conversation-copy strong,
.conversation-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-copy strong {
    font-size: 0.9rem;
    font-weight: 850;
}

.conversation-copy small,
.conversation-meta em {
    color: #6b7c77;
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 700;
}

.conversation-meta {
    display: grid;
    justify-items: end;
    gap: 4px;
}

.conversation-meta b {
    display: grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 999px;
    color: #fff;
    background: #0aae5c;
    font-size: 0.7rem;
}

.inbox-thread-pane {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
}

.thread-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #e7edf2;
    padding: 18px 20px;
}

.thread-person {
    display: flex;
    align-items: center;
    gap: 12px;
}

.thread-person h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 900;
}

.thread-person p {
    margin: 2px 0 0;
    color: #6d7d78;
    font-size: 0.82rem;
    font-weight: 700;
}

.thread-status-form {
    min-width: 150px;
}

.message-timeline {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow: auto;
    padding: 20px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
        radial-gradient(circle at 20% 20%, rgba(10, 174, 92, 0.08), transparent 38%);
}

.message-bubble {
    max-width: min(620px, 82%);
    border: 1px solid #e7edf2;
    border-radius: 16px;
    padding: 12px 14px;
    background: #fff;
}

.message-bubble.internal {
    align-self: center;
    border-color: rgba(10, 174, 92, 0.18);
    background: rgba(10, 174, 92, 0.08);
}

.message-bubble.inbound {
    align-self: flex-start;
}

.message-bubble.outbound {
    align-self: flex-end;
    color: #063a24;
    background: rgba(10, 174, 92, 0.14);
}

.message-bubble p {
    margin: 0;
    color: #172620;
    font-weight: 650;
}

.message-bubble footer {
    margin-top: 7px;
    color: #768681;
    font-size: 0.72rem;
    font-weight: 700;
}

.note-composer {
    border-top: 1px solid #e7edf2;
    padding: 16px 18px;
}

.whatsapp-composer {
    background: rgba(10, 174, 92, 0.04);
}

.internal-note-composer {
    background: #fff;
}

.note-composer textarea {
    margin-bottom: 10px;
    resize: vertical;
}

.inbox-empty-thread,
.empty-state.compact {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 240px;
    padding: 32px;
    color: #6d7d78;
    text-align: center;
}

.inbox-empty-thread i,
.empty-state.compact i {
    color: #0aae5c;
    font-size: 2rem;
}

.inbox-empty-thread h3,
.empty-state.compact strong {
    margin: 8px 0 0;
    color: #172620;
    font-weight: 900;
}

@media (max-width: 980px) {
    .inbox-shell {
        grid-template-columns: 1fr;
    }

    .inbox-list-pane {
        border-right: 0;
        border-bottom: 1px solid #e7edf2;
    }

    .conversation-list {
        max-height: 320px;
    }
}

/* WhatsApp Cloud API settings */
.whatsapp-settings-grid {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 7px 11px;
    color: #6b7c77;
    background: #f2f5f7;
    font-size: 0.75rem;
    font-weight: 900;
}

.status-pill.success {
    color: #047342;
    background: rgba(10, 174, 92, 0.12);
}

.saved-secret {
    display: inline-flex;
    margin-left: 6px;
    border-radius: 999px;
    padding: 2px 7px;
    color: #087a44;
    background: #e8f8ef;
    font-size: 0.68rem;
    font-weight: 900;
    vertical-align: middle;
}

.webhook-copy-box {
    border: 1px solid #e7edf2;
    border-radius: 16px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.74);
}

.webhook-copy-box .form-control {
    font-size: 0.82rem;
}

.setup-list {
    display: grid;
    gap: 12px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.setup-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #60736d;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.5;
}

.setup-list i {
    color: #0aae5c;
    flex: 0 0 auto;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 980px) {
    .whatsapp-settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .form-actions,
    .form-actions .btn {
        width: 100%;
    }
}

/* Templates module */
.template-metrics {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.templates-card {
    overflow: hidden;
}

.template-filters {
    grid-template-columns: minmax(260px, 1fr) 180px 190px auto;
}

.templates-table {
    min-width: 980px;
}

.templates-table strong {
    color: #10201d;
    font-weight: 900;
}

.template-body-cell {
    max-width: 340px;
    color: #536560;
    font-size: 0.84rem;
    font-weight: 650;
}

.template-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.72rem;
    font-weight: 900;
}

.template-status.success {
    color: #047342;
    background: rgba(10, 174, 92, 0.12);
}

.template-status.warning {
    color: #9b5b00;
    background: rgba(246, 166, 58, 0.18);
}

.template-status.danger {
    color: #a91522;
    background: rgba(222, 61, 70, 0.12);
}

.template-status.draft {
    color: #35546f;
    background: #edf4ff;
}

.template-status.muted {
    color: #687873;
    background: #f2f5f7;
}

.modal-subtitle {
    color: #6e7f79;
    font-size: 0.84rem;
    font-weight: 650;
}

.template-button-builder {
    border: 1px solid #e8eef2;
    border-radius: 16px;
    padding: 16px;
    background: #fbfcfd;
}

.template-button-list {
    display: grid;
    gap: 10px;
}

.template-button-row {
    display: grid;
    grid-template-columns: 150px minmax(150px, 1fr) minmax(180px, 1fr) minmax(150px, 0.8fr) 34px;
    align-items: center;
    gap: 8px;
}

.template-preview {
    position: sticky;
    top: 88px;
    border: 1px solid #e8eef2;
    border-radius: 20px;
    padding: 18px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
        radial-gradient(circle at 20% 20%, rgba(10, 174, 92, 0.08), transparent 38%);
}

.template-preview-label {
    display: block;
    margin-bottom: 12px;
    color: #61736d;
    font-size: 0.78rem;
    font-weight: 900;
}

.template-phone {
    display: grid;
    gap: 8px;
    border: 1px solid #dfe8ee;
    border-radius: 24px;
    min-height: 380px;
    padding: 20px;
    background: #eef5f1;
}

.template-bubble {
    align-self: start;
    border-radius: 18px 18px 18px 6px;
    padding: 12px 14px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(23, 43, 38, 0.08);
}

.template-bubble strong,
.template-bubble p,
.template-bubble small {
    display: block;
}

.template-bubble strong {
    margin-bottom: 7px;
    color: #10201d;
    font-size: 0.88rem;
    font-weight: 900;
}

.template-bubble p {
    margin: 0;
    white-space: pre-wrap;
    color: #253530;
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.55;
}

.template-bubble small {
    margin-top: 8px;
    color: #7d8b86;
    font-weight: 700;
}

.template-preview-buttons {
    display: grid;
    gap: 6px;
}

.template-preview-buttons button {
    border: 1px solid #dce8ef;
    border-radius: 12px;
    padding: 9px 10px;
    color: #078b4e;
    background: #fff;
    font-size: 0.84rem;
    font-weight: 850;
}

@media (max-width: 1100px) {
    .template-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .template-button-row {
        grid-template-columns: 1fr 1fr;
    }

    .template-button-row .icon-button {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .template-filters,
    .template-metrics {
        grid-template-columns: 1fr;
    }

    .template-button-row {
        grid-template-columns: 1fr;
    }

    .template-preview {
        position: static;
    }
}

/* Campaigns module */
.campaign-metrics {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.campaign-filters {
    grid-template-columns: minmax(260px, 1fr) 190px auto;
}

.campaigns-table {
    min-width: 1120px;
}

.campaigns-table strong {
    color: #10201d;
    font-weight: 900;
}

.campaign-delivery-mini {
    display: grid;
    gap: 3px;
    color: #62736e;
    font-size: 0.74rem;
    font-weight: 750;
}

.campaign-preview-panel {
    position: sticky;
    top: 88px;
    border: 1px solid #e8eef2;
    border-radius: 20px;
    padding: 18px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.78)),
        radial-gradient(circle at 20% 20%, rgba(52, 120, 246, 0.1), transparent 38%);
}

.campaign-preview-panel > strong {
    display: block;
    color: #10201d;
    font-size: 2rem;
    font-weight: 900;
}

.campaign-preview-panel > p,
.campaign-recipient-sample p {
    color: #687973;
    font-size: 0.86rem;
    font-weight: 650;
}

.campaign-recipient-sample {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.campaign-recipient-sample div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #edf2f4;
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
}

.campaign-recipient-sample strong,
.campaign-recipient-sample span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.campaign-recipient-sample span {
    color: #697a74;
    font-size: 0.78rem;
    font-weight: 750;
}

@media (max-width: 1100px) {
    .campaign-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .campaign-filters,
    .campaign-metrics {
        grid-template-columns: 1fr;
    }

    .campaign-preview-panel {
        position: static;
    }
}

/* Chatbot Flow Builder */
.chatbot-metrics {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.chatbot-shell {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 16px;
    align-items: start;
}

.chatbot-flow-panel,
.chatbot-builder-card {
    min-width: 0;
}

.chatbot-filters {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.chatbot-flow-list {
    display: grid;
    gap: 10px;
}

.chatbot-flow-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    border: 1px solid #edf2f4;
    border-radius: 14px;
    padding: 13px;
    color: #10201d;
    background: rgba(255, 255, 255, 0.74);
    text-decoration: none;
}

.chatbot-flow-item:hover,
.chatbot-flow-item.active {
    border-color: rgba(10, 174, 92, 0.28);
    background: linear-gradient(135deg, rgba(10, 174, 92, 0.1), rgba(255, 255, 255, 0.88));
}

.chatbot-flow-item strong,
.chatbot-flow-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chatbot-flow-item strong {
    font-size: 0.9rem;
    font-weight: 900;
}

.chatbot-flow-item small {
    color: #64766f;
    font-size: 0.74rem;
    font-weight: 750;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f6a63a;
}

.status-published {
    background: #0aae5c;
}

.status-paused {
    background: #7457ff;
}

.chatbot-builder-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #edf2f4;
    padding-bottom: 16px;
}

.chatbot-builder-header h3 {
    margin: 0 0 6px;
    color: #10201d;
    font-size: 1.22rem;
    font-weight: 900;
}

.chatbot-builder-header p:last-child {
    margin: 0;
    color: #667772;
    font-size: 0.86rem;
    font-weight: 650;
}

.chatbot-builder-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.chatbot-toolbar {
    display: grid;
    grid-template-columns: minmax(240px, 0.42fr) minmax(0, 1fr);
    gap: 14px;
    align-items: end;
    margin: 16px 0;
}

.chatbot-add-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.chatbot-work-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 16px;
    align-items: start;
}

.chatbot-canvas {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 14px;
    min-height: 420px;
    border: 1px dashed #dce7ed;
    border-radius: 20px;
    padding: 16px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.72)),
        radial-gradient(circle at 12% 10%, rgba(10, 174, 92, 0.1), transparent 28%),
        radial-gradient(circle at 92% 12%, rgba(52, 120, 246, 0.08), transparent 28%);
}

.chatbot-node-card {
    display: grid;
    gap: 8px;
    align-self: start;
    border: 1px solid #e6edf1;
    border-radius: 18px;
    padding: 14px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(24, 49, 44, 0.06);
}

.chatbot-node-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.node-type-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    color: #06733f;
    background: rgba(10, 174, 92, 0.12);
    font-size: 0.72rem;
    font-weight: 900;
}

.chatbot-node-card textarea {
    resize: vertical;
}

.chatbot-preview-panel {
    position: sticky;
    top: 88px;
    border: 1px solid #e8eef2;
    border-radius: 20px;
    padding: 16px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.82)),
        radial-gradient(circle at 20% 20%, rgba(10, 174, 92, 0.12), transparent 36%);
}

.chatbot-preview-result {
    display: grid;
    gap: 10px;
    min-height: 180px;
    margin-top: 14px;
}

.chatbot-preview-result p {
    color: #64766f;
    font-size: 0.86rem;
    font-weight: 700;
}

.preview-bubble {
    border-radius: 16px 16px 16px 6px;
    padding: 12px 13px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(20, 43, 38, 0.08);
}

.preview-bubble small,
.preview-bubble span {
    display: block;
}

.preview-bubble small {
    margin-bottom: 5px;
    color: #667772;
    font-size: 0.72rem;
    font-weight: 800;
}

.preview-bubble span {
    color: #172722;
    font-size: 0.88rem;
    font-weight: 650;
    line-height: 1.5;
    white-space: pre-wrap;
}

.chatbot-empty-state {
    display: grid;
    min-height: 420px;
    place-items: center;
    align-content: center;
    text-align: center;
}

.chatbot-empty-state i {
    display: grid;
    width: 70px;
    height: 70px;
    place-items: center;
    border-radius: 22px;
    color: #079b52;
    background: rgba(10, 174, 92, 0.11);
    font-size: 2rem;
}

.chatbot-empty-state h3 {
    margin: 18px 0 8px;
    color: #10201d;
    font-size: 1.2rem;
    font-weight: 900;
}

.chatbot-empty-state p {
    max-width: 520px;
    margin: 0;
    color: #667772;
    font-weight: 650;
}

@media (max-width: 1180px) {
    .chatbot-shell,
    .chatbot-work-grid {
        grid-template-columns: 1fr;
    }

    .chatbot-preview-panel {
        position: static;
    }
}

@media (max-width: 900px) {
    .chatbot-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .chatbot-toolbar,
    .chatbot-builder-header {
        grid-template-columns: 1fr;
    }

    .chatbot-builder-header {
        display: grid;
    }

    .chatbot-builder-actions,
    .chatbot-add-buttons {
        justify-content: flex-start;
    }
}

@media (max-width: 620px) {
    .chatbot-metrics,
    .chatbot-canvas {
        grid-template-columns: 1fr;
    }

    .chatbot-builder-actions .btn,
    .chatbot-builder-actions form {
        width: 100%;
    }

    .chatbot-builder-actions form .btn,
    .chatbot-builder-actions form .icon-button {
        width: 100%;
        border-radius: 12px;
    }
}

/* Analytics module */
.analytics-header {
    align-items: flex-start;
}

.analytics-export-actions .btn {
    white-space: nowrap;
}

.analytics-filter-card {
    padding: 16px 18px;
}

.analytics-filters {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(160px, 220px) auto auto minmax(0, 1fr);
    gap: 10px;
    align-items: end;
}

.analytics-metrics {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.analytics-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
    gap: 16px;
    align-items: stretch;
}

.analytics-grid.lower {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
}

.analytics-chart-card,
.analytics-side-card,
.analytics-table-card {
    min-width: 0;
}

.analytics-line-chart {
    min-height: 280px;
    overflow-x: auto;
    border: 1px solid #edf2f4;
    border-radius: 18px;
    padding: 14px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.74), rgba(255, 255, 255, 0.74)),
        repeating-linear-gradient(to bottom, transparent 0, transparent 43px, #eef3f5 44px);
}

.analytics-line-chart svg {
    width: 100%;
    min-width: 560px;
    height: 220px;
}

.campaign-line {
    stroke: #8d5cf6;
}

.campaign-dot {
    background: #8d5cf6;
}

.analytics-chart-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #758680;
    font-size: 0.76rem;
    font-weight: 800;
}

.analytics-bars {
    display: grid;
    gap: 13px;
}

.analytics-bar-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.analytics-bar-row span,
.analytics-bar-row strong {
    overflow: hidden;
    color: #1a2925;
    font-size: 0.84rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.analytics-bar-row strong {
    color: #50615d;
}

.analytics-bar-row em {
    grid-column: 1 / -1;
    height: 9px;
    border-radius: 999px;
    background: linear-gradient(90deg, #0aae5c, #3478f6);
}

.analytics-table {
    min-width: 860px;
}

.analytics-stack {
    display: grid;
    gap: 16px;
}

.lifecycle-list,
.agent-list {
    display: grid;
    gap: 10px;
}

.lifecycle-list div,
.agent-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid #edf2f4;
    border-radius: 14px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.76);
}

.lifecycle-list span,
.agent-list strong {
    color: #10201d;
    font-size: 0.84rem;
    font-weight: 900;
}

.lifecycle-list strong,
.agent-list span {
    color: #62736e;
    font-size: 0.78rem;
    font-weight: 800;
}

.agent-list div {
    align-items: flex-start;
    flex-direction: column;
}

@media (max-width: 1180px) {
    .analytics-grid,
    .analytics-grid.lower {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .analytics-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .analytics-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .analytics-metrics,
    .analytics-filters {
        grid-template-columns: 1fr;
    }

    .analytics-export-actions,
    .analytics-export-actions .btn {
        width: 100%;
    }
}

/* Sidebar: icon above label */
@media (min-width: 761px) {
    :root {
        --wa-sidebar-width: 92px;
    }

    body:not(.auth-body) .glass-sidebar {
        width: var(--wa-sidebar-width);
        max-width: var(--wa-sidebar-width);
        padding: 14px 8px;
        overflow-x: hidden;
    }

    body:not(.auth-body) .app-main {
        width: calc(100% - var(--wa-sidebar-width));
        margin-left: var(--wa-sidebar-width);
    }

    body:not(.auth-body) .glass-sidebar .brand-lockup {
        justify-content: center;
        padding: 0;
        margin-bottom: 16px;
    }

    body:not(.auth-body) .glass-sidebar .brand-lockup > span:not(.brand-mark),
    body:not(.auth-body) .glass-sidebar .tenant-pill,
    body:not(.auth-body) .glass-sidebar .profile-meta {
        display: none;
    }

    body:not(.auth-body) .brand-mark {
        width: 50px;
        height: 50px;
        border-radius: 16px;
    }

    body:not(.auth-body) .sidebar-nav {
        gap: 8px;
        margin-top: 0;
    }

    body:not(.auth-body) .sidebar-link {
        display: flex;
        min-height: 66px;
        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 5px;
        border-radius: 14px;
        padding: 7px 4px;
        color: rgba(255, 255, 255, 0.76);
        font-size: 0.68rem;
        font-weight: 500;
        line-height: 1.05;
        text-align: center;
    }

    body:not(.auth-body) .glass-sidebar .sidebar-link > span:not(.nav-icon) {
        display: block;
        max-width: 76px;
        overflow: hidden;
        color: inherit;
        font-size: 0.68rem;
        line-height: 1.1;
        text-align: center;
        text-overflow: ellipsis;
        white-space: normal;
        word-break: normal;
    }

    body:not(.auth-body) .sidebar-link .nav-icon {
        display: grid;
        width: 30px;
        height: 30px;
        flex: 0 0 30px;
        place-items: center;
        font-size: 1.35rem;
    }

    body:not(.auth-body) .sidebar-link.active,
    body:not(.auth-body) .sidebar-link:hover {
        color: #fff;
        background: rgba(3, 176, 90, 0.28);
    }

    body:not(.auth-body) .sidebar-footer {
        display: grid;
        place-items: center;
        margin-top: auto;
    }

    body:not(.auth-body) .sidebar-profile {
        justify-content: center;
        width: auto;
        padding: 0;
        background: transparent;
    }

    body:not(.auth-body) .profile-avatar {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
    }
}

/* Sidebar fixed header/footer with arrow-scrolled middle menu */
body:not(.auth-body) .glass-sidebar {
    display: flex;
    flex-direction: column;
}

.sidebar-scroll-button {
    display: none;
}

.sidebar-nav-scroll {
    min-height: 0;
}

@media (min-width: 761px) {
    body:not(.auth-body) .glass-sidebar {
        height: 100vh;
        min-height: 100vh;
        max-height: 100vh;
    }

    body:not(.auth-body) .glass-sidebar .brand-lockup {
        flex: 0 0 auto;
    }

    body:not(.auth-body) .sidebar-scroll-button {
        display: grid;
        width: 100%;
        height: 34px;
        flex: 0 0 34px;
        place-items: center;
        border: 0;
        border-radius: 12px;
        margin: 4px 0;
        color: rgba(255, 255, 255, 0.9);
        background: rgba(255, 255, 255, 0.13);
        font-size: 1rem;
    }

    body:not(.auth-body) .sidebar-scroll-button:hover {
        background: rgba(3, 176, 90, 0.32);
    }

    body:not(.auth-body) .sidebar-scroll-button.is-hidden {
        display: none;
    }

    body:not(.auth-body) .sidebar-nav-scroll {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    body:not(.auth-body) .sidebar-nav-scroll::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body:not(.auth-body) .sidebar-nav-scroll .sidebar-nav {
        padding: 2px 0;
    }

    body:not(.auth-body) .sidebar-footer {
        display: grid;
        flex: 0 0 auto;
        gap: 8px;
        margin-top: 8px;
        place-items: center;
    }

    body:not(.auth-body) .sidebar-settings-link {
        width: 100%;
    }

    body:not(.auth-body) .tenant-pill {
        display: none !important;
    }
}

@media (max-width: 760px) {
    body:not(.auth-body) .sidebar-scroll-button {
        display: none;
    }

    body:not(.auth-body) .sidebar-nav-scroll {
        overflow: visible;
    }
}

/* Billing module */
.billing-metrics {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
}

.billing-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 420px);
    gap: 16px;
}

.billing-current-card,
.billing-gateway-card,
.billing-invoices-card,
.billing-plan-card {
    min-width: 0;
}

.billing-current-card h3,
.billing-gateway-card h3,
.billing-plan-card h3 {
    margin: 0 0 8px;
    color: #10201d;
    font-size: 1.2rem;
    font-weight: 900;
}

.billing-current-card p,
.billing-gateway-card p,
.billing-plan-card p {
    color: #667772;
    font-size: 0.88rem;
    font-weight: 650;
}

.billing-period,
.gateway-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 16px;
}

.billing-period span,
.gateway-list span {
    color: #6b7d77;
    font-size: 0.76rem;
    font-weight: 800;
}

.billing-period strong,
.gateway-list strong {
    display: block;
    color: #10201d;
    font-size: 0.88rem;
    font-weight: 900;
}

.billing-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.billing-plan-card {
    display: grid;
    gap: 14px;
}

.billing-plan-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.billing-plan-top > strong {
    color: #079b52;
    font-size: 1.25rem;
    font-weight: 950;
    white-space: nowrap;
}

.billing-plan-card ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.billing-plan-card li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #273834;
    font-size: 0.84rem;
    font-weight: 750;
}

.billing-plan-card li i {
    color: #0aae5c;
}

.billing-checkout-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.billing-table {
    min-width: 780px;
}

@media (max-width: 1180px) {
    .billing-grid,
    .billing-plan-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .billing-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .billing-metrics,
    .billing-period,
    .gateway-list,
    .billing-checkout-actions {
        grid-template-columns: 1fr;
    }
}
