:root {
    --ink: #111827;
    --muted: #64748b;
    --line: #dce6f5;
    --paper: #f2f5fb;
    --card: #ffffff;
    --sidebar: #0c1f3d;
    --sidebar-2: #1b3a6b;
    --sidebar-text: #d7e2f2;
    --accent: #e8671a;
    --accent-dark: #c24e0e;
    --accent-soft: #fff4ed;
    --navy: #1b3a6b;
    --navy-2: #2a5298;
    --ok: #e5f6ea;
    --ok-ink: #0f6b32;
    --warn: #fff4df;
    --warn-ink: #8a4b08;
    --bad: #fde8e6;
    --bad-ink: #9f2218;
    --info: #e7f1fb;
    --info-ink: #1b3a6b;
    --marketing: #fff4ed;
    --marketing-ink: #c24e0e;
    --auth: #e8f0fb;
    --auth-ink: #1b3a6b;
    --shadow: 0 16px 40px rgba(12, 31, 61, 0.08);
    --radius: 14px;
    font-family: "DM Sans", "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--paper);
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(232, 103, 26, 0.08), transparent 28%),
        radial-gradient(circle at 12% 18%, rgba(42, 82, 152, 0.10), transparent 34%),
        var(--paper);
}
a { color: inherit; }
button, input, select { font: inherit; }
code, .mono { font-family: "IBM Plex Mono", Consolas, monospace; }

