/* Fábrica OS — Industrial Intelligence
   System-wide visual layer. Kept separate so legacy screens inherit the new
   product language without coupling their behavior to the redesign. */

:root {
    --bg-main: #07090f;
    --bg-secondary: #0b0f18;
    --card-bg: rgba(15, 20, 31, .82);
    --card-bg-solid: #0f141f;
    --surface-raised: #151b28;
    --surface-hover: #1a2231;
    --border: rgba(157, 173, 204, .14);
    --border-strong: rgba(157, 173, 204, .24);
    --text-main: #f4f7fb;
    --text-muted: #8994a8;
    --text-soft: #b9c1cf;
    --accent-teal: #5eead4;
    --accent-cyan: #60a5fa;
    --accent-violet: #8b5cf6;
    --brand: #6d7cff;
    --brand-bright: #91a0ff;
    --brand-soft: rgba(109, 124, 255, .14);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #fb7185;
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-card: 0 1px 0 rgba(255,255,255,.04) inset, 0 18px 50px rgba(0,0,0,.20);
    --shadow-float: 0 28px 80px rgba(0,0,0,.42);
    /* Referenced by legacy views (notification badges, chat, product cards)
       but never declared anywhere — they resolved to nothing until now. */
    --bg-card: var(--card-bg-solid);
    --text-bright: #ffffff;
    --primary: var(--brand);
    --primary-hover: #5b6ae6;
    --primary-glow: rgba(109, 124, 255, .22);
    --primary-rgb: 109, 124, 255;
}

html { background: var(--bg-main); }

body {
    font-family: 'Manrope', system-ui, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(900px 520px at 86% -12%, rgba(91, 108, 255, .12), transparent 66%),
        radial-gradient(720px 420px at 12% 104%, rgba(20, 184, 166, .07), transparent 70%),
        var(--bg-main);
    letter-spacing: -.012em;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .16;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, #000, transparent 78%);
    z-index: -1;
}

h1, h2, h3, h4, h5, h6,
.premium-header-brand,
.sidebar-brand {
    font-family: 'Space Grotesk', 'Manrope', sans-serif;
    letter-spacing: -.035em;
}

h1 { font-size: clamp(2rem, 3vw, 3.15rem); font-weight: 650; }
h2 { font-weight: 650; }

