:root {
    color-scheme: dark;
    --bg: #050b11;
    --surface: #0b1520;
    --surface-2: #111f2b;
    --text: #effff9;
    --muted: #7f9995;
    --line: #1d3440;
    --brown: #00e5a0;
    --brown-dark: #70ffd5;
    --gold: #11d7d3;
    --gold-soft: #0a302d;
    --green: #20e39b;
    --red: #fb7185;
    --shadow: 0 18px 50px rgba(2, 4, 20, .25);
    --radius: 18px;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f3f6fb;
    --surface: #ffffff;
    --surface-2: #eef2f8;
    --text: #17233a;
    --muted: #697690;
    --line: #d9e1ee;
    --brown-dark: #008e69;
    --gold-soft: color-mix(in srgb, var(--gold) 12%, #ffffff);
    --green: #159b6c;
    --red: #dc5269;
    --shadow: 0 16px 38px rgba(36, 51, 86, .10);
}

:root[data-theme="dark"] {
    --bg: #050b11;
    --surface: #0b1520;
    --surface-2: #111f2b;
    --text: #effff9;
    --muted: #7f9995;
    --line: #1d3440;
    --brown: #00e5a0;
    --brown-dark: #70ffd5;
    --gold: #11d7d3;
    --gold-soft: #0a302d;
    --green: #20e39b;
    --red: #fb7185;
    --shadow: 0 18px 50px rgba(0, 0, 0, .3);
}

* { box-sizing: border-box; }
html { min-width: 0; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { min-width: 0; margin: 0; background: radial-gradient(circle at 74% 7%, rgba(124,58,237,.09), transparent 26%), var(--bg); color: var(--text); font-family: "Cairo", Tahoma, Arial, sans-serif; font-size: 14px; overflow-wrap: break-word; }
html[dir="ltr"] body { font-family: "Inter", Arial, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
img, picture, video, canvas { max-width: 100%; height: auto; }
audio { max-width: 100%; }
pre { max-width: 100%; overflow: auto; -webkit-overflow-scrolling: touch; }
.muted { color: var(--muted); }
.eyebrow { color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .02em; }

.app-page-loader { position: fixed; z-index: 10000; inset: 0; display: grid; place-items: center; overflow: hidden; direction: rtl; color: #effff9; background-color: #050b11; background-image: linear-gradient(rgba(17,215,211,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(17,215,211,.035) 1px, transparent 1px), radial-gradient(circle at 50% 45%, rgba(17,215,211,.08), transparent 24%); background-size: 62px 62px, 62px 62px, auto; opacity: 1; visibility: visible; transition: opacity .26s ease, visibility .26s ease; }
.app-page-loader[hidden] { display: none; }
.app-page-loader.leaving { opacity: 0; visibility: hidden; pointer-events: none; }
.app-page-loader-center { display: grid; justify-items: center; gap: 17px; padding: 28px; text-align: center; transform: translateY(-3vh); }
.app-page-loader-center strong { color: #a7b9b6; font-size: clamp(13px, 1.2vw, 17px); font-weight: 700; letter-spacing: .01em; }
.app-page-loader-mark { position: relative; width: 66px; height: 66px; display: grid; place-items: center; color: #04110e; background: linear-gradient(145deg, #11d7d3, #00e5a0); border: 1px solid rgba(255,255,255,.35); border-radius: 18px; box-shadow: 0 0 0 0 rgba(17,215,211,.28), 0 18px 50px rgba(0,229,160,.18), inset 0 1px rgba(255,255,255,.5); animation: app-loader-pulse 1.6s ease-in-out infinite; }
.app-page-loader-mark::before, .app-page-loader-mark::after { content: ""; position: absolute; inset: -10px; border: 1px solid rgba(17,215,211,.16); border-radius: 25px; animation: app-loader-ring 1.8s ease-out infinite; }
.app-page-loader-mark::after { animation-delay: .6s; }
.app-page-loader-mark svg { width: 32px; height: 32px; fill: currentColor; filter: drop-shadow(0 1px rgba(255,255,255,.2)); animation: app-loader-bolt 1.1s ease-in-out infinite; }
.app-page-loader-dots { display: inline-block; width: 1.4em; overflow: hidden; vertical-align: bottom; animation: app-loader-dots 1.25s steps(4,end) infinite; }
.app-page-loader-progress { position: absolute; inset-inline: 0; bottom: 0; height: 3px; overflow: hidden; background: rgba(255,255,255,.035); }
.app-page-loader-progress i { width: 45%; height: 100%; display: block; background: linear-gradient(90deg, transparent, #11d7d3 30%, #00e5a0 70%, transparent); filter: drop-shadow(0 0 7px rgba(0,229,160,.8)); animation: app-loader-progress 1.15s ease-in-out infinite; }

@keyframes app-loader-pulse { 0%,100% { transform: translateY(0) scale(1); box-shadow: 0 0 0 0 rgba(17,215,211,.25), 0 18px 50px rgba(0,229,160,.18), inset 0 1px rgba(255,255,255,.5); } 50% { transform: translateY(-5px) scale(1.04); box-shadow: 0 0 0 10px rgba(17,215,211,0), 0 24px 62px rgba(0,229,160,.26), inset 0 1px rgba(255,255,255,.5); } }
@keyframes app-loader-ring { 0% { opacity: .7; transform: scale(.78); } 100% { opacity: 0; transform: scale(1.36); } }
@keyframes app-loader-bolt { 0%,100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(4deg) scale(1.09); } }
@keyframes app-loader-dots { 0% { width: 0; } 100% { width: 1.4em; } }
@keyframes app-loader-progress { 0% { transform: translateX(-110%); } 100% { transform: translateX(245%); } }

@media (prefers-reduced-motion: reduce) {
    .app-page-loader-mark, .app-page-loader-mark::before, .app-page-loader-mark::after, .app-page-loader-mark svg, .app-page-loader-dots, .app-page-loader-progress i { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

.app-shell { min-height: 100vh; min-height: 100dvh; }
.sidebar { position: fixed; inset: 0 0 0 auto; z-index: 30; width: 280px; padding: 22px 18px; color: #fff; background: linear-gradient(165deg, #171b38 0%, #21164d 100%); display: flex; flex-direction: column; box-shadow: -8px 0 34px rgba(3,4,20,.32); transition: width .24s ease, padding .24s ease, transform .25s ease; }
.sidebar-collapse-toggle { position: absolute; z-index: 2; inset-inline-end: -16px; top: 92px; width: 32px; height: 32px; display: grid; place-items: center; color: var(--brown-dark); background: var(--surface); border: 1px solid color-mix(in srgb,var(--brown) 45%,var(--line)); border-radius: 50%; box-shadow: 0 8px 24px rgba(0,0,0,.28); font-size: 21px; line-height: 1; transition: .2s ease; }
.sidebar-collapse-toggle:hover { color: #001710; background: var(--brown); transform: scale(1.06); }
.brand { display: flex; align-items: center; gap: 12px; padding: 5px 8px 22px; }
.brand-mark { width: 46px; height: 46px; flex: none; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg, #9b6cff, #6d28d9); font-size: 26px; font-weight: 800; box-shadow: inset 0 1px rgba(255,255,255,.25), 0 10px 24px rgba(109,40,217,.26); }
.brand-logo { width: 54px; height: 54px; flex: none; padding: 3px; object-fit: contain; color: #d9b65d; background: #070706; border: 1px solid rgba(215,169,30,.55); border-radius: 15px; box-shadow: 0 11px 28px rgba(0,0,0,.3); }
.brand > span:last-child { min-width: 0; }
.brand strong, .brand small { display: block; }
.brand strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.brand small { margin-top: 2px; overflow: hidden; color: rgba(255,255,255,.6); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.nav-list { display: flex; flex: 1; flex-direction: column; gap: 5px; overflow-y: auto; overflow-x: hidden; padding: 6px 0; }
.nav-heading { color: rgba(255,255,255,.42); font-size: 10px; font-weight: 700; padding: 18px 12px 6px; }
.nav-link { min-height: 44px; padding: 10px 12px; border-radius: 11px; display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.75); font-weight: 600; transition: .2s ease; }
.nav-link span { width: 22px; color: #b79cff; font-size: 18px; text-align: center; }
.nav-link small { margin-inline-start: auto; padding: 2px 7px; border-radius: 9px; color: rgba(255,255,255,.45); background: rgba(255,255,255,.06); font-size: 9px; }
.nav-link:hover, .nav-link.active { color: #fff; background: rgba(255,255,255,.1); transform: translateX(-2px); }
.nav-link.active { box-shadow: inset -3px 0 var(--gold); }
.nav-link.disabled { cursor: default; opacity: .55; }
.nav-group { border: 1px solid transparent; border-radius: 12px; transition: .2s ease; }
.nav-group[open] { padding-bottom: 4px; border-color: rgba(255,255,255,.08); background: rgba(2,8,20,.16); }
.nav-group-toggle { min-height: 43px; padding: 9px 11px; display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.72); border-radius: 11px; cursor: pointer; list-style: none; font-size: 12px; font-weight: 700; transition: .2s ease; user-select: none; }
.nav-group-toggle::-webkit-details-marker { display: none; }
.nav-group-toggle::marker { content: ""; }
.nav-group-toggle > span { width: 22px; flex: none; color: #b79cff; font-size: 18px; text-align: center; }
.nav-group-toggle > b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-group-toggle > i { margin-inline-start: auto; color: rgba(255,255,255,.45); font-size: 15px; font-style: normal; transition: transform .2s ease; }
.nav-group-toggle:hover, .nav-group[open] > .nav-group-toggle { color: #fff; background: rgba(255,255,255,.08); }
.nav-group[open] > .nav-group-toggle > i { transform: rotate(180deg); }
.nav-group-links { padding: 3px 7px 2px; display: grid; gap: 2px; }
.nav-group:not([open]) > .nav-group-links { display: none; }
.nav-group-links .nav-link { min-height: 38px; padding-block: 7px; padding-inline: 13px 10px; font-size: 11px; }
.nav-group-links .nav-link span { font-size: 16px; }
.nav-link-placeholder { width: 100%; border: 0; text-align: start; background: transparent; font-family: inherit; }
.nav-link-placeholder:disabled { cursor: not-allowed; opacity: .78; }
.nav-link-placeholder:disabled:hover { color: rgba(255,255,255,.75); background: rgba(255,255,255,.04); transform: none; }
.nav-group-ai[open] { border-color: rgba(17,215,211,.2); }
.nav-group-ai > .nav-group-toggle > span, .nav-group-ai .nav-link > span { color: #11d7d3; }
.nav-group-ai .nav-link small { color: #00e5a0; background: rgba(0,229,160,.1); }
.sidebar-user { display: flex; align-items: center; gap: 10px; padding: 14px 8px 0; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-user .avatar { color: #fff; background: #7c3aed; }
.sidebar-user span:nth-child(2) { min-width: 0; flex: 1; }
.sidebar-user strong, .sidebar-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: rgba(255,255,255,.55); font-size: 10px; }
.icon-button { width: 36px; height: 36px; border: 0; border-radius: 10px; color: inherit; background: transparent; font-size: 19px; }
.sidebar-user .icon-button:hover { background: rgba(255,255,255,.1); }

.main-area { min-height: 100vh; min-height: 100dvh; margin-right: 280px; }
.topbar { min-height: 88px; padding: 19px 32px; display: flex; align-items: center; gap: 18px; background: color-mix(in srgb, var(--surface) 90%, transparent); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.topbar h1, .topbar p { margin: 0; }
.topbar h1 { font-size: 20px; }
.topbar p { color: var(--muted); font-size: 11px; margin-top: 3px; }
.topbar-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.topbar-actions .icon-button { color: var(--brown-dark); background: var(--surface-2); }
.language-switch { margin: 0; }
.language-switch button { min-height: 36px; padding: 6px 11px; display: inline-flex; align-items: center; gap: 6px; color: var(--brown-dark); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: 11px; font-weight: 800; }
.language-switch button:hover { color: #fff; background: var(--brown); border-color: var(--brown); }
.login-language-switch { position: fixed; z-index: 10; inset-block-start: 18px; inset-inline-end: 18px; }
.login-language-switch button { min-width: 82px; color: #fff; background: rgba(23,27,56,.86); border-color: rgba(255,255,255,.18); backdrop-filter: blur(12px); }
.status-dot { width: 8px; height: 8px; background: #3ab47e; border-radius: 50%; box-shadow: 0 0 0 4px rgba(58,180,126,.12); }
.mobile-menu { display: none; border: 0; color: var(--brown); background: var(--surface-2); border-radius: 10px; width: 38px; height: 38px; }
.mobile-sidebar-backdrop { display: none; }
.content { max-width: 1460px; margin: auto; padding: 28px 32px 48px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.panel-header.padded { padding: 23px 25px 0; }
.panel-header h3 { margin: 4px 0 0; font-size: 18px; }
.welcome-card { min-height: 160px; padding: 28px 34px; overflow: hidden; position: relative; color: #fff; background: linear-gradient(115deg, #29205f, #171b3b); border: 1px solid #3d3672; border-radius: 22px; display: flex; align-items: center; box-shadow: 0 20px 45px rgba(3,5,25,.28); }
.welcome-card h2 { margin: 7px 0 5px; font-size: clamp(22px, 3vw, 30px); }
.welcome-card p { margin: 0; color: rgba(255,255,255,.68); }
.welcome-card .arabesque { margin-inline-start: auto; width: 115px; height: 115px; border: 1px solid rgba(255,255,255,.12); outline: 1px solid rgba(255,255,255,.07); outline-offset: 10px; border-radius: 50% 42% 50% 44%; display: grid; place-items: center; color: #c4b5fd; font-size: 66px; transform: rotate(-8deg); }
.stats-grid { margin: 22px 0; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; }
.stat-card { position: relative; overflow: hidden; min-height: 135px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.stat-card::after { content: ""; position: absolute; inset: auto auto -22px -15px; width: 75px; height: 75px; border-radius: 50%; opacity: .12; background: currentColor; }
.stat-card .stat-label, .stat-card strong, .stat-card small { display: block; }
.stat-card .stat-label { color: var(--muted); font-size: 11px; }
.stat-card strong { color: var(--text); font-size: 27px; margin: 7px 0 4px; }
.stat-card small { color: var(--muted); font-size: 9px; }
.stat-card.gold { color: #a78bfa; border-top: 3px solid #a78bfa; }
.stat-card.brown { color: #8b5cf6; border-top: 3px solid #8b5cf6; }
.stat-card.green { color: #34d399; border-top: 3px solid #34d399; }
.stat-card.blue { color: #60a5fa; border-top: 3px solid #60a5fa; }
.two-column { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .8fr); gap: 20px; }
.two-column > .panel { padding: 25px; }
.phase-list { display: grid; gap: 5px; }
.phase { padding: 10px 4px; display: flex; gap: 13px; align-items: center; color: var(--muted); border-bottom: 1px solid var(--line); }
.phase:last-child { border-bottom: 0; }
.phase > span { width: 31px; height: 31px; flex: none; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-weight: 800; font-size: 11px; }
.phase strong, .phase small { display: block; }
.phase strong { color: var(--text); font-size: 12px; }
.phase small { font-size: 9px; }
.phase.done > span { color: #fff; border-color: var(--green); background: var(--green); }
.phase.next { border-radius: 10px; background: var(--gold-soft); padding-inline: 10px; }
.phase.next > span { color: #fff; border-color: var(--gold); background: #7c3aed; }
.quick-actions a { display: flex; align-items: center; gap: 12px; padding: 15px 3px; border-bottom: 1px solid var(--line); }
.quick-actions a:last-child { border-bottom: 0; }
.quick-actions a:hover b { transform: translateX(-4px); }
.quick-actions strong, .quick-actions small { display: block; }
.quick-actions small { color: var(--muted); font-size: 9px; }
.quick-actions b { margin-inline-start: auto; color: var(--gold); transition: .2s; }
.quick-icon { width: 39px; height: 39px; display: grid; place-items: center; color: var(--brown); background: var(--surface-2); border-radius: 11px; font-size: 18px; }

.control-center-hero {
    min-height: 150px;
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 28px 32px;
    overflow: hidden;
    position: relative;
    color: var(--text);
    background:
        radial-gradient(circle at 10% 50%,color-mix(in srgb,var(--brown) 18%,transparent),transparent 30%),
        linear-gradient(120deg,color-mix(in srgb,var(--surface) 94%,var(--brown) 6%),var(--surface));
    border: 1px solid color-mix(in srgb,var(--brown) 40%,var(--line));
    border-radius: 20px;
}
.control-center-hero h2 { margin: 7px 0 6px; font-size: clamp(24px,3vw,34px); }
.control-center-hero p { max-width: 780px; margin: 0; color: var(--muted); line-height: 1.8; }
.control-center-hero-icon {
    width: 88px;
    height: 88px;
    margin-inline-start: auto;
    flex: 0 0 88px;
    display: grid;
    place-items: center;
    color: var(--brown-dark);
    background: color-mix(in srgb,var(--brown) 12%,transparent);
    border: 1px solid color-mix(in srgb,var(--brown) 35%,transparent);
    border-radius: 24px;
    font-size: 38px;
}
.control-center-stats { margin-block: 18px 24px; }
.control-center-section { display: grid; gap: 15px; }
.control-center-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.control-center-heading h3 { margin: 3px 0 0; font-size: 20px; }
.control-center-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(205px,1fr));
    gap: 10px;
}
.control-center-card {
    --action-color: #16a085;
    min-height: 142px;
    display: grid;
    grid-template-columns: 46px 1fr auto;
    grid-template-rows: auto 1fr;
    gap: 12px;
    padding: 14px;
    position: relative;
    overflow: hidden;
    color: var(--text);
    background:
        linear-gradient(rgba(255,255,255,.012),rgba(255,255,255,.012)),
        repeating-linear-gradient(90deg,transparent 0 43px,color-mix(in srgb,var(--line) 30%,transparent) 44px),
        var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    transition: transform .18s ease,border-color .18s ease,box-shadow .18s ease;
}
.control-center-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb,var(--action-color) 52%,var(--line));
    box-shadow: 0 16px 34px color-mix(in srgb,var(--action-color) 13%,transparent);
}
.control-center-card-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    color: var(--action-color);
    background: color-mix(in srgb,var(--action-color) 12%,transparent);
    border: 1px solid color-mix(in srgb,var(--action-color) 38%,transparent);
    border-radius: 10px;
    font-size: 17px;
    font-weight: 900;
}
.control-center-card-copy {
    min-width: 0;
    grid-column: 1 / -1;
    align-self: end;
    display: grid;
    gap: 5px;
}
.control-center-card-copy strong { font-size: 11px; }
.control-center-card-copy small { min-height: 29px; color: var(--muted); line-height: 1.6; font-size: 8px; }
.control-center-card > b {
    align-self: center;
    color: color-mix(in srgb,var(--action-color) 70%,var(--muted));
    font-size: 18px;
    transition: transform .18s ease;
}
.control-center-card:hover > b { transform: translateX(-3px); }
.control-center-card-tag {
    align-self: start;
    justify-self: end;
    padding: 3px 6px;
    color: var(--action-color);
    background: color-mix(in srgb,var(--action-color) 10%,transparent);
    border: 1px solid color-mix(in srgb,var(--action-color) 32%,transparent);
    border-radius: 999px;
    font-size: 6px;
    font-weight: 800;
}
.control-center-card.tone-emerald { --action-color: #00d69a; }
.control-center-card.tone-blue { --action-color: #2f9ff4; }
.control-center-card.tone-cyan { --action-color: #11c5ca; }
.control-center-card.tone-violet { --action-color: #9878f5; }
.control-center-card.tone-magenta { --action-color: #df6fc4; }
.control-center-card.tone-amber { --action-color: #f2ad17; }
.control-center-card.tone-slate { --action-color: #93a4b8; }

.button { min-height: 42px; padding: 9px 18px; border: 1px solid transparent; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-weight: 700; transition: .2s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #fff; background: linear-gradient(110deg, #6d28d9, var(--brown)); box-shadow: 0 10px 24px rgba(109,40,217,.26); }
.button.primary:hover { background: var(--brown-dark); }
.button.secondary { color: var(--brown-dark); background: var(--surface); border-color: var(--line); }
.button.wide { width: 100%; }
.text-link { color: var(--brown); font-weight: 700; }
.badge, .role-pill, .lock-chip, .field-status { display: inline-flex; align-items: center; width: max-content; padding: 4px 9px; border-radius: 20px; font-size: 9px; font-weight: 700; }
.badge.success { color: #8df1c8; background: rgba(52,211,153,.12); }
.badge.muted, .role-pill { color: var(--muted); background: var(--surface-2); }
.badge.gold { color: #d8ccff; background: var(--gold-soft); }
.lock-chip { color: var(--brown); background: var(--surface-2); }
.alert { margin-bottom: 18px; padding: 12px 15px; border-radius: 11px; border: 1px solid; font-size: 12px; }
.alert ul { margin: 6px 18px 0 0; }
.alert.success { color: #b9f6dd; background: #173e36; border-color: #286653; }
.alert.danger { color: #fecdd3; background: #4b1d2c; border-color: #7f2941; }
.alert.warning { color: #e9ddff; background: #33285f; border-color: #59468e; }

.whatsapp-global-status[hidden] { display: none; }
.whatsapp-global-status { display: flex; align-items: center; gap: 13px; margin-bottom: 18px; padding: 14px 16px; color: #fff1f2; background: linear-gradient(115deg,#4c0519,#881337); border: 1px solid #be123c; border-radius: 14px; box-shadow: 0 14px 30px rgba(76,5,25,.25); }
.whatsapp-status-icon { display: inline-grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; color: #881337; background: #fecdd3; border-radius: 50%; font-size: 20px; font-weight: 900; }
.whatsapp-status-copy { display: grid; flex: 1; gap: 3px; min-width: 0; }
.whatsapp-status-copy strong { font-size: 13px; }
.whatsapp-status-copy small { color: #fecdd3; font-size: 10px; line-height: 1.7; }
.whatsapp-status-actions { display: flex; align-items: center; gap: 8px; }
.whatsapp-status-actions .button { min-height: 36px; padding: 9px 13px; white-space: nowrap; }
.whatsapp-status-actions small { max-width: 250px; color: #fecdd3; font-size: 10px; line-height: 1.6; }
.whatsapp-global-status[aria-busy="true"] { opacity: .82; }

.section-actions { margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.inline-actions { display: flex; align-items: center; gap: 8px; }
.link-button { padding: 0; border: 0; background: transparent; font: inherit; font-weight: 700; }
.link-button.danger { color: var(--red); }
.summary-chip { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.summary-chip strong { min-width: 35px; height: 35px; padding: 7px; text-align: center; color: var(--brown); background: var(--surface-2); border-radius: 10px; }
.table-panel { overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 13px 18px; color: var(--muted); background: var(--surface-2); font-size: 10px; font-weight: 700; text-align: right; white-space: nowrap; }
html[dir="ltr"] th { text-align: left; }

html[dir="ltr"] .sidebar { inset: 0 auto 0 0; box-shadow: 8px 0 34px rgba(3,4,20,.32); }
html[dir="ltr"] .main-area { margin-right: 0; margin-left: 280px; }
html[dir="ltr"] .nav-link:hover, html[dir="ltr"] .nav-link.active { transform: translateX(2px); }
html[dir="ltr"] .nav-link.active { box-shadow: inset 3px 0 var(--gold); }
html[dir="ltr"] .quick-actions a:hover b { transform: translateX(4px); }
html[dir="ltr"] .control-center-card:hover > b { transform: translateX(3px); }

@media (max-width: 820px) {
    html[dir="ltr"] .sidebar { transform: translateX(-105%); }
    html[dir="ltr"] .sidebar.open { transform: translateX(0); }
    html[dir="ltr"] .main-area { margin-left: 0; }
}

@media (min-width: 821px) {
    html[dir="ltr"][data-sidebar="collapsed"] .main-area { margin-left: 88px; margin-right: 0; }
}
td { padding: 15px 18px; border-top: 1px solid var(--line); font-size: 11px; white-space: nowrap; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 42%, transparent); }
.person-cell { display: flex; align-items: center; gap: 10px; }
.person-cell strong, .person-cell small { display: block; }
.person-cell small { color: var(--muted); font-size: 9px; direction: ltr; }
.avatar { width: 37px; height: 37px; flex: none; display: grid; place-items: center; color: #fff; background: var(--brown); border-radius: 11px; font-weight: 800; }
.contact-row-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.contact-row-actions form, .inline-actions form { margin: 0; }
.contact-whatsapp-action, .whatsapp-button { border: 1px solid color-mix(in srgb, #22c55e 62%, var(--line)); color: #ecfdf5; background: color-mix(in srgb, #16a34a 82%, var(--surface)); }
.contact-whatsapp-action { min-height: 34px; padding: 6px 10px; display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; font: inherit; font-size: 10px; font-weight: 800; cursor: pointer; transition: .2s; }
.contact-whatsapp-action:hover, .whatsapp-button:hover { transform: translateY(-1px); background: #16a34a; box-shadow: 0 8px 20px rgba(22,163,74,.2); }
.contact-whatsapp-action svg, .whatsapp-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.whatsapp-button svg { width: 19px; height: 19px; }
.empty-state { padding: 55px; text-align: center; color: var(--muted); }
.pagination { padding: 13px 18px; display: flex; justify-content: space-between; color: var(--muted); border-top: 1px solid var(--line); font-size: 10px; }
.pagination a { margin-inline-start: 7px; padding: 5px 10px; color: var(--brown); background: var(--surface-2); border-radius: 7px; }

.form-panel { padding: 26px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.form-grid.compact { margin-bottom: 25px; }
.form-grid .full-span { grid-column: 1 / -1; }
.branding-editor { margin-bottom: 24px; padding: 20px; display: grid; grid-template-columns: 190px minmax(0,1fr); align-items: center; gap: 24px; background: linear-gradient(135deg,color-mix(in srgb,var(--gold) 8%,var(--surface-2)),var(--surface-2)); border: 1px solid color-mix(in srgb,var(--gold) 28%,var(--line)); border-radius: 16px; }
.branding-preview-frame { width: 190px; height: 190px; padding: 9px; display: grid; place-items: center; background: #050505; border: 1px solid rgba(215,169,30,.48); border-radius: 20px; box-shadow: 0 16px 38px rgba(0,0,0,.24); }
.branding-preview-frame img { width: 100%; height: 100%; object-fit: contain; border-radius: 13px; }
.branding-upload-copy h4 { margin: 4px 0 6px; font-size: 17px; }
.branding-upload-copy > p { max-width: 630px; margin: 0 0 15px; color: var(--muted); font-size: 10px; line-height: 1.9; }
.logo-file-input { padding: 6px !important; cursor: pointer; }
.logo-file-input::file-selector-button { min-height: 32px; margin-inline-end: 10px; padding: 5px 13px; color: #fff; background: var(--brown); border: 0; border-radius: 8px; cursor: pointer; }
label { color: var(--text); font-size: 11px; font-weight: 700; }
label small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; font-weight: 500; }
input:not([type="checkbox"]):not([type="color"]), select, textarea { width: 100%; min-height: 44px; margin-top: 7px; padding: 9px 12px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; outline: 0; transition: .2s; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(139,92,246,.15); }
.full-span { grid-column: 1 / -1; }
.form-divider { margin: 28px 0 18px; padding-top: 22px; border-top: 1px solid var(--line); }
.form-divider h3 { margin: 4px 0 0; }
.checkbox-grid { margin-top: 22px; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.filters-bar { margin-bottom: 16px; padding: 14px 18px; display: flex; align-items: end; gap: 10px; }
.filters-bar .search-field { width: min(560px, 100%); }
.contact-actions { flex-wrap: wrap; }
.transfer-dialog { width: min(650px, calc(100vw - 28px)); padding: 0; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 19px; box-shadow: 0 32px 90px rgba(1,3,18,.58); }
.transfer-dialog::backdrop { background: rgba(4,6,25,.76); backdrop-filter: blur(6px); }
.transfer-dialog-head { padding: 19px 22px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.transfer-dialog-head > div { display: flex; align-items: center; gap: 11px; }
.transfer-dialog-head > div > span { width: 38px; height: 38px; display: grid; place-items: center; color: var(--gold); background: var(--gold-soft); border-radius: 11px; font-size: 20px; font-weight: 800; }
.transfer-dialog-head small { display: block; color: var(--muted); font-size: 9px; }
.transfer-dialog-head h3 { margin: 2px 0 0; font-size: 16px; }
.transfer-dialog-head > button { width: 34px; height: 34px; color: var(--muted); background: transparent; border: 0; border-radius: 9px; font-size: 22px; }
.transfer-dialog-head > button:hover { color: var(--text); background: var(--surface-2); }
.transfer-dialog form { padding: 22px; }
.file-drop-field { padding: 18px; display: block; background: var(--surface-2); border: 1px dashed color-mix(in srgb, var(--gold) 52%, var(--line)); border-radius: 14px; }
.file-drop-field > span { display: block; margin-bottom: 8px; font-weight: 800; }
.file-drop-field input { margin: 0 0 8px; background: var(--surface); }
.file-drop-field small, .transfer-notes p { display: block; color: var(--muted); line-height: 1.8; }
.transfer-notes { margin-top: 14px; padding: 15px 17px; background: color-mix(in srgb, var(--gold-soft) 58%, var(--surface)); border: 1px solid var(--line); border-radius: 13px; }
.transfer-notes p { margin: 5px 0 9px; }
.import-result { margin-bottom: 16px; }
.import-result ul { margin: 7px 18px 0 0; }
.report-filters { margin-bottom: 13px; padding: 15px 18px; display: grid; grid-template-columns: minmax(160px,1.1fr) repeat(2,minmax(145px,.8fr)) auto auto; align-items: end; gap: 11px; }
.report-filters label { min-width: 0; }
.report-filters input, .report-filters select { margin-top: 5px; }
.report-filters [data-custom-date]:not(.is-custom) { opacity: .62; }
.report-range-line { margin: 0 2px 18px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 10px; }
.report-range-line small { margin-inline-start: auto; }
.report-kpis { margin-bottom: 18px; display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
.report-kpi { min-width: 0; padding: 18px; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 10px 28px rgba(2,4,24,.18); }
.report-kpi::before { content:""; width: 7px; position: absolute; inset-block: 0; inset-inline-start: 0; background: var(--kpi-color); }
.report-kpi::after { content:""; width: 75px; height: 75px; position: absolute; inset: -30px auto auto -25px; background: color-mix(in srgb,var(--kpi-color) 18%,transparent); border-radius: 50%; }
.report-kpi.purple { --kpi-color:#8b5cf6; } .report-kpi.blue { --kpi-color:#60a5fa; } .report-kpi.lavender { --kpi-color:#c4b5fd; } .report-kpi.green { --kpi-color:#34d399; } .report-kpi.pink { --kpi-color:#fb7185; }
.report-kpi span, .report-kpi small { display: block; color: var(--muted); }
.report-kpi strong { display: block; margin: 7px 0 4px; color: var(--text); font-size: 25px; }
.report-kpi small { font-size: 8px; }
.report-grid { margin-bottom: 18px; display: grid; gap: 18px; }
.report-grid-main { grid-template-columns: minmax(0,1.55fr) minmax(330px,.8fr); }
.report-grid-distributions { grid-template-columns: repeat(2,minmax(0,1fr)); }
.report-card { min-width: 0; padding: 20px; }
.report-card-head { margin-bottom: 18px; display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.report-card-head h3 { margin: 2px 0 3px; font-size: 16px; }
.report-card-head p { margin: 0; color: var(--muted); font-size: 9px; }
.report-total { color: var(--gold); font-weight: 800; }
.conversation-period-totals { display: flex; align-items: center; gap: 7px; }
.conversation-period-totals span { min-width: 70px; padding: 8px 10px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; text-align: center; font-size: 8px; }
.conversation-period-totals b { margin-bottom: 2px; display: block; color: var(--text); font-size: 13px; }
.report-line-chart { min-height: 230px; direction: ltr; }
.report-line-chart svg { width: 100%; height: 230px; overflow: visible; }
.chart-grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 5; }
.chart-line { fill: none; stroke: #9b6cff; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 5px 7px rgba(124,58,237,.3)); }
.chart-point { fill: #11152f; stroke: #c4b5fd; stroke-width: 3; }
.chart-x-label, .chart-y-label { fill: var(--muted); font-family: Cairo,sans-serif; font-size: 8px; text-anchor: middle; }
.chart-y-label { text-anchor: start; }
.funnel-list { display: grid; gap: 14px; }
.funnel-row { display: grid; grid-template-columns: minmax(125px,1fr) minmax(80px,1.25fr) 30px; align-items: center; gap: 9px; }
.funnel-row > div:first-child { min-width: 0; display: flex; align-items: center; gap: 7px; }
.funnel-row .stage-dot { background: var(--funnel-color); }
.funnel-row strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.funnel-row small { margin-inline-start: auto; color: var(--muted); font-size: 8px; }
.funnel-row > b { color: var(--text); text-align: center; }
.funnel-track { height: 9px; overflow: hidden; background: var(--surface-2); border-radius: 999px; }
.funnel-track span { width: var(--funnel-width); height: 100%; display: block; background: linear-gradient(90deg,var(--funnel-color),color-mix(in srgb,var(--funnel-color) 48%,#c4b5fd)); border-radius: inherit; }
.distribution-list { display: grid; gap: 14px; }
.distribution-row > div:first-child { margin-bottom: 5px; display: flex; justify-content: space-between; gap: 10px; }
.distribution-row strong { font-size: 10px; }
.distribution-row span { color: var(--muted); font-size: 9px; }
.distribution-row > div:last-child { height: 8px; overflow: hidden; background: var(--surface-2); border-radius: 999px; }
.distribution-row > div:last-child span { height: 100%; display: block; background: linear-gradient(90deg,#6d28d9,#a78bfa); border-radius: inherit; }
.distribution-list.sources .distribution-row > div:last-child span { background: linear-gradient(90deg,#2563eb,#60a5fa); }
.report-agents { margin-bottom: 10px; }
.report-agents .badge { white-space: nowrap; }
.phone-cell { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
.form-actions { margin-top: 26px; padding-top: 18px; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.role-card { padding: 22px; }
.role-card-head { display: flex; justify-content: space-between; }
.role-symbol { width: 42px; height: 42px; display: grid; place-items: center; color: var(--brown); background: var(--gold-soft); border-radius: 13px; }
.role-card h3 { margin: 16px 0 1px; }
.role-card code { color: var(--muted); font-size: 10px; }
.role-card p { min-height: 38px; color: var(--muted); font-size: 10px; }
.permissions-wrap { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
.permission-group { margin: 0; padding: 15px; border: 1px solid var(--line); border-radius: 13px; }
.permission-group legend { padding: 0 8px; color: var(--brown); font-size: 11px; font-weight: 800; }
.permission-row { padding: 8px 4px; display: flex; align-items: center; gap: 9px; cursor: pointer; }
.permission-row + .permission-row { border-top: 1px dashed var(--line); }
.permission-row input { accent-color: var(--brown); }
.permission-row strong, .permission-row small { display: block; }
.permission-row small { margin: 1px 0 0; direction: ltr; text-align: right; }
.employee-hero, .employee-activity-hero { margin-bottom: 18px; padding: 25px 27px; display: flex; align-items: center; justify-content: space-between; gap: 22px; overflow: hidden; position: relative; background: linear-gradient(120deg,color-mix(in srgb,var(--brown) 13%,var(--surface)),var(--surface)); border-color: color-mix(in srgb,var(--brown) 36%,var(--line)); }
.employee-hero::after, .employee-activity-hero::after { content: ""; width: 230px; height: 230px; position: absolute; inset: -135px auto auto -55px; background: radial-gradient(circle,color-mix(in srgb,var(--brown) 18%,transparent),transparent 70%); pointer-events: none; }
.employee-hero > *, .employee-activity-hero > * { position: relative; z-index: 1; }
.employee-hero h2, .employee-activity-hero h2 { margin: 5px 0 4px; font-size: clamp(23px,3vw,31px); }
.employee-hero p, .employee-activity-hero p { max-width: 720px; margin: 0; color: var(--muted); font-size: 10px; line-height: 1.9; }
.employee-hero-actions { display: flex; align-items: center; gap: 10px; }
.employee-stats { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.employee-stats.four { grid-template-columns: repeat(4,minmax(0,1fr)); }
.employee-stats article { min-height: 100px; padding: 17px 19px; position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: 15px; box-shadow: var(--shadow); }
.employee-stats article::after { content: ""; width: 70px; height: 70px; position: absolute; inset: auto auto -35px -25px; background: color-mix(in srgb,var(--brown) 13%,transparent); border-radius: 50%; }
.employee-stats span { display: block; color: var(--muted); font-size: 9px; }
.employee-stats strong { display: block; margin-top: 7px; font-size: 25px; }
.permission-mode-picker { margin-bottom: 16px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.permission-mode-picker label { padding: 15px; display: flex; align-items: center; gap: 11px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; cursor: pointer; }
.permission-mode-picker label.selected { background: color-mix(in srgb,var(--brown) 11%,var(--surface)); border-color: var(--brown); }
.permission-mode-picker input { accent-color: var(--brown); }
.permission-mode-picker strong, .permission-mode-picker small { display: block; }
.employee-permissions { transition: opacity .2s ease; }
.employee-permissions.is-disabled { opacity: .48; }
.employee-activity-filters { margin-bottom: 18px; padding: 16px 18px; display: grid; grid-template-columns: minmax(180px,1fr) minmax(180px,1fr) minmax(220px,1.3fr) auto auto; align-items: end; gap: 10px; }
.employee-timeline { overflow: hidden; }
.employee-timeline-list { padding: 0 20px 18px; display: grid; gap: 8px; }
.employee-timeline-list article { padding: 13px 14px; display: grid; grid-template-columns: 38px minmax(145px,.8fr) minmax(190px,1fr) minmax(140px,.75fr) auto; align-items: center; gap: 12px; background: color-mix(in srgb,var(--surface-2) 60%,var(--surface)); border: 1px solid var(--line); border-radius: 12px; }
.activity-symbol { width: 34px; height: 34px; display: grid; place-items: center; color: var(--brown); background: color-mix(in srgb,var(--brown) 12%,var(--surface)); border: 1px solid color-mix(in srgb,var(--brown) 30%,var(--line)); border-radius: 10px; font-weight: 800; }
.activity-employee strong, .activity-employee small, .activity-copy strong, .activity-copy small, .activity-context span, .activity-context small { display: block; }
.activity-employee small, .activity-copy small, .activity-context small, .employee-timeline time { color: var(--muted); font-size: 8px; }
.activity-copy strong { color: var(--brown-dark); font-size: 10px; }
.activity-context { color: var(--muted); font-size: 9px; }
.employee-timeline time { white-space: nowrap; direction: ltr; }
@media (max-width: 1050px) {
    .employee-stats.four { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .employee-activity-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .employee-timeline-list article { grid-template-columns: 38px minmax(130px,.8fr) minmax(180px,1fr); }
    .activity-context, .employee-timeline time { grid-column: 2 / -1; }
}
@media (max-width: 700px) {
    .employee-hero, .employee-activity-hero { align-items: stretch; flex-direction: column; padding: 20px; }
    .employee-hero-actions { align-items: stretch; flex-direction: column; }
    .employee-hero-actions .button { width: 100%; }
    .permission-mode-picker, .employee-stats, .employee-stats.four, .employee-activity-filters { grid-template-columns: 1fr; }
    .employee-timeline-list { padding-inline: 12px; }
    .employee-timeline-list article { grid-template-columns: 38px 1fr; }
    .activity-copy, .activity-context, .employee-timeline time { grid-column: 2; }
}

.settings-layout { display: grid; grid-template-columns: minmax(0,1fr) 270px; gap: 20px; align-items: start; }
.settings-main { display: grid; gap: 18px; }
.settings-save { padding: 22px; position: sticky; top: 112px; }
.settings-save h3 { margin: 4px 0 8px; }
.channel-pair-grid { margin-bottom: 18px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.channel-card { padding: 15px; display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 13px; }
.channel-card > span { width: 44px; height: 44px; display: grid; place-items: center; color: var(--brown); background: var(--gold-soft); border-radius: 12px; font-size: 10px; font-weight: 800; direction: ltr; }
.channel-card strong, .channel-card small { display: block; }
.channel-card small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.channel-card > b { color: var(--green); font-size: 20px; }
.baileys-fields { margin-top: 18px; }
.field-status { float: left; color: var(--muted); font-size: 9px; }
.field-status.saved { color: var(--green); }
.qr-connect-panel { margin-top: 18px; }
.qr-connection-grid { display: grid; grid-template-columns: minmax(260px,360px) 1fr; gap: 26px; align-items: center; }
.qr-stage { aspect-ratio: 1; padding: 18px; display: grid; place-items: center; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
.qr-stage img { width: 100%; height: 100%; object-fit: contain; }
.qr-placeholder { color: #70789e; text-align: center; }
.qr-placeholder strong { width: 90px; height: 90px; margin: 0 auto 12px; display: grid; place-items: center; color: var(--brown); background: var(--gold-soft); border-radius: 20px; font-size: 27px; direction: ltr; }
.qr-placeholder span { display: block; max-width: 220px; font-size: 10px; line-height: 1.8; }
.device-state { display: flex; align-items: center; gap: 10px; }
.device-state strong, .device-state small { display: block; }
.device-state small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.qr-instructions ol { margin: 20px 0; padding-right: 22px; color: var(--muted); font-size: 10px; line-height: 2.2; }
.linked-device { margin-bottom: 16px; padding: 13px; background: var(--surface-2); border-radius: 11px; }
.linked-device span, .linked-device strong, .linked-device small { display: block; }
.linked-device span { color: var(--muted); font-size: 8px; }
.linked-device small { margin-top: 2px; color: var(--muted); }
.qr-actions { margin-top: 10px; }
.settings-save p, .settings-save li { color: var(--muted); font-size: 10px; }
.settings-save ul { padding-right: 18px; line-height: 2; }
.section-copy { margin: -10px 0 20px; font-size: 10px; }
.field-status { float: left; color: var(--muted); background: var(--surface-2); }
.field-status.configured { color: #8df1c8; background: rgba(52,211,153,.12); }
.facebook-sync-form { align-items: center; }
.facebook-sync-form small { max-width: 280px; line-height: 1.8; }
.table-subtitle, .table-error { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; }
.table-error { max-width: 250px; color: var(--red); white-space: normal; line-height: 1.6; }
.color-input { margin-top: 7px; min-height: 44px; padding: 5px 8px; display: flex; align-items: center; gap: 10px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.color-input input { width: 38px; height: 30px; border: 0; background: transparent; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 15px; background: var(--surface-2); border-radius: 12px; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row input { width: 40px; height: 20px; accent-color: var(--brown); }
.danger-zone .alert { margin: 15px 0 0; }
.settings-hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 18px; }
.settings-hub-card { min-height: 155px; padding: 22px; display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: 1fr auto; align-items: center; gap: 12px 16px; transition: .2s ease; }
.settings-hub-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--gold) 55%, var(--line)); box-shadow: 0 18px 40px rgba(3,5,25,.25); }
.settings-hub-icon { grid-row: 1 / -1; width: 52px; height: 52px; display: grid; place-items: center; color: var(--brown); background: var(--gold-soft); border-radius: 15px; font-size: 24px; font-weight: 800; }
.settings-hub-copy h3 { margin: 4px 0; }
.settings-hub-copy p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.8; }
.settings-hub-card .badge { grid-column: 2; }
.settings-hub-card > b { grid-column: 3; grid-row: 1 / -1; color: var(--gold); font-size: 20px; }
.settings-security-note { margin-top: 18px; padding: 18px 22px; display: flex; align-items: center; gap: 14px; }
.settings-security-note strong, .settings-security-note small { display: block; }
.settings-security-note small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.quick-actions a.settings-dashboard-link { margin: 8px -10px 0; padding: 15px 13px; color: var(--text); background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line)); border-radius: 12px; }
.notification-scope-note { min-height: 110px; padding: 15px 18px; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.notification-scope-note ul { margin: 8px 0 0; padding-right: 18px; color: var(--muted); font-size: 10px; line-height: 2; }

.profile-layout { display: grid; grid-template-columns: minmax(300px,.75fr) minmax(0,1.25fr); gap: 20px; align-items: start; }
.profile-card, .activity-panel { padding: 24px; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.large-avatar { width: 54px; height: 54px; border-radius: 15px; font-size: 20px; }
.profile-head h2, .profile-head p { margin: 0; }
.profile-head h2 { margin-block: 4px 2px; }
.profile-head p { color: var(--muted); font-size: 10px; }
.details-grid { margin: 24px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.details-grid > div { padding: 13px; background: var(--surface-2); border-radius: 11px; }
.details-grid dt { color: var(--muted); font-size: 9px; }
.details-grid dd { margin: 5px 0 0; font-weight: 700; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-list span { padding: 5px 9px; color: var(--brown); background: var(--gold-soft); border-radius: 20px; font-size: 9px; font-weight: 700; }
.custom-data { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.custom-data h3 { margin-top: 0; }
.custom-data > div { padding: 9px 0; display: flex; justify-content: space-between; gap: 10px; border-top: 1px dashed var(--line); font-size: 10px; }
.custom-data span { color: var(--muted); }
.stage-chip { display: inline-flex; align-items: center; gap: 6px; width: max-content; padding: 5px 9px; color: var(--text); background: color-mix(in srgb, var(--stage-color) 13%, var(--surface)); border: 1px solid color-mix(in srgb, var(--stage-color) 35%, var(--line)); border-radius: 20px; font-size: 9px; font-weight: 800; }
.stage-chip::before { content: ""; width: 7px; height: 7px; background: var(--stage-color); border-radius: 50%; }
.lead-summary { padding: 16px 0; border-top: 1px solid var(--line); }
.lead-summary:first-of-type { border-top: 0; }
.lead-summary-head { display: flex; justify-content: space-between; gap: 12px; }
.lead-summary-head strong, .lead-summary-head small { display: block; }
.lead-summary-head small { color: var(--muted); font-size: 9px; }
.timeline { margin-top: 14px; }
.timeline > div { position: relative; padding: 0 20px 15px 0; }
.timeline > div > span { position: absolute; right: 1px; top: 5px; width: 8px; height: 8px; background: var(--gold); border-radius: 50%; }
.timeline > div::after { content: ""; position: absolute; right: 4px; top: 14px; bottom: 0; width: 1px; background: var(--line); }
.timeline > div:last-child::after { display: none; }
.timeline p { margin: 0; }
.timeline strong, .timeline small { display: block; }
.timeline strong { font-size: 10px; }
.timeline small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.activity-form { margin-bottom: 20px; padding: 12px; display: grid; grid-template-columns: 130px 1fr auto; gap: 8px; background: var(--surface-2); border-radius: 12px; }
.activity-form input, .activity-form select { margin-top: 0; }
.full-timeline { max-height: 520px; overflow-y: auto; }

.conversation-list { overflow: hidden; }
.conversation-row { min-height: 92px; padding: 17px 21px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); transition: .2s; }
.conversation-row:last-child { border-bottom: 0; }
.conversation-row:hover { background: var(--surface-2); }
.conversation-copy { min-width: 0; flex: 1; }
.conversation-title { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.conversation-title small, .conversation-preview { color: var(--muted); font-size: 9px; }
.conversation-preview { display: block; margin: 5px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.conversation-meta b { padding: 3px 7px; color: var(--muted); background: var(--surface-2); border-radius: 20px; font-size: 8px; }
.conversation-meta .ai-label, .ai-message-label { color: #d8ccff; background: var(--gold-soft); }
.unread-badge { min-width: 25px; height: 25px; padding: 4px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-size: 9px; font-weight: 800; }
.conversation-arrow { color: var(--gold); font-size: 18px; }
.chat-layout { display: grid; grid-template-columns: minmax(0,1fr) 290px; gap: 20px; align-items: start; }
.chat-panel { overflow: hidden; }
.chat-header { padding: 16px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.message-list { height: min(62vh, 650px); min-height: 430px; padding: 24px; overflow-y: auto; background: color-mix(in srgb, var(--surface-2) 43%, var(--surface)); display: flex; flex-direction: column; gap: 11px; }
.message-bubble { max-width: min(76%, 620px); padding: 11px 14px 8px; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 14px rgba(65,44,33,.05); }
.message-bubble.incoming { align-self: flex-start; background: var(--surface); border-bottom-right-radius: 4px; }
.message-bubble.outgoing { align-self: flex-end; background: var(--gold-soft); border-color: color-mix(in srgb, var(--gold) 28%, var(--line)); border-bottom-left-radius: 4px; }
.message-bubble p { margin: 3px 0 6px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-bubble footer { display: flex; gap: 8px; justify-content: flex-end; color: var(--muted); font-size: 8px; }
.ai-message-label { display: inline-flex; padding: 2px 7px; border-radius: 12px; font-size: 8px; font-weight: 800; }
.composer-wrap { padding: 15px; display: grid; gap: 9px; border-top: 1px solid var(--line); }
.message-composer { display: grid; grid-template-columns: 1fr auto; gap: 9px; align-items: end; }
.message-composer textarea { margin: 0; resize: vertical; }
.ai-button { color: #fff; background: linear-gradient(110deg, #6d28d9, #9b6cff); border: 0; box-shadow: 0 10px 24px rgba(109,40,217,.22); }
.ai-button:disabled { opacity: .48; cursor: not-allowed; }
.quick-reply-composer-shell { position: relative; width: max-content; max-width: 100%; }
.quick-reply-picker-toggle { min-height: 34px; padding: 6px 11px; display: inline-flex; align-items: center; gap: 6px; color: #6944bd; background: color-mix(in srgb, #7c3aed 10%, var(--surface)); border: 1px solid color-mix(in srgb, #7c3aed 30%, var(--line)); border-radius: 9px; font-size: 10px; font-weight: 800; }
.quick-reply-picker-toggle:hover, .quick-reply-picker-toggle[aria-expanded="true"] { color: #fff; background: linear-gradient(110deg,#6d28d9,#8b5cf6); border-color: transparent; }
.quick-reply-picker-toggle small { min-width: 18px; height: 18px; padding: 2px 5px; display: grid; place-items: center; color: inherit; background: rgba(255,255,255,.12); border-radius: 6px; font-size: 8px; }
.quick-reply-picker { position: absolute; z-index: 25; inset: auto 0 calc(100% + 9px) auto; width: min(550px,calc(100vw - 70px)); max-height: 470px; padding: 15px; overflow: hidden; color: #f7f7ff; background: #171d3a; border: 1px solid #364061; border-radius: 16px; box-shadow: 0 24px 65px rgba(4,6,25,.38); }
.quick-reply-picker[hidden] { display: none; }
.quick-reply-picker-head { margin-bottom: 11px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.quick-reply-picker-head strong, .quick-reply-picker-head small { display: block; }
.quick-reply-picker-head strong { font-size: 12px; }
.quick-reply-picker-head small { margin-top: 2px; color: #8d96c1; font-size: 8px; }
.quick-reply-picker-head a { color: #a78bfa; font-size: 8px; font-weight: 800; }
.quick-reply-picker-search { min-height: 38px !important; margin: 0 0 10px !important; color: #f2f3ff !important; background: #10152e !important; border-color: #323c5e !important; }
.quick-reply-picker-search::placeholder { color: #727ba7; }
.quick-reply-picker-categories { margin-bottom: 9px; padding-bottom: 8px; display: flex; gap: 6px; overflow-x: auto; }
.quick-reply-picker-categories button { min-height: 29px; padding: 5px 9px; display: inline-flex; align-items: center; gap: 5px; color: #939cc6; white-space: nowrap; background: #202744; border: 1px solid #303a5c; border-radius: 8px; font-size: 8px; }
.quick-reply-picker-categories button.active { color: #fff; background: #352461; border-color: #6d50a7; }
.quick-reply-picker-categories i { width: 6px; height: 6px; background: var(--category-color); border-radius: 50%; }
.quick-reply-picker-list { max-height: 290px; padding-inline-end: 3px; display: grid; gap: 6px; overflow-y: auto; }
.quick-reply-picker-item { width: 100%; padding: 9px; display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; color: #eef0ff; text-align: right; background: #1d2444; border: 1px solid #2c3556; border-radius: 10px; }
.quick-reply-picker-item:hover { background: #25234d; border-color: #65509a; }
.quick-reply-picker-item > span:nth-child(2) { min-width: 0; }
.quick-reply-picker-item strong, .quick-reply-picker-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick-reply-picker-item strong { font-size: 9px; }
.quick-reply-picker-item small { margin-top: 2px; color: #8c95bf; font-size: 7px; }
.quick-reply-picker-item code { color: #bda9f7; font-size: 7px; direction: ltr; }
.quick-reply-picker-icon { width: 34px; height: 34px; display: grid; place-items: center; background: color-mix(in srgb,var(--category-color) 32%,#22274a); border-radius: 9px; }
.quick-reply-picker-empty, .quick-reply-picker-no-results { padding: 28px 12px; color: #8c95bf; text-align: center; font-size: 9px; }
.quick-reply-picker-empty span, .quick-reply-picker-empty strong, .quick-reply-picker-empty a { display: block; }
.quick-reply-picker-empty span { margin-bottom: 7px; font-size: 24px; }
.quick-reply-picker-empty strong { color: #d9dcf4; }
.quick-reply-picker-empty a { margin-top: 7px; color: #a78bfa; }
.conversation-side { padding: 22px; }
.conversation-side h3 { margin: 5px 0; }
.conversation-side > p { color: var(--muted); font-size: 10px; line-height: 1.8; }
.details-grid.one-column { grid-template-columns: 1fr; }
.compact-alert { margin: 14px 0 0; font-size: 9px; }

.login-page { min-height: 100vh; background: #11152f; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(430px, .95fr) minmax(470px, 1.05fr); }
.login-story { padding: 55px; position: relative; overflow: hidden; color: #fff; background: linear-gradient(145deg, #171b38, #352267); display: flex; align-items: center; }
.story-pattern { position: absolute; inset: 0; opacity: .13; background-image: radial-gradient(circle at center, transparent 0 18px, #fff 19px 20px, transparent 21px), radial-gradient(circle at center, transparent 0 40px, #fff 41px 42px, transparent 43px); background-size: 100px 100px; transform: rotate(12deg) scale(1.3); }
.story-content { position: relative; z-index: 1; max-width: 520px; margin: auto; }
.brand.large { padding: 0 0 70px; }
.brand.large .brand-mark { width: 54px; height: 54px; }
.brand.large .brand-logo { width: 112px; height: 112px; padding: 5px; border-radius: 24px; }
.brand.large strong { font-size: 22px; }
.brand.large small { max-width: 320px; color: rgba(255,255,255,.68); font-size: 11px; white-space: normal; }
.story-content h1 { margin: 0 0 18px; font-size: clamp(34px, 4vw, 52px); line-height: 1.45; }
.story-content h1 em { color: #c4b5fd; font-style: normal; }
.story-content > p { max-width: 430px; color: rgba(255,255,255,.67); line-height: 2; }
.privacy-note { margin-top: 55px; padding: 15px; width: max-content; max-width: 100%; display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); border-radius: 13px; }
.privacy-note > span { color: #c4b5fd; font-size: 24px; }
.privacy-note strong, .privacy-note small { display: block; }
.privacy-note small { color: rgba(255,255,255,.55); font-size: 9px; }
.academy-contact-line { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.academy-contact-line span { padding: 6px 10px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.09); border-radius: 9px; font-size: 9px; }
.login-form-panel { padding: 40px; display: flex; align-items: center; background: #11152f; color: #f8f8ff; }
.login-form-wrap { width: min(420px, 100%); margin: auto; }
.login-form-wrap h2 { margin: 6px 0 4px; font-size: 30px; }
.login-form-wrap > .muted { margin-bottom: 28px; }
.form-stack { display: grid; gap: 17px; }
.form-stack input:not([type="checkbox"]) { background: #191e3d; color: #f8f8ff; border-color: #30395e; }
.check-row { display: flex; align-items: center; gap: 8px; color: #a4acd2; }
.check-row input { accent-color: #7c3aed; }
.login-help { margin-top: 25px; color: #7f88b3; text-align: center; font-size: 10px; }
.mobile-brand { display: none; align-items: center; gap: 10px; margin-bottom: 35px; }
.mobile-brand .brand-logo { width: 52px; height: 52px; }
.mobile-brand span { min-width: 0; }
.mobile-brand strong, .mobile-brand small { display: block; }
.mobile-brand small { max-width: 260px; overflow: hidden; color: #8992bd; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.error-page { min-height: 100vh; display: grid; place-items: center; text-align: center; }
.error-page main { max-width: 480px; padding: 30px; }
.error-page main > span { color: var(--gold); font-size: 70px; font-weight: 800; }
.error-page p { color: var(--muted); margin-bottom: 25px; }

@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2,1fr); }
    .role-grid { grid-template-columns: repeat(2,1fr); }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-save { position: static; }
    .profile-layout { grid-template-columns: 1fr; }
    .checkbox-grid { grid-template-columns: repeat(2,1fr); }
    .chat-layout { grid-template-columns: 1fr; }
    .conversation-side { order: -1; }
    .report-kpis { grid-template-columns: repeat(3,1fr); }
    .report-grid-main { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
    html, body { max-width: 100%; overflow-x: hidden; }
    body { --mobile-sidebar-width: min(88vw,320px); }
    body.mobile-sidebar-open { overflow: hidden; overscroll-behavior: contain; }
    .app-shell { width: 100%; min-width: 0; }
    .sidebar {
        width: var(--mobile-sidebar-width);
        height: 100vh;
        height: 100dvh;
        padding: max(18px,env(safe-area-inset-top)) 16px max(16px,env(safe-area-inset-bottom));
        overflow: hidden;
        transform: translateX(105%);
        transition: transform .25s ease;
        box-shadow: none;
        overscroll-behavior: contain;
    }
    .sidebar.open { transform: translateX(0); box-shadow: -14px 0 46px rgba(0,0,0,.5); }
    .mobile-sidebar-backdrop {
        position: fixed;
        z-index: 29;
        inset-block: 0;
        inset-inline-start: var(--mobile-sidebar-width);
        inset-inline-end: 0;
        display: block;
        padding: 0;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        background: rgba(2,6,23,.68);
        border: 0;
        backdrop-filter: blur(2px);
        transition: opacity .22s ease,visibility .22s ease;
    }
    body.mobile-sidebar-open .mobile-sidebar-backdrop {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    .nav-list { overscroll-behavior: contain; }
    .sidebar-collapse-toggle { inset-inline-end: 14px; top: 17px; }
    .main-area { width: 100%; min-width: 0; margin-right: 0; }
    .mobile-menu { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; font-size: 20px; }
    .topbar { padding: 15px 18px; }
    .topbar > div:not(.topbar-actions) { min-width: 0; }
    .topbar h1 { overflow-wrap: anywhere; }
    .topbar-actions { flex: 0 0 auto; }
    .topbar-actions > span:not(.status-dot) { display: none; }
    .content { width: 100%; max-width: 100%; min-width: 0; padding: 20px 16px max(40px,env(safe-area-inset-bottom)); overflow-x: clip; }
    .content > *, .panel, .panel-header, .section-actions, .filters-bar, .form-grid, .report-filters { min-width: 0; max-width: 100%; }
    :is(input,select,textarea,button) { max-width: 100%; }
    .table-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }
    .table-wrap table { min-width: max-content; }
    dialog {
        width: calc(100vw - 20px)!important;
        max-width: calc(100vw - 20px)!important;
        max-height: calc(100dvh - 20px)!important;
        margin: auto;
    }
    .control-center-hero { min-height: 135px; padding: 22px; }
    .control-center-hero-icon { width: 66px; height: 66px; flex-basis: 66px; border-radius: 18px; font-size: 29px; }
    .whatsapp-global-status { align-items: flex-start; flex-wrap: wrap; }
    .whatsapp-status-copy { min-width: calc(100% - 52px); }
    .whatsapp-status-actions { width: 100%; padding-inline-start: 49px; flex-wrap: wrap; }
    .settings-hub-grid { grid-template-columns: 1fr; }
    .qr-connection-grid { grid-template-columns: 1fr; }
    .qr-stage { width: min(360px,100%); margin: auto; }
    .two-column, .form-grid, .permissions-wrap { grid-template-columns: 1fr; }
    .form-grid .full-span { grid-column: auto; }
    .branding-editor { grid-template-columns: 150px minmax(0,1fr); }
    .branding-preview-frame { width: 150px; height: 150px; }
    .filters-bar { align-items: stretch; flex-direction: column; }
    .contact-actions, .contact-actions .button { width: 100%; }
    .report-filters { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: stretch; }
    .report-filters .button { width: 100%; }
    .report-kpis { grid-template-columns: repeat(2,1fr); }
    .report-grid-distributions { grid-template-columns: 1fr; }
    .activity-form { grid-template-columns: 1fr; }
    .login-shell { grid-template-columns: 1fr; }
    .login-story { display: none; }
    .login-form-panel { min-height: 100vh; padding: 28px 20px; }
    .mobile-brand { display: flex; }
}

/* WhatsApp templates, broadcasts, team inbox, privacy and advanced automation */
.template-manager-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.template-manager-card { display:grid; gap:16px; min-width:0; }
.template-manager-card header,.template-manager-card footer { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; }
.template-manager-card h3 { margin:4px 0 0; overflow-wrap:anywhere; }
.template-manager-card p { margin:0; line-height:1.9; white-space:pre-wrap; }
.template-manager-card footer { border-top:1px solid var(--border); padding-top:12px; color:var(--muted); font-size:12px; flex-wrap:wrap; }
.broadcast-hero { margin-bottom:18px; }
.broadcast-create { margin-bottom:18px; }
.broadcast-create summary { cursor:pointer; font-weight:800; color:var(--brown-dark); }
.broadcast-create[open] summary { margin-bottom:20px; }
.broadcast-progress { height:8px; background:var(--surface-soft); border-radius:999px; overflow:hidden; }
.broadcast-progress span { display:block; height:100%; background:linear-gradient(90deg,var(--brown),var(--gold)); border-radius:inherit; }
.broadcast-card > p { margin:0; }
.conversation-team-form { display:grid; gap:10px; margin-bottom:14px; }
.conversation-team-form label,.internal-notes form { display:grid; gap:7px; }
.conversation-side hr { width:100%; border:0; border-top:1px solid var(--border); margin:18px 0; }
.internal-notes { display:grid; gap:10px; margin-top:16px; }
.internal-notes h4 { margin:0; }
.internal-notes article { background:var(--surface-soft); border:1px solid var(--border); border-radius:12px; padding:10px; }
.internal-notes article p { margin:0 0 6px; white-space:pre-wrap; }
.internal-notes article small { color:var(--muted); }
.privacy-center { margin-top:18px; }
.privacy-grid { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(260px,.8fr); gap:18px; }
.privacy-grid > form,.privacy-actions { display:grid; gap:12px; align-content:start; }
.automation-steps-builder { border-top:1px solid var(--border); padding-top:18px; display:grid; gap:14px; }
.automation-steps-builder > header { display:flex; justify-content:space-between; gap:16px; align-items:center; }
.automation-steps-builder h4,.automation-steps-builder p { margin:0; }
.automation-steps-builder p { color:var(--muted); font-size:12px; }
[data-step-list] { display:grid; gap:12px; }
.automation-step-card { border:1px solid var(--border); background:var(--surface-soft); border-radius:16px; padding:14px; display:grid; gap:14px; }
.automation-step-card.dragging { opacity:.55; border-color:var(--brown); }
.automation-step-head { display:flex; align-items:center; gap:10px; }
.automation-step-head strong { flex:1; }
.automation-step-head button { border:0; background:transparent; color:var(--danger); cursor:pointer; }
.step-handle { cursor:grab; color:var(--brown-dark); font-size:20px; }
.automation-step-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }

@media (max-width: 1100px) {
    .template-manager-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .automation-step-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width: 720px) {
    .template-manager-grid,.privacy-grid,.automation-step-grid { grid-template-columns:1fr; }
    .automation-steps-builder > header { align-items:flex-start; flex-direction:column; }
}

@media (max-width: 560px) {
    body { --mobile-sidebar-width: min(90vw,320px); }
    .topbar {
        min-height: 72px;
        padding: 10px 12px;
        gap: 9px;
    }
    .topbar > div:not(.topbar-actions) { flex: 1 1 112px; }
    .topbar-actions { gap: 5px; }
    .topbar-actions .icon-button { width: 34px; height: 34px; font-size: 16px; }
    .topbar-actions .status-dot { display: none; }
    .language-switch button { min-height: 34px; padding: 5px 8px; }
    .topbar p { display: none; }
    .topbar h1 { font-size: 15px; line-height: 1.55; }
    .content { padding: 14px 10px max(32px,env(safe-area-inset-bottom)); }
    .button { min-height: 44px; padding-inline: 14px; }
    .panel-header.padded { padding: 18px 16px 0; }
    .pagination { align-items: stretch; flex-direction: column; gap: 10px; }
    .pagination > span:last-child { display: flex; flex-wrap: wrap; gap: 6px; }
    .pagination a { margin: 0; }
    .empty-state { padding: 36px 16px; }
    .branding-editor { grid-template-columns: 1fr; text-align: center; }
    .branding-preview-frame { width: min(210px,100%); height: 190px; margin: auto; }
    .branding-upload-copy > p { margin-inline: auto; }
    .welcome-card { min-height: 185px; padding: 24px; }
    .welcome-card .arabesque { position: absolute; left: -20px; bottom: -30px; opacity: .25; }
    .control-center-hero { min-height: 168px; padding: 20px; }
    .control-center-hero-icon { position: absolute; inset-inline-end: -10px; bottom: -14px; opacity: .2; }
    .control-center-heading { align-items: flex-start; flex-direction: column; }
    .control-center-grid { grid-template-columns: 1fr; }
    .control-center-card { min-height: 120px; }
    .stats-grid, .role-grid { grid-template-columns: 1fr; }
    .stat-card { min-height: 115px; }
    .section-actions { align-items: stretch; flex-direction: column; }
    .section-actions .button { width: 100%; }
    .form-panel { padding: 19px; }
    .channel-pair-grid { grid-template-columns: 1fr; }
    .panel-header { flex-direction: column; }
    .form-actions { flex-direction: column-reverse; }
    .form-actions .button { width: 100%; }
    .inline-actions { align-items: stretch; flex-wrap: wrap; }
    .checkbox-grid, .details-grid { grid-template-columns: 1fr; }
    .conversation-row { padding: 14px; }
    .conversation-arrow { display: none; }
    .message-list { height: 56vh; min-height: 390px; padding: 14px; }
    .message-bubble { max-width: 88%; }
    .message-composer { grid-template-columns: 1fr; }
    .quick-reply-composer-shell { width: 100%; }
    .quick-reply-picker-toggle { width: 100%; justify-content: center; }
    .quick-reply-picker { position: fixed; inset: auto 12px 12px; width: auto; max-height: 72vh; }
    .report-filters { grid-template-columns: 1fr; }
    .report-range-line { align-items: flex-start; flex-direction: column; }
    .report-range-line small { margin-inline-start: 0; }
    .report-kpis { grid-template-columns: 1fr; }
    .report-card { padding: 16px; }
    .report-card-head { flex-direction: column; }
    .conversation-period-totals { width: 100%; display: grid; grid-template-columns: repeat(3,1fr); }
    .conversation-period-totals span { min-width: 0; padding: 7px 4px; }
    .funnel-row { grid-template-columns: minmax(110px,1fr) minmax(60px,.8fr) 24px; }
}

/* Quick reply library — indigo/purple palette inspired by the supplied reference. */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
body.quick-replies-theme {
    background: radial-gradient(circle at 75% 8%, rgba(124,58,237,.10), transparent 25%), var(--bg);
}
.quick-replies-theme .sidebar { background: linear-gradient(165deg, #171b38 0%, #21164d 100%); box-shadow: -8px 0 34px rgba(3,4,20,.32); }
.quick-replies-theme .brand-mark { color: #fff; background: linear-gradient(145deg, #9b6cff, #6d28d9); }
.quick-replies-theme .nav-link span { color: #b79cff; }
.quick-replies-theme .nav-link.active { box-shadow: inset -3px 0 #8b5cf6; }
.quick-replies-theme .sidebar-user .avatar { color: #fff; background: #7c3aed; }
.quick-replies-theme .topbar { min-height: 64px; background: rgba(17,21,47,.88); border-color: #2d3458; }
.quick-replies-theme .topbar > div:first-of-type { display: none; }
.quick-replies-theme .topbar-actions .icon-button { color: #c4b5fd; background: #222849; }
.quick-replies-theme .content { max-width: 1600px; }
.quick-replies-theme .alert.success { color: #b9f6dd; background: #173e36; border-color: #286653; }
.quick-replies-theme .alert.danger { color: #fecdd3; background: #4b1d2c; border-color: #7f2941; }

.quick-replies-hero { min-height: 148px; padding: 10px 2px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.quick-replies-heading { display: flex; align-items: flex-start; gap: 16px; }
.quick-replies-heading-icon { width: 54px; height: 54px; flex: none; display: grid; place-items: center; color: #a78bfa; background: rgba(124,58,237,.16); border: 1px solid rgba(139,92,246,.28); border-radius: 16px; }
.quick-replies-heading-icon svg { width: 28px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quick-replies-kicker { color: #a78bfa; font-size: 10px; font-weight: 800; }
.quick-replies-heading h2 { margin: 3px 0 4px; font-size: clamp(23px,3vw,30px); line-height: 1.35; }
.quick-replies-heading p { max-width: 630px; margin: 0; color: #a5add4; font-size: 11px; line-height: 1.8; }
.quick-replies-stats { margin-top: 10px; color: #747da9; font-size: 9px; }
.quick-replies-stats strong { color: #c4b5fd; font-size: 11px; }
.quick-replies-stats span { margin: 0 7px; }
.quick-replies-actions { display: flex; align-items: center; gap: 9px; }
.button.quick-reply-primary { color: #fff; background: linear-gradient(110deg, #6d28d9, #8b5cf6); border: 0; box-shadow: 0 12px 26px rgba(109,40,217,.28); }
.button.quick-reply-primary:hover { background: linear-gradient(110deg, #7c3aed, #9b6cff); }
.button.quick-reply-secondary { color: #bbc2e7; background: #202644; border-color: #30395e; box-shadow: none; }
.button.quick-reply-secondary:hover { color: #fff; border-color: #5b4a94; background: #272d50; }

.quick-reply-filters { margin-bottom: 18px; padding: 13px; display: grid; grid-template-columns: minmax(240px,1fr) 220px 160px auto auto; align-items: center; gap: 10px; background: rgba(25,30,61,.76); border: 1px solid #293255; border-radius: 15px; }
.quick-reply-filters label { min-width: 0; }
.quick-reply-filters input, .quick-reply-filters select { margin: 0; color: #eef0ff; background-color: #151b35; border-color: #36405f; }
.quick-reply-filters input::placeholder { color: #70789e; }
.quick-reply-filters input:focus, .quick-reply-filters select:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.14); }
.quick-reply-clear { color: #9fa7d1; font-size: 10px; font-weight: 700; white-space: nowrap; }
.quick-reply-clear:hover { color: #c4b5fd; }

.quick-reply-categories { margin-bottom: 20px; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.quick-reply-category-wrap { display: inline-flex; align-items: center; }
.quick-reply-category-pill { min-height: 36px; padding: 7px 11px; display: inline-flex; align-items: center; gap: 7px; color: #a8b0d7; background: #191f3d; border: 1px solid #30395e; border-radius: 11px; font-size: 10px; }
.quick-reply-category-pill:hover, .quick-reply-category-pill.active { color: #fff; background: #24234e; border-color: #6851a4; }
.quick-reply-category-pill small { min-width: 20px; height: 20px; padding: 3px 5px; display: grid; place-items: center; color: #aaaee0; background: rgba(255,255,255,.06); border-radius: 7px; font-size: 8px; }
.category-dot { width: 8px; height: 8px; flex: none; background: var(--category-color); border-radius: 50%; box-shadow: 0 0 0 3px color-mix(in srgb, var(--category-color) 22%, transparent); }
.category-edit-button { width: 28px; height: 28px; margin-inline-start: -4px; border: 1px solid #30395e; border-radius: 8px; color: #8992bd; background: #171c38; }
.category-edit-button:hover { color: #fff; border-color: #6d58a8; }

.quick-reply-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.quick-reply-card { min-height: 250px; padding: 19px; display: flex; flex-direction: column; overflow: hidden; position: relative; background: linear-gradient(145deg, #1b2142, #181d3a); border: 1px solid #30395e; border-radius: 17px; box-shadow: 0 14px 36px rgba(3,5,22,.18); transition: .2s ease; }
.quick-reply-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: linear-gradient(90deg, var(--category-color), transparent 75%); }
.quick-reply-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--category-color) 48%, #30395e); box-shadow: 0 20px 42px rgba(3,5,22,.28); }
.quick-reply-card header { display: grid; grid-template-columns: 39px minmax(0,1fr) auto; align-items: start; gap: 11px; }
.quick-reply-card-icon { width: 39px; height: 39px; display: grid; place-items: center; color: #fff; background: color-mix(in srgb, var(--category-color) 55%, #211f48); border: 1px solid color-mix(in srgb, var(--category-color) 55%, #30395e); border-radius: 11px; }
.quick-reply-card-category { display: flex; align-items: center; gap: 5px; color: #8f97c2; font-size: 8px; }
.quick-reply-card-category i { width: 6px; height: 6px; background: var(--category-color); border-radius: 50%; }
.quick-reply-card h3 { margin: 3px 0 0; color: #fff; font-size: 14px; }
.quick-reply-status { padding: 4px 8px; border-radius: 20px; font-size: 8px; font-weight: 800; }
.quick-reply-status.active { color: #8df1c8; background: rgba(52,211,153,.12); }
.quick-reply-status.inactive { color: #abb2d1; background: rgba(148,156,199,.10); }
.quick-reply-card > p { flex: 1; margin: 17px 0 15px; color: #b5bbdd; font-size: 10px; line-height: 1.95; white-space: pre-line; overflow-wrap: anywhere; }
.quick-reply-card-meta { min-height: 27px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #7f88b3; font-size: 8px; }
.quick-reply-card-meta code { padding: 4px 8px; color: #c4b5fd; background: #26214d; border: 1px solid #3e356e; border-radius: 7px; direction: ltr; }
.quick-reply-card footer { margin-top: 12px; padding-top: 12px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #2b3456; }
.quick-reply-card footer form { margin-inline-start: auto; }
.quick-reply-edit, .quick-reply-delete { padding: 4px 0; border: 0; background: transparent; font-size: 9px; font-weight: 700; }
.quick-reply-edit { color: #a78bfa; }
.quick-reply-delete { color: #d98394; }
.quick-reply-edit:hover, .quick-reply-delete:hover { color: #fff; }
.quick-reply-pagination { margin-top: 18px; padding: 13px 16px; display: flex; justify-content: space-between; color: #8d96c0; background: #191f3d; border: 1px solid #30395e; border-radius: 12px; font-size: 9px; }
.quick-reply-pagination a { margin-inline-start: 7px; padding: 6px 11px; color: #c4b5fd; background: #28234f; border-radius: 8px; }

.quick-replies-empty { min-height: 390px; padding: 55px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.quick-replies-empty-icon { width: 84px; height: 84px; display: grid; place-items: center; color: #7e88b2; background: #1d2546; border: 1px solid #2c3761; border-radius: 18px; }
.quick-replies-empty-icon svg { width: 44px; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quick-replies-empty h3 { margin: 18px 0 3px; color: #f7f7ff; font-size: 17px; }
.quick-replies-empty p { margin: 0 0 17px; color: #7d86b1; font-size: 10px; }

.quick-reply-dialog { width: min(670px,calc(100vw - 28px)); max-height: min(88vh,760px); padding: 0; overflow: auto; color: #f8f8ff; background: #191f3f; border: 1px solid #384269; border-radius: 19px; box-shadow: 0 32px 90px rgba(1,3,18,.58); }
.quick-reply-dialog.compact { width: min(500px,calc(100vw - 28px)); }
.quick-reply-dialog::backdrop { background: rgba(4,6,25,.75); backdrop-filter: blur(6px); }
.quick-reply-dialog-head { padding: 19px 22px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #30395e; }
.quick-reply-dialog-head > div { display: flex; align-items: center; gap: 11px; }
.quick-reply-dialog-head > div > span { width: 38px; height: 38px; display: grid; place-items: center; color: #c4b5fd; background: #2a2356; border-radius: 11px; }
.quick-reply-dialog-head small { display: block; color: #8c95bf; font-size: 8px; }
.quick-reply-dialog-head h3 { margin: 1px 0 0; font-size: 16px; }
.quick-reply-dialog-head > button { width: 34px; height: 34px; color: #a6add0; background: transparent; border: 0; border-radius: 9px; font-size: 22px; }
.quick-reply-dialog-head > button:hover { color: #fff; background: #272e51; }
.quick-reply-dialog form { padding: 22px; }
.quick-reply-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.quick-reply-form-grid.one-column { grid-template-columns: 1fr; }
.quick-reply-form-grid label { color: #e4e6f8; }
.quick-reply-form-grid label small { color: #828bb7; }
.quick-reply-form-grid input:not([type="checkbox"]):not([type="color"]), .quick-reply-form-grid select, .quick-reply-form-grid textarea { color: #f4f4ff; background: #11162f; border-color: #354061; }
.quick-reply-form-grid input:focus, .quick-reply-form-grid select:focus, .quick-reply-form-grid textarea:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.15); }
.shortcut-input { margin-top: 7px; display: flex; align-items: center; background: #11162f; border: 1px solid #354061; border-radius: 10px; direction: ltr; }
.shortcut-input span { padding: 0 0 0 12px; color: #8b5cf6; font-weight: 800; }
.shortcut-input input { margin: 0 !important; border: 0 !important; box-shadow: none !important; }
.quick-reply-active { min-height: 69px; padding: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #202746; border: 1px solid #30395e; border-radius: 11px; }
.quick-reply-active strong, .quick-reply-active small { display: block; }
.quick-reply-active input { width: 40px; height: 20px; accent-color: #7c3aed; }
.category-color-input { min-height: 46px; margin-top: 7px; padding: 5px 9px; display: flex; align-items: center; gap: 10px; background: #11162f; border: 1px solid #354061; border-radius: 10px; }
.category-color-input input { width: 42px; height: 32px; border: 0; background: transparent; }
.category-color-input code { color: #c4b5fd; direction: ltr; }
.quick-reply-dialog-actions { margin-top: 20px; padding-top: 16px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid #30395e; }
.quick-reply-dialog > form[hidden] { display: none; }
.quick-reply-dialog > form:not(:first-of-type) { margin-top: -22px; padding-top: 0; }
.quick-reply-dialog-delete { padding: 5px 0; color: #fb7185; background: transparent; border: 0; font-size: 9px; font-weight: 800; }

/* Keyword-triggered automatic replies */
.keyword-rules-theme .content { max-width: 1600px; }
.keyword-rules-hero { min-height: 165px; margin-bottom: 18px; padding: 23px 25px; display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; overflow: hidden; position: relative; background: radial-gradient(circle at 14% -20%,rgba(0,229,160,.13),transparent 43%),linear-gradient(135deg,#151b38,#181d3a); border: 1px solid #2d3859; border-radius: 19px; box-shadow: 0 18px 44px rgba(3,5,22,.18); }
.keyword-rules-hero::after { content: ""; width: 240px; height: 240px; position: absolute; inset: -140px -80px auto auto; border: 1px solid rgba(139,92,246,.18); border-radius: 50%; box-shadow: 0 0 0 34px rgba(139,92,246,.04),0 0 0 68px rgba(139,92,246,.025); pointer-events: none; }
.keyword-rules-hero > * { position: relative; z-index: 1; }
.keyword-rules-kicker { color: #5eeac0; font-size: 9px; font-weight: 800; }
.keyword-rules-hero h2 { margin: 4px 0 5px; color: #fff; font-size: clamp(23px,3vw,31px); }
.keyword-rules-hero p { max-width: 720px; margin: 0; color: #a7afd3; font-size: 10px; line-height: 1.9; }
.keyword-rules-stats { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 8px; }
.keyword-rules-stats span { padding: 6px 10px; color: #969fc8; background: rgba(13,19,43,.58); border: 1px solid #2b3658; border-radius: 9px; font-size: 8px; }
.keyword-rules-stats strong { margin-inline-end: 3px; color: #68e9c2; font-size: 11px; }
.keyword-rules-actions { display: flex; flex-wrap: wrap; gap: 9px; }
.keyword-rules-layout { display: grid; grid-template-columns: minmax(0,1fr) 330px; align-items: start; gap: 18px; }
.keyword-rules-filter { margin-bottom: 14px; padding: 11px; display: grid; grid-template-columns: minmax(240px,1fr) auto auto; align-items: center; gap: 9px; background: #191f3d; border: 1px solid #30395e; border-radius: 14px; }
.keyword-rules-filter input { margin: 0; color: #f4f5ff; background: #11162f; border-color: #354061; }
.keyword-rules-filter input::placeholder { color: #747da8; }
.keyword-rules-filter input:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,.15); }
.keyword-rules-filter > a { color: #a78bfa; font-size: 9px; font-weight: 800; }
.keyword-rule-list { display: grid; gap: 13px; }
.keyword-rule-card { padding: 18px; overflow: hidden; position: relative; background: linear-gradient(145deg,#1b2142,#181d3a); border: 1px solid #30395e; border-radius: 16px; box-shadow: 0 12px 32px rgba(3,5,22,.15); }
.keyword-rule-card::before { content: ""; width: 3px; position: absolute; inset: 18px 0 18px auto; background: linear-gradient(#00e5a0,#7c3aed); border-radius: 4px; }
.keyword-rule-card.inactive { opacity: .7; }
.keyword-rule-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; }
.keyword-rule-card > header > div { min-width: 0; display: flex; align-items: center; gap: 10px; }
.keyword-rule-card header small { color: #7f88b3; font-size: 8px; }
.keyword-rule-card h3 { margin: 2px 0 0; color: #fff; font-size: 14px; }
.keyword-rule-icon { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; color: #59e2b9; background: rgba(0,229,160,.09); border: 1px solid rgba(0,229,160,.22); border-radius: 11px; font-size: 17px; }
.keyword-rule-chips { margin: 15px 0 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.keyword-rule-chips span { padding: 5px 9px; color: #76edc8; background: rgba(0,229,160,.08); border: 1px solid rgba(0,229,160,.20); border-radius: 999px; font-size: 8px; font-weight: 800; }
.keyword-rule-response { padding: 12px 14px; color: #aab2d5; background: #141a35; border: 1px solid #293455; border-radius: 11px; }
.keyword-rule-response small { color: #858fb9; font-size: 8px; }
.keyword-rule-response strong { color: #c4b5fd; }
.keyword-rule-response p { margin: 5px 0 0; color: #c6cbe5; font-size: 9px; line-height: 1.9; white-space: pre-line; overflow-wrap: anywhere; }
.keyword-rule-meta { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 6px; }
.keyword-rule-meta span { padding: 4px 7px; color: #8992bc; background: #202746; border-radius: 7px; font-size: 7px; }
.keyword-rule-meta span.danger { color: #fda4af; background: rgba(244,63,94,.10); }
.keyword-rule-card > footer { margin-top: 13px; padding-top: 11px; display: flex; align-items: center; gap: 12px; border-top: 1px solid #2b3456; }
.keyword-rule-card > footer form { margin-inline-start: auto; }
.keyword-rules-help { padding: 19px; position: sticky; top: 82px; background: linear-gradient(155deg,#191f3d,#171c38); border: 1px solid #30395e; border-radius: 16px; box-shadow: 0 14px 34px rgba(3,5,22,.14); }
.keyword-rules-help h3 { margin: 0 0 13px; padding-bottom: 12px; display: flex; align-items: center; gap: 8px; color: #fff; border-bottom: 1px solid #2c3557; font-size: 13px; }
.keyword-rules-help h3 span { width: 24px; height: 24px; display: grid; place-items: center; color: #001b13; background: #00e5a0; border-radius: 50%; font-size: 11px; }
.keyword-rules-help ul { margin: 0; padding: 0 17px 0 0; color: #949dc5; }
.keyword-rules-help li { margin-bottom: 10px; font-size: 8px; line-height: 1.95; }
.keyword-rules-help strong { color: #c4b5fd; }
.keyword-rules-empty { min-height: 370px; padding: 45px 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #838db8; text-align: center; background: #191f3d; border: 1px solid #30395e; border-radius: 16px; }
.keyword-rules-empty > span { width: 66px; height: 66px; display: grid; place-items: center; color: #5eeac0; background: rgba(0,229,160,.08); border: 1px solid rgba(0,229,160,.18); border-radius: 17px; font-size: 27px; }
.keyword-rules-empty h3 { margin: 15px 0 4px; color: #fff; font-size: 15px; }
.keyword-rules-empty p { max-width: 560px; margin: 0 0 15px; font-size: 9px; line-height: 1.9; }
.keyword-rule-dialog { width: min(720px,calc(100vw - 28px)); }

:root[data-theme="light"] .keyword-rules-hero { background: radial-gradient(circle at 14% -20%,rgba(16,185,129,.12),transparent 43%),linear-gradient(135deg,var(--surface),var(--surface-2)); border-color: var(--line); }
:root[data-theme="light"] .keyword-rules-hero h2,
:root[data-theme="light"] .keyword-rule-card h3,
:root[data-theme="light"] .keyword-rules-help h3,
:root[data-theme="light"] .keyword-rules-empty h3 { color: var(--text); }
:root[data-theme="light"] :is(.keyword-rules-filter,.keyword-rule-card,.keyword-rules-help,.keyword-rules-empty) { color: var(--text); background: var(--surface); border-color: var(--line); }
:root[data-theme="light"] :is(.keyword-rules-filter input,.keyword-rule-response,.keyword-rule-meta span) { color: var(--text); background: var(--surface-2); border-color: var(--line); }
:root[data-theme="light"] .keyword-rule-response p { color: var(--text); }

@media (max-width: 1020px) {
    .keyword-rules-layout { grid-template-columns: 1fr; }
    .keyword-rules-help { position: static; }
}
@media (max-width: 760px) {
    .keyword-rules-hero { flex-direction: column; padding: 19px; }
    .keyword-rules-actions { width: 100%; }
    .keyword-rules-actions .button { flex: 1; }
    .keyword-rules-filter { grid-template-columns: 1fr auto; }
    .keyword-rules-filter > a { grid-column: 1 / -1; }
}
@media (max-width: 520px) {
    .keyword-rules-actions { flex-direction: column; }
    .keyword-rules-actions .button { width: 100%; }
    .keyword-rules-filter { grid-template-columns: 1fr; }
    .keyword-rules-filter > a { grid-column: auto; }
    .keyword-rule-card > header { align-items: center; }
}

/* Educational AI catalog */
.education-catalog-theme .content { display: grid; gap: 18px; }
.education-catalog-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 220px; padding: 36px 40px; border: 1px solid color-mix(in srgb,var(--primary) 40%,var(--line)); border-radius: 25px; background: radial-gradient(circle at 90% 20%,color-mix(in srgb,var(--accent) 18%,transparent),transparent 34%),linear-gradient(135deg,color-mix(in srgb,var(--primary) 9%,var(--surface)),var(--surface)); }
.education-catalog-hero::after { content: '◇'; position: absolute; inset-inline-end: 5%; inset-block-start: -40px; color: color-mix(in srgb,var(--primary) 10%,transparent); font-size: 230px; font-weight: 950; pointer-events: none; }
.education-catalog-hero > * { position: relative; z-index: 1; }
.education-catalog-hero > div { max-width: 900px; }
.education-catalog-hero h2 { margin: 10px 0 8px; font-size: clamp(30px,3vw,48px); }
.education-catalog-hero p { max-width: 850px; margin: 0; color: var(--muted); line-height: 1.9; }
.education-catalog-add { flex: 0 0 auto; min-height: 50px; }
.education-only-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: fit-content; margin-top: 18px; padding: 9px 13px; border: 1px solid rgba(52,211,153,.3); border-radius: 12px; color: #45daa0; background: rgba(16,185,129,.07); }
.education-only-note small { color: var(--muted); }
.education-catalog-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.education-catalog-stats article { position: relative; display: grid; gap: 5px; min-height: 125px; padding: 20px; }
.education-catalog-stats strong { font-size: 29px; }
.education-catalog-stats small { color: var(--muted); }
.education-catalog-stats .stat-icon { position: absolute; inset-inline-end: 18px; inset-block-start: 17px; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid currentColor; border-radius: 13px; background: color-mix(in srgb,currentColor 10%,transparent); font-size: 20px; }
.education-catalog-stats .cyan { color:#22d3ee }.education-catalog-stats .green { color:#34d399 }.education-catalog-stats .violet { color:#a78bfa }.education-catalog-stats .amber { color:#fbbf24 }
.education-catalog-filter-panel { padding: 20px; }
.education-catalog-filter-panel .section-heading { margin-bottom: 14px; }
.education-catalog-filters { display: grid; grid-template-columns: minmax(260px,1.5fr) repeat(3,minmax(160px,.8fr)) auto auto; align-items: end; gap: 10px; }
.education-catalog-filters label { display: grid; gap: 7px; min-width: 0; }
.education-catalog-filters label > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.education-catalog-filters .button { min-height: 43px; white-space: nowrap; }
.education-catalog-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }
.education-catalog-card { overflow: hidden; padding: 0; }
.education-catalog-card.is-active { border-color: color-mix(in srgb,var(--primary) 32%,var(--line)); }
.education-catalog-card.is-inactive { opacity: .7; filter: saturate(.7); }
.education-catalog-media { position: relative; display: grid; place-items: center; height: 180px; overflow: hidden; border-bottom: 1px solid var(--line); color: var(--primary); background: radial-gradient(circle,color-mix(in srgb,var(--primary) 13%,transparent),transparent 68%),var(--surface-2); }
.education-catalog-media img { width: 100%; height: 100%; object-fit: cover; }
.education-catalog-media > span { font-size: 58px; font-weight: 900; }
.education-catalog-media .badge { position: absolute; inset-inline-start: 13px; inset-block-start: 13px; }
.education-catalog-card-body { display: grid; gap: 14px; padding: 18px; }
.education-catalog-card-body > header { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.education-catalog-card h3 { margin: 5px 0 0; font-size: 19px; }
.education-catalog-card-body > p { min-height: 52px; margin: 0; overflow: hidden; color: var(--muted); line-height: 1.75; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.availability { flex: 0 0 auto; padding: 5px 8px; border-radius: 999px; font-size: 10px; font-weight: 900; }
.availability-available { color:#45daa0; background:rgba(16,185,129,.1) }.availability-coming_soon { color:#fbbf24; background:rgba(245,158,11,.1) }.availability-unavailable { color:#fb7185; background:rgba(244,63,94,.1) }
.education-catalog-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.education-catalog-card dl div { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb,var(--surface-2) 75%,transparent); }
.education-catalog-card dt { color: var(--muted); font-size: 10px; }.education-catalog-card dd { margin: 4px 0 0; overflow-wrap: anywhere; font-weight: 900; }
.education-registration-link { color: var(--primary); font-size: 12px; font-weight: 900; }
.education-catalog-card-body > footer { display: grid; gap: 11px; padding-top: 12px; border-top: 1px solid var(--line); }
.education-catalog-card-body > footer > small { color: var(--muted); }
.education-catalog-actions { display: flex; flex-wrap: wrap; gap: 7px; }.education-catalog-actions form { flex: 1; margin: 0; }.education-catalog-actions .button { width: 100%; min-height: 34px; padding: 7px 10px; }
.education-catalog-empty { grid-column: 1 / -1; display: grid; place-items: center; min-height: 310px; padding: 35px; text-align: center; }
.education-catalog-empty > span { display: grid; place-items: center; width: 72px; height: 72px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 22px; color: var(--primary); background: var(--surface-2); font-size: 36px; }
.education-catalog-empty strong { font-size: 20px; }.education-catalog-empty p { margin: 8px 0 18px; color: var(--muted); }
.education-catalog-dialog { width: min(900px,calc(100vw - 30px)); max-height: min(900px,calc(100dvh - 30px)); padding: 0; overflow: auto; border: 1px solid color-mix(in srgb,var(--primary) 42%,var(--line)); border-radius: 22px; color: var(--text); background: var(--surface); box-shadow: 0 30px 90px rgba(0,0,0,.5); }
.education-catalog-dialog::backdrop { background: rgba(2,8,18,.78); backdrop-filter: blur(5px); }
.education-catalog-dialog form { display: grid; }
.education-catalog-dialog [hidden] { display: none !important; }
.education-catalog-dialog form > header,.education-catalog-dialog form > footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 20px 24px; }
.education-catalog-dialog form > header { position: sticky; z-index: 2; top: 0; border-bottom: 1px solid var(--line); background: color-mix(in srgb,var(--surface) 94%,transparent); backdrop-filter: blur(14px); }
.education-catalog-dialog h3 { margin: 5px 0; font-size: 22px; }.education-catalog-dialog header p { margin: 0; color: var(--muted); font-size: 12px; }
.education-catalog-dialog form > footer { position: sticky; bottom: 0; justify-content: flex-start; border-top: 1px solid var(--line); background: color-mix(in srgb,var(--surface) 94%,transparent); backdrop-filter: blur(14px); }
.education-catalog-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; padding: 22px 24px; }
.education-catalog-form-grid > label:not(.toggle-row) { display: grid; align-content: start; gap: 7px; }
.education-catalog-form-grid > label > span { color: var(--muted); font-size: 11px; font-weight: 900; }
.education-form-wide { grid-column: 1 / -1; }
.education-image-field small { color: var(--muted); }.education-image-field img { width: 150px; height: 100px; margin-top: 5px; border: 1px solid var(--line); border-radius: 12px; object-fit: cover; }

@media (max-width: 1400px) {
    .education-catalog-filters { grid-template-columns: repeat(2,minmax(0,1fr)); }.education-catalog-filters .button { width: 100%; }
    .education-catalog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 820px) {
    .education-catalog-hero { align-items: stretch; flex-direction: column; padding: 25px 20px; }.education-catalog-add { width: 100%; }
    .education-catalog-stats,.education-catalog-filters,.education-catalog-grid,.education-catalog-form-grid { grid-template-columns: 1fr; }
    .education-form-wide { grid-column: auto; }.education-catalog-dialog form > header { align-items: start; }.education-catalog-dialog form > footer .button { flex: 1; }
}
@media (max-width: 520px) {
    .education-catalog-hero h2 { font-size: 28px; }.education-catalog-filter-panel { padding: 14px; }
    .education-catalog-dialog { width: 100%; max-width: none; max-height: 100dvh; height: 100dvh; border: 0; border-radius: 0; }
    .education-catalog-dialog form > header,.education-catalog-dialog form > footer,.education-catalog-form-grid { padding: 16px; }
    .education-catalog-card dl { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
    .quick-reply-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .quick-reply-filters { grid-template-columns: 1fr 190px 150px auto; }
    .quick-reply-clear { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .quick-replies-hero { flex-direction: column; }
    .quick-replies-actions { width: 100%; }
    .quick-replies-actions .button { flex: 1; }
    .quick-reply-filters { grid-template-columns: 1fr; }
    .quick-reply-clear { grid-column: auto; }
    .quick-reply-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .quick-replies-heading-icon { width: 46px; height: 46px; }
    .quick-replies-heading p { font-size: 10px; }
    .quick-replies-actions { flex-direction: column; }
    .quick-replies-actions .button { width: 100%; }
    .quick-reply-form-grid { grid-template-columns: 1fr; }
    .quick-reply-dialog-actions { flex-direction: column-reverse; }
    .quick-reply-dialog-actions .button { width: 100%; }
}

/* Dedicated customer journey pages. */
.lead-stages-theme .content { max-width: 1580px; }
.lead-stage-hero { margin-bottom: 18px; padding: 24px; display: flex; align-items: center; justify-content: space-between; gap: 22px; overflow: hidden; position: relative; background: linear-gradient(120deg,color-mix(in srgb,var(--stage-color) 20%,#171b38),#191e3d 62%); border: 1px solid color-mix(in srgb,var(--stage-color) 38%,var(--line)); border-radius: 20px; box-shadow: var(--shadow); }
.lead-stage-hero::after { content: ""; width: 230px; height: 230px; position: absolute; inset: -95px auto auto -55px; background: radial-gradient(circle,color-mix(in srgb,var(--stage-color) 20%,transparent),transparent 69%); pointer-events: none; }
.lead-stage-hero-main { min-width: 0; display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }
.lead-stage-hero-step { width: 64px; height: 64px; flex: none; display: grid; place-items: center; color: #fff; background: var(--stage-color); border-radius: 18px; box-shadow: 0 13px 30px color-mix(in srgb,var(--stage-color) 34%,transparent); font-size: 19px; font-weight: 800; direction: ltr; }
.lead-stage-hero h2 { margin: 3px 0 4px; font-size: clamp(22px,3vw,30px); }
.lead-stage-hero p { max-width: 680px; margin: 0; color: #aeb5db; font-size: 10px; line-height: 1.9; }
.lead-stage-hero .eyebrow { color: color-mix(in srgb,var(--stage-color) 55%,#fff); }
.lead-stage-hero-actions { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }
.lead-next-stage { min-width: 170px; padding: 10px 13px; color: #dfe2f8; background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.09); border-radius: 12px; }
.lead-next-stage small, .lead-next-stage strong { display: block; }
.lead-next-stage small { color: #8d96c0; font-size: 8px; }
.lead-next-stage strong { margin-top: 2px; font-size: 10px; }
.lead-next-stage:hover { border-color: color-mix(in srgb,var(--stage-color) 55%,var(--line)); background: rgba(255,255,255,.07); }

.lead-journey-nav { margin-bottom: 18px; padding: 17px; background: rgba(25,30,61,.76); border: 1px solid #2d365b; border-radius: 17px; }
.lead-journey-nav-head { margin-bottom: 13px; display: flex; align-items: end; justify-content: space-between; gap: 16px; }
.lead-journey-nav-head h2 { margin: 2px 0 0; font-size: 15px; }
.lead-journey-nav-head > small { color: var(--muted); font-size: 9px; }
.lead-journey-steps { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: 9px; }
.lead-journey-step { min-width: 0; padding: 11px; display: grid; grid-template-columns: 34px minmax(0,1fr) 18px; align-items: center; gap: 9px; color: #c8cdea; background: #151a36; border: 1px solid #30395e; border-radius: 12px; transition: .18s ease; }
.lead-journey-step:hover, .lead-journey-step.active { transform: translateY(-2px); color: #fff; border-color: color-mix(in srgb,var(--stage-color) 58%,#30395e); background: color-mix(in srgb,var(--stage-color) 12%,#171c38); }
.lead-journey-step.active { box-shadow: inset -3px 0 var(--stage-color),0 8px 20px rgba(3,5,22,.18); }
.lead-journey-number { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: color-mix(in srgb,var(--stage-color) 72%,#20264a); border-radius: 10px; font-size: 9px; font-weight: 800; direction: ltr; }
.lead-journey-label { min-width: 0; }
.lead-journey-label strong, .lead-journey-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-journey-label strong { font-size: 10px; }
.lead-journey-label small { margin-top: 2px; color: #7f88b3; font-size: 8px; }
.lead-journey-arrow { color: var(--stage-color); font-size: 13px; }

.lead-stage-summary { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.lead-stage-summary article { min-height: 104px; padding: 17px; overflow: hidden; position: relative; background: linear-gradient(145deg,#1b2142,#181d3a); border: 1px solid #30395e; border-radius: 15px; }
.lead-stage-summary article::after { content: ""; width: 70px; height: 70px; position: absolute; inset: auto auto -35px -25px; background: rgba(139,92,246,.11); border-radius: 50%; }
.lead-stage-summary span, .lead-stage-summary small { display: block; color: #8992bd; font-size: 8px; }
.lead-stage-summary strong { display: block; margin: 4px 0 2px; color: #fff; font-size: 23px; }

.lead-stage-filters { margin-bottom: 16px; padding: 13px; display: grid; grid-template-columns: minmax(260px,1fr) 210px auto auto; align-items: end; gap: 10px; }
.lead-stage-filters label { min-width: 0; }
.lead-stage-filters input, .lead-stage-filters select { margin-top: 5px; }
.lead-stage-list { display: grid; gap: 13px; }
.lead-stage-customer { overflow: hidden; background: linear-gradient(145deg,#1b2142,#181d3a); border: 1px solid #30395e; border-inline-start: 3px solid var(--stage-color); border-radius: 17px; box-shadow: 0 13px 34px rgba(3,5,22,.16); }
.lead-stage-customer-head { padding: 16px 18px 13px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid #2b3456; }
.lead-customer-identity { min-width: 0; display: flex; align-items: center; gap: 11px; }
.lead-customer-identity .avatar { width: 42px; height: 42px; flex: none; color: #fff; background: color-mix(in srgb,var(--stage-color) 78%,#24284d); }
.lead-customer-identity h3 { margin: 1px 0; font-size: 14px; }
.lead-customer-identity small { display: block; max-width: 360px; overflow: hidden; color: #9099c4; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.lead-stage-customer-body { padding: 15px 18px; display: grid; grid-template-columns: minmax(0,1.35fr) minmax(270px,.65fr); gap: 15px; }
.lead-customer-details { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 9px; }
.lead-customer-details > div { padding: 11px; background: #151a35; border: 1px solid #2a3356; border-radius: 11px; }
.lead-customer-details span, .lead-customer-details strong { display: block; }
.lead-customer-details span { margin-bottom: 3px; color: #7d86b1; font-size: 8px; }
.lead-customer-details strong { overflow: hidden; color: #e9ebf9; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.lead-latest-note { min-width: 0; padding: 12px; display: flex; gap: 10px; color: #d9dcf1; background: color-mix(in srgb,var(--stage-color) 8%,#171c38); border: 1px solid color-mix(in srgb,var(--stage-color) 26%,#30395e); border-radius: 12px; }
.lead-latest-note.empty { color: #949cc7; border-style: dashed; }
.lead-note-icon { width: 30px; height: 30px; flex: none; display: grid; place-items: center; color: var(--stage-color); background: color-mix(in srgb,var(--stage-color) 15%,#24294c); border-radius: 9px; }
.lead-latest-note div { min-width: 0; }
.lead-latest-note small, .lead-latest-note time { display: block; color: #828bb7; font-size: 8px; }
.lead-latest-note p { margin: 3px 0; overflow: hidden; font-size: 9px; line-height: 1.7; text-overflow: ellipsis; white-space: nowrap; }
.lead-stage-customer-actions { padding: 12px 18px 16px; display: grid; grid-template-columns: auto minmax(300px,.72fr) minmax(340px,1fr); align-items: center; gap: 9px; border-top: 1px solid #2b3456; }
.lead-move-form { min-width: 0; display: grid; grid-template-columns: 1fr; gap: 4px; }
.lead-inline-note-form { min-width: 0; display: grid; grid-template-columns: minmax(130px,1fr) auto; gap: 7px; }
.lead-move-label > span { display: block; margin-bottom: 4px; color: #aeb5d8; font-size: 8px; font-weight: 800; }
.lead-move-form select, .lead-inline-note-form input { min-width: 0; margin: 0; }
.lead-move-hint { color: #7f88b3; font-size: 7px; line-height: 1.6; }
.lead-move-button { color: #fff; background: color-mix(in srgb,var(--stage-color) 72%,#4c1d95); border-color: transparent; }
.lead-move-button:hover { background: var(--stage-color); }
.lead-stage-empty { min-height: 300px; padding: 45px 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.lead-stage-empty > span { width: 68px; height: 68px; display: grid; place-items: center; color: #8b5cf6; background: #27214f; border-radius: 17px; font-size: 30px; }
.lead-stage-empty h3 { margin: 15px 0 3px; }
.lead-stage-empty p { margin: 0 0 15px; color: var(--muted); font-size: 10px; }

@media (max-width: 1180px) {
    .lead-stage-customer-body { grid-template-columns: 1fr; }
    .lead-stage-customer-actions { grid-template-columns: auto 1fr; }
    .lead-inline-note-form { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
    .lead-stage-hero { align-items: stretch; flex-direction: column; }
    .lead-stage-hero-actions { justify-content: space-between; }
    .lead-stage-filters { grid-template-columns: 1fr 1fr; }
    .lead-customer-details { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 620px) {
    .lead-stage-hero-main { align-items: flex-start; }
    .lead-stage-hero-step { width: 50px; height: 50px; border-radius: 14px; }
    .lead-stage-hero-actions, .lead-journey-nav-head { align-items: stretch; flex-direction: column; }
    .lead-next-stage, .lead-stage-hero-actions .button { width: 100%; }
    .lead-journey-steps, .lead-stage-summary, .lead-stage-filters { grid-template-columns: 1fr; }
    .lead-stage-customer-head { align-items: flex-start; flex-direction: column; }
    .lead-customer-details { grid-template-columns: 1fr; }
    .lead-stage-customer-actions { grid-template-columns: 1fr; }
    .lead-stage-customer-actions > .button { width: 100%; }
    .lead-inline-note-form { grid-column: auto; }
    .lead-inline-note-form { grid-template-columns: 1fr; }
    .lead-move-form .button, .lead-inline-note-form .button { width: 100%; }
}

/* Automation workflows. */
.automations-theme .content { max-width: 1540px; }
.automation-hero { margin-bottom: 18px; padding: 24px 26px; display: flex; align-items: center; justify-content: space-between; gap: 22px; overflow: hidden; position: relative; background: linear-gradient(120deg,#2b1c63,#171d3c 68%); border: 1px solid #453579; border-radius: 21px; box-shadow: var(--shadow); }
.automation-hero::after { content: ""; width: 280px; height: 280px; position: absolute; inset: -150px auto auto -75px; background: radial-gradient(circle,rgba(167,139,250,.2),transparent 70%); pointer-events: none; }
.automation-hero-copy { display: flex; align-items: center; gap: 17px; position: relative; z-index: 1; }
.automation-hero-icon { width: 62px; height: 62px; flex: none; display: grid; place-items: center; color: #fff; background: linear-gradient(145deg,#a78bfa,#6d28d9); border-radius: 18px; box-shadow: 0 15px 32px rgba(109,40,217,.35); font-size: 30px; }
.automation-hero h2 { margin: 3px 0 4px; font-size: clamp(21px,3vw,29px); }
.automation-hero p { margin: 0; color: #aeb5d7; font-size: 10px; }
.automation-hero > .button { position: relative; z-index: 1; }
.automation-stats { margin-bottom: 18px; display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.automation-stats article { min-height: 108px; padding: 17px 19px; overflow: hidden; position: relative; background: linear-gradient(145deg,#1b2142,#181d3a); border: 1px solid #30395e; border-radius: 15px; }
.automation-stats article::after { content: ""; width: 72px; height: 72px; position: absolute; inset: auto auto -35px -24px; background: rgba(139,92,246,.12); border-radius: 50%; }
.automation-stats span, .automation-stats small, .automation-meta small { display: block; color: #8d96c0; font-size: 8px; }
.automation-stats strong { display: block; margin: 4px 0 2px; font-size: 25px; }
.automation-filters { margin-bottom: 18px; padding: 13px; display: grid; grid-template-columns: minmax(250px,1fr) 190px auto auto; align-items: end; gap: 10px; }
.automation-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.automation-card { min-width: 0; padding: 19px; background: linear-gradient(145deg,#1b2142,#181d3a); border: 1px solid #30395e; border-top: 3px solid #8b5cf6; border-radius: 17px; box-shadow: 0 14px 34px rgba(3,5,22,.18); }
.automation-card.is-paused { border-top-color: #5c648b; opacity: .82; }
.automation-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.automation-card-title { min-width: 0; display: flex; align-items: center; gap: 11px; }
.automation-card-title > span { width: 40px; height: 40px; flex: none; display: grid; place-items: center; color: #c4b5fd; background: #2a2456; border-radius: 11px; font-size: 20px; }
.automation-card-title h3 { margin: 0 0 2px; font-size: 14px; }
.automation-card-title small { display: block; overflow: hidden; color: #8790ba; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.automation-flow { margin: 17px 0; display: grid; grid-template-columns: minmax(0,1fr) 28px minmax(0,1fr); align-items: stretch; gap: 7px; }
.automation-flow > div { min-width: 0; padding: 11px; background: #121731; border: 1px solid #2d365a; border-radius: 11px; }
.automation-flow > div small, .automation-flow > div strong { display: block; }
.automation-flow > div small { color: #8d96c0; font-size: 8px; }
.automation-flow > div strong { margin-top: 3px; overflow: hidden; color: #e8e9f8; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.automation-flow > span { display: grid; place-items: center; color: #a78bfa; font-size: 17px; }
.automation-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; }
.automation-meta > span { min-width: 0; padding: 9px; background: rgba(255,255,255,.025); border-radius: 9px; }
.automation-meta strong { display: block; margin-top: 2px; overflow: hidden; color: #dfe2f4; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.automation-error { margin: 12px 0 0; padding: 9px 11px; color: #ffc1ca; background: rgba(251,113,133,.1); border: 1px solid rgba(251,113,133,.18); border-radius: 9px; font-size: 8px; }
.automation-card > footer { margin-top: 15px; padding-top: 13px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #2d3658; }
.automation-card > footer .button { min-height: 36px; padding: 6px 12px; font-size: 9px; }
.automation-card > footer form:last-child { margin-inline-start: auto; }
.automation-empty { min-height: 320px; padding: 45px 20px; grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.automation-empty > span { width: 72px; height: 72px; display: grid; place-items: center; color: #c4b5fd; background: #292252; border-radius: 18px; font-size: 32px; }
.automation-empty h3 { margin: 15px 0 3px; }
.automation-empty p { margin: 0 0 16px; color: var(--muted); font-size: 10px; }
.automation-dialog { width: min(790px,calc(100vw - 28px)); max-height: min(90vh,820px); padding: 0; overflow: auto; color: #f8f8ff; background: #191f3f; border: 1px solid #384269; border-radius: 19px; box-shadow: 0 32px 90px rgba(1,3,18,.58); }
.automation-dialog::backdrop { background: rgba(4,6,25,.78); backdrop-filter: blur(6px); }
.automation-dialog-head { padding: 19px 22px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid #30395e; }
.automation-dialog-head > div { display: flex; align-items: center; gap: 11px; }
.automation-dialog-head > div > span { width: 38px; height: 38px; display: grid; place-items: center; color: #c4b5fd; background: #2a2356; border-radius: 11px; }
.automation-dialog-head small { display: block; color: #8c95bf; font-size: 8px; }
.automation-dialog-head h3 { margin: 1px 0 0; font-size: 16px; }
.automation-dialog-head > button { width: 34px; height: 34px; color: #a6add0; background: transparent; border: 0; border-radius: 9px; font-size: 22px; }
.automation-dialog > form { padding-bottom: 20px; }
.automation-form-grid { padding: 20px 22px 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.automation-message-field { grid-column: 1 / -1; }
.automation-active-row { min-height: 68px; padding: 11px 13px; grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #202746; border: 1px solid #30395e; border-radius: 11px; }
.automation-active-row strong, .automation-active-row small { display: block; }
.automation-active-row input { width: 42px; height: 22px; accent-color: #7c3aed; }
.automation-dialog-actions { margin: 18px 22px 0; padding-top: 15px; display: flex; justify-content: flex-end; gap: 9px; border-top: 1px solid #30395e; }
[data-phone-field][hidden] { display: none; }

@media (max-width: 900px) {
    .automation-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .automation-hero { align-items: stretch; flex-direction: column; }
    .automation-hero > .button { width: 100%; }
    .automation-stats, .automation-filters, .automation-form-grid { grid-template-columns: 1fr; }
    .automation-message-field, .automation-active-row { grid-column: auto; }
}
@media (max-width: 480px) {
    .automation-hero-copy { align-items: flex-start; }
    .automation-hero-icon { width: 49px; height: 49px; border-radius: 14px; }
    .automation-flow { grid-template-columns: 1fr; }
    .automation-flow > span { transform: rotate(-90deg); }
    .automation-meta { grid-template-columns: 1fr; }
    .automation-card > footer { flex-wrap: wrap; }
    .automation-dialog-actions { flex-direction: column-reverse; }
    .automation-dialog-actions .button { width: 100%; }
}

/* Per-device interface customizer. */
html[data-container="full"] .content { max-width: none; }
html[data-container="boxed"] .content { max-width: 1180px; }

html[data-card="border"] :is(.panel,.stat-card,.report-kpi,.quick-reply-card,.lead-stage-customer,.automation-card,.automation-stats article) { box-shadow: none; }
html[data-card="shadow"] :is(.panel,.stat-card,.report-kpi,.quick-reply-card,.lead-stage-customer,.automation-card,.automation-stats article) { border-color: transparent; box-shadow: var(--shadow); }

@media (min-width: 821px) {
    html[data-sidebar="collapsed"] .sidebar { width: 88px; padding-inline: 12px; }
    html[data-sidebar="collapsed"] .main-area { margin-right: 88px; }
    html[data-sidebar="collapsed"] .brand { justify-content: center; padding-inline: 0; }
    html[data-sidebar="collapsed"] .brand-logo { width: 50px; height: 50px; }
    html[data-sidebar="collapsed"] .brand > span:last-child,
    html[data-sidebar="collapsed"] .nav-heading,
    html[data-sidebar="collapsed"] .nav-link > :not(:first-child),
    html[data-sidebar="collapsed"] .nav-link > small,
    html[data-sidebar="collapsed"] .nav-group-toggle > b,
    html[data-sidebar="collapsed"] .nav-group-toggle > i,
    html[data-sidebar="collapsed"] .sidebar-user > span,
    html[data-sidebar="collapsed"] .sidebar-user > form { display: none; }
    html[data-sidebar="collapsed"] .nav-heading { height: 13px; margin-top: 8px; padding: 0; border-bottom: 1px solid rgba(255,255,255,.1); }
    html[data-sidebar="collapsed"] .nav-link { padding-inline: 0; justify-content: center; font-size: 0; }
    html[data-sidebar="collapsed"] .nav-link > span:first-child { width: 38px; font-size: 18px; }
    html[data-sidebar="collapsed"] .nav-group { padding: 0; border-color: transparent; background: transparent; }
    html[data-sidebar="collapsed"] .nav-group-toggle { padding-inline: 0; justify-content: center; font-size: 0; }
    html[data-sidebar="collapsed"] .nav-group-toggle > span { width: 38px; font-size: 18px; }
    html[data-sidebar="collapsed"] .nav-group-links { display: none; }
    html[data-sidebar="collapsed"] .sidebar-user { justify-content: center; padding-inline: 0; }
}

.ui-customizer-toggle { color: var(--gold) !important; }
.ui-customizer-overlay { position: fixed; z-index: 70; inset: 0; opacity: 0; visibility: hidden; background: rgba(2,4,20,.58); backdrop-filter: blur(3px); transition: .22s ease; }
.ui-customizer { width: min(380px,92vw); position: fixed; z-index: 80; inset: 0 auto 0 0; display: flex; flex-direction: column; color: var(--text); background: var(--surface); border-inline-end: 1px solid var(--line); box-shadow: 25px 0 70px rgba(2,4,20,.35); transform: translateX(-105%); transition: .25s ease; }
.ui-customizer.open { transform: translateX(0); }
.ui-customizer-open .ui-customizer-overlay { opacity: 1; visibility: visible; }
.ui-customizer-head { padding: 22px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.ui-customizer-head h2 { margin: 3px 0 2px; font-size: 20px; }
.ui-customizer-head p { margin: 0; color: var(--muted); font-size: 9px; }
.ui-customizer-head > button { width: 36px; height: 36px; flex: none; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; font-size: 22px; }
.ui-customizer-body { flex: 1; padding: 20px 22px; overflow-y: auto; }
.ui-option-section { padding: 0 0 24px; }
.ui-option-section + .ui-option-section { padding-top: 20px; border-top: 1px solid var(--line); }
.ui-option-section h3 { margin: 0 0 11px; font-size: 12px; }
.ui-option-grid { display: grid; gap: 10px; }
.ui-option-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
.ui-option-grid button { min-height: 62px; padding: 10px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ui-option-grid button span { color: var(--brown); font-size: 20px; }
.ui-option-grid button strong { font-size: 10px; }
.ui-option-grid button:hover, .ui-option-grid button.selected { color: var(--text); border-color: color-mix(in srgb,var(--brown) 60%,var(--line)); background: color-mix(in srgb,var(--brown) 8%,var(--surface)); }
.ui-option-grid button.selected { box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--brown) 38%,transparent); }
.ui-color-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.ui-color-option { min-height: 55px; position: relative; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.ui-color-option > span { width: 21px; height: 21px; display: block; background: var(--ui-swatch); border-radius: 50%; box-shadow: 0 0 0 4px color-mix(in srgb,var(--ui-swatch) 12%,transparent); }
.ui-color-option:hover, .ui-color-option.selected { border-color: var(--ui-swatch); }
.ui-color-option.selected::after { content: "✓"; width: 17px; height: 17px; position: absolute; inset: 5px 5px auto auto; display: grid; place-items: center; color: #fff; background: var(--ui-swatch); border-radius: 50%; font-size: 10px; font-weight: 800; }
.ui-customizer-footer { padding: 15px 22px 20px; border-top: 1px solid var(--line); }

:root[data-theme="light"] body { background: radial-gradient(circle at 75% 8%,color-mix(in srgb,var(--brown) 8%,transparent),transparent 26%),var(--bg); }
:root[data-theme="light"] .topbar { background: color-mix(in srgb,var(--surface) 92%,transparent); }
:root[data-theme="light"] .button.secondary { color: var(--brown); }
:root[data-theme="light"] :is(.quick-reply-card,.quick-reply-filters,.quick-reply-category-pill,.quick-reply-pagination,.automation-card,.automation-stats article,.automation-filters,.lead-stage-customer,.lead-journey-nav) { color: var(--text); background: var(--surface); border-color: var(--line); }
:root[data-theme="light"] :is(.quick-reply-card h3,.quick-replies-heading h2,.automation-card-title h3,.automation-stats strong,.lead-stage-customer h3) { color: var(--text); }
:root[data-theme="light"] :is(.quick-reply-card > p,.quick-replies-heading p,.automation-card-title small) { color: var(--muted); }
:root[data-theme="light"] :is(.quick-reply-filters input,.quick-reply-filters select,.automation-flow > div,.automation-meta > span) { color: var(--text); background: var(--surface-2); border-color: var(--line); }
:root[data-theme="light"] .quick-replies-theme .topbar { background: color-mix(in srgb,var(--surface) 92%,transparent); border-color: var(--line); }

@media (max-width: 560px) {
    .ui-customizer { width: min(360px,94vw); }
    .ui-customizer-head, .ui-customizer-body { padding-inline: 17px; }
    .ui-customizer-footer { padding-inline: 17px; }
}

/* ConvoBest-inspired neon workspace: shared by every admin and employee page. */
:root:not([data-theme="light"]) body {
    background:
        radial-gradient(circle at 76% 0, rgba(0,229,160,.085), transparent 28%),
        radial-gradient(circle at 18% 100%, rgba(17,215,211,.055), transparent 34%),
        var(--bg);
}
:root:not([data-theme="light"]) .sidebar {
    background: linear-gradient(180deg,#07121b 0%,#081019 58%,#050b11 100%);
    border-inline-start: 1px solid #16323a;
    box-shadow: -12px 0 36px rgba(0,0,0,.32);
}
:root:not([data-theme="light"]) .brand-mark {
    color: #001710;
    background: linear-gradient(145deg,var(--brown-dark),var(--brown));
    box-shadow: 0 0 28px rgba(0,229,160,.24);
}
:root:not([data-theme="light"]) .brand-logo { border-color: rgba(0,229,160,.42); }
:root:not([data-theme="light"]) .nav-heading { color: #607a77; }
:root:not([data-theme="light"]) .nav-link { color: #9bb0ad; }
:root:not([data-theme="light"]) .nav-link span { color: var(--gold); }
:root:not([data-theme="light"]) .nav-link:hover,
:root:not([data-theme="light"]) .nav-link.active {
    color: #eafff8;
    background: linear-gradient(90deg,rgba(0,229,160,.14),rgba(17,215,211,.055));
    box-shadow: inset -3px 0 var(--brown),0 0 0 1px rgba(0,229,160,.12);
}
:root:not([data-theme="light"]) .sidebar-user { border-color: #18323a; }
:root:not([data-theme="light"]) .sidebar-user .avatar { color: #001710; background: var(--brown); }
:root:not([data-theme="light"]) .topbar {
    background: rgba(5,12,18,.9);
    border-color: #17313a;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
:root:not([data-theme="light"]) :is(
    .panel,.stat-card,.report-card,.report-kpi,.table-panel,.table-wrap,.form-panel,
    .profile-card,.role-card,.settings-hub-card,.broadcast-card,.channel-card,.chat-panel,
    .quick-reply-card,.quick-reply-filters,.quick-reply-pagination,.quick-reply-dialog,
    .lead-stage-customer,.lead-stage-filters,.lead-journey-nav,.lead-stage-empty,
    .automation-card,.automation-stats article,.automation-filters,.automation-dialog,
    .template-manager-card,.transfer-dialog,.qr-connect-panel
) {
    background: linear-gradient(145deg,#0b1620,#09131c);
    border-color: #1b3941;
    box-shadow: 0 16px 38px rgba(0,0,0,.18);
}
:root:not([data-theme="light"]) :is(.panel,.stat-card,.report-kpi,.quick-reply-card,.lead-stage-customer,.automation-card):hover {
    border-color: rgba(0,229,160,.42);
}
:root:not([data-theme="light"]) .welcome-card,
:root:not([data-theme="light"]) .quick-replies-hero,
:root:not([data-theme="light"]) .lead-stage-hero,
:root:not([data-theme="light"]) .automation-hero,
:root:not([data-theme="light"]) .login-story {
    color: #effff9;
    background:
        radial-gradient(circle at 15% 30%,rgba(0,229,160,.16),transparent 30%),
        linear-gradient(120deg,#0b2026,#07131d 62%,#050c13);
    border-color: rgba(0,229,160,.38);
    box-shadow: 0 18px 50px rgba(0,0,0,.28),inset 0 0 60px rgba(17,215,211,.035);
}
:root:not([data-theme="light"]) .welcome-card .arabesque { color: var(--brown-dark); border-color: rgba(0,229,160,.28); }
:root:not([data-theme="light"]) .button.primary,
:root:not([data-theme="light"]) .quick-reply-primary,
:root:not([data-theme="light"]) .lead-move-button {
    color: #001710;
    background: linear-gradient(110deg,var(--brown),var(--gold));
    border-color: transparent;
    box-shadow: 0 10px 28px rgba(0,229,160,.22);
}
:root:not([data-theme="light"]) .button.primary:hover,
:root:not([data-theme="light"]) .quick-reply-primary:hover,
:root:not([data-theme="light"]) .lead-move-button:hover { color: #001710; background: var(--brown-dark); }
:root:not([data-theme="light"]) .button.secondary { color: var(--brown-dark); background: #0d1a24; border-color: #23424a; }
:root:not([data-theme="light"]) :is(input,select,textarea,.quick-reply-picker-search) {
    color: var(--text);
    background: #08131c;
    border-color: #24424a;
}
:root:not([data-theme="light"]) :is(input,select,textarea):focus {
    border-color: var(--brown);
    box-shadow: 0 0 0 3px rgba(0,229,160,.13);
    outline: 0;
}
:root:not([data-theme="light"]) :is(.quick-reply-category-pill,.role-pill,.badge.muted,.field-status) { background: #10242b; border-color: #24434a; }
:root:not([data-theme="light"]) :is(.quick-reply-card-icon,.quick-replies-heading-icon,.automation-hero-icon,.lead-note-icon,.quick-icon) {
    color: var(--brown-dark);
    background: rgba(0,229,160,.1);
    border-color: rgba(0,229,160,.25);
}
:root:not([data-theme="light"]) :is(.stat-card.gold,.stat-card.brown,.stat-card.green) { color: var(--brown); border-top-color: var(--brown); }
:root:not([data-theme="light"]) .stat-card.blue { color: var(--gold); border-top-color: var(--gold); }
:root:not([data-theme="light"]) :is(.report-line-chart,.report-range-line,.automation-flow,.automation-meta > span) { border-color: #1d3b43; }
:root:not([data-theme="light"]) :is(table thead th,.data-table thead th) { color: #99b5b0; background: #0d1c25; border-color: #1d3b43; }
:root:not([data-theme="light"]) :is(table tbody td,.data-table tbody td) { border-color: #172f37; }
:root:not([data-theme="light"]) :is(table tbody tr:hover,.data-table tbody tr:hover) { background: rgba(0,229,160,.045); }
:root:not([data-theme="light"]) .status-dot { background: var(--brown); box-shadow: 0 0 0 4px rgba(0,229,160,.12),0 0 12px rgba(0,229,160,.42); }
:root:not([data-theme="light"]) .ui-customizer { background: #08131c; border-color: #1b3941; }
:root:not([data-theme="light"]) .ui-option-grid button,
:root:not([data-theme="light"]) .ui-color-option { background: #0d1a24; border-color: #203d45; }
:root:not([data-theme="light"]) .login-page { background: #050b11; }
:root:not([data-theme="light"]) .login-form-panel { background: linear-gradient(145deg,#0b1620,#071018); border-color: #1b3941; }

/* Unified WhatsApp inbox */
.nav-whatsapp-icon { width: 21px; height: 21px; display: inline-grid; place-items: center; flex: 0 0 21px; }
.nav-whatsapp-icon svg { width: 21px; height: 21px; fill: currentColor; }
.nav-keyword-icon { width: 21px!important; height: 21px; display: inline-grid; place-items: center; flex: 0 0 21px; }
.nav-keyword-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.inbox-theme .content { max-width: none; padding: 16px 20px 22px; }
.inbox-toolbar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.inbox-channel { display: flex; align-items: center; gap: 10px; }
.inbox-channel > span:last-child { display: grid; gap: 1px; }
.inbox-channel small { color: var(--muted); font-size: 10px; }
.inbox-channel strong { font-size: 12px; }
.inbox-whatsapp-mark { width: 30px; height: 30px; display: grid; place-items: center; color: #001b13; background: var(--brown); border-radius: 50%; font-weight: 900; box-shadow: 0 0 20px rgba(0,229,160,.25); }
.inbox-workspace { direction: ltr; height: calc(100vh - 220px); min-height: 610px; display: grid; grid-template-columns: 340px minmax(0,1fr); overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.inbox-sidebar,.inbox-chat { direction: rtl; min-width: 0; }
.inbox-sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: color-mix(in srgb,var(--surface-2) 68%,var(--surface)); }
.inbox-tabs { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; padding: 10px; border-bottom: 1px solid var(--line); }
.inbox-tabs a { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 6px 12px; color: var(--muted); border: 1px solid transparent; border-radius: 11px; font-size: 11px; font-weight: 800; }
.inbox-tabs a.active { color: var(--brown-dark); background: color-mix(in srgb,var(--brown) 16%,transparent); border-color: color-mix(in srgb,var(--brown) 55%,var(--line)); }
.inbox-search { padding: 12px; border-bottom: 1px solid var(--line); }
.inbox-search label { height: 42px; display: flex; align-items: center; gap: 8px; padding-inline: 12px; color: var(--muted); background: color-mix(in srgb,var(--surface) 75%,#050b11); border: 1px solid var(--line); border-radius: 12px; }
.inbox-search input { width: 100%; height: 38px; padding: 0; border: 0!important; box-shadow: none!important; background: transparent!important; font-size: 11px; }
.inbox-thread-list { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--brown) transparent; }
.inbox-thread { position: relative; min-height: 82px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 13px; color: var(--text); border-bottom: 1px solid var(--line); transition: background .18s,border-color .18s; }
.inbox-thread:hover { background: color-mix(in srgb,var(--brown) 6%,var(--surface)); }
.inbox-thread.active { background: color-mix(in srgb,var(--brown) 9%,var(--surface)); box-shadow: inset -3px 0 var(--brown); }
.inbox-avatar { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 40px; color: var(--brown-dark); background: color-mix(in srgb,var(--brown) 11%,var(--surface-2)); border: 1px solid color-mix(in srgb,var(--brown) 24%,var(--line)); border-radius: 50%; font-weight: 800; }
.inbox-avatar.group { color: #001b13; background: var(--brown); }
.inbox-thread-copy { min-width: 0; display: grid; gap: 5px; }
.inbox-thread-copy > span { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inbox-thread-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.inbox-thread-copy time,.inbox-thread-copy small { color: var(--muted); font-size: 8px; }
.inbox-thread-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-unread { min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; color: #001b13; background: var(--brown); border-radius: 999px; font-size: 8px; }
.inbox-list-empty { padding: 36px 18px; color: var(--muted); text-align: center; font-size: 11px; }
.inbox-chat { position: relative; display: flex; flex-direction: column; min-height: 0; background: radial-gradient(circle at 70% 15%,color-mix(in srgb,var(--brown) 4%,transparent),transparent 33%),var(--surface); }
.inbox-chat-header { min-height: 68px; display: flex; align-items: center; gap: 11px; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.inbox-chat-header > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.inbox-chat-header strong { font-size: 13px; }
.inbox-chat-header small { color: var(--muted); font-size: 9px; }
.inbox-live { margin-inline-start: auto; display: flex!important; grid-auto-flow: column; align-items: center; gap: 6px!important; color: var(--muted); font-size: 9px; }
.inbox-live i { width: 7px; height: 7px; background: var(--brown); border-radius: 50%; box-shadow: 0 0 10px var(--brown); }
.inbox-messages { direction: ltr; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding: 24px 26px; scrollbar-width: thin; scrollbar-color: var(--brown) transparent; }
.inbox-message { direction: rtl; width: fit-content; max-width: min(68%,680px); padding: 11px 14px 8px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.inbox-message.incoming { align-self: flex-start; border-bottom-left-radius: 4px; }
.inbox-message.outgoing { align-self: flex-end; color: color-mix(in srgb,var(--text) 95%,white); background: color-mix(in srgb,var(--brown) 14%,var(--surface-2)); border-color: color-mix(in srgb,var(--brown) 40%,var(--line)); border-bottom-right-radius: 4px; }
.inbox-message > b { display: block; margin-bottom: 4px; color: var(--brown-dark); font-size: 9px; }
.inbox-message p { margin: 0; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 11px; }
.inbox-message footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 7px; }
.inbox-message.outgoing footer span { color: var(--brown-dark); }
.inbox-welcome,.inbox-chat-empty { margin: auto; display: grid; place-items: center; gap: 8px; color: var(--muted); text-align: center; }
.inbox-welcome strong,.inbox-chat-empty strong { color: var(--text); font-size: 15px; }
.inbox-welcome p,.inbox-chat-empty small { max-width: 430px; margin: 0; font-size: 10px; line-height: 1.8; }
.inbox-welcome-icon { width: 58px; height: 58px; display: grid; place-items: center; color: var(--brown-dark); background: color-mix(in srgb,var(--brown) 8%,var(--surface-2)); border: 1px solid color-mix(in srgb,var(--brown) 22%,var(--line)); border-radius: 50%; font-size: 25px; }
.inbox-chat-empty { flex: 1; }
.inbox-composer { direction: rtl; min-height: 66px; display: flex; align-items: center; gap: 9px; padding: 10px 14px; border-top: 1px solid var(--line); background: color-mix(in srgb,var(--surface-2) 74%,var(--surface)); }
.inbox-composer textarea { flex: 1; min-height: 42px; max-height: 112px; resize: vertical; padding: 11px 14px; border-radius: 13px; font-size: 11px; }
.inbox-composer select { width: 108px; height: 42px; padding: 0 9px; border-radius: 12px; font-size: 9px; }
.inbox-composer button { width: 42px; height: 42px; display: grid; place-items: center; color: #001b13; background: var(--brown); border: 0; border-radius: 12px; cursor: pointer; font-size: 17px; box-shadow: 0 8px 22px rgba(0,229,160,.2); }
.inbox-readonly { padding: 18px; color: var(--muted); border-top: 1px solid var(--line); text-align: center; font-size: 10px; }

@media (max-width: 1050px) {
    .inbox-workspace { grid-template-columns: 290px minmax(0,1fr); }
}
@media (max-width: 760px) {
    .inbox-theme .content { padding: 10px; }
    .inbox-toolbar { margin-bottom: 8px; }
    .inbox-workspace { height: auto; min-height: 0; grid-template-columns: 1fr; overflow: visible; }
    .inbox-sidebar { height: 390px; border-right: 0; border-bottom: 1px solid var(--line); }
    .inbox-chat { min-height: 610px; }
    .inbox-message { max-width: 88%; }
}
@media (max-width: 480px) {
    .inbox-channel small { display: none; }
    .inbox-chat-header { padding-inline: 12px; }
    .inbox-messages { padding: 16px 12px; }
    .inbox-composer { flex-wrap: wrap; }
    .inbox-composer select { width: calc(100% - 51px); order: 2; }
}

/* WhatsApp Web-style inbox */
.wa-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.wa-web-shell {
    --wa-green: #00a884;
    --wa-green-strong: #00c896;
    --wa-pane: #111b21;
    --wa-pane-2: #202c33;
    --wa-pane-3: #182229;
    --wa-canvas: #0b141a;
    --wa-line: #2a3942;
    --wa-text: #e9edef;
    --wa-muted: #8696a0;
    --wa-incoming: #202c33;
    --wa-outgoing: #005c4b;
    direction: ltr;
    position: relative;
    height: calc(100vh - 178px);
    min-height: 610px;
    display: grid;
    grid-template-columns: 390px minmax(0,1fr);
    overflow: hidden;
    color: var(--wa-text);
    background: var(--wa-canvas);
    border: 1px solid var(--wa-line);
    border-radius: 12px;
    box-shadow: 0 18px 60px rgba(0,0,0,.2);
}
.wa-web-shell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wa-list-pane,.wa-chat-pane { direction: rtl; min-width: 0; min-height: 0; }
.wa-list-pane { position: relative; display: flex; flex-direction: column; background: var(--wa-pane); border-right: 1px solid var(--wa-line); }
.wa-list-header,.wa-chat-header { min-height: 60px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--wa-pane-2); }
.wa-list-header { justify-content: space-between; }
.wa-header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 5px; }
.wa-icon-button { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; color: var(--wa-muted); background: transparent; border: 0; border-radius: 50%; cursor: pointer; transition: color .16s,background .16s; }
.wa-icon-button:hover,.wa-icon-button:focus-visible { color: var(--wa-text); background: rgba(255,255,255,.08); }
.wa-avatar { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; overflow: hidden; color: #d9fdd3; background: linear-gradient(145deg,#176b5c,#0f8d74); border-radius: 50%; font-size: 15px; font-weight: 900; }
.wa-avatar-me { width: 40px; height: 40px; flex-basis: 40px; background: linear-gradient(145deg,#536b78,#263943); }
.wa-avatar-group { color: #e9edef; background: #667781; }
.wa-avatar svg { width: 23px; height: 23px; }
.wa-channel-strip { min-height: 58px; display: flex; align-items: center; gap: 10px; padding: 9px 13px; background: #182229; border-bottom: 1px solid var(--wa-line); }
.wa-channel-strip > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.wa-channel-strip strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.wa-channel-strip small { color: var(--wa-muted); font-size: 9px; }
.wa-channel-strip i { width: 8px; height: 8px; margin-inline-start: auto; background: var(--wa-green-strong); border-radius: 50%; box-shadow: 0 0 0 4px rgba(0,168,132,.12); }
.wa-channel-icon { width: 30px; height: 30px; display: grid; place-items: center; color: #071d18; background: var(--wa-green-strong); border-radius: 50%; font-weight: 900; }
.wa-search-box { height: 49px; display: flex; align-items: center; gap: 12px; margin: 0; padding: 7px 12px; background: var(--wa-pane); border-bottom: 1px solid var(--wa-line); }
.wa-search-box > svg { width: 18px; height: 18px; margin-inline-start: 10px; color: var(--wa-muted); position: absolute; pointer-events: none; }
.wa-search-box input { width: 100%; height: 35px; margin: 0; padding: 0 42px 0 36px; color: var(--wa-text); background: var(--wa-pane-2); border: 0!important; border-radius: 9px; box-shadow: none!important; font-size: 11px; }
.wa-search-box input::placeholder { color: var(--wa-muted); }
.wa-search-box > a { width: 28px; height: 28px; margin-inline-start: -39px; z-index: 1; display: grid; place-items: center; color: var(--wa-muted); }
.wa-search-box > a svg { width: 16px; height: 16px; }
.wa-filter-row { display: flex; gap: 7px; padding: 7px 11px 9px; overflow-x: auto; background: var(--wa-pane); border-bottom: 1px solid var(--wa-line); scrollbar-width: none; }
.wa-filter-row::-webkit-scrollbar { display: none; }
.wa-filter-row button,.wa-filter-row a { min-width: max-content; padding: 6px 12px; color: var(--wa-muted); background: var(--wa-pane-2); border: 0; border-radius: 999px; cursor: pointer; font-size: 9px; font-weight: 700; }
.wa-filter-row .active { color: #d9fdd3; background: rgba(0,168,132,.2); }
.wa-thread-list { flex: 1; overflow-y: auto; background: var(--wa-pane); scrollbar-width: thin; scrollbar-color: #374248 transparent; }
.wa-thread { min-height: 74px; display: flex; align-items: center; gap: 11px; padding: 9px 12px; color: var(--wa-text); transition: background .14s; }
.wa-thread:hover { background: #202c33; }
.wa-thread.active { background: #2a3942; }
.wa-thread-main { min-width: 0; flex: 1; align-self: stretch; display: flex; justify-content: center; flex-direction: column; gap: 5px; padding-bottom: 7px; border-bottom: 1px solid rgba(134,150,160,.13); }
.wa-thread:last-child .wa-thread-main { border-bottom-color: transparent; }
.wa-thread-line { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wa-thread-line strong,.wa-thread-line small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-thread-line strong { font-size: 12px; font-weight: 650; }
.wa-thread-line time { min-width: max-content; color: var(--wa-muted); direction: ltr; font-size: 8px; }
.wa-thread-preview small { flex: 1; color: var(--wa-muted); font-size: 9px; }
.wa-mini-check { color: #53bdeb; letter-spacing: -4px; margin-inline-end: 5px; }
.wa-unread { min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px; color: #061a16; background: var(--wa-green-strong); border-radius: 999px; font-size: 8px; }
.wa-list-empty { min-height: 230px; display: grid; place-content: center; justify-items: center; gap: 8px; padding: 30px; color: var(--wa-muted); text-align: center; }
.wa-list-empty svg { width: 30px; height: 30px; }
.wa-list-empty strong { color: var(--wa-text); font-size: 13px; }
.wa-list-empty small { max-width: 240px; font-size: 9px; line-height: 1.8; }
.wa-chat-pane { position: relative; display: flex; flex-direction: column; overflow: hidden; background: var(--wa-canvas); }
.wa-chat-header { z-index: 4; flex: 0 0 60px; border-bottom: 1px solid rgba(0,0,0,.2); }
.wa-chat-identity { min-width: 0; flex: 1; display: flex; align-items: center; gap: 11px; padding: 0; color: var(--wa-text); background: transparent; border: 0; text-align: start; cursor: pointer; }
.wa-chat-identity > span:last-child { min-width: 0; display: grid; gap: 2px; }
.wa-chat-identity strong,.wa-chat-identity small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-chat-identity strong { font-size: 12px; }
.wa-chat-identity small { color: var(--wa-muted); font-size: 9px; }
.wa-mobile-back { display: none; }
.wa-popover { z-index: 30; position: absolute; min-width: 190px; padding: 7px 0; background: #233138; border: 1px solid #34434b; border-radius: 4px; box-shadow: 0 10px 35px rgba(0,0,0,.4); }
.wa-list-menu { top: 52px; left: 12px; }
.wa-chat-menu { top: 53px; left: 15px; }
.wa-popover a,.wa-popover button { width: 100%; display: block; padding: 10px 17px; color: var(--wa-text); background: transparent; border: 0; text-align: start; cursor: pointer; font-size: 10px; }
.wa-popover a:hover,.wa-popover button:hover { background: rgba(255,255,255,.06); }
.wa-message-search { z-index: 5; min-height: 54px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--wa-pane); border-bottom: 1px solid var(--wa-line); }
.wa-message-search > svg { color: var(--wa-muted); }
.wa-message-search input { flex: 1; height: 36px; margin: 0; padding: 0 12px; color: var(--wa-text); background: var(--wa-pane-2); border: 0!important; border-radius: 8px; box-shadow: none!important; font-size: 10px; }
.wa-message-search > span { min-width: 65px; color: var(--wa-muted); font-size: 9px; }
.wa-message-canvas {
    direction: ltr;
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    overflow-y: auto;
    padding: 14px 6.5%;
    background-color: var(--wa-canvas);
    background-image:
        linear-gradient(rgba(11,20,26,.93),rgba(11,20,26,.93)),
        radial-gradient(circle at 20% 30%,rgba(134,150,160,.11) 0 1px,transparent 1.5px),
        radial-gradient(circle at 72% 68%,rgba(134,150,160,.09) 0 1px,transparent 1.5px);
    background-size: auto,44px 44px,56px 56px;
    scrollbar-width: thin;
    scrollbar-color: #374248 transparent;
}
.wa-encryption-note { direction: rtl; max-width: 430px; align-self: center; margin: 5px 0 10px; padding: 6px 12px; color: #ffd279; background: #182229; border-radius: 7px; text-align: center; font-size: 8px; }
.wa-day-label { direction: rtl; position: sticky; top: 2px; z-index: 2; align-self: center; margin: 8px 0; padding: 6px 12px; color: #d3dbe0; background: rgba(24,34,41,.94); border-radius: 7px; box-shadow: 0 1px 3px rgba(0,0,0,.2); font-size: 8px; }
.wa-message { direction: rtl; position: relative; width: fit-content; max-width: min(66%,680px); margin-block: 1px; padding: 7px 9px 5px; color: var(--wa-text); background: var(--wa-incoming); border-radius: 8px; box-shadow: 0 1px 1px rgba(0,0,0,.28); transition: opacity .15s,transform .15s,box-shadow .15s; }
.wa-message.incoming { align-self: flex-start; border-top-left-radius: 2px; }
.wa-message.outgoing { align-self: flex-end; background: var(--wa-outgoing); border-top-right-radius: 2px; }
.wa-message.incoming::before,.wa-message.outgoing::before { content: ""; position: absolute; top: 0; width: 0; height: 0; border-style: solid; }
.wa-message.incoming::before { left: -7px; border-width: 0 8px 9px 0; border-color: transparent var(--wa-incoming) transparent transparent; }
.wa-message.outgoing::before { right: -7px; border-width: 0 0 9px 8px; border-color: transparent transparent transparent var(--wa-outgoing); }
.wa-message.search-hidden { display: none; }
.wa-message-flash { box-shadow: 0 0 0 3px rgba(0,168,132,.5),0 1px 1px rgba(0,0,0,.28); }
.wa-message-caret { position: absolute; top: 3px; inset-inline-start: 3px; width: 25px; height: 24px; z-index: 1; display: grid; place-items: center; padding: 0; color: var(--wa-muted); background: linear-gradient(90deg,transparent,var(--wa-incoming) 45%); border: 0; border-radius: 50%; opacity: 0; cursor: pointer; transition: opacity .13s; }
.wa-message.outgoing .wa-message-caret { background: linear-gradient(90deg,transparent,var(--wa-outgoing) 45%); }
.wa-message:hover .wa-message-caret,.wa-message-caret:focus-visible { opacity: 1; }
.wa-message-caret svg { width: 15px; height: 15px; }
.wa-message-actions { z-index: 12; position: absolute; bottom: calc(100% + 6px); inset-inline-start: 2px; display: flex; align-items: center; gap: 3px; padding: 5px; direction: rtl; background: #233138; border: 1px solid #34434b; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.38); }
.wa-message-actions[hidden],.wa-message-reaction-picker[hidden] { display: none!important; }
.wa-message-actions button { position: relative; width: 38px; height: 36px; display: grid; place-items: center; padding: 0; color: var(--wa-text); background: transparent; border: 0; border-radius: 8px; cursor: pointer; }
.wa-message-actions button:hover { background: rgba(255,255,255,.07); }
.wa-message-actions button > span { position: absolute; bottom: calc(100% + 7px); left: 50%; width: max-content; max-width: 150px; padding: 5px 7px; opacity: 0; pointer-events: none; color: #fff; background: #111b21; border-radius: 5px; transform: translateX(-50%) translateY(3px); transition: opacity .14s,transform .14s; font-size: 10px; }
.wa-message-actions button:hover > span,.wa-message-actions button:focus-visible > span { opacity: 1; transform: translateX(-50%) translateY(0); }
.wa-message-actions svg { width: 18px; height: 18px; }
.wa-message-actions button > b { color: #55e7b4; font-size: 10px; letter-spacing: -.4px; }
.wa-message-copied { box-shadow: 0 0 0 2px rgba(0,168,132,.75),0 1px 1px rgba(0,0,0,.28); }
.wa-message-reaction-picker { z-index: 13; position: absolute; bottom: calc(100% + 6px); inset-inline-start: 2px; display: flex; align-items: center; gap: 2px; padding: 5px; background: #233138; border: 1px solid #34434b; border-radius: 999px; box-shadow: 0 8px 24px rgba(0,0,0,.38); }
.wa-message-reaction-picker button { width: 37px; height: 37px; display: grid; place-items: center; padding: 0; background: transparent; border: 0; border-radius: 50%; cursor: pointer; transition: background .14s,transform .14s; font-size: 20px; }
.wa-message-reaction-picker button:hover { background: rgba(255,255,255,.08); transform: scale(1.15); }
.wa-message-reaction-picker button:disabled { opacity: .5; cursor: wait; }
.wa-sender-name { display: block; padding-inline-start: 25px; margin-bottom: 4px; color: #53bdeb; font-size: 12px; }
.wa-quoted-message { width: 100%; display: grid; gap: 2px; margin-bottom: 5px; padding: 6px 8px; color: var(--wa-text); background: rgba(0,0,0,.18); border: 0; border-right: 3px solid #53bdeb; border-radius: 5px; text-align: start; cursor: pointer; }
.wa-quoted-message strong { color: #53bdeb; font-size: 11px; }
.wa-quoted-message span { max-width: 360px; overflow: hidden; color: #b8c4ca; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.wa-media-placeholder { min-width: 210px; min-height: 90px; display: grid; place-content: center; justify-items: center; gap: 7px; margin-bottom: 5px; color: var(--wa-muted); background: rgba(0,0,0,.16); border-radius: 6px; }
.wa-media-placeholder svg { width: 30px; height: 30px; }
.wa-media-placeholder span { font-size: 12px; }
.wa-media-content { width: min(420px,62vw); max-height: 420px; display: block; margin: 0 0 7px; overflow: hidden; background: rgba(0,0,0,.2); border-radius: 8px; }
a.wa-media-content img { width: 100%; max-height: 420px; display: block; object-fit: contain; }
.wa-audio-content { min-width: min(330px,65vw); height: 54px; padding: 7px; }
.wa-media-document { min-width: 250px; max-width: 420px; display: flex; align-items: center; gap: 10px; margin-bottom: 7px; padding: 13px; color: var(--wa-text); background: rgba(0,0,0,.18); border-radius: 8px; text-decoration: none; }
.wa-media-document svg { width: 30px; height: 30px; flex: 0 0 auto; }
.wa-media-document span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wa-message p { min-width: 40px; margin: 0; padding-inline-start: 24px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; }
.wa-message footer { min-height: 17px; display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 1px; color: #9eb0b9; direction: ltr; font-size: 10px; }
.wa-reaction-summary { position: absolute; bottom: -15px; inset-inline-start: 8px; z-index: 2; display: flex; align-items: center; gap: 3px; padding: 2px 5px; background: #202c33; border: 1px solid #34434b; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.28); }
.wa-reaction-summary[hidden] { display: none!important; }
.wa-reaction-summary span { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; }
.wa-reaction-summary b { color: var(--wa-muted); font-size: 9px; }
.wa-message:has(.wa-reaction-summary:not([hidden])) { margin-bottom: 17px; }
.wa-status-ticks { width: 17px!important; height: 13px!important; color: #9eb0b9; stroke-width: 2.1!important; }
.wa-status-ticks.read,.wa-status-ticks.delivered { color: #53bdeb; }
.wa-status-ticks.failed { color: #ff6b6b; }
.wa-ai-label { padding: 1px 4px; color: #d9fdd3; background: rgba(0,168,132,.22); border-radius: 3px; font-size: 6px; font-weight: 900; }
.wa-chat-empty,.wa-welcome { margin: auto; display: grid; place-items: center; gap: 8px; color: var(--wa-muted); text-align: center; }
.wa-chat-empty { flex: 1; }
.wa-chat-empty svg { width: 38px; height: 38px; }
.wa-chat-empty strong,.wa-welcome strong { color: var(--wa-text); font-size: 17px; }
.wa-chat-empty small,.wa-welcome p { max-width: 480px; margin: 0; line-height: 1.8; font-size: 10px; }
.wa-welcome { max-width: 560px; padding: 30px; }
.wa-welcome-logo { width: 92px; height: 92px; display: grid; place-items: center; color: #d9fdd3; background: rgba(0,168,132,.14); border-radius: 50%; }
.wa-welcome-logo svg { width: 46px; height: 46px; }
.wa-welcome > span:last-child { display: flex; align-items: center; gap: 7px; font-size: 8px; }
.wa-welcome > span:last-child i { width: 7px; height: 7px; background: var(--wa-green-strong); border-radius: 50%; }
.wa-scroll-bottom { position: sticky; z-index: 4; bottom: 8px; align-self: flex-end; width: 39px; height: 39px; display: grid; place-items: center; padding: 0; color: var(--wa-muted); background: var(--wa-pane-2); border: 0; border-radius: 50%; box-shadow: 0 3px 10px rgba(0,0,0,.35); cursor: pointer; }
.wa-scroll-bottom svg { width: 18px; height: 18px; }
.wa-scroll-bottom span { position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; display: grid; place-items: center; padding: 0 4px; color: #061a16; background: var(--wa-green-strong); border-radius: 99px; font-size: 7px; }
.wa-composer { position: relative; z-index: 6; flex: 0 0 auto; padding: 8px 12px; background: var(--wa-pane-2); border-top: 1px solid rgba(0,0,0,.15); }
.wa-composer-row { display: flex; align-items: flex-end; gap: 5px; }
.wa-composer textarea { flex: 1; min-height: 44px; max-height: 140px; margin: 0; padding: 10px 14px; color: var(--wa-text); background: #2a3942; border: 0!important; border-radius: 9px; box-shadow: none!important; resize: none; line-height: 1.65; font-size: 14px; }
.wa-composer textarea::placeholder { color: var(--wa-muted); }
.wa-send-button { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; padding: 0; color: white; background: var(--wa-green); border: 0; border-radius: 50%; cursor: pointer; box-shadow: 0 5px 18px rgba(0,168,132,.24); }
.wa-send-button:hover { background: var(--wa-green-strong); }
.wa-send-button svg { width: 19px; height: 19px; transform: rotate(180deg); }
.wa-attachment-preview { min-height: 58px; display: flex; align-items: center; gap: 10px; margin: 0 90px 8px 48px; padding: 8px 10px; color: var(--wa-text); background: #182229; border: 1px solid #34434b; border-radius: 8px; }
.wa-attachment-preview > svg { width: 27px; height: 27px; color: var(--wa-green-strong); }
.wa-attachment-preview > span { min-width: 0; flex: 1; display: grid; gap: 2px; }
.wa-attachment-preview strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.wa-attachment-preview small { color: var(--wa-muted); font-size: 9px; }
.wa-reply-preview { min-height: 50px; display: flex; align-items: center; gap: 10px; margin: -1px 48px 7px 48px; padding: 6px 9px; background: #182229; border-right: 4px solid #53bdeb; border-radius: 6px; }
.wa-reply-preview > span { min-width: 0; flex: 1; display: grid; gap: 2px; }
.wa-reply-preview strong { color: #53bdeb; font-size: 8px; }
.wa-reply-preview small { overflow: hidden; color: var(--wa-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.wa-emoji-panel,.wa-quick-replies-panel { position: absolute; z-index: 20; bottom: calc(100% + 6px); right: 10px; background: #202c33; border: 1px solid #34434b; border-radius: 8px; box-shadow: 0 14px 40px rgba(0,0,0,.45); }
.wa-emoji-panel { max-width: 330px; display: grid; grid-template-columns: repeat(8,1fr); gap: 2px; padding: 8px; }
.wa-emoji-panel button { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; background: transparent; border: 0; border-radius: 6px; cursor: pointer; font-size: 19px; }
.wa-emoji-panel button:hover { background: rgba(255,255,255,.07); }
.wa-quick-replies-panel { width: min(360px,calc(100vw - 40px)); max-height: 380px; display: flex; flex-direction: column; padding: 10px; }
.wa-quick-replies-panel header { display: grid; gap: 2px; padding: 4px 5px 8px; }
.wa-quick-replies-panel header strong { font-size: 11px; }
.wa-quick-replies-panel header small { color: var(--wa-muted); font-size: 8px; }
.wa-quick-replies-panel > input { height: 35px; margin: 0 0 8px; padding: 0 10px; color: var(--wa-text); background: #111b21; border: 0!important; border-radius: 7px; box-shadow: none!important; font-size: 9px; }
.wa-quick-replies-panel > div { overflow-y: auto; }
.wa-quick-replies-panel [data-quick-reply-id] { width: 100%; display: grid; gap: 3px; padding: 9px; color: var(--wa-text); background: transparent; border: 0; border-bottom: 1px solid rgba(134,150,160,.14); text-align: start; cursor: pointer; }
.wa-quick-replies-panel [data-quick-reply-id]:hover { background: rgba(255,255,255,.06); }
.wa-quick-replies-panel [data-quick-reply-id] strong { font-size: 9px; }
.wa-quick-replies-panel [data-quick-reply-id] small { overflow: hidden; color: var(--wa-muted); text-overflow: ellipsis; white-space: nowrap; font-size: 8px; }
.wa-readonly { padding: 14px; color: var(--wa-muted); background: var(--wa-pane-2); border-top: 1px solid var(--wa-line); text-align: center; font-size: 9px; }
.wa-info-drawer { z-index: 42; position: absolute; inset-block: 0; left: 0; width: min(390px,88%); overflow-y: auto; background: var(--wa-pane); border-right: 1px solid var(--wa-line); box-shadow: 10px 0 30px rgba(0,0,0,.2); }
.wa-info-drawer > header { height: 60px; display: flex; align-items: center; gap: 12px; padding: 8px 13px; background: var(--wa-pane-2); }
.wa-info-drawer > header strong { font-size: 12px; }
.wa-info-profile { display: grid; place-items: center; gap: 7px; padding: 34px 20px; border-bottom: 1px solid var(--wa-line); text-align: center; }
.wa-info-profile .wa-avatar { width: 94px; height: 94px; font-size: 30px; }
.wa-info-profile .wa-avatar svg { width: 42px; height: 42px; }
.wa-info-profile > strong { margin-top: 6px; font-size: 16px; }
.wa-info-profile > small { color: var(--wa-muted); font-size: 9px; }
.wa-info-drawer dl { margin: 0; }
.wa-info-drawer dl > div { display: flex; justify-content: space-between; gap: 15px; padding: 15px 18px; border-bottom: 1px solid var(--wa-line); }
.wa-info-drawer dt { color: var(--wa-muted); font-size: 9px; }
.wa-info-drawer dd { margin: 0; font-size: 9px; }
.wa-info-drawer > .button { margin: 18px; display: flex; justify-content: center; }
.wa-drawer-backdrop { z-index: 40; position: absolute; inset: 0; background: rgba(0,0,0,.28); border: 0; cursor: default; }
.wa-forward-modal { z-index: 70; position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.68); backdrop-filter: blur(2px); }
.wa-forward-modal > form { width: min(520px,100%); max-height: min(650px,90vh); display: flex; flex-direction: column; color: var(--wa-text); background: var(--wa-pane); border: 1px solid var(--wa-line); border-radius: 14px; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.wa-forward-modal header,.wa-forward-modal footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; background: var(--wa-pane-2); }
.wa-forward-modal header { border-radius: 14px 14px 0 0; }
.wa-forward-modal header > span { display: grid; gap: 3px; }
.wa-forward-modal header strong { font-size: 16px; }
.wa-forward-modal header small { color: var(--wa-muted); font-size: 11px; }
.wa-forward-modal footer { justify-content: flex-end; border-radius: 0 0 14px 14px; }
.wa-forward-modal footer .button { display: inline-flex; align-items: center; gap: 8px; }
.wa-forward-modal footer svg { width: 17px; height: 17px; }
.wa-ai-correction-modal { z-index: 74; position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.72); backdrop-filter: blur(3px); }
.wa-ai-correction-modal[hidden] { display: none!important; }
.wa-ai-correction-modal > form { width: min(620px,100%); max-height: min(760px,92vh); overflow: auto; display: grid; gap: 14px; padding: 18px; color: var(--wa-text); background: var(--wa-pane); border: 1px solid color-mix(in srgb,var(--primary) 42%,var(--wa-line)); border-radius: 16px; box-shadow: 0 28px 80px rgba(0,0,0,.62); }
.wa-ai-correction-modal header,.wa-ai-correction-modal footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wa-ai-correction-modal header > span { display: grid; gap: 4px; }
.wa-ai-correction-modal header strong { font-size: 18px; }
.wa-ai-correction-modal header small { color: var(--wa-muted); line-height: 1.65; }
.wa-ai-correction-context { padding: 13px; border: 1px solid var(--wa-line); border-radius: 12px; background: var(--wa-pane-2); }
.wa-ai-correction-context.old { border-color: rgba(244,63,94,.27); background: rgba(244,63,94,.06); }
.wa-ai-correction-context span,.wa-ai-correction-modal label > span { display: block; margin-bottom: 6px; color: var(--wa-muted); font-size: 11px; font-weight: 800; }
.wa-ai-correction-context p { margin: 0; overflow-wrap: anywhere; line-height: 1.75; white-space: pre-wrap; }
.wa-ai-correction-modal label { display: grid; }
.wa-ai-correction-modal textarea { min-height: 125px; resize: vertical; color: var(--wa-text); background: var(--wa-input); border-color: var(--wa-line); line-height: 1.8; }
.wa-ai-correction-modal footer { justify-content: flex-end; }
.wa-forward-group-list { min-height: 120px; overflow-y: auto; padding: 8px; }
.wa-forward-group-list label { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-bottom: 1px solid var(--wa-line); cursor: pointer; }
.wa-forward-group-list label:hover { background: rgba(0,168,132,.08); }
.wa-forward-group-list input { width: 18px; height: 18px; accent-color: var(--wa-green-strong); }
.wa-forward-group-list .wa-avatar { width: 38px; height: 38px; }
.wa-forward-group-list strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.wa-web-shell [hidden] { display: none!important; }

/* Public academy authentication gateway */
.auth-gateway { min-height: 100vh; overflow-x: hidden; color: #edf9f5; background:
    radial-gradient(circle at 50% -10%,rgba(0,229,160,.13),transparent 35%),
    linear-gradient(145deg,#040b11,#07131b 55%,#040b11); }
.auth-gateway::before { content:""; position:fixed; inset:0; pointer-events:none; opacity:.3; background-image:linear-gradient(rgba(32,73,83,.18) 1px,transparent 1px),linear-gradient(90deg,rgba(32,73,83,.18) 1px,transparent 1px); background-size:42px 42px; mask-image:linear-gradient(to bottom,black,transparent 88%); }
.auth-gateway-shell { position:relative; z-index:1; width:min(590px,calc(100% - 30px)); min-height:100vh; display:flex; flex-direction:column; justify-content:center; gap:18px; margin:auto; padding:34px 0; }
.auth-academy-brand { display:flex; align-items:center; justify-content:center; gap:13px; text-align:start; }
.auth-academy-brand img { width:66px; height:66px; object-fit:contain; padding:4px; background:#050b10; border:1px solid rgba(0,229,160,.35); border-radius:18px; box-shadow:0 0 28px rgba(0,229,160,.15); }
.auth-academy-brand div { min-width:0; display:grid; gap:3px; }
.auth-academy-brand strong { max-width:440px; overflow:hidden; color:#fff; text-overflow:ellipsis; white-space:nowrap; font-size:20px; }
.auth-academy-brand small { max-width:440px; overflow:hidden; color:#82969e; text-overflow:ellipsis; white-space:nowrap; font-size:10px; }
.auth-academy-description { max-width:440px; margin:4px 0 0; color:#a9bac1; font-size:11px; line-height:1.8; }
.auth-gateway-card { overflow:hidden; padding:9px 28px 27px; background:linear-gradient(145deg,rgba(12,25,35,.96),rgba(7,16,24,.98)); border:1px solid #1c3942; border-radius:22px; box-shadow:0 28px 80px rgba(0,0,0,.43); }
.auth-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; margin:0 -18px 27px; padding:7px; background:#061018; border:1px solid #173039; border-radius:14px; }
.auth-tabs button { min-height:42px; color:#7f929a; background:transparent; border:0; border-radius:10px; cursor:pointer; font-family:inherit; font-weight:800; }
.auth-tabs button.active { color:#001b13; background:linear-gradient(110deg,var(--brown),var(--gold)); box-shadow:0 8px 25px rgba(0,229,160,.18); }
.auth-panel[hidden] { display:none!important; }
.auth-heading { display:grid; justify-items:center; margin-bottom:23px; text-align:center; }
.auth-heading-icon { width:48px; height:48px; display:grid; place-items:center; margin-bottom:9px; color:var(--brown-dark); background:rgba(0,229,160,.09); border:1px solid rgba(0,229,160,.26); border-radius:15px; font-size:23px; font-weight:900; }
.auth-heading h1 { margin:0 0 5px; color:#fff; font-size:26px; }
.auth-heading p { max-width:470px; margin:0; color:#8598a0; font-size:11px; line-height:1.8; }
.auth-message { margin:0 0 17px; }
.auth-form { gap:15px; }
.auth-form label { display:grid; gap:7px; color:#a8bbc0; font-size:11px; font-weight:800; }
.auth-form label > span b { color:#fb7185; }
.auth-form input:not([type="checkbox"]),.auth-form select { min-height:49px; color:#f3fffb; background:#0b1a24; border:1px solid #24424a; border-radius:11px; font-family:inherit; }
.auth-form input::placeholder { color:#60737c; }
.auth-form input:focus,.auth-form select:focus { border-color:var(--brown); box-shadow:0 0 0 3px rgba(0,229,160,.11); outline:0; }
.auth-phone-field { direction:ltr; display:grid; grid-template-columns:minmax(132px,38%) minmax(0,1fr); gap:8px; }
.auth-phone-field select { width:100%; padding-inline:8px; font-size:10px; }
.auth-phone-field input { width:100%; text-align:left; }
.auth-password-field { position:relative; }
.auth-password-field input { width:100%; padding-inline-end:47px; }
.auth-password-field button { position:absolute; inset-inline-end:5px; top:5px; width:39px; height:39px; display:grid; place-items:center; color:#78919a; background:transparent; border:0; cursor:pointer; }
.auth-form .check-row { display:flex; }
.auth-form .check-row input { width:17px; height:17px; accent-color:var(--brown); }
.auth-submit { min-height:51px; margin-top:2px; font-size:14px; font-weight:900; }
.auth-two-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.auth-approval-note { display:flex; align-items:center; gap:10px; padding:12px; color:#93aaa9; background:rgba(0,229,160,.055); border:1px solid rgba(0,229,160,.18); border-radius:11px; }
.auth-approval-note > span { width:30px; height:30px; display:grid; place-items:center; flex:0 0 30px; color:#001b13; background:var(--brown); border-radius:50%; font-weight:900; }
.auth-approval-note p { display:grid; gap:2px; margin:0; }
.auth-approval-note strong,.auth-approval-note small { display:block; }
.auth-approval-note strong { color:#dffbf1; font-size:10px; }
.auth-approval-note small { color:#789098; font-size:8px; line-height:1.6; }
.auth-gateway .login-help { margin:18px 0 0; color:#7f929a; font-size:10px; }
.auth-gateway .login-help button { padding:0; color:var(--brown-dark); background:none; border:0; cursor:pointer; font-family:inherit; font-size:inherit; font-weight:800; }
.auth-contact-line { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px 12px; color:#607780; font-size:9px; }
.auth-contact-line b { color:#91aaa9; font-weight:600; }
.auth-honeypot { position:absolute!important; left:-10000px!important; width:1px!important; height:1px!important; opacity:0!important; }

@media (max-width:620px) {
    .auth-gateway-shell { width:min(100% - 20px,520px); justify-content:flex-start; padding:max(22px,env(safe-area-inset-top)) 0 max(26px,env(safe-area-inset-bottom)); }
    .auth-academy-brand img { width:57px; height:57px; border-radius:15px; }
    .auth-academy-brand strong { font-size:17px; }
    .auth-academy-brand small { max-width:250px; font-size:8px; }
    .auth-academy-description { max-width:250px; font-size:9px; }
    .auth-gateway-card { padding:7px 16px 22px; border-radius:18px; }
    .auth-tabs { margin:0 -8px 22px; }
    .auth-heading h1 { font-size:22px; }
    .auth-phone-field { grid-template-columns:120px minmax(0,1fr); }
    .auth-two-fields { grid-template-columns:1fr; }
    .auth-form input:not([type="checkbox"]),.auth-form select { min-height:48px; font-size:16px; }
}

:root[data-theme="light"] .wa-web-shell {
    --wa-pane: #ffffff;
    --wa-pane-2: #f0f2f5;
    --wa-pane-3: #f7f8fa;
    --wa-canvas: #efeae2;
    --wa-line: #d8dfE3;
    --wa-text: #111b21;
    --wa-muted: #667781;
    --wa-incoming: #ffffff;
    --wa-outgoing: #d9fdd3;
}
:root[data-theme="light"] .wa-message-canvas {
    background-image:
        linear-gradient(rgba(239,234,226,.92),rgba(239,234,226,.92)),
        radial-gradient(circle at 20% 30%,rgba(84,101,111,.1) 0 1px,transparent 1.5px),
        radial-gradient(circle at 72% 68%,rgba(84,101,111,.08) 0 1px,transparent 1.5px);
}
:root[data-theme="light"] .wa-search-box input,
:root[data-theme="light"] .wa-composer textarea,
:root[data-theme="light"] .wa-message-search input { color: var(--wa-text); }
:root[data-theme="light"] .wa-popover,
:root[data-theme="light"] .wa-message-actions,
:root[data-theme="light"] .wa-message-reaction-picker,
:root[data-theme="light"] .wa-reaction-summary,
:root[data-theme="light"] .wa-emoji-panel,
:root[data-theme="light"] .wa-quick-replies-panel { background: #fff; border-color: #d8dfe3; }
:root[data-theme="light"] .wa-quick-replies-panel > input { color: var(--wa-text); background: #f0f2f5; }
:root[data-theme="light"] .wa-encryption-note { color: #54656f; background: #ffeecd; }
:root[data-theme="light"] .wa-day-label { color: #54656f; background: rgba(255,255,255,.94); }
:root[data-theme="light"] .wa-reply-preview { background: rgba(255,255,255,.55); }
:root[data-theme="light"] .wa-media-placeholder { background: rgba(0,0,0,.04); }

@media (max-width: 1200px) {
    .wa-web-shell { grid-template-columns: 330px minmax(0,1fr); }
    .wa-message { max-width: 76%; }
}
@media (max-width: 760px) {
    .whatsapp-web-theme .content { padding: 0!important; }
    .wa-web-shell { height: calc(100vh - 118px); min-height: 540px; grid-template-columns: 1fr; border: 0; border-radius: 0; }
    .wa-chat-pane { display: none; position: absolute; inset: 0; z-index: 50; }
    .wa-web-shell.mobile-chat-open .wa-list-pane { display: none; }
    .wa-web-shell.mobile-chat-open .wa-chat-pane { display: flex; }
    .wa-mobile-back { display: grid; }
    .wa-message-canvas { padding-inline: 16px; }
    .wa-message { max-width: 88%; }
    .wa-chat-header { padding-inline: 6px; }
    .wa-chat-header .wa-icon-button { width: 36px; height: 36px; }
    .wa-chat-header [data-chat-info-toggle]:not(.wa-chat-identity) { display: none; }
    .wa-list-menu,.wa-chat-menu { left: 8px; }
}
@media (max-width: 430px) {
    .wa-list-header,.wa-chat-header { min-height: 55px; }
    .wa-channel-strip { min-height: 52px; }
    .wa-composer { padding-inline: 7px; }
    .wa-composer-row { gap: 1px; }
    .wa-composer-row > .wa-icon-button { width: 34px; }
    .wa-reply-preview { margin-inline: 34px; }
    .wa-emoji-panel { right: 4px; grid-template-columns: repeat(7,1fr); }
    .wa-emoji-panel button { width: 34px; height: 34px; }
}

/* Browser and sound notifications */
.browser-notification-toggle { position: relative; overflow: visible; }
.browser-notification-toggle > span { display: block; line-height: 1; font-size: 15px; }
.browser-notification-toggle > i {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    width: 7px;
    height: 7px;
    opacity: 0;
    background: #f59e0b;
    border: 2px solid var(--surface);
    border-radius: 50%;
    transition: opacity .2s ease;
}
.browser-notification-toggle.active {
    color: #061a16;
    background: var(--brown);
    border-color: color-mix(in srgb,var(--brown) 78%,white);
}
.browser-notification-toggle.needs-permission > i,
.browser-notification-toggle.limited > i { opacity: 1; }
.browser-notification-toggle.needs-permission > i { animation: rattil-notification-pulse 1.5s ease-in-out infinite; }
.browser-notification-toggle.has-new-message { animation: rattil-notification-bell .55s ease-in-out 3; }

.browser-notification-controls {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.browser-notification-sound-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
    color: var(--muted);
}
.browser-notification-sound-button[aria-expanded="true"] {
    color: var(--brown);
    border-color: color-mix(in srgb,var(--brown) 62%,var(--border));
}
.browser-notification-sound-menu {
    position: absolute;
    z-index: 170;
    top: calc(100% + 10px);
    inset-inline-start: 0;
    width: min(290px,calc(100vw - 24px));
    padding: 12px;
    color: var(--text);
    background: color-mix(in srgb,var(--surface) 97%,var(--brown) 3%);
    border: 1px solid color-mix(in srgb,var(--brown) 38%,var(--border));
    border-radius: 16px;
    box-shadow: 0 22px 55px rgba(0,0,0,.42);
}
.browser-notification-sound-menu > strong {
    display: block;
    margin: 0 4px 9px;
    font-size: 13px;
}
.browser-notification-sound-menu > button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 8px 10px;
    color: var(--text);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 11px;
    text-align: start;
    cursor: pointer;
}
.browser-notification-sound-menu > button:hover,
.browser-notification-sound-menu > button.active {
    color: var(--brown);
    background: color-mix(in srgb,var(--brown) 11%,transparent);
    border-color: color-mix(in srgb,var(--brown) 34%,transparent);
}
.browser-notification-sound-menu small {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: currentColor;
    background: color-mix(in srgb,currentColor 10%,transparent);
    border-radius: 50%;
}

.browser-notification-toast {
    position: fixed;
    z-index: 140;
    top: auto;
    right: auto;
    bottom: max(24px,env(safe-area-inset-bottom));
    left: 24px;
    width: min(520px,calc(100vw - 32px));
    display: grid;
    gap: 8px;
    padding: 19px 21px;
    color: var(--text);
    background: color-mix(in srgb,var(--surface) 94%,var(--brown) 6%);
    border: 1px solid color-mix(in srgb,var(--brown) 42%,var(--border));
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0,0,0,.42);
    opacity: 0;
    transform: translateY(18px);
    text-align: start;
    cursor: pointer;
    transition: opacity .2s ease,transform .2s ease;
}
.browser-notification-toast.visible { opacity: 1; transform: translateY(0); }
.browser-notification-toast strong { color: var(--text); font-size: 18px; }
.browser-notification-toast span { display: -webkit-box; overflow: hidden; color: var(--muted); line-height: 1.65; -webkit-box-orient: vertical; -webkit-line-clamp: 3; font-size: 14px; }

@keyframes rattil-notification-bell {
    0%,100% { transform: rotate(0); }
    30% { transform: rotate(12deg); }
    70% { transform: rotate(-12deg); }
}
@keyframes rattil-notification-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,.1); }
    50% { box-shadow: 0 0 0 5px rgba(245,158,11,.22); }
}

@media (max-width: 820px) {
    .browser-notification-toast { bottom: max(16px,env(safe-area-inset-bottom)); left: 16px; }
}

/* Mobile browser hardening: safe areas, touch targets and dynamic viewports. */
.wa-web-shell {
    height: calc(100vh - 178px);
    height: calc(100dvh - 178px);
}
.wa-forward-modal > form {
    max-height: min(650px,90vh);
    max-height: min(650px,90dvh);
}

@media (max-width: 820px) {
    .topbar {
        padding-block-start: max(15px,env(safe-area-inset-top));
        padding-inline: max(18px,env(safe-area-inset-left)) max(18px,env(safe-area-inset-right));
    }
    .sidebar-collapse-toggle,
    .mobile-menu,
    .topbar-actions .icon-button,
    .language-switch button {
        min-width: 40px;
        min-height: 40px;
    }
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select,
    textarea {
        font-size: 16px;
    }
    input[type="file"] { max-width: 100%; }
    .panel { max-width: 100%; border-radius: 15px; }
    .panel-header > *,
    .section-actions > *,
    .filters-bar > * { min-width: 0; max-width: 100%; }
    .filters-bar label,
    .filters-bar .search-field { width: 100%; }
    .table-wrap { scroll-snap-type: x proximity; }
    .table-wrap th:first-child,
    .table-wrap td:first-child { scroll-snap-align: start; }
}

@media (max-width: 760px) {
    .whatsapp-web-theme .content {
        height: calc(100vh - 72px);
        height: calc(100dvh - 72px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .whatsapp-web-theme .whatsapp-global-status {
        flex: 0 0 auto;
        margin: 0;
        border-radius: 0;
    }
    .whatsapp-web-theme .wa-web-shell {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }
    .wa-list-pane,
    .wa-chat-pane { padding-bottom: env(safe-area-inset-bottom); }
    .wa-search-box input,
    .wa-message-search input,
    .wa-composer textarea,
    .wa-quick-replies-panel > input { font-size: 16px; }
    .wa-message-caret { opacity: .72; }
    .wa-message-actions,
    .wa-message-reaction-picker {
        max-width: calc(100vw - 24px);
        overflow-x: auto;
        overscroll-behavior-inline: contain;
    }
    .wa-info-drawer { width: 100%; }
    .wa-forward-modal,.wa-ai-correction-modal { padding: 8px; }
    .wa-forward-modal > form {
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }
}

@media (max-width: 430px) {
    .topbar { padding-inline: 10px; }
    .mobile-menu { flex-basis: 38px; width: 38px; min-width: 38px; height: 38px; min-height: 38px; }
    .topbar-actions .icon-button { min-width: 36px; width: 36px; min-height: 36px; height: 36px; }
    .language-switch button { min-width: 38px; min-height: 36px; padding-inline: 7px; }
    .wa-message-canvas { padding-inline: 10px; }
    .wa-message { max-width: 92%; }
    .wa-media-content,
    .wa-media-document,
    .wa-media-placeholder,
    .wa-audio-content {
        min-width: 0;
        max-width: calc(100vw - 54px);
    }
    .wa-attachment-preview,
    .wa-reply-preview { margin-inline: 0; }
    .wa-emoji-panel {
        left: 4px;
        right: 4px;
        max-width: none;
        overflow-y: auto;
    }
    .wa-forward-modal header,
    .wa-forward-modal footer { padding: 12px; }
    .wa-ai-correction-modal > form { max-height: calc(100dvh - 16px); padding: 14px; border-radius: 12px; }
    .whatsapp-web-theme .whatsapp-global-status { padding: 10px; gap: 9px; }
    .whatsapp-web-theme .whatsapp-status-icon { width: 30px; height: 30px; flex-basis: 30px; font-size: 16px; }
    .whatsapp-web-theme .whatsapp-status-copy { min-width: calc(100% - 39px); }
    .whatsapp-web-theme .whatsapp-status-copy strong { font-size: 11px; }
    .whatsapp-web-theme .whatsapp-status-copy small {
        display: -webkit-box;
        overflow: hidden;
        line-height: 1.5;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        font-size: 8px;
    }
    .whatsapp-web-theme .whatsapp-status-actions {
        display: grid;
        grid-template-columns: repeat(2,minmax(0,1fr));
        gap: 6px;
        padding-inline-start: 0;
    }
    .whatsapp-web-theme .whatsapp-status-actions .button {
        width: 100%;
        min-height: 38px;
        padding: 7px;
        font-size: 9px;
    }
    .browser-notification-toast {
        top: auto;
        right: auto;
        bottom: max(10px,env(safe-area-inset-bottom));
        left: 8px;
        width: auto;
        max-width: calc(100vw - 16px);
        padding: 15px 16px;
        border-radius: 14px;
    }
    .browser-notification-toast strong { font-size: 16px; }
}

@media (max-width: 380px) {
    .topbar { gap: 6px; }
    .topbar > div:not(.topbar-actions) { flex-basis: 90px; }
    .topbar h1 { font-size: 13px; }
    .topbar-actions { gap: 3px; }
    .topbar-actions .ui-customizer-toggle { display: none; }
    .language-switch button span { display: none; }
    .wa-composer { padding-inline: 5px; }
    .wa-composer-row > .wa-icon-button { width: 32px; min-width: 32px; }
    .wa-send-button { width: 40px; flex-basis: 40px; }
}

@media (pointer: coarse) {
    .wa-message-caret { opacity: .72; }
    .nav-link,
    .nav-group-toggle { min-height: 44px; }
}

/* Dual-channel broadcast center */
.broadcasts-theme .content { display: grid; gap: 18px; }
.broadcast-command {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: clamp(22px,3vw,38px);
    border: 1px solid color-mix(in srgb,var(--brown) 38%,var(--line));
    border-radius: 22px;
    background:
        radial-gradient(circle at 12% 20%,color-mix(in srgb,var(--brown) 17%,transparent),transparent 38%),
        linear-gradient(135deg,color-mix(in srgb,var(--surface) 88%,var(--brown) 12%),var(--surface));
}
.broadcast-command h2 { margin: 8px 0; font-size: clamp(25px,3vw,38px); }
.broadcast-command p { margin: 0; max-width: 760px; color: var(--muted); line-height: 1.9; }
.broadcast-channel-health { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badge.danger { color: #ff9b9b; background: rgba(239,68,68,.13); }
.broadcast-stat-grid {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 12px;
}
.broadcast-stat-grid article {
    display: grid;
    gap: 6px;
    min-height: 126px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: var(--surface);
}
.broadcast-stat-grid span,.broadcast-stat-grid small { color: var(--muted); }
.broadcast-stat-grid strong { font-size: 28px; color: var(--text); }
.broadcast-builder { padding: 0; overflow: clip; scroll-margin-top: 18px; }
.broadcast-builder > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 20px 24px;
    list-style: none;
    cursor: pointer;
    user-select: none;
}
.broadcast-builder > summary::-webkit-details-marker { display: none; }
.broadcast-builder > summary > span:first-child { display: grid; gap: 5px; }
.broadcast-builder > summary small { color: var(--muted); }
.broadcast-summary-chevron { font-size: 26px; transition: transform .2s ease; }
.broadcast-builder[open] .broadcast-summary-chevron { transform: rotate(180deg); }
.broadcast-builder > form { border-top: 1px solid var(--line); }
.broadcast-builder-grid {
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(245px,330px);
    gap: 0;
}
.broadcast-form-main { min-width: 0; padding: 24px; }
.broadcast-form-section {
    display: grid;
    gap: 17px;
    padding: 0 0 26px;
    margin: 0 0 26px;
    border-bottom: 1px solid var(--line);
}
.broadcast-form-section:last-child { padding-bottom: 0; margin-bottom: 0; border-bottom: 0; }
.broadcast-form-section > header { display: flex; align-items: flex-start; gap: 12px; }
.broadcast-form-section > header > span {
    display: grid;
    place-items: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    border-radius: 11px;
    color: var(--brown-dark);
    background: color-mix(in srgb,var(--brown) 18%,transparent);
    font-weight: 800;
}
.broadcast-form-section h3 { margin: 0 0 3px; }
.broadcast-form-section p { margin: 0; color: var(--muted); }
.broadcast-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.broadcast-choice {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px 12px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 15px;
    cursor: pointer;
    background: color-mix(in srgb,var(--surface) 84%,transparent);
}
.broadcast-choice:has(input:checked) {
    border-color: var(--brown);
    box-shadow: inset 0 0 0 1px var(--brown);
    background: color-mix(in srgb,var(--brown) 10%,var(--surface));
}
.broadcast-choice input { position: absolute; opacity: 0; }
.broadcast-choice-icon { grid-row: span 2; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: var(--brown-dark); background: color-mix(in srgb,var(--brown) 15%,transparent); font-size: 19px; }
.broadcast-choice small { color: var(--muted); line-height: 1.6; }
.broadcast-variants { display: grid; gap: 10px; }
.broadcast-variant { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 8px; }
.broadcast-variant textarea { min-height: 106px; }
.broadcast-variant .icon-button { margin-top: 4px; }
.broadcast-source-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.broadcast-source-tabs label { position: relative; cursor: pointer; }
.broadcast-source-tabs input { position: absolute; opacity: 0; }
.broadcast-source-tabs span { display: grid; place-items: center; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 11px; color: var(--muted); }
.broadcast-source-tabs input:checked + span { color: var(--text); border-color: var(--brown); background: color-mix(in srgb,var(--brown) 12%,transparent); }
.broadcast-audience-panel { display: grid; gap: 12px; }
.broadcast-consent-note,.broadcast-consent-check {
    padding: 14px;
    border: 1px solid color-mix(in srgb,var(--brown) 30%,var(--line));
    border-radius: 12px;
    background: color-mix(in srgb,var(--brown) 7%,transparent);
}
.broadcast-consent-check { display: flex; align-items: flex-start; gap: 12px; }
.broadcast-consent-check input { margin-top: 5px; }
.broadcast-consent-check span { display: grid; gap: 5px; }
.broadcast-consent-check small { color: var(--muted); }
.broadcast-upload {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 150px;
    padding: 20px;
    border: 1px dashed color-mix(in srgb,var(--brown) 50%,var(--line));
    border-radius: 15px;
    text-align: center;
    cursor: pointer;
}
.broadcast-upload > span { font-size: 28px; color: var(--brown-dark); }
.broadcast-upload input { max-width: 100%; margin-top: 7px; }
.broadcast-builder-help {
    padding: 25px;
    border-inline-start: 1px solid var(--line);
    background: color-mix(in srgb,var(--surface-strong) 74%,transparent);
}
.broadcast-builder-help { align-self: stretch; }
.broadcast-builder-help h3 { margin-top: 0; }
.broadcast-builder-help ul { display: grid; gap: 14px; padding-inline-start: 22px; color: var(--muted); line-height: 1.7; }
.broadcast-builder-help li::marker { color: var(--brown); }
.broadcast-safety { margin-top: 24px; padding: 16px; border: 1px solid color-mix(in srgb,var(--gold) 30%,var(--line)); border-radius: 13px; background: color-mix(in srgb,var(--gold) 7%,transparent); }
.broadcast-safety p { margin-bottom: 0; color: var(--muted); line-height: 1.8; }
.broadcast-builder-actions { display: flex; gap: 10px; padding: 18px 24px; border-top: 1px solid var(--line); background: color-mix(in srgb,var(--surface-strong) 70%,transparent); }
.broadcast-filters { display: grid; grid-template-columns: minmax(220px,1fr) repeat(2,minmax(150px,220px)) auto; align-items: end; }
.broadcast-campaigns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.broadcast-campaign-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.broadcast-campaign-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.broadcast-campaign-title { display: flex; align-items: center; gap: 12px; min-width: 0; }
.broadcast-campaign-title h3 { margin: 0 0 4px; overflow-wrap: anywhere; }
.broadcast-campaign-title small { color: var(--muted); }
.broadcast-provider { display: grid; place-items: center; flex: 0 0 60px; min-height: 42px; padding: 6px; border-radius: 12px; font-weight: 800; font-size: 11px; }
.broadcast-provider.cloud { color: #9ad9ff; background: rgba(14,165,233,.13); }
.broadcast-provider.qr { color: #9ff1d1; background: rgba(16,185,129,.13); }
.broadcast-result-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: 7px; margin-top: 15px; }
.broadcast-result-grid span { display: grid; gap: 4px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 10px; text-align: center; background: color-mix(in srgb,var(--surface-strong) 70%,transparent); }
.broadcast-result-grid small { color: var(--muted); font-size: 9px; }
.broadcast-card-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.broadcast-card-notes span { padding: 6px 9px; border-radius: 9px; color: var(--muted); background: color-mix(in srgb,var(--surface-strong) 80%,transparent); font-size: 11px; }
.broadcast-campaign-card > footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }

@media (max-width: 1100px) {
    .broadcast-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .broadcast-builder-grid { grid-template-columns: 1fr; }
    .broadcast-builder-help { border-inline-start: 0; border-top: 1px solid var(--line); }
    .broadcast-campaigns { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .broadcast-command { align-items: stretch; flex-direction: column; padding: 20px; }
    .broadcast-command .button { width: 100%; }
    .broadcast-stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
    .broadcast-stat-grid article { min-height: 105px; padding: 14px; }
    .broadcast-choice-grid,.broadcast-source-tabs { grid-template-columns: 1fr; }
    .broadcast-form-main { padding: 16px; }
    .broadcast-builder > summary,.broadcast-builder-actions { padding-inline: 16px; }
    .broadcast-builder-actions { display: grid; grid-template-columns: 1fr; }
    .broadcast-filters { grid-template-columns: 1fr; }
    .broadcast-result-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
@media (max-width: 430px) {
    .broadcast-stat-grid { grid-template-columns: 1fr 1fr; }
    .broadcast-stat-grid article { min-height: 95px; }
    .broadcast-stat-grid strong { font-size: 23px; }
    .broadcast-campaign-card { padding: 14px; }
    .broadcast-campaign-card > header { align-items: stretch; flex-direction: column; }
    .broadcast-campaign-card > header > .badge { align-self: flex-start; }
    .broadcast-result-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

/* AI agent control center */
.ai-agent-theme .content {
    background-image:
        linear-gradient(color-mix(in srgb,var(--line) 28%,transparent) 1px,transparent 1px),
        linear-gradient(90deg,color-mix(in srgb,var(--line) 28%,transparent) 1px,transparent 1px);
    background-size: 44px 44px;
}
.ai-agent-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0,1.35fr) minmax(280px,.65fr);
    align-items: center;
    min-height: 270px;
    margin-bottom: 18px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb,var(--primary) 45%,var(--line));
    border-radius: 24px;
    background:
        radial-gradient(circle at 18% 20%,color-mix(in srgb,var(--accent) 24%,transparent),transparent 28%),
        linear-gradient(128deg,color-mix(in srgb,var(--surface-strong) 96%,#02070d),color-mix(in srgb,var(--primary) 7%,#02070d));
    box-shadow: 0 24px 70px rgba(0,0,0,.22);
}
.ai-agent-hero::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg,transparent,rgba(255,255,255,.025),transparent); }
.ai-agent-hero-copy { position: relative; z-index: 2; padding: 40px 44px; }
.ai-agent-hero-copy h2 { max-width: 720px; margin: 8px 0 12px; font-size: clamp(28px,3vw,48px); line-height: 1.28; }
.ai-agent-hero-copy p { max-width: 720px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.9; }
.ai-agent-status-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 24px; }
.agent-status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: color-mix(in srgb,var(--surface) 80%,transparent); font-size: 12px; font-weight: 750; }
.agent-status i { width: 8px; height: 8px; border-radius: 50%; background: #64748b; box-shadow: 0 0 0 4px rgba(100,116,139,.1); }
.agent-status.is-on { color: #65e6b3; border-color: rgba(16,185,129,.3); }
.agent-status.is-on i { background: #10b981; box-shadow: 0 0 0 4px rgba(16,185,129,.12),0 0 14px rgba(16,185,129,.7); }
.ai-agent-hero-art { position: relative; z-index: 1; display: grid; place-items: center; align-self: stretch; min-height: 270px; isolation: isolate; }
.ai-agent-hero-art::before { content: ''; position: absolute; width: 210px; height: 210px; border-radius: 50%; background: radial-gradient(circle,rgba(0,229,160,.25),rgba(17,215,211,.06) 52%,transparent 70%); filter: blur(5px); }
.ai-agent-brain { display: grid; place-items: center; width: 116px; height: 116px; border: 2px solid color-mix(in srgb,var(--primary) 82%,white); border-radius: 34% 66% 52% 48% / 42% 40% 60% 58%; color: #04130f; background: linear-gradient(145deg,var(--primary),var(--accent)); box-shadow: 0 0 44px color-mix(in srgb,var(--primary) 52%,transparent),inset 0 0 22px rgba(255,255,255,.34); font-size: 40px; font-weight: 950; transform: rotate(-6deg); }
.ai-agent-orbit { position: absolute; width: 190px; height: 190px; border: 1px dashed color-mix(in srgb,var(--accent) 50%,transparent); border-radius: 50%; animation: ai-agent-spin 22s linear infinite; }
.ai-agent-orbit.orbit-two { width: 250px; height: 140px; transform: rotate(28deg); animation-direction: reverse; animation-duration: 16s; }
.ai-agent-node { position: absolute; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid color-mix(in srgb,var(--primary) 42%,var(--line)); border-radius: 12px; color: var(--primary); background: var(--surface); box-shadow: 0 8px 25px rgba(0,0,0,.25); }
.ai-agent-node.node-one { inset-block-start: 45px; inset-inline-start: 25%; }
.ai-agent-node.node-two { inset-block-end: 38px; inset-inline-end: 22%; }
.ai-agent-node.node-three { inset-block-start: 45%; inset-inline-end: 10%; }
@keyframes ai-agent-spin { to { transform: rotate(360deg); } }
.ai-agent-alert { margin-bottom: 18px; }
.ai-agent-alert a { color: inherit; font-weight: 800; text-decoration: underline; }
.ai-agent-layout { display: grid; grid-template-columns: minmax(220px,310px) minmax(0,1fr); align-items: start; gap: 18px; }
.ai-agent-guide { position: sticky; top: 88px; padding: 24px; }
.ai-agent-guide-icon { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid rgba(244,63,94,.35); border-radius: 12px; color: #fb7185; background: rgba(244,63,94,.08); font-weight: 900; }
.ai-agent-guide h3 { margin: 15px 0; }
.ai-agent-guide ol { display: grid; gap: 14px; padding-inline-start: 22px; margin: 0; color: var(--muted); line-height: 1.75; }
.ai-agent-guide li::marker { color: var(--primary); font-weight: 900; }
.ai-agent-privacy { display: grid; gap: 4px; margin-top: 22px; padding: 14px; border: 1px solid rgba(16,185,129,.25); border-radius: 13px; background: rgba(16,185,129,.07); }
.ai-agent-privacy strong { color: #65e6b3; }
.ai-agent-privacy span { color: var(--muted); font-size: 12px; line-height: 1.65; }
.ai-agent-form,.ai-agent-form fieldset { min-width: 0; }
.ai-agent-form fieldset { display: grid; gap: 16px; padding: 0; margin: 0; border: 0; }
.ai-agent-section { padding: 24px; }
.ai-agent-section-head { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: start; gap: 13px; margin-bottom: 20px; }
.ai-agent-section-head.with-toggle { grid-template-columns: auto minmax(0,1fr) auto; align-items: center; }
.ai-agent-section-head h3 { margin: 2px 0 5px; font-size: 20px; }
.ai-agent-section-head p { margin: 0; color: var(--muted); line-height: 1.7; }
.ai-agent-section-icon { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid color-mix(in srgb,var(--primary) 32%,var(--line)); border-radius: 13px; color: var(--primary); background: color-mix(in srgb,var(--primary) 8%,var(--surface)); font-size: 19px; font-weight: 900; }
.ai-agent-channel-grid { margin-bottom: 14px; }
.ai-provider-chip { display: flex; align-items: center; gap: 9px; padding: 13px 15px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: color-mix(in srgb,var(--surface-strong) 75%,transparent); }
.ai-provider-chip.is-ready { color: #65e6b3; border-color: rgba(16,185,129,.26); background: rgba(16,185,129,.06); }
.ai-master-toggle { margin-top: 14px; border-color: color-mix(in srgb,var(--primary) 35%,var(--line)); background: color-mix(in srgb,var(--primary) 6%,var(--surface)); }
.switch-control { position: relative; flex: 0 0 auto; width: 50px; height: 28px; cursor: pointer; }
.switch-control input { position: absolute; opacity: 0; }
.switch-control span { position: absolute; inset: 0; border-radius: 999px; background: #243043; transition: .2s ease; }
.switch-control span::after { content: ''; position: absolute; inset-block-start: 4px; inset-inline-start: 4px; width: 20px; height: 20px; border-radius: 50%; background: #8190a4; transition: .2s ease; }
.switch-control input:checked + span { background: linear-gradient(90deg,var(--primary),var(--accent)); box-shadow: 0 0 18px color-mix(in srgb,var(--primary) 35%,transparent); }
.switch-control input:checked + span::after { inset-inline-start: 26px; background: #04130f; }
.ai-agent-two-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.follow-up-preview { display: grid; gap: 10px; margin: 14px 0; padding: 13px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb,var(--surface-strong) 75%,transparent); }
.follow-up-preview > span { color: var(--muted); font-size: 12px; }
.follow-up-preview > div { display: flex; flex-wrap: wrap; gap: 7px; }
.follow-up-preview > div span { padding: 6px 9px; border-radius: 999px; color: #c9f9e7; background: rgba(16,185,129,.1); font-size: 11px; }
.ai-agent-message-list { display: grid; gap: 12px; }
.ai-agent-message { display: grid; gap: 8px; }
.ai-agent-message > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.ai-agent-message textarea,.ai-agent-prompt textarea { resize: vertical; line-height: 1.85; }
.ai-agent-prompt { position: relative; display: grid; }
.ai-agent-prompt textarea { min-height: 250px; padding-bottom: 35px; }
.ai-agent-prompt small { position: absolute; inset-inline-end: 13px; inset-block-end: 10px; color: var(--muted); direction: ltr; }
.ai-check-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.ai-check-card { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; min-height: 52px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; cursor: pointer; background: color-mix(in srgb,var(--surface-strong) 72%,transparent); }
.ai-check-card input { width: 17px; height: 17px; accent-color: var(--primary); }
.ai-check-card:has(input:checked) { border-color: color-mix(in srgb,var(--primary) 52%,var(--line)); background: color-mix(in srgb,var(--primary) 8%,var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb,var(--primary) 12%,transparent); }
.ai-check-card > span { color: var(--primary); font-size: 19px; }
.ai-check-card.slim { min-height: 46px; }
.escalation-phone-box { display: grid; gap: 10px; padding: 15px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 14px; }
.escalation-phone-box > label { display: flex; justify-content: space-between; gap: 10px; font-weight: 800; }
.escalation-phone-box > label small { color: var(--muted); font-weight: 500; }
.escalation-phone-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.escalation-phone-row { display: grid; grid-template-columns: minmax(0,1fr) 38px; gap: 7px; }
.escalation-phone-row button { border: 1px solid rgba(244,63,94,.2); border-radius: 10px; color: #fb7185; background: rgba(244,63,94,.07); cursor: pointer; font-size: 20px; }
.escalation-phone-box .button { justify-self: start; }
.escalation-categories { margin-top: 16px; }
.escalation-categories h4 { margin: 0 0 11px; }
.ai-agent-final { display: grid; gap: 15px; border-color: color-mix(in srgb,var(--primary) 35%,var(--line)); }
.ai-agent-save { min-height: 52px; font-size: 15px; font-weight: 900; box-shadow: 0 12px 28px color-mix(in srgb,var(--primary) 19%,transparent); }

@media (max-width: 1050px) {
    .ai-agent-layout { grid-template-columns: 1fr; }
    .ai-agent-guide { position: static; }
}
@media (max-width: 760px) {
    .ai-agent-hero { grid-template-columns: 1fr; min-height: 0; }
    .ai-agent-hero-copy { padding: 26px 20px; }
    .ai-agent-hero-art { grid-row: 1; min-height: 190px; }
    .ai-agent-brain { width: 88px; height: 88px; font-size: 30px; }
    .ai-agent-orbit { width: 150px; height: 150px; }
    .ai-agent-orbit.orbit-two { width: 205px; height: 105px; }
    .ai-agent-section,.ai-agent-guide { padding: 17px; }
    .ai-agent-section-head.with-toggle { grid-template-columns: auto minmax(0,1fr); }
    .ai-agent-section-head.with-toggle .switch-control { grid-column: 1 / -1; justify-self: end; margin-top: -5px; }
    .ai-agent-two-columns,.ai-check-grid,.escalation-phone-list { grid-template-columns: 1fr; }
    .ai-agent-prompt textarea { min-height: 210px; }
}
@media (max-width: 430px) {
    .ai-agent-hero-copy h2 { font-size: 27px; }
    .ai-agent-hero-art { min-height: 160px; }
    .ai-agent-status-row { display: grid; }
    .agent-status { width: 100%; }
    .ai-agent-section-head { grid-template-columns: 1fr; }
    .ai-agent-section-icon { width: 38px; height: 38px; }
    .ai-agent-form .toggle-row { align-items: flex-start; }
}

/* Agent response corrections */
.ai-corrections-theme .content { display: grid; gap: 18px; }
.ai-corrections-hero { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 22px; min-height: 190px; padding: 34px 38px; border: 1px solid color-mix(in srgb,var(--primary) 38%,var(--line)); border-radius: 24px; background: radial-gradient(circle at 86% 18%,color-mix(in srgb,var(--accent) 18%,transparent),transparent 30%),linear-gradient(135deg,color-mix(in srgb,var(--primary) 8%,var(--surface)),var(--surface)); box-shadow: inset 0 0 70px rgba(0,0,0,.1); }
.ai-corrections-hero::after { content: '⌘'; position: absolute; inset-inline-end: 4%; inset-block-start: 15px; color: color-mix(in srgb,var(--primary) 12%,transparent); font-size: 150px; font-weight: 950; transform: rotate(-10deg); pointer-events: none; }
.ai-corrections-hero-copy,.ai-corrections-hero-actions { position: relative; z-index: 1; }
.ai-corrections-hero-copy { max-width: 850px; }
.ai-corrections-hero-copy h2 { margin: 10px 0 8px; font-size: clamp(29px,3vw,46px); }
.ai-corrections-hero-copy p { max-width: 820px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.9; }
.ai-corrections-hero-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.ai-correction-manual { padding: 24px; border-color: color-mix(in srgb,var(--primary) 40%,var(--line)); }
.ai-correction-manual > header { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.ai-correction-manual h3 { margin: 5px 0; }
.ai-correction-manual p { margin: 0; color: var(--muted); }
.ai-correction-manual form,.ai-correction-edit { display: grid; gap: 14px; }
.ai-correction-manual label:not(.toggle-row),.ai-correction-edit label { display: grid; gap: 7px; }
.ai-correction-manual label > span,.ai-correction-edit label > span { color: var(--muted); font-size: 12px; font-weight: 800; }
.correction-manual-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.ai-corrections-filter-panel { padding: 20px; }
.ai-corrections-filter-panel .section-heading { margin-bottom: 14px; }
.ai-corrections-filter-grid { display: grid; grid-template-columns: minmax(180px,.9fr) minmax(220px,1.15fr) minmax(240px,1.4fr) minmax(150px,.7fr) auto auto; align-items: end; gap: 10px; }
.ai-corrections-filter-grid label { display: grid; gap: 7px; min-width: 0; }
.ai-corrections-filter-grid label > span { color: var(--muted); font-size: 11px; font-weight: 800; }
.ai-corrections-filter-grid .button { min-height: 43px; white-space: nowrap; }
.ai-corrections-stats { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.ai-corrections-stats article { position: relative; display: grid; gap: 5px; min-height: 126px; padding: 20px; }
.ai-corrections-stats strong { font-size: 29px; }
.ai-corrections-stats small { color: var(--muted); }
.ai-corrections-stats .stat-icon { position: absolute; inset-inline-end: 18px; inset-block-start: 17px; display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid currentColor; border-radius: 13px; background: color-mix(in srgb,currentColor 10%,transparent); font-size: 20px; font-weight: 900; }
.ai-corrections-stats .cyan { color: #22d3ee; }.ai-corrections-stats .green { color: #34d399; }.ai-corrections-stats .violet { color: #a78bfa; }.ai-corrections-stats .amber { color: #fbbf24; }
.ai-corrections-list { display: grid; gap: 14px; }
.ai-correction-card { overflow: hidden; padding: 0; }
.ai-correction-card.is-active { border-color: color-mix(in srgb,var(--primary) 34%,var(--line)); }
.ai-correction-card.is-inactive { opacity: .78; }
.ai-correction-card > header,.ai-correction-card > footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 20px; }
.ai-correction-card > header { border-bottom: 1px solid var(--line); background: color-mix(in srgb,var(--surface-2) 74%,transparent); }
.ai-correction-card > footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.ai-correction-contact { display: flex; align-items: center; gap: 11px; min-width: 0; }
.ai-correction-contact > span:last-child { display: grid; gap: 3px; min-width: 0; }
.ai-correction-contact small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.ai-correction-avatar { display: grid; flex: 0 0 auto; place-items: center; width: 43px; height: 43px; border: 1px solid color-mix(in srgb,var(--primary) 40%,var(--line)); border-radius: 50%; color: var(--primary); background: color-mix(in srgb,var(--primary) 9%,var(--surface)); font-weight: 900; }
.ai-correction-meta,.ai-correction-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ai-correction-meta > span:not(.badge) { color: var(--muted); font-size: 11px; }
.ai-correction-flow { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; padding: 18px 20px; }
.ai-correction-flow section { min-width: 0; padding: 15px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb,var(--surface-2) 70%,transparent); }
.ai-correction-flow section > span { display: block; margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 900; }
.ai-correction-flow p { margin: 0; overflow-wrap: anywhere; line-height: 1.85; white-space: pre-wrap; }
.ai-correction-flow .old-response { border-color: rgba(244,63,94,.25); background: rgba(244,63,94,.045); }
.ai-correction-flow .correct-instruction { border-color: rgba(16,185,129,.32); background: rgba(16,185,129,.065); }
.ai-correction-flow .correct-instruction > span { color: #45daa0; }
.ai-correction-actions form { margin: 0; }
.ai-correction-actions .button { min-height: 34px; padding: 7px 12px; }
.ai-correction-edit { margin: 0 20px 20px; padding: 18px; border: 1px solid color-mix(in srgb,var(--primary) 32%,var(--line)); border-radius: 15px; background: color-mix(in srgb,var(--primary) 4%,var(--surface-2)); }
.ai-correction-edit > div { display: flex; gap: 9px; }
.ai-corrections-empty { display: grid; place-items: center; min-height: 270px; padding: 35px; text-align: center; }
.ai-corrections-empty > span { display: grid; place-items: center; width: 68px; height: 68px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 22px; color: var(--muted); background: var(--surface-2); font-size: 30px; }
.ai-corrections-empty strong { font-size: 19px; }
.ai-corrections-empty p { max-width: 620px; margin: 8px 0 17px; color: var(--muted); line-height: 1.85; }

@media (max-width: 1440px) {
    .ai-corrections-filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ai-corrections-filter-grid .button { width: 100%; }
    .ai-correction-flow { grid-template-columns: 1fr 1fr; }
    .ai-correction-flow .correct-instruction:last-child { grid-column: 1 / -1; }
}
@media (max-width: 780px) {
    .ai-corrections-hero { align-items: stretch; flex-direction: column; padding: 24px 20px; }
    .ai-corrections-hero-actions { justify-content: stretch; }
    .ai-corrections-hero-actions .button { flex: 1 1 180px; }
    .correction-manual-grid,.ai-corrections-filter-grid,.ai-corrections-stats,.ai-correction-flow { grid-template-columns: 1fr; }
    .ai-correction-flow .correct-instruction:last-child { grid-column: auto; }
    .ai-correction-card > header,.ai-correction-card > footer { align-items: stretch; flex-direction: column; }
    .ai-correction-actions { width: 100%; }
    .ai-correction-actions form,.ai-correction-actions .button { flex: 1; }
    .ai-correction-actions .button { width: 100%; }
}
@media (max-width: 520px) {
    .ai-corrections-hero-copy h2 { font-size: 28px; }
    .ai-corrections-filter-panel,.ai-correction-manual { padding: 15px; }
    .ai-correction-flow { padding: 13px; }
    .ai-correction-card > header,.ai-correction-card > footer { padding: 14px; }
    .ai-correction-edit { margin: 0 13px 13px; padding: 14px; }
}

/* Contact directory */
.contact-directory-intro { display:flex; gap:14px; margin-bottom:20px; padding:20px 24px; border:1px solid color-mix(in srgb,var(--primary) 38%,var(--line)); border-radius:18px; background:color-mix(in srgb,var(--primary) 9%,var(--surface)); }
.contact-directory-intro-icon { flex:0 0 auto; color:var(--primary); font-size:22px; }
.contact-directory-intro h2 { margin:0 0 6px; font-size:16px; }
.contact-directory-intro p { margin:0; color:var(--muted); font-size:12px; line-height:1.85; }
.contact-directory-intro ul { display:grid; gap:4px; margin:9px 0 0; padding-inline-start:20px; color:var(--text); font-size:11px; line-height:1.7; }
.contact-directory-layout { display:grid; grid-template-columns:270px minmax(0,1fr); gap:20px; align-items:start; }
.contact-directory-sidebar { position:sticky; top:76px; padding:18px; }
.contact-directory-sidebar-title { display:flex; align-items:center; gap:11px; padding-bottom:15px; border-bottom:1px solid var(--line); }
.contact-directory-sidebar-title > span { display:grid; place-items:center; width:36px; height:36px; border-radius:10px; color:var(--primary); background:color-mix(in srgb,var(--primary) 10%,var(--surface-2)); }
.contact-directory-sidebar-title small { color:var(--muted); font-size:9px; }
.contact-directory-sidebar-title h3 { margin:2px 0 0; font-size:14px; }
.contact-directory-add { display:grid; place-items:center; width:34px; height:34px; margin-inline-start:auto; border:1px solid var(--line); border-radius:9px; color:var(--text); background:var(--surface-2); text-decoration:none; font-size:17px; }
.contact-directory-add:hover { border-color:var(--primary); color:var(--primary); }
.contact-category-nav { display:grid; gap:7px; margin-top:15px; }
.contact-category-nav a { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:43px; padding:9px 12px; border:1px solid transparent; border-radius:12px; color:var(--muted); text-decoration:none; transition:.18s ease; }
.contact-category-nav a:hover { color:var(--text); background:var(--surface-2); }
.contact-category-nav a.active { border-color:color-mix(in srgb,var(--primary) 56%,var(--line)); color:var(--primary); background:color-mix(in srgb,var(--primary) 11%,var(--surface-2)); }
.contact-category-nav a span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11px; font-weight:800; }
.contact-category-nav a b { flex:0 0 auto; padding:3px 8px; border-radius:999px; color:var(--muted); background:var(--surface); font-size:9px; }
.contact-category-nav a.active b { color:var(--primary); }
.contact-sidebar-tools { display:grid; gap:6px; margin-top:15px; padding-top:14px; border-top:1px solid var(--line); }
.contact-sidebar-tools button,.contact-sidebar-tools a { padding:8px 10px; border:0; border-radius:9px; color:var(--muted); background:transparent; text-align:start; text-decoration:none; font:inherit; font-size:9px; cursor:pointer; }
.contact-sidebar-tools button:hover,.contact-sidebar-tools a:hover { color:var(--primary); background:color-mix(in srgb,var(--primary) 8%,transparent); }
.contact-directory-main { min-width:0; }
.contact-directory-toolbar { display:grid; grid-template-columns:minmax(260px,1fr) auto auto; gap:16px; align-items:center; padding:15px 17px; }
.contact-directory-search { display:flex; gap:8px; margin:0; }
.contact-directory-search label { position:relative; flex:1; }
.contact-directory-search input { width:100%; min-height:43px; padding-inline:14px 42px; }
.contact-directory-search label button { position:absolute; inset-inline-end:4px; top:4px; display:grid; place-items:center; width:35px; height:35px; border:0; border-radius:9px; color:var(--muted); background:transparent; cursor:pointer; font-size:20px; }
.contact-directory-search label button:hover { color:var(--primary); background:color-mix(in srgb,var(--primary) 10%,transparent); }
.contact-page-size { margin:0; }
.contact-page-size label { display:flex; align-items:center; gap:8px; color:var(--muted); font-size:10px; }
.contact-page-size select { min-width:76px; min-height:43px; }
.contact-directory-total { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:10px; min-width:250px; color:var(--muted); font-size:10px; }
.contact-directory-total strong,.contact-directory-total b { color:var(--primary); }
.contact-sync-button { min-height:34px; padding:7px 11px; border:1px solid color-mix(in srgb,var(--primary) 45%,var(--line)); border-radius:9px; color:var(--primary); background:color-mix(in srgb,var(--primary) 9%,transparent); font:inherit; font-size:9px; font-weight:900; cursor:pointer; }
.contact-sync-button:hover { background:color-mix(in srgb,var(--primary) 16%,transparent); }
.contact-sync-button:disabled { opacity:.65; cursor:wait; }
.contact-directory-actions { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px; margin:12px 0; }
.contact-directory-table-panel { overflow:hidden; }
.contact-directory-table { min-width:820px; }
.contact-directory-table th { color:var(--muted); font-size:10px; }
.contact-directory-table td { vertical-align:middle; }
.contact-directory-avatar { display:grid; place-items:center; width:38px; height:38px; border-radius:50%; color:#04130e; background:linear-gradient(145deg,var(--primary),var(--accent)); font-size:15px; font-weight:900; box-shadow:0 0 20px color-mix(in srgb,var(--primary) 17%,transparent); }
.contact-select-cell { width:42px; text-align:center; }
.contact-select-cell input { width:16px; height:16px; accent-color:var(--primary); cursor:pointer; }
.contact-directory-name { display:block; color:var(--text); font-size:12px; font-weight:900; text-decoration:none; }
.contact-directory-name:hover { color:var(--primary); }
.contact-directory-table td small { display:block; max-width:220px; margin-top:4px; overflow:hidden; color:var(--muted); text-overflow:ellipsis; white-space:nowrap; font-size:9px; }
.contact-directory-tags { display:flex; flex-wrap:wrap; gap:5px; }
.contact-directory-tags a,.contact-directory-tags span { padding:4px 8px; border:1px solid var(--line); border-radius:999px; color:var(--muted); background:var(--surface-2); font-size:8px; font-weight:800; text-decoration:none; }
.contact-directory-tags a:hover { border-color:var(--primary); color:var(--primary); }
.contact-directory-row-actions { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:6px; }
.contact-directory-row-actions form { margin:0; }
.contact-directory-main .button.compact { min-height:34px; padding:7px 10px; font-size:9px; }

@media (max-width: 1100px) {
    .contact-directory-layout { grid-template-columns:220px minmax(0,1fr); }
    .contact-directory-toolbar { grid-template-columns:1fr auto; }
    .contact-directory-total { grid-column:1 / -1; justify-content:space-between; }
}
@media (max-width: 780px) {
    .contact-directory-intro { padding:17px; }
    .contact-directory-intro ul { display:none; }
    .contact-directory-layout { grid-template-columns:1fr; }
    .contact-directory-sidebar { position:static; padding:14px; }
    .contact-category-nav { display:flex; padding-bottom:4px; overflow-x:auto; }
    .contact-category-nav a { flex:0 0 auto; }
    .contact-sidebar-tools { grid-template-columns:repeat(3,1fr); margin-top:10px; }
    .contact-directory-toolbar { grid-template-columns:1fr; }
    .contact-directory-search { width:100%; }
    .contact-page-size label { justify-content:space-between; }
    .contact-directory-total { grid-column:auto; justify-content:space-between; min-width:0; }
    .contact-directory-actions { display:grid; grid-template-columns:1fr 1fr; }
    .contact-directory-actions .button:first-child { grid-column:1 / -1; }
    .contact-directory-table { min-width:0; }
    .contact-directory-table thead { display:none; }
    .contact-directory-table tbody { display:grid; gap:10px; padding:10px; }
    .contact-directory-table tr { display:grid; grid-template-columns:24px 48px minmax(0,1fr); gap:9px 10px; padding:14px; border:1px solid var(--line); border-radius:14px; background:var(--surface-2); }
    .contact-directory-table td { display:block; padding:0; border:0; }
    .contact-directory-table td:first-child { grid-column:1; grid-row:1; }
    .contact-directory-table td:nth-child(2) { grid-column:2; grid-row:1 / span 2; }
    .contact-directory-table td:nth-child(3) { grid-column:3; }
    .contact-directory-table td:nth-child(n+4) { grid-column:1 / -1; padding-top:8px; border-top:1px solid var(--line); }
    .contact-directory-table td:nth-child(n+4)::before { content:attr(data-label); display:block; margin-bottom:5px; color:var(--muted); font-size:8px; font-weight:800; }
    .contact-directory-row-actions { justify-content:stretch; }
    .contact-directory-row-actions form,.contact-directory-row-actions .button { flex:1 1 120px; }
    .contact-directory-row-actions .button { width:100%; }
    .contact-directory-table .empty-state { grid-column:1 / -1 !important; }
}
@media (max-width: 480px) {
    .contact-directory-intro h2 { font-size:14px; }
    .contact-directory-search { flex-direction:column; }
    .contact-directory-actions { grid-template-columns:1fr; }
    .contact-directory-actions .button:first-child { grid-column:auto; }
}
