:root {
    --sidebar-width: 268px;
    --topbar-height: 72px;
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --primary-soft: #eaf2ff;
    --success: #16a34a;
    --success-soft: #eaf8ef;
    --warning: #f59e0b;
    --warning-soft: #fff6df;
    --danger: #dc2626;
    --danger-soft: #feeeee;
    --purple: #7c3aed;
    --purple-soft: #f2edff;
    --orange: #f28c18;
    --orange-soft: #fff0df;
    --cyan: #0891b2;
    --surface: #ffffff;
    --surface-2: #f5f7fb;
    --surface-3: #edf1f6;
    --surface-4: #e4e9f0;
    --body: #152033;
    --body-2: #2c3950;
    --muted: #728097;
    --border: #dfe5ed;
    --border-strong: #ccd5e1;
    --sidebar: #0d1b2e;
    --sidebar-2: #101f34;
    --sidebar-text: #adbbcd;
    --shadow: 0 10px 28px rgba(31, 45, 70, .07);
    --shadow-lg: 0 20px 50px rgba(31, 45, 70, .13);
    --radius: 14px;
    --radius-sm: 9px;
    --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body { min-height: 100%; margin: 0; color: var(--body); background: var(--surface-2); font: 14px/1.45 var(--font); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .62; }
svg { display: block; }
.ui-icon { flex: 0 0 auto; }
code { padding: 2px 6px; border-radius: 5px; background: var(--surface-3); color: var(--body-2); font-size: 12px; }

.app-shell { min-height: 100vh; display: flex; }
.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 50; width: var(--sidebar-width); display: flex; flex-direction: column; padding: 18px 12px 14px; overflow-y: auto; background: linear-gradient(180deg, var(--sidebar), #091425 100%); color: var(--sidebar-text); border-right: 1px solid rgba(255,255,255,.055); }
.brand { display: flex; align-items: center; gap: 11px; min-height: 48px; padding: 0 8px 20px; }
.brand-mark { position: relative; display: inline-grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border-radius: 11px; overflow: hidden; background: linear-gradient(145deg, #3b82f6, #1d4ed8); color: #fff; box-shadow: 0 9px 22px rgba(37,99,235,.32); }
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand-mark.large { width: 48px; height: 48px; flex-basis: 48px; border-radius: 14px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.1; }
.brand-copy strong { color: #fff; font-size: 18px; letter-spacing: -.02em; }
.brand-copy small { margin-top: 4px; color: #c4d0df; font-size: 12px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.sidebar-nav a { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 12px; border-radius: 9px; color: var(--sidebar-text); font-weight: 550; transition: background .18s ease, color .18s ease, transform .18s ease; }
.sidebar-nav a:hover { color: #fff; background: rgba(255,255,255,.055); transform: translateX(1px); }
.sidebar-nav a.active { color: #fff; background: linear-gradient(100deg, #1d6cf2, #347df6); box-shadow: 0 7px 20px rgba(37,99,235,.25); }
.nav-icon { display: grid; place-items: center; width: 23px; }
.nav-label { flex: 1; }
.nav-badge { min-width: 22px; height: 22px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; color: #d8e9ff; background: rgba(255,255,255,.12); font-size: 11px; font-weight: 750; }
.sidebar-nav a.active .nav-badge { background: rgba(255,255,255,.2); color: #fff; }

.sidebar-queue-card { margin-top: auto; padding: 13px 12px 11px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: rgba(255,255,255,.025); }
.sidebar-queue-card header { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-bottom: 9px; border-bottom: 1px solid rgba(255,255,255,.12); }
.sidebar-queue-card header strong { color: #f5f8fc; font-size: 12px; }
.sidebar-queue-card header span { min-width: 23px; height: 20px; display: grid; place-items: center; border-radius: 6px; color: #fff; background: #16a34a; font-size: 11px; font-weight: 800; }
.sidebar-queue-list { min-width: 0; }
.sidebar-queue-card a { min-width: 0; min-height: 37px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 7px 0; color: #d0d9e6; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 11px; }
.sidebar-queue-card a:last-child { border-bottom: 0; }
.sidebar-queue-card a:hover { color: #fff; }
.sidebar-queue-card time { flex: 0 0 auto; color: #aab8c9; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sidebar-queue-phone { min-width: 0; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.sidebar-whatsapp-icon { width: 18px; height: 18px; display: grid; place-items: center; flex: 0 0 18px; color: #2cdb7f; }
.sidebar-whatsapp-icon .ui-icon { width: 16px; height: 16px; }
.sidebar-queue-number { min-width: 0; color: inherit; font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.sidebar-empty { margin: 0; padding: 10px 0 2px; color: #8fa1b6; font-size: 10px; line-height: 1.35; }
.sidebar-auto-card { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding: 13px 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 11px; background: rgba(255,255,255,.025); }
.sidebar-auto-card div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.sidebar-auto-card strong { color: #fff; font-size: 11px; }
.sidebar-auto-card span { margin-top: 2px; color: #94a5b9; font-size: 10px; }
.sidebar-auto-card i { width: 36px; height: 36px; display: grid; place-items: center; color: #80efae; border-radius: 50%; background: rgba(22,163,74,.23); }
.sidebar-footer { display: flex; justify-content: space-between; padding: 15px 8px 2px; color: #75869b; font-size: 10px; }

.app-content { width: calc(100% - var(--sidebar-width)); min-width: 0; margin-left: var(--sidebar-width); }
.app-topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-height); display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 24px; background: color-mix(in srgb, var(--surface) 94%, transparent); border-bottom: 1px solid var(--border); backdrop-filter: blur(16px); }
.topbar-left, .topbar-actions { display: flex; align-items: center; gap: 11px; }
.topbar-left { min-width: 0; }
.global-search { width: min(420px, 40vw); height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); color: var(--muted); }
.global-search:focus-within { border-color: #8bb5fb; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.global-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--body); background: transparent; }
.global-search input::placeholder { color: #95a1b2; }
kbd { padding: 3px 7px; border: 0; border-radius: 6px; color: var(--muted); background: var(--surface-3); font: 10px/1.5 var(--font); box-shadow: none; white-space: nowrap; }
.plain-icon { width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 9px; color: var(--muted); background: transparent; }
.plain-icon:hover { color: var(--body); background: var(--surface-3); }
.menu-button { display: none; }
.api-state { display: inline-flex; align-items: center; gap: 7px; min-height: 31px; padding: 0 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.api-state i { width: 7px; height: 7px; border-radius: 50%; }
.api-state.demo { color: #8a5a00; background: var(--warning-soft); }
.api-state.demo i { background: var(--warning); }
.api-state.online { color: #137233; background: var(--success-soft); }
.api-state.online i { background: var(--success); box-shadow: 0 0 0 4px rgba(22,163,74,.11); }
.notification-button { position: relative; width: 38px; height: 38px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; color: var(--muted); background: transparent; }
.notification-button:hover { color: var(--body); background: var(--surface-3); }
.notification-button b { position: absolute; top: -2px; right: -1px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 4px; border: 2px solid var(--surface); border-radius: 999px; color: #fff; background: var(--danger); font-size: 9px; }
.notification-menu { position: relative; }
.notification-dropdown { position: absolute; z-index: 70; top: calc(100% + 10px); right: -8px; width: min(370px, calc(100vw - 24px)); max-height: min(560px, calc(100dvh - 86px)); display: flex; overflow: hidden; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 48px rgba(15,23,42,.18); }
.notification-dropdown[hidden] { display: none !important; }
.notification-dropdown-header { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 15px; border-bottom: 1px solid var(--border); }
.notification-dropdown-header strong { font-size: 14px; }
.notification-dropdown-header button { padding: 6px 7px; border: 0; border-radius: 6px; color: var(--primary); background: transparent; font-size: 10px; font-weight: 700; }
.notification-dropdown-header button:not(:disabled):hover { background: var(--primary-soft); }
.notification-dropdown-header button:disabled { color: var(--muted); opacity: .58; }
.notification-list { min-height: 76px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.notification-item { position: relative; border-bottom: 1px solid var(--border); }
.notification-item:last-of-type { border-bottom: 0; }
.notification-item.is-unread { background: #eef5ff; }
.notification-item.is-unread::before { position: absolute; z-index: 1; top: 20px; left: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); content: ''; }
.notification-item-link { min-height: 72px; display: flex; align-items: flex-start; flex-direction: column; padding: 13px 14px 12px 26px; color: var(--body); }
.notification-item-link:hover { background: rgba(37,99,235,.045); }
.notification-item-link strong { max-width: 100%; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.notification-item-link span { width: 100%; margin-top: 4px; overflow: hidden; color: var(--body-2); font-size: 10px; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.notification-item-link time { margin-top: 5px; color: var(--muted); font-size: 9px; }
.notification-empty { min-height: 96px; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 11px; }
.top-status { display: flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); }
.top-status select { max-width: 108px; border: 0; outline: 0; color: var(--body); background: transparent; font-size: 11px; font-weight: 650; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.status-disponivel { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.11); }
.status-atendimento { background: #3b82f6; box-shadow: 0 0 0 4px rgba(59,130,246,.11); }
.status-pausa { background: #8b5cf6; box-shadow: 0 0 0 4px rgba(139,92,246,.11); }
.status-offline { background: #9aa5b4; box-shadow: 0 0 0 4px rgba(154,165,180,.1); }
.status-prioridade { background: var(--danger); box-shadow: 0 0 0 4px rgba(220,38,38,.1); }
.top-user { display: flex; align-items: center; gap: 9px; padding-left: 4px; }
.top-user-copy { display: flex; flex-direction: column; line-height: 1.2; }
.top-user-copy strong { max-width: 135px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.top-user-copy small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.top-logout { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); }
.top-logout:hover { color: var(--danger); background: var(--danger-soft); }
.top-profile-link { width: auto; display: inline-flex; gap: 5px; padding: 0 8px; color: var(--body-2); font-size: 10px; font-weight: 650; white-space: nowrap; }
.top-profile-link:hover { color: var(--primary); background: var(--primary-soft); }

.page-main { min-height: calc(100vh - var(--topbar-height)); padding: 22px 24px 30px; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-heading h1 { margin: 0; font-size: 23px; line-height: 1.2; letter-spacing: -.025em; }
.page-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }

.avatar { display: inline-grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%; color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--avatar-color, var(--primary)) 75%, white), var(--avatar-color, var(--primary))); font-size: 11px; font-weight: 850; letter-spacing: .03em; box-shadow: inset 0 0 0 2px rgba(255,255,255,.25); }
.avatar-xs { width: 34px; height: 34px; flex-basis: 34px; font-size: 10px; }
.avatar-sm { width: 38px; height: 38px; flex-basis: 38px; font-size: 10px; }
.avatar-lg { width: 64px; height: 64px; flex-basis: 64px; font-size: 18px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 16px; }
.metric-card { min-height: 116px; display: flex; align-items: center; gap: 16px; padding: 19px 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.metric-icon { width: 56px; height: 56px; display: grid; place-items: center; flex: 0 0 56px; border-radius: 50%; font-size: 24px; font-weight: 800; }
.metric-card > div { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: end; column-gap: 8px; }
.metric-card span:not(.metric-icon) { grid-column: 1 / -1; color: var(--body-2); font-size: 12px; }
.metric-card strong { margin-top: 4px; font-size: 26px; line-height: 1; letter-spacing: -.025em; }
.metric-card small { grid-column: 1 / -1; margin-top: 8px; color: var(--muted); font-size: 10px; }
.metric-card.blue .metric-icon { color: var(--primary); background: var(--primary-soft); }
.metric-card.green .metric-icon { color: var(--success); background: var(--success-soft); }
.metric-card.orange .metric-icon { color: var(--orange); background: var(--orange-soft); }
.metric-card.purple .metric-icon { color: var(--purple); background: var(--purple-soft); }
.metric-card.red .metric-icon { color: var(--danger); background: var(--danger-soft); }
.compact-metrics .metric-card { min-height: 96px; padding-top: 15px; padding-bottom: 15px; }
.compact-metrics .metric-icon { width: 48px; height: 48px; flex-basis: 48px; }
.compact-metrics .metric-card strong { font-size: 23px; }

.panel-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.flush-panel { overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 19px; border-bottom: 1px solid var(--border); }
.panel-heading > div { min-width: 0; }
.panel-heading h2 { margin: 0; font-size: 16px; letter-spacing: -.015em; }
.panel-heading p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--primary); font-size: 9px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.primary-button, .secondary-button, .ghost-button, .action-button, .table-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 13px; border: 1px solid transparent; border-radius: 8px; font-size: 11px; font-weight: 750; white-space: nowrap; transition: .16s ease; }
.primary-button { color: #fff; background: linear-gradient(135deg, #2c75f4, #1d5fe2); box-shadow: 0 6px 14px rgba(37,99,235,.18); }
.primary-button:hover { background: linear-gradient(135deg, #1f68ec, #174fc7); transform: translateY(-1px); }
.secondary-button { color: var(--body-2); border-color: var(--border); background: var(--surface); }
.secondary-button:hover { border-color: var(--border-strong); background: var(--surface-3); }
.ghost-button { color: var(--primary); background: var(--primary-soft); }
.ghost-button:hover { color: #fff; background: var(--primary); }
.full { width: 100%; }
.text-link { color: var(--primary); font-size: 11px; font-weight: 750; }
.text-link:hover { text-decoration: underline; }
.icon-action { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--surface); }
.icon-action:hover { color: var(--primary); background: var(--primary-soft); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(290px, .75fr); gap: 15px; }
.chart-card { position: relative; min-height: 326px; border-color: #dbe4ef; background: linear-gradient(155deg, #fff 0%, #fff 62%, #f8fbff 100%); box-shadow: 0 12px 30px rgba(30,64,110,.055), inset 0 1px 0 rgba(255,255,255,.88); }
.chart-report-link { color: var(--body); border: 1px solid var(--border); background: var(--surface); box-shadow: 0 4px 12px rgba(16,24,40,.05); }
.chart-report-link:hover { color: var(--primary); border-color: #b8cdf1; background: var(--primary-soft); }
.premium-bar-chart { --chart-bar-width: 30px; height: 212px; min-height: 0; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; padding: 15px 22px 5px 13px; }
.bar-scale { min-height: 0; display: flex; align-items: flex-end; justify-content: space-between; flex-direction: column; padding: 1px 0 30px; color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.bar-plot { position: relative; min-width: 0; min-height: 0; }
.bar-grid-lines { position: absolute; inset: 7px 0 30px; display: flex; justify-content: space-between; flex-direction: column; pointer-events: none; }
.bar-grid-lines i { width: 100%; height: 1px; display: block; border-top: 1px dashed #dfe6ef; }
.bar-grid-lines i:last-child { border-top-style: solid; border-color: #cfd9e6; }
.bar-columns { position: absolute; inset: 0 3px; display: grid; grid-template-columns: repeat(var(--chart-columns, 7), minmax(0, 1fr)); gap: clamp(8px, 2vw, 24px); }
.bar-column { min-width: 0; height: 100%; display: grid; grid-template-rows: 18px minmax(0, 1fr) 30px; align-items: end; justify-items: center; }
.bar-value { align-self: start; color: var(--body-2); font-size: 10px; font-weight: 800; font-variant-numeric: tabular-nums; }
.bar-stage { width: 100%; height: 100%; min-height: 0; display: flex; align-items: flex-end; justify-content: center; }
.bar-fill { width: min(var(--chart-bar-width), 40%); height: var(--bar-height); display: block; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, #1268f3 0%, #318cff 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.26), 0 5px 12px rgba(18,104,243,.16); transition: filter .16s ease, transform .16s ease; }
.bar-column:hover .bar-fill { filter: brightness(1.05) saturate(1.06); transform: translateY(-2px); }
.bar-column small { align-self: end; display: flex; align-items: center; flex-direction: column; color: var(--muted); font-size: 9px; line-height: 1.2; }
.bar-column small strong { color: var(--body-2); font-size: 10px; font-weight: 700; }
.bar-column small em { margin-top: 2px; color: var(--muted); font-size: 8px; font-style: normal; }
.chart-summary { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 11px 20px 17px; border-top: 1px solid var(--border); color: var(--muted); background: rgba(248,251,255,.72); font-size: 10px; }
.chart-summary span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; }
.blue-dot { background: var(--primary); }
.green-dot { background: var(--success); }
.team-overview { min-height: 326px; }
.team-status-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 17px 14px 13px; }
.team-status-grid > div { display: flex; flex-direction: column; align-items: center; gap: 7px; text-align: center; }
.status-circle { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; font-size: 15px; font-weight: 850; }
.status-circle.available { color: var(--success); background: var(--success-soft); }
.status-circle.busy { color: var(--primary); background: var(--primary-soft); }
.status-circle.pause { color: var(--purple); background: var(--purple-soft); }
.status-circle.offline { color: var(--muted); background: var(--surface-3); }
.team-status-grid small { color: var(--muted); font-size: 9px; }
.compact-team-list { border-top: 1px solid var(--border); }
.compact-team-list > div { display: flex; align-items: center; gap: 9px; padding: 9px 15px; border-bottom: 1px solid var(--border); }
.compact-team-list > div:last-child { border-bottom: 0; }
.compact-team-list > div > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.compact-team-list strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
.compact-team-list small { color: var(--muted); font-size: 9px; }
.recent-card, .queue-preview { min-height: 330px; }
.recent-list a { display: flex; align-items: center; gap: 10px; padding: 11px 17px; border-bottom: 1px solid var(--border); }
.recent-list a:last-child { border-bottom: 0; }
.recent-list a:hover { background: var(--surface-2); }
.recent-main { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.recent-main strong, .recent-main small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.recent-main strong { font-size: 11px; }
.recent-main small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.recent-side { display: flex; align-items: flex-end; flex-direction: column; gap: 4px; }
.recent-side small { color: var(--muted); font-size: 9px; }
.queue-preview-list a { display: grid; grid-template-columns: 22px 34px minmax(0, 1fr) auto auto; align-items: center; gap: 9px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.queue-preview-list a:last-child { border-bottom: 0; }
.queue-preview-list a:hover { background: var(--surface-2); }
.queue-preview-list > a > b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--primary); background: var(--primary-soft); font-size: 9px; }
.queue-preview-list > a > span:nth-child(3) { min-width: 0; display: flex; flex-direction: column; }
.queue-preview-list strong, .queue-preview-list small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.queue-preview-list strong { font-size: 11px; }
.queue-preview-list small { color: var(--muted); font-size: 9px; }
.queue-preview-list time { color: var(--muted); font: 9px/1 var(--font); font-variant-numeric: tabular-nums; }

.status-pill, .priority-badge, .status-badge, .channel-badge, .tag { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: fit-content; min-height: 22px; padding: 0 8px; border-radius: 999px; font-size: 9px; font-style: normal; font-weight: 750; white-space: nowrap; }
.status-em_atendimento { color: #1764cd; background: #e9f2ff; }
.status-aguardando_aceite { color: #7b3fb8; background: #f3eaff; }
.status-fila { color: #9a6200; background: #fff1d7; }
.status-aguardando_cliente { color: #a65c00; background: #fff0df; }
.status-finalizado { color: #16743a; background: #e9f8ef; }
.priority-alta { color: #c61d2b; background: #fee9eb; }
.priority-normal { color: #175fcb; background: #e9f2ff; }
.priority-baixa { color: #4b647d; background: #edf1f5; }
.channel-badge { color: var(--success); background: var(--success-soft); }

.service-workspace { min-height: 650px; display: grid; grid-template-columns: 310px minmax(410px, 1fr) 330px; gap: 13px; }
.conversation-panel, .chat-panel, .customer-panel { min-width: 0; height: min(710px, calc(100vh - 250px)); min-height: 620px; }
.conversation-panel { display: flex; flex-direction: column; }
.conversation-panel-header { display: flex; align-items: center; justify-content: space-between; min-height: 62px; padding: 13px 14px; border-bottom: 1px solid var(--border); }
.conversation-panel-header h2 { margin: 0; font-size: 15px; }
.conversation-panel-header span { color: var(--muted); font-size: 9px; }
.mini-actions { display: flex; gap: 5px; }
.mini-actions button, .mini-actions a { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: var(--surface); }
.mini-actions button:hover, .mini-actions a:hover { color: var(--primary); background: var(--primary-soft); }
.conversation-search { height: 42px; display: flex; align-items: center; gap: 8px; margin: 11px 12px 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); background: var(--surface); }
.conversation-search:focus-within { border-color: #8bb5fb; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.conversation-search input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--body); background: transparent; font-size: 11px; }
.filter-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: stretch; gap: 6px; padding: 0 8px 9px; overflow: hidden; border-bottom: 1px solid var(--border); }
.filter-tabs a { min-width: 0; width: 100%; min-height: 31px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 6px; border: 1px solid var(--border); border-radius: 5px; color: var(--body-2); background: var(--surface-2); font-size: 10px; font-weight: 750; letter-spacing: -.01em; white-space: nowrap; }
.filter-tabs a:hover { color: var(--body); border-color: var(--border-strong); background: var(--surface-3); }
.filter-tabs a:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.filter-tabs a.active { color: var(--primary); border-color: color-mix(in srgb, var(--primary) 48%, var(--border)); background: var(--primary-soft); }
.filter-tabs b { min-width: 20px; height: 18px; display: grid; place-items: center; padding: 0 5px; border: 1px solid var(--border); border-radius: 5px; color: var(--body-2); background: var(--surface); font-size: 9px; font-variant-numeric: tabular-nums; line-height: 1; }
.filter-tabs a.active b { color: #fff; background: var(--primary); }
.conversation-list { min-height: 0; flex: 1; overflow-y: auto; }
.conversation-item { position: relative; min-height: 64px; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); transition: .15s ease; }
.conversation-item:hover { background: var(--surface-2); }
.conversation-item.active { background: linear-gradient(90deg, var(--primary-soft), color-mix(in srgb, var(--primary-soft) 35%, var(--surface))); }
.conversation-item.active::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary); }
.conversation-copy { min-width: 0; flex: 1; }
.conversation-name { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 11px; }
.conversation-item > .status-pill { flex: 0 0 auto; margin-left: auto; }

.chat-panel { display: flex; flex-direction: column; }
.chat-panel-top { flex: 0 0 auto; display: flex; flex-direction: column; }
.chat-panel-expanded { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.chat-header { min-height: 69px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.chat-person { min-width: 0; display: flex; align-items: center; gap: 10px; }
.chat-person > div { min-width: 0; display: flex; flex-direction: column; }
.chat-person strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; }
.chat-person small { display: flex; align-items: center; gap: 4px; margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.chat-person small .ui-icon { color: var(--success); }
.chat-actions { display: flex; align-items: center; gap: 5px; }
.action-button { min-height: 34px; padding: 0 10px; color: var(--body-2); border-color: var(--border); background: var(--surface); font-size: 9px; }
.action-button:hover { color: var(--primary); border-color: #9ebef3; background: var(--primary-soft); }
.action-button.primary { color: #fff; border-color: var(--success); background: var(--success); }
.action-button.danger { color: var(--danger); border-color: #f2b5b5; background: var(--danger-soft); }
.action-button.danger:hover { color: #fff; border-color: var(--danger); background: var(--danger); }
.action-button.transfer-disabled[disabled] { color: var(--danger); border-color: #f2b5b5; background: var(--danger-soft); cursor: not-allowed; opacity: 1; }
.chat-notice { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-bottom: 1px solid var(--border); font-size: 10px; }
.chat-notice.warning { color: #895800; background: var(--warning-soft); }
.chat-notice.info { color: #185eaa; background: var(--primary-soft); }
.chat-messages { min-height: 0; flex: 1; overflow-y: auto; padding: 19px 16px; background-color: #f4f1eb; background-image: radial-gradient(circle at 12px 12px, rgba(80,100,120,.05) 1px, transparent 1px); background-size: 24px 24px; }
.day-divider { display: flex; justify-content: center; margin: 0 0 15px; }
.day-divider span { padding: 4px 10px; border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: 0 2px 8px rgba(0,0,0,.05); font-size: 9px; }
.message-row { display: flex; margin-bottom: 9px; }
.message-row.outgoing { justify-content: flex-end; }
.message-bubble { position: relative; max-width: min(74%, 540px); padding: 5px 10px; border-radius: 10px; background: var(--surface); box-shadow: 0 2px 6px rgba(27,39,57,.08); }
.message-row.incoming .message-bubble { border-top-left-radius: 3px; }
.message-row.outgoing .message-bubble { border-top-right-radius: 3px; background: #d9f8d2; color: #18311b; }
.message-author { margin-bottom: 3px; color: #18723a; font-size: 9px; font-weight: 800; }
.message-text { font-size: 11px; line-height: 1.48; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-text-tail { white-space: nowrap; }
.message-text-tail::after {
    content: "";
    display: inline-block;
    width: 42px;
    height: 1px;
}
.message-row.outgoing .message-text-tail::after { width: 58px; }
.message-bubble:has(> .message-text) > .message-meta {
    position: absolute;
    right: 5px;
    bottom: 5px;
    display: flex;
    margin: 0;
    white-space: nowrap;
    transform: translateY(2px);
}
.message-media { display: block; overflow: hidden; margin: -3px -4px 7px; border-radius: 8px; }
.message-media img, .message-media video { display: block; max-width: 100%; }
.message-media-image { width: min(380px, 100%); background: #e8edf3; }
.message-media-image img { width: 100%; max-height: 280px; object-fit: cover; }
.media-viewer-open { overflow: hidden; }
.media-image-viewer { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 54px 24px 24px; background: rgba(3, 9, 18, .9); backdrop-filter: blur(4px); }
.media-image-viewer[hidden] { display: none !important; }
.media-image-viewer img { display: block; max-width: min(1100px, 96vw); max-height: calc(100vh - 78px); border-radius: 10px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); object-fit: contain; }
.media-image-viewer-close { position: fixed; top: 14px; right: 18px; width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.28); border-radius: 50%; color: #fff; background: rgba(15,23,42,.78); font: 300 30px/1 sans-serif; cursor: pointer; }
.media-image-viewer-close:hover { background: rgba(239,68,68,.9); }
@media (max-width: 620px) { .media-image-viewer { padding: 58px 10px 14px; } .media-image-viewer img { max-width: 100%; max-height: calc(100vh - 72px); } }
.message-media-sticker { width: 150px; margin: -4px 0 4px; background: transparent; }
.message-media-sticker img { width: 100%; max-height: 150px; object-fit: contain; }
.message-media-video { width: min(420px, 100%); background: #101820; }
.message-media-video video { width: 100%; max-height: 270px; }
.message-media-audio { width: min(310px, 70vw); min-width: min(270px, 70vw); display: grid; grid-template-columns: 40px minmax(150px, 1fr) 42px; grid-template-rows: 25px 13px; align-items: center; column-gap: 9px; row-gap: 0; margin: 1px 0 5px; padding: 3px 2px 2px; overflow: visible; border: 0; border-radius: 0; background: transparent; }
.message-media-audio audio { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.message-audio-toggle { grid-row: 1 / 3; width: 40px; height: 40px; display: grid; place-items: center; padding: 0 0 0 2px; border: 0; border-radius: 50%; color: #fff; background: #1598c9; box-shadow: 0 2px 7px rgba(15,92,124,.2); font-size: 15px; line-height: 1; font-weight: 900; cursor: pointer; transition: transform .16s ease, background-color .16s ease; }
.message-audio-toggle:hover { background: #087fab; transform: scale(1.04); }
.message-audio-toggle:active { transform: scale(.96); }
.message-audio-track { position: relative; min-width: 0; height: 25px; display: flex; align-items: center; }
.message-audio-track::after { content: ''; position: absolute; z-index: 2; top: 50%; left: clamp(3px, var(--audio-progress, 0%), calc(100% - 3px)); width: 7px; height: 7px; border-radius: 50%; background: #23a9e0; box-shadow: 0 0 0 2px rgba(35,169,224,.14); transform: translate(-50%,-50%); pointer-events: none; }
.message-audio-wave { width: 100%; height: 23px; display: flex; align-items: center; gap: 2px; overflow: hidden; }
.message-audio-wave i { width: 2px; height: 6px; flex: 1 1 2px; border-radius: 3px; background: #8998a8; opacity: .8; }
.message-audio-wave i:nth-child(4n+1) { height: 10px; }
.message-audio-wave i:nth-child(5n+2) { height: 15px; }
.message-audio-wave i:nth-child(7n+3) { height: 20px; }
.message-audio-track input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; opacity: 0; }
.message-media-audio time { grid-column: 2; grid-row: 2; align-self: end; color: inherit; font-size: 8px; line-height: 1; font-variant-numeric: tabular-nums; text-align: left; white-space: nowrap; opacity: .65; }
.message-audio-speed { grid-column: 3; grid-row: 1 / 3; min-width: 40px; height: 25px; padding: 0 6px; border: 0; border-radius: 999px; color: inherit; background: rgba(15,23,42,.1); font-size: 9px; font-weight: 850; cursor: pointer; transition: background-color .16s ease; }
.message-audio-speed:hover { background: rgba(15,23,42,.17); }
.message-row.incoming .message-media-audio, .message-row.outgoing .message-media-audio { background: transparent; }
html[data-theme="dark"] .message-media-audio { background: transparent; }
html[data-theme="dark"] .message-audio-wave i { background: #718399; }
html[data-theme="dark"] .message-audio-track::after { background: #54c7f3; box-shadow: 0 0 0 2px rgba(84,199,243,.14); }
html[data-theme="dark"] .message-audio-speed { background: rgba(2,8,23,.24); }
.message-media-document { min-width: min(300px, 66vw); display: grid; grid-template-columns: 34px minmax(0, 1fr) 22px; align-items: center; gap: 9px; margin: 0 0 6px; padding: 10px; border: 1px solid rgba(105,126,150,.24); color: inherit; background: rgba(255,255,255,.58); }
.message-media-document > b { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-size: 20px; }
.message-media-document > b .ui-icon { color: inherit; }
.message-media-document > span { min-width: 0; display: flex; flex-direction: column; }
.message-media-document strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.message-media-document small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.message-media-document > .ui-icon { color: var(--muted); }
.message-media-document > em { color: var(--muted); font-size: 20px; font-style: normal; }
.message-media + .message-text, .message-media-state + .message-text { margin-top: 5px; }
.message-media-state { min-width: 210px; display: flex; align-items: center; gap: 9px; margin-bottom: 6px; padding: 10px; border-radius: 8px; color: var(--muted); background: rgba(226,232,240,.7); }
.message-media-state > i { width: 18px; height: 18px; flex: 0 0 18px; border: 2px solid #b5c1d0; border-top-color: var(--primary); border-radius: 50%; }
.message-media-state.loading > i { animation: media-spin .8s linear infinite; }
.message-media-state.error { color: #9d2e2e; background: #fff0f0; }
.message-media-state.error > i { border: 0; animation: none; }
.message-media-state.error > i::before { content: '!'; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--danger); font-size: 11px; font-style: normal; font-weight: 800; }
.message-media-state.removed { color: var(--body-2); background: var(--surface-3); }
.message-media-state.removed > i { border: 0; animation: none; }
.message-media-state.removed > i::before { content: '×'; width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); background: var(--surface); font-size: 13px; font-style: normal; font-weight: 800; }
.message-bubble:has(> .message-media-state.removed):not(:has(> .message-text)) {
    width: max-content;
    white-space: nowrap;
}
.message-bubble:has(> .message-media-state.removed):not(:has(> .message-text)) > .message-media-state.removed {
    min-width: 0;
    display: inline-flex;
    margin-bottom: 0;
    vertical-align: middle;
}
.message-bubble:has(> .message-media-state.removed):not(:has(> .message-text)) > .message-meta {
    display: inline-flex;
    margin: 0 0 0 5px;
    white-space: nowrap;
    vertical-align: bottom;
    transform: translateY(2px);
}
.message-media-state > span { display: flex; flex-direction: column; }
.message-media-state strong { font-size: 10px; }
.message-media-state small { margin-top: 2px; font-size: 8px; }
.message-product-card { width: min(250px, 68vw); display: flex; flex-direction: column; gap: 4px; }
.message-product-card > img { width: 100%; height: 132px; display: block; margin-bottom: 2px; border-radius: 7px; background: #fff; object-fit: contain; }
.message-product-card > strong { font-size: 11px; line-height: 1.3; }
.message-product-card > b { font-size: 12px; }
.message-product-card > p { margin: 1px 0; font-size: 9px; line-height: 1.4; white-space: pre-wrap; }
.message-product-card > a { min-height: 32px; display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 2px; border: 1px solid rgba(255,255,255,.28); border-radius: 7px; color: inherit; background: rgba(255,255,255,.12); font-size: 9px; font-weight: 800; }
.message-product-card > a:hover { background: rgba(255,255,255,.2); }
@keyframes media-spin { to { transform: rotate(360deg); } }
.message-meta { display: flex; justify-content: flex-end; gap: 5px; margin-top: 0; color: #748090; font-size: 8px; line-height: 1; }
.message-reaction-trigger { position: absolute; top: 50%; right: calc(100% + 6px); width: 28px; height: 28px; display: grid; padding: 0; place-items: center; border: 0; border-radius: 50%; color: var(--muted); background: transparent; opacity: 0; transform: translateY(-50%); transition: opacity .15s, color .15s, background .15s; cursor: pointer; z-index: 4; }
.message-row.incoming .message-reaction-trigger { right: auto; left: calc(100% + 5px); }
.message-reaction-trigger .ui-icon { display: block; flex: 0 0 auto; }
.message-row:hover .message-reaction-trigger, .message-reaction-trigger:focus-visible { opacity: 1; }
.message-reaction-trigger:hover, .message-reaction-trigger:focus-visible { color: var(--body); background: var(--surface-2); }
.message-reaction-picker { position: fixed; display: flex; gap: 1px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: 0 8px 24px rgba(15,23,42,.22); z-index: 120; }
.message-reaction-picker button { width: 34px; height: 34px; display: grid; padding: 0; place-items: center; border: 0; border-radius: 50%; background: transparent; font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 20px; line-height: 1; cursor: pointer; transition: background .15s, transform .15s; }
.message-reaction-picker button:hover, .message-reaction-picker button:focus-visible { background: var(--surface-2); transform: scale(1.1); }
.message-reactions { position: absolute; right: 7px; bottom: -12px; display: flex; gap: 3px; margin: 0; z-index: 3; }
.message-row.incoming .message-reactions { right: auto; left: 7px; }
.message-reactions:empty { display: none; }
.message-reaction { display: inline-flex; min-width: 26px; height: 22px; padding: 0 4px 1px; align-items: center; justify-content: center; border: 2px solid var(--page); border-radius: 11px; background: var(--surface); font-family: "Segoe UI Emoji", "Apple Color Emoji", sans-serif; font-size: 17px; line-height: 1; box-shadow: 0 1px 3px rgba(15,23,42,.18); }
button.message-reaction { cursor: pointer; }
.message-reaction.is-team { border-color: #70a7ff; background: #eaf2ff; }
.message-row.outgoing .message-meta span { color: #2b75d2; }
.message-status.status-pendente { color: #6f7d8f !important; }
.message-status.status-enviada, .message-status.status-entregue { color: #2b75d2 !important; }
.message-status.status-lida { color: #087bc1 !important; font-weight: 700; }
.message-status.status-falhou { color: var(--danger) !important; font-weight: 700; }
.message-retry { padding: 0; border: 0; color: var(--danger); background: transparent; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; }
.message-retry:hover { color: #a51f1f; }
.empty-conversation { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 11px; }
.channel-line { position: relative; min-height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 14px; border-top: 1px solid var(--border); color: var(--muted); background: var(--surface); font-size: 9px; }
.channel-line .ui-icon { color: var(--success); }
.recent-messages-jump { position: absolute; z-index: 24; left: 50%; bottom: calc(100% + 10px); min-height: 38px; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 1px solid var(--border-strong); border-radius: 10px; color: var(--body-2); background: var(--surface); box-shadow: 0 10px 28px rgba(15,31,54,.2); opacity: 0; visibility: hidden; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s; white-space: nowrap; }
.recent-messages-jump.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); pointer-events: auto; transition-delay: 0s; }
.recent-messages-jump span { color: var(--muted); font-size: 9px; }
.recent-messages-jump strong { color: var(--primary); font-size: 10px; }
.recent-messages-jump > .ui-icon { color: var(--primary); transform: rotate(90deg); }
.recent-messages-jump:hover { border-color: var(--primary); background: var(--surface-2); }
.channel-store-number { display: inline-flex; align-items: center; gap: 4px; color: #078a42; font-weight: 750; }
.channel-store-number i { margin-right: 1px; color: var(--border-strong); font-style: normal; font-weight: 400; }
.channel-store-number .ui-icon { color: #078a42; }
.chat-composer { position: relative; min-height: 93px; display: flex; align-items: center; gap: 7px; padding: 10px 12px; border-top: 1px solid var(--border); background: var(--surface); }
.composer-tools { display: grid; flex: 0 0 auto; grid-template-columns: repeat(2, 34px); gap: 5px; }
.chat-composer textarea { height: 73px; min-height: 73px; max-height: 73px; flex: 1; resize: none; overflow-y: auto; padding: 10px 11px; border: 1px solid var(--border); border-radius: 9px; outline: 0; color: var(--body); background: var(--surface-2); font-size: 11px; }
.chat-composer textarea:focus { border-color: #8bb5fb; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.composer-icon { width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 18px; }
.composer-icon:hover { color: var(--body); background: var(--surface-3); }
.composer-icon.is-recording { color: #dc2626; border-color: #ef4444 !important; background: #fff1f2 !important; }
.composer-popover[hidden], .composer-attachment-preview[hidden] { display: none !important; }
.composer-popover { position: absolute; z-index: 35; bottom: calc(100% + 8px); left: 12px; width: min(330px, calc(100% - 24px)); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: 0 18px 45px rgba(15,31,54,.2); }
.chat-composer.is-audio-active .composer-tools,
.chat-composer.is-audio-active > textarea,
.chat-composer.is-audio-active > .send-button { display: none !important; }
.audio-recorder { min-width: 0; height: 73px; display: flex; flex: 1; align-items: center; gap: 12px; padding: 10px 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.audio-recorder[hidden] { display: none !important; }
.audio-recorder-head { min-width: 126px; display: grid; grid-template-columns: 12px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 8px; }
.audio-recorder-head strong { font-size: 11px; letter-spacing: -.01em; }
.audio-recorder-head time { grid-column: 2; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 10px; font-weight: 800; }
.audio-recorder-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 4px rgba(239,68,68,.13); animation: audio-recording-pulse 1.15s ease-in-out infinite; }
.audio-recorder-wave { min-width: 70px; height: 42px; display: flex; flex: 1; align-items: center; justify-content: center; gap: 3px; padding: 0 8px; overflow: hidden; }
.audio-recorder-wave i { width: 3px; height: 30px; flex: 0 1 3px; border-radius: 3px; background: linear-gradient(180deg, #60a5fa, #2563eb); transform: scaleY(.16); transform-origin: center; transition: transform 70ms linear, opacity 70ms linear; }
.audio-recorder.is-ready .audio-recorder-dot { background: #22c55e; box-shadow: 0 0 0 4px rgba(34,197,94,.13); animation: none; }
.audio-recorder.is-ready .audio-recorder-wave { display: none; }
.audio-recorder-review { --audio-preview-progress: 0%; min-width: 80px; display: grid; flex: 1; grid-template-columns: 40px minmax(0, 1fr); grid-template-rows: 26px 13px; align-items: center; column-gap: 10px; padding: 0; }
.audio-recorder-review[hidden] { display: none !important; }
.audio-recorder-review audio { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.audio-recorder-review-toggle { grid-row: 1 / 3; width: 40px; height: 40px; display: grid; place-items: center; padding: 0 0 0 2px; border: 0; border-radius: 50%; color: #fff; background: var(--primary); box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 28%, transparent); font-size: 15px; font-weight: 900; cursor: pointer; }
.audio-recorder-review-track { position: relative; min-width: 0; height: 26px; display: flex; align-items: center; }
.audio-recorder-review-track::after { content: ''; position: absolute; z-index: 2; top: 50%; left: clamp(3px, var(--audio-preview-progress), calc(100% - 3px)); width: 7px; height: 7px; border-radius: 50%; background: #23a9e0; box-shadow: 0 0 0 2px rgba(35,169,224,.14); transform: translate(-50%,-50%); pointer-events: none; }
.audio-recorder-review-wave { width: 100%; height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 2px; overflow: hidden; }
.audio-recorder-review-wave i { width: 2px; height: 4px; flex: 0 0 2px; border-radius: 999px; background: #8998a8; transition: height 180ms ease; }
.audio-recorder-review-track input { position: absolute; inset: 0; z-index: 3; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.audio-recorder-review time { grid-column: 2; grid-row: 2; align-self: end; color: var(--muted); font-size: 8px; line-height: 1; font-variant-numeric: tabular-nums; }
.audio-recorder p { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.audio-recorder-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.audio-recorder-action { width: 40px; height: 40px; display: grid; place-items: center; padding: 0; border: 1px solid var(--border); border-radius: 50%; color: var(--muted); background: var(--surface); cursor: pointer; }
.audio-recorder-action:hover { color: var(--body); background: var(--surface-3); }
.audio-recorder-action.stop { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); color: #fff; background: var(--primary); }
.audio-recorder-action.stop span { width: 12px; height: 12px; border-radius: 2px; background: currentColor; }
.audio-recorder-action.send { border-color: var(--primary); color: #fff; background: var(--primary); }
@keyframes audio-recording-pulse { 50% { opacity: .45; transform: scale(.82); } }
@media (prefers-reduced-motion: reduce) { .audio-recorder-dot { animation: none; } }
@media (max-width: 620px) {
    .audio-recorder { gap: 7px; padding: 8px; }
    .audio-recorder-head { min-width: 66px; }
    .audio-recorder-head strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 9px; }
    .audio-recorder-wave { gap: 2px; padding: 0; }
    .audio-recorder-wave i:nth-child(even) { display: none; }
    .audio-recorder-action { width: 36px; height: 36px; }
}
.emoji-picker-head { display: flex; align-items: center; gap: 6px; padding: 9px; border-bottom: 1px solid var(--border); }
.emoji-picker-head input { min-width: 0; height: 34px; flex: 1; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; outline: 0; color: var(--body); background: var(--surface-2); font-size: 10px; }
.emoji-picker-head input:focus { border-color: #8bb5fb; }
.emoji-picker-head button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 20px; }
.quick-replies-head { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; border-bottom: 1px solid var(--border); }
.quick-replies-head strong { font-size: 11px; }
.quick-replies-head button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 20px; }
.quick-replies-list { max-height: 260px; display: flex; overflow-y: auto; flex-direction: column; gap: 5px; padding: 7px; }
.quick-replies-group { padding: 6px 8px 2px; color: var(--muted); font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.quick-replies-list button { display: flex; align-items: flex-start; flex-direction: column; gap: 3px; padding: 9px 10px; border: 1px solid transparent; border-radius: 8px; color: var(--body); background: transparent; text-align: left; }
.quick-replies-list button:hover { border-color: var(--border); background: var(--surface-2); }
.quick-replies-list strong { font-size: 10px; }
.quick-replies-list small { color: var(--muted); font-size: 9px; line-height: 1.4; }
.quick-replies-list[hidden] { display: none !important; }
.quick-products-state { padding: 20px 10px; color: var(--muted); font-size: 9px; text-align: center; }
.quick-product-option { width: 100%; min-height: 62px; display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px; border: 1px solid transparent; border-radius: 9px; color: var(--body); background: transparent; text-align: left; }
.quick-product-option:hover { border-color: var(--border); background: var(--surface-2); }
.quick-product-option > img { width: 48px; height: 48px; border-radius: 7px; background: #fff; object-fit: contain; }
.quick-product-option > span { min-width: 0; display: flex; flex-direction: column; }
.quick-product-option strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.quick-product-option small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.quick-product-option > b { color: var(--primary); font-size: 10px; white-space: nowrap; }
.command-product-picker { left: 92px; width: min(680px, calc(100% - 170px)); overflow: hidden; }
.command-product-head { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.command-product-head strong { font-size: 11px; }
.command-product-head button { width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 20px; }
.command-product-content { max-height: 310px; overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.command-product-content .quick-product-option:first-child { border-color: var(--primary); background: var(--primary-soft); }
.command-product-categories { position: sticky; top: -8px; z-index: 2; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: -8px -8px 8px; padding: 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
.command-product-categories button { min-height: 36px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 9px; color: var(--body); background: var(--surface-2); text-align: center; font-size: 10px; font-weight: 800; }
.command-product-categories button:hover,
.command-product-categories button.active { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.command-product-results { display: flex; flex-direction: column; gap: 5px; }
.command-product-hint { display: block; padding: 8px 12px; border-top: 1px solid var(--border); color: var(--muted); font-size: 8px; }
.product-send-modal { width: min(520px, calc(100vw - 28px)); }
.product-send-preview { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: 14px; margin-bottom: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.product-send-preview > img { width: 112px; height: 96px; border-radius: 8px; background: #fff; object-fit: contain; }
.product-send-preview > div { min-width: 0; display: flex; flex-direction: column; }
.product-send-preview strong { font-size: 12px; line-height: 1.35; }
.product-send-preview b { margin-top: 7px; color: var(--primary); font-size: 15px; }
.product-send-preview small { margin-top: 4px; color: var(--success); font-size: 9px; }
.product-send-modal .field { margin: 0; }
.product-send-modal textarea { min-height: 82px; resize: vertical; }
.emoji-categories { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.emoji-categories button { height: 29px; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; font-size: 16px; }
.emoji-categories button.active, .emoji-categories button:hover { color: var(--primary); background: var(--primary-soft); }
.emoji-grid { height: 176px; display: grid; grid-template-columns: repeat(8, 1fr); align-content: start; gap: 2px; overflow-y: auto; padding: 8px; }
.emoji-grid button { width: 34px; height: 34px; padding: 0; border: 0; border-radius: 7px; background: transparent; font-size: 20px; line-height: 1; }
.emoji-grid button:hover { background: var(--surface-3); transform: scale(1.08); }
.emoji-grid p { grid-column: 1 / -1; margin: 24px 8px; color: var(--muted); text-align: center; font-size: 10px; }
.composer-attachment-preview { position: absolute; z-index: 28; left: 12px; bottom: calc(100% + 8px); width: min(380px, calc(100% - 24px)); min-height: 58px; display: grid; grid-template-columns: 38px minmax(0, 1fr) 30px; align-items: center; gap: 9px; overflow: hidden; padding: 9px; border: 1px solid #b9cff2; border-radius: 11px; background: var(--surface); box-shadow: 0 12px 30px rgba(15,31,54,.16); }
.attachment-preview-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.composer-attachment-preview > span:nth-child(2) { position: relative; min-width: 0; display: flex; flex-direction: column; overflow: hidden; padding-bottom: 5px; }
.composer-attachment-preview strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.composer-attachment-preview small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.composer-attachment-preview button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 7px; color: var(--muted); background: transparent; }
.composer-attachment-preview button:hover { color: var(--danger); background: var(--danger-soft); }
.composer-upload-progress { position: absolute; right: 0; bottom: 0; left: 0; width: 0; height: 3px; border-radius: 999px; background: var(--primary); transition: width .15s linear; }
.send-button { width: 44px; height: 39px; flex: 0 0 auto; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #3a82f5, #1e5edb); box-shadow: 0 6px 13px rgba(37,99,235,.23); }
.send-button:hover { background: var(--primary-strong); }
.chat-empty, .side-empty, .empty-state, .detail-empty { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; color: var(--muted); padding: 24px; }
.chat-empty .ui-icon, .side-empty .ui-icon, .empty-state .ui-icon { color: #9fb2cc; }
.chat-empty h2, .empty-state strong, .side-empty strong { margin: 12px 0 0; color: var(--body); font-size: 15px; }
.chat-empty p, .empty-state p, .side-empty p { max-width: 270px; margin: 5px 0 0; font-size: 10px; }
.small-empty { height: auto; min-height: 240px; }

.customer-panel { overflow-y: auto; }
.customer-panel-title { min-height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--border); }
.customer-panel-title h2 { margin: 0; font-size: 14px; }
.customer-panel-title a { color: var(--primary); font-size: 9px; font-weight: 650; }
.customer-panel-actions { display: flex; align-items: center; gap: 8px; }
.customer-panel-actions button { padding: 2px 3px; border: 0; color: var(--body-2); background: transparent; font: inherit; font-size: 9px; font-weight: 600; line-height: 1.2; cursor: pointer; }
.customer-panel-actions button:hover, .customer-panel-title a:hover { text-decoration: underline; }
.customer-profile.compact { display: flex; align-items: center; gap: 11px; padding: 16px; border-bottom: 1px solid var(--border); }
.customer-profile.compact > div { min-width: 0; display: flex; flex-direction: column; }
.customer-profile h3 { margin: 0; font-size: 14px; }
.customer-profile span:not(.avatar) { margin-top: 4px; color: var(--body-2); font-size: 10px; }
.customer-profile small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.customer-phone-list { display: flex; flex-direction: column; gap: 6px; padding: 10px 16px 13px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.customer-phone-list > span { min-width: 0; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 6px; min-height: 28px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; color: var(--body-2); background: var(--surface); }
.customer-phone-list > span.primary { border-color: #bcd3f8; color: var(--primary); background: var(--primary-soft); }
.customer-phone-list .ui-icon { color: var(--success); }
.customer-phone-list strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.customer-phone-list em { color: var(--muted); font-size: 7px; font-style: normal; font-weight: 800; text-transform: uppercase; }
.customer-context-form { display: flex; flex-direction: column; gap: 9px; padding: 13px 16px 15px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.customer-context-form[hidden], .customer-context-view[hidden], .purchase-card[hidden], [data-customer-purchase-empty][hidden] { display: none !important; }
.customer-context-form > header { display: flex; flex-direction: column; }
.customer-context-form > header strong { font-size: 11px; }
.customer-context-form > header small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.customer-context-form label { display: flex; flex-direction: column; gap: 4px; color: var(--body-2); font-size: 8px; font-weight: 750; }
.customer-context-form input, .customer-context-form textarea { width: 100%; min-height: 34px; padding: 7px 8px; border: 1px solid var(--border); border-radius: 7px; outline: none; color: var(--body); background: var(--surface); font: inherit; font-size: 9px; font-weight: 500; }
.customer-context-form textarea { resize: vertical; }
.customer-context-form input:focus, .customer-context-form textarea:focus { border-color: #8bb5fb; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.customer-context-purchase-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 7px; }
.customer-context-feedback { min-height: 13px; margin: 0; color: var(--danger); font-size: 8px; }
.customer-context-actions { display: flex; justify-content: flex-end; gap: 7px; }
.customer-context-actions > button { min-height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--body-2); background: var(--surface); font: inherit; font-size: 9px; font-weight: 800; cursor: pointer; }
.customer-context-actions > .primary-button { border-color: var(--primary); color: #fff; background: var(--primary); }
.catalog-product-autocomplete { position: relative; min-width: 0; }
.catalog-product-autocomplete > label { display: flex; flex-direction: column; gap: 4px; }
.catalog-product-results { position: absolute; z-index: 45; top: 100%; right: 0; left: 0; max-height: 250px; overflow-y: auto; margin-top: 5px; padding: 5px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); box-shadow: 0 16px 36px rgba(15,23,42,.18); }
.catalog-product-results[hidden], .catalog-product-selected[hidden] { display: none !important; }
.catalog-product-option { width: 100%; display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 7px; border: 0; border-radius: 8px; color: var(--body); background: transparent; text-align: left; cursor: pointer; }
.catalog-product-option:hover, .catalog-product-option:focus { outline: 0; background: var(--primary-soft); }
.catalog-product-option img { width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 7px; object-fit: contain; background: #fff; }
.catalog-product-option > span { min-width: 0; display: flex; flex-direction: column; }
.catalog-product-option strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-product-option small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.catalog-product-option > em { color: var(--primary); font-size: 9px; font-style: normal; font-weight: 850; white-space: nowrap; }
.catalog-product-results-state { display: block; padding: 12px; color: var(--muted); font-size: 9px; text-align: center; }
.catalog-product-results-wide.is-floating { position: fixed; z-index: 500; right: auto; bottom: auto; max-height: 360px; margin-top: 0; padding: 8px; }
.catalog-product-results-wide .catalog-product-option { grid-template-columns: 54px minmax(0, 1fr) auto; gap: 12px; padding: 9px; }
.catalog-product-results-wide .catalog-product-option img { width: 54px; height: 54px; border-radius: 9px; }
.catalog-product-results-wide .catalog-product-option strong { font-size: 12px; }
.catalog-product-results-wide .catalog-product-option small { margin-top: 4px; font-size: 9px; }
.catalog-product-results-wide .catalog-product-option > em { font-size: 11px; }
.catalog-product-selected { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding: 6px; border: 1px solid #cfe0fc; border-radius: 8px; background: var(--primary-soft); }
.catalog-product-selected img { width: 36px; height: 36px; flex: 0 0 36px; border: 1px solid var(--border); border-radius: 7px; object-fit: contain; background: #fff; }
.catalog-product-selected > span { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.catalog-product-selected strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.catalog-product-selected a { margin-top: 2px; color: var(--primary); font-size: 8px; font-weight: 750; }
.catalog-product-selected button { width: 28px; height: 28px; display: grid; place-items: center; flex: 0 0 28px; border: 0; border-radius: 7px; color: var(--muted); background: rgba(255,255,255,.7); cursor: pointer; }
.client-catalog-product > label { display: flex; flex-direction: column; gap: 6px; }
.client-catalog-product > label > span { color: var(--body-2); font-size: 9px; font-weight: 750; }
.client-catalog-product .catalog-product-selected { max-width: 520px; }
.info-section { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.info-section header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.info-section header .ui-icon { color: var(--muted); }
.info-section h4 { margin: 0; font-size: 11px; }
.info-section p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.55; }
.purchase-section-header h4 { flex: 1; }
.purchase-card-status { padding: 4px 8px; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: 8px; font-style: normal; font-weight: 750; }
.purchase-card-status[hidden] { display: none !important; }
.purchase-card { min-height: 56px; display: flex; align-items: center; gap: 11px; }
.purchase-card > i { width: 50px; height: 50px; display: grid; place-items: center; flex: 0 0 50px; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.purchase-card > i[hidden], .purchase-card-image[hidden] { display: none !important; }
.purchase-card-image { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 52px; overflow: hidden; padding: 2px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.purchase-card-image img { width: 100%; height: 100%; object-fit: contain; }
.purchase-card > span { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.purchase-card-name { min-width: 0; color: inherit; text-decoration: none; }
.purchase-card-name[href]:hover { color: var(--primary); text-decoration: underline; }
.purchase-card-name[aria-disabled="true"] { pointer-events: none; }
.purchase-card strong { display: -webkit-box; overflow: hidden; font-size: 11px; line-height: 1.35; white-space: normal; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.purchase-card small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 9px; white-space: nowrap; text-overflow: ellipsis; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-1 { color: #1d5ec7; background: #e7f0ff; }
.tag-2 { color: #18713a; background: #e6f7ec; }
.tag-3 { color: #6e3bc2; background: #f0e9ff; }
.tag-4 { color: #a45c05; background: #fff0dc; }
.history-list { position: relative; }
.history-item { position: relative; display: flex; gap: 9px; padding: 0 0 13px; }
.history-item:last-child { padding-bottom: 0; }
.history-item > i { position: relative; z-index: 1; width: 8px; height: 8px; flex: 0 0 8px; margin-top: 4px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.history-item:not(:last-child)::after { content: ""; position: absolute; left: 3px; top: 10px; bottom: -2px; width: 1px; background: var(--border); }
.history-item > span { display: flex; flex-direction: column; }
.history-item strong { font-size: 9px; }
.history-item small { margin-top: 2px; color: var(--muted); font-size: 8px; }

.automation-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 14px; margin-bottom: 15px; }
.automation-card, .next-queue-card { min-height: 118px; display: flex; align-items: center; gap: 13px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.automation-card { position: relative; flex-wrap: wrap; background: linear-gradient(110deg, var(--primary-soft), var(--surface)); border-color: color-mix(in srgb, var(--primary) 24%, var(--border)); }
.automation-card > i { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 45%, var(--surface)); }
.automation-card > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.automation-card strong { color: var(--primary); font-size: 13px; }
.automation-card div span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.automation-card > em { padding: 4px 8px; border-radius: 999px; color: var(--success); background: var(--success-soft); font-size: 9px; font-style: normal; font-weight: 800; }
.automation-card > a { margin-left: 57px; display: inline-flex; align-items: center; gap: 6px; color: var(--body-2); font-size: 9px; font-weight: 700; }
.next-queue-card { background: linear-gradient(110deg, var(--success-soft), var(--surface)); border-color: color-mix(in srgb, var(--success) 20%, var(--border)); }
.next-queue-card > div:first-child { display: flex; align-items: center; gap: 9px; }
.next-queue-card > span { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.next-queue-card strong, .next-queue-card small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.next-queue-card strong { font-size: 12px; }
.next-queue-card small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.queue-table-card { overflow: hidden; }
.panel-actions { display: flex; gap: 8px; }
.queue-bulk-actions { display: flex; align-items: center; gap: 7px; padding-right: 8px; border-right: 1px solid var(--border); }
.queue-bulk-actions > span { min-width: 76px; color: var(--muted); font-size: 9px; text-align: right; white-space: nowrap; }
.queue-bulk-actions .compact-select select { min-width: 174px; }
.queue-bulk-actions .primary-button { min-height: 36px; padding: 0 11px; }
.queue-priority-filter { margin: 0; }
.queue-select-column { width: 38px; text-align: center !important; }
.queue-select-column input { width: 15px; height: 15px; accent-color: var(--primary); }
.table-wrap { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 10px 13px; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); text-align: left; font-size: 9px; font-weight: 800; white-space: nowrap; }
.data-table td { padding: 11px 13px; border-bottom: 1px solid var(--border); color: var(--body-2); font-size: 10px; vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover td { background: var(--surface-2); }
.data-table td > strong { color: var(--body); font-size: 10px; }
.table-subtitle { display: block; margin-top: 2px; color: var(--muted); font-size: 8px; }
.person-cell { display: flex; align-items: center; gap: 9px; min-width: 170px; }
.person-cell > div { min-width: 0; display: flex; flex-direction: column; }
.person-cell strong, .person-cell small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.person-cell strong { color: var(--body); font-size: 10px; }
.person-cell small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.person-cell.large h2 { margin: 0; font-size: 18px; }
.queue-position { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 850; }
.wait-time { font-variant-numeric: tabular-nums; font-size: 10px; font-weight: 750; }
.row-actions { display: flex; align-items: center; gap: 6px; }
.table-action { min-height: 31px; padding: 0 9px; color: var(--body-2); border-color: var(--border); background: var(--surface); font-size: 9px; }
.table-action.primary { color: #fff; border-color: var(--primary); background: var(--primary); }
.table-action.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); background: color-mix(in srgb, var(--danger) 9%, var(--surface)); }
.table-action.danger:hover { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 16%, var(--surface)); }
.table-empty { height: 220px; }

.clients-layout { display: grid; grid-template-columns: 275px minmax(480px, 1fr) 280px; gap: 14px; min-height: 680px; }
.client-list-panel { min-height: 680px; }
.client-list-heading { gap: 8px; }
.compact-button { min-height: 31px; padding: 0 9px; font-size: 9px; }
.client-search { margin-top: 10px; }
.client-search button { min-height: 28px; padding: 0 8px; border: 0; border-radius: 6px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 800; }
.client-search > a { width: 26px; height: 26px; display: grid; place-items: center; flex: 0 0 26px; border-radius: 6px; color: var(--muted); }
.client-search > a:hover { color: var(--danger); background: var(--danger-soft); }
.client-list { max-height: 603px; overflow-y: auto; }
.client-list-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-bottom: 1px solid var(--border); }
.client-list-item:hover { background: var(--surface-2); }
.client-list-item.active { background: var(--primary-soft); }
.client-list-item.active::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--primary); }
.client-list-item > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.client-list-item strong, .client-list-item small { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.client-list-item strong { font-size: 10px; }
.client-list-item small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.client-list-item em { width: fit-content; margin-top: 5px; padding: 2px 6px; border-radius: 999px; color: var(--primary); background: color-mix(in srgb, var(--primary-soft) 55%, var(--surface)); font-size: 8px; font-style: normal; }
.client-detail-panel { min-width: 0; padding-bottom: 18px; }
.client-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.client-form { padding: 4px 20px 0; }
.form-section { padding: 18px 0; border-bottom: 1px solid var(--border); }
.form-section:last-of-type { border-bottom: 0; }
.form-section > header { margin-bottom: 13px; }
.form-section h3 { margin: 0; font-size: 13px; }
.form-section header span { color: var(--muted); font-size: 9px; }
.form-grid { display: grid; gap: 12px; }
.form-grid.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three-columns { grid-template-columns: minmax(0, 1.6fr) minmax(100px, .55fr) minmax(130px, .65fr); }
.form-grid .span-two { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { color: var(--body-2); font-size: 9px; font-weight: 750; }
.field > span small { color: var(--muted); font-size: 8px; font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; min-height: 39px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; outline: 0; color: var(--body); background: var(--surface); font-size: 10px; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #8bb5fb; box-shadow: 0 0 0 3px rgba(37,99,235,.08); }
.field small { color: var(--muted); font-size: 8px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 17px; }
.client-contact-list { display: flex; align-items: flex-start; flex-direction: column; gap: 7px; margin-top: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.client-contact-list > span { color: var(--body-2); font-size: 9px; font-weight: 800; }
.client-contact-list > div { display: flex; flex-wrap: wrap; gap: 6px; }
.client-contact-list > div span { padding: 5px 8px; border: 1px solid #cfe0fc; border-radius: 999px; color: var(--primary-strong); background: var(--primary-soft); font-size: 9px; font-weight: 700; }
.client-contact-list > small { color: var(--muted); font-size: 8px; }
.client-primary-phone-field { align-self: start; }
.client-alt-phone-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 2px; }
.client-alt-phone-inline b { color: var(--body-2); font-size: 8px; }
.client-alt-phone-inline em { padding: 3px 6px; border: 1px solid #cfe0fc; border-radius: 999px; color: var(--primary-strong); background: var(--primary-soft); font-size: 8px; font-style: normal; font-weight: 750; }
.client-history-panel { min-height: 680px; }
.timeline-list a, .timeline-list .timeline-static { position: relative; display: flex; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.timeline-list a:hover { background: var(--surface-2); }
.timeline-dot { width: 9px; height: 9px; flex: 0 0 9px; margin-top: 4px; border-radius: 50%; }
.timeline-list a > span, .timeline-list .timeline-static > span { min-width: 0; display: flex; flex-direction: column; }
.timeline-list strong { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 10px; }
.timeline-list small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.timeline-list em { margin-top: 5px; color: var(--primary); font-size: 8px; font-style: normal; font-weight: 700; }

.client-import-overlay { position: fixed; z-index: 90; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(7,17,31,.66); backdrop-filter: blur(3px); }
.client-import-dialog { width: min(1080px, calc(100vw - 40px)); max-height: calc(100dvh - 42px); display: flex; overflow: hidden; flex-direction: column; border: 1px solid rgba(255,255,255,.24); border-radius: 17px; background: var(--surface); box-shadow: 0 30px 90px rgba(3,11,24,.38); }
.client-import-header { min-height: 82px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.client-import-header h2 { margin: 0; font-size: 19px; }
.client-import-header p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.client-import-header > a { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border-radius: 9px; color: var(--muted); background: var(--surface-3); }
.client-import-header > a:hover { color: var(--danger); background: var(--danger-soft); }
.client-import-alert { flex: 0 0 auto; margin: 12px 20px 0; }
.client-import-body { min-height: 0; overflow-y: auto; padding: 16px 20px 20px; scrollbar-width: thin; }
.client-import-file { display: flex; align-items: center; gap: 11px; padding: 12px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.client-import-file > span { width: 40px; height: 40px; display: grid; place-items: center; flex: 0 0 40px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.client-import-file > div { min-width: 0; display: flex; flex-direction: column; }
.client-import-file strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.client-import-file small { margin-top: 4px; color: var(--muted); font-size: 8px; }
.client-import-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.client-import-stats article { min-height: 70px; display: flex; justify-content: center; flex-direction: column; padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.client-import-stats span { color: var(--muted); font-size: 8px; }
.client-import-stats strong { margin-top: 4px; font-size: 18px; }
.client-import-stats article.success strong { color: var(--success); }
.client-import-stats article.info strong { color: var(--primary); }
.client-import-stats article.warning strong { color: var(--warning); }
.client-import-stats article.muted strong { color: var(--muted); }
.client-import-note { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 11px 13px; border: 1px solid #cfe0fc; border-radius: 9px; color: var(--primary); background: var(--primary-soft); }
.client-import-note > span { display: flex; flex-direction: column; }
.client-import-note strong { color: var(--body); font-size: 10px; }
.client-import-note small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.client-import-issues { margin-top: 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; }
.client-import-issues > header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid var(--border); }
.client-import-issues > header strong { font-size: 10px; }
.client-import-issues > header span { color: var(--muted); font-size: 8px; }
.client-import-issues .table-wrap { max-height: 230px; overflow: auto; scrollbar-width: thin; }
.client-import-issues table { width: 100%; border-collapse: collapse; }
.client-import-issues th, .client-import-issues td { padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 9px; text-align: left; vertical-align: top; }
.client-import-issues th { position: sticky; z-index: 1; top: 0; color: var(--muted); background: var(--surface-2); font-size: 8px; text-transform: uppercase; }
.import-action { display: inline-flex; padding: 3px 6px; border-radius: 999px; font-size: 8px; font-weight: 800; }
.import-ignorar { color: var(--muted); background: var(--surface-3); }
.import-revisar { color: #8a5900; background: var(--warning-soft); }
.import-criar { color: #08783d; background: var(--success-soft); }
.import-atualizar { color: var(--primary); background: var(--primary-soft); }
.client-import-confirm { position: sticky; z-index: 2; bottom: -20px; display: flex; align-items: flex-end; justify-content: flex-end; gap: 8px; margin: 14px -20px -20px; padding: 13px 20px 16px; border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 96%, transparent); box-shadow: 0 -9px 22px rgba(15,23,42,.06); }
.client-import-confirm form:first-child { min-width: min(560px, 100%); display: flex; align-items: flex-end; gap: 9px; }
.client-import-confirm form:first-child .field { min-width: 260px; flex: 1; }
.client-import-upload { width: min(720px, 100%); margin: 0 auto; display: flex; align-items: center; flex-direction: column; }
.client-import-drop { width: 100%; min-height: 190px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 7px; padding: 24px; border: 2px dashed #a9c4f2; border-radius: 14px; color: var(--primary); background: var(--primary-soft); cursor: pointer; }
.client-import-drop:hover { border-color: var(--primary); background: #e7f0ff; }
.client-import-drop > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: var(--primary); }
.client-import-drop strong { color: var(--body); font-size: 14px; }
.client-import-drop small { color: var(--muted); font-size: 9px; }
.client-import-drop input { margin-top: 9px; max-width: 100%; color: var(--body-2); font-size: 10px; }
.client-import-upload ul { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 18px; margin: 14px 0; padding: 0; list-style: none; }
.client-import-upload li { position: relative; padding-left: 15px; color: var(--body-2); font-size: 9px; line-height: 1.45; }
.client-import-upload li::before { position: absolute; top: 5px; left: 0; width: 6px; height: 6px; border-radius: 50%; background: var(--success); content: ''; }
.client-import-history { margin-top: 18px; border: 1px solid var(--border); border-radius: 10px; }
.client-import-history > header { padding: 11px 13px; border-bottom: 1px solid var(--border); font-size: 10px; }
.client-import-history article { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 13px; border-bottom: 1px solid var(--border); }
.client-import-history article:last-child { border-bottom: 0; }
.client-import-history article > span { min-width: 0; display: flex; flex-direction: column; }
.client-import-history article strong { overflow: hidden; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.client-import-history article small, .client-import-history article em { color: var(--muted); font-size: 8px; font-style: normal; }

.employees-layout { display: grid; grid-template-columns: minmax(650px, 1fr) 370px; gap: 14px; }
.employees-table-panel { min-width: 0; overflow: hidden; }
.table-toolbar { display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--border); }
.table-toolbar label { height: 38px; min-width: 260px; flex: 1; display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--muted); }
.table-toolbar input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--body); background: transparent; font-size: 10px; }
.table-toolbar select { min-width: 150px; height: 38px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--body); background: var(--surface); font-size: 10px; }
.selected-row td { background: var(--primary-soft) !important; }
.employee-inactive td:not(.employee-action-cell) { opacity: .62; }
.employee-action-cell { width: 54px; text-align: center; }
.employee-action-cell .icon-action { margin: 0 auto; }
.employee-actions-menu { position: fixed; z-index: 75; width: 208px; padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: var(--shadow-lg); }
.employee-actions-menu[hidden] { display: none; }
.employee-actions-menu a,
.employee-actions-menu button { width: 100%; min-height: 36px; display: flex; align-items: center; gap: 9px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--body-2); background: transparent; font: inherit; font-size: 10px; font-weight: 700; text-align: left; cursor: pointer; }
.employee-actions-menu a:hover,
.employee-actions-menu button:hover,
.employee-actions-menu [role="menuitem"]:focus-visible { color: var(--primary); background: var(--primary-soft); outline: 0; }
.employee-actions-menu button[data-next-active="0"] { color: var(--danger); }
.employee-actions-menu button[data-next-active="0"]:hover,
.employee-actions-menu button[data-next-active="0"]:focus-visible { color: var(--danger); background: var(--danger-soft); }
.employee-actions-menu button[data-employee-action-delete] { color: var(--danger); }
.employee-actions-menu button[data-employee-action-delete]:hover,
.employee-actions-menu button[data-employee-action-delete]:focus-visible { color: var(--danger); background: var(--danger-soft); }
.employee-delete-modal .confirmation-symbol { color: var(--danger); background: var(--danger-soft); }
.employee-delete-confirmation { width: 100%; margin-top: 12px; text-align: left; }
.employee-delete-confirmation input { width: 100%; }
.employee-confirmation-symbol { color: var(--primary); background: var(--primary-soft); }
#employee-active-modal.is-deactivating .employee-confirmation-symbol { color: var(--danger); background: var(--danger-soft); }
#confirm-employee-active.is-danger { border-color: var(--danger); background: var(--danger); box-shadow: 0 6px 14px rgba(220,38,38,.16); }
#employee-photo-section:focus { outline: 3px solid rgba(37,99,235,.15); outline-offset: 3px; border-radius: 8px; }
.status-badge i { width: 7px; height: 7px; border-radius: 50%; }
.user-status-disponivel { color: var(--success); background: var(--success-soft); }
.user-status-disponivel i { background: var(--success); }
.user-status-atendimento { color: var(--primary); background: var(--primary-soft); }
.user-status-atendimento i { background: var(--primary); }
.user-status-pausa { color: var(--purple); background: var(--purple-soft); }
.user-status-pausa i { background: var(--purple); }
.user-status-offline { color: var(--muted); background: var(--surface-3); }
.user-status-offline i { background: var(--muted); }
.employee-detail-panel { padding-bottom: 16px; }
.employee-form { padding: 16px 18px 0; display: flex; flex-direction: column; gap: 12px; }
.unit-assignment { margin: 0; padding: 9px 10px 10px; border: 1px solid var(--border); border-radius: 8px; }
.unit-assignment legend { padding: 0 5px; color: var(--body); font-size: 10px; font-weight: 750; }
.unit-assignment > p { margin: 0 0 7px; color: var(--muted); font-size: 8px; }
.unit-assignment > div { display: flex; flex-wrap: wrap; gap: 7px; }
.unit-assignment label { min-height: 28px; display: inline-flex; align-items: center; gap: 6px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--body-2); background: var(--surface-2); font-size: 9px; }
.unit-assignment input { accent-color: var(--primary); }
.profile-color-row { display: flex; align-items: center; gap: 15px; padding-bottom: 4px; }
.color-field { flex: 1; }
.color-field input[type="color"] { padding: 4px; }
.setting-toggle { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.setting-toggle > span { min-width: 0; display: flex; flex-direction: column; }
.setting-toggle strong { font-size: 11px; }
.setting-toggle small { max-width: 590px; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.setting-toggle input[type="checkbox"] { appearance: none; position: relative; width: 40px; height: 22px; flex: 0 0 40px; border-radius: 999px; background: #b8c2ce; transition: .18s ease; }
.setting-toggle input[type="checkbox"]::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.18); transition: .18s ease; }
.setting-toggle input[type="checkbox"]:checked { background: var(--success); }
.setting-toggle input[type="checkbox"]:checked::after { transform: translateX(18px); }
.compact-toggle { padding: 12px 0; }
.compact-toggle strong { font-size: 10px; }
.split-actions { justify-content: space-between; }

.reports-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 14px; }
.report-volume-card { min-height: 335px; }
.category-card { min-height: 335px; }
.progress-list { padding: 15px 18px; }
.progress-list > div { margin-bottom: 15px; }
.progress-list > div:last-child { margin-bottom: 0; }
.progress-list span { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.progress-list strong { font-size: 10px; }
.progress-list em { color: var(--muted); font-size: 9px; font-style: normal; }
.progress-list i { height: 7px; display: block; overflow: hidden; border-radius: 999px; background: var(--surface-3); }
.progress-list b { height: 100%; display: block; border-radius: 999px; background: linear-gradient(90deg, #3b82f6, #2563eb); }
.agent-ranking-card, .insights-card { min-height: 340px; }
.ranking-list > div { display: grid; grid-template-columns: 25px 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px 17px; border-bottom: 1px solid var(--border); }
.ranking-list > div:last-child { border-bottom: 0; }
.ranking-list > div > b { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-size: 9px; }
.ranking-list > div > span:nth-child(3) { min-width: 0; display: flex; flex-direction: column; }
.ranking-list strong { font-size: 10px; }
.ranking-list small { color: var(--muted); font-size: 8px; }
.ranking-list em { color: var(--success); font-size: 9px; font-style: normal; font-weight: 750; }
.insight-list { padding: 6px 18px 16px; }
.insight-list article { display: flex; gap: 11px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.insight-list article:last-child { border-bottom: 0; }
.insight-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border-radius: 10px; font-style: normal; font-weight: 850; }
.red-bg { color: var(--danger); background: var(--danger-soft); }
.blue-bg { color: var(--primary); background: var(--primary-soft); }
.green-bg { color: var(--success); background: var(--success-soft); }
.insight-list article > span { display: flex; flex-direction: column; }
.insight-list strong { font-size: 10px; }
.insight-list small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }

.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); align-items: start; gap: 14px; }
.settings-nav { position: sticky; top: calc(var(--topbar-height) + 20px); overflow: hidden; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 14px; border-bottom: 1px solid var(--border); color: var(--muted); }
.settings-nav a:last-child { border-bottom: 0; }
.settings-nav a:hover { color: var(--body); background: var(--surface-2); }
.settings-nav a.active { color: var(--primary); background: var(--primary-soft); }
.settings-nav a > span { display: flex; flex-direction: column; }
.settings-nav strong { font-size: 10px; }
.settings-nav small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.settings-content { display: flex; flex-direction: column; gap: 14px; }
.settings-section { padding-bottom: 18px; }
.settings-section > .setting-toggle, .settings-section > .field, .settings-section > .integration-grid, .settings-section > .alert-box, .settings-section > .rule-list { margin-left: 19px; margin-right: 19px; }
.settings-section > .field { margin-top: 15px; }
.modern-rules { margin-top: 14px; }
.rule-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rule-list > div { display: flex; align-items: flex-start; gap: 9px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.rule-list > div > span { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 25px; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-size: 9px; font-weight: 850; }
.rule-list p { margin: 0; display: flex; flex-direction: column; }
.rule-list strong { font-size: 9px; }
.rule-list small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.integration-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.integration-grid > div { display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.integration-grid span { color: var(--muted); font-size: 8px; }
.integration-grid strong { margin-top: 4px; overflow-wrap: anywhere; font-size: 10px; }
.sticky-save { position: sticky; bottom: 10px; display: flex; justify-content: flex-end; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: color-mix(in srgb, var(--surface) 92%, transparent); box-shadow: var(--shadow-lg); backdrop-filter: blur(14px); }

.alert-box { margin: 13px 17px; padding: 11px 12px; border: 1px solid transparent; border-radius: 8px; font-size: 10px; }
.alert-box.success { color: #166b35; background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 20%, transparent); }
.alert-box.danger { color: #a91d25; background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 20%, transparent); }
.alert-box.info { color: #1c5ea9; background: var(--primary-soft); border-color: color-mix(in srgb, var(--primary) 18%, transparent); }
.empty-inline { min-height: 92px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); }
.empty-inline > span { display: flex; flex-direction: column; }
.empty-inline strong { color: var(--body); font-size: 10px; }
.empty-inline small { font-size: 8px; }

.app-toast-region { position: fixed; z-index: 100; left: 24px; bottom: 24px; width: min(520px, calc(100vw - 30px)); display: flex; flex-direction: column-reverse; gap: 10px; pointer-events: none; }
.app-toast-item { --toast-duration: 4200ms; position: relative; width: 100%; min-height: 58px; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 13px; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; color: #fff; background: linear-gradient(135deg, #18283f, #223b5c); box-shadow: 0 22px 55px rgba(15,23,42,.28), 0 8px 18px rgba(15,23,42,.18); opacity: 0; transform: translate3d(-48px, 0, 0) scale(.975); pointer-events: none; transition: opacity .46s ease, transform .46s cubic-bezier(.2,.8,.2,1); }
.app-toast-item.visible { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
.app-toast-item.leaving { opacity: 0; transform: translate3d(-32px, 0, 0) scale(.98); }
.app-toast-item[data-actionable="true"] { pointer-events: auto; }
.app-toast-icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.22); border-radius: 12px; background: rgba(255,255,255,.14); font-size: 20px; font-weight: 850; line-height: 1; }
.app-toast-item .app-toast-avatar { border-radius: 50%; color: var(--avatar-foreground, #fff); background-color: var(--avatar-color, #2563eb); background-image: var(--avatar-image, linear-gradient(145deg, color-mix(in srgb, var(--avatar-color, #2563eb) 72%, white), var(--avatar-color, #2563eb))); background-position: center; background-size: cover; background-repeat: no-repeat; font-size: 12px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.38), 0 5px 12px rgba(5,19,43,.18); }
.app-toast-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-toast-title { font-size: 12px; font-weight: 850; letter-spacing: -.01em; }
.app-toast-message { overflow-wrap: anywhere; font-size: 11px; font-weight: 700; line-height: 1.35; }
.app-toast-detail { color: rgba(255,255,255,.8); font-size: 9px; font-weight: 550; line-height: 1.35; }
.app-toast-action { min-height: 34px; padding: 0 12px; border: 1px solid rgba(255,255,255,.34); border-radius: 9px; color: #fff; background: rgba(255,255,255,.13); font: inherit; font-size: 10px; font-weight: 800; white-space: nowrap; }
.app-toast-action:hover { background: rgba(255,255,255,.23); }
.app-toast-action:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.app-toast-progress { position: absolute; right: 0; bottom: 0; left: 0; height: 3px; background: rgba(255,255,255,.72); transform: scaleX(0); transform-origin: left; }
.app-toast-item.visible .app-toast-progress { animation: app-toast-countdown var(--toast-duration) linear forwards; }
.app-toast-item.prominent { min-height: 108px; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 15px; padding: 17px 17px 18px; border-radius: 18px; }
.app-toast-item.prominent .app-toast-icon { width: 54px; height: 54px; border-radius: 16px; font-size: 27px; }
.app-toast-item.prominent .app-toast-avatar { border-radius: 50%; font-size: 15px; }
.app-toast-item.prominent .app-toast-copy { gap: 4px; }
.app-toast-item.prominent .app-toast-title { font-size: 14px; }
.app-toast-item.prominent .app-toast-message { font-size: 12px; }
.app-toast-item.prominent .app-toast-detail { font-size: 10px; }
.app-toast-item.success { background: linear-gradient(135deg, #08783d, #12a258); }
.app-toast-item.error { background: linear-gradient(135deg, #a91620, #d3313b); }
.app-toast-item.info { background: linear-gradient(135deg, #084daf, #1673eb); }
.app-toast-item.warning { background: linear-gradient(135deg, #8b4800, #c97508); }
@keyframes app-toast-countdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) {
    .app-toast-item { transform: none; transition-duration: .01ms; }
    .app-toast-item.visible .app-toast-progress { animation: none; transform: scaleX(1); }
}
.sidebar-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 45; display: none; background: rgba(8,16,28,.58); opacity: 0; pointer-events: none; transition: .18s ease; }
.modal-backdrop { z-index: 80; display: block; }
.modal-backdrop.visible { opacity: 1; pointer-events: auto; }
.app-modal { position: fixed; z-index: 90; top: 50%; left: 50%; width: min(540px, calc(100vw - 28px)); max-height: 82vh; display: none; overflow: hidden; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); transform: translate(-50%, -47%); opacity: 0; transition: .18s ease; }
.app-modal.visible { display: block; opacity: 1; transform: translate(-50%, -50%); }
.app-modal > header { display: flex; justify-content: space-between; gap: 10px; padding: 17px 18px; border-bottom: 1px solid var(--border); }
.app-modal h2 { margin: 0; font-size: 16px; }
.app-modal header button { width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; color: var(--muted); background: var(--surface-3); }
.modal-body { max-height: calc(82vh - 70px); overflow-y: auto; padding: 16px 18px 18px; }
.modal-body > p { margin: 0 0 12px; color: var(--muted); font-size: 10px; }
.confirmation-modal { width: min(460px, calc(100vw - 28px)); }
.confirmation-modal .modal-body { display: grid; justify-items: center; padding: 22px 24px 18px; text-align: center; }
.confirmation-modal .modal-body > p { color: var(--body-2); font-size: 12px; line-height: 1.5; }
.confirmation-symbol { width: 54px; height: 54px; display: grid; place-items: center; margin-bottom: 15px; border-radius: 50%; color: var(--danger); background: var(--danger-soft); }
.confirmation-modal .modal-feedback { min-height: 36px; margin: 5px 0 0; color: var(--muted); font-size: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 13px 18px 17px; border-top: 1px solid var(--border); }
.modal-actions button { min-width: 126px; }
.modal-actions button[aria-busy="true"] { cursor: wait; opacity: .75; }
.transfer-list { display: flex; flex-direction: column; gap: 7px; }
.transfer-option { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--body); background: var(--surface); text-align: left; }
.transfer-option:not(:disabled):hover { border-color: #8bb5fb; background: var(--primary-soft); }
.transfer-option > span:nth-child(2) { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.transfer-option strong { font-size: 10px; }
.transfer-option small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.transfer-option em { color: var(--primary); font-size: 9px; font-style: normal; font-weight: 750; }
.transfer-option:disabled em { color: var(--muted); }

.login-body { min-height: 100vh; background: #f5f7fb; }
.login-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(520px, 1.08fr) minmax(420px, .92fr); }
.login-hero { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 34px 48px 42px; overflow: hidden; color: #fff; background: radial-gradient(circle at 70% 25%, rgba(48,116,241,.42), transparent 30%), linear-gradient(145deg, #0d1b2e, #10284c); }
.login-hero::after { content: ""; position: absolute; width: 420px; height: 420px; right: -160px; bottom: -180px; border: 70px solid rgba(79,141,250,.1); border-radius: 50%; }
.login-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 12px; }
.login-brand > span:last-child { display: flex; flex-direction: column; }
.login-brand strong { font-size: 19px; }
.login-brand small { color: #b7c7da; font-size: 12px; }
.login-visual { position: relative; z-index: 1; width: min(620px, 100%); height: 310px; margin: 15px auto; }
.login-chat-demo { position: absolute; inset: 38px 60px 25px 40px; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 18px; background: rgba(255,255,255,.96); box-shadow: 0 30px 70px rgba(0,0,0,.28); transform: rotate(-1.5deg); }
.login-chat-demo header { display: flex; align-items: center; gap: 9px; padding: 12px 14px; color: #17243a; border-bottom: 1px solid #e2e8f0; }
.login-chat-demo header > span:last-child { display: flex; flex-direction: column; }
.login-chat-demo header strong { font-size: 11px; }
.login-chat-demo header small { color: #718096; font-size: 8px; }
.login-chat-demo > div { height: 210px; padding: 22px; background: #f3f0ea; }
.login-chat-demo p { width: fit-content; max-width: 75%; margin: 0 0 13px; padding: 10px 12px; border-radius: 10px; color: #213047; background: #fff; font-size: 10px; box-shadow: 0 3px 8px rgba(0,0,0,.08); }
.login-chat-demo p.sent { margin-left: auto; background: #d9f8d2; }
.floating-card { position: absolute; z-index: 3; display: flex; align-items: center; gap: 9px; padding: 11px 13px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; color: #17243a; background: rgba(255,255,255,.98); box-shadow: 0 18px 35px rgba(0,0,0,.24); }
.floating-card i { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: #eaf2ff; }
.floating-card span { display: flex; flex-direction: column; }
.floating-card strong { font-size: 10px; }
.floating-card small { color: #718096; font-size: 8px; }
.card-a { top: 3px; right: 13px; }
.card-b { bottom: 3px; left: 0; }
.hero-copy { position: relative; z-index: 1; max-width: 620px; }
.hero-copy .eyebrow { color: #84adff; }
.hero-copy h1 { max-width: 600px; margin: 0; font-size: clamp(29px, 3vw, 43px); line-height: 1.08; letter-spacing: -.035em; }
.hero-copy p { max-width: 550px; margin: 13px 0 0; color: #b9c8da; font-size: 13px; line-height: 1.6; }
.hero-points { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 15px; margin-top: 18px; }
.hero-points span { display: inline-flex; align-items: center; gap: 6px; color: #d8e4f1; font-size: 10px; }
.hero-points .ui-icon { color: #63e993; }
.login-panel { display: grid; place-items: center; padding: 32px; background: #f5f7fb; }
.login-card { width: min(420px, 100%); padding: 31px; border: 1px solid #dfe5ed; border-radius: 16px; background: #fff; box-shadow: 0 22px 55px rgba(31,45,70,.1); }
.login-card-header { margin-bottom: 20px; }
.login-card-header h2 { margin: 0; color: #152033; font-size: 24px; letter-spacing: -.03em; }
.login-card-header p { margin: 6px 0 0; color: #728097; font-size: 11px; }
.login-card .field { margin-bottom: 13px; }
.login-card .field > span { color: #2c3950; }
.login-card .field input { color: #152033; background: #fff; }
.login-submit { min-height: 44px; margin-top: 5px; justify-content: space-between; padding: 0 16px; }
.mobile-login-brand { display: none; }
.setup-body { display: grid; place-items: center; padding: 32px; background: radial-gradient(circle at 15% 15%, rgba(37,99,235,.1), transparent 28%), #f5f7fb; }
.setup-shell { width: min(760px, 100%); }
.setup-card { width: 100%; padding: 36px; }
.setup-card .mobile-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; color: #152033; }
.setup-card .login-card-header h1 { margin: 0; color: #152033; font-size: 28px; letter-spacing: -.035em; }
.setup-card .login-card-header p { max-width: 610px; font-size: 12px; line-height: 1.6; }

@media (max-width: 1450px) {
    .service-workspace { grid-template-columns: 285px minmax(400px, 1fr) 300px; }
    .chat-actions .action-button { padding: 0 8px; }
    .clients-layout { grid-template-columns: 250px minmax(430px, 1fr) 255px; }
}

@media (max-width: 1250px) {
    :root { --sidebar-width: 238px; }
    .api-state { display: none; }
    .service-workspace { grid-template-columns: 285px minmax(410px, 1fr); }
    .customer-panel { display: none; }
    .clients-layout { grid-template-columns: 255px minmax(0, 1fr); }
    .client-history-panel { grid-column: 1 / -1; min-height: auto; }
    .timeline-list { display: grid; grid-template-columns: repeat(3, 1fr); }
    .timeline-list a, .timeline-list .timeline-static { border-right: 1px solid var(--border); }
    .employees-layout { grid-template-columns: minmax(570px, 1fr) 340px; }
}

@media (max-width: 1050px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid, .reports-grid { grid-template-columns: 1fr; }
    .employees-layout { grid-template-columns: 1fr; }
    .employee-detail-panel { max-width: none; }
    .automation-row { grid-template-columns: 1fr; }
    .login-layout { grid-template-columns: 1fr; }
    .login-hero { display: none; }
    .login-panel { min-height: 100vh; }
    .mobile-login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 25px; color: #152033; }
}

@media (max-width: 620px) {
    .setup-body { padding: 18px; }
    .setup-card { padding: 24px; }
    .setup-card .form-grid.two-columns { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    :root { --sidebar-width: 268px; }
    .app-sidebar { transform: translateX(-101%); transition: transform .2s ease; box-shadow: 16px 0 40px rgba(0,0,0,.2); }
    .app-sidebar.open { transform: translateX(0); }
    .app-content { width: 100%; margin-left: 0; }
    .menu-button { display: grid; }
    .sidebar-backdrop { display: block; }
    .sidebar-backdrop.visible { opacity: 1; pointer-events: auto; }
    .app-topbar { padding: 0 13px; }
    .global-search { width: min(360px, 52vw); }
    .top-status, .top-user-copy, .top-logout { display: none; }
    .page-main { padding: 17px 13px 24px; }
    .service-workspace { grid-template-columns: 280px minmax(420px, 1fr); overflow-x: auto; }
    .conversation-panel, .chat-panel { height: 680px; }
    .clients-layout { grid-template-columns: 230px minmax(480px, 1fr); overflow-x: auto; }
    .settings-layout { grid-template-columns: 1fr; }
    .settings-nav { position: static; display: grid; grid-template-columns: repeat(2, 1fr); }
    .rule-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
    .global-search { width: 42px; padding: 0 11px; }
    .global-search input, .global-search kbd { display: none; }
    .notification-button { display: grid; }
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
    .metric-card { min-height: 96px; padding: 13px; gap: 10px; }
    .metric-icon { width: 42px; height: 42px; flex-basis: 42px; }
    .metric-card strong { font-size: 20px; }
    .metric-card small { display: none; }
    .page-heading h1 { font-size: 19px; }
    .service-workspace { grid-template-columns: 1fr; overflow: visible; }
    .conversation-panel { height: auto; min-height: 420px; }
    .chat-panel { height: 680px; min-height: 680px; }
    .chat-actions .action-button { font-size: 0; width: 34px; padding: 0; }
    .chat-actions .action-button .ui-icon { width: 16px; height: 16px; }
    .message-bubble { max-width: 88%; }
    .clients-layout { display: flex; flex-direction: column; overflow: visible; }
    .client-list-panel, .client-history-panel { min-height: auto; }
    .client-list { max-height: 380px; }
    .client-detail-header { align-items: flex-start; flex-direction: column; }
    .form-grid.two-columns, .form-grid.three-columns, .integration-grid { grid-template-columns: 1fr; }
    .timeline-list { grid-template-columns: 1fr; }
    .employees-table-panel { overflow-x: auto; }
    .employee-detail-panel { min-width: 0; }
    .automation-card, .next-queue-card { align-items: flex-start; flex-direction: column; }
    .automation-card > a { margin-left: 0; }
    .next-queue-card > span { width: 100%; }
    .settings-nav { grid-template-columns: 1fr; }
    .login-panel { padding: 18px; }
    .login-card { padding: 23px; }
    .app-toast-region { left: 12px; bottom: 12px; width: calc(100vw - 24px); }
    .app-toast-item,
    .app-toast-item.prominent { grid-template-columns: 44px minmax(0, 1fr); min-height: 92px; padding: 14px; }
    .app-toast-action { grid-column: 1 / -1; width: 100%; }
}

@media print {
    .app-sidebar, .app-topbar, .page-heading, .secondary-button, .primary-button, .sidebar-backdrop, .app-toast-region { display: none !important; }
    .app-content { width: 100%; margin: 0; }
    .page-main { padding: 0; }
    .panel-card, .metric-card { box-shadow: none; break-inside: avoid; }
}

/* Rework visual 2026: layout claro, compacto e sem rolagem global no desktop. */
:root {
    --sidebar-width: 272px;
    --topbar-height: 64px;
    --primary: #1265f3;
    --primary-strong: #0754d8;
    --primary-soft: #eaf2ff;
    --success: #16a34a;
    --success-soft: #eaf8ee;
    --warning: #f59e0b;
    --warning-soft: #fff7e5;
    --danger: #e22d32;
    --danger-soft: #fff0f1;
    --purple: #7342dc;
    --purple-soft: #f2edff;
    --orange: #ff7a00;
    --orange-soft: #fff1e2;
    --surface: #ffffff;
    --surface-2: #f7f9fc;
    --surface-3: #eef2f7;
    --surface-4: #e5eaf1;
    --body: #111827;
    --body-2: #344054;
    --muted: #667085;
    --border: #dfe5ed;
    --border-strong: #cbd5e1;
    --sidebar: #071a33;
    --sidebar-2: #0a213f;
    --sidebar-text: #c7d2e1;
    --shadow: 0 1px 2px rgba(16, 24, 40, .035), 0 8px 24px rgba(16, 24, 40, .035);
    --shadow-lg: 0 18px 55px rgba(16, 24, 40, .16);
    --radius: 12px;
    --radius-sm: 8px;
}

html,
body {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    background: #f8fafc;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
a,
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

.app-shell { min-height: 100dvh; }
.app-sidebar {
    padding: 17px 10px 12px;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(circle at 35% 0, rgba(25, 104, 225, .16), transparent 24%),
        linear-gradient(180deg, #06172d 0%, #071b34 58%, #06203d 100%);
}
.brand { min-height: 46px; padding: 0 10px 22px; }
.brand-mark { width: 38px; height: 38px; flex-basis: 38px; border-radius: 10px; }
.brand-copy { white-space: nowrap; }
.brand-copy strong { font-size: 17px; font-weight: 760; }
.brand-copy strong span { margin-left: 4px; font-weight: 520; }
.sidebar-nav { gap: 6px; }
.sidebar-nav a { min-height: 47px; padding: 0 13px; border-radius: 8px; font-size: 14px; font-weight: 530; }
.sidebar-nav a.active { background: linear-gradient(100deg, #0e64f4, #2377f7); box-shadow: 0 9px 24px rgba(14, 100, 244, .28); }
.nav-badge { color: #fff; background: rgba(255,255,255,.16); }
.sidebar-queue-card { margin-top: auto; background: rgba(255,255,255,.025); border-color: rgba(255,255,255,.14); }
.sidebar-queue-card header strong { font-size: 13px; }
.sidebar-queue-card header span { border-radius: 999px; background: linear-gradient(135deg, #18b761, #0e8e49); }
.sidebar-queue-card a { padding: 8px 0; }
.sidebar-auto-card { padding: 12px; background: rgba(255,255,255,.025); border-color: rgba(255,255,255,.12); }
.sidebar-footer { justify-content: center; padding-top: 15px; color: #9aabc0; font-size: 10px; }

.app-content { min-height: 100dvh; overflow: visible; }
.app-topbar {
    height: var(--topbar-height);
    padding: 0 22px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 1px 0 rgba(16,24,40,.02);
}
.menu-button { display: grid; color: #344054; }
.global-search { width: min(620px, 46vw); height: 40px; border-color: #d7dee8; background: #fff; }
.global-search input { font-size: 12px; }
.topbar-actions { gap: 12px; }
.notification-button { color: #344054; }
.top-user { gap: 10px; padding-left: 14px; border-left: 1px solid var(--border); }
.top-user-copy { min-width: 178px; }
.top-user-copy strong { max-width: 260px; color: #111827; font-size: 12px; }
.top-user-copy strong span { font-weight: 540; }
.top-status { min-height: 18px; gap: 6px; padding: 0; border: 0; background: transparent; }
.top-status .status-dot { width: 7px; height: 7px; box-shadow: none; }
.top-status select { max-width: 125px; padding: 0 18px 0 0; color: var(--muted); font-size: 10px; font-weight: 520; }
.top-logout { color: #344054; }

.page-main {
    min-height: calc(100dvh - var(--topbar-height));
    padding: 15px 20px 18px;
    overflow: visible;
}
.page-heading { margin-bottom: 13px; }
.page-heading h1 { font-size: 22px; }
.page-heading p { margin-top: 4px; font-size: 11px; }
body[data-page="dashboard"] .page-heading,
body[data-page="atendimentos"] .page-heading,
body[data-page="usuarios"] .page-heading { display: none; }

.avatar {
    overflow: hidden;
    color: var(--avatar-foreground, #fff);
    background-color: var(--avatar-color, var(--primary));
    background-image: var(--avatar-image, linear-gradient(145deg, color-mix(in srgb, var(--avatar-color, var(--primary)) 72%, white), var(--avatar-color, var(--primary))));
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,.66), 0 1px 4px rgba(16,24,40,.12);
}
.avatar > .ui-icon { display: block; width: 48%; height: 48%; stroke-width: 1.9; }

.metric-grid { gap: 14px; margin-bottom: 14px; }
.metric-card {
    min-height: 104px;
    gap: 15px;
    padding: 15px 18px;
    border-color: #e0e5ec;
    border-radius: 11px;
    box-shadow: 0 1px 2px rgba(16,24,40,.025), 0 5px 18px rgba(16,24,40,.025);
}
.metric-icon { width: 54px; height: 54px; flex-basis: 54px; border-radius: 16px; }
.metric-card > div { display: flex; align-items: flex-start; justify-content: center; flex-direction: column; }
.metric-card span:not(.metric-icon) { font-size: 11px; }
.metric-card strong { margin-top: 3px; font-size: 25px; }
.metric-card small { margin-top: 5px; font-size: 9px; }
.compact-metrics .metric-card { min-height: 104px; padding: 15px 18px; }
.compact-metrics .metric-icon { width: 54px; height: 54px; flex-basis: 54px; }
.compact-metrics .metric-card strong { font-size: 25px; }

.panel-card { border-color: #e0e5ec; border-radius: 11px; box-shadow: var(--shadow); }
.panel-heading { min-height: 58px; padding: 13px 17px; }
.panel-heading h2 { font-size: 14px; }
.eyebrow { margin-bottom: 3px; font-size: 8px; }
.primary-button,
.secondary-button,
.ghost-button,
.action-button,
.table-action { border-radius: 7px; }
.primary-button { background: linear-gradient(135deg, #1671f8, #0d5ee8); }

body[data-page="dashboard"] .dashboard-grid {
    height: calc(100dvh - var(--topbar-height) - 151px);
    min-height: 0;
    grid-template-rows: minmax(0, 1.16fr) minmax(0, .84fr);
}
body[data-page="dashboard"] .dashboard-grid > .panel-card { min-height: 0; overflow: hidden; }
.chart-card,
.team-overview,
.recent-card,
.queue-preview { min-height: 0; }
.premium-bar-chart { height: calc(100% - 101px); min-height: 135px; padding-top: 10px; }
.team-status-grid { padding: 12px 12px 9px; }
.status-circle { width: 43px; height: 43px; background: #fff !important; border: 2px solid currentColor; }
.compact-team-list { height: calc(100% - 116px); overflow: hidden; }
.compact-team-list > div { padding: 4px 14px; }
.compact-team-list .avatar-xs { width: 30px; height: 30px; flex-basis: 30px; }
.recent-list,
.queue-preview-list { height: calc(100% - 59px); overflow: hidden; }
.recent-list a,
.queue-preview-list a { padding-top: 8px; padding-bottom: 8px; }

body[data-page="atendimentos"] .service-workspace {
    height: calc(100dvh - var(--topbar-height) - 33px);
    min-height: 0;
    grid-template-columns: minmax(300px, .82fr) minmax(520px, 1.7fr) minmax(310px, .78fr);
}
.conversation-panel,
.chat-panel,
.customer-panel { height: 100%; min-height: 0; }
body[data-page="atendimentos"] .conversation-panel,
body[data-page="atendimentos"] .customer-panel {
    border-width: 1px;
    border-color: var(--border-strong);
}
.conversation-panel-header { min-height: 56px; }
.conversation-search { height: 38px; margin-top: 9px; }
.filter-tabs { flex: 0 0 auto; }
.conversation-item { padding: 10px 12px; }
.chat-header { min-height: 58px; }
.chat-messages {
    padding: 15px 14px;
    background-color: #faf9f6;
    background-image:
        radial-gradient(circle at 10px 10px, rgba(100,116,139,.055) 1px, transparent 1.2px),
        radial-gradient(circle at 22px 22px, rgba(100,116,139,.035) 1px, transparent 1.2px);
    background-size: 32px 32px;
}
.message-bubble { border: 1px solid rgba(148,163,184,.23); box-shadow: 0 2px 5px rgba(16,24,40,.045); }
.message-row.outgoing .message-bubble { border-color: #a9d89e; background: #e2f7dc; }
.channel-line { min-height: 32px; }
.chat-composer { min-height: 60px; padding: 8px 10px; }
.chat-composer textarea { min-height: 42px; background: #fff; }
.send-button { width: 46px; height: 42px; }
.customer-panel { overflow-y: auto; scrollbar-width: thin; }

@media (min-width: 1501px) {
    body[data-page="atendimentos"] .service-workspace {
        grid-template-rows: minmax(0, 2fr) minmax(225px, 1fr);
    }
    body[data-page="atendimentos"] .service-workspace > .conversation-panel {
        grid-column: 1;
        grid-row: 1;
        position: relative;
        z-index: 3;
    }
    body[data-page="atendimentos"] .chat-panel {
        --chat-l-notch: 343px;
        --chat-l-radius: 11px;
        --chat-l-border: var(--border-strong);
        --chat-l-message-bg: #faf9f6;
        --chat-l-message-pattern:
            radial-gradient(circle at 10px 10px, rgba(100,116,139,.055) 1px, transparent 1.2px),
            radial-gradient(circle at 22px 22px, rgba(100,116,139,.035) 1px, transparent 1.2px);
        --chat-l-top-offset: 74px;
        grid-column: 1 / 3;
        grid-row: 1 / 3;
        display: grid;
        grid-template-columns: 330px 13px minmax(0, 1fr);
        grid-template-rows: minmax(0, 2fr) 13px minmax(225px, 1fr);
        min-width: 0;
        min-height: 0;
        position: relative;
        z-index: 1;
        isolation: isolate;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    body[data-page="atendimentos"] .chat-panel::before {
        content: '';
        grid-column: 3;
        grid-row: 1 / 4;
        position: relative;
        z-index: 0;
        border: 1px solid var(--chat-l-border);
        border-radius: var(--chat-l-radius) var(--chat-l-radius) var(--chat-l-radius) 0;
        background-color: var(--chat-l-message-bg);
        background-image: var(--chat-l-message-pattern);
        background-size: 32px 32px;
        background-clip: border-box;
        opacity: 1;
        pointer-events: none;
    }
    body[data-page="atendimentos"] .chat-panel::after {
        content: '';
        grid-column: 1 / 3;
        grid-row: 3;
        position: relative;
        z-index: 1;
        margin-right: -1px;
        border: 1px solid var(--chat-l-border);
        border-right: 0;
        border-radius: var(--chat-l-radius) 0 0 var(--chat-l-radius);
        background-color: var(--chat-l-message-bg);
        background-image: var(--chat-l-message-pattern);
        background-size: 32px 32px;
        background-clip: border-box;
        opacity: 1;
        pointer-events: none;
    }
    body[data-page="atendimentos"] .chat-panel.chat-panel-empty::after { display: none; }
    body[data-page="atendimentos"] .chat-panel.chat-panel-empty::before {
        background: var(--surface);
    }
    body[data-page="atendimentos"] .chat-panel-top,
    body[data-page="atendimentos"] .chat-panel-expanded,
    body[data-page="atendimentos"] .chat-panel > .chat-empty {
        position: relative;
        z-index: 2;
    }
    body[data-page="atendimentos"] .chat-panel-top {
        grid-column: 3;
        grid-row: 1;
        align-self: start;
        min-width: 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        height: fit-content;
        margin: 1px;
        overflow: hidden;
        border-radius: calc(var(--chat-l-radius) - 1px) calc(var(--chat-l-radius) - 1px) 0 0;
        background: var(--surface);
        z-index: 3;
    }
    body[data-page="atendimentos"] .chat-panel-expanded {
        grid-column: 1 / -1;
        grid-row: 1 / 4;
        grid-template-columns: 330px 13px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto auto;
        min-width: 0;
        min-height: 0;
        display: grid;
        margin: 0;
    }
    body[data-page="atendimentos"] .chat-panel-top.has-chat-status + .chat-panel-expanded {
        --chat-l-top-offset: 108px;
    }
    body[data-page="atendimentos"] .chat-panel-top.has-chat-notice + .chat-panel-expanded {
        --chat-l-top-offset: 112px;
    }
    body[data-page="atendimentos"] .chat-panel-top.has-chat-notice.has-chat-status + .chat-panel-expanded {
        --chat-l-top-offset: 146px;
    }
    body[data-page="atendimentos"] .chat-messages {
        grid-column: 1 / -1;
        grid-row: 1;
        position: relative;
        z-index: 1;
        min-height: 0;
        margin: var(--chat-l-top-offset) 1px 0;
        background: transparent;
        overflow-y: scroll;
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }
    body[data-page="atendimentos"] .chat-messages > .chat-l-row-inset {
        margin-left: calc(var(--chat-l-notch) - 1px);
    }
    body[data-page="atendimentos"] .chat-messages > .message-row:not(.chat-l-row-inset) .message-bubble {
        max-width: min(72%, 820px);
    }
    body[data-page="atendimentos"] .channel-line {
        grid-column: 1 / -1;
        grid-row: 2;
        position: relative;
        z-index: 2;
        margin: 0 1px;
    }
    body[data-page="atendimentos"] .chat-composer {
        grid-column: 1 / -1;
        grid-row: 3;
        position: relative;
        z-index: 2;
        margin: 0 1px 1px;
        border-radius: 0 0 calc(var(--chat-l-radius) - 1px) calc(var(--chat-l-radius) - 1px);
    }
    body[data-page="atendimentos"] .chat-composer .composer-popover {
        left: calc(var(--chat-l-notch) + 12px);
        width: min(330px, calc(100% - var(--chat-l-notch) - 36px));
    }
    body[data-page="atendimentos"] .customer-panel {
        grid-column: 3;
        grid-row: 1 / 3;
    }
    body[data-page="atendimentos"] .chat-panel > .chat-empty {
        grid-column: 3;
        grid-row: 1 / 4;
        margin: 1px;
        border-radius: calc(var(--chat-l-radius) - 1px);
        background: var(--surface);
    }
}

body[data-page="fila"] .metric-card { min-height: 101px; }
body[data-page="fila"] .automation-row { height: 112px; margin-bottom: 14px; }
.automation-card,
.next-queue-card { min-height: 112px; padding: 14px 17px; }
.automation-card > a { min-height: 31px; margin-left: 56px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; background: #fff; }
body[data-page="fila"] .queue-table-card {
    height: calc(100dvh - var(--topbar-height) - 333px);
    min-height: 270px;
    display: flex;
    flex-direction: column;
}
.queue-table-card .panel-heading { flex: 0 0 auto; }
.queue-table-card .table-wrap { min-height: 0; flex: 1; overflow: auto; scrollbar-width: thin; }
.compact-select select { height: 36px; padding: 0 30px 0 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--body-2); background: #fff; font-size: 10px; }
.data-table th { position: sticky; top: 0; z-index: 2; background: #fbfcfe; }
.data-table td { padding-top: 9px; padding-bottom: 9px; }
.table-footer { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 14px; border-top: 1px solid var(--border); color: var(--muted); background: #fff; font-size: 9px; }
.table-footer nav { display: flex; align-items: center; gap: 5px; }
.table-footer button { min-width: 31px; height: 31px; padding: 0 9px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: #fff; font-size: 9px; }
.table-footer button.active { color: #fff; border-color: var(--primary); background: var(--primary); }

body[data-page="clientes"] .clients-layout {
    height: calc(100dvh - var(--topbar-height) - 92px);
    min-height: 0;
    grid-template-columns: 280px minmax(520px, 1fr) 285px;
}
.client-list-panel,
.client-detail-panel,
.client-history-panel { height: 100%; min-height: 0; }
.client-list-panel { display: flex; flex-direction: column; }
.client-list { min-height: 0; max-height: none; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.client-detail-panel { overflow-y: auto; scrollbar-width: thin; }
.client-history-panel { overflow-y: auto; scrollbar-width: thin; }
.client-list-item { padding-top: 9px; padding-bottom: 9px; }
.client-detail-header { padding: 14px 17px; }
.client-form { padding: 0 17px; }
.form-section { padding: 13px 0; }

body[data-page="usuarios"] .employees-layout {
    height: calc(100dvh - var(--topbar-height) - 151px);
    min-height: 0;
    grid-template-columns: minmax(680px, 1fr) 390px;
}
.employees-table-panel { height: 100%; display: flex; flex-direction: column; }
.employees-table-panel .panel-heading,
.employees-table-panel .table-toolbar,
.employees-table-panel .table-footer { flex: 0 0 auto; }
.employees-table-panel .table-wrap { min-height: 0; flex: 1; overflow: auto; scrollbar-width: thin; }
.employee-detail-panel { height: 100%; overflow-y: auto; scrollbar-width: thin; }
.employee-form { gap: 9px; padding-top: 12px; }
.profile-photo-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) 58px; align-items: center; gap: 12px; padding-bottom: 4px; }
.profile-photo-row > div { display: flex; align-items: flex-start; flex-direction: column; gap: 5px; }
.profile-photo-row > div > strong { font-size: 10px; }
.profile-photo-row > div > small { color: var(--muted); font-size: 8px; }
.photo-upload { min-height: 31px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--body-2); background: #fff; font-size: 9px; font-weight: 700; cursor: pointer; }
.photo-upload:hover { color: var(--primary); border-color: #9fc0fa; background: var(--primary-soft); }
.photo-upload input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.profile-photo-row .color-field { width: 58px; }
.profile-photo-row .color-field > span { font-size: 8px; }
.profile-photo-row .color-field input[type="color"] { height: 31px; min-height: 31px; }

body[data-page="relatorios"] .reports-grid {
    height: calc(100dvh - var(--topbar-height) - 210px);
    min-height: 0;
    grid-template-rows: repeat(2, minmax(0, 1fr));
}
.reports-grid > .panel-card { min-height: 0; overflow: hidden; }
.report-volume-card,
.category-card,
.agent-ranking-card,
.insights-card { min-height: 0; }
.progress-list,
.ranking-list,
.insight-list { max-height: calc(100% - 59px); overflow-y: auto; scrollbar-width: thin; }

body[data-page="configuracoes"] .settings-layout { height: calc(100dvh - var(--topbar-height) - 92px); min-height: 0; }
body[data-page="configuracoes"] .settings-nav { top: 0; }
body[data-page="configuracoes"] .settings-content { height: 100%; overflow-y: auto; padding-right: 3px; scrollbar-width: thin; }

.login-body { overflow: auto; }
.login-card { box-shadow: 0 24px 70px rgba(16,24,40,.11); }

@media (max-width: 1500px) {
    body[data-page="atendimentos"] .service-workspace { grid-template-columns: 285px minmax(480px, 1fr) 300px; }
    body[data-page="clientes"] .clients-layout { grid-template-columns: 255px minmax(470px, 1fr) 260px; }
    body[data-page="usuarios"] .employees-layout { grid-template-columns: minmax(600px, 1fr) 350px; }
}

@media (max-width: 1320px) {
    body[data-page="atendimentos"] .service-workspace { grid-template-columns: 285px minmax(470px, 1fr); }
    .customer-panel { display: none; }
    body[data-page="clientes"] .clients-layout { grid-template-columns: 250px minmax(0, 1fr); }
    .client-history-panel { display: none; }
    .top-user-copy { min-width: 145px; }
}

@media (max-width: 1100px) {
    html,
    body { height: auto; min-height: 100%; overflow: auto; }
    .app-shell,
    .app-content { height: auto; min-height: 100vh; overflow: visible; }
    .page-main { height: auto; min-height: calc(100vh - var(--topbar-height)); overflow: visible; }
    body[data-page="dashboard"] .dashboard-grid,
    body[data-page="atendimentos"] .service-workspace,
    body[data-page="fila"] .queue-table-card,
    body[data-page="clientes"] .clients-layout,
    body[data-page="usuarios"] .employees-layout,
    body[data-page="relatorios"] .reports-grid,
    body[data-page="configuracoes"] .settings-layout { height: auto; min-height: 0; }
    body[data-page="dashboard"] .dashboard-grid,
    body[data-page="relatorios"] .reports-grid { grid-template-rows: none; }
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-grid,
    .reports-grid,
    .employees-layout { grid-template-columns: 1fr !important; }
    .employee-detail-panel { max-height: none; }
}

@media (max-width: 860px) {
    .app-content { min-height: 100vh; }
    .app-topbar { padding: 0 12px; }
    .global-search { width: min(430px, 55vw); }
    .top-user { border-left: 0; padding-left: 0; }
    .top-user-copy,
    .top-logout { display: none; }
    .page-main { padding: 14px 12px 22px; }
    body[data-page="atendimentos"] .service-workspace { display: flex; overflow: visible; flex-direction: column; }
    .conversation-panel { height: auto; min-height: 460px; }
    .chat-panel { height: 680px; }
    body[data-page="clientes"] .clients-layout { display: flex; overflow: visible; flex-direction: column; }
    .client-list-panel { height: auto; }
    .client-list { max-height: 390px; }
    .settings-layout { grid-template-columns: 1fr; }
}

@media (min-width: 1101px) and (max-height: 760px) {
    body[data-page] .page-main { min-height: 696px; }
    body[data-page="dashboard"] .dashboard-grid,
    body[data-page="atendimentos"] .service-workspace,
    body[data-page="fila"] .queue-table-card,
    body[data-page="clientes"] .clients-layout,
    body[data-page="usuarios"] .employees-layout,
    body[data-page="relatorios"] .reports-grid,
    body[data-page="configuracoes"] .settings-layout { height: auto; }
    body[data-page="dashboard"] .dashboard-grid,
    body[data-page="relatorios"] .reports-grid { grid-template-rows: none; }
    body[data-page="atendimentos"] .service-workspace,
    body[data-page="usuarios"] .employees-layout { min-height: 620px; }
    body[data-page="fila"] .queue-table-card { min-height: 390px; }
    body[data-page="clientes"] .clients-layout,
    body[data-page="configuracoes"] .settings-layout { min-height: 620px; }
}

@media (max-width: 640px) {
    .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .metric-card,
    .compact-metrics .metric-card { min-height: 92px; padding: 12px; gap: 9px; }
    .metric-icon,
    .compact-metrics .metric-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 12px; }
    .metric-card strong,
    .compact-metrics .metric-card strong { font-size: 20px; }
    .metric-card small { display: none; }
    body[data-page="atendimentos"] .service-workspace { display: flex; overflow: visible; flex-direction: column; }
    .conversation-panel { height: auto; min-height: 430px; }
    .chat-panel { height: 690px; }
    body[data-page="clientes"] .clients-layout { display: flex; overflow: visible; flex-direction: column; }
    .client-list-panel { height: auto; }
    .client-list { max-height: 390px; }
    .form-grid.two-columns,
    .form-grid.three-columns,
    .integration-grid { grid-template-columns: 1fr; }
    .automation-card,
    .next-queue-card { height: auto; min-height: 120px; }
    body[data-page="fila"] .automation-row { height: auto; }
    .panel-actions .compact-select { display: none; }
    .profile-photo-row { grid-template-columns: 70px minmax(0, 1fr); }
    .profile-photo-row .color-field { grid-column: 1 / -1; width: 100%; }
}

/* Ajuste de fidelidade: tipografia e densidade das telas de referencia. */
@media (min-width: 861px) {
    .page-main { padding: 15px 24px 16px; }
    .panel-heading h2 { font-size: 16px; }
    .panel-heading p { font-size: 12px; }
    .metric-card span:not(.metric-icon) { font-size: 12px; }
    .metric-card strong,
    .compact-metrics .metric-card strong { font-size: 28px; }
    .metric-card small { font-size: 10px; }

    .conversation-panel-header h2 { font-size: 16px; }
    .conversation-panel-header span,
    .conversation-search input,
    .filter-tabs a { font-size: 11px; }
    .conversation-name { font-size: 13px; }
    .chat-person strong { font-size: 14px; }
    .chat-person small,
    .action-button { font-size: 10px; }
    .message-text { font-size: 13px; }
    .message-meta,
    .day-divider span,
    .channel-line { font-size: 10px; }
    .chat-composer textarea { font-size: 12px; }

    .customer-panel-title h2,
    .customer-profile h3 { font-size: 15px; }
    .customer-panel-title a,
    .info-section h4,
    .purchase-card strong { font-size: 11px; }
    .customer-profile span:not(.avatar),
    .info-section p { font-size: 11px; }
    .customer-profile small,
    .purchase-card small,
    .history-item strong { font-size: 9px; }

    .automation-card strong { font-size: 15px; }
    .automation-card div span,
    .next-queue-card small { font-size: 11px; }
    .next-queue-card strong { font-size: 13px; }

    .data-table th { font-size: 10px; }
    .data-table td,
    .data-table td > strong,
    .person-cell strong,
    .wait-time { font-size: 12px; }
    .table-subtitle,
    .person-cell small { font-size: 10px; }
    .table-action { font-size: 10px; }

    .client-list-item strong,
    .timeline-list strong { font-size: 12px; }
    .client-list-item small,
    .timeline-list small { font-size: 10px; }
    .form-section h3 { font-size: 15px; }
    .field > span,
    .table-toolbar input,
    .table-toolbar select { font-size: 11px; }
    .field input,
    .field select,
    .field textarea { font-size: 12px; }

    .progress-list strong,
    .ranking-list strong,
    .setting-toggle strong { font-size: 12px; }
    .progress-list em,
    .ranking-list small,
    .setting-toggle small { font-size: 10px; }

    body[data-page="fila"] .queue-table-card .eyebrow,
    body[data-page="usuarios"] .employees-table-panel .eyebrow { display: none; }

    .top-user .avatar-sm { width: 44px; height: 44px; flex-basis: 44px; }
    .conversation-item .avatar-sm,
    .chat-person .avatar-sm,
    .client-list-item .avatar-sm,
    .person-cell .avatar-sm { width: 42px; height: 42px; flex-basis: 42px; }
    .customer-profile .avatar-lg { width: 70px; height: 70px; flex-basis: 70px; }
}

@media (min-width: 1101px) and (min-height: 821px) {
    .sidebar-nav { padding-bottom: 22px; border-bottom: 1px solid rgba(255,255,255,.13); }
    .app-sidebar .sidebar-queue-card { margin-top: 24px; }
    .sidebar-queue-card a { padding: 9px 0; font-size: 12px; }
    .sidebar-queue-number { font-size: 11px; }
    .sidebar-footer { margin-top: auto; }

    body[data-page="fila"] .metric-grid { gap: 16px; margin-bottom: 16px; }
    body[data-page="fila"] .page-heading { margin-bottom: 35px; }
    body[data-page="fila"] .metric-card { min-height: 118px; padding: 18px 20px; }
    body[data-page="fila"] .metric-icon { width: 66px; height: 66px; flex-basis: 66px; border-radius: 18px; }
    body[data-page="fila"] .metric-card span:not(.metric-icon) { font-size: 13px; }
    body[data-page="fila"] .metric-card strong { font-size: 30px; }
    body[data-page="fila"] .metric-card small { font-size: 11px; }

    body[data-page="fila"] .automation-row {
        height: 166px;
        grid-template-columns: minmax(470px, .84fr) minmax(620px, 1.16fr);
        gap: 16px;
        margin-bottom: 16px;
    }
    body[data-page="fila"] .automation-card,
    body[data-page="fila"] .next-queue-card { height: 166px; min-height: 166px; padding: 18px 20px; }
    body[data-page="fila"] .automation-card {
        display: grid;
        grid-template-columns: 68px minmax(0, 1fr) auto;
        grid-template-rows: 1fr auto;
        column-gap: 18px;
        row-gap: 10px;
    }
    body[data-page="fila"] .automation-card > i {
        width: 64px;
        height: 64px;
        grid-row: 1 / 3;
        align-self: center;
        font-size: 28px;
    }
    body[data-page="fila"] .automation-card > div { grid-column: 2; align-self: center; }
    body[data-page="fila"] .automation-card strong { font-size: 17px; }
    body[data-page="fila"] .automation-card div span { max-width: 520px; margin-top: 6px; font-size: 12px; line-height: 1.5; }
    body[data-page="fila"] .automation-card > em { grid-column: 3; grid-row: 1; align-self: center; font-size: 10px; }
    body[data-page="fila"] .automation-card > a {
        width: fit-content;
        min-height: 37px;
        grid-column: 2;
        grid-row: 2;
        margin: 0;
        padding: 0 13px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #fff;
        font-size: 11px;
    }

    body[data-page="fila"] .next-queue-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto auto;
        grid-template-rows: auto 1fr;
        align-items: center;
        gap: 9px 24px;
    }
    body[data-page="fila"] .next-queue-title {
        grid-column: 1 / -1;
        color: #0d7b35;
        font-size: 14px;
        overflow: visible;
    }
    body[data-page="fila"] .next-queue-person {
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 14px;
    }
    body[data-page="fila"] .next-queue-person .avatar { width: 72px; height: 72px; flex-basis: 72px; }
    body[data-page="fila"] .next-queue-person > span:last-child { min-width: 0; display: flex; flex-direction: column; }
    body[data-page="fila"] .next-queue-person strong { color: var(--body); font-size: 15px; }
    body[data-page="fila"] .next-queue-person small { margin-top: 3px; color: var(--muted); font-size: 11px; }
    body[data-page="fila"] .next-queue-card > .priority-badge {
        min-width: 52px;
        min-height: 28px;
        flex: none;
        display: inline-flex;
        grid-column: 2;
        grid-row: 2;
        font-size: 10px;
    }
    body[data-page="fila"] .next-queue-card > .primary-button {
        min-width: 185px;
        min-height: 46px;
        grid-column: 3;
        grid-row: 2;
        font-size: 12px;
        background: linear-gradient(135deg, #18a84f, #078f3b);
        box-shadow: 0 8px 20px rgba(8,143,59,.2);
    }

    body[data-page="fila"] .queue-table-card {
        height: calc(100dvh - var(--topbar-height) - 428px);
        min-height: 370px;
    }
    body[data-page="fila"] .queue-table-card .panel-heading { min-height: 64px; }
    body[data-page="fila"] .queue-table .avatar-sm { width: 42px; height: 42px; flex-basis: 42px; }
    body[data-page="fila"] .queue-table th { padding-top: 11px; padding-bottom: 11px; font-size: 11px; }
    body[data-page="fila"] .queue-table td { padding-top: 10px; padding-bottom: 10px; }
    body[data-page="fila"] .queue-table .person-cell strong,
    body[data-page="fila"] .queue-table td > strong { font-size: 12px; }
    body[data-page="fila"] .queue-table .person-cell small,
    body[data-page="fila"] .queue-table .table-subtitle { font-size: 10px; }
    body[data-page="fila"] .queue-table .table-action { min-height: 34px; padding: 0 11px; }
    body[data-page="fila"] .table-footer { min-height: 45px; font-size: 10px; }
}

/* Estabilidade no refresh e fidelidade do Dashboard/Atendimentos. */
html.app-locked {
    height: 100%;
    min-height: 0;
    overflow: hidden;
    scroll-behavior: auto;
}
html.app-locked body.app-body {
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
body.app-body .app-shell,
body.app-body .app-content {
    height: 100%;
    min-height: 0;
}
body.app-body .app-content { overflow: hidden; }
body.app-body .app-sidebar {
    height: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
}
body.app-body .app-topbar {
    position: relative;
    flex: 0 0 var(--topbar-height);
    backdrop-filter: none;
}
body.app-body .page-main {
    height: calc(100% - var(--topbar-height));
    min-height: 0;
    overflow: hidden;
}
.conversation-list,
.chat-messages,
.customer-panel,
.queue-table-card .table-wrap {
    overflow-anchor: none;
    scrollbar-gutter: stable;
}

@media (min-width: 861px) {
    .metric-icon {
        width: 60px;
        height: 60px;
        flex-basis: 60px;
        border-radius: 17px;
        color: #fff !important;
        box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 8px 18px rgba(16,24,40,.1);
    }
    .metric-card.blue .metric-icon { background: linear-gradient(145deg, #2f7cff, #0759e8); }
    .metric-card.orange .metric-icon { background: linear-gradient(145deg, #ff941f, #f56b00); }
    .metric-card.green .metric-icon { background: linear-gradient(145deg, #27b95b, #078d39); }
    .metric-card.purple .metric-icon { background: linear-gradient(145deg, #8a55ef, #6130d0); }
    .metric-card.red .metric-icon { background: linear-gradient(145deg, #f04d54, #cf2029); }

    body[data-page="dashboard"] .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 15px;
    }
    body[data-page="dashboard"] .panel-heading { min-height: 62px; padding: 13px 17px; }
    body[data-page="dashboard"] .premium-bar-chart { padding-right: 28px; padding-left: 16px; }

    body[data-page="dashboard"] .compact-team-list {
        height: calc(100% - 155px);
        display: grid;
        grid-template-rows: repeat(6, minmax(0, 1fr));
        overflow: hidden;
    }
    body[data-page="dashboard"] .compact-team-list > .team-member-row {
        min-height: 0;
        display: grid;
        grid-template-columns: 38px minmax(0, 1.15fr) minmax(84px, .8fr) 10px;
        align-items: center;
        gap: 11px;
        padding: 5px 17px;
    }
    body[data-page="dashboard"] .team-member-row .avatar-xs {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }
    body[data-page="dashboard"] .team-member-name {
        min-width: 0;
        display: block;
    }
    body[data-page="dashboard"] .team-member-name strong {
        display: block;
        overflow: hidden;
        color: var(--body);
        font-size: 13px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    body[data-page="dashboard"] .team-member-role {
        overflow: hidden;
        color: var(--muted);
        font-size: 11px;
        font-style: normal;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    body[data-page="dashboard"] .recent-list,
    body[data-page="dashboard"] .queue-preview-list {
        height: calc(100% - 62px);
        display: grid;
        overflow: hidden;
    }
    body[data-page="dashboard"] .recent-list { grid-template-rows: repeat(4, minmax(0, 1fr)); }
    body[data-page="dashboard"] .queue-preview-list { grid-template-rows: repeat(5, minmax(0, 1fr)); }
    body[data-page="dashboard"] .recent-list a {
        min-height: 0;
        display: grid;
        grid-template-columns: 40px minmax(145px, 1.15fr) minmax(170px, 1.45fr) auto 42px;
        align-items: center;
        gap: 12px;
        padding: 7px 17px;
    }
    body[data-page="dashboard"] .recent-list .avatar-xs,
    body[data-page="dashboard"] .queue-preview-list .avatar-xs {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
    }
    body[data-page="dashboard"] .recent-name,
    body[data-page="dashboard"] .queue-preview-name {
        min-width: 0;
        overflow: hidden;
        color: var(--body);
        font-size: 13px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    body[data-page="dashboard"] .recent-subject,
    body[data-page="dashboard"] .queue-preview-subject {
        min-width: 0;
        overflow: hidden;
        color: var(--muted);
        font-size: 11px;
        white-space: nowrap;
        text-overflow: ellipsis;
    }
    body[data-page="dashboard"] .recent-list time,
    body[data-page="dashboard"] .queue-preview-list time {
        color: var(--muted);
        font-size: 10px;
        font-variant-numeric: tabular-nums;
        text-align: right;
    }
    body[data-page="dashboard"] .queue-preview-list a {
        min-height: 0;
        grid-template-columns: 24px 40px minmax(135px, 1.1fr) minmax(150px, 1.25fr) auto 52px;
        gap: 10px;
        padding: 6px 16px;
    }
    body[data-page="dashboard"] .queue-preview-list > a > b {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    body[data-page="atendimentos"] .service-workspace {
        grid-template-columns: 330px minmax(0, 1fr) 350px;
        gap: 13px;
    }
    body[data-page="atendimentos"] .conversation-panel-header { min-height: 62px; padding: 13px 15px; }
    body[data-page="atendimentos"] .conversation-search { height: 42px; margin: 11px 12px 8px; }
    body[data-page="atendimentos"] .filter-tabs { padding-bottom: 10px; }
    body[data-page="atendimentos"] .filter-tabs a { min-height: 31px; font-size: 11px; }
    body[data-page="atendimentos"] .conversation-item { gap: 10px; padding: 10px 12px; }
    body[data-page="atendimentos"] .conversation-item > .avatar {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }
    body[data-page="atendimentos"] .conversation-name { font-size: 13px; }

    body[data-page="atendimentos"] .chat-header {
        min-height: 72px;
        padding: 10px 16px;
    }
    body[data-page="atendimentos"] .chat-person > .avatar {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
    }
    body[data-page="atendimentos"] .chat-person strong { font-size: 15px; }
    body[data-page="atendimentos"] .chat-person small { font-size: 11px; }
    body[data-page="atendimentos"] .action-button { min-height: 36px; padding: 0 12px; font-size: 11px; }
    body[data-page="atendimentos"] .chat-messages { padding: 0 18px; }
    body[data-page="atendimentos"] .day-divider { margin-bottom: 18px; }
    body[data-page="atendimentos"] .day-divider span { padding: 5px 13px; font-size: 11px; }
    body[data-page="atendimentos"] .message-row { margin-bottom: 13px; }
    body[data-page="atendimentos"] .message-bubble {
        max-width: min(72%, 620px);
        padding: 5px 14px;
        border-radius: 12px;
    }
    body[data-page="atendimentos"] .message-author { margin-bottom: 4px; font-size: 10px; }
    body[data-page="atendimentos"] .message-text { font-size: 15px; line-height: 1.5; }
    body[data-page="atendimentos"] .message-meta { font-size: 10px; }
    body[data-page="atendimentos"] .channel-line { min-height: 40px; padding: 0 16px; font-size: 11px; }
    body[data-page="atendimentos"] .chat-composer {
        min-height: 93px;
        align-items: center;
        gap: 8px;
        padding: 10px 12px;
    }
    body[data-page="atendimentos"] .composer-tools {
        display: grid;
        align-items: center;
        grid-template-columns: repeat(2, 34px);
        gap: 5px;
    }
    body[data-page="atendimentos"] .composer-icon {
        width: 34px;
        height: 34px;
        border: 1px solid var(--border);
        border-radius: 8px;
        color: var(--body-2);
        background: #fff;
    }
    body[data-page="atendimentos"] .chat-composer textarea {
        height: 73px;
        min-height: 73px;
        max-height: 73px;
        padding: 12px 13px;
        border-radius: 9px;
        font-size: 14px;
        line-height: 1.5;
    }
    body[data-page="atendimentos"] .send-button {
        width: 48px;
        height: 48px;
        border-radius: 11px;
    }
    body[data-page="atendimentos"] .chat-composer.disabled .composer-icon { opacity: .45; pointer-events: none; }

    body[data-page="atendimentos"] .customer-panel-title { min-height: 64px; padding: 0 18px; }
    body[data-page="atendimentos"] .customer-panel-title h2 { font-size: 16px; }
    body[data-page="atendimentos"] .customer-panel-title a,
    body[data-page="atendimentos"] .customer-panel-title button { font-size: 11px; }
    body[data-page="atendimentos"] .customer-profile.compact { gap: 14px; padding: 18px; }
    body[data-page="atendimentos"] .customer-profile .avatar-lg {
        width: 76px;
        height: 76px;
        flex-basis: 76px;
    }
    body[data-page="atendimentos"] .customer-profile h3 { font-size: 16px; }
    body[data-page="atendimentos"] .customer-profile span:not(.avatar) { font-size: 12px; }
    body[data-page="atendimentos"] .customer-profile small { font-size: 10px; }
    body[data-page="atendimentos"] .info-section { padding: 16px 18px; }
    body[data-page="atendimentos"] .info-section h4 { font-size: 12px; }
    body[data-page="atendimentos"] .info-section p { font-size: 11px; }
    body[data-page="atendimentos"] .purchase-card { min-height: 64px; gap: 13px; }
    body[data-page="atendimentos"] .purchase-card > i { width: 60px; height: 60px; flex-basis: 60px; }
    body[data-page="atendimentos"] .purchase-card-image { width: 62px; height: 62px; flex-basis: 62px; padding: 3px; border-radius: 11px; }
    body[data-page="atendimentos"] .purchase-card strong { font-size: 13px; }
    body[data-page="atendimentos"] .purchase-card small { margin-top: 5px; font-size: 10px; }
    body[data-page="atendimentos"] .purchase-card-status { padding: 4px 9px; font-size: 9px; }
}

@media (min-width: 861px) and (max-width: 1500px) {
    body[data-page="atendimentos"] .service-workspace {
        grid-template-columns: 300px minmax(0, 1fr);
    }
    body[data-page="atendimentos"] .customer-panel { display: none; }
    body[data-page="atendimentos"] .filter-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 5px;
        padding-right: 8px;
        padding-left: 8px;
    }
    body[data-page="atendimentos"] .filter-tabs a {
        width: 100%;
        padding-right: 6px;
        padding-left: 6px;
        font-size: 11px;
    }
    body[data-page="atendimentos"] .chat-composer { min-height: 93px; }
    body[data-page="atendimentos"] .composer-tools { grid-template-columns: repeat(2, 34px); }
    body[data-page="atendimentos"] .composer-icon { width: 34px; height: 34px; }
    body[data-page="atendimentos"] .chat-composer textarea { height: 73px; min-height: 73px; max-height: 73px; }
    body[data-page="dashboard"] .recent-list a {
        grid-template-columns: 34px minmax(100px, 1fr) minmax(0, 1.15fr) auto 36px;
        gap: 8px;
    }
    body[data-page="dashboard"] .queue-preview-list a {
        grid-template-columns: 22px 34px minmax(90px, 1fr) minmax(0, 1.1fr) auto 44px;
        gap: 7px;
    }
}

@media (min-width: 861px) and (max-height: 820px) {
    body[data-page="dashboard"] .compact-team-list > .team-member-row { padding-top: 2px; padding-bottom: 2px; }
    body[data-page="dashboard"] .team-member-row .avatar-xs,
    body[data-page="dashboard"] .recent-list .avatar-xs,
    body[data-page="dashboard"] .queue-preview-list .avatar-xs {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }
    body[data-page="atendimentos"] .chat-composer { min-height: 91px; padding: 9px 11px; }
    body[data-page="atendimentos"] .composer-tools { grid-template-columns: repeat(2, 34px); gap: 5px; }
    body[data-page="atendimentos"] .composer-icon { width: 34px; height: 34px; }
    body[data-page="atendimentos"] .chat-composer textarea { height: 73px; min-height: 73px; max-height: 73px; padding: 12px 13px; }
    body[data-page="atendimentos"] .send-button { width: 48px; height: 48px; }
}

@media (max-width: 1100px) {
    html.app-locked,
    html.app-locked body.app-body {
        height: auto;
        min-height: 100%;
        overflow: auto;
    }
    body.app-body .app-shell,
    body.app-body .app-content {
        height: auto;
        min-height: 100vh;
        overflow: visible;
    }
    body.app-body .page-main {
        height: auto;
        min-height: calc(100vh - var(--topbar-height));
        overflow: visible;
    }
    body.app-body .app-sidebar { overflow-y: auto; }
}

/* Configurações e conta: uma área por página, sem rolagem externa em desktop. */
.settings-nav-caption {
    display: block;
    padding: 11px 14px 7px;
    color: #8a97a9;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    font-size: 8px;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.settings-screen-layout { min-height: 0; align-items: stretch; }
.settings-screen { min-width: 0; min-height: 0; overflow: hidden; }
.settings-feedback { flex: 0 0 auto; margin: 0; }
.settings-overview-grid,
.settings-master-detail {
    min-width: 0;
    min-height: 0;
    flex: 1;
    display: grid;
    gap: 14px;
}
.settings-overview-grid { grid-template-columns: minmax(0, 1.25fr) minmax(310px, .75fr); }
.settings-master-detail { grid-template-columns: 286px minmax(0, 1fr); }
.settings-overview-grid > *,
.settings-master-detail > * { min-width: 0; min-height: 0; }
.settings-editor-card,
.settings-record-panel,
.settings-info-card {
    height: 100%;
    display: flex;
    min-height: 0;
    overflow: hidden;
    flex-direction: column;
}
.settings-editor-card { padding-bottom: 0; }
.settings-editor-card > .panel-heading,
.settings-record-panel > .panel-heading,
.settings-info-card > .panel-heading { flex: 0 0 auto; }
.settings-editor-card > .form-actions {
    flex: 0 0 auto;
    margin-top: auto;
    padding: 13px 18px 16px;
    border-top: 1px solid var(--border);
    background: var(--surface);
}
.settings-editor-card > .setting-toggle,
.settings-editor-card > .settings-wide-field { margin-right: 18px; margin-left: 18px; }
.settings-editor-scroll { min-height: 0; flex: 1; overflow-y: auto; scrollbar-width: thin; }
.messages-editor-fields { padding: 0 18px 12px; }
.messages-editor-fields > .field { margin-top: 13px; }
.messages-editor-fields > .setting-toggle { margin: 0; }
.settings-form-pad { padding: 16px 18px 8px; }
.settings-form-pad .field.wide { grid-column: 1 / -1; }
.cleanup-summary-grid { flex: 0 0 auto; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.cleanup-summary-grid article { min-width: 0; display: flex; align-items: center; gap: 11px; padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface); }
.cleanup-summary-grid article > span { width: 38px; height: 38px; flex: 0 0 38px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.cleanup-summary-grid strong,.cleanup-summary-grid small { display: block; }
.cleanup-summary-grid strong { font-size: 11px; }
.cleanup-summary-grid small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.cleanup-card-grid { min-height: 0; flex: 1; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.cleanup-card { min-height: 0; display: flex; flex-direction: column; overflow-x: hidden; overflow-y: auto; padding: 0; scrollbar-width: thin; }
.cleanup-card > header { padding: 17px 18px 14px; border-bottom: 1px solid var(--border); }
.cleanup-card > header h2 { margin: 3px 0 4px; font-size: 15px; }
.cleanup-card > header p { margin: 0; color: var(--muted); font-size: 9px; }
.cleanup-list { display: grid; padding: 14px 16px; }
.cleanup-list > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 2px; border-bottom: 1px solid var(--border); }
.cleanup-list > div:last-child { border-bottom: 0; }
.cleanup-list strong,.cleanup-list small { display: block; }
.cleanup-list strong { font-size: 10px; }
.cleanup-list small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.cleanup-list em { flex: 0 0 auto; color: var(--primary-strong); font-size: 9px; font-style: normal; font-weight: 800; }
.cleanup-list .warning em { color: var(--warning); }
.cleanup-filter { margin-top: auto; padding: 14px 16px 16px; border-top: 1px solid var(--border); }
.cleanup-filter .field { margin-bottom: 10px; }
.cleanup-filter button,.cleanup-card > button { width: calc(100% - 32px); margin: auto 16px 16px; }
.cleanup-protected-form { display: grid; gap: 10px; margin: 0 16px 16px; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.cleanup-protected-form > strong { font-size: 10px; }
.cleanup-protected-form > small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.cleanup-option { display: flex; align-items: center; gap: 8px; font-size: 9px; font-weight: 700; }
.cleanup-option input { width: 15px; height: 15px; accent-color: var(--primary); }
.cleanup-option strong,.cleanup-option small { display: block; }
.cleanup-option small { margin-top: 2px; color: var(--muted); font-size: 8px; font-weight: 500; line-height: 1.35; }
.cleanup-option:has(input:disabled) { opacity: .62; }
.cleanup-media-note { padding: 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--body-2); background: var(--surface); font-size: 8px; line-height: 1.45; }
.cleanup-confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.cleanup-protected-form .field { margin: 0; }
.cleanup-protected-form .danger-button { width: 100%; }
.cleanup-danger-note { margin: 15px 16px 0; padding: 13px; border: 1px solid #ef9aa0; border-radius: 9px; color: #a91e28; background: #fff1f2; }
.cleanup-danger-note strong,.cleanup-danger-note small { display: block; }
.cleanup-danger-note strong { font-size: 10px; }
.cleanup-danger-note small { margin-top: 4px; font-size: 8px; }
html[data-theme="dark"] .cleanup-danger-note { color: #ffb4b9; border-color: #70313a; background: #351c23; }
.cleanup-confirm-modal { width: min(500px,calc(100vw - 28px)); }
.cleanup-modal-warning { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border: 1px solid #ef9aa0; border-radius: 10px; color: #a91e28; background: #fff1f2; }
.cleanup-modal-warning > svg { flex: 0 0 auto; }
.cleanup-modal-warning strong,.cleanup-modal-warning small { display: block; }
.cleanup-modal-warning strong { font-size: 12px; }
.cleanup-modal-warning small { margin-top: 5px; color: #7f2930; font-size: 10px; line-height: 1.5; }
.cleanup-reset-ack { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; font-size: 10px; line-height: 1.45; cursor: pointer; }
.cleanup-reset-ack[hidden] { display: none; }
.cleanup-reset-ack input { flex: 0 0 auto; margin-top: 1px; accent-color: var(--danger); }
html[data-theme="dark"] .cleanup-modal-warning { color: #ffb4b9; border-color: #70313a; background: #351c23; }
html[data-theme="dark"] .cleanup-modal-warning small { color: #efb0b5; }
.profile-quick-replies-wrap { min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.quick-reply-variables { margin-bottom: 13px; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--primary-soft); }
.quick-reply-variables > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.quick-reply-variables strong { font-size: 11px; }
.quick-reply-variables small { color: var(--muted); font-size: 9px; }
.quick-reply-variable-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.quick-reply-variable-list button { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 8px; color: var(--body); background: var(--surface); text-align: left; }
.quick-reply-variable-list button:hover { border-color: var(--primary); background: var(--surface-2); }
.quick-reply-variable-list code { color: var(--primary-strong); font-size: 10px; font-weight: 800; }
.quick-reply-variable-list span { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.quick-reply-variable-list svg { color: var(--primary); }
.profile-quick-replies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.profile-quick-reply { min-width: 0; margin: 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.profile-quick-reply legend { padding: 0 6px; color: var(--primary); font-size: 9px; font-weight: 800; }
.profile-quick-reply .field + .field { margin-top: 10px; }
.profile-quick-reply textarea { min-height: 70px; resize: vertical; }
html[data-theme="dark"] .quick-reply-variables { color: var(--body); border-color: #315274; background: #102843; }
html[data-theme="dark"] .quick-reply-variable-list button { color: var(--body); border-color: #314a66; background: #0f1d2e; }
html[data-theme="dark"] .quick-reply-variable-list button:hover { border-color: #4f82bd; background: #18314d; }
html[data-theme="dark"] .quick-reply-variable-list code { color: #69aefe; }
html[data-theme="dark"] .quick-reply-variable-list span { color: #afbdd0; }
html[data-theme="dark"] .profile-quick-reply :is(input,textarea)::placeholder { color: #8194aa; opacity: 1; }
.settings-record-list { min-height: 0; flex: 1; overflow-y: auto; padding: 7px; scrollbar-width: thin; }
.settings-record {
    min-height: 66px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 9px;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--body-2);
}
.settings-record:hover { background: var(--surface-2); }
.settings-record.active { color: var(--primary-strong); border-color: #c9dcfd; background: var(--primary-soft); }
.settings-record > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.settings-record strong { overflow: hidden; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.settings-record small { margin-top: 4px; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.record-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.record-icon.whatsapp { color: var(--success); background: var(--success-soft); }
.compact-heading { min-height: 68px; }
.settings-info-card { padding-bottom: 16px; }
.settings-step-list { min-height: 0; display: flex; overflow-y: auto; flex-direction: column; gap: 10px; padding: 16px 18px; scrollbar-width: thin; }
.settings-step-list > div,
.settings-step-list > a { display: flex; align-items: flex-start; gap: 11px; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.settings-step-list b { width: 30px; height: 30px; display: grid; place-items: center; flex: 0 0 30px; border-radius: 8px; color: var(--primary); background: var(--primary-soft); font-size: 10px; }
.settings-step-list span { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.settings-step-list strong { font-size: 11px; }
.settings-step-list small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.settings-inline-link { align-self: flex-start; margin: auto 18px 0; }
.catalog-database-toggle { margin: 0 0 16px; }
.catalog-database-fields { align-items: end; }
.catalog-security-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px; border: 1px solid #cfe0fc; border-radius: 10px; color: var(--primary-strong); background: var(--primary-soft); }
.catalog-security-note > svg { flex: 0 0 auto; }
.catalog-security-note > span { display: flex; flex-direction: column; }
.catalog-security-note strong { font-size: 10px; }
.catalog-security-note small { margin-top: 3px; color: var(--body-2); font-size: 8px; line-height: 1.5; }
.catalog-database-actions { justify-content: space-between; }
.settings-callout {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 13px 18px;
    padding: 12px;
    border: 1px solid #cfe0fc;
    border-radius: 9px;
    color: var(--primary);
    background: #f3f7ff;
}
.settings-callout > span { min-width: 0; display: flex; flex-direction: column; }
.settings-callout strong { color: var(--body); font-size: 10px; }
.settings-callout small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.settings-callout a { font-size: 10px; font-weight: 800; }
.credentials-editor-card .settings-contained-toggle { margin-right: 18px; margin-left: 18px; }
.settings-full-empty { height: 100%; }
.api-state.offline { color: #aa2026; background: var(--danger-soft); }
.api-state.offline i { background: var(--danger); }
.alert-box.warning { color: #855900; background: var(--warning-soft); border-color: #f4d58e; }

.integration-diagnostic-body { padding: 15px 18px 18px; }
.integration-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.integration-status-grid article { min-height: 70px; display: flex; justify-content: center; flex-direction: column; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.integration-status-grid span { color: var(--muted); font-size: 8px; }
.integration-status-grid strong { margin-top: 5px; overflow-wrap: anywhere; font-size: 10px; }
.integration-status-grid small { margin-top: 5px; overflow-wrap: anywhere; font-size: 8px; line-height: 1.35; }
.integration-status-card.error { border-color: #f0b6b9; background: var(--danger-soft); }
.integration-status-card.error strong, .integration-status-card.error small { color: #a51f26; }
.integration-status-card.warning { border-color: #f4d58e; background: var(--warning-soft); }
.integration-status-card.warning strong, .integration-status-card.warning small { color: #855900; }
.field.field-error input, .field.field-error select, .field.field-error textarea { border-color: #e58a91; background: #fff7f7; }
.field.field-warning input, .field.field-warning select, .field.field-warning textarea { border-color: #e7c15a; background: #fffdf4; }
.field-diagnostic.error { color: #a51f26; font-weight: 700; }
.field-diagnostic.warning { color: #855900; font-weight: 700; }
.integration-error-card { margin-top: 12px; padding: 12px 14px; border: 1px solid #f0b6b9; border-radius: 9px; color: #a51f26; background: var(--danger-soft); }
.integration-error-card strong { font-size: 10px; }
.integration-error-card p { margin: 5px 0; font-size: 10px; line-height: 1.45; }
.integration-error-card small { font-size: 8px; }
.integration-diagnostic-body > .alert-box { margin: 12px 0 0; }
.integration-test-grid { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 10px; margin-top: 12px; }
.integration-test-card { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.integration-test-card > div { min-width: 0; flex: 1; display: flex; flex-direction: column; }
.integration-test-card strong { font-size: 10px; }
.integration-test-card small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.send-test-card { display: grid; grid-template-columns: minmax(140px, .65fr) minmax(180px, 1fr) auto; }
.send-test-card .field { gap: 3px; }
.integration-diagnostic-body > .settings-inline-link { margin: 12px 0 0; }

.account-summary { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 13px; margin: 15px 18px 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.account-summary > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.account-summary strong { font-size: 13px; }
.account-summary small { margin-top: 4px; color: var(--muted); font-size: 9px; }
.account-links-list a { align-items: center; }
.account-links-list a > .ui-icon { align-self: center; color: var(--muted); }
.password-form { width: min(620px, 100%); display: grid; gap: 12px; }
.security-guide-card { max-height: 100%; }

.webhook-settings-grid { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr); }
.webhook-form-stack { display: flex; flex-direction: column; gap: 16px; }
.webhook-field-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.webhook-field-row.token-row { grid-template-columns: minmax(0, 1fr) auto auto; }
.webhook-field-row > input { min-width: 0; }
.webhook-token-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.webhook-token-actions small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.webhook-token-actions .ghost-button { min-height: 32px; flex: 0 0 auto; }
.webhook-warning { margin: 0; line-height: 1.5; }
.webhook-status-summary { display: grid; grid-template-columns: 1fr; gap: 9px; padding: 15px 18px 0; }
.webhook-status-summary > div { display: flex; flex-direction: column; gap: 4px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2); }
.webhook-status-summary span { color: var(--muted); font-size: 8px; }
.webhook-status-summary strong { overflow-wrap: anywhere; font-size: 10px; }
.webhook-step-list { padding-top: 10px; }

.profile-photo-feature { display: grid; grid-template-columns: 98px minmax(0, 1fr) 72px; align-items: center; gap: 16px; padding: 16px 18px 10px; }
.avatar-profile-xl { width: 92px; height: 92px; flex-basis: 92px; font-size: 24px; }
.profile-photo-feature > span:nth-child(2) { display: flex; align-items: flex-start; flex-direction: column; gap: 6px; }
.profile-photo-feature > span:nth-child(2) > strong { font-size: 14px; }
.profile-photo-feature > span:nth-child(2) > small { color: var(--muted); font-size: 9px; }
.profile-photo-feature .color-field { width: 72px; }
.avatar-preset-fieldset { min-width: 0; margin: 4px 18px 10px; padding: 12px 13px 13px; border: 1px solid var(--border); border-radius: 10px; }
.avatar-preset-fieldset legend { padding: 0 5px; font-size: 10px; font-weight: 800; }
.avatar-preset-fieldset > p { margin: 0 0 10px; color: var(--muted); font-size: 8px; }
.avatar-preset-grid { display: grid; grid-template-columns: repeat(10, minmax(54px, 1fr)); gap: 7px; }
.avatar-preset-option { position: relative; min-width: 0; display: flex; align-items: center; flex-direction: column; gap: 5px; padding: 8px 4px 6px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); cursor: pointer; }
.avatar-preset-option:hover { border-color: #9ebdf4; background: var(--primary-soft); }
.avatar-preset-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.avatar-preset { width: 54px; height: 54px; flex-basis: 54px; background-position: center; background-size: cover; }
.avatar-preset-option small { max-width: 100%; overflow: hidden; color: var(--muted); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.avatar-preset-option > i { position: absolute; top: 5px; right: 5px; width: 19px; height: 19px; display: none; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: var(--primary); }
.avatar-preset-option:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.12); }
.avatar-preset-option:has(input:checked) > i { display: grid; }
.profile-photo-settings-grid .avatar-preset-fieldset { min-height: 0; flex: 1 1 auto; overflow-y: auto; scrollbar-width: thin; }
.compact-avatar-gallery { max-height: 218px; margin: 1px 0 3px; padding: 8px; overflow-y: auto; scrollbar-width: thin; }
.compact-avatar-gallery .avatar-preset-grid { grid-template-columns: repeat(8, minmax(38px, 1fr)); gap: 5px; }
.compact-avatar-gallery .avatar-preset-option { padding: 5px 2px; border-radius: 8px; }
.compact-avatar-gallery .avatar-preset { width: 38px; height: 38px; flex-basis: 38px; }
.compact-avatar-gallery .avatar-preset-option small { display: none; }
.compact-avatar-gallery .avatar-preset-option > i { top: 2px; right: 2px; width: 16px; height: 16px; }
.client-avatar-gallery { margin: 7px 0 12px; }
.avatar-context-preview { display: grid; grid-template-columns: 64px minmax(0, 1fr) 9px; align-items: center; gap: 11px; margin: 16px 18px 0; padding: 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.avatar-context-preview.compact { grid-template-columns: 42px minmax(0, 1fr); }
.avatar-context-preview > span:nth-child(2) { min-width: 0; display: flex; flex-direction: column; }
.avatar-context-preview strong { font-size: 11px; }
.avatar-context-preview small { margin-top: 3px; color: var(--muted); font-size: 8px; }

@media (min-width: 1101px) {
    body[data-page="configuracoes"] .page-main,
    body[data-page="perfil"] .page-main {
        height: calc(100dvh - var(--topbar-height));
        min-height: 0;
        display: flex;
        overflow: hidden;
        flex-direction: column;
    }
    body[data-page="configuracoes"] .page-heading,
    body[data-page="perfil"] .page-heading { flex: 0 0 auto; margin-bottom: 14px; }
    body[data-page="configuracoes"] .settings-layout,
    body[data-page="perfil"] .settings-layout {
        height: auto;
        min-height: 0;
        flex: 1;
    }
    body[data-page="configuracoes"] .settings-nav,
    body[data-page="perfil"] .settings-nav { position: static; height: 100%; overflow-y: auto; scrollbar-width: thin; }
    body[data-page="configuracoes"] .settings-content,
    body[data-page="perfil"] .settings-content { height: 100%; overflow: hidden; padding-right: 0; }
}

@media (max-width: 1450px) {
    .integration-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .integration-test-grid { grid-template-columns: 1fr; }
    .avatar-preset-grid { grid-template-columns: repeat(6, minmax(54px, 1fr)); }
    .compact-avatar-gallery .avatar-preset-grid { grid-template-columns: repeat(4, minmax(38px, 1fr)); }
}

@media (max-width: 1100px) {
    .settings-screen-layout,
    .settings-overview-grid,
    .settings-master-detail { height: auto; display: grid; grid-template-columns: 1fr; overflow: visible; }
    .settings-screen { overflow: visible; }
    .settings-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .settings-nav-caption { grid-column: 1 / -1; }
    .settings-editor-card,
    .settings-record-panel,
    .settings-info-card { height: auto; max-height: none; overflow: visible; }
    .settings-record-list,
    .settings-editor-scroll { max-height: none; overflow: visible; }
    .send-test-card { grid-template-columns: 1fr; }
    .client-import-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .client-import-confirm { align-items: stretch; flex-direction: column; }
    .client-import-confirm form,
    .client-import-confirm form:first-child { width: 100%; min-width: 0; }
    .cleanup-summary-grid,.cleanup-card-grid,.cleanup-confirm-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .settings-nav { grid-template-columns: 1fr; }
    .profile-quick-replies { grid-template-columns: 1fr; }
    .quick-reply-variables > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
    .quick-reply-variable-list { grid-template-columns: 1fr; }
    .settings-overview-grid,
    .settings-master-detail { grid-template-columns: 1fr; }
    .integration-status-grid { grid-template-columns: 1fr; }
    .profile-photo-feature { grid-template-columns: 82px minmax(0, 1fr); }
    .profile-photo-feature .color-field { grid-column: 1 / -1; width: 100%; }
    .avatar-profile-xl { width: 76px; height: 76px; flex-basis: 76px; }
    .avatar-preset-grid { grid-template-columns: repeat(2, minmax(62px, 1fr)); }
    .compact-avatar-gallery .avatar-preset-grid { grid-template-columns: repeat(4, minmax(38px, 1fr)); }
    .account-summary { grid-template-columns: 58px minmax(0, 1fr); }
    .account-summary > a { grid-column: 1 / -1; }
    .webhook-field-row,
    .webhook-field-row.token-row { grid-template-columns: 1fr; }
    .webhook-token-actions { align-items: stretch; flex-direction: column; }
    .client-import-overlay { padding: 8px; }
    .client-import-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 12px; }
    .client-import-header { min-height: 70px; padding: 13px 14px; }
    .client-import-body { padding: 12px 14px 16px; }
    .client-import-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .client-import-upload ul { grid-template-columns: 1fr; }
    .client-import-confirm { bottom: -16px; margin: 12px -14px -16px; padding: 12px 14px; }
    .client-import-confirm form:first-child { align-items: stretch; flex-direction: column; }
    .client-import-history article { align-items: flex-start; flex-direction: column; }
}

/* Conversa contínua, janela segura e encerramento silencioso (0.9.0). */
.chat-status-row {
    min-height: 34px;
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border);
}
.whatsapp-window-status {
    min-height: 34px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    font-size: 10px;
    line-height: 1.3;
}
.whatsapp-window-status .ui-icon { flex: 0 0 auto; }
.whatsapp-window-status strong { font-weight: 800; }
.whatsapp-window-status em { opacity: .55; font-style: normal; }
.whatsapp-window-status.is-open { color: #1d5da8; background: #eef6ff; }
.whatsapp-window-status.is-closed { color: #9a5b08; background: #fff8e8; }
.inactivity-status { min-height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 14px; color: #1d5da8; background: #eef6ff; font-size: 10px; line-height: 1.3; }
.inactivity-status[hidden] { display: none !important; }
.inactivity-status .ui-icon { flex: 0 0 auto; }
.inactivity-status strong { font-weight: 850; }
.inactivity-status.urgent { color: #c2262d; background: #fff1f1; }
.inactivity-status.urgent strong { animation: inactivity-time-pulse .9s ease-in-out infinite; }
.chat-status-row > .whatsapp-window-status { flex: 1 1 auto; min-width: 0; }
.chat-status-row > .inactivity-status { flex: 0 0 auto; border-left: 1px solid rgba(28, 93, 168, .14); }
.chat-status-row > .whatsapp-window-status span,
.chat-status-row > .inactivity-status span { white-space: nowrap; }
@keyframes inactivity-time-pulse { 50% { opacity: .35; } }

.conversation-cycle-divider {
    display: flex;
    justify-content: center;
    margin: 7px 0 13px;
    color: #496078;
}
.conversation-cycle-divider > span {
    min-width: 210px;
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr);
    align-items: center;
    column-gap: 5px;
    padding: 7px 12px;
    border: 1px solid rgba(148,163,184,.34);
    border-radius: 999px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 3px 10px rgba(15,23,42,.05);
    text-align: left;
}
.conversation-cycle-divider .ui-icon { grid-row: 1 / span 2; color: var(--primary); }
.conversation-cycle-divider strong { font-size: 9px; }
.conversation-cycle-divider small { color: var(--muted); font-size: 8px; }
.conversation-cycle-divider.is-end > span { background: rgba(240,253,244,.88); }
.conversation-cycle-divider.is-end .ui-icon { color: var(--success); }

.client-detail-actions { display: flex; align-items: center; gap: 8px; }
.client-detail-actions .primary-button,
.client-detail-actions .secondary-button { min-height: 38px; white-space: nowrap; }
.client-detail-actions button:disabled { cursor: not-allowed; opacity: .55; }

.safe-window-setting {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 18px;
    margin: 0 19px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}
.safe-window-setting > span { display: flex; min-width: 0; flex-direction: column; }
.safe-window-setting > span strong { font-size: 11px; }
.safe-window-setting > span small { max-width: 590px; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.safe-window-setting > div { display: flex; gap: 8px; }
.safe-window-setting > div label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 9px; }
.safe-window-setting input { width: 68px; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.safe-window-setting > em { grid-column: 1 / -1; color: #08783d; font-size: 9px; font-style: normal; font-weight: 700; }

@media (max-width: 760px) {
    .chat-status-row { flex-wrap: wrap; }
    .chat-status-row > .inactivity-status { flex: 1 1 100%; border-top: 1px solid rgba(28, 93, 168, .14); border-left: 0; }
    .whatsapp-window-status { align-items: flex-start; flex-wrap: wrap; }
    .whatsapp-window-status em { display: none; }
    .conversation-cycle-divider > span { min-width: 0; width: min(100%, 310px); }
    .client-detail-actions { width: 100%; align-items: stretch; flex-direction: column; }
    .client-detail-actions > * { justify-content: center; }
    .safe-window-setting { grid-template-columns: 1fr; }
    .safe-window-setting > div { justify-content: flex-start; }
}

/* Uso contínuo, reposição, modelos pessoais e lembretes (0.11.0). */
.sidebar-continuous-use-card { position: relative; margin-top: 9px; padding: 9px 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.025); transition: border-color .24s ease, background .24s ease, box-shadow .24s ease, transform .24s ease; }
.sidebar-continuous-use-card::before { position: absolute; inset: -45% auto auto -25%; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(68,142,255,.26), transparent 68%); opacity: 0; pointer-events: none; content: ''; transition: opacity .24s ease; }
.sidebar-continuous-use-card.is-active { border-color: rgba(96,165,250,.72); background: rgba(37,99,235,.17); }
.sidebar-continuous-use-card.has-pending { border-color: rgba(80,143,250,.78); background: linear-gradient(145deg, rgba(37,99,235,.24), rgba(23,62,117,.22)); box-shadow: 0 12px 24px rgba(2,12,31,.18), inset 0 0 0 1px rgba(121,170,255,.08); animation: continuous-use-card-arrive .55s cubic-bezier(.2,.8,.2,1) both; }
.sidebar-continuous-use-card.has-pending::before { opacity: 1; }
.sidebar-continuous-use-card > header { position: relative; z-index: 1; }
.sidebar-continuous-use-card > header > a { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-continuous-use-heading { min-width: 0; display: flex; align-items: center; gap: 8px; }
.sidebar-continuous-use-heading > i { width: 29px; height: 29px; display: grid; place-items: center; flex: 0 0 29px; border-radius: 9px; color: #b9d6ff; background: rgba(68,134,238,.2); font-style: normal; }
.sidebar-continuous-use-heading > span { min-width: 0; display: flex; flex-direction: column; }
.sidebar-continuous-use-heading strong { color: #f7faff; font-size: 12px; font-weight: 850; }
.sidebar-continuous-use-heading small { margin-top: 2px; overflow: hidden; color: #aebed1; font-size: 9px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-continuous-use-card > header em { min-width: 23px; height: 23px; display: grid; place-items: center; padding: 0 6px; border-radius: 999px; color: #fff; background: #ef4444; box-shadow: 0 0 0 0 rgba(239,68,68,.35); font-size: 10px; font-style: normal; font-weight: 850; }
.sidebar-continuous-use-card.has-pending > header em { animation: continuous-use-badge-pulse 2.4s ease-in-out 2 .45s; }
.sidebar-continuous-use-list { position: relative; z-index: 1; }
.sidebar-continuous-use-list > a { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 7px; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,.07); color: #d0d9e6; }
.sidebar-continuous-use-list > a:last-child { border-bottom: 0; }
.sidebar-continuous-use-list > a > span { min-width: 0; display: flex; flex-direction: column; }
.sidebar-continuous-use-list strong,
.sidebar-continuous-use-list small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-continuous-use-list strong { font-size: 11px; }
.sidebar-continuous-use-list small { margin-top: 2px; color: #a9b8ca; font-size: 10px; }
.sidebar-continuous-use-card time { padding: 4px 6px; border-radius: 5px; color: #c6d2e1; background: rgba(255,255,255,.06); font-size: 10px; font-weight: 800; }
.sidebar-continuous-use-card time.due { color: #fecaca; background: rgba(220,38,38,.2); }
.sidebar-continuous-use-list p { margin: 8px 0 2px; color: #9aabc0; font-size: 10px; text-align: center; }
.sidebar-continuous-use-heartbeat { position: absolute; z-index: 0; right: 0; bottom: -3px; left: 0; width: 100%; height: 42px; overflow: visible; color: #fca5a5; opacity: .72; pointer-events: none; }
.sidebar-continuous-use-heartbeat path { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.sidebar-continuous-use-heartbeat .heartbeat-track { stroke-width: .8; opacity: .11; }
.sidebar-continuous-use-heartbeat .heartbeat-trace { stroke-width: 1.55; stroke-dasharray: 600; stroke-dashoffset: 600; filter: drop-shadow(0 0 2.5px rgba(252,165,165,.68)); }
.sidebar-continuous-use-heartbeat .heartbeat-head { fill: currentColor; stroke: none; filter: drop-shadow(0 0 4px rgba(252,165,165,.92)); }
@keyframes continuous-use-card-arrive { from { opacity: .55; transform: translate3d(-12px,0,0) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes continuous-use-badge-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.35); transform: scale(1); } 45% { box-shadow: 0 0 0 7px rgba(239,68,68,0); transform: scale(1.08); } }

.continuous-use-editor { margin-top: 13px; padding: 12px; border: 1px solid #cfe0fc; border-radius: 10px; background: #f8fbff; }
.continuous-use-master-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.continuous-use-master-toggle > span { min-width: 0; display: flex; flex-direction: column; }
.continuous-use-master-toggle strong { font-size: 13px; }
.continuous-use-master-toggle small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.continuous-use-master-toggle > input { position: relative; width: 36px; height: 20px; flex: 0 0 36px; margin: 0; border: 0; border-radius: 999px; appearance: none; background: #cbd5e1; transition: background .18s ease; }
.continuous-use-master-toggle > input::after { position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(15,23,42,.2); content: ''; transition: transform .18s ease; }
.continuous-use-master-toggle > input:checked { background: var(--success); }
.continuous-use-master-toggle > input:checked::after { transform: translateX(16px); }
.continuous-use-fields { margin-top: 11px; padding-top: 11px; border-top: 1px solid #dbe8fb; }
.continuous-use-fields[hidden] { display: none !important; }
.continuous-use-grid { display: grid; grid-template-columns: repeat(4, minmax(110px, 1fr)); gap: 9px; }
.continuous-use-grid .field input,
.continuous-use-grid .field select { min-height: 35px; padding: 7px 8px; }
.continuous-use-result { display: flex; align-items: center; gap: 9px; margin-top: 10px; padding: 9px 10px; border: 1px solid #c8dcfb; border-radius: 8px; color: #174f9f; background: #edf5ff; }

/* Tema claro/escuro do painel. */
.theme-toggle {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: #315b91;
    background: var(--surface);
    box-shadow: 0 3px 10px rgba(16,24,40,.05);
    cursor: pointer;
    transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}
.theme-toggle:hover { color: #174f9f; border-color: #aac7ed; background: #f2f7ff; transform: translateY(-1px); }
.theme-toggle-icon { display: grid; place-items: center; }
.theme-toggle-moon { display: none; }

html[data-theme="dark"] {
    color-scheme: dark;
    --surface: #111c2b;
    --surface-2: #162335;
    --surface-3: #1d2d42;
    --surface-4: #2a3b51;
    --body: #edf4ff;
    --body-2: #c4d0df;
    --muted: #8fa2b8;
    --border: #2b3d53;
    --border-strong: #40566e;
    --shadow: 0 1px 2px rgba(0,0,0,.26), 0 10px 28px rgba(0,0,0,.22);
}
html[data-theme="dark"] body { background: #0b1421; color: var(--body); }
html[data-theme="dark"] .app-topbar { background: rgba(14, 24, 38, .96); box-shadow: 0 1px 0 rgba(255,255,255,.035); }
html[data-theme="dark"] .global-search { border-color: var(--border); color: var(--muted); background: #0d1726; }
html[data-theme="dark"] .global-search input { color: var(--body); }
html[data-theme="dark"] .global-search kbd { background: #203149; }
html[data-theme="dark"] .menu-button,
html[data-theme="dark"] .notification-button,
html[data-theme="dark"] .top-logout { color: var(--body-2); }
html[data-theme="dark"] .top-profile-link { color: #cbd8e8; border: 1px solid #344b64; background: #142236; }
html[data-theme="dark"] .top-profile-link:hover,
html[data-theme="dark"] .top-profile-link:focus-visible { color: #e8f2ff; border-color: #4c6b8d; background: #1b3048; }
html[data-theme="dark"] .top-user { border-left-color: var(--border); }
html[data-theme="dark"] .top-user-copy strong { color: var(--body); }
html[data-theme="dark"] .panel-card,
html[data-theme="dark"] .metric-card { border-color: var(--border); background: var(--surface); box-shadow: var(--shadow); }
html[data-theme="dark"] .page-main,
html[data-theme="dark"] .app-content { background: #0b1421; }
html[data-theme="dark"] .panel-heading,
html[data-theme="dark"] .conversation-panel-header,
html[data-theme="dark"] .customer-panel-title,
html[data-theme="dark"] .chat-header,
html[data-theme="dark"] .channel-line,
html[data-theme="dark"] .chat-composer { border-color: var(--border); background: var(--surface); }
html[data-theme="dark"] .conversation-search,
html[data-theme="dark"] .conversation-search input,
html[data-theme="dark"] .chat-composer textarea,
html[data-theme="dark"] .safe-window-setting input { border-color: var(--border); color: var(--body); background: var(--surface-2); }
html[data-theme="dark"] .filter-tabs,
html[data-theme="dark"] .conversation-item,
html[data-theme="dark"] .info-section,
html[data-theme="dark"] .customer-profile.compact,
html[data-theme="dark"] .customer-phone-list,
html[data-theme="dark"] .chat-status-row { border-color: var(--border); }
html[data-theme="dark"] .filter-tabs a { color: #b9c7d8; border-color: #354b64; background: #142236; }
html[data-theme="dark"] .filter-tabs a:hover { color: #edf4ff; border-color: #58718d; background: #1b2d43; }
html[data-theme="dark"] .filter-tabs a.active { color: #dcebff; border-color: #4d83c7; background: #18365d; }
html[data-theme="dark"] .filter-tabs b { color: #c8d4e2; border-color: #40566e; background: #0f1b2b; }
html[data-theme="dark"] .filter-tabs a.active b { color: #fff; border-color: #4d8fe5; background: #2f7eea; }
html[data-theme="dark"] .conversation-item:hover { background: var(--surface-2); }
html[data-theme="dark"] .conversation-item.active { background: linear-gradient(90deg, #18365d, #14263d); }
html[data-theme="dark"] .chat-messages { background-color: #0d1723; background-image: radial-gradient(circle at 12px 12px, rgba(166,190,220,.08) 1px, transparent 1px); }
html[data-theme="dark"] .message-row.incoming .message-bubble { color: var(--body); background: #1d2c3f; }
html[data-theme="dark"] .message-row.outgoing .message-bubble { color: #dff8e4; background: #174b37; }
html[data-theme="dark"] .message-status.status-enviada { color: #d7e0ea !important; }
html[data-theme="dark"] .message-status.status-entregue { color: #fff !important; }
html[data-theme="dark"] .message-status.status-lida { color: #facc15 !important; }
html[data-theme="dark"] .message-reaction-trigger,
html[data-theme="dark"] .message-reaction-picker,
html[data-theme="dark"] .message-reaction { color: #d9e7f7; border-color: #36506c; background: #132235; }
html[data-theme="dark"] .message-reaction-trigger { border-color: transparent; background: transparent; }
html[data-theme="dark"] .message-reaction-trigger:hover,
html[data-theme="dark"] .message-reaction-trigger:focus-visible { background: #223448; }
html[data-theme="dark"] .message-reaction { border-color: #0d1723; }
html[data-theme="dark"] .message-reaction.is-team { border-color: #3478d4; background: #16355d; }
html[data-theme="dark"] .day-divider span { color: var(--body-2); background: #213149; }
html[data-theme="dark"] .notification-dropdown { border-color: var(--border); background: var(--surface); box-shadow: 0 18px 48px rgba(0,0,0,.42); }
html[data-theme="dark"] .notification-dropdown-header,
html[data-theme="dark"] .notification-item { border-color: var(--border); }
html[data-theme="dark"] .notification-item.is-unread { background: #183353; }
html[data-theme="dark"] .action-button,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .icon-action { border-color: var(--border); color: var(--body-2); background: var(--surface-2); }
html[data-theme="dark"] .theme-toggle { border-color: #49627e; color: #ffd873; background: #142338; box-shadow: none; }
html[data-theme="dark"] .theme-toggle:hover { border-color: #6f8dad; background: #1b304a; }
html[data-theme="dark"] .theme-toggle-moon { display: grid; }
html[data-theme="dark"] .theme-toggle-sun { display: none; }
html[data-theme="dark"] .chart-summary { color: var(--body-2); border-top-color: var(--border); background: var(--surface-2); }
html[data-theme="dark"] .chart-summary span { color: var(--body-2); }
html[data-theme="dark"] body[data-page="atendimentos"] .app-modal {
    color: var(--body);
    border-color: #40566e;
    background: #111c2b;
    box-shadow: 0 24px 70px rgba(0,0,0,.58);
}
html[data-theme="dark"] body[data-page="atendimentos"] .app-modal > header,
html[data-theme="dark"] body[data-page="atendimentos"] .modal-actions {
    border-color: #2b3d53;
    background: #111c2b;
}
html[data-theme="dark"] body[data-page="atendimentos"] .transfer-option {
    color: #edf4ff;
    border-color: #40566e;
    background: #162335;
}
html[data-theme="dark"] body[data-page="atendimentos"] .transfer-option:not(:disabled):hover {
    border-color: #4d83c7;
    background: #18365d;
}
html[data-theme="dark"] body[data-page="atendimentos"] .confirmation-symbol {
    color: #ff8f96;
    background: #421f28;
}
html[data-theme="dark"] body[data-page="atendimentos"] .modal-actions .ghost-button {
    color: #b9d7ff;
    border-color: #40566e;
    background: #18385f;
}
html[data-theme="dark"] body[data-page="atendimentos"] .modal-actions .ghost-button:hover {
    color: #fff;
    border-color: #4d83c7;
    background: #245b9e;
}
html[data-theme="dark"] body[data-page="fila"] #queue-remove-modal {
    color: var(--body);
    border-color: #40566e;
    background: #111c2b;
    box-shadow: 0 24px 70px rgba(0,0,0,.58);
}
html[data-theme="dark"] body[data-page="fila"] #queue-remove-modal > header,
html[data-theme="dark"] body[data-page="fila"] #queue-remove-modal .modal-actions {
    border-color: #2b3d53;
    background: #111c2b;
}
html[data-theme="dark"] body[data-page="fila"] #queue-remove-modal .confirmation-symbol {
    color: #ff8f96;
    background: #421f28;
}
html[data-theme="dark"] body[data-page="fila"] #queue-remove-modal .ghost-button {
    color: #b9d7ff;
    border-color: #40566e;
    background: #18385f;
}
html[data-theme="dark"] body[data-page="fila"] #queue-remove-modal .ghost-button:hover {
    color: #fff;
    border-color: #4d83c7;
    background: #245b9e;
}
html[data-theme="dark"] body[data-page="dashboard"] .status-circle.available { background: #143b2b !important; }
html[data-theme="dark"] body[data-page="dashboard"] .status-circle.busy { background: #17375d !important; }
html[data-theme="dark"] body[data-page="dashboard"] .status-circle.pause { background: #35245d !important; }
html[data-theme="dark"] body[data-page="dashboard"] .status-circle.offline { background: #243246 !important; }
html[data-theme="dark"] body[data-page="dashboard"] .bar-grid-lines i {
    border-color: #34495f;
}
html[data-theme="dark"] body[data-page="dashboard"] .bar-grid-lines i:last-child {
    border-color: #526a83;
}
html[data-theme="dark"] body[data-page="dashboard"] .status-em_atendimento {
    color: #b9d7ff;
    background: #18385f;
}
html[data-theme="dark"] body[data-page="dashboard"] .status-finalizado {
    color: #9be3b8;
    background: #173d2d;
}
html[data-theme="dark"] body[data-page="dashboard"] .status-fila,
html[data-theme="dark"] body[data-page="dashboard"] .status-aguardando_cliente {
    color: #f0c879;
    background: #3a2c17;
}
html[data-theme="dark"] body[data-page="dashboard"] .queue-preview-list > a > b,
html[data-theme="dark"] body[data-page="fila"] .queue-position {
    color: #9ac7ff;
    background: #18385f;
}
html[data-theme="dark"] :is(body[data-page="dashboard"], body[data-page="fila"]) .priority-normal {
    color: #b9d7ff;
    background: #18385f;
}
html[data-theme="dark"] :is(body[data-page="dashboard"], body[data-page="fila"]) .priority-alta {
    color: #ff9da2;
    background: #421f28;
}
html[data-theme="dark"] :is(body[data-page="dashboard"], body[data-page="fila"]) .priority-baixa {
    color: #c4d0df;
    background: #243246;
}
html[data-theme="dark"] body[data-page="fila"] .channel-badge {
    color: #9be3b8;
    background: #173d2d;
}
html[data-theme="dark"] body[data-page="fila"] .automation-card {
    color: var(--body);
    border-color: #365b85;
    background: linear-gradient(110deg, #142e4e, #111c2b);
    box-shadow: none;
}
html[data-theme="dark"] body[data-page="fila"] .automation-card > i {
    color: #8fc1ff;
    background: #1b3b61;
}
html[data-theme="dark"] body[data-page="fila"] .automation-card > em {
    color: #91e0b2;
    background: #173d2d;
}
html[data-theme="dark"] body[data-page="fila"] .automation-card > a {
    color: #b9c9da;
    border-color: #40566e;
    background: #18273a;
}
html[data-theme="dark"] body[data-page="fila"] .next-queue-card {
    border-color: #315d50;
    background: linear-gradient(110deg, #15372d, #111c2b);
    box-shadow: none;
}
html[data-theme="dark"] body[data-page="fila"] .compact-select select {
    color: #d4deea;
    border-color: #40566e;
    background: #162335;
}
html[data-theme="dark"] body[data-page="fila"] .compact-select select:focus {
    border-color: #5f8fc8;
}
html[data-theme="dark"] body[data-page="fila"] .data-table th {
    color: #aebdd0;
    border-color: #40566e;
    background: #172538;
}
html[data-theme="dark"] body[data-page="fila"] .table-footer {
    color: #9eafc3;
    border-color: #40566e;
    background: #111c2b;
}
html[data-theme="dark"] body[data-page="fila"] .table-footer button {
    color: #aebdd0;
    border-color: #40566e;
    background: #18273a;
}
html[data-theme="dark"] body[data-page="fila"] .table-footer button.active {
    color: #fff;
    border-color: #2f7eea;
    background: #2f7eea;
}
html[data-theme="dark"] body[data-page="clientes"] .client-search button {
    color: #b9d7ff;
    background: #18385f;
}
html[data-theme="dark"] body[data-page="clientes"] .client-list-item.active {
    background: #18365d;
}
html[data-theme="dark"] body[data-page="clientes"] .client-list-item em {
    color: #a9cfff;
    background: #1a3454;
}
html[data-theme="dark"] body[data-page="clientes"] .photo-upload {
    color: #b9c9da;
    border-color: #40566e;
    background: #18273a;
}
html[data-theme="dark"] body[data-page="clientes"] .photo-upload:hover {
    color: #b9d7ff;
    border-color: #5f8fc8;
    background: #1c385a;
}
html[data-theme="dark"] body[data-page="clientes"] .avatar-preset-option {
    border-color: #354b64;
    background: #121f30;
}
html[data-theme="dark"] body[data-page="clientes"] .avatar-preset-option:hover,
html[data-theme="dark"] body[data-page="clientes"] .avatar-preset-option:has(input:checked) {
    border-color: #4d83c7;
    background: #18365d;
}
html[data-theme="dark"] body[data-page="clientes"] .catalog-product-selected {
    color: #d4deea;
    border-color: #3e6695;
    background: #142f50;
}
html[data-theme="dark"] body[data-page="clientes"] .catalog-product-selected button {
    color: #aebed1;
    background: #1d395b;
}
html[data-theme="dark"] body[data-page="clientes"] .continuous-use-editor {
    border-color: #40566e;
    background: #142236;
}
html[data-theme="dark"] body[data-page="clientes"] .continuous-use-fields {
    border-color: #40566e;
}
html[data-theme="dark"] body[data-page="clientes"] .continuous-use-master-toggle > input {
    background: #52657b;
}
html[data-theme="dark"] body[data-page="clientes"] .continuous-use-master-toggle > input:checked {
    background: var(--success);
}
html[data-theme="dark"] :is(body[data-page="clientes"], body[data-page="atendimentos"]) .continuous-use-editor {
    color: var(--body);
    border-color: #40566e;
    background: #142236;
}
html[data-theme="dark"] :is(body[data-page="clientes"], body[data-page="atendimentos"]) .continuous-use-fields {
    border-color: #40566e;
}
html[data-theme="dark"] :is(body[data-page="clientes"], body[data-page="atendimentos"]) .continuous-use-result {
    color: #a9cfff;
    border-color: #3e6695;
    background: #142f50;
}
html[data-theme="dark"] :is(body[data-page="clientes"], body[data-page="atendimentos"]) .continuous-use-result small {
    color: #9fb4cd;
}
html[data-theme="dark"] :is(body[data-page="clientes"], body[data-page="atendimentos"]) .continuous-use-permissions label {
    color: #d4deea;
    border-color: #40566e;
    background: #18273a;
}
html[data-theme="dark"] :is(body[data-page="clientes"], body[data-page="atendimentos"]) .continuous-use-permissions label:hover {
    border-color: #5f8fc8;
    background: #1c385a;
}
html[data-theme="dark"] :is(body[data-page="clientes"], body[data-page="atendimentos"]) .continuous-use-permissions label:has(input:checked) {
    border-color: #398260;
    background: #173d2d;
}
html[data-theme="dark"] :is(body[data-page="clientes"], body[data-page="atendimentos"]) .continuous-use-permissions input {
    background: #52657b;
}
html[data-theme="dark"] :is(body[data-page="clientes"], body[data-page="atendimentos"]) .continuous-use-permissions input:checked {
    background: var(--success);
}
html[data-theme="dark"] body[data-page="atendimentos"] .catalog-product-selected {
    color: #d4deea;
    border-color: #3e6695;
    background: #142f50;
}
html[data-theme="dark"] body[data-page="atendimentos"] .catalog-product-selected button {
    color: #aebed1;
    background: #1d395b;
}
html[data-theme="dark"] body[data-page="usuarios"] .data-table th {
    color: #aebdd0;
    border-color: #40566e;
    background: #172538;
}
html[data-theme="dark"] body[data-page="usuarios"] .selected-row td {
    background: #18365d !important;
}
html[data-theme="dark"] body[data-page="usuarios"] .table-footer {
    color: #9eafc3;
    border-color: #40566e;
    background: #111c2b;
}
html[data-theme="dark"] body[data-page="usuarios"] .table-footer button {
    color: #aebdd0;
    border-color: #40566e;
    background: #18273a;
}
html[data-theme="dark"] body[data-page="usuarios"] .table-footer button.active {
    color: #fff;
    border-color: #2f7eea;
    background: #2f7eea;
}
html[data-theme="dark"] body[data-page="usuarios"] .photo-upload {
    color: #b9c9da;
    border-color: #40566e;
    background: #18273a;
}
html[data-theme="dark"] body[data-page="usuarios"] .photo-upload:hover {
    color: #b9d7ff;
    border-color: #5f8fc8;
    background: #1c385a;
}
html[data-theme="dark"] body[data-page="usuarios"] .avatar-preset-option {
    border-color: #354b64;
    background: #121f30;
}
html[data-theme="dark"] body[data-page="usuarios"] .avatar-preset-option:hover,
html[data-theme="dark"] body[data-page="usuarios"] .avatar-preset-option:has(input:checked) {
    border-color: #4d83c7;
    background: #18365d;
}
html[data-theme="dark"] body[data-page="usuarios"] .user-status-disponivel {
    color: #91e0b2;
    background: #173d2d;
}
html[data-theme="dark"] body[data-page="usuarios"] .user-status-atendimento {
    color: #b9d7ff;
    background: #18385f;
}
html[data-theme="dark"] body[data-page="usuarios"] .user-status-pausa {
    color: #d7b8ff;
    background: #35245d;
}
html[data-theme="dark"] body[data-page="usuarios"] .user-status-offline {
    color: #aebed1;
    background: #243246;
}
html[data-theme="dark"] body[data-page="usuarios"] .field input:-webkit-autofill,
html[data-theme="dark"] body[data-page="usuarios"] .field input:-webkit-autofill:hover,
html[data-theme="dark"] body[data-page="usuarios"] .field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #edf4ff;
    box-shadow: 0 0 0 1000px #162335 inset;
}
html[data-theme="dark"] :is(body[data-page="configuracoes"], body[data-page="perfil"]) .settings-nav a.active {
    color: #dcebff;
    background: #18365d;
}
html[data-theme="dark"] body[data-page="configuracoes"] .settings-record.active {
    color: #dcebff;
    border-color: #4d83c7;
    background: #18365d;
}
html[data-theme="dark"] body[data-page="configuracoes"] .record-icon {
    color: #9ac7ff;
    background: #18385f;
}
html[data-theme="dark"] body[data-page="configuracoes"] .record-icon.whatsapp {
    color: #9be3b8;
    background: #173d2d;
}
html[data-theme="dark"] :is(body[data-page="configuracoes"], body[data-page="perfil"]) .settings-step-list b {
    color: #9ac7ff;
    background: #18385f;
}
html[data-theme="dark"] :is(body[data-page="configuracoes"], body[data-page="perfil"]) .settings-callout,
html[data-theme="dark"] body[data-page="configuracoes"] .catalog-security-note {
    color: #9ac7ff;
    border-color: #345579;
    background: #132c49;
}
html[data-theme="dark"] body[data-page="configuracoes"] .catalog-security-note small {
    color: #b9c7d8;
}
html[data-theme="dark"] :is(body[data-page="configuracoes"], body[data-page="perfil"]) .api-state.online {
    color: #9be3b8;
    background: #173d2d;
}
html[data-theme="dark"] :is(body[data-page="configuracoes"], body[data-page="perfil"]) .api-state.demo {
    color: #f0c879;
    background: #382b16;
}
html[data-theme="dark"] body[data-page="configuracoes"] .api-state.offline {
    color: #ff9da2;
    background: #421f28;
}
html[data-theme="dark"] body[data-page="configuracoes"] .alert-box.success {
    color: #9be3b8;
    border-color: #2d684c;
    background: #173d2d;
}
html[data-theme="dark"] body[data-page="configuracoes"] .alert-box.warning {
    color: #f0c879;
    border-color: #72562b;
    background: #382b16;
}
html[data-theme="dark"] body[data-page="configuracoes"] .alert-box.info {
    color: #9ac7ff;
    border-color: #345579;
    background: #132c49;
}
html[data-theme="dark"] body[data-page="configuracoes"] .integration-status-card.error,
html[data-theme="dark"] body[data-page="configuracoes"] .integration-error-card {
    color: #ff9da2;
    border-color: #74404a;
    background: #421f28;
}
html[data-theme="dark"] body[data-page="configuracoes"] .integration-status-card.error strong,
html[data-theme="dark"] body[data-page="configuracoes"] .integration-status-card.error small {
    color: #ff9da2;
}
html[data-theme="dark"] body[data-page="configuracoes"] .integration-status-card.warning {
    border-color: #72562b;
    background: #382b16;
}
html[data-theme="dark"] body[data-page="configuracoes"] .integration-status-card.warning strong,
html[data-theme="dark"] body[data-page="configuracoes"] .integration-status-card.warning small {
    color: #f0c879;
}
html[data-theme="dark"] body[data-page="configuracoes"] .field.field-error :is(input, select, textarea) {
    border-color: #74404a;
    background: #281a22;
}
html[data-theme="dark"] body[data-page="configuracoes"] .field.field-warning :is(input, select, textarea) {
    border-color: #72562b;
    background: #261f16;
}
html[data-theme="dark"] body[data-page="perfil"] .photo-upload {
    color: #b9d7ff;
    border-color: #40566e;
    background: #162335;
}
html[data-theme="dark"] body[data-page="perfil"] .photo-upload:hover {
    color: #dcebff;
    border-color: #4d83c7;
    background: #18365d;
}
html[data-theme="dark"] body[data-page="perfil"] .avatar-preset-option {
    background: #121f30;
}
html[data-theme="dark"] body[data-page="perfil"] .avatar-preset-option:hover,
html[data-theme="dark"] body[data-page="perfil"] .avatar-preset-option:has(input:checked) {
    border-color: #4d83c7;
    background: #18365d;
}
html[data-theme="dark"] :is(body[data-page="configuracoes"], body[data-page="perfil"]) .ghost-button:not(.danger) {
    color: #b9d7ff;
    border-color: #40566e;
    background: #18385f;
}
html[data-theme="dark"] :is(body[data-page="configuracoes"], body[data-page="perfil"]) .ghost-button:not(.danger):hover {
    color: #fff;
    border-color: #4d83c7;
    background: #245b9e;
}
html[data-theme="dark"] body[data-page="perfil"] .ghost-button.danger,
html[data-theme="dark"] body[data-page="configuracoes"] .ghost-button.danger {
    color: #ff9da2;
    border-color: #74404a;
    background: #421f28;
}
html[data-theme="dark"] :is(body[data-page="configuracoes"], body[data-page="perfil"]) .field input:-webkit-autofill,
html[data-theme="dark"] :is(body[data-page="configuracoes"], body[data-page="perfil"]) .field input:-webkit-autofill:hover,
html[data-theme="dark"] :is(body[data-page="configuracoes"], body[data-page="perfil"]) .field input:-webkit-autofill:focus {
    -webkit-text-fill-color: #edf4ff;
    box-shadow: 0 0 0 1000px #162335 inset;
}
html[data-theme="dark"] body[data-page="relatorios"] .bar-grid-lines i {
    border-color: #34495f;
}
html[data-theme="dark"] body[data-page="relatorios"] .bar-grid-lines i:last-child {
    border-color: #526a83;
}
html[data-theme="dark"] body[data-page="relatorios"] .bar-column small strong.is-recent-period {
    color: #f0c879;
}
html[data-theme="dark"] body[data-page="relatorios"] .ranking-list > div > b {
    color: #9ac7ff;
    background: #18385f;
}
html[data-theme="dark"] body[data-page="relatorios"] .insight-icon.red-bg {
    color: #ff9da2;
    background: #421f28;
}
html[data-theme="dark"] body[data-page="relatorios"] .insight-icon.blue-bg {
    color: #9ac7ff;
    background: #18385f;
}
html[data-theme="dark"] body[data-page="relatorios"] .insight-icon.green-bg {
    color: #9be3b8;
    background: #173d2d;
}
html[data-theme="dark"] body[data-page="atendimentos"] .whatsapp-window-status.is-open,
html[data-theme="dark"] body[data-page="atendimentos"] .inactivity-status {
    color: #9ac7ff;
    background: #132c49;
}
html[data-theme="dark"] body[data-page="atendimentos"] .whatsapp-window-status.is-closed {
    color: #f0c879;
    background: #382b16;
}
html[data-theme="dark"] body[data-page="atendimentos"] .inactivity-status.urgent {
    color: #ff9da2;
    background: #421f28;
}
html[data-theme="dark"] body[data-page="atendimentos"] .chat-status-row > .inactivity-status {
    border-color: #345579;
}
html[data-theme="dark"] body[data-page="atendimentos"] .status-em_atendimento {
    color: #b9d7ff;
    background: #18385f;
}
html[data-theme="dark"] body[data-page="atendimentos"] .status-finalizado {
    color: #9be3b8;
    background: #173d2d;
}
html[data-theme="dark"] body[data-page="atendimentos"] .status-fila,
html[data-theme="dark"] body[data-page="atendimentos"] .status-aguardando_cliente {
    color: #f0c879;
    background: #3a2c17;
}
html[data-theme="dark"] body[data-page="atendimentos"] .status-aguardando_aceite {
    color: #d7b8ff;
    background: #35245d;
}
html[data-theme="dark"] body[data-page="atendimentos"] .tag {
    color: #a9cfff;
    background: #18385f;
}
html[data-theme="dark"] body[data-page="atendimentos"] .customer-phone-list > span.primary {
    color: #9bc8ff;
    border-color: #3e6695;
    background: #142f50;
}
html[data-theme="dark"] body[data-page="atendimentos"] .purchase-card-status {
    color: #8fe1b4;
    background: #153d2d;
}
html[data-theme="dark"] body[data-page="atendimentos"] .composer-icon {
    color: #b8c8da;
    border-color: #40566e;
    background: #18273a;
}
html[data-theme="dark"] body[data-page="atendimentos"] .composer-icon:hover {
    color: #edf4ff;
    border-color: #5b7593;
    background: #22364d;
}
html[data-theme="dark"] body[data-page="atendimentos"] .composer-icon.is-recording {
    color: #fecaca;
    border-color: #ef4444 !important;
    background: #4a1d24 !important;
}
html[data-theme="dark"] .top-status select {
    color: #aebed1;
    background: #0f1d2d;
    color-scheme: dark;
}
html[data-theme="dark"] .top-status select option {
    color: #e8f0fa;
    background: #0f1d2d;
}
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-categories button:hover,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-categories button.active,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-categories button:focus,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-categories button:focus-visible,
html[data-theme="dark"] body[data-page="atendimentos"] .emoji-categories button.active,
html[data-theme="dark"] body[data-page="atendimentos"] .emoji-categories button:hover,
html[data-theme="dark"] body[data-page="atendimentos"] .emoji-categories button:focus-visible {
    color: #dbeafe;
    border-color: #3b82f6;
    background: #17375d;
}
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:first-child,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:hover,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:focus-visible {
    color: #f4f8ff;
    border-color: #3b82f6;
    background: #17375d;
}
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:first-child strong,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:hover strong,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:focus-visible strong {
    color: #f4f8ff;
}
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:first-child small,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:hover small,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:focus-visible small {
    color: #a9bad0;
}
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:first-child > b,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:hover > b,
html[data-theme="dark"] body[data-page="atendimentos"] .command-product-content .quick-product-option:focus-visible > b {
    color: #72adff;
}
html[data-theme="dark"] body[data-page="atendimentos"] .conversation-cycle-divider > span {
    color: #c2d0df;
    border-color: #40566e;
    background: #1a293b;
    box-shadow: none;
}
html[data-theme="dark"] body[data-page="atendimentos"] .conversation-cycle-divider.is-end > span {
    background: #17372d;
}
html[data-theme="dark"] body[data-page="atendimentos"] .chat-panel {
    --chat-l-message-bg: #091521;
    --chat-l-message-pattern: radial-gradient(circle at 12px 12px, rgba(166,190,220,.08) 1px, transparent 1px);
}
@media (min-width: 1501px) {
    html[data-theme="dark"] body[data-page="atendimentos"] .chat-panel {
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    html[data-theme="dark"] body[data-page="atendimentos"] .chat-messages {
        background: transparent;
    }
}
@media (max-width: 760px) {
    .theme-toggle { width: 36px; height: 36px; }
}
.continuous-use-result > span { min-width: 0; display: flex; flex-direction: column; }
.continuous-use-result strong { font-size: 12px; }
.continuous-use-result strong b { font-size: 17px; }
.continuous-use-result small { margin-top: 3px; color: #55739c; font-size: 11px; }
.continuous-use-permissions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 9px; }
.continuous-use-permissions label { min-width: 0; display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px; color: var(--body-2); background: var(--surface); cursor: pointer; transition: border-color .18s ease, background .18s ease, opacity .18s ease; }
.continuous-use-permissions label:hover { border-color: #8bb5fb; background: var(--primary-soft); }
.continuous-use-permissions label:has(input:checked) { border-color: #77c99c; background: var(--success-soft); }
.continuous-use-permissions label:has(input:disabled) { cursor: not-allowed; opacity: .5; }
.continuous-use-permissions label > span { min-width: 0; display: flex; flex-direction: column; }
.continuous-use-permissions label strong { font-size: 10px; }
.continuous-use-permissions label small { margin-top: 2px; color: var(--muted); font-size: 9px; line-height: 1.3; }
.continuous-use-permissions input { position: relative; width: 34px; height: 19px; flex: 0 0 34px; margin: 0; border: 0; border-radius: 999px; appearance: none; background: #a9b7c7; transition: background .18s ease; }
.continuous-use-permissions input::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(15,23,42,.24); content: ''; transition: transform .18s ease; }
.continuous-use-permissions input:checked { background: var(--success); }
.continuous-use-permissions input:checked::after { transform: translateX(15px); }
.continuous-use-privacy { display: flex; align-items: flex-start; gap: 6px; margin: 9px 0 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
.continuous-use-editor.is-compact { margin: 4px 0 0; padding: 9px; }
.continuous-use-editor.is-compact .continuous-use-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.continuous-use-editor.is-compact .continuous-use-grid .field > span { font-size: 10px; }
.continuous-use-editor.is-compact .continuous-use-grid .field input,
.continuous-use-editor.is-compact .continuous-use-grid .field select { min-height: 34px; padding: 6px 8px; font-size: 11px; }
.continuous-use-editor.is-compact .continuous-use-result { margin-top: 8px; padding: 7px; }
.continuous-use-editor.is-compact .continuous-use-permissions { grid-template-columns: 1fr; gap: 6px; }

.continuous-use-status { padding: 4px 8px; border-radius: 999px; font-size: 10px; font-style: normal; font-weight: 800; }
.continuous-use-status.status-ativo { color: #08783d; background: #e8f8ee; }
.continuous-use-status.status-pausado { color: #9a5b08; background: #fff5dc; }
.continuous-use-status.status-concluido,
.continuous-use-status.status-cancelado { color: #667085; background: #eef1f5; }
.continuous-use-summary-card > header h4 { flex: 1; }
.continuous-use-summary-card > div { display: flex; align-items: center; gap: 9px; }
.continuous-use-summary-card > div img { width: 45px; height: 45px; flex: 0 0 45px; padding: 2px; border: 1px solid var(--border); border-radius: 8px; object-fit: contain; background: #fff; }
.continuous-use-summary-card > div > span { min-width: 0; display: flex; flex-direction: column; }
.continuous-use-summary-card > div strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.continuous-use-summary-card > div small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.client-continuous-use-list { margin-top: 12px; border: 1px solid var(--border); border-radius: 9px; overflow: hidden; }
.client-continuous-use-list > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 11px; background: var(--surface-2); }
.client-continuous-use-list > header strong { font-size: 12px; }
.client-continuous-use-list > header a { color: var(--primary); font-size: 10px; font-weight: 800; }
.client-continuous-use-list article { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 9px; padding: 8px 10px; border-top: 1px solid var(--border); }
.client-continuous-use-list img,
.client-continuous-use-list article > i { width: 38px; height: 38px; display: grid; place-items: center; padding: 2px; border: 1px solid var(--border); border-radius: 7px; object-fit: contain; background: #fff; color: var(--primary); }
.client-continuous-use-list article > span { min-width: 0; display: flex; flex-direction: column; }
.client-continuous-use-list article strong,
.client-continuous-use-list article small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-continuous-use-list article strong { font-size: 12px; }
.client-continuous-use-list article small { margin-top: 3px; color: var(--muted); font-size: 10px; }

body[data-page="uso_continuo"] .page-main { display: flex; flex-direction: column; }
.continuous-use-page { min-height: 0; display: flex; flex: 1; flex-direction: column; gap: 11px; }
.continuous-use-page > .alert-box { flex: 0 0 auto; margin: 0; }
.continuous-use-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; flex: 0 0 auto; }
.continuous-use-metrics article { min-height: 96px; display: flex; align-items: center; gap: 14px; padding: 15px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.continuous-use-metrics article > i { width: 50px; height: 50px; display: grid; place-items: center; flex: 0 0 50px; border-radius: 12px; }
.continuous-use-metrics article > i.blue { color: var(--primary); background: var(--primary-soft); }
.continuous-use-metrics article > i.red { color: var(--danger); background: var(--danger-soft); }
.continuous-use-metrics article > i.orange { color: #b86405; background: var(--orange-soft); }
.continuous-use-metrics article > i.green { color: var(--success); background: var(--success-soft); }
.continuous-use-metrics article > span { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 7px; }
.continuous-use-metrics small { grid-column: 1 / -1; color: var(--body-2); font-size: 12px; font-weight: 650; }
.continuous-use-metrics strong { font-size: 28px; line-height: 1; }
.continuous-use-metrics em { color: var(--muted); font-size: 11px; font-style: normal; }
.continuous-use-main-card { min-height: 0; display: flex; flex: 1; flex-direction: column; overflow: hidden; }
.continuous-use-toolbar { min-height: 66px; display: flex; align-items: center; gap: 12px; padding: 11px 15px; border-bottom: 1px solid var(--border); }
.continuous-use-toolbar nav { display: flex; align-items: center; gap: 3px; }
.continuous-use-toolbar nav a { min-height: 38px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 8px; color: var(--muted); font-size: 12px; font-weight: 800; }
.continuous-use-toolbar nav a:hover { color: var(--primary); background: var(--primary-soft); }
.continuous-use-toolbar nav a.active { color: #fff; background: var(--primary); }
.continuous-use-search { min-width: 280px; height: 40px; display: flex; align-items: center; gap: 7px; margin-left: auto; padding: 0 5px 0 11px; border: 1px solid var(--border); border-radius: 9px; background: #fff; }
.continuous-use-search .ui-icon { color: var(--muted); }
.continuous-use-search input { min-width: 0; flex: 1; border: 0; outline: 0; font-size: 12px; }
.continuous-use-search button { height: 30px; padding: 0 10px; border: 0; border-radius: 7px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 800; }
.continuous-use-config-toggle { min-height: 40px; padding: 0 12px; font-size: 11px; white-space: nowrap; }
.continuous-use-config { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(180px, .8fr) 90px minmax(190px, .8fr) auto; align-items: end; gap: 10px; padding: 11px 13px; border-bottom: 1px solid var(--border); background: #f8fbff; }
.continuous-use-config[hidden] { display: none !important; }
.continuous-use-config > div { align-self: center; display: flex; flex-direction: column; }
.continuous-use-config > div strong { font-size: 13px; }
.continuous-use-config > div small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.continuous-use-config .field input { min-height: 34px; padding: 6px 8px; }
.continuous-use-inline-toggle { min-height: 34px; display: flex; align-items: center; gap: 7px; }
.continuous-use-inline-toggle > span { display: flex; flex-direction: column; }
.continuous-use-inline-toggle strong { font-size: 11px; }
.continuous-use-inline-toggle small { color: var(--muted); font-size: 10px; }
.continuous-use-inline-toggle input { accent-color: var(--success); }
.continuous-use-config .primary-button { min-height: 38px; padding: 0 13px; font-size: 11px; white-space: nowrap; }
.continuous-use-table-wrap { min-height: 0; flex: 1; overflow: auto; scrollbar-width: thin; }
.continuous-use-table { width: 100%; min-width: 1260px; border-collapse: collapse; }
.continuous-use-table th { position: sticky; z-index: 3; top: 0; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--muted); background: #fbfcfe; font-size: 11px; text-align: left; text-transform: uppercase; letter-spacing: .045em; }
.continuous-use-table td { min-width: 130px; padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.continuous-use-table tr.is-due { background: #fffafa; }
.continuous-use-table tr:hover { background: #f9fbfe; }
.continuous-use-client { min-width: 180px; display: flex; align-items: center; gap: 8px; }
.continuous-use-client > span:last-child,
.continuous-use-product > span,
.continuous-use-consumption,
.continuous-use-forecast,
.continuous-use-whatsapp { min-width: 0; display: flex; flex-direction: column; }
.continuous-use-client strong,
.continuous-use-product strong { overflow: hidden; max-width: 240px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.continuous-use-client small,
.continuous-use-product small,
.continuous-use-consumption small,
.continuous-use-forecast small,
.continuous-use-whatsapp small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.continuous-use-product { min-width: 190px; display: flex; align-items: center; gap: 8px; }
.continuous-use-product img,
.continuous-use-product > i { width: 46px; height: 46px; display: grid; place-items: center; flex: 0 0 46px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; object-fit: contain; background: #fff; color: var(--primary); }
.continuous-use-consumption strong,
.continuous-use-forecast strong,
.continuous-use-whatsapp strong { font-size: 12px; }
.continuous-use-forecast small.due { color: var(--danger); font-weight: 800; }
.continuous-use-whatsapp { color: var(--body-2); }
.continuous-use-whatsapp-title { display: flex; align-items: center; gap: 6px; }
.continuous-use-whatsapp.window-open .continuous-use-whatsapp-title,
.continuous-use-whatsapp .template-state.authorized { color: #08783d; }
.continuous-use-whatsapp:not(.window-open) .continuous-use-whatsapp-title,
.continuous-use-whatsapp .template-state:not(.authorized) { color: #a13d3d; }
.continuous-use-whatsapp .window-state { font-weight: 700; }
.continuous-use-actions { min-width: 420px; display: flex; align-items: center; gap: 6px; }
.continuous-use-actions form { margin: 0; }
.continuous-use-actions button { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; padding: 0 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--body-2); background: #fff; font-size: 11px; font-weight: 800; white-space: nowrap; }
.continuous-use-actions button.primary { color: #fff; border-color: var(--primary); background: var(--primary); }
.continuous-use-actions button.template { color: #174f9f; border-color: #b9d2f8; background: #edf5ff; }
.continuous-use-actions button.edit { color: #5b3bb3; border-color: #d8ccfb; background: #f5f1ff; }
.continuous-use-actions button.danger { color: var(--danger); border-color: #fecaca; background: #fff5f5; }
.continuous-use-actions button:disabled { opacity: .45; }
.continuous-use-finished { color: var(--muted); font-size: 11px; }
.continuous-use-footer { min-height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--border); color: var(--muted); background: #fff; font-size: 10px; }
.continuous-use-message-modal { width: min(760px, calc(100vw - 28px)); }
.continuous-use-message-modal .modal-body > p { font-size: 12px; line-height: 1.5; }
.continuous-use-message-modal textarea { min-height: 132px; padding: 12px; font-size: 13px; line-height: 1.55; resize: vertical; }
.continuous-use-model-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.continuous-use-model-picker .field { margin: 0; }
.continuous-use-model-picker select { min-height: 40px; font-size: 12px; }
.continuous-use-model-actions { display: flex; align-items: center; gap: 7px; padding-bottom: 1px; }
.continuous-use-model-actions button,
.continuous-use-variable-chips button { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 0 10px; border: 1px solid #cbdaf2; border-radius: 8px; color: #174f9f; background: #f5f9ff; font-size: 10px; font-weight: 800; }
.continuous-use-model-actions button:hover,
.continuous-use-variable-chips button:hover { border-color: #8db4ef; background: #eaf3ff; }
.continuous-use-variable-chips { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 12px 0 9px; }
.continuous-use-variable-chips button { min-height: 29px; padding: 0 8px; border-radius: 999px; color: #5b3bb3; border-color: #ddd3fa; background: #f8f5ff; }
.continuous-use-message-preview { margin-top: 11px; padding: 11px 12px; border: 1px solid #cbe1d2; border-radius: 10px; background: #f1fbf4; }
.continuous-use-message-preview > span { display: block; margin-bottom: 5px; color: #187443; font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .04em; }
.continuous-use-message-preview > p { margin: 0; color: #183c28; font-size: 12px; line-height: 1.5; white-space: pre-wrap; }
.continuous-use-model-editor-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; padding: 11px; border: 1px solid #d8e4f6; border-radius: 10px; background: #f7faff; }
.continuous-use-model-editor-heading > span { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 38px; border-radius: 10px; color: var(--primary); background: var(--primary-soft); }
.continuous-use-model-editor-heading > div { display: flex; flex-direction: column; }
.continuous-use-model-editor-heading strong { font-size: 13px; }
.continuous-use-model-editor-heading small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.continuous-use-model-default { display: flex; align-items: center; gap: 7px; margin-top: 11px; color: var(--body-2); font-size: 11px; font-weight: 750; }
.continuous-use-model-default input { accent-color: var(--primary); }
.continuous-use-model-delete-confirm { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 3px 12px; margin-top: 12px; padding: 11px 12px; border: 1px solid #fecaca; border-radius: 9px; background: #fff6f6; }
.continuous-use-model-delete-confirm[hidden] { display: none !important; }
.continuous-use-model-delete-confirm strong { color: #a91d25; font-size: 11px; }
.continuous-use-model-delete-confirm span { grid-column: 1; color: #9b4b50; font-size: 10px; }
.continuous-use-model-delete-confirm > div { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 6px; }
.continuous-use-model-delete-confirm button { min-height: 32px; padding: 0 9px; border: 1px solid #e3b8bb; border-radius: 7px; color: #8f343a; background: #fff; font-size: 9px; font-weight: 800; }
.continuous-use-model-delete-confirm button.danger { color: #fff; border-color: #cf303a; background: #cf303a; }
.continuous-use-model-editor-actions .danger-button { margin-right: auto; }
.danger-button { min-height: 38px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 13px; border: 1px solid #dc303a; border-radius: 8px; color: #fff; background: linear-gradient(135deg, #e13d47, #c82530); font-size: 11px; font-weight: 800; white-space: nowrap; }
.danger-button:hover { background: linear-gradient(135deg, #cf303a, #ad1f28); transform: translateY(-1px); }
.continuous-use-edit-modal { width: min(760px, calc(100vw - 28px)); }
.continuous-use-edit-product { display: flex; align-items: center; gap: 11px; margin-bottom: 11px; padding: 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.continuous-use-edit-product > img,
.continuous-use-edit-product > i { width: 52px; height: 52px; display: grid; place-items: center; flex: 0 0 52px; padding: 4px; border: 1px solid var(--border); border-radius: 10px; object-fit: contain; color: var(--primary); background: #fff; font-style: normal; }
.continuous-use-edit-product > span { min-width: 0; display: flex; flex-direction: column; }
.continuous-use-edit-product small { color: var(--muted); font-size: 10px; }
.continuous-use-edit-product strong { margin-top: 2px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.continuous-use-edit-product em { width: fit-content; margin-top: 4px; padding: 3px 7px; border-radius: 999px; color: #174f9f; background: #eaf3ff; font-size: 9px; font-style: normal; font-weight: 800; }
.continuous-use-editor.is-modal { margin-top: 0; }
.continuous-use-editor.is-modal .continuous-use-fields { margin-top: 0; padding-top: 0; border-top: 0; }
.continuous-use-remove-modal .modal-body > p strong { color: var(--body); }

@media (prefers-reduced-motion: reduce) {
    .sidebar-continuous-use-card.has-pending,
    .sidebar-continuous-use-card.has-pending > header em { animation: none; }
}

@media (max-width: 1320px) {
    .continuous-use-grid { grid-template-columns: repeat(2, minmax(120px, 1fr)); }
    .continuous-use-config { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .continuous-use-config > div { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
    .continuous-use-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .continuous-use-toolbar { align-items: stretch; flex-direction: column; }
    .continuous-use-toolbar nav { overflow-x: auto; }
    .continuous-use-search { width: 100%; min-width: 0; margin-left: 0; }
    .continuous-use-config { grid-template-columns: 1fr; }
    .continuous-use-grid { grid-template-columns: 1fr; }
    .continuous-use-footer { align-items: flex-start; flex-direction: column; }
    .continuous-use-model-picker { grid-template-columns: 1fr; }
    .continuous-use-model-actions { flex-wrap: wrap; }
    .continuous-use-model-delete-confirm { grid-template-columns: 1fr; }
    .continuous-use-model-delete-confirm > div { grid-column: 1; grid-row: auto; margin-top: 7px; }
}
.schema-compatibility-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 24px;
    color: #fff;
    background: #a8202b;
    border-bottom: 1px solid #ef6470;
}

.hours-grid { display:grid; gap:8px; margin:18px 0; }
.hours-row { display:grid; grid-template-columns:150px 1fr 1fr; gap:12px; align-items:center; padding:10px 12px; border:1px solid var(--border); border-radius:10px; }
.hours-row label { display:flex; align-items:center; gap:7px; font-size:13px; color:var(--muted); }
.hours-row input[type="time"] { min-width:92px; padding:8px; color:var(--text); background:var(--input); border:1px solid var(--border); border-radius:8px; }
@media (max-width:860px){.hours-row{grid-template-columns:1fr}.hours-row label{flex-wrap:wrap}}

.schema-compatibility-alert strong {
    flex: 0 0 auto;
}

.schema-compatibility-alert span {
    min-width: 0;
    font-size: 13px;
}

@media (max-width: 860px) {
    .schema-compatibility-alert {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
        padding: 10px 16px;
    }
}
/* Balance */
.balance-toolbar{display:flex;justify-content:flex-end;gap:10px;margin:0 0 16px}.balance-period{border:1px solid var(--border-color);border-radius:10px;padding:10px 14px;color:var(--text-muted);font-size:.82rem;background:var(--panel-bg)}
.balance-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:16px}.balance-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(300px,.8fr);gap:16px;margin-bottom:16px}.balance-chart,.balance-config,.balance-detail{min-width:0}.balance-bars{height:230px;display:flex;align-items:flex-end;gap:8px;padding:18px 12px 0;border-top:1px solid var(--border-color);overflow-x:auto}.balance-bar{height:100%;min-width:20px;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:7px}.balance-bar i{display:block;width:100%;height:var(--bar);min-height:4px;border-radius:6px 6px 2px 2px;background:linear-gradient(180deg,#38bdf8,#2563eb);box-shadow:0 3px 12px rgba(37,99,235,.28)}.balance-bar small{color:var(--text-muted);font-size:.72rem}.balance-config form{display:grid;gap:12px}.balance-config .primary-button{justify-self:start}.balance-detail{margin-bottom:24px}.balance-detail table{width:100%;border-collapse:collapse}.balance-detail th,.balance-detail td{padding:11px 14px;border-bottom:1px solid var(--border-color);text-align:left}.balance-detail th{color:var(--text-muted);font-size:.75rem;text-transform:uppercase;letter-spacing:.04em}.balance-detail td{font-size:.86rem}@media(max-width:1100px){.balance-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}.balance-grid{grid-template-columns:1fr}}@media(max-width:620px){.balance-metrics{grid-template-columns:1fr}.balance-toolbar{justify-content:flex-start;overflow:auto}.balance-period{white-space:nowrap}}
