/* ===== ChatDesk · Identidade Credinowe ===== */
:root {
  --blue: #1c5eac;
  --blue-600: #174f92;
  --blue-700: #123f76;
  --blue-50: #eef4fc;
  --blue-100: #dbe7f7;
  --navy: #0b2a55;
  --navy-2: #0f3670;
  --orange: #ff7900;
  --orange-600: #e86d00;
  --orange-50: #fff3e8;
  --ink: #0f1b2d;
  --muted: #64748b;
  --line: #e6ebf2;
  --bg: #f3f6fa;
  --surface: #ffffff;
  --side-w: 256px;
  --top-h: 64px;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(11, 42, 85, .05), 0 6px 20px rgba(11, 42, 85, .06);
  --shadow-lg: 0 20px 50px rgba(11, 42, 85, .18);
  --bs-primary: #1c5eac;
  --bs-primary-rgb: 28, 94, 172;
  --bs-link-color: #1c5eac;
  --bs-link-color-rgb: 28, 94, 172;
  --bs-link-hover-color: #123f76;
  --bs-font-sans-serif: "Inter Variable", Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { -webkit-font-smoothing: antialiased; }
body { background: var(--bg); color: var(--ink); font-family: var(--bs-font-sans-serif); letter-spacing: -.005em; }
a { color: var(--blue); }
.text-brand { color: var(--blue) !important; }
.text-accent { color: var(--orange) !important; }
.border-brand { border-color: var(--blue-100) !important; box-shadow: 0 0 0 4px var(--blue-50), var(--shadow); }
.text-prewrap { white-space: pre-wrap; }
.min-w-0 { min-width: 0; }
.bi.pf-messenger, .pf-messenger { color: #0a7cff; }
.bi.pf-instagram, .pf-instagram { color: #e1306c; }
.bi.pf-telegram, .pf-telegram { color: #229ed9; }
::selection { background: rgba(255, 121, 0, .25); }

/* ===== Layout ===== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: var(--side-w); flex-shrink: 0; background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #c7d5ea; position: fixed; inset: 0 auto 0 0; z-index: 1040; overflow-y: auto; transition: transform .25s ease; }
.sidebar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 180px; background: radial-gradient(120% 80% at 0% 100%, rgba(255, 121, 0, .18), transparent 60%); pointer-events: none; }
.brand { padding: 1.35rem 1.4rem 1.1rem; border-bottom: 1px solid rgba(255, 255, 255, .07); margin-bottom: .6rem; }
.brand-img { width: 150px; height: auto; display: block; }
.brand-sub { display: inline-flex; align-items: center; gap: .35rem; margin-top: .55rem; font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: rgba(255, 255, 255, .08); padding: .2rem .55rem; border-radius: 99px; }
.brand-sub i { color: var(--orange); }
.sidebar .nav-link { color: #c7d5ea; display: flex; align-items: center; gap: .8rem; padding: .62rem .9rem; margin: .12rem .8rem; border-radius: 10px; font-size: .9rem; font-weight: 500; position: relative; transition: background .15s, color .15s; }
.sidebar .nav-link i { font-size: 1.1rem; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.sidebar .nav-link.active { background: rgba(255, 255, 255, .12); color: #fff; }
.sidebar .nav-link.active::before { content: ""; position: absolute; left: -.8rem; top: 22%; bottom: 22%; width: 4px; border-radius: 0 4px 4px 0; background: var(--orange); }
.sidebar .nav-link.active i { color: var(--orange); }
.nav-section { text-transform: uppercase; font-size: .68rem; letter-spacing: .1em; color: #7f95b8; padding: 1.2rem 1.7rem .35rem; font-weight: 600; }
.main { flex: 1; margin-left: var(--side-w); min-width: 0; display: flex; flex-direction: column; }
.topbar { height: var(--top-h); background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(10px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: .75rem; padding: 0 1.75rem; position: sticky; top: 0; z-index: 1030; }
.page-title { font-size: 1.15rem; font-weight: 700; margin: 0; letter-spacing: -.02em; }
.content { padding: 1.75rem; flex: 1; animation: fadeIn .25s ease; }
.content-inbox { padding: 0; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.user-chip { display: flex; align-items: center; gap: .55rem; border-radius: 999px; padding: .25rem .7rem .25rem .3rem; border: 1px solid var(--line); background: #fff; }
.avatar-sm { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700; font-size: .82rem; color: #fff; background: linear-gradient(135deg, var(--blue), var(--blue-700)); flex-shrink: 0; }
.avatar-img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.presence { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; vertical-align: middle; }
.presence.on { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #94a3b8; flex-shrink: 0; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(11, 42, 85, .5); }
  .main { margin-left: 0; }
  .content { padding: 1rem; }
  .topbar { padding: 0 1rem; }
}

/* ===== Componentes ===== */
.card-soft { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.card-soft .card-header { border-bottom: 1px solid var(--line); padding: 1rem 1.25rem; }
.card-title { font-weight: 700; letter-spacing: -.01em; }
.card-title i, h5 > i.bi, h6 > i.bi { color: var(--blue); }
.btn { border-radius: 10px; font-weight: 500; transition: transform .12s, box-shadow .12s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn-gradient, .btn-brand { background: linear-gradient(135deg, var(--blue), var(--blue-600)); border: 0; color: #fff; box-shadow: 0 6px 16px rgba(28, 94, 172, .28); }
.btn-gradient:hover, .btn-gradient:focus, .btn-brand:hover, .btn-brand:focus { background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); color: #fff; transform: translateY(-1px); }
.btn-accent { background: linear-gradient(135deg, #ff8a1f, var(--orange)); border: 0; color: #fff; box-shadow: 0 8px 20px rgba(255, 121, 0, .32); }
.btn-accent:hover, .btn-accent:focus { background: linear-gradient(135deg, var(--orange), var(--orange-600)); color: #fff; transform: translateY(-1px); }
.btn-accent:disabled { opacity: .55; box-shadow: none; }
.btn-brand-soft { background: var(--blue-50); color: var(--blue); border: 1px solid var(--blue-100); }
.btn-brand-soft:hover { background: var(--blue-100); color: var(--blue-700); }
.btn-light { background: #f4f7fb; border-color: #e6ebf2; }
.btn-outline-primary { --bs-btn-color: var(--blue); --bs-btn-border-color: var(--blue); --bs-btn-hover-bg: var(--blue); --bs-btn-hover-border-color: var(--blue); --bs-btn-active-bg: var(--blue-600); }
.btn-icon { width: 44px; height: 44px; display: inline-grid; place-items: center; padding: 0; flex-shrink: 0; }
.form-control, .form-select { border-radius: 10px; border-color: #dbe2ec; }
.form-control:focus, .form-select:focus { border-color: var(--blue); box-shadow: 0 0 0 .22rem rgba(28, 94, 172, .14); }
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }
.form-check-input:focus { box-shadow: 0 0 0 .22rem rgba(28, 94, 172, .14); border-color: var(--blue); }
.form-label { font-weight: 500; font-size: .9rem; color: #334155; }
.table > :not(caption) > * > * { border-color: var(--line); padding-top: .7rem; padding-bottom: .7rem; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: #f8fafc; }
.table-hover > tbody > tr:hover > * { --bs-table-bg-state: #f7faff; }
.pagination { --bs-pagination-active-bg: var(--blue); --bs-pagination-active-border-color: var(--blue); --bs-pagination-color: var(--blue); }
.nav-pills { --bs-nav-pills-link-active-bg: var(--blue); }
.alert { border-radius: 12px; border: 0; }
.alert-success { background: #ecfdf3; color: #166534; }
.alert-danger { background: #fef2f2; color: #991b1b; }
.alert-warning { background: var(--orange-50); color: #9a4a00; }
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom-color: var(--line); }
.modal-footer { border-top-color: var(--line); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; padding: .4rem; }
.dropdown-item { border-radius: 8px; }
.dropdown-item.active, .dropdown-item:active { background: var(--blue); }
.empty-state { text-align: center; color: var(--muted); padding: 4rem 1rem; }
.empty-state i { font-size: 3rem; color: var(--blue-100); display: block; margin-bottom: .75rem; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: .9rem 1rem; height: 100%; background: #fbfcfe; }
.perm-group-title { font-weight: 700; font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--blue); margin-bottom: .5rem; }
.progress-thin { height: 6px; border-radius: 99px; }
.badge { font-weight: 600; letter-spacing: .01em; }
.badge.role-admin { background: var(--navy); }
.badge.role-supervisor { background: var(--blue); }
.badge.role-agente { background: #0f9f6e; }
.badge.role-visualizador { background: #64748b; }
.badge.role-personalizado { background: var(--orange); }
.badge.status-bot { background: #6d5ce8; }
.badge.status-queue { background: var(--orange); }
.badge.status-open { background: var(--blue); }
.badge.status-closed { background: #94a3b8; }
.audit-details { max-width: 380px; }
kbd { background: var(--navy); }

/* ===== Login ===== */
.guest { background: var(--bg); }
.login-split { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-brand { position: relative; overflow: hidden; color: #fff; background: radial-gradient(900px 500px at 110% -10%, rgba(255, 121, 0, .2), transparent 60%), radial-gradient(700px 500px at -20% 120%, rgba(255, 255, 255, .08), transparent 60%), linear-gradient(150deg, var(--navy) 0%, var(--blue) 100%); display: flex; align-items: center; padding: 3.5rem; }
.login-brand::before { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; border: 70px solid rgba(255, 255, 255, .04); right: -200px; bottom: -220px; }
.login-brand-inner { position: relative; max-width: 520px; animation: rise .6s ease; }
.login-logo-light { width: 230px; margin-bottom: 2.6rem; }
.login-brand h1 { font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 800; line-height: 1.15; letter-spacing: -.03em; margin-bottom: 1rem; }
.login-brand h1 span { color: var(--orange); }
.login-brand p { color: #d5e2f5; font-size: 1.05rem; margin-bottom: 2rem; }
.login-features { list-style: none; padding: 0; margin: 0 0 2.2rem; display: grid; gap: .85rem; }
.login-features li { display: flex; align-items: center; gap: .8rem; color: #eaf1fb; }
.login-features i { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: var(--orange); font-size: 1.05rem; flex-shrink: 0; }
.login-channels { display: flex; gap: .6rem; }
.login-channels i { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .12); font-size: 1.2rem; }
.login-form-side { display: grid; place-items: center; padding: 2rem; background: #fff; }
.login-form-side .login-card { box-shadow: none; padding: 0; max-width: 400px; background: transparent; }
.login-logo { width: 190px; margin-bottom: 2rem; }
.login-form-side .form-control { height: 3.4rem; background: #f8fafc; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(150deg, var(--navy), var(--blue)); }
.login-card { width: 100%; max-width: 440px; background: #fff; border-radius: 22px; padding: 2.25rem; box-shadow: var(--shadow-lg); animation: rise .5s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 991.98px) {
  .login-split { grid-template-columns: 1fr; }
  .login-brand { padding: 2rem 1.5rem; }
  .login-features, .login-channels, .login-brand p { display: none; }
  .login-logo-light { margin-bottom: 1rem; width: 170px; }
  .login-brand h1 { font-size: 1.5rem; margin: 0; }
  .login-logo { display: none; }
}

/* Páginas legais públicas */
.legal-wrap { min-height: 100vh; padding: 2rem 1rem 3rem; background: radial-gradient(900px 400px at 100% 0%, rgba(255, 121, 0, .1), transparent 60%), linear-gradient(180deg, var(--blue-50), var(--bg) 40%); }
.legal-top { max-width: 860px; margin: 0 auto 1.25rem; display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; justify-content: space-between; }
.legal-logo { width: 170px; }
.legal-nav { display: flex; flex-wrap: wrap; gap: .3rem; background: #fff; padding: .3rem; border-radius: 12px; box-shadow: var(--shadow); }
.legal-nav a { text-decoration: none; color: #475569; font-size: .85rem; font-weight: 600; padding: .4rem .8rem; border-radius: 9px; }
.legal-nav a.active, .legal-nav a:hover { background: var(--blue); color: #fff; }
.legal-card { max-width: 860px; margin: 0 auto; background: #fff; border-radius: 20px; padding: clamp(1.4rem, 4vw, 3rem); box-shadow: var(--shadow); line-height: 1.75; color: #1e293b; }
.legal-card h1 { font-weight: 800; letter-spacing: -.03em; margin-bottom: .2rem; }
.legal-card h2 { font-size: 1.08rem; font-weight: 700; margin-top: 1.9rem; color: var(--blue); }
.legal-card ul, .legal-card ol { padding-left: 1.2rem; }
.legal-meta { color: var(--muted); font-size: .88rem; margin-bottom: 1.5rem; }
.legal-footer { max-width: 860px; margin: 1.2rem auto 0; text-align: center; font-size: .8rem; color: var(--muted); }
.legal-status { border-radius: 14px; padding: 1rem 1.2rem; margin: 0 0 1.5rem; background: var(--blue-50); border: 1px solid var(--blue-100); }
.legal-status.st-done { background: #ecfdf3; border-color: #bbf7d0; }
.legal-status.st-pending { background: var(--orange-50); border-color: #ffd9b8; }
.legal-status.st-rejected, .legal-status.st-none { background: #f8fafc; border-color: var(--line); }
.legal-code { font-family: ui-monospace, monospace; font-size: 1.3rem; font-weight: 800; letter-spacing: .12em; color: var(--blue); }
.legal-form { background: #f8fafc; border: 1px solid var(--line); border-radius: 16px; padding: 1.2rem; }
.legal-lookup { max-width: 420px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ===== KPIs / gráficos ===== */
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.05rem 1.15rem; box-shadow: var(--shadow); height: 100%; position: relative; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.kpi::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: currentColor; opacity: .05; }
.kpi:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(11, 42, 85, .1); }
.kpi-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; margin-bottom: .7rem; }
.kpi-value { font-size: 1.6rem; font-weight: 800; line-height: 1.1; letter-spacing: -.03em; color: var(--ink); }
.kpi-label { font-size: .78rem; color: var(--muted); margin-top: .25rem; font-weight: 500; }
.kpi-primary { color: var(--blue); } .kpi-primary .kpi-icon { background: var(--blue-50); color: var(--blue); }
.kpi-success { color: #0f9f6e; } .kpi-success .kpi-icon { background: #e7f8f1; color: #0f9f6e; }
.kpi-warn { color: var(--orange); } .kpi-warn .kpi-icon { background: var(--orange-50); color: var(--orange); }
.kpi-info { color: #0b8bc5; } .kpi-info .kpi-icon { background: #e6f5fc; color: #0b8bc5; }
.kpi-violet { color: var(--navy); } .kpi-violet .kpi-icon { background: #e8edf6; color: var(--navy); }
.chart-box { position: relative; height: 290px; }
.chart-sm { height: 260px; }
.report-tabs .nav-link { border-radius: 10px; color: #334155; font-weight: 500; }
.report-tabs .nav-link.active { background: var(--blue); }

/* ===== Integrações ===== */
.platform-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-size: 1.35rem; flex-shrink: 0; box-shadow: 0 6px 14px rgba(11, 42, 85, .15); }
.platform-icon.messenger { background: linear-gradient(135deg, #0a7cff, #7b3bff); }
.platform-icon.instagram { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.platform-icon.telegram { background: linear-gradient(135deg, #37aee2, #1e96c8); }
.platform-icon.wh { background: linear-gradient(135deg, var(--blue), var(--navy)); }
.wh-health { list-style: none; margin: 0 0 .9rem; padding: 0; display: grid; gap: .45rem; font-size: .86rem; }
.wh-health li { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .65rem; background: #f8fafc; border-radius: 10px; }
.wh-health span { color: var(--muted); }
.int-hero { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1.5rem; padding: 1.6rem 1.75rem; margin-bottom: 1.5rem; border-radius: 20px; color: #fff; background: radial-gradient(600px 260px at 100% 0%, rgba(255, 121, 0, .35), transparent 65%), linear-gradient(135deg, var(--navy), var(--blue)); box-shadow: 0 18px 40px rgba(11, 42, 85, .22); }
.int-hero::after { content: ""; position: absolute; width: 280px; height: 280px; right: -90px; bottom: -150px; border-radius: 50%; border: 46px solid rgba(255, 255, 255, .05); }
.int-hero-text { max-width: 560px; position: relative; }
.int-eyebrow { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: #ffd2a6; }
.int-hero h2 { font-weight: 800; letter-spacing: -.03em; margin: .35rem 0 .4rem; font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
.int-hero p { color: #d5e2f5; margin: 0; }
.int-stats { display: grid; grid-template-columns: repeat(4, minmax(96px, 1fr)); gap: .6rem; position: relative; }
.int-stat { background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); border-radius: 14px; padding: .7rem .9rem; }
.int-stat b { display: block; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.int-stat span { font-size: .72rem; color: #cfdcf0; }
@media (max-width: 767.98px) { .int-stats { grid-template-columns: repeat(2, 1fr); width: 100%; } }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 .8rem; }
.section-title h6 { margin: 0; font-weight: 800; font-size: .95rem; letter-spacing: -.01em; display: flex; align-items: center; gap: .45rem; }
.count-pill { background: var(--blue-50); color: var(--blue); font-size: .72rem; border-radius: 99px; padding: .05rem .5rem; }

.provider-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .9rem; }
.provider { position: relative; display: flex; align-items: center; gap: .85rem; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 16px; padding: 1rem 1.05rem; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s, border-color .15s; overflow: hidden; }
.provider::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.provider.fb::before { background: #0866ff; } .provider.ig::before { background: linear-gradient(#f09433, #bc1888); } .provider.tg::before { background: #229ed9; }
.provider:hover { transform: translateY(-3px); box-shadow: 0 16px 32px rgba(11, 42, 85, .12); border-color: var(--blue-100); }
.provider-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 1.45rem; color: #fff; flex-shrink: 0; }
.provider.fb .provider-ico, .connect-modal-head.fb .provider-ico { background: #0866ff; }
.provider.ig .provider-ico, .connect-modal-head.ig .provider-ico { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.provider.tg .provider-ico, .connect-modal-head.tg .provider-ico { background: #229ed9; }
.provider-body { display: grid; min-width: 0; }
.provider-body strong { font-size: .98rem; }
.provider-body small { color: var(--muted); font-size: .76rem; line-height: 1.3; }
.provider-state { display: inline-block; vertical-align: 2px; margin-left: .3rem; font-size: .6rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; padding: .1rem .45rem; border-radius: 99px; background: var(--orange-50); color: var(--orange-600); }
.provider-state.ready { background: #ecfdf3; color: #15803d; }
.provider-go { margin-left: auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; color: var(--blue); flex-shrink: 0; transition: background .15s, color .15s; }
.provider:hover .provider-go { background: var(--blue); color: #fff; }

.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: .9rem; }
.ch-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; transition: box-shadow .15s, transform .15s; position: relative; }
.ch-card::before { content: ""; height: 4px; }
.ch-card.messenger::before { background: linear-gradient(90deg, #0a7cff, #7b3bff); }
.ch-card.instagram::before { background: linear-gradient(90deg, #f09433, #dc2743, #bc1888); }
.ch-card.telegram::before { background: linear-gradient(90deg, #37aee2, #1e96c8); }
.ch-card:hover { box-shadow: 0 16px 34px rgba(11, 42, 85, .1); transform: translateY(-2px); }
.ch-card.is-off { opacity: .6; }
.ch-card-head { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.1rem .8rem; }
.ch-card-head h6 { font-weight: 700; }
.ch-sub { font-size: .76rem; color: var(--muted); }
.ch-status { display: inline-flex; align-items: center; gap: .35rem; font-size: .68rem; font-weight: 700; padding: .2rem .55rem; border-radius: 99px; white-space: nowrap; align-self: flex-start; }
.ch-status span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ch-status.live { background: #ecfdf3; color: #15803d; } .ch-status.live span { animation: pulse 1.8s infinite; }
.ch-status.wait { background: var(--blue-50); color: var(--blue); }
.ch-status.idle { background: var(--orange-50); color: var(--orange-600); }
.ch-status.off { background: #f1f5f9; color: #64748b; }
.ch-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 0 1.1rem; padding: .75rem .85rem; background: #f8fafc; border-radius: 12px; }
.ch-metrics div { min-width: 0; display: grid; }
.ch-metrics small { font-size: .66rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }
.ch-metrics b { font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-actions { display: flex; align-items: center; gap: .4rem; padding: .8rem 1.1rem 1rem; margin-top: auto; flex-wrap: wrap; }
.ch-actions form { display: inline; }
.ch-empty { grid-column: 1 / -1; text-align: center; padding: 3rem 1rem; background: #fff; border: 2px dashed var(--line); border-radius: 18px; color: var(--muted); }
.ch-empty h6 { font-weight: 800; color: var(--ink); margin-top: .4rem; }
.ch-empty .empty-orb { width: 72px; height: 72px; font-size: 1.8rem; border-radius: 22px; margin-bottom: .8rem; }

.side-card { padding: 1.1rem 1.2rem; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.side-head h6 { margin: 0; font-weight: 800; display: flex; align-items: center; gap: .45rem; }
.side-head h6 i { color: var(--blue); }
.check-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; font-size: .88rem; }
.check-steps li { display: flex; align-items: center; gap: .6rem; color: #475569; }
.check-steps li.done { color: var(--ink); }
.check-steps .ck { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; border: 2px solid #cbd5e1; color: #94a3b8; flex-shrink: 0; font-size: .8rem; }
.check-steps li.done .ck { background: #16a34a; border-color: #16a34a; color: #fff; }
.ev-timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; max-height: 420px; overflow-y: auto; }
.ev-timeline li { display: flex; gap: .7rem; align-items: center; padding: .5rem .4rem; border-radius: 10px; position: relative; }
.ev-timeline li:hover { background: #f8fafc; }
.ev-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: .95rem; }
.ev-timeline li.ok .ev-ico { background: #ecfdf3; color: #15803d; }
.ev-timeline li.warn .ev-ico { background: var(--orange-50); color: var(--orange-600); }
.ev-timeline li.fail .ev-ico { background: #fef2f2; color: #dc2626; }
.ev-title { font-size: .84rem; font-weight: 600; }
.ev-time { font-weight: 400; color: var(--muted); font-size: .74rem; margin-left: .3rem; }
.ev-sub { font-size: .76rem; color: var(--muted); }
.ev-timeline li.fail .ev-sub { color: #dc2626; }
.ev-empty { display: grid; justify-items: center; gap: .4rem; text-align: center; color: var(--muted); font-size: .84rem; padding: 1.5rem .5rem; }
.ev-empty i { font-size: 1.8rem; color: var(--blue-100); }

/* Passo de seleção */
.select-step { padding: 1.4rem 1.5rem 0; overflow: hidden; border-color: var(--blue-100); box-shadow: 0 0 0 4px var(--blue-50), var(--shadow); animation: rise .35s ease; }
.stepper { list-style: none; display: flex; gap: .5rem; padding: 0; margin: 0 0 1.2rem; flex-wrap: wrap; }
.stepper li { display: flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; color: #94a3b8; }
.stepper li:not(:last-child)::after { content: ""; width: 34px; height: 2px; background: #e2e8f0; margin-left: .3rem; border-radius: 2px; }
.stepper li span { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: #e2e8f0; color: #64748b; font-size: .74rem; }
.stepper li.done { color: #15803d; } .stepper li.done span { background: #16a34a; color: #fff; } .stepper li.done::after { background: #16a34a; }
.stepper li.current { color: var(--blue); } .stepper li.current span { background: var(--blue); color: #fff; box-shadow: 0 0 0 4px var(--blue-50); }
.select-head { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }
.select-head h5 { font-weight: 800; letter-spacing: -.02em; }
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: .9rem; }
.page-tile { border: 1px solid var(--line); border-radius: 16px; padding: .9rem; background: #fbfcfe; display: grid; gap: .55rem; }
.page-tile-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .1rem; }
.page-avatar { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: #fff; border: 1px solid var(--line); font-weight: 800; color: var(--blue); flex-shrink: 0; }
.page-avatar img { width: 100%; height: 100%; object-fit: cover; }
.page-name { font-weight: 700; }
.page-id { font-size: .72rem; color: var(--muted); font-family: ui-monospace, monospace; }
.ch-toggle { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; margin: 0; }
.ch-toggle:hover { border-color: var(--blue-100); }
.ch-toggle.on { border-color: rgba(28, 94, 172, .45); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(28, 94, 172, .08); }
.ch-toggle.disabled { cursor: default; opacity: .6; background: #f8fafc; }
.ch-toggle .form-switch { padding-left: 2.5em; margin: 0; }
.ch-toggle .form-check-input { width: 2.4em; height: 1.3em; cursor: pointer; }
.ch-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex-shrink: 0; }
.ch-ico.messenger { background: linear-gradient(135deg, #0a7cff, #7b3bff); }
.ch-ico.instagram { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.ch-label { display: grid; min-width: 0; line-height: 1.25; }
.ch-label strong { font-size: .88rem; }
.ch-label small { font-size: .74rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.select-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; justify-content: space-between; margin: 1.2rem -1.5rem 0; padding: .9rem 1.5rem; background: rgba(255, 255, 255, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }

/* Diagnóstico */
.diag-card { padding: 1.2rem 1.3rem; animation: rise .3s ease; }
.diag-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; flex-wrap: wrap; }
.diag-head h5 { font-weight: 800; letter-spacing: -.02em; }
.diag-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .45rem; }
.diag-list li { display: grid; grid-template-columns: 22px minmax(180px, 300px) 1fr; gap: .6rem; align-items: center; padding: .6rem .85rem; border-radius: 12px; background: #f8fafc; font-size: .88rem; border: 1px solid transparent; }
.diag-list li.ok i { color: #16a34a; }
.diag-list li.fail { background: #fef2f2; border-color: #fecaca; } .diag-list li.fail i { color: #dc2626; }
.diag-list li.warn { background: var(--orange-50); } .diag-list li.warn i { color: var(--orange); }
.diag-label { font-weight: 600; }
.diag-detail { color: var(--muted); word-break: break-word; }
.diag-howto { display: flex; gap: .7rem; background: var(--blue-50); border-radius: 12px; padding: .8rem 1rem; color: #1e3a5f; font-size: .88rem; }
.diag-howto > i { color: var(--orange); font-size: 1.15rem; }
@media (max-width: 767.98px) { .diag-list li { grid-template-columns: 22px 1fr; } .diag-detail { grid-column: 2; } }

/* Modais de conexão */
.connect-modal { overflow: hidden; }
.connect-modal-head { display: flex; align-items: center; gap: .9rem; padding: 1.2rem 1.3rem; color: #fff; background: linear-gradient(135deg, var(--navy), var(--blue)); position: relative; }
.connect-modal-head h5 { margin: 0; font-weight: 800; }
.connect-modal-head p { margin: 0; font-size: .82rem; color: #d5e2f5; }
.connect-modal-head .provider-ico { box-shadow: 0 0 0 4px rgba(255, 255, 255, .15); }
.connect-modal-head .btn-close { position: absolute; top: 1rem; right: 1rem; }
.mini-steps { counter-reset: s; list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .45rem; font-size: .88rem; }
.mini-steps li { counter-increment: s; display: flex; gap: .6rem; align-items: flex-start; }
.mini-steps li::before { content: counter(s); width: 22px; height: 22px; border-radius: 50%; background: var(--blue-50); color: var(--blue); font-weight: 800; font-size: .74rem; display: grid; place-items: center; flex-shrink: 0; }

/* Bot preview */
.preview-sticky { top: calc(var(--top-h) + 1rem); }
.phone-preview { background: linear-gradient(180deg, #f8fafc, var(--blue-50)); border-radius: 24px; border: 8px solid var(--navy); min-height: 420px; max-height: 560px; overflow-y: auto; padding: 1rem .75rem; display: flex; flex-direction: column; gap: .5rem; }
.pv-bubble { max-width: 85%; padding: .55rem .8rem; border-radius: 16px; font-size: .85rem; white-space: pre-wrap; word-break: break-word; }
.pv-bubble.in { background: #fff; border: 1px solid var(--line); align-self: flex-start; border-bottom-left-radius: 4px; }
.pv-bubble.out { background: var(--blue); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.pv-quick { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }
.pv-chip { border: 1px solid var(--orange); color: var(--orange-600); border-radius: 999px; padding: .2rem .65rem; font-size: .75rem; background: #fff; }

/* ===== Inbox ===== */
.inbox { display: grid; grid-template-columns: 360px minmax(0, 1fr) 320px; height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); background: var(--surface); transition: grid-template-columns .25s ease; }
.inbox.info-hidden { grid-template-columns: 360px minmax(0, 1fr) 0; }
.inbox.info-hidden .inbox-info { opacity: 0; pointer-events: none; }

/* Lista */
.inbox-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; background: #fff; }
.list-head { padding: 1rem 1rem .75rem; border-bottom: 1px solid var(--line); display: grid; gap: .7rem; }
.list-title { display: flex; align-items: center; justify-content: space-between; }
.list-title h6 { font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em; }
.live-pill { display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 600; color: #16a34a; background: #ecfdf3; padding: .15rem .55rem; border-radius: 99px; text-transform: uppercase; letter-spacing: .06em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .55); } 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
.seg-tabs { display: flex; gap: .2rem; background: #f1f5fa; padding: .25rem; border-radius: 12px; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; }
.seg-tabs::-webkit-scrollbar { display: none; }
.seg-tabs .tab { flex: 1 0 auto; border: 0; background: transparent; padding: .42rem .6rem; border-radius: 9px; font-size: .8rem; color: #5b6b82; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; white-space: nowrap; scroll-snap-align: start; transition: background .15s, color .15s, box-shadow .15s; }
.seg-tabs .tab i { font-size: .9rem; }
.seg-tabs .tab:hover { color: var(--blue); }
.seg-tabs .tab.active { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(11, 42, 85, .12); }
.seg-tabs .tab b { min-width: 18px; padding: 0 .3rem; border-radius: 99px; background: #e2e8f0; color: #334155; font-size: .68rem; line-height: 1.5; }
.seg-tabs .tab.active b { background: var(--blue-50); color: var(--blue); }
.seg-tabs .tab b.warn { background: var(--orange); color: #fff; }
.search-box { position: relative; display: flex; align-items: center; }
.search-box > i { position: absolute; left: .8rem; color: #94a3b8; font-size: .9rem; }
.search-box input { width: 100%; border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 12px; padding: .55rem 2.6rem .55rem 2.2rem; font-size: .88rem; outline: none; transition: border-color .15s, background .15s, box-shadow .15s; }
.search-box input:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 .2rem rgba(28, 94, 172, .12); }
.btn-filter { position: absolute; right: .35rem; border: 0; background: transparent; width: 32px; height: 32px; border-radius: 9px; color: #64748b; }
.btn-filter:hover, .btn-filter.active { background: var(--blue-50); color: var(--blue); }
.list-filters { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; animation: fadeIn .2s; }
.conv-list { overflow-y: auto; flex: 1; padding: .35rem; overscroll-behavior: contain; }
.list-empty { padding: 3rem 1rem; text-align: center; color: var(--muted); font-size: .9rem; display: grid; gap: .4rem; justify-items: center; }
.list-empty i { font-size: 2rem; color: var(--blue-100); }
.conv-item { display: flex; gap: .75rem; width: 100%; text-align: left; border: 0; background: transparent; padding: .7rem .75rem; border-radius: 12px; margin-bottom: .15rem; transition: background .12s, transform .12s; position: relative; }
.conv-item:hover { background: #f5f8fd; }
.conv-item.active { background: linear-gradient(90deg, var(--blue-50), #f7faff); }
.conv-item.active::before { content: ""; position: absolute; left: 0; top: 18%; bottom: 18%; width: 3px; border-radius: 3px; background: var(--orange); }
.conv-item.unread .conv-name { font-weight: 800; }
.conv-item.unread .conv-preview { color: var(--ink); font-weight: 500; }
.conv-avatar, .chat-avatar, .info-avatar { position: relative; width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #94a3b8, #64748b); }
.conv-avatar img, .chat-avatar img, .info-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.conv-avatar.instagram { background: linear-gradient(45deg, #f09433, #dc2743, #bc1888); }
.conv-avatar.messenger { background: linear-gradient(135deg, #0a7cff, #7b3bff); }
.conv-avatar.telegram { background: linear-gradient(135deg, #37aee2, #1e96c8); }
.platform-badge { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .62rem; color: #fff; border: 2px solid #fff; }
.platform-badge.instagram { background: #dc2743; } .platform-badge.messenger { background: #0a7cff; } .platform-badge.telegram { background: #229ed9; }
.conv-body { flex: 1; min-width: 0; display: grid; gap: .12rem; }
.conv-top, .conv-bottom { display: flex; justify-content: space-between; align-items: center; gap: .5rem; min-width: 0; }
.conv-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-time { font-size: .72rem; color: var(--muted); flex-shrink: 0; }
.conv-item.unread .conv-time { color: var(--orange-600); font-weight: 600; }
.conv-preview { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .2rem; align-items: center; }
.tag { font-size: .68rem; background: #f1f5f9; color: #475569; border-radius: 6px; padding: .1rem .42rem; display: inline-flex; align-items: center; gap: .25rem; font-weight: 500; }
.tag .dot { width: 7px; height: 7px; }
.tag-bot { background: #eef0fd; color: #5143d9; }
.tag-wait { background: #eef4fc; color: var(--blue); }
.tag-wait.warn { background: var(--orange-50); color: var(--orange-600); }
.tag-wait.late { background: #fef2f2; color: #dc2626; }
.unread-badge { background: var(--orange); color: #fff; border-radius: 99px; font-size: .68rem; padding: .05rem .42rem; font-weight: 700; flex-shrink: 0; box-shadow: 0 2px 6px rgba(255, 121, 0, .35); }

/* Conversa + fundo */
.inbox-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-stage { position: relative; flex: 1; display: flex; flex-direction: column; min-height: 0; overflow: hidden; isolation: isolate; background-color: #eef3f9; }
.chat-bg-photo, .chat-bg-dim { position: absolute; z-index: -1; pointer-events: none; }
.chat-bg-photo { inset: -24px; background-size: cover; background-position: center; transition: filter .2s; }
.chat-bg-dim { inset: 0; background: #f3f6fa; opacity: .25; transition: opacity .2s; }
.bg-padrao { background-color: #eef3f9; background-image: radial-gradient(rgba(28, 94, 172, .09) 1px, transparent 1px); background-size: 18px 18px; }
.bg-credinowe { background: radial-gradient(800px 400px at 100% 0%, rgba(255, 121, 0, .18), transparent 60%), radial-gradient(700px 500px at 0% 100%, rgba(28, 94, 172, .22), transparent 60%), #eef3fa; }
.bg-aurora { background: linear-gradient(135deg, #e0ecff 0%, #f5e9ff 45%, #ffeede 100%); }
.bg-papel { background-color: #faf7f2; background-image: linear-gradient(rgba(28, 94, 172, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(28, 94, 172, .05) 1px, transparent 1px); background-size: 26px 26px; }
.bg-noite { background: radial-gradient(700px 400px at 100% 0%, rgba(255, 121, 0, .2), transparent 60%), linear-gradient(160deg, #0b2a55, #081b38); }
.bg-noite .chat-bg-dim { background: #081b38; }
.bg-foto { background: #1e293b; }
.bg-noite .day-sep span, .bg-foto .day-sep span, .bg-noite .msg-system, .bg-foto .msg-system { background: rgba(255, 255, 255, .88); }
.bg-noite .chat-empty, .bg-foto .chat-empty { color: #e2e8f0; }
.bg-noite .chat-empty h5, .bg-foto .chat-empty h5 { color: #fff; }

.chat-empty { margin: auto; text-align: center; color: var(--muted); max-width: 360px; padding: 2rem; animation: rise .4s ease; }
.chat-empty h5 { font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.empty-orb { width: 96px; height: 96px; border-radius: 30px; margin: 0 auto 1.2rem; display: grid; place-items: center; font-size: 2.5rem; color: #fff; background: linear-gradient(135deg, var(--blue), var(--navy)); box-shadow: 0 18px 40px rgba(28, 94, 172, .35); position: relative; }
.empty-orb::after { content: ""; position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--orange); top: -6px; right: -6px; border: 4px solid #eef3f9; }
.empty-keys { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; font-size: .75rem; margin-top: 1rem; }
.empty-keys kbd { font-size: .7rem; }
.chat-wrap { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
.chat-header { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: rgba(255, 255, 255, .86); backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid rgba(230, 235, 242, .9); z-index: 3; }
.chat-avatar { width: 42px; height: 42px; }
.chat-title { flex: 1; min-width: 0; }
.chat-name { font-weight: 700; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .74rem; color: var(--muted); margin-top: .1rem; }
.meta-chip { display: inline-flex; align-items: center; gap: .2rem; background: #f1f5f9; border-radius: 6px; padding: .05rem .4rem; font-weight: 600; }
.meta-status { border-radius: 6px; padding: .05rem .4rem; font-weight: 600; color: #fff; }
.meta-status.st-bot { background: #6d5ce8; } .meta-status.st-queue { background: var(--orange); } .meta-status.st-open { background: var(--blue); } .meta-status.st-closed { background: #94a3b8; }
.meta-text { white-space: nowrap; }
.chat-actions { display: flex; align-items: center; gap: .3rem; }
.icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: #475569; display: inline-grid; place-items: center; font-size: 1.08rem; transition: background .15s, color .15s; cursor: pointer; flex-shrink: 0; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--blue-50); color: var(--blue); }
.icon-btn.danger:hover { background: #fef2f2; color: #dc2626; }
.chat-window-alert { background: rgba(255, 243, 232, .95); color: #9a4a00; font-size: .78rem; padding: .4rem 1rem; text-align: center; z-index: 2; }
.chat-window-alert.soft { background: rgba(240, 253, 244, .92); color: #166534; }
.chat-messages { flex: 1; overflow-y: auto; padding: 1.25rem clamp(.75rem, 3vw, 2.5rem) 1rem; display: flex; flex-direction: column; gap: .2rem; overscroll-behavior: contain; scroll-behavior: auto; }
.msgs-loading { margin: auto; color: var(--blue); }
.day-sep { display: flex; justify-content: center; margin: .9rem 0 .5rem; position: sticky; top: .25rem; z-index: 1; }
.day-sep span { background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); color: #475569; font-size: .72rem; font-weight: 600; padding: .25rem .8rem; border-radius: 99px; box-shadow: 0 1px 4px rgba(11, 42, 85, .1); }
.msg { max-width: min(72%, 580px); padding: .5rem .8rem .3rem; border-radius: 18px; font-size: .9rem; line-height: 1.45; position: relative; animation: pop .2s ease; word-wrap: break-word; box-shadow: 0 1px 2px rgba(11, 42, 85, .08); margin-top: .5rem; }
.msg.grouped { margin-top: .12rem; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.msg-in { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; }
.msg-in.grouped { border-top-left-radius: 6px; }
.msg-out { align-self: flex-end; background: linear-gradient(135deg, #2a72c9, var(--blue)); color: #fff; border-bottom-right-radius: 6px; }
.msg-out.grouped { border-top-right-radius: 6px; }
.msg-out a { color: #fff; text-decoration: underline; }
.msg-bot { background: #fff; color: var(--ink); border: 1px solid #d6e1f0; }
.msg-bot .msg-author { color: var(--blue); }
.msg-bot a { color: var(--blue); }
.msg-note { align-self: flex-end; background: #fff8ec; border: 1px dashed #ffb366; color: #7a3b00; }
.msg-system { align-self: center; background: rgba(226, 232, 240, .92); color: #475569; font-size: .74rem; padding: .25rem .8rem; border-radius: 99px; box-shadow: none; margin: .5rem 0; max-width: 90%; text-align: center; }
.msg-author { font-size: .7rem; opacity: .9; font-weight: 700; margin-bottom: .1rem; }
.msg-text { white-space: pre-wrap; }
.msg-foot { font-size: .66rem; opacity: .7; text-align: right; margin-top: .1rem; display: flex; justify-content: flex-end; gap: .25rem; align-items: center; }
.msg-status .is-read { color: #7dd3fc; }
.msg-bot .msg-status .is-read, .msg-note .msg-status .is-read { color: #0ea5e9; }
.msg-status .is-failed { color: #fecaca; }
.msg-img-link { display: block; margin: .15rem -.4rem .2rem; }
.msg-img { max-width: min(300px, 100%); max-height: 340px; border-radius: 14px; display: block; object-fit: cover; }
.msg-img.sticker { max-width: 140px; background: transparent; }
.msg-img-missing { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; opacity: .8; }
.msg-att { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .55rem; border-radius: 10px; background: rgba(0, 0, 0, .06); text-decoration: none; }
.msg-error { font-size: .72rem; background: #fee2e2; color: #991b1b; border-radius: 8px; padding: .2rem .45rem; margin: .3rem 0 .15rem; }
.scroll-down { position: absolute; right: 1.25rem; bottom: 130px; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #fff; color: var(--blue); box-shadow: 0 6px 18px rgba(11, 42, 85, .2); z-index: 4; display: grid; place-items: center; animation: rise .2s; }
.scroll-down:hover { background: var(--blue); color: #fff; }
.sd-count { position: absolute; top: -6px; right: -4px; background: var(--orange); color: #fff; font-size: .65rem; font-weight: 700; border-radius: 99px; padding: 0 .35rem; min-width: 18px; }

/* Composer */
.chat-composer { padding: .5rem clamp(.6rem, 2.5vw, 2rem) .9rem; position: relative; z-index: 3; }
.composer-box { background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 30px rgba(11, 42, 85, .1); padding: .45rem .55rem .55rem; transition: box-shadow .15s, border-color .15s; }
.composer-box:focus-within { border-color: rgba(28, 94, 172, .45); box-shadow: 0 10px 30px rgba(11, 42, 85, .12), 0 0 0 .2rem rgba(28, 94, 172, .1); }
.note-mode .composer-box { background: #fffaf3; border-color: #ffd19e; }
.composer-mode { display: flex; gap: .2rem; margin: 0 .2rem .3rem; align-items: center; min-width: 0; }
.composer-mode .mode { border: 0; background: transparent; font-size: .76rem; padding: .2rem .6rem; border-radius: 8px; color: #64748b; font-weight: 600; }
.composer-mode .mode.active { background: var(--blue-50); color: var(--blue); }
.note-mode .composer-mode .mode.active { background: var(--orange-50); color: var(--orange-600); }
.composer-mode .mode:disabled { opacity: .4; }
.composer-row { display: flex; align-items: flex-end; gap: .25rem; }
#msgInput { flex: 1; min-width: 0; resize: none; max-height: 160px; border: 0; outline: none; background: transparent; padding: .55rem .4rem; font-size: .93rem; line-height: 1.4; }
.send-btn { width: 42px; height: 42px; border-radius: 14px; border: 0; color: #fff; background: linear-gradient(135deg, #ff8a1f, var(--orange)); box-shadow: 0 6px 16px rgba(255, 121, 0, .35); display: grid; place-items: center; flex-shrink: 0; transition: transform .12s; }
.send-btn:hover { transform: translateY(-1px) rotate(-8deg); }
.send-btn.sending i { animation: fly .6s ease infinite; }
@keyframes fly { 50% { transform: translate(3px, -3px); opacity: .6; } }
.composer-locked { font-size: .84rem; color: #475569; text-align: center; padding: .55rem .9rem; background: rgba(255, 255, 255, .9); border-radius: 14px; border: 1px solid var(--line); margin-top: .4rem; }
.quick-pop, .emoji-pop { position: absolute; bottom: calc(100% - .3rem); left: clamp(.6rem, 2.5vw, 2rem); background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); z-index: 6; animation: rise .15s; }
.quick-pop { right: clamp(.6rem, 2.5vw, 2rem); max-height: 300px; overflow-y: auto; padding: .35rem; }
.pop-title { font-size: .7rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; padding: .35rem .6rem; }
.quick-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: .5rem .65rem; font-size: .85rem; border-radius: 10px; }
.quick-item.active, .quick-item:hover { background: var(--blue-50); }
.quick-item code { color: var(--orange-600); }
.quick-empty { padding: .75rem; color: var(--muted); font-size: .85rem; }
.emoji-pop { width: 296px; padding: .5rem; display: grid; grid-template-columns: repeat(8, 1fr); gap: .1rem; }
.emoji { border: 0; background: transparent; font-size: 1.25rem; border-radius: 8px; padding: .2rem 0; line-height: 1.3; }
.emoji:hover { background: var(--blue-50); transform: scale(1.15); }

/* Aparência */
.appearance-menu { width: 290px; padding: .9rem; }
.ap-title { font-weight: 700; font-size: .85rem; margin-bottom: .6rem; }
.ap-swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; margin-bottom: .75rem; }
.sw { aspect-ratio: 1; border-radius: 10px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; display: grid; place-items: center; color: #fff; }
.sw.active { box-shadow: 0 0 0 2px var(--orange); }
.sw:disabled { opacity: .4; cursor: not-allowed; }
.sw-padrao { background: #eef3f9 radial-gradient(rgba(28, 94, 172, .25) 1px, transparent 1px) 0 0 / 6px 6px; }
.sw-credinowe { background: linear-gradient(135deg, var(--blue), var(--orange)); }
.sw-aurora { background: linear-gradient(135deg, #cfe0ff, #f0dcff, #ffe2c7); }
.sw-papel { background: #faf7f2; }
.sw-noite { background: linear-gradient(160deg, #0b2a55, #081b38); }
.sw-foto { background: #334155; }
.ap-range { display: grid; grid-template-columns: 1fr auto; gap: .15rem .5rem; font-size: .78rem; color: #475569; font-weight: 500; margin-bottom: .45rem; width: 100%; }
.ap-range input { grid-column: 1 / -1; accent-color: var(--blue); }

/* Painel do contato */
.inbox-info { border-left: 1px solid var(--line); overflow-y: auto; background: #fbfcfe; transition: opacity .2s; position: relative; }
.info-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; padding: 1rem; text-align: center; }
.info-empty i { font-size: 2.2rem; color: var(--blue-100); }
.info-cover { height: 78px; background: radial-gradient(300px 120px at 100% 0%, rgba(255, 121, 0, .45), transparent 70%), linear-gradient(135deg, var(--navy), var(--blue)); }
.info-head { text-align: center; margin-top: -40px; padding: 0 1rem .9rem; }
.info-avatar { width: 80px; height: 80px; font-size: 1.7rem; margin: 0 auto; background: linear-gradient(135deg, var(--blue), var(--navy)); border: 4px solid #fbfcfe; }
.info-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .8rem .9rem; margin-bottom: .75rem; }
.info-card-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 700; margin-bottom: .55rem; display: flex; align-items: center; gap: .35rem; }
.info-card-title i { color: var(--blue); }
.info-list { display: grid; grid-template-columns: auto 1fr; gap: .42rem .75rem; margin: 0; }
.info-list dt { color: var(--muted); font-weight: 500; }
.info-list dd { margin: 0; text-align: right; word-break: break-word; font-weight: 600; }
.history-item { display: grid; gap: .05rem; padding: .45rem .55rem; border-radius: 10px; text-decoration: none; color: #334155; }
.history-item strong { color: var(--blue); font-size: .78rem; }
.history-item:hover { background: var(--blue-50); }

@media (max-width: 1599.98px) {
  .inbox { grid-template-columns: 330px minmax(0, 1fr) 290px; }
  .inbox.info-hidden { grid-template-columns: 330px minmax(0, 1fr) 0; }
}
@media (max-width: 1399.98px) {
  .inbox, .inbox.info-hidden { grid-template-columns: 320px minmax(0, 1fr); }
  .inbox-info, .inbox.info-hidden .inbox-info { opacity: 1; pointer-events: auto; position: fixed; right: 0; top: var(--top-h); bottom: 0; width: min(340px, 92vw); z-index: 1035; box-shadow: -12px 0 40px rgba(11, 42, 85, .18); transform: translateX(105%); transition: transform .25s ease; }
  .inbox.show-info .inbox-info { transform: none; }
}
@media (max-width: 991.98px) {
  .inbox, .inbox.info-hidden { grid-template-columns: 1fr; }
  .inbox-chat { display: none; }
  .inbox.show-chat .inbox-list { display: none; }
  .inbox.show-chat .inbox-chat { display: flex; }
  .msg { max-width: 86%; }
  .chat-header { padding: .5rem .6rem; gap: .5rem; }
  .chat-actions { gap: .1rem; }
  .icon-btn { width: 36px; height: 36px; }
  .meta-text { display: none; }
  .scroll-down { bottom: 120px; right: .8rem; }
  .emoji-pop { width: calc(100% - 1.2rem); grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 991.98px) { .content.content-inbox { padding: 0; } }
@media (max-width: 575.98px) {
  .chat-meta .meta-status { display: none; }
  .chat-avatar { width: 36px; height: 36px; }
  .chat-actions .icon-btn { width: 32px; height: 32px; font-size: 1rem; }
  .chat-composer { padding: .4rem .5rem .6rem; }
  .composer-box { border-radius: 16px; }
  .chat-actions [data-act="take"] { padding: .25rem .5rem; font-size: .78rem; }
  .chat-actions [data-act="take"] i { margin: 0 !important; }
  .msg { max-width: 92%; font-size: .88rem; }
  .composer-mode .mode { font-size: .72rem; padding: .2rem .45rem; }
}

/* ===== Menu lateral recolhível ===== */
.brand-mark { display: none; width: 40px; height: 40px; border-radius: 12px; }
.sb-toggle { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border-radius: 11px; }
@media (min-width: 992px) {
  .sidebar, .main { transition: width .22s ease, margin-left .22s ease, box-shadow .22s; }
  .sb-mini { --side-w: 76px; }
  .sb-mini .sidebar { width: 76px; overflow-x: hidden; }
  .sb-mini .sidebar .brand { padding: 1rem .9rem; display: grid; justify-items: center; }
  .sb-mini .sidebar .brand-img, .sb-mini .sidebar .brand-sub, .sb-mini .sidebar .nav-section, .sb-mini .sidebar .nav-link span { display: none; }
  .sb-mini .sidebar .brand-mark { display: block; }
  .sb-mini .sidebar .nav-link { justify-content: center; margin: .15rem .65rem; padding: .7rem 0; }
  .sb-mini .sidebar .nav-link i { font-size: 1.2rem; }
  .sb-mini .sidebar .nav-link.active::before { left: -.65rem; }
  /* Ao passar o mouse, abre por cima do conteúdo sem empurrar a tela */
  .sb-mini .sidebar:hover { width: 256px; box-shadow: 18px 0 50px rgba(11, 42, 85, .35); }
  .sb-mini .sidebar:hover .brand { display: block; padding: 1.35rem 1.4rem 1.1rem; }
  .sb-mini .sidebar:hover .brand-mark { display: none; }
  .sb-mini .sidebar:hover .brand-img { display: block; }
  .sb-mini .sidebar:hover .brand-sub { display: inline-flex; }
  .sb-mini .sidebar:hover .nav-section { display: block; }
  .sb-mini .sidebar:hover .nav-link { justify-content: flex-start; margin: .12rem .8rem; padding: .62rem .9rem; }
  .sb-mini .sidebar:hover .nav-link span { display: inline; }
  .sb-mini .sidebar:hover .nav-link.active::before { left: -.8rem; }
}

/* ===== Barras de rolagem finas e discretas ===== */
* { scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .35) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, .28); border-radius: 99px; border: 2px solid transparent; background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(28, 94, 172, .55); background-clip: padding-box; }
.sidebar { scrollbar-color: rgba(255, 255, 255, .18) transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); background-clip: padding-box; }
.chat-messages { scrollbar-color: rgba(28, 94, 172, .28) transparent; }
.table-responsive { scrollbar-width: thin; }
@media (hover: none) { *::-webkit-scrollbar { width: 0; height: 0; } }

@media print {
  .sidebar, .topbar, form, .report-tabs, .pagination, .btn { display: none !important; }
  .main { margin: 0; }
  .card-soft { box-shadow: none; border: 0; }
}
