/* ============================================================
   CLX CONNECT — CSS BASE
   Padrão visual idêntico ao CLX ERP
   ============================================================ */

/* ------------------------------------------------------------
   GOOGLE FONTS (carregadas no HTML)
   Inter: corpo | Outfit: títulos e logo
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   VARIÁVEIS GLOBAIS
   ------------------------------------------------------------ */
:root {
    /* Cores principais */
    --clx-navy:        #0b1a35;      /* sidebar, card login */
    --clx-navy-light:  #0f2747;      /* hover sidebar, badge */
    --clx-navy-border: rgba(255,255,255,.10);

    --clx-gold:        #d8b056;      /* destaque, botão primário */
    --clx-gold-dark:   #a9791c;      /* hover gold, slogan */
    --clx-gold-shadow: rgba(216,176,86,.35);

    --clx-blue:        #2563ff;      /* ativo menu, botão ação */
    --clx-blue-hover:  #1d4ed8;
    --clx-blue-light:  rgba(37,99,255,.12);
    --clx-blue-focus:  rgba(37,99,255,.25);

    /* Fundo e superfícies */
    --clx-bg:          #f1f5f9;      /* fundo conteúdo */
    --clx-surface:     #ffffff;      /* cards, painéis */
    --clx-border:      #e2e8f0;      /* bordas gerais */
    --clx-border-dark: #dbe2ec;

    /* Textos */
    --clx-text:        #0f172a;      /* texto principal */
    --clx-text-soft:   #334155;      /* texto secundário */
    --clx-text-muted:  #93a4c0;      /* placeholders, labels */
    --clx-text-white:  #e7edf6;

    /* Status / Semânticas */
    --clx-success:     #16a34a;
    --clx-success-bg:  rgba(22,163,74,.10);
    --clx-warning:     #d97706;
    --clx-warning-bg:  rgba(217,119,6,.10);
    --clx-danger:      #dc2626;
    --clx-danger-bg:   rgba(239,68,68,.10);
    --clx-info:        #0891b2;
    --clx-info-bg:     rgba(8,145,178,.10);

    /* Status conversa */
    --status-bot:          #7c3aed;
    --status-aguardando:   #d97706;
    --status-atendimento:  #2563ff;
    --status-encerrada:    #64748b;

    /* Layout */
    --sidebar-w:       238px;
    --sidebar-w-mini:  60px;
    --header-h:        56px;
    --radius-sm:       8px;
    --radius-md:       12px;
    --radius-lg:       18px;
    --radius-xl:       22px;

    /* Sombras */
    --shadow-sm:  0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:  0 4px 16px rgba(0,0,0,.08), 0 1px 4px rgba(0,0,0,.04);
    --shadow-lg:  0 12px 36px rgba(0,0,0,.10), 0 2px 8px rgba(0,0,0,.06);

    /* Tipografia */
    --font-body:   'Inter', ui-sans-serif, system-ui, sans-serif;
    --font-title:  'Outfit', 'Inter', sans-serif;

    /* Transições */
    --transition: .15s ease;
}

/* ------------------------------------------------------------
   RESET E BASE
   ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    font-size: .875rem;
    color: var(--clx-text);
    background: var(--clx-bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--clx-blue); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { display: block; max-width: 100%; }

/* ------------------------------------------------------------
   LAYOUT PRINCIPAL (sidebar + conteúdo)
   ------------------------------------------------------------ */
.clx-layout {
    display: flex;
    min-height: 100vh;
}

/* ------------------------------------------------------------
   SIDEBAR
   ------------------------------------------------------------ */
.clx-sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--clx-navy);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 200;
    transition: width var(--transition), transform var(--transition);
    overflow: hidden;
}

/* Logo / topo da sidebar */
.clx-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--clx-navy-border);
    min-height: var(--header-h);
    flex-shrink: 0;
}

.clx-brand-badge {
    width: 32px; height: 32px;
    background: #fff;
    color: var(--clx-navy);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-title);
    font-weight: 800; font-size: .72rem;
    letter-spacing: .04em;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.clx-brand-name {
    font-family: var(--font-title);
    font-weight: 800; font-size: 1rem;
    color: #fff;
    letter-spacing: .02em;
    white-space: nowrap;
}

.clx-brand-name span { color: var(--clx-gold); }

/* Navegação */
.clx-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.1) transparent;
}

.clx-sidebar-nav::-webkit-scrollbar { width: 4px; }
.clx-sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

/* Grupo de menu */
.clx-nav-group {
    padding: 16px 18px 4px;
}

.clx-nav-group-label {
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.3);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
}

/* Item de menu */
.clx-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 18px;
    color: rgba(255,255,255,.65);
    font-size: .82rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 0;
    transition: background var(--transition), color var(--transition);
    position: relative;
    white-space: nowrap;
    text-decoration: none;
}

.clx-nav-item:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
    text-decoration: none;
}

.clx-nav-item.ativo {
    background: var(--clx-blue);
    color: #fff;
    font-weight: 600;
}

.clx-nav-item.ativo:hover { background: var(--clx-blue-hover); }

.clx-nav-item svg {
    width: 16px; height: 16px;
    flex-shrink: 0;
    opacity: .8;
}

.clx-nav-item.ativo svg { opacity: 1; }