::selection { background: rgba(109,124,255,.42); color: #fff; }

*:focus-visible {
    outline: 2px solid var(--brand-bright) !important;
    outline-offset: 3px;
}

.premium-header {
    height: 72px;
    padding: 0 1.4rem;
    background: rgba(7, 9, 15, .82);
    border-bottom: 1px solid var(--border);
    box-shadow: none;
    backdrop-filter: blur(22px) saturate(140%);
}

.premium-header-brand,
.sidebar-brand,
.nav-brand,
.mobile-brand {
    /* The old teal→purple gradient text is retired: it fought the brand indigo
       and rendered as transparent fill wherever the gradient failed. */
    background: none;
    background-clip: border-box;
    -webkit-background-clip: border-box;
    -webkit-text-fill-color: currentColor;
    color: var(--text-main);
}

.premium-header-brand {
    display: inline-flex;
    align-items: center;
    gap: .72rem;
    text-decoration: none;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, #8794ff, #5967e9 58%, #4d53b7);
    color: #fff;
    box-shadow: 0 8px 24px rgba(91, 108, 255, .28), inset 0 1px 0 rgba(255,255,255,.34);
}

.brand-mark i { font-size: 1rem; }
.brand-mark svg { width: 19px; height: 19px; }
.brand-wordmark { display: flex; align-items: baseline; gap: .35rem; }
.brand-wordmark strong { font-size: 1.02rem; font-weight: 650; }
.brand-wordmark small { font: 700 .58rem/1 'Manrope', sans-serif; letter-spacing: .12em; color: var(--brand-bright); }

.premium-header-link {
    min-height: 38px;
    padding: .5rem .75rem;
    border-radius: 10px;
    color: var(--text-soft);
    font-size: .82rem;
    font-weight: 650;
    border: 1px solid transparent;
}

.premium-header-link:hover,
.premium-header-link.active {
    color: #fff;
    background: rgba(255,255,255,.055);
    border-color: var(--border);
}

.sidebar {
    top: 72px;
    width: 256px;
    padding: 1.25rem .85rem 2rem;
    background: rgba(8, 11, 18, .96);
    border-right: 1px solid var(--border);
    box-shadow: none;
}

.sidebar-brand {
    display: flex;
    flex-direction: column;
    gap: .22rem;
    color: var(--text-main);
}

.sidebar-brand small {
    color: #657087;
    font: 750 .58rem/1 'Manrope', sans-serif;
    letter-spacing: .17em;
}

.sidebar-brand strong { font-size: .92rem; font-weight: 650; }

.sidebar-nav { gap: .22rem; }

.sidebar-link,
.sidebar-sublink {
    min-height: 42px;
    border-radius: 11px;
    color: #8f9aaf;
    font-size: .82rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.sidebar-link i,
.sidebar-sublink i { color: #69758d; }

.sidebar-link:hover,
.sidebar-sublink:hover {
    color: #e9edf6;
    background: rgba(255,255,255,.045);
}

.sidebar-link.active,
.sidebar-sublink.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(109,124,255,.18), rgba(109,124,255,.06));
    border-color: rgba(126,140,255,.18);
    box-shadow: inset 3px 0 0 #7e8cff;
}

.sidebar-link.active i,
.sidebar-sublink.active i { color: #9aa6ff; }

.main-container {
    width: 100%;
    min-width: 0;
    max-width: none;
    box-sizing: border-box;
    padding: 2rem clamp(1.1rem, 3vw, 3rem) 4rem;
    transition: margin-left .3s cubic-bezier(.4, 0, .2, 1), width .3s cubic-bezier(.4, 0, .2, 1);
}

/* Shared internal page anatomy */
.os-page-head {
    align-items: flex-end;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
}

/* The heading was boxed into a 230px column, so page titles broke onto two
   lines while the toolbar floated at a third baseline. Give the title room and
   let the toolbar wrap underneath instead of squeezing it. */
.os-page-head {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}

.os-page-heading {
    flex: 1 1 360px;
    min-width: 0;
}

.os-page-head > .crm-toolbar,
.os-page-head > .appointments-actions,
.os-page-head > .os-page-actions {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center !important;
    gap: .7rem;
}

.os-kicker {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    margin-bottom: .75rem;
    color: #8e9aff;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .14em;
}

.os-page-title {
    margin: 0;
    color: var(--text-main);
    font: 650 clamp(2rem, 3vw, 3rem)/1 'Space Grotesk', sans-serif;
    letter-spacing: -.05em;
}

.os-page-subtitle {
    margin: .65rem 0 0;
    color: var(--text-muted);
    font-size: .92rem;
    line-height: 1.55;
}

.alert-premium {
    border-radius: 12px;
    border-width: 1px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.modal-header,
.side-panel-header {
    border-bottom: 1px solid var(--border);
    background: rgba(9,12,19,.88);
}

.modal-title,
.side-panel-header h2 { font-family: 'Space Grotesk', sans-serif; }

.pagination,
.appt-pagination { font-size: .82rem; }

/* Shell docking — the sidebar and the content offset are driven by the SAME
   state. Never reserve the 256px gutter while the drawer is off-screen: that
   was pushing every page right and making the layout look off-centre. */
@media (min-width: 993px) {
    body.has-sidebar .sidebar {
        transform: translateX(0);
        box-shadow: none;
    }

    body.has-sidebar.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    body.has-sidebar .main-container {
        width: calc(100% - 256px);
        margin-left: 256px;
    }

    body.has-sidebar.sidebar-collapsed .main-container {
        width: 100%;
        margin-left: 0;
    }

    /* Docked sidebar is not a drawer: no dimming mask, no scroll lock. */
    body.has-sidebar .sidebar-mask { display: none !important; }
    body.has-sidebar.sidebar-open { overflow: auto; }
}

.premium-card,
.glass-panel,
.modal-content,
.side-panel {
    background: linear-gradient(145deg, rgba(18,24,37,.94), rgba(12,16,26,.96));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.premium-card:hover { border-color: rgba(157,173,204,.22); }

.btn-primary-premium,
.btn-premium {
    min-height: 42px;
    border-radius: 11px;
    border: 1px solid rgba(255,255,255,.13);
    background: linear-gradient(135deg, #7c8aff, #5968e8);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(82, 98, 226, .22), inset 0 1px 0 rgba(255,255,255,.25);
}

.btn-primary-premium:hover,
.btn-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 15px 32px rgba(82, 98, 226, .32), inset 0 1px 0 rgba(255,255,255,.28);
}

.btn-secondary-premium,
.btn-outline-premium {
    min-height: 42px;
    border-radius: 11px;
    border-color: var(--border-strong);
    background: rgba(255,255,255,.035);
    color: var(--text-soft);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.035);
}

.glass-input,
.form-control,
.form-select,
input:not([type='checkbox']):not([type='radio']):not([type='hidden']),
select,
textarea {
    border-radius: 11px;
    border-color: var(--border-strong);
    background-color: rgba(5, 8, 14, .58);
    color: var(--text-main);
    min-height: 42px;
    font-size: .9rem;
}

.glass-input:focus,
.form-control:focus,
.form-select:focus,
input:focus,
select:focus,
textarea:focus {
    border-color: rgba(126,140,255,.75);
    box-shadow: 0 0 0 4px rgba(109,124,255,.12);
}

.premium-table { border-collapse: separate; border-spacing: 0; }
.premium-table th {
    color: #748096;
    font-size: .68rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    background: rgba(255,255,255,.018);
}
.premium-table td { border-color: rgba(157,173,204,.09); }
.premium-table tbody tr:hover { background: rgba(109,124,255,.045); }

.badge-premium { border-radius: 7px; font-weight: 700; }

/* CRM — pipeline as an operational command board */
.kanban-outer-container {
    padding: .35rem 0 1rem;
    border-radius: var(--radius-lg);
}

.kanban-board { gap: .9rem !important; }

.kanban-column {
    background: rgba(10,14,22,.76) !important;
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}

.kanban-header {
    padding: .9rem 1rem !important;
    border-bottom: 1px solid rgba(157,173,204,.10) !important;
}

.kanban-title h3 { font: 650 .84rem/1.2 'Space Grotesk', sans-serif !important; }
.kanban-ref { color: #657087 !important; letter-spacing: .08em; text-transform: uppercase; }
.kanban-count { background: var(--brand-soft) !important; color: #aab4ff !important; border: 1px solid rgba(126,140,255,.18); }

.kanban-card {
    background: linear-gradient(145deg, rgba(24,31,46,.92), rgba(16,21,32,.94)) !important;
    border: 1px solid rgba(157,173,204,.13) !important;
    border-radius: 13px !important;
    box-shadow: 0 8px 25px rgba(0,0,0,.16) !important;
}

.kanban-card:hover {
    transform: translateY(-2px);
    border-color: rgba(126,140,255,.38) !important;
    box-shadow: 0 16px 36px rgba(0,0,0,.28), 0 0 0 1px rgba(126,140,255,.07) !important;
}

.crm-toolbar {
    align-items: flex-end !important;
    gap: .7rem !important;
}

.crm-filter-card {
    background: rgba(12,16,25,.86) !important;
    border: 1px solid var(--border) !important;
    border-radius: 13px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025) !important;
}

.filter-title { font-family: 'Space Grotesk', sans-serif; font-weight: 650 !important; }
.filter-subtitle { color: #69758b !important; }
.btn-filter-primary { background: linear-gradient(135deg, #7c8aff, #5968e8) !important; border-radius: 9px !important; }
.btn-filter-ghost,
.btn-filter-clear { border-radius: 9px !important; }
.filter-input { background: rgba(5,8,14,.72) !important; border-color: var(--border-strong) !important; }

/* Agenda — dense, legible planning surface */
.appointments-topbar { margin-bottom: 1.3rem !important; }
.appointments-topbar h1 {
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: var(--text-main) !important;
}

.view-toggle {
    padding: .28rem !important;
    background: rgba(8,11,18,.76) !important;
    border-color: var(--border) !important;
    border-radius: 12px !important;
}

.toggle-btn { border-radius: 9px !important; padding: .55rem .85rem !important; }
.toggle-btn.active { background: var(--surface-raised) !important; box-shadow: 0 2px 8px rgba(0,0,0,.24) !important; }

.calendar-shell {
    background: rgba(10,14,22,.80) !important;
    border-color: var(--border) !important;
    border-radius: 18px !important;
    box-shadow: var(--shadow-card);
}

#appointmentsFilterBar {
    background: rgba(12,16,25,.86) !important;
    border-color: var(--border) !important;
    border-radius: 14px !important;
}

.appointments-mobile-card {
    background: linear-gradient(145deg, rgba(18,24,37,.94), rgba(12,16,26,.96)) !important;
    border: 1px solid var(--border) !important;
    border-radius: 14px !important;
}

.tg-gutter-head,
.tg-day-head { background: rgba(11,15,24,.97) !important; }
.tg-day-head.is-today { background: rgba(109,124,255,.075) !important; }
.tg-day-head.is-today .tg-dh-name,
.tg-day-head.is-today .tg-dh-num { color: #9aa6ff !important; }
.tg-dh-count { background: var(--brand-soft) !important; color: #aab4ff !important; }

/* Chat Manager — restrained command-center treatment */
body.full-chat { --conv-header-offset: 72px !important; }
body.full-chat .premium-header { height: 72px !important; }
.conv-shell {
    --wa-bg: #080b12;
    --wa-panel: #0d121c;
    --wa-panel-2: #141a27;
    --wa-border: rgba(157,173,204,.12);
    --wa-muted: #7e899e;
    --wa-accent: #7f8cff;
    --wa-accent-hover: #929dff;
    --wa-bubble: #171e2c;
    --wa-bubble-me: #5866d8;
    --wa-bubble-tail-me: #5866d8;
    --wa-bubble-tail-other: #171e2c;
    --wa-chat-bg: radial-gradient(900px 480px at 78% 0%, rgba(91,108,255,.09), transparent 60%), #090c13;
    --wa-text: #f1f4f9;
    --wa-text-secondary: #c3cad6;
    --wa-unread: #8e9aff;
}

.conv-sidebar { background: #0d111a !important; }
.conv-sidebar-header {
    min-height: 60px;
    padding: .75rem 1rem !important;
    background: #101621 !important;
    border-bottom: 1px solid var(--wa-border);
}
.conv-sidebar-header h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 650 !important; }
.conv-sidebar-title { display: flex; align-items: center; gap: .7rem; }
.conv-sidebar-title small { color: #69758b; font-size: .66rem; }
.conv-sidebar-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #aab4ff;
    background: rgba(109,124,255,.12);
    border: 1px solid rgba(126,140,255,.18);
}
.conv-search { background: #151b27 !important; border: 1px solid var(--wa-border) !important; border-radius: 11px !important; }
.conv-chip { border-radius: 8px !important; font-weight: 650 !important; }
.conv-chip.active { background: rgba(109,124,255,.14) !important; color: #aab4ff !important; border-color: rgba(126,140,255,.34) !important; }
.conv-item { padding: .78rem 1rem !important; }
.conv-item.active { background: linear-gradient(90deg, rgba(109,124,255,.14), rgba(109,124,255,.035)) !important; box-shadow: inset 3px 0 0 #7e8cff; }
.conv-avatar,
.conv-avatar-chat { border-radius: 13px !important; }
.conv-online-indicator.ai-active { background: var(--success) !important; box-shadow: 0 0 0 3px rgba(52,211,153,.12) !important; }

.chat-shell { --chat-accent: #7f8cff !important; --chat-glow: rgba(109,124,255,.28) !important; }
.chat-header,
.chat-messages,
.chat-input { border-color: var(--border) !important; background: rgba(13,18,28,.90) !important; }
.chat-send { background: linear-gradient(135deg, #7d8aff, #5866d8) !important; color: #fff !important; }
.chat-bubble.me { background: linear-gradient(135deg, #6473e7, #4f5bc4) !important; }

/* Dashboard becomes a working surface instead of a marketing hero */
.app-dashboard { max-width: 1560px !important; }
.os-command-header {
    min-height: 0 !important;
    padding: 1.5rem !important;
    border-radius: 20px !important;
    background: linear-gradient(135deg, rgba(17,23,36,.96), rgba(10,14,23,.97)) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-card) !important;
    overflow: hidden;
}
.os-command-header::after {
    content: '';
    position: absolute;
    width: 360px;
    height: 360px;
    right: -170px;
    top: -240px;
    border-radius: 50%;
    background: rgba(109,124,255,.16);
    filter: blur(50px);
    pointer-events: none;
}
.os-command-top {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
}
.os-command-header .app-title {
    margin: 0;
    font: 650 clamp(1.9rem, 3vw, 2.9rem)/1.05 'Space Grotesk', sans-serif;
    letter-spacing: -.05em;
}
.os-command-header .app-lead { margin: .6rem 0 0; color: var(--text-muted); font-size: .9rem; }
.os-command-header .app-actions { margin: 0; display: flex; gap: .55rem; flex-wrap: wrap; }
.os-command-metrics {
    position: relative;
    z-index: 1;
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .65rem !important;
    margin-top: 1.4rem !important;
}
.os-command-metrics .mini-card {
    min-width: 0;
    padding: 1rem 1.05rem !important;
    background: rgba(5,8,14,.42) !important;
    border: 1px solid rgba(157,173,204,.11) !important;
    border-radius: 13px !important;
}
.os-command-metrics .mini-card span { color: #778299; font-size: .67rem; font-weight: 750; text-transform: uppercase; letter-spacing: .075em; }
.os-command-metrics .mini-card strong { margin-top: .35rem; font: 650 1.65rem/1 'Space Grotesk', sans-serif; color: #f5f7fb; }
.os-command-metrics .mini-card small { display: block; margin-top: .45rem; color: #69758b; font-size: .68rem; }
.os-system-state strong { display: flex; align-items: center; gap: .5rem; font-size: 1rem !important; color: #d7f9e9 !important; }
.os-system-state strong i { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 5px rgba(52,211,153,.1); }
.app-dashboard > section:not(.app-hero) { margin-top: 2.25rem; }
.app-dashboard .stats-grid { gap: .7rem !important; }
.app-dashboard .stat-card,
.app-dashboard .panel {
    background: linear-gradient(145deg, rgba(18,24,37,.88), rgba(11,15,24,.94)) !important;
    border-color: var(--border) !important;
    border-radius: 16px !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.025);
}
.app-dashboard .stat-card { min-height: 130px; }
.app-dashboard .stat-value { font-family: 'Space Grotesk', sans-serif; letter-spacing: -.04em; }

/* Normalize legacy page chrome throughout the remaining internal screens */
.content-centered { max-width: 1500px; }
.page-header,
.dashboard-header { border-bottom-color: var(--border) !important; }
.dropdown-menu {
    background: #111722;
    border-color: var(--border-strong);
    border-radius: 12px;
    box-shadow: var(--shadow-float);
}
.dropdown-item { color: var(--text-soft); }
.dropdown-item:hover { background: var(--brand-soft); color: #fff; }
.table-responsive {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(11,15,24,.72);
}

@media (max-width: 992px) {
    .sidebar { top: 0; width: min(294px, 88vw); }
    body.has-sidebar .main-container {
        width: 100%;
        margin-left: 0;
    }
    .main-container { padding: 1.35rem 1rem 3rem; }
    .os-command-top { align-items: flex-start; flex-direction: column; }
    .os-command-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
    .premium-header { height: 64px; padding: 0 .85rem; }
    .premium-header-brand .brand-wordmark { display: none; }
    .premium-header-link span { display: none; }
    .premium-header-actions { gap: .35rem !important; }
    body.full-chat { --conv-header-offset: 64px !important; }
    body.full-chat .premium-header { height: 64px !important; }
    .appointments-topbar { align-items: stretch !important; }
    .appointments-actions { justify-content: stretch !important; }
    .appointments-actions > * { flex: 1; }
    .os-page-head { align-items: stretch !important; }
    .os-command-metrics { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}


/* ── Corrections: things that were visibly broken in production ─────────── */

/* Status pills were clipping their own text ("PROCESSA…", "LEVANTAMENTO /
   VISITA" spilling outside the pill). Let them size to their content. */
.badge-premium,
.badge,
.status-badge,
.lead-status,
.appt-status {
    display: inline-flex;
    align-items: center;
    width: auto;
    max-width: 100%;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.2;
}

/* Table headers were being ellipsised into "DATA DO AGEN…". Two short lines
   read better than a truncated one. */
.premium-table th {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    vertical-align: bottom;
}

.table-fixed th { overflow: visible; text-overflow: clip; }

/* Kanban: the board ran off the right edge with no hint that it scrolls. */
.kanban-outer-container {
    overflow-x: auto;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.kanban-outer-container::-webkit-scrollbar { height: 8px; }
.kanban-outer-container::-webkit-scrollbar-thumb {
    background: rgba(157,173,204,.22);
    border-radius: 999px;
}

/* Empty columns stretched to the full page height. Cap them. */
.kanban-column { min-height: 240px; }

/* Internal stage keys (INICIO_DE_CONVERSA_149CEC0E) were rendered at the same
   weight as the column name. Keep them, but as metadata. */
.kanban-ref {
    font-size: .6rem !important;
    opacity: .5;
}

/* Calendar was a card inside a card inside a card. */
.calendar-shell { padding: 0 !important; }

/* Scrollbars, everywhere, in the product palette. */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(157,173,204,.22) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(157,173,204,.18);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(157,173,204,.34); background-clip: content-box; }

/* Contact lines were painted WhatsApp green at full weight, so every phone
   number in a table read as the most important thing on the row. Keep the
   green on the glyph, return the value to normal text. */
.wa-contact {
    color: var(--text-soft);
    font-weight: 500;
}

.wa-contact .bi-whatsapp { color: #25d366; }

/* Conversation chips were cut mid-word ("#TESTE_AUTC"). */
.conv-tag-chip {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Destructive row actions sat at the same visual weight as the primary one. */
.btn-icon-sm.btn-danger,
.premium-table .btn-danger,
.premium-table [class*="delete"] {
    background: transparent;
    border-color: transparent;
    color: var(--text-muted) !important;
}

.btn-icon-sm.btn-danger:hover,
.premium-table .btn-danger:hover,
.premium-table [class*="delete"]:hover {
    background: rgba(251, 113, 133, .12);
    border-color: rgba(251, 113, 133, .28);
    color: var(--danger) !important;
}

/* Native date fields kept their Chrome chrome next to the custom selects. */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
    color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
    filter: invert(63%) sepia(9%) saturate(560%) hue-rotate(190deg) brightness(95%);
    cursor: pointer;
    opacity: .8;
}

/* Chat Manager pins its shell with position:fixed;left:0, so a docked sidebar
   would sit on top of the conversation list. Offset it with the same state. */
@media (min-width: 993px) {
    body.full-chat.has-sidebar .main-container > main { left: 256px !important; }
    body.full-chat.has-sidebar.sidebar-collapsed .main-container > main { left: 0 !important; }
    body.full-chat.has-sidebar .premium-header { left: 0 !important; }
}
