/* Suporte SOS Digital: tema Ciano fibra, modo claro e escuro */
:root {
  --brand: #00739e; --brand-strong: #102d37; --brand-soft: #d6ecf5; --bg: #eff4f5; --panel: #ffffff; --panel-2: #f7f9fb; --line: #dde6e9; --text: #11252c; --muted: #5b6f76; --chat: #eaeff0; --dot: rgba(0,115,158,0.07); --in: #ffffff; --out: #d7ecf4; --out-text: #0f262e; --sys: #fff6d9; --sys-text: #6b5a1d; --danger: #b42318; --ok: #0e8a5f; --warn: #b7791f; --on-brand: #ffffff; --head-text: #ffffff;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --brand: #4cc4ef; --brand-strong: #0a161a; --brand-soft: #18343f; --bg: #0a1215; --panel: #101a1e; --panel-2: #162327; --line: #213036; --text: #e6edf0; --muted: #94a6ad; --chat: #0c1518; --dot: rgba(76,196,239,0.06); --in: #1d2b30; --out: #1d3944; --out-text: #dbeaf0; --sys: #2c2814; --sys-text: #e8d9a0; --danger: #f97066; --ok: #3ccb8f; --warn: #f0b350; --on-brand: #081a21; --head-text: #e6edf0; color-scheme: dark; } }
:root[data-theme="dark"] {
  --brand: #4cc4ef; --brand-strong: #0a161a; --brand-soft: #18343f; --bg: #0a1215; --panel: #101a1e; --panel-2: #162327; --line: #213036; --text: #e6edf0; --muted: #94a6ad; --chat: #0c1518; --dot: rgba(76,196,239,0.06); --in: #1d2b30; --out: #1d3944; --out-text: #dbeaf0; --sys: #2c2814; --sys-text: #e8d9a0; --danger: #f97066; --ok: #3ccb8f; --warn: #f0b350; --on-brand: #081a21; --head-text: #e6edf0; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.45 var(--font); background: var(--bg); color: var(--text); }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon { background: none; border: 0; padding: 7px; border-radius: 50%; display: inline-grid; place-items: center; color: inherit; }
.icon:hover { background: rgba(127,127,127,.15); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn { border: 0; border-radius: 8px; padding: 9px 16px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); }
.btn.primary { background: var(--brand); color: var(--on-brand); border-color: transparent; }
.btn.danger { color: var(--danger); }
.link { background: none; border: 0; color: var(--brand); padding: 0; font-weight: 600; }
.err { color: var(--danger); margin: 0; }

/* login */
.login { min-height: 100%; display: grid; grid-template-columns: minmax(380px, 46%) 1fr; background: var(--bg); }
.login-brand { position: relative; overflow: hidden; color: #e6f4f9; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background: radial-gradient(120% 80% at 0% 0%, #0b5c7d 0%, transparent 60%), radial-gradient(90% 70% at 100% 100%, #0b4a63 0%, transparent 60%), linear-gradient(160deg, #0a2530, #06151b); }
.login-brand .fibers { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: rgba(76,196,239,.16); stroke-width: 1.4; }
.login-brand .fibers .pulse { stroke: url(#fg); stroke-width: 2.2; stroke-dasharray: 140 900; animation: fiber 6s linear infinite; }
.login-brand .fibers .p2 { animation-duration: 8s; animation-delay: -3s; }
@keyframes fiber { from { stroke-dashoffset: 1040; } to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .login-brand .fibers .pulse { animation: none; } }
.login-brand > * { position: relative; }
.brand-logo { width: 230px; max-width: 70%; }
.brand-copy h2 { font-size: 30px; line-height: 1.2; font-weight: 600; margin: 0 0 12px; max-width: 15em; letter-spacing: -.01em; color: #fff; }
.brand-copy p { margin: 0 0 26px; color: #a9c9d4; font-size: 15px; max-width: 26em; }
.brand-copy ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.brand-copy li { display: flex; align-items: center; gap: 12px; font-weight: 500; color: #d8ecf3; }
.brand-copy li svg { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: rgba(76,196,239,.12); border: 1px solid rgba(76,196,239,.25); color: #4cc4ef; flex: none; }
.brand-foot { color: #7fa3b0; letter-spacing: .08em; font-size: 12px; }
.login-main { display: grid; place-items: center; padding: 32px 24px; }
.login-card { width: min(380px, 100%); display: grid; gap: 8px; }
.login-card h1 { font-size: 26px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.login-card .sub { margin: 0 0 18px; color: var(--muted); }
.login-card .mob-logo { display: none !important; }
.login-card label { font-weight: 500; font-size: 13px; color: var(--text); margin-top: 6px; }
.login-card .lfield { position: relative; display: flex; align-items: center; }
.login-card .lfield > svg { position: absolute; left: 13px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.login-card input { width: 100%; padding: 13px 14px 13px 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  transition: border-color .15s, box-shadow .15s; }
.login-card input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.login-card input#password { padding-right: 44px; }
.login-card .eye { position: absolute; right: 6px; background: none; border: 0; padding: 7px; border-radius: 8px; color: var(--muted); display: grid; }
.login-card .eye svg { width: 18px; height: 18px; } .login-card .eye.on { color: var(--brand); }
.login-card .btn { margin-top: 16px; padding: 13px; border-radius: 10px; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #003a52)); box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 30%, transparent); transition: transform .15s, box-shadow .15s; }
.login-card .btn:hover { transform: translateY(-1px); box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 38%, transparent); }
.login-card .btn svg { width: 18px; height: 18px; }
.login-card .secure { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); margin-top: 14px; font-size: 12px; }
.login-card .secure svg { width: 15px; height: 15px; color: var(--ok); }
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .login-main { background: radial-gradient(circle at 20% 0%, var(--brand-soft), transparent 50%), var(--bg); }
  .login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px 22px; box-shadow: 0 14px 40px rgba(0,0,0,.08); }
  .login-card .mob-logo { display: block !important; width: 220px; max-width: 80%; margin: 0 auto 14px; }
  .login-card h1, .login-card .sub { text-align: center; }
  .login-card .mob-logo.logo-dark { display: none !important; }
  :root[data-theme="dark"] .login-card .mob-logo.logo-dark { display: block !important; } :root[data-theme="dark"] .login-card .mob-logo.logo-light { display: none !important; }
}
@media (max-width: 820px) and (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .login-card .mob-logo.logo-dark { display: block !important; } :root:not([data-theme="light"]) .login-card .mob-logo.logo-light { display: none !important; } }
.logo-dark { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; } :root[data-theme="dark"] .logo-light { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-dark { display: block; } :root:not([data-theme="light"]) .logo-light { display: none; } }

/* layout */
.app { height: 100%; display: grid; grid-template-columns: minmax(300px, 400px) 1fr; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.side-top { background: var(--brand-strong); color: var(--head-text); display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; }
:root:not([data-theme="dark"]) .side-top { background: var(--brand); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .side-top { background: var(--brand-strong); } }
.brand-icon { width: 34px; height: 34px; border-radius: 9px; }
.brand { flex: 1; display: grid; line-height: 1.2; min-width: 0; }
.brand b { font-size: 15px; }
.wa-state { font-size: 12px; opacity: .85; display: flex; align-items: center; gap: 6px; }
.wa-state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }
.wa-state.ok::before { background: #3ccb8f; } .wa-state.off::before { background: #f97066; }
.search { padding: 10px 12px 6px; }
.search input { width: 100%; padding: 9px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 11px 4px 9px; font-weight: 500; color: var(--muted); font-size: 13px; }
.tabs button.on { color: var(--brand); border-color: var(--brand); }
.tabs em { font-style: normal; background: var(--brand); color: var(--on-brand); border-radius: 10px; padding: 0 6px; font-size: 11px; margin-left: 2px; }
.tabs em:empty { display: none; }
.filter { padding: 6px 14px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--line); }
.list { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.item { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: center; }
.item:hover { background: var(--panel-2); }
.item.sel { background: var(--brand-soft); }
.item img { width: 44px; height: 44px; border-radius: 50%; }
.item .t { min-width: 0; }
.item b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item p { margin: 1px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .meta { display: grid; justify-items: end; gap: 4px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.badge { background: var(--ok); color: #fff; border-radius: 11px; min-width: 20px; padding: 1px 6px; text-align: center; font-weight: 600; }
.who-tag { font-size: 11px; color: var(--brand); font-weight: 500; }
.list .none { padding: 30px 20px; color: var(--muted); text-align: center; }
.me { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* conversa */
.chat { min-width: 0; min-height: 0; display: flex; background: var(--chat); }
.empty { margin: auto; text-align: center; color: var(--muted); max-width: 380px; padding: 20px; }
.empty img { width: 84px; opacity: .9; } .empty h2 { color: var(--text); font-weight: 600; margin: 10px 0 4px; }
.conv { flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.conv-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--panel); border-bottom: 1px solid var(--line); }
.conv-top .avatar { width: 40px; height: 40px; border-radius: 50%; }
.who { flex: 1; min-width: 0; display: grid; }
.who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; } .who b:hover { text-decoration: underline; }
.who span { font-size: 12px; color: var(--muted); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.actions .btn { padding: 6px 12px; font-size: 13px; }
.back { display: none; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 6%; display: flex; flex-direction: column; gap: 4px;
  background-image: radial-gradient(var(--dot) 1.2px, transparent 1.4px); background-size: 18px 18px; }
.day { align-self: center; background: var(--panel); color: var(--muted); font-size: 12px; padding: 3px 10px; border-radius: 8px; margin: 10px 0 6px; box-shadow: 0 1px 1px rgba(0,0,0,.05); }
.bubble { max-width: min(560px, 80%); padding: 6px 9px 4px; border-radius: 9px; background: var(--in); box-shadow: 0 1px 1.5px rgba(0,0,0,.08); align-self: flex-start; word-wrap: break-word; white-space: pre-wrap; }
.bubble.out { align-self: flex-end; background: var(--out); color: var(--out-text); }
.bubble .by { display: block; font-size: 12px; font-weight: 600; color: var(--brand); margin-bottom: 1px; }
.bubble .tm { float: right; font-size: 11px; color: var(--muted); margin: 6px 0 -2px 10px; display: inline-flex; gap: 3px; align-items: center; font-variant-numeric: tabular-nums; }
.bubble.out .tm { color: inherit; opacity: .7; }
.tick { font-size: 12px; letter-spacing: -3px; } .tick.read { color: #2aa3ef; opacity: 1; }
.bubble img.media, .bubble video { display: block; max-width: 100%; max-height: 320px; border-radius: 6px; margin-bottom: 4px; cursor: zoom-in; }
.bubble audio { width: 260px; max-width: 100%; display: block; }
.doc { display: flex; gap: 8px; align-items: center; padding: 8px; background: rgba(127,127,127,.12); border-radius: 6px; margin-bottom: 4px; color: inherit; text-decoration: none; }
.sys { align-self: center; background: var(--sys); color: var(--sys-text); font-size: 12px; padding: 4px 10px; border-radius: 8px; margin: 4px 0; }
.accept-bar { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 12px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
.composer { position: relative; display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; background: var(--panel); border-top: 1px solid var(--line); }
.field { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.field textarea { width: 100%; border: 0; background: transparent; resize: none; padding: 10px 12px; max-height: 160px; outline: none; }
.file-prev { padding: 8px 12px 0; font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.sign { font-size: 12px; color: var(--muted); display: flex; gap: 4px; align-items: center; padding-bottom: 10px; white-space: nowrap; }
.send { background: var(--brand); color: var(--on-brand); width: 42px; height: 42px; }
.mic { width: 42px; height: 42px; color: var(--brand); }
.composer.recording .field, .composer.recording .attach, .composer.recording .sign, .composer.recording .mic { display: none; }
.rec { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 42px; font-variant-numeric: tabular-nums; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #d93b3b; animation: pisca 1s infinite; }
.rec-lbl { color: var(--muted); font-size: 13px; }
@keyframes pisca { 50% { opacity: .3; } }
.send:hover { background: var(--brand); filter: brightness(1.1); }
.quick { position: absolute; left: 60px; right: 60px; bottom: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 -6px 20px rgba(0,0,0,.08); max-height: 240px; overflow: auto; }
.quick button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.quick button:hover, .quick button.on { background: var(--brand-soft); }
.quick b { color: var(--brand); margin-right: 8px; }

/* menu, janela, aviso */
.menu { position: fixed; z-index: 20; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.15); padding: 6px 0; min-width: 220px; }
.menu button { display: block; width: 100%; background: none; border: 0; text-align: left; padding: 9px 16px; }
.menu button:hover { background: var(--panel-2); }
dialog { border: 0; border-radius: 14px; padding: 0; background: var(--panel); color: var(--text); width: min(560px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(4,16,22,.5); }
.dlg header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px 20px; }
.dlg h3 { margin: 0; font-size: 17px; }
#dlgBody { padding: 4px 20px 20px; display: grid; gap: 10px; max-height: 70vh; overflow: auto; }
#dlgBody label { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
#dlgBody input, #dlgBody select, #dlgBody textarea { padding: 9px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel-2); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table td, .table th { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); }
.qr { display: grid; justify-items: center; gap: 10px; text-align: center; }
.qr img { width: 280px; max-width: 100%; background: #fff; padding: 8px; border-radius: 10px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; background: var(--panel-2); border: 1px solid var(--line); }
.pill.ok { color: var(--ok); } .pill.off { color: var(--danger); }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--brand-strong); color: #fff; padding: 10px 18px; border-radius: 10px; z-index: 50; box-shadow: 0 8px 30px rgba(0,0,0,.25); max-width: calc(100% - 32px); }
.zoom { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: grid; place-items: center; z-index: 60; cursor: zoom-out; }
.zoom img { max-width: 94vw; max-height: 94vh; }

.grp { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; vertical-align: 1px; }
.bubble.in .by small { font-weight: 400; color: var(--muted); }
.ph-edit { display: flex; align-items: center; gap: 14px; }
.ph-edit img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.ph-edit div { display: grid; gap: 6px; justify-items: start; }
.item img, .conv-top .avatar { object-fit: cover; background: var(--panel-2); }
/* responder citando */
.bubble { position: relative; }
.rep { position: absolute; top: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--panel); color: var(--muted); box-shadow: 0 1px 3px rgba(0,0,0,.15); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.rep svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.bubble.in .rep { right: -36px; } .bubble.out .rep { left: -36px; }
.bubble:hover .rep, .rep:focus-visible { opacity: 1; }
.rep:hover { color: var(--brand); }
@media (hover: none) { .rep { opacity: .7; } }
.quote { display: grid; gap: 1px; border-left: 3px solid var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); border-radius: 6px; padding: 4px 8px; margin: 2px 0 4px; font-size: 13px; cursor: pointer; white-space: normal; }
.quote b { color: var(--brand); font-size: 12px; }
.quote span { color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px 0; background: var(--panel); border-top: 1px solid var(--line); }
.reply-bar .quote { flex: 1; min-width: 0; margin: 0; cursor: default; }
.reply-bar:not([hidden]) + .composer { border-top: 0; }
.bubble.flash { animation: flash 1.4s; }
@keyframes flash { 30% { box-shadow: 0 0 0 3px var(--brand); } }
/* painel */
dialog.wide { width: min(1000px, calc(100% - 24px)); }
#dlgBody h4 { margin: 18px 0 6px; font-size: 14px; }
.dash-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--text); padding: 7px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.seg button.on { background: var(--brand); color: var(--on-brand); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.kpis div { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 2px; }
.kpis b { font-size: 22px; font-variant-numeric: tabular-nums; color: var(--brand); }
.kpis span { font-size: 12px; color: var(--muted); }
.kpis .warn b { color: #d93b3b; }
.days { display: flex; align-items: flex-end; gap: 3px; height: 110px; padding-bottom: 18px; }
.days div { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; min-width: 0; }
.days i { display: block; width: 100%; max-width: 26px; background: var(--brand); border-radius: 3px 3px 0 0; min-height: 1px; }
.days span { position: absolute; bottom: -17px; font-size: 10px; color: var(--muted); }
.scroll-x { overflow-x: auto; }
.table.dash .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table.dash .w { width: 30%; min-width: 80px; }
.nowrap { white-space: nowrap; }
.dbar { display: block; height: 8px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.dbar i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.hint { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .app.in-chat .side { display: none; } .app:not(.in-chat) .chat { display: none; }
  .back { display: inline-grid; } .msgs { padding: 12px 10px; }
  .days div:not(:nth-child(5n+1)) span { display: none; }
  .sign { display: none; } .actions .btn { padding: 6px 9px; }
  .conv-top { flex-wrap: wrap; row-gap: 6px; } .actions { width: 100%; display: flex; justify-content: flex-end; gap: 6px; }
  .who span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
dialog.wide #dlgBody { max-height: 82vh; }