/* Item sair */
.clx-nav-item.sair {
    color: #f87171;
    margin-top: auto;
}
.clx-nav-item.sair:hover { background: rgba(239,68,68,.10); color: #ef4444; }

/* Rodapé sidebar */
.clx-sidebar-footer {
    padding: 14px 18px;
    border-top: 1px solid var(--clx-navy-border);
    flex-shrink: 0;
}

/* Badge de notificação no menu */
.clx-nav-badge {
    margin-left: auto;
    background: var(--clx-gold);
    color: #1a0e00;
    font-size: .6rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 20px;
    min-width: 18px;
    text-align: center;
}

/* ------------------------------------------------------------
   HEADER TOPO
   ------------------------------------------------------------ */
.clx-header {
    height: var(--header-h);
    background: var(--clx-surface);
    border-bottom: 1px solid var(--clx-border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    z-index: 100;
    transition: left var(--transition);
}

.clx-header-title {
    font-size: .95rem;
    font-weight: 600;
    color: var(--clx-text);
    flex: 1;
}

.clx-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Botão toggle sidebar (mobile) */
.clx-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--clx-text-soft);
    padding: 6px;
    border-radius: var(--radius-sm);
}

.clx-sidebar-toggle:hover { background: var(--clx-bg); }

/* Avatar usuário */
.clx-user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-md);
    transition: background var(--transition);
}

.clx-user-menu:hover { background: var(--clx-bg); }

.clx-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: var(--clx-blue);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .72rem;
    font-weight: 700;
    flex-shrink: 0;
}

.clx-user-name {
    font-size: .8rem;
    font-weight: 600;
    color: var(--clx-text);
}

/* Notificação header */
.clx-notif-btn {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--clx-text-soft);
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center;
}

.clx-notif-btn:hover { background: var(--clx-bg); color: var(--clx-text); }

.clx-notif-dot {
    position: absolute;
    top: 4px; right: 4px;
    width: 8px; height: 8px;
    background: var(--clx-danger);
    border-radius: 50%;
    border: 2px solid var(--clx-surface);
}

/* ------------------------------------------------------------
   CONTEÚDO PRINCIPAL
   ------------------------------------------------------------ */
.clx-main {
    margin-left: var(--sidebar-w);
    margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
    padding: 24px;
    transition: margin-left var(--transition);
}

.clx-page-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--clx-text);
    margin-bottom: 4px;
}

.clx-page-sub {
    font-size: .8rem;
    color: var(--clx-text-muted);
    margin-bottom: 24px;
}

/* ------------------------------------------------------------
   CARDS
   ------------------------------------------------------------ */
.clx-card {
    background: var(--clx-surface);
    border: 1px solid var(--clx-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.clx-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.clx-card-title {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--clx-text-muted);
}

/* Card métrica (dashboard) */
.clx-metric {
    background: var(--clx-surface);
    border: 1px solid var(--clx-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.clx-metric-info {}
.clx-metric-label {
    font-size: .78rem;
    color: var(--clx-text-soft);
    margin-bottom: 6px;
    font-weight: 500;
}

.clx-metric-value {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--clx-text);
    line-height: 1;
}

.clx-metric-sub {
    font-size: .72rem;
    color: var(--clx-text-muted);
    margin-top: 4px;
}

.clx-metric-icon {
    width: 42px; height: 42px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ------------------------------------------------------------
   BOTÕES
   ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    font-size: .82rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: filter var(--transition), transform var(--transition), box-shadow var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover { filter: brightness(1.07); transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); filter: brightness(.97); }

/* Primário: gold */
.btn-primary {
    background: var(--clx-gold);
    color: #1a0e00;
    box-shadow: 0 6px 18px var(--clx-gold-shadow);
}

/* Ação: azul */
.btn-action {
    background: var(--clx-blue);
    color: #fff;
    box-shadow: 0 4px 14px rgba(37,99,255,.25);
}
.btn-action:hover { color: #fff; }

/* Secundário: outline */
.btn-secondary {
    background: transparent;
    color: var(--clx-text-soft);
    border: 1px solid var(--clx-border-dark);
}
.btn-secondary:hover { background: var(--clx-bg); }

/* Perigo */
.btn-danger {
    background: var(--clx-danger);
    color: #fff;
}

/* Tamanhos */
.btn-sm { padding: 6px 12px; font-size: .76rem; }
.btn-lg { padding: 13px 24px; font-size: .95rem; }
.btn-block { width: 100%; }

/* Ícone apenas */
.btn-icon {
    width: 34px; height: 34px;
    padding: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--clx-text-soft);
    border: 1px solid var(--clx-border);
}
.btn-icon:hover { background: var(--clx-bg); color: var(--clx-text); }

/* Loading */
.btn.loading { pointer-events: none; opacity: .7; }
.btn.loading::after {
    content: '';
    width: 14px; height: 14px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .6s linear infinite;
    margin-left: 4px;
}

/* ------------------------------------------------------------
   FORMULÁRIOS
   ------------------------------------------------------------ */
.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--clx-text-muted);
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    background: #f1f5f9;
    border: 1px solid var(--clx-border-dark);
    border-radius: var(--radius-sm);
    color: var(--clx-text);
    font-size: .88rem;
    font-family: var(--font-body);
    padding: 10px 14px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
    outline: none;
}

.form-control::placeholder { color: var(--clx-text-muted); }

.form-control:focus {
    background: #fff;
    border-color: var(--clx-blue);
    box-shadow: 0 0 0 3px var(--clx-blue-focus);
}

.form-control:disabled {
    opacity: .6;
    cursor: not-allowed;
}

select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }

/* Input group (ícone + campo) */
.input-group { position: relative; }

.input-group .input-icon {
    position: absolute;
    left: 13px; top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    pointer-events: none;
}

.input-group .form-control { padding-left: 42px; }

.input-group .input-action {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    background: none; border: none;
    cursor: pointer; color: #64748b;
    padding: 4px;
    display: flex; align-items: center;
}

/* Feedback validação */
.form-error { font-size: .75rem; color: var(--clx-danger); margin-top: 5px; }
.form-control.is-invalid { border-color: var(--clx-danger); }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(239,68,68,.2); }

/* ------------------------------------------------------------
   TABELAS
   ------------------------------------------------------------ */