.nav-toggle { position: absolute; opacity: 0; pointer-events: none; }
.shell { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.sidebar {
    background:
        linear-gradient(180deg, rgba(232, 103, 26, 0.12), transparent 18%),
        linear-gradient(180deg, var(--sidebar) 0%, #08162c 100%);
    color: var(--sidebar-text);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: hidden;
}
.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 2px 6px 10px;
    flex-shrink: 0;
}
.brand-logo {
    width: 100%;
    height: auto;
    max-width: 140px;
    object-fit: contain;
    display: block;
    background: white;
    border-radius: 8px;
    padding: 5px 7px;
}
.brand-copy {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.brand-mark {
    width: 32px; height: 32px; border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), #ff7c30);
    color: white; display: grid; place-items: center; font-weight: 700;
}
.brand strong { display: block; color: white; font-size: 13px; line-height: 1.2; }
.brand span { color: #9fb4d4; font-size: 11px; line-height: 1.3; }
.nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: visible;
    margin-bottom: 6px;
}
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label {
    display: block;
    padding: 2px 10px 1px;
    color: #8ea4c4;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.nav a {
    text-decoration: none;
    color: var(--sidebar-text);
    padding: 6px 10px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    line-height: 1.2;
}
.nav a:hover, .nav a.is-active { background: rgba(42, 82, 152, 0.45); color: white; }
.nav a.is-active { box-shadow: inset 3px 0 0 var(--accent); }
.sidebar-foot {
    margin-top: auto;
    padding: 8px 6px 0;
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 12px;
}
.sidebar-foot form { margin-top: 6px; }
.sidebar-account {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-top: 4px;
}
.sidebar-account a {
    color: #9fb4d4;
    text-decoration: none;
    font-size: 12px;
    padding: 0;
}
.sidebar-account a:hover,
.sidebar-account a.is-active {
    color: white;
}
.sidebar-foot .ghost-btn {
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 8px;
}
.ghost-btn, .btn, .btn-primary, .btn-danger {
    border: 0; border-radius: 12px; padding: 10px 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px;
}
.ghost-btn { background: transparent; color: #d7e2f2; border: 1px solid rgba(255,255,255,.14); }
.btn { background: white; color: var(--ink); border: 1px solid var(--line); }
.btn-primary {
    background: linear-gradient(135deg, var(--accent), #ff7c30);
    color: white;
    box-shadow: 0 10px 24px rgba(232, 103, 26, 0.24);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--accent-dark), var(--accent)); }
.btn-danger { background: var(--bad); color: var(--bad-ink); }
.btn[disabled], .btn-primary[disabled] { opacity: .5; cursor: not-allowed; }
.main { padding: 28px 32px 48px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 18px; }
.topbar h1 {
    margin: 0 0 6px;
    font-family: "Bebas Neue", "DM Sans", sans-serif;
    font-size: 42px;
    letter-spacing: 0.02em;
    color: var(--navy);
}
.topbar p { margin: 0; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.banner, .alert { border-radius: 14px; padding: 12px 14px; margin-bottom: 14px; }
.banner { background: var(--accent-soft); color: #8a3d0d; border: 1px solid #f3c9a8; }
.alert-success { background: var(--ok); color: var(--ok-ink); }
.alert-error { background: var(--bad); color: var(--bad-ink); }
.alert-warning { background: var(--warn); color: var(--warn-ink); }
.alert ul { margin: 0; padding-left: 18px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat, .card, .panel {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat { padding: 16px 18px; }
.stat span { color: var(--muted); font-size: 13px; }
.stat strong { display: block; margin-top: 6px; font-size: 28px; letter-spacing: -0.04em; color: var(--navy); }
.grid-2 { display: grid; grid-template-columns: 1.3fr .7fr; gap: 14px; }
.card { padding: 18px; }
.card h2, .panel h2 { margin: 0 0 12px; font-size: 18px; color: var(--navy); }

/* Dashboard */
.dash { display: flex; flex-direction: column; gap: 14px; }
.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.dash-kpi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    min-width: 0;
}
a.dash-kpi:hover { border-color: #b8c9e4; }
a.dash-kpi.is-active-filter { border-color: var(--accent, #e67a35); box-shadow: 0 0 0 1px var(--accent, #e67a35); }
.dash-kpi-label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.02em; }
.dash-kpi-value {
    font-size: 32px;
    line-height: 1.05;
    letter-spacing: -0.04em;
    color: var(--navy);
    font-weight: 700;
}
.dash-kpi-meta { color: var(--muted); font-size: 12px; }
.dash-kpi.is-warn { background: var(--warn); border-color: #f0d2a0; }
.dash-kpi.is-warn .dash-kpi-value { color: var(--warn-ink); }
.dash-kpi.is-bad { background: var(--bad); border-color: #f0b8b2; }
.dash-kpi.is-bad .dash-kpi-value { color: var(--bad-ink); }
.dash-kpi.is-ok { background: linear-gradient(180deg, #ffffff, #f4faf6); }
.dash-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 10px;
}
.dash-strip-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    min-width: 0;
}
.dash-strip-item span { color: var(--muted); font-size: 11px; font-weight: 600; }
.dash-strip-item strong { color: var(--navy); font-size: 18px; letter-spacing: -0.03em; }
.dash-strip-item.is-warn { background: var(--warn); }
.dash-strip-item.is-warn strong { color: var(--warn-ink); }
.dash-strip-item.is-bad { background: var(--bad); }
.dash-strip-item.is-bad strong { color: var(--bad-ink); }
.dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
    gap: 14px;
    align-items: start;
}
.dash-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dash-panel { padding: 16px; }
.dash-panel > .dash-panel-head { margin-bottom: 8px; }
.dash-panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.dash-panel .dash-panel-head h2 { margin: 0 0 2px; font-size: 17px; color: var(--navy); }
.dash-panel .dash-panel-head p { margin: 0; color: var(--muted); font-size: 13px; }
.dash-panel-head a { color: var(--navy); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.dash-panel-head a:hover { color: var(--accent-dark); }
.dash-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding: 10px 8px;
    margin: 0 -8px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid var(--line);
}
.dash-row:last-child { border-bottom: 0; }
a.dash-row:hover { background: #f7f9fd; }
.dash-row.is-static { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.dash-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--navy), var(--navy-2));
    color: white;
    font-size: 13px;
    font-weight: 700;
}
.dash-row-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dash-row-title { font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-sub { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-row-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.dash-row-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.dash-attention { list-style: none; margin: 0; padding: 0; }
.dash-attention li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 14px;
}
.dash-attention li:last-child { border-bottom: 0; padding-bottom: 0; }
.dash-attention span { color: var(--muted); }
.dash-attention strong { color: var(--navy); font-size: 16px; }
.tone-warn { color: var(--warn-ink) !important; }
.tone-bad { color: var(--bad-ink) !important; }
.dash-empty { padding: 28px 12px; text-align: center; }
.dash-empty.compact { padding: 18px 8px; }
.dash-empty h3 { margin: 0 0 4px; font-size: 15px; color: var(--navy); }
.dash-empty p { margin: 0; color: var(--muted); font-size: 13px; }
.dash-table-wrap { border: 0; box-shadow: none; border-radius: 0; }
.dash-table { min-width: 0; }
.dash-table th, .dash-table td { padding: 10px 12px; }
.filters {
    display: flex; flex-wrap: wrap; gap: 10px; align-items: end;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 14px; margin-bottom: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 150px; }
.field-grow { flex: 1; min-width: 220px; }
.field span { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.field input, .field select, .field textarea {
    border: 1px solid var(--line); background: white; border-radius: 12px; padding: 10px 12px; color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid rgba(232, 103, 26, 0.25);
    border-color: var(--accent);
}
.field textarea { min-height: 90px; resize: vertical; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 12px; }
.chip { background: white; border: 1px solid var(--line); border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.chip strong { font-weight: 600; margin-right: 4px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
table { width: 100%; border-collapse: collapse; min-width: 760px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 14px; }
th { font-size: 12px; color: var(--muted); background: #f7f9fd; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link.is-active { color: var(--accent-dark); }
.badge { display: inline-flex; border-radius: 999px; padding: 3px 8px; font-size: 12px; font-weight: 600; background: #eef3fb; color: var(--ink); }
.badge-ok { background: var(--ok); color: var(--ok-ink); }
.badge-warn { background: var(--warn); color: var(--warn-ink); }
.badge-bad { background: var(--bad); color: var(--bad-ink); }
.badge-info { background: var(--info); color: var(--info-ink); }
.badge-marketing { background: var(--marketing); color: var(--marketing-ink); }
.badge-auth { background: var(--auth); color: var(--auth-ink); }
.badge-neutral { background: #eef3fb; color: #334155; }
.row-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
}
.row-actions form { margin: 0; }
.icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    color: var(--navy);
    display: inline-grid;
    place-items: center;
    text-decoration: none;
    cursor: pointer;
    padding: 0;
}
.icon-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}
.icon-btn:hover {
    background: #eef3fb;
    border-color: #c9d7ec;
}
.icon-btn-danger {
    color: var(--bad-ink);
}
.icon-btn-danger:hover {
    background: var(--bad);
    border-color: #f0c2bc;
}
.pager { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 4px; flex-wrap: wrap; }
.pager-summary { color: var(--muted); font-size: 13px; }
.pager-links { display: flex; gap: 6px; flex-wrap: wrap; }
.pager-btn, .pager-gap {
    min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; border: 1px solid var(--line); background: white; text-decoration: none; padding: 0 10px;
}
.pager-btn.is-current { background: var(--navy); color: white; border-color: var(--navy); }
.pager-btn.is-disabled { opacity: .45; }
.empty { padding: 36px 16px; text-align: center; }
.empty h3 { margin: 0 0 6px; }
.empty p { margin: 0; color: var(--muted); }
.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.checklist li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 8px 12px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.thread { display: flex; flex-direction: column; gap: 10px; }
.main:has(.wa-chat),
.main:has(.wa-inbox) {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    padding: 8px 12px 12px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.main:has(.wa-chat) .topbar,
.main:has(.wa-inbox) .topbar {
    display: none;
}
.main:has(.wa-chat) .banner,
.main:has(.wa-chat) .alert,
.main:has(.wa-inbox) .banner,
.main:has(.wa-inbox) .alert {
    flex-shrink: 0;
    margin-bottom: 8px;
}
html:has(.wa-chat),
body:has(.wa-chat),
html:has(.wa-inbox),
body:has(.wa-inbox) {
    height: 100%;
    overflow: hidden;
}
.shell:has(.wa-chat),
.shell:has(.wa-inbox) {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
}

.wa-inbox {
    display: grid;
    grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
    gap: 0;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid #d1d7db;
    border-radius: 12px;
    background: #fff;
    box-shadow: var(--shadow);
}
.wa-inbox.is-open {
    grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
}
.wa-inbox-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    border-right: 1px solid #e9edef;
    background: #fff;
}
.wa-inbox-head {
    flex-shrink: 0;
    padding: 12px 14px 10px;
    border-bottom: 1px solid #f0f2f5;
    background: #fff;
}
.wa-inbox-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.wa-inbox-title strong {
    font-size: 22px;
    color: #111b21;
    letter-spacing: -0.02em;
}
.wa-inbox-menu {
    display: none;
}
.wa-inbox-search {
    display: grid;
    gap: 8px;
}
.wa-inbox-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0f2f5;
    border-radius: 8px;
    padding: 0 10px;
}
.wa-inbox-search-ico {
    color: #54656f;
    font-size: 16px;
    line-height: 1;
}
.wa-inbox-search-box input[type="search"] {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 10px 0;
    font: inherit;
    color: #111b21;
    outline: none;
}
.wa-inbox-search-box input[type="search"]::placeholder {
    color: #667781;
}
.wa-inbox-search-clear {
    border: 0;
    background: transparent;
    color: #54656f;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
}
.wa-inbox-search select {
    width: 100%;
    border: 0;
    border-radius: 8px;
    background: #f0f2f5;
    padding: 10px 12px;
    font: inherit;
    color: #111b21;
}
.wa-inbox-section-label {
    padding: 10px 16px 6px;
    font-size: 12px;
    font-weight: 700;
    color: #008069;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 1;
}
.wa-inbox-avatar.is-contact {
    background: #e7f8f2;
    color: #008069;
}
.wa-inbox-contact strong {
    font-weight: 600;
}

.wa-chat-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f0f2f5;
    border-bottom: 1px solid #e9edef;
    flex-shrink: 0;
}
.wa-chat-search[hidden] { display: none !important; }
.wa-chat-search-box {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 8px;
    padding: 0 10px;
}
.wa-chat-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    border-radius: 0;
    padding: 9px 0;
    font: inherit;
    background: transparent;
    outline: none;
}
.wa-chat-search-count {
    font-size: 12px;
    color: #667781;
    white-space: nowrap;
    min-width: 36px;
    text-align: center;
}
.wa-chat-search-count[hidden] { display: none !important; }
.wa-chat-search-nav,
.wa-chat-search-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #54656f;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
.wa-inbox-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.wa-chip {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 999px;
    background: #f0f2f5;
    color: #54656f;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}
.wa-chip.is-active {
    background: #e7f8f2;
    color: #008069;
}
.wa-inbox-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}
.wa-inbox-item {
    display: grid;
    grid-template-columns: 49px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 14px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f2f5;
}
.wa-inbox-item[hidden],
.wa-inbox-item.is-search-hidden,
.wa-inbox-section[hidden],
.wa-inbox-section.is-search-hidden,
.wa-inbox-empty-list[hidden],
.wa-inbox-empty-list.is-search-hidden,
.wa-inbox-section-label[hidden],
.wa-inbox-section-label.is-search-hidden,
#wa-inbox-chips[hidden],
#wa-inbox-chips.is-search-hidden,
#wa-inbox-search-clear[hidden],
#wa-inbox-search-clear.is-search-hidden {
    display: none !important;
}
.wa-inbox-item:hover {
    background: #f5f6f6;
}
.wa-inbox-item.is-active {
    background: #f0f2f5;
}
.wa-inbox-avatar {
    width: 49px;
    height: 49px;
    border-radius: 50%;
    background: #dfe5e7;
    color: #54656f;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 700;
}
.wa-inbox-body {
    min-width: 0;
    display: grid;
    gap: 4px;
    padding-top: 2px;
}
.wa-inbox-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}
.wa-inbox-row strong {
    color: #111b21;
    font-size: 16px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wa-inbox-row time {
    color: #667781;
    font-size: 12px;
    flex-shrink: 0;
}
.wa-inbox-item.is-unread .wa-inbox-row strong {
    font-weight: 700;
}
.wa-inbox-item.is-unread time {
    color: #25d366;
    font-weight: 600;
}
.wa-inbox-preview span {
    color: #667781;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}
.wa-inbox-company {
    font-style: normal;
    color: #008069;
    font-weight: 600;
}
.wa-inbox-unread {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #25d366;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wa-inbox-empty-list {
    padding: 36px 20px;
    text-align: center;
    color: #667781;
}
.wa-inbox-empty-list strong {
    display: block;
    color: #111b21;
    margin-bottom: 4px;
}
.wa-inbox-stage {
    min-width: 0;
    min-height: 0;
    height: 100%;
    background: #f0f2f5;
}
.wa-inbox-splash {
    height: 100%;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 20% 20%, rgba(0,168,132,.06), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(37,211,102,.05), transparent 35%),
        #f0f2f5;
}
.wa-inbox-splash-card {
    max-width: 460px;
    text-align: center;
    background: #fff;
    border-radius: 18px;
    padding: 36px 28px;
    box-shadow: 0 8px 30px rgba(11, 20, 26, 0.08);
}
.wa-inbox-splash-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 18px;
    display: grid;
    place-items: center;
    background: #e7f8f2;
    font-size: 28px;
}
.wa-inbox-splash-card h2 {
    margin: 0 0 8px;
    color: #111b21;
    font-size: 28px;
}
.wa-inbox-splash-card p {
    margin: 0;
    color: #667781;
    line-height: 1.5;
}
.wa-inbox-splash-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}
.wa-inbox-splash-foot {
    margin-top: 18px;
    color: #8696a0;
    font-size: 12px;
    text-align: center;
}

.wa-inbox .wa-chat {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    height: 100%;
    grid-template-columns: minmax(0, 1fr) 260px;
}
.wa-inbox .wa-main {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
.wa-inbox .wa-back {
    display: none;
}
.wa-inbox .wa-side {
    border-radius: 0;
    border: 0;
    border-left: 1px solid #e9edef;
    box-shadow: none;
}

.wa-chat {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 10px;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}
.wa-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #d1d7db;
    background: #efeae2;
    box-shadow: var(--shadow);
}
.wa-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f0f2f5;
    border-bottom: 1px solid #d1d7db;
    flex-shrink: 0;
}
.wa-back {
    color: #54656f;
    text-decoration: none;
    font-size: 28px;
    line-height: 1;
    padding: 0 4px;
}
.wa-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #00a884;
    color: white;
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.wa-header-meta {
    min-width: 0;
    flex: 1;
}
.wa-header-meta strong {
    display: block;
    color: #111b21;
    font-size: 16px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wa-header-meta span {
    display: block;
    color: #667781;
    font-size: 12px;
    margin-top: 2px;
}
.wa-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.wa-icon-link {
    color: #54656f;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 8px;
    border-radius: 8px;
    background: white;
    border: 1px solid #d1d7db;
}
.wa-jump {
    text-align: center;
    padding: 6px;
    background: rgba(255,255,255,.55);
}
.wa-jump a { color: #027eb5; font-size: 12px; }
.wa-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.wa-thread {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 12px 56px 18px;
    background-color: #e5ddd5;
    background-image:
        radial-gradient(circle at 12% 18%, rgba(0,0,0,.035) 1.2px, transparent 1.4px),
        radial-gradient(circle at 72% 34%, rgba(0,0,0,.03) 1px, transparent 1.2px),
        radial-gradient(circle at 38% 78%, rgba(0,0,0,.028) 1.1px, transparent 1.3px),
        radial-gradient(circle at 88% 82%, rgba(0,0,0,.03) 1px, transparent 1.2px),
        linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,0) 28%);
    background-size: 42px 42px, 36px 36px, 48px 48px, 32px 32px, 100% 100%;
}
.wa-day {
    align-self: center;
    margin: 10px 0 8px;
    z-index: 1;
}
.wa-day span {
    display: inline-block;
    background: #e1f2fa;
    color: #54656f;
    font-size: 12.5px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    box-shadow: 0 1px 1px rgba(11, 20, 26, 0.08);
}
.wa-scroll-bottom {
    position: absolute;
    right: 18px;
    bottom: 14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #54656f;
    box-shadow: 0 2px 8px rgba(11, 20, 26, 0.18);
    cursor: pointer;
    font-size: 18px;
    z-index: 3;
}
.wa-scroll-bottom[hidden] { display: none !important; }
.wa-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.wa-inline-form { margin: 0; }
.wa-bubble {
    position: relative;
    display: flex;
    max-width: min(420px, 78%);
    gap: 0;
    align-items: flex-start;
}
.wa-bubble.inbound { align-self: flex-start; }
.wa-bubble.outbound {
    align-self: flex-end;
    margin-left: auto;
    flex-direction: row-reverse;
}
.wa-bubble.is-flash .wa-bubble-inner {
    outline: 2px solid #00a884;
}
.wa-bubble-actions {
    position: absolute;
    top: 2px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .12s ease;
}
.wa-bubble.inbound .wa-bubble-actions {
    left: calc(100% + 4px);
}
.wa-bubble.outbound .wa-bubble-actions {
    right: calc(100% + 4px);
}
.wa-bubble:hover .wa-bubble-actions,
.wa-bubble:focus-within .wa-bubble-actions {
    opacity: 1;
    pointer-events: auto;
}
.wa-bubble-action {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 4px rgba(11, 20, 26, 0.18);
    color: #54656f;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    flex-shrink: 0;
}
.wa-quote {
    display: flex;
    align-items: stretch;
    gap: 8px;
    width: calc(100% - 8px);
    margin: 4px 4px 2px;
    padding: 6px 8px;
    border: 0;
    border-left: 3px solid #00a884;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.05);
    text-align: left;
    cursor: pointer;
    color: inherit;
}
.wa-quote-copy {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
}
.wa-quote strong {
    font-size: 12px;
    color: #008069;
}
.wa-quote span {
    font-size: 12px;
    color: #667781;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wa-quote-thumb,
.wa-reply-thumb {
    width: 42px;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #d1d7db;
}
.wa-quote-thumb img,
.wa-reply-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.wa-reply-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 10px 8px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #f0f2f5;
    border-left: 4px solid #00a884;
}
.wa-reply-bar[hidden] { display: none !important; }
.wa-reply-bar-inner {
    flex: 1;
    min-width: 0;
    display: grid;
    gap: 2px;
}
.wa-reply-bar-inner strong {
    font-size: 12px;
    color: #008069;
}
.wa-reply-bar-inner span {
    font-size: 13px;
    color: #54656f;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wa-reply-bar button {
    border: 0;
    background: transparent;
    font-size: 20px;
    color: #667781;
    cursor: pointer;
}
.wa-forward-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: rgba(11, 20, 26, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.wa-forward-modal[hidden] { display: none !important; }
.wa-forward-card {
    width: min(420px, 100%);
    max-height: min(70vh, 560px);
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(11, 20, 26, 0.28);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.wa-forward-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #e9edef;
}
.wa-forward-head button {
    border: 0;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    color: #667781;
}
.wa-forward-card > input {
    margin: 10px 12px;
    border: 1px solid #d1d7db;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
}
.wa-forward-new {
    padding: 10px 12px 4px;
    border-bottom: 1px solid #e9edef;
}
.wa-forward-new-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #54656f;
    margin-bottom: 6px;
}
.wa-forward-new-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 6px;
}
.wa-forward-new-row input {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid #d1d7db;
    border-radius: 10px;
    font: inherit;
    font-size: 13px;
}
.wa-forward-send {
    border: 0;
    border-radius: 10px;
    background: #00a884;
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: 13px;
    padding: 0 14px;
    cursor: pointer;
    white-space: nowrap;
}
.wa-forward-send:disabled {
    opacity: 0.6;
    cursor: wait;
}
.wa-forward-new-hint {
    margin: 6px 0 8px;
    font-size: 11px;
    color: #8696a0;
}
.wa-chat-search-nav:disabled {
    opacity: 0.4;
    cursor: default;
}
.wa-chat-search-results {
    max-height: 240px;
    overflow-y: auto;
    background: #fff;
    border-bottom: 1px solid #e9edef;
    flex-shrink: 0;
    z-index: 4;
}
.wa-main:has(#chat-search-bar:not([hidden])) .wa-header-meta span {
    max-width: 100%;
}
.wa-chat-search-results[hidden] { display: none !important; }
.wa-chat-search-hit {
    display: grid;
    gap: 2px;
    width: 100%;
    text-align: left;
    border: 0;
    border-bottom: 1px solid #f0f2f5;
    background: transparent;
    padding: 10px 14px;
    cursor: pointer;
    font: inherit;
}
.wa-chat-search-hit:hover,
.wa-chat-search-hit.is-active {
    background: #f0f2f5;
}
.wa-chat-search-hit strong {
    font-size: 13px;
    color: #111b21;
}
.wa-chat-search-hit span {
    font-size: 12px;
    color: #667781;
}
.wa-chat-search-hit em {
    font-style: normal;
    font-size: 11px;
    color: #8696a0;
}
.wa-bubble.is-search-hit .wa-bubble-inner {
    outline: 2px solid #00a884;
    outline-offset: 1px;
}
.wa-bubble.is-search-current .wa-bubble-inner {
    outline-color: #ffce45;
    box-shadow: 0 0 0 3px rgba(255, 206, 69, 0.35);
}
@media (max-width: 640px) {
    .wa-forward-new-row {
        grid-template-columns: 1fr;
    }
    .wa-forward-send {
        height: 38px;
    }
}
.wa-forward-list {
    overflow: auto;
    padding: 4px 8px 12px;
}
.wa-forward-item {
    width: 100%;
    display: grid;
    gap: 2px;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
}
.wa-forward-item:hover { background: #f0f2f5; }
.wa-forward-item strong { color: #111b21; font-size: 14px; }
.wa-forward-item span { color: #667781; font-size: 12px; }
.wa-delete-card { max-width: 360px; }
.wa-delete-hint {
    margin: 0;
    padding: 4px 16px 12px;
    color: #667781;
    font-size: 13px;
}
.wa-delete-actions {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0 8px 12px;
}
.wa-delete-btn {
    border: 0;
    background: transparent;
    text-align: left;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 15px;
    color: #111b21;
}
.wa-delete-btn:hover { background: #f0f2f5; }
.wa-delete-btn.is-everyone { color: #ea0038; font-weight: 600; }
.wa-delete-btn.is-cancel { color: #667781; }
.wa-deleted-msg {
    padding: 8px 10px 2px;
    color: #667781;
    font-size: 13.5px;
    font-style: italic;
}
.wa-bubble.is-deleted .wa-bubble-inner {
    opacity: 0.92;
}
.wa-bubble-inner {
    position: relative;
    padding: 4px 6px 3px;
    border-radius: 8px;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
    background: #fff;
    color: #111b21;
    min-width: 84px;
}
.wa-bubble.has-media .wa-bubble-inner { padding: 3px; overflow: hidden; }
.wa-bubble.outbound .wa-bubble-inner { background: #d9fdd3; }
.bubble-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14.2px;
    line-height: 1.4;
    padding: 4px 7px 0;
}
.bubble-body strong { font-weight: 700; }
.bubble-body em { font-style: italic; }
.bubble-body s { text-decoration: line-through; }
.bubble-body .wa-mono,
.wa-mono {
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: 12.5px;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
    padding: 1px 4px;
}
.wa-media-card {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 6px;
    background: #111b21;
    min-width: 220px;
}
.wa-media-image-card img,
.wa-media-video-card video {
    display: block;
    width: 100%;
    max-width: 320px;
    max-height: 360px;
    object-fit: cover;
    vertical-align: middle;
}
.wa-media-video-card { cursor: pointer; }
.wa-media-video-card video { width: 100%; background: #000; }
.wa-media-shade {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 52px;
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.55));
    pointer-events: none;
}
.wa-media-badges {
    position: absolute;
    left: 8px;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 2;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}
.wa-hd {
    background: rgba(0,0,0,.45);
    border-radius: 3px;
    padding: 1px 4px;
    letter-spacing: 0.04em;
}
.wa-duration { text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.wa-video-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 52px;
    height: 52px;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    color: #fff;
    cursor: pointer;
    z-index: 2;
}
.wa-video-play::before {
    content: '';
    display: block;
    margin: 0 auto;
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
    margin-left: 20px;
}
.wa-media-video-card.is-playing .wa-video-play,
.wa-media-video-card.is-playing .wa-media-badges,
.wa-media-video-card.is-playing .wa-media-shade { display: none; }
.wa-media-audio-card {
    padding: 8px 8px 2px;
    min-width: 240px;
}
.wa-media-audio-card audio { width: 100%; }
.wa-doc-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 28px;
    gap: 10px;
    align-items: center;
    min-width: 240px;
    max-width: 320px;
    margin: 2px;
    padding: 10px 10px 8px;
    border-radius: 8px;
    background: rgba(0,0,0,.04);
    text-decoration: none;
    color: #111b21;
}
.wa-doc-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: #e35d6a;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}
.wa-doc-icon[data-ext="PDF"] { background: #e35d6a; }
.wa-doc-icon[data-ext="DOC"],
.wa-doc-icon[data-ext="DOCX"] { background: #4a86e8; }
.wa-doc-icon[data-ext="XLS"],
.wa-doc-icon[data-ext="XLSX"],
.wa-doc-icon[data-ext="CSV"] { background: #34a853; }
.wa-doc-icon[data-ext="PPT"],
.wa-doc-icon[data-ext="PPTX"] { background: #f6a623; }
.wa-doc-icon[data-ext="ZIP"] { background: #7a5af8; }
.wa-doc-meta { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wa-doc-meta strong {
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.wa-doc-meta small { color: #667781; font-size: 12px; }
.wa-doc-download {
    color: #54656f;
    font-size: 16px;
    text-align: center;
}
.wa-media-missing {
    font-size: 12px;
    color: #667781;
    padding: 8px 10px;
}
.wa-media-missing small {
    display: block;
    margin-top: 4px;
    color: #b3261e;
    line-height: 1.35;
}
.bubble-body.is-reaction {
    font-size: 28px;
    line-height: 1.2;
    padding: 6px 8px 0;
}
.wa-template-tag {
    margin: 2px 8px 0;
    font-size: 11px;
    color: #667781;
}
.wa-error {
    margin: 2px 8px 0;
    font-size: 12px;
    color: #ea4335;
}
.wa-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    padding: 0 4px 2px;
    color: #667781;
    font-size: 11px;
}
.wa-bubble.media-only .wa-meta {
    position: absolute;
    right: 8px;
    bottom: 6px;
    margin: 0;
    padding: 0;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,.55);
    z-index: 2;
}
.wa-bubble.media-only .wa-ticks { color: #fff; }
.wa-bubble.media-only .wa-ticks.read { color: #53bdeb; }
.wa-ticks { letter-spacing: -1px; font-size: 12px; color: #667781; }
.wa-ticks.delivered { color: #667781; }
.wa-ticks.read { color: #53bdeb; }
.wa-ticks.failed { color: #ea4335; font-weight: 700; }
.wa-empty {
    margin: auto;
    background: rgba(255,255,255,.92);
    border-radius: 10px;
    padding: 14px 18px;
    text-align: center;
    color: #54656f;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.wa-empty strong { display: block; color: #111b21; margin-bottom: 4px; }
.wa-empty p { margin: 0; font-size: 13px; }
.wa-composer {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 12px 12px;
    background: #f0f2f5;
    border-top: 1px solid #d1d7db;
    flex-shrink: 0;
}
.wa-popovers {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(100% + 8px);
    z-index: 8;
    pointer-events: none;
}
.wa-panel {
    pointer-events: auto;
    background: #ffffff;
    border: 1px solid #d1d7db;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(11, 20, 26, 0.18);
    overflow: hidden;
    max-height: min(420px, 58vh);
    display: flex;
    flex-direction: column;
}
.wa-panel[hidden] { display: none !important; }
.wa-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #667781;
    border-bottom: 1px solid #e9edef;
    flex-shrink: 0;
}
.wa-panel-head input {
    flex: 1;
    min-width: 0;
    border: 1px solid #d1d7db;
    border-radius: 16px;
    padding: 6px 10px;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
    color: #111b21;
}
.wa-emoji-panel {
    width: min(380px, calc(100vw - 24px));
}
.wa-emoji-tabs {
    display: grid;
    grid-template-columns: repeat(9, minmax(0, 1fr));
    gap: 0;
    padding: 0 4px;
    border-bottom: 1px solid #e9edef;
    flex-shrink: 0;
    overflow: visible;
}
.wa-emoji-tab {
    appearance: none;
    -webkit-appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #54656f;
    cursor: pointer;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif !important;
    font-size: 20px !important;
    font-weight: 400 !important;
    font-style: normal !important;
    line-height: 1 !important;
    letter-spacing: normal !important;
    text-transform: none !important;
    text-decoration: none !important;
    box-shadow: none;
}
.wa-emoji-tab:hover {
    background: #f0f2f5;
}
.wa-emoji-tab.is-active {
    border-bottom-color: #00a884;
    background: transparent;
}
.wa-emoji-cat-title {
    padding: 8px 12px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #667781;
    flex-shrink: 0;
}
.wa-emoji-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 2px;
    padding: 4px 8px 10px;
    overflow: auto;
    flex: 1;
    min-height: 200px;
}
.wa-emoji {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    border-radius: 8px;
    font-size: 22px !important;
    font-family: "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Segoe UI Symbol", sans-serif !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    text-transform: none !important;
    cursor: pointer;
    padding: 6px 4px;
    color: inherit;
}
.wa-emoji:hover { background: #f0f2f5; }
.bubble-body,
.wa-input-wrap textarea {
    font-family: "DM Sans", "Segoe UI", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.wa-format-list,
.wa-attach-list {
    display: flex;
    flex-direction: column;
    padding: 6px;
}
.wa-format-list button,
.wa-attach-list button,
.wa-attach-list a {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: center;
    gap: 10px;
    border: 0;
    background: transparent;
    text-align: left;
    text-decoration: none;
    color: #111b21;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
}
.wa-attach-list button,
.wa-attach-list a {
    grid-template-columns: 34px 1fr;
}
.wa-format-list button:hover,
.wa-attach-list button:hover,
.wa-attach-list a:hover {
    background: #f0f2f5;
}
.wa-format-list code {
    color: #667781;
    font-size: 11px;
}
.wa-mono-mark {
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: 12px;
    font-weight: 700;
}
.wa-attach-ico {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 16px;
}
.wa-attach-ico.photo { background: #e7fce3; }
.wa-attach-ico.doc { background: #e8f0fb; }
.wa-attach-ico.template { background: #fff4ed; }
.wa-attach-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: white;
    border: 1px solid #d1d7db;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 13px;
    color: #111b21;
}
.wa-attach-preview[hidden] {
    display: none !important;
}
.wa-attach-preview button {
    border: 0;
    background: transparent;
    color: #667781;
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}
.wa-composer-bar {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.wa-composer-pill {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    background: #ffffff;
    border-radius: 24px;
    padding: 4px 8px 4px 4px;
    box-shadow: 0 1px 2px rgba(11, 20, 26, 0.08);
}
.wa-bar-btn {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #54656f;
    display: inline-grid;
    place-items: center;
    cursor: pointer;
    flex-shrink: 0;
    font-size: 22px;
    padding: 0;
    line-height: 1;
}
.wa-bar-btn:hover,
.wa-bar-btn.is-open {
    background: rgba(0, 0, 0, 0.05);
    color: #111b21;
}
#attach-toggle {
    font-size: 28px;
    font-weight: 400;
    color: #54656f;
}
.wa-input-wrap {
    flex: 1;
    background: transparent;
    border-radius: 0;
    padding: 8px 8px 8px 4px;
    border: 0;
    min-width: 0;
}
.wa-input-wrap textarea {
    width: 100%;
    border: 0;
    outline: 0;
    resize: none;
    font: inherit;
    font-size: 15px;
    line-height: 1.35;
    max-height: 120px;
    background: transparent;
    color: #111b21;
}
.wa-send {
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: #00a884;
    color: white;
    cursor: pointer;
    font-size: 18px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
.wa-send.is-mic {
    background: #00a884;
    font-size: 20px;
}
.wa-send:disabled { opacity: .55; cursor: not-allowed; }
.wa-error-banner {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 100%;
    margin: 0 0 6px;
    background: #ffe9e6;
    color: #9f2218;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 12px;
    z-index: 9;
}
.wa-side {
    overflow: auto;
    align-self: stretch;
    min-height: 0;
    max-height: 100%;
}
.chat-live-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #00a884;
    background: #e7f8f2;
    border-radius: 999px;
    padding: 4px 8px;
}
.chat-live-dot::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    animation: chat-pulse 1.4s ease-in-out infinite;
}
@keyframes chat-pulse {
    0%, 100% { opacity: .35; }
    50% { opacity: 1; }
}
.bubble { max-width: min(640px, 100%); padding: 12px 14px; border-radius: 16px; background: white; border: 1px solid var(--line); }
.bubble.inbound { align-self: flex-start; }
.bubble.outbound { margin-left: auto; align-self: flex-end; background: var(--accent-soft); border-color: #f3c9a8; }
.bubble .meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; margin-top: 8px; }
.preview-card {
    background: linear-gradient(160deg, var(--sidebar), var(--navy));
    color: white; border-radius: 18px; padding: 16px; min-height: 140px;
}
.preview-card p { white-space: pre-wrap; margin: 8px 0 0; }
.preview-card span { color: #9fb4d4; font-size: 12px; }
.menu-btn { display: none; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.login-hero {
    background:
        radial-gradient(circle at 80% 18%, rgba(232, 103, 26, 0.28), transparent 28%),
        linear-gradient(160deg, #0c1f3d 0%, #1b3a6b 58%, #12305a 100%);
    color: white;
    padding: 64px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.login-hero .brand-logo {
    height: 56px;
    max-width: 220px;
    width: auto;
    margin: 0 0 28px;
}
.login-hero .eyebrow {
    color: #ff9a57;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 14px;
}
.login-hero h1 {
    font-family: "Bebas Neue", "DM Sans", sans-serif;
    font-size: 64px;
    line-height: .95;
    letter-spacing: 0.02em;
    margin: 0 0 12px;
}
.login-hero p { max-width: 460px; color: #d7e2f2; }
.login-card { display: grid; place-items: center; padding: 32px; }
.login-card form { width: min(420px, 100%); }
.login-card h2 { color: var(--navy); margin: 0 0 6px; }
.hint { color: var(--muted); font-size: 13px; }
pre.payload { overflow: auto; background: #0c1f3d; color: #e7f0fb; padding: 16px; border-radius: 14px; font-size: 12px; }

.company-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1120px;
}
.company-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}
.company-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    padding: 20px;
}
.company-card-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}
.company-card-head h2 {
    margin: 0 0 4px;
    font-size: 17px;
}
.company-card-head .hint {
    margin: 0;
    line-height: 1.35;
}
.company-layout .span-full {
    grid-column: 1 / -1;
}
.company-wa-card {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    background: #fafbfc;
    margin-bottom: 12px;
}
.company-wa-card:last-child {
    margin-bottom: 0;
}
.company-wa-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.company-wa-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
.company-wa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px 14px;
    margin: 0;
}
.company-wa-grid dt {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}
.company-wa-grid dd {
    margin: 2px 0 0;
    color: #111b21;
    font-size: 13px;
    word-break: break-all;
}
.company-step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e8eef8;
    color: var(--navy);
    display: grid;
    place-items: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}
.company-subhead {
    margin: 0 0 4px;
    font-size: 14px;
    color: var(--navy);
}
.company-subhint { margin: 0 0 12px; }
.company-divider {
    height: 1px;
    background: var(--line);
    margin: 18px 0 14px;
}
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.form-grid .field {
    min-width: 0;
}
.form-grid .span-2 {
    grid-column: 1 / -1;
}
.form-grid .field input,
.form-grid .field select,
.form-grid .field textarea {
    width: 100%;
    box-sizing: border-box;
}
.field-help {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    line-height: 1.35;
}
.check-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 14px;
    font-size: 13px;
    color: var(--muted);
}
.check-row input { margin-top: 3px; }
.company-form-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 14px 16px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}
.company-form-footer.is-inline {
    margin-top: 18px;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
}
.company-account-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.company-account-row:last-child { border-bottom: 0; padding-bottom: 0; }
.company-account-row:first-of-type { padding-top: 0; }
.recipient-combobox {
    position: relative;
}
.recipient-combobox input {
    width: 100%;
}
.recipient-match {
    margin-top: 6px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #e8f5e9;
    color: #1b5e20;
    font-size: 12px;
}
.recipient-suggestions {
    position: absolute;
    z-index: 12;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    max-height: 240px;
    overflow: auto;
    background: #fff;
    border: 1px solid #d8dee6;
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .12);
    padding: 4px;
}
.recipient-suggestion {
    width: 100%;
    display: grid;
    gap: 2px;
    text-align: left;
    border: 0;
    background: transparent;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}
.recipient-suggestion:hover,
.recipient-suggestion.is-active {
    background: #f0f2f5;
}
.recipient-suggestion strong {
    color: #111b21;
    font-size: 14px;
}
.recipient-suggestion span {
    color: #667781;
    font-size: 12px;
}

.table-wrap { overflow-x: auto; }
.stack { display: grid; gap: 12px; }

.api-key-banner {
    background: #ecfdf5;
    border-color: #86efac;
    color: #166534;
    display: grid;
    gap: 12px;
}
.api-key-banner-hint { margin: 6px 0 0; color: #166534; }
.api-copy-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.api-copy-row.is-compact .api-copy-value {
    font-size: 12px;
}
.api-copy-value {
    flex: 1;
    min-width: 0;
    display: block;
    overflow: auto;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #bbf7d0;
    color: #14532d;
    user-select: all;
    white-space: pre-wrap;
    word-break: break-all;
}
.api-copy-input {
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: 13px;
    width: 100%;
    outline: none;
}
.api-key-masked {
    color: #64748b;
}
.api-key-row-fresh td {
    background: #f0fdf4;
}
.api-revoke-btn {
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 700;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
}
.api-docs .api-copy-value,
.api-block .api-copy-value {
    border-color: #e2e8f0;
    color: inherit;
}
.api-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.api-copy-btn:hover { background: #f8fafc; }
.api-copy-btn.is-copied {
    border-color: #86efac;
    background: #ecfdf5;
    color: #166534;
}
.api-copy-ico { font-size: 15px; line-height: 1; }
.api-steps {
    margin: 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
}
.api-docs .api-endpoint {
    padding-top: 4px;
    border-top: 1px solid #eef2f7;
}
.api-docs .api-endpoint:first-child { border-top: 0; padding-top: 0; }
.api-endpoint-title {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.api-endpoint-title code {
    font-size: 13px;
    word-break: break-all;
}
.api-method {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 64px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
}
.api-method.is-get { background: #e0f2fe; color: #075985; }
.api-method.is-post { background: #dcfce7; color: #166534; }
.api-method.is-error { background: #fee2e2; color: #991b1b; }
.api-desc {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.5;
}
.api-desc strong { color: inherit; }
.api-endpoint-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.api-block {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
}
.api-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    background: #fff;
}
.api-block-head h3 {
    margin: 0;
    font-size: 13px;
}
.api-json {
    margin: 0;
    padding: 12px;
    overflow: auto;
    max-height: 420px;
    font-family: "IBM Plex Mono", Consolas, monospace;
    font-size: 12px;
    line-height: 1.45;
    white-space: pre;
    color: #0f172a;
}

@media (max-width: 980px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; z-index: 20; transform: translateX(-105%); width: min(280px, 86vw); transition: transform .2s ease; }
    .nav-toggle:checked ~ .shell .sidebar { transform: none; }
    .menu-btn { display: inline-flex; }
    .stats, .grid-2, .login-shell, .wa-chat, .dash-kpis, .dash-strip, .dash-grid, .form-grid, .company-layout, .api-endpoint-grid { grid-template-columns: 1fr; }
    .form-grid .span-2,
    .form-grid .field-grow { grid-column: auto; }
    .wa-chat { height: 100%; min-height: 0; }
    .wa-main { min-height: 0; height: 100%; }
    .wa-side { display: none; }
    .main:has(.wa-chat),
    .main:has(.wa-inbox) { padding: 0; }
    .wa-inbox,
    .wa-inbox.is-open {
        grid-template-columns: 1fr;
        border-radius: 0;
        border: 0;
    }
    .wa-inbox-menu { display: inline-flex; }
    .wa-inbox.is-open .wa-inbox-pane { display: none; }
    .wa-inbox:not(.is-open) .wa-inbox-stage { display: none; }
    .wa-inbox .wa-back { display: inline-block; }
    .wa-inbox .wa-chat {
        grid-template-columns: 1fr;
    }
    .login-hero { padding: 32px; min-height: 240px; }
    .login-hero h1 { font-size: 44px; }
    .main { padding: 18px 14px 32px; }
    .kv { grid-template-columns: 1fr; }
    .dash-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