.clx-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--clx-border);
}

.clx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .82rem;
}

.clx-table thead th {
    background: var(--clx-bg);
    padding: 10px 16px;
    text-align: left;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--clx-text-muted);
    border-bottom: 1px solid var(--clx-border);
    white-space: nowrap;
}

.clx-table tbody tr {
    border-bottom: 1px solid var(--clx-border);
    transition: background var(--transition);
}

.clx-table tbody tr:last-child { border-bottom: none; }
.clx-table tbody tr:hover { background: #f8fafc; }

.clx-table tbody td {
    padding: 12px 16px;
    color: var(--clx-text-soft);
    vertical-align: middle;
}

/* ------------------------------------------------------------
   BADGES / PILLS
   ------------------------------------------------------------ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    white-space: nowrap;
}

.badge-bot         { background: rgba(124,58,237,.12); color: #7c3aed; }
.badge-aguardando  { background: rgba(217,119,6,.12);  color: #d97706; }
.badge-atendimento { background: var(--clx-blue-light); color: var(--clx-blue); }
.badge-encerrada   { background: rgba(100,116,139,.12); color: #64748b; }
.badge-success     { background: var(--clx-success-bg); color: var(--clx-success); }
.badge-danger      { background: var(--clx-danger-bg);  color: var(--clx-danger); }
.badge-warning     { background: var(--clx-warning-bg); color: var(--clx-warning); }
.badge-info        { background: var(--clx-info-bg);    color: var(--clx-info); }
.badge-gold        { background: rgba(216,176,86,.15);  color: var(--clx-gold-dark); }

/* Ponto de status (dot) */
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-dot.bot         { background: #7c3aed; }
.status-dot.aguardando  { background: #d97706; }
.status-dot.atendimento { background: var(--clx-blue); }
.status-dot.encerrada   { background: #64748b; }
.status-dot.online      { background: var(--clx-success); }

/* ------------------------------------------------------------
   MODAIS
   ------------------------------------------------------------ */
.clx-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(11,26,53,.55);
    backdrop-filter: blur(2px);
    z-index: 900;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: fadeIn .15s ease;
}

.clx-modal {
    background: var(--clx-surface);
    border: 1px solid var(--clx-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%; max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp .2s ease;
}

.clx-modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1px solid var(--clx-border);
}

.clx-modal-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--clx-text);
}

.clx-modal-close {
    width: 30px; height: 30px;
    background: none; border: none;
    cursor: pointer; border-radius: var(--radius-sm);
    color: var(--clx-text-muted);
    display: flex; align-items: center; justify-content: center;
}

.clx-modal-close:hover { background: var(--clx-bg); color: var(--clx-text); }

.clx-modal-body { padding: 24px; }

.clx-modal-footer {
    display: flex; align-items: center; justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px 20px;
    border-top: 1px solid var(--clx-border);
}

/* ------------------------------------------------------------
   TOASTS / ALERTAS
   ------------------------------------------------------------ */
.clx-toast-container {
    position: fixed;
    bottom: 24px; right: 24px;
    z-index: 999;
    display: flex; flex-direction: column; gap: 10px;
    pointer-events: none;
}

.clx-toast {
    background: var(--clx-navy);
    color: var(--clx-text-white);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    font-size: .82rem;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    display: flex; align-items: center; gap: 10px;
    pointer-events: all;
    animation: slideInRight .2s ease;
    max-width: 320px;
    border-left: 3px solid var(--clx-gold);
}

.clx-toast.toast-success { border-left-color: var(--clx-success); }
.clx-toast.toast-danger  { border-left-color: var(--clx-danger); }
.clx-toast.toast-warning { border-left-color: var(--clx-warning); }

/* ------------------------------------------------------------
   EMPTY STATE
   ------------------------------------------------------------ */
.clx-empty {
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 48px 24px; gap: 12px;
    color: var(--clx-text-muted);
    text-align: center;
}

.clx-empty svg { opacity: .35; }
.clx-empty-title { font-size: .9rem; font-weight: 600; color: var(--clx-text-soft); }
.clx-empty-sub   { font-size: .8rem; }

/* ------------------------------------------------------------
   LOADING SPINNER
   ------------------------------------------------------------ */
.clx-spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--clx-border);
    border-top-color: var(--clx-blue);
    border-radius: 50%;
    animation: spin .6s linear infinite;
    display: inline-block;
}

/* ------------------------------------------------------------
   ITEM DE LISTA (dashboard / painéis)
   ------------------------------------------------------------ */
.dash-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 8px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: background var(--transition);
}
.dash-item:hover { background: var(--clx-bg); text-decoration: none; }
.dash-item + .dash-item { border-top: 1px solid var(--clx-border); }

.dash-item-avatar {
    width: 38px; height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--clx-navy);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .78rem; font-weight: 700;
}

.dash-item-body { flex: 1; min-width: 0; }

.dash-item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.dash-item-nome {
    font-size: .86rem; font-weight: 600;
    color: var(--clx-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.dash-item-tempo {
    font-size: .72rem; color: var(--clx-text-muted);
    flex-shrink: 0;
}

.dash-item-msg {
    font-size: .8rem; color: var(--clx-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ------------------------------------------------------------
   CONVERSAS — abas de status
   ------------------------------------------------------------ */
.conv-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.conv-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    font-size: .82rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--clx-text-soft);
    background: var(--clx-surface);
    border: 1px solid var(--clx-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.conv-tab:hover { background: var(--clx-bg); }
.conv-tab.ativo {
    background: var(--clx-navy);
    color: #fff;
    border-color: var(--clx-navy);
}

.conv-tab-count {
    font-size: .72rem;
    font-weight: 700;
    min-width: 18px;
    padding: 1px 6px;
    border-radius: 9px;
    background: var(--clx-bg);
    color: var(--clx-text-muted);
}
.conv-tab.ativo .conv-tab-count {
    background: rgba(255,255,255,.18);
    color: #fff;
}

/* ------------------------------------------------------------
   CONVERSAS — item da lista
   ------------------------------------------------------------ */
.conv-item {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--clx-border);
    cursor: pointer;
    transition: background var(--transition);
}
.conv-item:last-child { border-bottom: none; }
.conv-item:hover { background: #f8fafc; }

.conv-avatar {
    width: 44px; height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--clx-navy);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .85rem; font-weight: 700;
}

.conv-body { flex: 1; min-width: 0; }

.conv-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.conv-nome {
    font-size: .9rem; font-weight: 600;
    color: var(--clx-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.conv-tempo { font-size: .72rem; color: var(--clx-text-muted); flex-shrink: 0; }

.conv-preview {
    font-size: .82rem; color: var(--clx-text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    margin: 2px 0 6px;
}

.conv-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.conv-dept {
    font-size: .68rem; font-weight: 600;
    color: var(--clx-text-soft);
    padding: 2px 8px;
    border-radius: 9px;
    background: var(--clx-bg);
    border-left: 3px solid var(--cor, #6c757d);
}
.conv-atendente {
    font-size: .72rem; color: var(--clx-text-muted);
}

.conv-acoes {
    display: flex; flex-direction: column; align-items: flex-end;
    gap: 8px; flex-shrink: 0;
}

/* ------------------------------------------------------------
   GRID UTILITÁRIO
   ------------------------------------------------------------ */
.clx-grid {
    display: grid;
    gap: 16px;
}

.clx-grid-2 { grid-template-columns: repeat(2, 1fr); }
.clx-grid-3 { grid-template-columns: repeat(3, 1fr); }
.clx-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ------------------------------------------------------------
   UTILITÁRIOS
   ------------------------------------------------------------ */
.d-flex    { display: flex; }
.d-none    { display: none; }
.align-center { align-items: center; }
.gap-8     { gap: 8px; }
.gap-12    { gap: 12px; }
.gap-16    { gap: 16px; }
.mt-8      { margin-top: 8px; }
.mt-16     { margin-top: 16px; }
.mt-24     { margin-top: 24px; }
.mb-8      { margin-bottom: 8px; }
.mb-16     { margin-bottom: 16px; }
.mb-24     { margin-bottom: 24px; }
.text-muted { color: var(--clx-text-muted); }
.text-sm   { font-size: .78rem; }
.fw-600    { font-weight: 600; }
.fw-700    { font-weight: 700; }
.ml-auto   { margin-left: auto; }

/* ------------------------------------------------------------
   ANIMAÇÕES
   ------------------------------------------------------------ */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ------------------------------------------------------------
   RESPONSIVO — MOBILE
   ------------------------------------------------------------ */
@media (max-width: 768px) {

    /* Sidebar vira drawer */
    .clx-sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-w);
        box-shadow: var(--shadow-lg);
    }

    .clx-sidebar.aberta {
        transform: translateX(0);
    }

    /* Overlay quando sidebar aberta */
    .clx-sidebar-overlay {
        position: fixed; inset: 0;
        background: rgba(11,26,53,.5);
        z-index: 190;
        display: none;
    }

    .clx-sidebar.aberta ~ .clx-sidebar-overlay {
        display: block;
    }

    /* Header ocupa toda a largura */
    .clx-header {
        left: 0;
    }

    /* Mostrar toggle */
    .clx-sidebar-toggle { display: flex; }

    /* Conteúdo sem margem lateral */
    .clx-main {
        margin-left: 0;
        padding: 16px;
    }

    /* Grids colapsam */
    .clx-grid-2,
    .clx-grid-3,
    .clx-grid-4 {
        grid-template-columns: 1fr;
    }

    /* Modais em fullscreen no mobile */
    .clx-modal-backdrop { padding: 0; align-items: flex-end; }
    .clx-modal {
        max-width: 100%;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 92vh;
    }

    /* Toasts em baixo full */
    .clx-toast-container { left: 16px; right: 16px; bottom: 16px; }
    .clx-toast { max-width: 100%; }

    /* Tabela scroll horizontal */
    .clx-table-wrap { -webkit-overflow-scrolling: touch; }

    /* Ocultar labels de usuário no header */
    .clx-user-name { display: none; }
}

@media (max-width: 480px) {
    .clx-main { padding: 12px; }
    .clx-card { padding: 14px; }
    .clx-metric { padding: 14px; }
    .clx-page-title { font-size: 1.1rem; }
}

/* ============================================================
   ATENDIMENTO — tela de chat (3 colunas)
   ============================================================ */
.atd-wrap {
    display: flex;
    height: calc(100vh - var(--header-h));
    background: var(--clx-bg);
    overflow: hidden;
}

/* COLUNA 1 — lista */
.atd-list {
    width: 320px; flex-shrink: 0;
    display: flex; flex-direction: column;
    background: var(--clx-surface);
    border-right: 1px solid var(--clx-border);
}
.atd-list-head { padding: 12px; border-bottom: 1px solid var(--clx-border); }
.atd-list-head .form-control { min-height: auto; padding: 9px 12px; }
.atd-list-tabs { display: flex; gap: 4px; padding: 8px 12px; border-bottom: 1px solid var(--clx-border); }
.atd-ltab {
    flex: 1; padding: 6px 8px; font-size: .76rem; font-weight: 600;
    border: 1px solid var(--clx-border); border-radius: var(--radius-sm);
    background: var(--clx-surface); color: var(--clx-text-soft); cursor: pointer;
}
.atd-ltab.ativo { background: var(--clx-navy); color: #fff; border-color: var(--clx-navy); }
.atd-list-itens { flex: 1; overflow-y: auto; }

.atd-li {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px; cursor: pointer;
    border-bottom: 1px solid var(--clx-border);
    transition: background var(--transition);
}
.atd-li:hover { background: var(--clx-bg); }
.atd-li.ativa { background: var(--clx-blue-light); }
.atd-li-body { flex: 1; min-width: 0; }
.atd-li-top { display: flex; justify-content: space-between; gap: 6px; }
.atd-li-nome { font-size: .85rem; font-weight: 600; color: var(--clx-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atd-li-tempo { font-size: .68rem; color: var(--clx-text-muted); flex-shrink: 0; }
.atd-li-prev { font-size: .78rem; color: var(--clx-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atd-li-resp { font-size: .72rem; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.atd-li-resp .resp-atendente { color: #16a34a; font-weight: 600; }
.atd-li-resp .resp-bot { color: #7c3aed; font-weight: 600; }
.atd-li-resp .resp-fila { color: var(--clx-text-muted); }
.atd-h-resp { margin-top: 4px; font-size: .76rem; }
.atd-h-resp .resp-atendente { color: #16a34a; font-weight: 600; }
.atd-h-resp .resp-bot { color: #7c3aed; font-weight: 600; }
.atd-h-resp .resp-fila { color: var(--clx-text-muted); }

/* Balão de menu interativo (botões/lista enviados pelo bot) */
.msg-opcoes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.msg-opcao { font-size: .74rem; padding: 3px 9px; border: 1px solid var(--clx-border); border-radius: 12px; background: #fff; color: var(--clx-text); }

/* Avatares */
.atd-avatar {
    width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%;
    background: var(--clx-navy); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .82rem; font-weight: 700;
}
.atd-avatar.sm { width: 38px; height: 38px; font-size: .78rem; }
.atd-avatar.lg { width: 64px; height: 64px; font-size: 1.2rem; margin: 0 auto; }

/* COLUNA 2 — chat */
.atd-chat { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #eef2f7; }
.atd-chat-vazio { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--clx-text-muted); }
.atd-chat-ativo { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.atd-chat-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 18px; background: var(--clx-surface); border-bottom: 1px solid var(--clx-border);
}
.atd-chat-contato { display: flex; align-items: center; gap: 12px; min-width: 0; }
.atd-h-nome { font-size: .95rem; font-weight: 700; color: var(--clx-text); }
.atd-h-sub { font-size: .74rem; color: var(--clx-text-muted); }
.atd-chat-acoes { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }

.atd-banner-encerrada { padding: 9px 16px; font-size: .82rem; color: #92400e; background: #fef3c7; border-bottom: 1px solid #fde68a; text-align: center; }

.atd-msgs { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 8px; }

.msg { display: flex; }
.msg.dir { justify-content: flex-end; }
.msg.esq { justify-content: flex-start; }
.msg-bolha {
    max-width: 64%; padding: 8px 12px 6px; border-radius: 12px;
    background: #fff; box-shadow: 0 1px 1px rgba(0,0,0,.06); position: relative;
}
.msg.dir .msg-bolha { background: #d9fdd3; }
.msg.bot .msg-bolha { background: #e7ddff; }
.msg-corpo { font-size: .86rem; color: var(--clx-text); white-space: pre-wrap; word-break: break-word; }
.msg-rodape { font-size: .64rem; color: var(--clx-text-muted); text-align: right; margin-top: 2px; }
.msg-bot-tag { font-size: .58rem; font-weight: 800; letter-spacing: .08em; color: #7c3aed; margin-bottom: 2px; }
.msg-img { max-width: 260px; border-radius: 8px; display: block; }
.msg-doc { display: inline-block; padding: 6px 4px; color: var(--clx-blue); text-decoration: none; font-size: .84rem; }

/* Composer */
.atd-composer {
    display: flex; align-items: flex-end; gap: 8px;
    padding: 12px 16px; background: var(--clx-surface); border-top: 1px solid var(--clx-border);
}
.atd-composer textarea.form-control {
    flex: 1; min-height: 42px; max-height: 120px; resize: none;
    padding: 11px 14px; border-radius: 22px;
}
.atd-enviar { width: 42px; height: 42px; padding: 0; border-radius: 50%; flex-shrink: 0; }

/* COLUNA 3 — painel */
.atd-panel {
    width: 300px; flex-shrink: 0;
    display: flex; flex-direction: column;
    background: var(--clx-surface); border-left: 1px solid var(--clx-border);
}
.atd-panel-tabs { display: flex; border-bottom: 1px solid var(--clx-border); }
.atd-ptab {
    flex: 1; padding: 12px 8px; font-size: .78rem; font-weight: 600;
    background: none; border: none; cursor: pointer; color: var(--clx-text-muted);
    border-bottom: 2px solid transparent;
}
.atd-ptab.ativo { color: var(--clx-blue); border-bottom-color: var(--clx-blue); }
.atd-panel-body { flex: 1; overflow-y: auto; padding: 16px; }

.atd-contato-card { text-align: center; padding: 8px 0 16px; border-bottom: 1px solid var(--clx-border); margin-bottom: 14px; }
.atd-contato-nome { font-size: 1rem; font-weight: 700; color: var(--clx-text); margin-top: 10px; }
.atd-contato-tel { font-size: .8rem; color: var(--clx-text-muted); }
.atd-info-linha { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: .82rem; border-bottom: 1px solid var(--clx-border); }
.atd-info-linha span { color: var(--clx-text-muted); }
.atd-info-linha b { color: var(--clx-text); font-weight: 600; text-align: right; }

/* Dados coletados pelo formulário do bot */
.atd-coletados { margin-bottom: 16px; padding: 10px 12px; border: 1px solid var(--clx-border); border-left: 3px solid #7c3aed; border-radius: 8px; background: rgba(124, 58, 237, .04); }
.atd-coletados-tit { font-size: .76rem; font-weight: 700; color: #7c3aed; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 4px; }
.atd-coletados .atd-info-linha:last-child { border-bottom: none; }

.atd-tl-item { display: flex; gap: 10px; padding: 8px 0; }
.atd-tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--clx-blue); margin-top: 5px; flex-shrink: 0; }
.atd-tl-evt { font-size: .78rem; font-weight: 600; color: var(--clx-text); }
.atd-tl-desc { font-size: .76rem; color: var(--clx-text-muted); }
.atd-tl-data { font-size: .68rem; color: var(--clx-text-muted); margin-top: 2px; }

.atd-nota-form { margin-bottom: 14px; }
.atd-nota-form textarea.form-control { min-height: 60px; }
.atd-nota { background: #fffbe9; border: 1px solid #f5e9b8; border-radius: var(--radius-sm); padding: 10px; margin-bottom: 8px; }
.atd-nota-txt { font-size: .82rem; color: var(--clx-text); white-space: pre-wrap; }
.atd-nota-meta { font-size: .68rem; color: var(--clx-text-muted); margin-top: 5px; }

/* Responsivo: esconde colunas laterais em telas estreitas */
@media (max-width: 1100px) {
    .atd-panel { display: none; }
    .atd-panel.aberto { display: flex; position: absolute; right: 0; top: var(--header-h); bottom: 0; z-index: 40; box-shadow: -8px 0 24px rgba(0,0,0,.12); }
}
@media (max-width: 760px) {
    .atd-list { width: 100%; }
    .atd-chat { display: none; }
}

/* ------------------------------------------------------------
   CONTATOS — paginação
   ------------------------------------------------------------ */
.ct-paginacao {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; padding: 12px 18px; border-top: 1px solid var(--clx-border);
}
.ct-pag-info { font-size: .78rem; color: var(--clx-text-muted); }
.ct-pag-btns { display: flex; gap: 8px; }

/* ------------------------------------------------------------
   DEPARTAMENTOS
   ------------------------------------------------------------ */
.dep-card { display: flex; flex-direction: column; gap: 10px; }
.dep-card.inativo { opacity: .6; }
.dep-card-top { display: flex; align-items: center; gap: 9px; }
.dep-cor { width: 14px; height: 14px; border-radius: 4px; flex-shrink: 0; }
.dep-nome { font-size: .95rem; font-weight: 700; color: var(--clx-text); }
.dep-desc { font-size: .8rem; color: var(--clx-text-muted); }
.dep-stats { display: flex; gap: 16px; font-size: .78rem; color: var(--clx-text-soft); padding: 6px 0; border-top: 1px solid var(--clx-border); }
.dep-stats b { color: var(--clx-text); }
.dep-acoes { display: flex; gap: 8px; }

.dep-membros { max-height: 180px; overflow-y: auto; border: 1px solid var(--clx-border); border-radius: var(--radius-sm); padding: 8px; }
.dep-membro { display: flex; align-items: center; gap: 8px; padding: 6px 4px; cursor: pointer; font-size: .85rem; }
.dep-membro:hover { background: var(--clx-bg); border-radius: 6px; }
.dep-membro small { color: var(--clx-text-muted); }

/* ============================================================
   BOTS — construtor visual de fluxo (canvas)
   ============================================================ */
.fb-editor { position: fixed; inset: 0; z-index: 1000; background: var(--clx-bg); display: flex; flex-direction: column; }

/* Barra superior */
.fb-topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--clx-surface); border-bottom: 1px solid var(--clx-border); flex-wrap: wrap; }
.fb-topbar-campos { display: flex; align-items: center; gap: 8px; }
.fb-nome { width: 230px; font-weight: 600; min-height: auto; padding: 8px 10px; }
.fb-conta { width: 220px; min-height: auto; padding: 8px 10px; }
.fb-ativo { width: 120px; min-height: auto; padding: 8px 10px; }
.fb-dica-top { font-size: .76rem; color: var(--clx-text-muted); }

/* Corpo: paleta | canvas | painel */
.fb-corpo { flex: 1; display: flex; min-height: 0; }

.fb-paleta { width: 188px; min-width: 188px; background: var(--clx-surface); border-right: 1px solid var(--clx-border); display: flex; flex-direction: column; padding: 8px; gap: 4px; overflow-y: auto; }
.fb-paleta-tit { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--clx-text-muted); padding: 6px 6px 4px; }
.fb-blk { display: flex; align-items: center; gap: 9px; padding: 9px 8px; border-radius: 8px; font-size: .85rem; color: var(--clx-text); cursor: grab; user-select: none; border: 1px solid transparent; }
.fb-blk:hover { background: var(--clx-bg); border-color: var(--clx-border); }
.fb-blk:active { cursor: grabbing; }
.fb-blk-ic { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 15px; flex: none; }
.fb-paleta-rod { padding: 10px 6px; font-size: .72rem; color: var(--clx-text-muted); line-height: 1.7; }

/* Canvas */
.fb-canvas-wrap { flex: 1; position: relative; overflow: auto; background: var(--clx-bg); }
.fb-canvas-bg { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, var(--clx-border) 1px, transparent 1px); background-size: 22px 22px; opacity: .5; }
.fb-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 1; overflow: visible; }
.fb-lines .fb-conn { pointer-events: stroke; }
.fb-canvas { position: absolute; inset: 0; }
.fb-canvas-vazio { position: absolute; top: 40%; left: 0; right: 0; text-align: center; color: var(--clx-text-muted); font-size: .9rem; pointer-events: none; }

.fb-conn { stroke-width: 2; fill: none; opacity: .8; }
.fb-conn-draft { stroke: #9aa; stroke-width: 1.6; fill: none; stroke-dasharray: 5 4; opacity: .7; }

/* Nó */
.fb-node { position: absolute; z-index: 5; width: 210px; border-radius: 10px; border: 1.5px solid transparent; background: var(--clx-surface); box-shadow: var(--shadow-md); cursor: move; user-select: none; }
.fb-node:hover { z-index: 20; }
.fb-node.selected { border-color: #378ADD !important; box-shadow: 0 0 0 3px rgba(55,138,221,.2); }
.fb-node-head { padding: 8px 11px; border-radius: 8px 8px 0 0; display: flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 600; }
.fb-node-body { padding: 9px 11px; font-size: .78rem; color: var(--clx-text-soft); }
.fb-node-txt { color: var(--clx-text); line-height: 1.35; word-break: break-word; white-space: pre-wrap; }
.fb-node-txt i { color: var(--clx-text-muted); }
.fb-opt { position: relative; margin-top: 6px; background: var(--clx-bg); border: 1px solid var(--clx-border); border-radius: 14px; padding: 5px 12px; font-size: .76rem; color: var(--clx-text); }
.fb-badge { margin-top: 7px; border-radius: 6px; padding: 4px 9px; font-size: .73rem; }
.fb-badge-in { background: #FAEEDA; color: #854F0B; }
.fb-badge-dep { background: #EAF3DE; color: #3B6D11; }
.fb-cond-tags { display: flex; gap: 5px; margin-top: 7px; }
.fb-tag { border-radius: 4px; padding: 2px 7px; font-size: .7rem; }
.fb-tag-ok { background: #EAF3DE; color: #3B6D11; }
.fb-tag-no { background: #FCEBEB; color: #A32D2D; }

/* Portas */
.fb-port { position: absolute; width: 13px; height: 13px; border-radius: 50%; border: 2px solid var(--clx-surface); z-index: 30; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.fb-out { right: -7px; background: #378ADD; cursor: crosshair; }
.fb-in  { left: -7px;  background: #1D9E75; cursor: cell; }
.fb-opt-port { top: 50%; transform: translateY(-50%); }

/* Painel de propriedades */
.fb-panel { width: 280px; min-width: 280px; background: var(--clx-surface); border-left: 1px solid var(--clx-border); overflow-y: auto; display: flex; flex-direction: column; }
.fb-no-sel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; color: var(--clx-text-muted); font-size: .85rem; }
.fb-no-sel-ic { font-size: 30px; opacity: .5; }
.fb-panel-head { padding: 13px 16px; border-bottom: 1px solid var(--clx-border); font-size: .9rem; font-weight: 700; color: var(--clx-text); }
.fb-panel-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.fb-panel-foot { padding: 12px 16px; border-top: 1px solid var(--clx-border); }
.fb-fgroup { display: flex; flex-direction: column; gap: 4px; }
.fb-flabel { font-size: .74rem; font-weight: 600; color: var(--clx-text-muted); }
.fb-f { min-height: auto; }
textarea.fb-f { resize: vertical; min-height: 64px; }
.fb-hint { font-size: .76rem; color: var(--clx-text-muted); line-height: 1.4; background: var(--clx-bg); border-radius: 6px; padding: 8px 10px; }
.fb-opt-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.fb-opt-input { flex: 1; min-height: auto; padding: 6px 9px; font-size: .82rem; }
.fb-del-opt { color: var(--clx-danger); width: 28px; height: 28px; }
.fb-add-opt { display: flex; gap: 6px; margin-top: 4px; }
.fb-add-opt input { flex: 1; min-height: auto; padding: 6px 9px; }

@media (max-width: 820px) {
    .fb-paleta { width: 150px; min-width: 150px; }
    .fb-panel { width: 240px; min-width: 240px; }
    .fb-topbar-campos { flex-wrap: wrap; }
}

/* ---- Simulador (chat de teste) ---- */
.fb-sim { position: fixed; inset: 0; z-index: 1100; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; }
.fb-sim-box { width: 390px; max-width: 94vw; height: 580px; max-height: 90vh; background: #0b141a; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-lg); }
.fb-sim-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: #1f2c34; color: #e9edef; font-size: .9rem; font-weight: 600; }
.fb-sim-head small { color: #8696a0; font-weight: 400; font-size: .72rem; }
.fb-sim-head-btns { display: flex; align-items: center; gap: 6px; }
.fb-sim-head .btn-icon { color: #e9edef; }
.fb-sim-msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 7px; }
.fb-sim-bolha { max-width: 82%; padding: 7px 11px; border-radius: 8px; font-size: .84rem; line-height: 1.4; color: #e9edef; word-break: break-word; white-space: pre-wrap; }
.fb-sim-bot { align-self: flex-start; background: #202c33; border-top-left-radius: 2px; }
.fb-sim-cli { align-self: flex-end; background: #005c4b; border-top-right-radius: 2px; }
.fb-sim-opts { display: flex; flex-direction: column; gap: 5px; align-self: flex-start; width: 82%; }
.fb-sim-opt { text-align: left; background: #202c33; color: #53bdeb; border: 1px solid #2a3942; border-radius: 8px; padding: 8px 11px; font-size: .84rem; cursor: pointer; }
.fb-sim-opt:hover { background: #2a3942; }
.fb-sim-nota { align-self: center; text-align: center; font-size: .72rem; color: #8696a0; padding: 3px 10px; line-height: 1.35; }
.fb-sim-input { display: flex; gap: 8px; padding: 10px; background: #1f2c34; }
.fb-sim-input .form-control { flex: 1; min-height: auto; background: #2a3942; border-color: #2a3942; color: #e9edef; }
.fb-sim-input .form-control::placeholder { color: #8696a0; }

/* ------------------------------------------------------------
   WHATSAPP — ajuda do webhook + campos
   ------------------------------------------------------------ */
.wa-help-linha { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.wa-help-linha > span { font-size: .78rem; color: var(--clx-text-muted); min-width: 150px; }
.wa-help-linha code { background: var(--clx-bg); padding: 6px 10px; border-radius: 6px; font-size: .8rem; color: var(--clx-text); flex: 1; min-width: 200px; word-break: break-all; }
.wa-help-obs { font-size: .76rem; color: var(--clx-text-muted); margin-top: 8px; }
.wa-help-obs code { background: var(--clx-bg); padding: 1px 5px; border-radius: 4px; }
.wa-campos { display: flex; flex-direction: column; gap: 4px; padding: 8px 0; border-top: 1px solid var(--clx-border); }
.wa-campos > div { display: flex; justify-content: space-between; font-size: .8rem; }
.wa-campos span { color: var(--clx-text-muted); }
.wa-campos b { color: var(--clx-text); font-weight: 600; }

/* ------------------------------------------------------------
   EMPRESA — horários e API key
   ------------------------------------------------------------ */
.emp-dia { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.emp-dia-nome { display: flex; align-items: center; gap: 7px; min-width: 130px; font-size: .84rem; font-weight: 500; cursor: pointer; }
.emp-dia .form-control { min-height: auto; padding: 6px 9px; max-width: 120px; }
.emp-dia span { color: var(--clx-text-muted); font-size: .8rem; }
.emp-chave-box { background: var(--clx-bg); border: 1px dashed var(--clx-border-dark); border-radius: var(--radius-sm); padding: 14px; }
.emp-chave-box code { display: block; word-break: break-all; font-size: .82rem; color: var(--clx-text); background: var(--clx-surface); padding: 8px; border-radius: 6px; }

/* ------------------------------------------------------------
   RELATÓRIOS — gráficos em CSS
   ------------------------------------------------------------ */
.rel-grafico { display: flex; align-items: flex-end; gap: 4px; height: 200px; overflow-x: auto; padding-top: 10px; }
.rel-bar-col { flex: 1; min-width: 26px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.rel-bar-val { font-size: .66rem; color: var(--clx-text-muted); margin-bottom: 3px; }
.rel-bar { width: 70%; max-width: 30px; background: linear-gradient(180deg, var(--clx-blue), #6ea0ff); border-radius: 4px 4px 0 0; transition: height .3s; min-height: 3px; }
.rel-bar-lbl { font-size: .6rem; color: var(--clx-text-muted); margin-top: 5px; white-space: nowrap; transform: rotate(-45deg); transform-origin: center; }

.rel-status-linha { margin-bottom: 14px; }
.rel-status-top { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 5px; }
.rel-status-top span { color: var(--clx-text-soft); }
.rel-status-top b { color: var(--clx-text); }
.rel-status-bar { height: 10px; background: var(--clx-bg); border-radius: 6px; overflow: hidden; }
.rel-status-bar > div { height: 100%; border-radius: 6px; transition: width .3s; }

/* ------------------------------------------------------------
   TEMPLATES
   ------------------------------------------------------------ */
.tpl-card { display: flex; flex-direction: column; gap: 8px; }
.tpl-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tpl-nome { font-size: .9rem; font-weight: 700; color: var(--clx-text); word-break: break-all; }
.tpl-meta { font-size: .72rem; color: var(--clx-text-muted); }
.tpl-conteudo { font-size: .82rem; color: var(--clx-text-soft); background: var(--clx-bg); padding: 10px; border-radius: var(--radius-sm); white-space: pre-wrap; max-height: 110px; overflow-y: auto; }
.tpl-vars { font-size: .72rem; color: var(--clx-blue); font-weight: 600; }
.tpl-vars-hint { font-size: .74rem; color: var(--clx-text-muted); }
.tpl-vars-hint code { background: var(--clx-bg); padding: 1px 5px; border-radius: 4px; }
#tpl-vars-detect { color: var(--clx-blue); font-weight: 600; }

/* ------------------------------------------------------------
   NOTIFICAÇÕES — badge do sino + dropdown
   ------------------------------------------------------------ */
.clx-notif-dot {
    position: absolute; top: 4px; right: 4px;
    min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--clx-danger); color: #fff;
    border-radius: 9px; font-size: .6rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
}
.clx-notif-dropdown {
    position: fixed; width: 320px; max-height: 420px;
    background: var(--clx-surface); border: 1px solid var(--clx-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
    z-index: 300; display: none; flex-direction: column; overflow: hidden;
}
.clx-notif-dropdown.aberto { display: flex; }
.clx-notif-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--clx-border);
    font-size: .82rem; font-weight: 700; color: var(--clx-text);
}
.clx-notif-head button {
    background: none; border: none; color: var(--clx-blue);
    font-size: .72rem; font-weight: 600; cursor: pointer;
}
.clx-notif-lista { overflow-y: auto; }
.clx-notif-item {
    display: block; padding: 11px 14px; border-bottom: 1px solid var(--clx-border);
    text-decoration: none; transition: background var(--transition);
}
.clx-notif-item:hover { background: var(--clx-bg); text-decoration: none; }
.clx-notif-item.nova { background: var(--clx-blue-light); }
.clx-notif-tit { font-size: .82rem; font-weight: 600; color: var(--clx-text); }
.clx-notif-corpo { font-size: .76rem; color: var(--clx-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clx-notif-data { font-size: .68rem; color: var(--clx-text-muted); margin-top: 3px; }
.clx-notif-vazio { padding: 28px; text-align: center; color: var(--clx-text-muted); font-size: .82rem; }
