/* ============================================================
   CRM WhatsApp - Design System (v2)
   Base: neutros + uma cor de destaque (índigo), bordas finas,
   muito respiro, tipografia Inter e modo escuro nativo.
   90% neutro · 8% destaque · 2% estados
   ============================================================ */

/* ---------------- Fonte Inter embutida (woff2) ----------------
   A Inter vai junto com o projeto (assets/fonts), com os pesos 400/500/600.
   Nome próprio ("Inter CRM") de propósito: se a máquina do usuário tiver uma
   Inter instalada incompleta (uma única face pesada), ela NÃO é usada aqui -
   o navegador carrega estes arquivos e os pesos são respeitados.
   Sem CDN: os arquivos são servidos pelo próprio CRM. */
@font-face {
    font-family: "Inter CRM";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/inter-latin-400.woff2") format("woff2");
}
@font-face {
    font-family: "Inter CRM";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("../fonts/inter-latin-500.woff2") format("woff2");
}
@font-face {
    font-family: "Inter CRM";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("../fonts/inter-latin-600.woff2") format("woff2");
}

/* ---------------- Tokens ---------------- */
:root {
    /* Superfícies */
    --bg:            #F8F9FB;
    --surface:       #FFFFFF;
    --surface-2:     #F3F4F8;
    --surface-3:     #EDEFF4;
    --sidebar-bg:    #FFFFFF;
    --sidebar-text:  #4B5563;

    /* Bordas */
    --border:        #E8EAEF;
    --border-soft:   #F1F3F7;
    --border-strong: #DDE1E9;

    /* Texto */
    --text:          #111827;
    --text-soft:     #6B7280;
    --text-faint:    #9CA3AF;
    --ink:           #111827;

    /* Destaque (único) */
    --accent:        #4F46E5;
    --accent-hover:  #4338CA;
    --accent-dark:   #4338CA;
    --accent-soft:   #EEF2FF;
    --accent-soft-2: #E0E7FF;
    --accent-ring:   rgba(79, 70, 229, .16);
    --on-accent:     #FFFFFF;

    /* Estados */
    --green:         #16A34A;
    --green-dark:    #15803D;
    --green-soft:    #ECFDF3;
    --red:           #DC2626;
    --red-dark:      #B91C1C;
    --red-soft:      #FEF2F2;
    --amber:         #F59E0B;
    --amber-dark:    #B45309;
    --amber-soft:    #FFFBEB;
    --slate:         #64748B;
    --slate-soft:    --surface-2;

    /* Formas */
    --radius-xs:     6px;
    --radius-sm:     8px;
    --radius:        12px;
    --radius-lg:     16px;
    --radius-full:   999px;

    /* Sombras (quase invisíveis) */
    --shadow-xs:     0 1px 2px rgba(16, 24, 40, .04);
    --shadow:        0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .03);
    --shadow-md:     0 4px 12px rgba(16, 24, 40, .07);
    --shadow-lg:     0 12px 32px rgba(16, 24, 40, .12);

    /* Movimento */
    --ease:          cubic-bezier(.22, 1, .36, 1);
    --t-fast:        150ms;
    --t-base:        200ms;

    /* Layout */
    --sidebar-w:     240px;
    --sidebar-w-min: 72px;
    --topbar-h:      64px;
    --content-max:   1320px;

    /* Fonte do painel: Inter, entregue pelo próprio CRM (assets/fonts).
       O nome "Inter CRM" evita a Inter instalada na máquina, que em alguns
       casos tem só uma face pesada e deixava o painel inteiro "bold".
       Fallback: fonte de interface do sistema. */
    --font: "Inter CRM", "Inter", system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

/* ---------------- Modo escuro ---------------- */
html[data-theme="dark"] {
    --bg:            #0B0D12;
    --surface:       #12151C;
    --surface-2:     #171B24;
    --surface-3:     #1E232E;
    --sidebar-bg:    #0E1116;
    --sidebar-text:  #9AA3B2;

    --border:        #1F2430;
    --border-soft:   #191E27;
    --border-strong: #2A3140;

    --text:          #E8EAF0;
    --text-soft:     #9AA3B2;
    --text-faint:    #6B7482;
    --ink:           #E8EAF0;

    --accent:        #6366F1;
    --accent-hover:  #7C7FF5;
    --accent-dark:   #818CF8;
    --accent-soft:   #1B1F35;
    --accent-soft-2: #232850;
    --accent-ring:   rgba(99, 102, 241, .28);
    --on-accent:     #FFFFFF;

    --green:         #22C55E;
    --green-dark:    #4ADE80;
    --green-soft:    #10231A;
    --red:           #F87171;
    --red-dark:      #FCA5A5;
    --red-soft:      #26151A;
    --amber:         #FBBF24;
    --amber-dark:    #FCD34D;
    --amber-soft:    #241E12;

    --shadow-xs:     0 1px 2px rgba(0, 0, 0, .4);
    --shadow:        0 1px 2px rgba(0, 0, 0, .45);
    --shadow-md:     0 4px 14px rgba(0, 0, 0, .5);
    --shadow-lg:     0 16px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
}

/* ---------------- Base ---------------- */
* { box-sizing: border-box; }

html, body { height: 100%; overflow-x: hidden; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    letter-spacing: -.006em;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, video, audio { max-width: 100%; }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.02em; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

button { font-family: inherit; }

input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }

::selection { background: var(--accent-soft-2); color: var(--text); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* Utilidades */
.hidden { display: none !important; }
.muted { color: var(--text-soft); }
.small { font-size: 12px; }
.full { grid-column: 1 / -1; }
.nowrap { white-space: nowrap; }

/* Ícones */
.icon { width: 18px; height: 18px; flex: none; stroke-width: 1.75; }
.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; flex: none;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text-soft); cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.icon-btn:hover { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 26%, transparent); color: var(--accent-dark); }
.icon-btn:active { transform: scale(.97); }
.icon-btn.is-active { background: var(--accent-soft); color: var(--accent); }
.icon-btn.icon-sm { width: 32px; height: 32px; }
.icon-btn.icon-sm .icon { width: 15px; height: 15px; }

/* ============================================================
   Shell: sidebar + topbar + conteúdo
   ============================================================ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 60;
    width: var(--sidebar-w);
    background: var(--sidebar-bg); color: var(--sidebar-text);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    transition: width var(--t-base) var(--ease), transform var(--t-base) var(--ease);
}

/* Marca */
.brand {
    display: flex; align-items: center; gap: 10px;
    height: var(--topbar-h); padding: 0 18px; flex: none;
    border-bottom: 1px solid var(--border-soft);
}
.brand-dot {
    width: 32px; height: 32px; border-radius: 9px; flex: none;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    display: grid; place-items: center; color: #fff;
    font-size: 14px; font-weight: 600;
    box-shadow: 0 2px 6px rgba(79, 70, 229, .28);
}
.brand-dot .icon { width: 17px; height: 17px; }
.brand strong { display: block; color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; letter-spacing: -.01em; }
.brand small { color: var(--text-faint); font-size: 11.5px; white-space: nowrap; }

/* Navegação */
.nav {
    flex: 1; padding: 12px 12px 8px; overflow-y: auto; overflow-x: hidden;
    display: flex; flex-direction: column; gap: 2px;
    scrollbar-width: thin;
}
.nav-section {
    font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--text-faint); padding: 14px 12px 6px;
}
.nav-section:first-child { padding-top: 2px; }

.nav-item {
    position: relative;
    display: flex; align-items: center; gap: 11px;
    height: 38px; padding: 0 12px; width: 100%;
    border: 0; border-radius: var(--radius-sm);
    color: var(--sidebar-text); background: transparent;
    font-size: 13.5px; font-weight: 500; text-align: left;
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast);
}
.nav-item .icon { width: 18px; height: 18px; color: var(--text-faint); transition: color var(--t-fast); }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item:hover .icon { color: var(--text-soft); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.nav-item.active .icon { color: var(--accent); }
.nav-item.active::before {
    content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-item > span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-chev { width: 15px !important; height: 15px !important; margin-left: auto; color: var(--text-faint) !important; transition: transform var(--t-base) var(--ease); }
.nav-group.open .nav-chev { transform: rotate(90deg); }
.nav-sub { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-base) var(--ease); }
.nav-group.open .nav-sub { grid-template-rows: 1fr; }
.nav-sub > div, .nav-sub-inner { overflow: hidden; }
.nav-sub-item { height: 34px; padding-left: 41px; font-size: 13px; }
.nav-sub-item::before { display: none; }

/* Badges */
.nav-badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px;
    border-radius: var(--radius-full); background: var(--red); color: #fff;
    font-size: 11px; font-weight: 600; line-height: 20px; text-align: center;
}
.nav-badge-blue, .nav-badge-violet, .nav-badge-amber { background: var(--accent); animation: none; }
.nav-item.active .nav-badge-blue,
.nav-item.active .nav-badge-violet,
.nav-item.active .nav-badge-amber { background: var(--accent); color: #fff; }

/* Rodapé do usuário */
.sidebar-user {
    display: flex; align-items: center; gap: 10px; flex: none;
    padding: 12px; border-top: 1px solid var(--border-soft);
}
.avatar {
    width: 34px; height: 34px; border-radius: 50%; flex: none;
    background: var(--accent-soft-2); color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 13px;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-info strong { display: block; color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-info small { color: var(--text-faint); font-size: 11px; }
.logout-form { flex: none; }
.sidebar-user .icon-btn { color: var(--text-faint); }
.sidebar-user .icon-btn:hover { background: var(--red-soft); color: var(--red); }

/* Sidebar recolhida */
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-min); }
body.sidebar-collapsed .brand { justify-content: center; padding: 0; }
body.sidebar-collapsed .brand > div:last-child,
body.sidebar-collapsed .nav-section,
body.sidebar-collapsed .nav-item > span,
body.sidebar-collapsed .nav-chev,
body.sidebar-collapsed .nav-sub,
body.sidebar-collapsed .sidebar-user-info,
body.sidebar-collapsed .sidebar-user .logout-form { display: none; }
body.sidebar-collapsed .nav { padding: 12px 10px; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 0; }
body.sidebar-collapsed .nav-item.active::before { left: -10px; }
body.sidebar-collapsed .nav-badge {
    position: absolute; top: 3px; right: 4px; margin: 0;
    min-width: 16px; height: 16px; line-height: 16px; font-size: 9.5px; padding: 0 4px;
}
body.sidebar-collapsed .sidebar-user { justify-content: center; padding: 12px 8px; }

/* Área principal */
.main {
    flex: 1; min-width: 0; min-height: 100vh;
    margin-left: var(--sidebar-w);
    display: flex; flex-direction: column;
    transition: margin-left var(--t-base) var(--ease);
}
body.sidebar-collapsed .main { margin-left: var(--sidebar-w-min); }

.topbar {
    position: sticky; top: 0; z-index: 40; flex: none;
    display: flex; align-items: center; gap: 10px;
    height: var(--topbar-h); padding: 0 24px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.topbar-crumb { font-size: 12px; color: var(--text-faint); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: none; }
.menu-toggle { display: inline-flex; }

.content { flex: 1; width: 100%; max-width: var(--content-max); margin: 0 auto; padding: 28px 32px 72px; }

/* Cabeçalho de página */
.page-head {
    display: flex; align-items: flex-start; justify-content: space-between;
    gap: 20px; flex-wrap: wrap; margin: 0 0 24px;
}
.page-head > div:first-child { min-width: 0; }
.page-title { margin: 0; font-size: 26px; font-weight: 600; letter-spacing: -.025em; }
.page-desc { margin: 6px 0 0; color: var(--text-soft); font-size: 13.5px; max-width: 660px; }
.page-head .btn { display: inline-flex; align-items: center; gap: 8px; }
.page-head .btn .icon { width: 16px; height: 16px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Interruptor da IA (topbar) */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
    width: 38px; height: 22px; border-radius: var(--radius-full);
    background: var(--surface-3); position: relative; transition: background var(--t-base); flex: none;
}
.switch .track::after {
    content: ""; position: absolute; top: 3px; left: 3px;
    width: 16px; height: 16px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 2px rgba(16,24,40,.2); transition: transform var(--t-base) var(--ease);
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch .switch-label { font-size: 12px; font-weight: 500; color: var(--text-faint); transition: color var(--t-base); }
.switch.on .switch-label { color: var(--accent); }
.switch.paused .switch-label { color: var(--text-faint); }

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); animation: blink 1.4s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* ============================================================
   Cards
   ============================================================ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
}
.card-pad { padding: 20px 22px; }
.card-title {
    font-size: 15px; font-weight: 600; letter-spacing: -.01em;
    margin-bottom: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.card-title .icon { width: 17px; height: 17px; color: var(--text-faint); flex: none; }
.card-sub { font-size: 12.5px; color: var(--text-soft); font-weight: 400; margin: -8px 0 16px; }

/* ============================================================
   Botões - o botão PADRÃO tem cor: fundo suave na cor padrão do
   sistema com texto na mesma cor. O primário é a cor cheia.
   ============================================================ */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    height: 40px; padding: 0 16px;
    border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
    border-radius: var(--radius-sm);
    background: var(--accent-soft); color: var(--accent-dark);
    font-size: 13.5px; font-weight: 500; white-space: nowrap;
    cursor: pointer; user-select: none;
    transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { background: var(--accent-soft-2); border-color: color-mix(in srgb, var(--accent) 42%, transparent); color: var(--accent-hover); }
.btn:active { transform: translateY(.5px); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 500; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }

.btn-success {
    background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 28%, transparent);
    color: var(--green-dark); font-weight: 600;
}
.btn-success:hover { background: color-mix(in srgb, var(--green) 16%, var(--surface)); color: var(--green-dark); }

.btn-danger {
    background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 24%, transparent);
    color: var(--red-dark);
}
.btn-danger:hover { background: color-mix(in srgb, var(--red) 14%, var(--surface)); color: var(--red-dark); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--accent-dark); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-hover); }

.btn-sm { height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14.5px; }
.btn-block { width: 100%; }
.btn .icon { width: 16px; height: 16px; }
.btn-sm .icon { width: 14px; height: 14px; }

/* Loading do botão */
.btn.is-busy { pointer-events: none; opacity: .75; }
.btn.is-busy::before {
    content: ""; width: 13px; height: 13px; flex: none;
    border: 2px solid currentColor; border-top-color: transparent;
    border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Formulários
   ============================================================ */
input[type="text"], input[type="password"], input[type="email"], input[type="tel"],
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="number"],
input[type="search"], input[type="url"], input[type="color"], select, textarea {
    width: 100%; height: 40px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text);
    outline: none;
    transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
input[type="color"] { padding: 3px; width: 52px; cursor: pointer; }
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--border-strong); }
input:focus, select:focus, textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-ring);
}
input:disabled, select:disabled, textarea:disabled,
input[readonly] { background: var(--surface-2); color: var(--text-soft); cursor: default; }
select {
    appearance: none; -webkit-appearance: none; padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center;
    cursor: pointer;
}
html[data-theme="dark"] select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239AA3B2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
select option { background: var(--surface); color: var(--text); }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }

label.f-label, .f-label {
    display: block; font-size: 12.5px; font-weight: 500;
    margin: 0 0 6px; color: var(--text-soft);
}
.f-label .muted { font-weight: 400; }

.form-row { margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 20px; align-items: start; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-section-title {
    font-size: 11px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--text-faint); font-weight: 600;
    margin: 28px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--border-soft);
}
.form-section-title:first-child { margin-top: 0; }
.form-actions {
    display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
    margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border-soft);
}
.form-hint { font-size: 12px; color: var(--text-faint); margin: 6px 0 0; }
.err, .field-error { color: var(--red); font-size: 12px; margin: 6px 0 0; }

.token-box { display: flex; gap: 8px; align-items: center; }
.token-box input { font-family: var(--mono); font-size: 12.5px; }
.social-field {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 0 12px; height: 40px; min-width: 210px; flex: 1;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.social-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.social-field .icon { width: 16px; height: 16px; color: var(--text-faint); flex: none; }
.social-field input { border: 0; box-shadow: none !important; background: transparent; padding: 0; height: auto; }
.pick-all { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-soft); cursor: pointer; }

/* ============================================================
   Alertas e mensagens
   ============================================================ */
.alert {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 12px 14px; margin-bottom: 16px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2); color: var(--text);
    font-size: 13.5px;
}
.alert-info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-dark); }
.alert-ok  { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 24%, transparent); color: var(--green-dark); }
.alert-error { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 24%, transparent); color: var(--red-dark); }
.alert-warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 28%, transparent); color: var(--amber-dark); }

/* ============================================================
   Pills, chips e badges
   ============================================================ */
.chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: var(--radius-full);
    border: 1px solid var(--border); background: var(--surface-2);
    font-size: 12px; font-weight: 500; color: var(--text-soft);
}
.chip-waiting { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); color: var(--amber-dark); }
.chip-amber { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); color: var(--amber-dark); }

.status-chip {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 9px; border-radius: var(--radius-full);
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
    background: var(--surface-2); color: var(--text-soft);
}
.status-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.st-ia      { background: var(--surface-2); color: var(--text-soft); }
.st-waiting { background: var(--amber-soft); color: var(--amber-dark); }
.st-human   { background: var(--accent-soft); color: var(--accent-dark); }
.st-closed  { background: var(--surface-2); color: var(--text-faint); }
.st-pending   { background: var(--amber-soft); color: var(--amber-dark); }
.st-done      { background: var(--green-soft); color: var(--green-dark); }
.st-failed    { background: var(--red-soft); color: var(--red-dark); }
.st-cancelled { background: var(--surface-2); color: var(--text-faint); }

.stage-badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 3px 10px; border-radius: var(--radius-full);
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
    background: var(--surface-2); color: var(--text-soft);
}
.stage-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-novo         { background: var(--surface-2); color: var(--text-soft); }
.st-qualificacao { background: var(--accent-soft); color: var(--accent-dark); }
.st-oferta       { background: var(--accent-soft); color: var(--accent-dark); }
.st-negociacao   { background: var(--amber-soft); color: var(--amber-dark); }
.st-fechamento   { background: var(--green-soft); color: var(--green-dark); }
.st-perdido      { background: var(--surface-2); color: var(--text-faint); }

.stage-select {
    display: inline-flex; align-items: center; justify-content: center;
    height: 26px; padding: 0 10px; border: 1px solid transparent;
    border-radius: var(--radius-full);
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
    cursor: pointer; outline: none;
    -webkit-appearance: none; appearance: none;
    background-image: none; text-align: center; text-last-center: center;
}
.stage-select:hover { box-shadow: 0 0 0 2px var(--accent-ring); }
.stage-select:focus { box-shadow: 0 0 0 3px var(--accent-ring); }

.mini-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: var(--radius-xs);
    background: var(--surface-2); color: var(--text-soft);
    font-size: 11.5px; font-weight: 500;
}
.mini-chip .icon { width: 12px; height: 12px; }
.mini-chip.mc-value { background: var(--green-soft); color: var(--green-dark); }

.off-chip { background: var(--surface-2); color: var(--text-faint); }
.role-chip { background: var(--accent-soft); color: var(--accent-dark); }

/* Etiquetas (tags) */
.tag-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 28px; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 6px 3px 10px; border-radius: var(--radius-full);
    font-size: 11.5px; font-weight: 600; white-space: nowrap;
    background: color-mix(in srgb, var(--tg, #6366F1) 12%, var(--surface));
    color: color-mix(in srgb, var(--tg, #6366F1) 82%, var(--text));
    border: 1px solid color-mix(in srgb, var(--tg, #6366F1) 26%, transparent);
}
.tag-chip .tag-x { border: 0; background: transparent; cursor: pointer; color: inherit; opacity: .55; font-size: 13px; line-height: 1; padding: 0 2px; }
.tag-chip .tag-x:hover { opacity: 1; }
.tag-add {
    height: 28px; max-width: 190px; padding: 0 10px; cursor: pointer;
    border: 1px dashed var(--border-strong); border-radius: var(--radius-full);
    background: transparent; color: var(--text-soft); font-size: 12px;
}
.tag-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.tag-add:disabled { opacity: .5; cursor: default; }
.tag-cor-input { width: 44px; height: 30px; padding: 2px; }

/* ============================================================
   KPIs
   ============================================================ */
.stat-grid {
    display: grid; gap: 16px; margin-bottom: 24px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.stat { padding: 18px 20px; }
.stat .stat-label { font-size: 12px; font-weight: 500; color: var(--text-soft); }
.stat .stat-value {
    font-size: 30px; font-weight: 600; letter-spacing: -.03em; margin-top: 6px;
    font-variant-numeric: tabular-nums;
}
.stat .stat-sub { font-size: 12px; color: var(--text-faint); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.stat .stat-sub .icon { width: 13px; height: 13px; }
.stat-sub.up { color: var(--green-dark); }
.stat-sub.down { color: var(--red-dark); }
.stat-waiting { border-color: color-mix(in srgb, var(--amber) 32%, var(--border)); }
.stat-waiting .stat-value { color: var(--amber-dark); }
.stat.ia-active .stat-value { color: var(--text); }
.stat-click { cursor: pointer; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.stat-click:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); }

.dash-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.dash-grid .full { grid-column: 1 / -1; }
@media (max-width: 1100px) { .dash-grid { grid-template-columns: 1fr; } }

.chart-wrap { width: 100%; overflow-x: auto; }
.chart-wrap svg { display: block; min-width: 520px; width: 100%; height: auto; }

/* ============================================================
   Kanban (funil)
   ============================================================ */
.kanban {
    display: grid; gap: 14px; align-items: start;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.kcol {
    min-height: 200px; padding: 12px;
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--t-fast), background var(--t-fast);
}
.kcol.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 12px; }
.kcol-title { font-size: 12.5px; font-weight: 600; color: var(--text-soft); text-transform: uppercase; letter-spacing: .04em; }
.kcol-count {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: var(--radius-full);
    background: var(--surface-3); color: var(--text-soft);
    font-size: 11.5px; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center;
}
.kcol-body { min-height: 100px; display: flex; flex-direction: column; gap: 8px; }
.kcol-empty { color: var(--text-faint); font-size: 12px; text-align: center; padding: 20px 8px; }

.kcard {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px;
    cursor: grab; box-shadow: var(--shadow-xs);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.kcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .5; }
.kcard-top { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.kcard-name { font-weight: 500; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kcard-time { margin-left: auto; color: var(--text-faint); font-size: 11.5px; flex: none; }
.kcard-preview {
    color: var(--text-soft); font-size: 12.5px; line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kcard-foot { display: flex; align-items: center; gap: 6px; margin-top: 9px; }
.kcard .status-chip { margin-left: auto; }
.kcard-waiting { border-color: color-mix(in srgb, var(--amber) 40%, var(--border)); }

/* ============================================================
   Tabelas
   ============================================================ */
.table-wrap {
    overflow-x: auto; border: 1px solid var(--border);
    border-radius: var(--radius); background: var(--surface);
    -webkit-overflow-scrolling: touch;
}
.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th {
    text-align: left; font-size: 11.5px; font-weight: 600;
    letter-spacing: .04em; text-transform: uppercase;
    color: var(--text-faint); background: var(--surface-2);
    padding: 11px 16px; white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table td { padding: 0 16px; height: 56px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.table tbody tr { transition: background var(--t-fast); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.td-main strong { display: block; font-size: 13.5px; font-weight: 500; }
.td-main small { color: var(--text-faint); font-size: 11.5px; }
.table .empty td, .table .empty:hover td { text-align: center; color: var(--text-faint); height: auto; padding: 40px 16px; }

/* Paginação simples */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.pagination .pages { display: flex; gap: 6px; }
.pagination .page-btn {
    min-width: 34px; height: 34px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface); color: var(--text-soft); font-size: 13px; cursor: pointer;
}
.pagination .page-btn.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }

/* Abas */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab {
    appearance: none; background: none; border: 0; cursor: pointer;
    padding: 10px 14px; margin-bottom: -1px;
    font-size: 13.5px; font-weight: 500; color: var(--text-soft);
    border-bottom: 2px solid transparent; white-space: nowrap;
    transition: color var(--t-fast), border-color var(--t-fast);
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ============================================================
   Chat
   ============================================================ */
.chat-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .chat-layout { grid-template-columns: 1fr; } }

.chat-card { display: flex; flex-direction: column; height: calc(100vh - 190px); min-height: 480px; overflow: hidden; }
.chat-head {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: none;
    padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.chat-head .who { flex: 1; min-width: 0; }
.chat-head .who strong { display: block; font-size: 14.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .who small { color: var(--text-soft); font-size: 12px; }
.chat-head .actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.chat-scroll {
    flex: 1; overflow-y: auto; padding: 20px;
    display: flex; flex-direction: column; gap: 10px;
    background: var(--bg);
    scrollbar-width: thin;
}
.msg {
    max-width: min(74%, 560px); padding: 10px 14px;
    border-radius: var(--radius); position: relative;
    word-wrap: break-word; white-space: pre-wrap;
    font-size: 13.5px; line-height: 1.5;
    box-shadow: var(--shadow-xs);
}
.msg .msg-time { display: block; font-size: 10.5px; color: var(--text-faint); margin-top: 5px; }
.msg.client { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg.ia { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.msg.ia .msg-time { color: rgba(255,255,255,.7); }
.msg.human { align-self: flex-end; background: var(--green); color: #fff; border-bottom-right-radius: 4px; }
.msg.human .msg-time { color: rgba(255,255,255,.75); }
.msg.system {
    align-self: center; background: var(--surface-2); color: var(--text-soft);
    font-size: 12px; border-radius: var(--radius-full); padding: 6px 14px;
    max-width: 90%; box-shadow: none;
}
.msg.system .msg-time { display: none; }
.msg.failed { outline: 1px solid var(--red); }
.msg-tag { font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; opacity: .8; margin-right: 6px; }

.msg.selectable { cursor: pointer; transition: box-shadow var(--t-fast); }
.msg.selectable:hover { box-shadow: 0 0 0 2px var(--accent-ring); }
.msg.selected { box-shadow: 0 0 0 2px var(--accent); background: var(--accent-soft) !important; color: var(--text) !important; }
.msg.selected .msg-time { color: var(--text-soft) !important; }

.media-broken {
    display: inline-flex; align-items: center; gap: 8px;
    margin-top: 8px; padding: 8px 12px;
    background: var(--surface-2); border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm); color: var(--text-soft); font-size: 12px;
}
.media-broken .icon { width: 15px; height: 15px; color: var(--text-faint); flex: none; }
.msg.ia .media-broken, .msg.human .media-broken {
    background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.3); color: rgba(255,255,255,.9);
}
.msg.ia .media-broken .icon, .msg.human .media-broken .icon { color: rgba(255,255,255,.8); }

/* Lightbox */
.lightbox {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(9, 11, 16, .9);
    display: flex; align-items: center; justify-content: center;
    cursor: zoom-out; animation: fade-in var(--t-base) var(--ease);
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox img { max-width: 92vw; max-height: 92vh; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox .lb-close {
    position: absolute; top: 18px; right: 20px;
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border: 0; border-radius: 50%;
    background: rgba(255,255,255,.14); color: #fff; font-size: 20px; cursor: pointer;
}
.lightbox .lb-close:hover { background: rgba(255,255,255,.26); }
.lightbox .lb-caption { position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; color: rgba(255,255,255,.8); font-size: 12.5px; }

/* Composer */
.chat-input {
    display: flex; gap: 10px; align-items: flex-end; flex: none;
    padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface);
    position: relative;
}
.chat-input textarea { flex: 1; min-height: 40px; max-height: 132px; resize: none; padding: 10px 12px; }
.chat-input .btn { align-self: flex-end; }
.emoji-btn .icon, .attach-btn .icon { width: 20px; height: 20px; }
.emoji-panel {
    position: absolute; bottom: calc(100% - 6px); left: 12px; z-index: 70;
    width: 340px; max-height: 300px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden;
    animation: pop-in var(--t-base) var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.emoji-tabs { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--border-soft); flex: none; overflow-x: auto; }
.emoji-tab {
    flex: 1; min-width: 34px; background: transparent; border: 0; border-radius: var(--radius-sm);
    font-size: 19px; line-height: 1.2; padding: 4px 0; cursor: pointer; opacity: .5;
    transition: opacity var(--t-fast), background var(--t-fast);
    font-family: "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
}
.emoji-tab:hover { opacity: .85; }
.emoji-tab.active { opacity: 1; background: var(--surface-2); }
.emoji-body { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 8px; overflow-y: auto; max-height: 230px; }
.emoji-cell {
    background: transparent; border: 0; border-radius: var(--radius-sm);
    font-size: 21px; line-height: 1.2; padding: 5px 0; cursor: pointer;
    font-family: "Segoe UI Emoji", "Noto Color Emoji", "Apple Color Emoji", sans-serif;
}
.emoji-cell:hover { background: var(--surface-2); }
.chat-locked {
    display: flex; align-items: center; gap: 8px; flex: none;
    padding: 12px 16px; border-top: 1px solid var(--border);
    background: var(--surface-2); color: var(--text-soft); font-size: 13px;
}
.quick-replies { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 12px; }
.quick-replies .chip { cursor: pointer; }
.quick-replies .chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ============================================================
   Ficha do cliente
   ============================================================ */
.ficha { position: sticky; top: calc(var(--topbar-h) + 20px); }
.ficha-section { padding: 20px 22px; margin-bottom: 16px; }
.ficha-section dl, .ficha dl { margin: 0; }
.ficha-section .f-item, .ficha .f-item {
    display: flex; gap: 14px; padding: 10px 0;
    border-bottom: 1px solid var(--border-soft); align-items: baseline;
}
.ficha-section .f-item:last-child, .ficha .f-item:last-child { border-bottom: 0; }
.ficha-section .f-key, .ficha .f-key {
    flex: 0 0 132px; font-size: 12px; color: var(--text-soft); font-weight: 500;
}
.ficha-section .f-val, .ficha .f-val { font-size: 13.5px; word-break: break-word; }
.ficha-empty { color: var(--text-faint); font-size: 13px; padding: 4px 0; }
.ficha-section .f-add, .ficha .f-add { display: flex; gap: 8px; margin-top: 14px; align-items: flex-end; }
.ficha-section .f-add input:first-child, .ficha .f-add input:first-child { flex: 0 0 100px; }

.meta-row {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    padding: 9px 0; font-size: 13px; border-bottom: 1px solid var(--border-soft);
}
.meta-row:last-child { border-bottom: 0; }
.meta-row .meta-key { color: var(--text-soft); font-size: 12.5px; }

/* Observações destacadas */
.f-obs {
    margin-top: 16px; padding: 14px 16px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--surface-2);
}
.f-obs-ia { border-left: 3px solid var(--accent); background: var(--accent-soft); }
.f-obs-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    font-size: 12px; font-weight: 600; color: var(--text-soft); margin-bottom: 10px;
}
.f-obs-head .icon { width: 15px; height: 15px; }
.f-obs-body { font-size: 13px; white-space: pre-wrap; word-break: break-word; line-height: 1.55; }

/* Notas em balões */
.notes-list { display: flex; flex-direction: column; gap: 8px; max-height: 280px; overflow-y: auto; margin-bottom: 12px; }
.note-bubble {
    position: relative; align-self: flex-start; max-width: 96%;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) var(--radius) 4px;
    padding: 10px 14px; box-shadow: var(--shadow-xs);
}
.note-bubble.legacy { background: var(--surface-2); border-style: dashed; }
.note-bubble .note-text { font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; padding-right: 18px; }
.note-bubble .note-meta { font-size: 10.5px; color: var(--text-faint); margin-top: 6px; }
.note-bubble .note-del {
    position: absolute; top: 4px; right: 4px; border: 0; background: transparent;
    color: var(--text-faint); font-size: 17px; line-height: 1; cursor: pointer;
    padding: 2px 6px; border-radius: var(--radius-xs);
}
.note-bubble .note-del:hover { background: var(--red-soft); color: var(--red); }
.note-add { display: flex; gap: 8px; align-items: flex-end; }
.note-add .note-input { flex: 1; min-height: 40px; max-height: 140px; resize: none; font-size: 13px; }
.note-add .note-save { flex: none; }
.notes-loading { color: var(--text-faint); font-size: 12px; }

/* Linha do tempo */
.tl-day {
    font-size: 11px; font-weight: 600; letter-spacing: .06em;
    text-transform: uppercase; color: var(--text-faint);
    margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border-soft);
}
.tl-day:first-child { margin-top: 0; }
.tl-item {
    display: flex; gap: 10px; padding: 8px 0 8px 14px;
    margin-left: 10px; border-left: 1.5px solid var(--border);
}
.tl-ico {
    flex: none; width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center; margin-left: -26px;
    background: var(--surface); color: var(--text-soft);
    box-shadow: 0 0 0 2px var(--border);
}
.tl-ico .icon { width: 12px; height: 12px; }
.tl-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-body strong { font-size: 13px; font-weight: 500; }
.tl-det { font-size: 12.5px; color: var(--text-soft); word-break: break-word; }
.tl-when { font-size: 11px; color: var(--text-faint); }
.tl-mensagem .tl-ico { color: #0284C7; }
.tl-nota .tl-ico     { color: #7C3AED; }
.tl-proposta .tl-ico { color: #C2410C; }
.tl-compra .tl-ico   { color: var(--green-dark); }
.tl-disparo .tl-ico  { color: #EA580C; }
.tl-reuniao .tl-ico  { color: #2563EB; }
.tl-tarefa .tl-ico   { color: #0891B2; }
.tl-sistema .tl-ico  { color: var(--text-faint); }

/* ============================================================
   Follow-ups / listas de itens
   ============================================================ */
.fu-item { display: flex; align-items: center; gap: 14px; padding: 14px 20px; }
.fu-item + .fu-item { border-top: 1px solid var(--border-soft); }
.fu-icon {
    width: 40px; height: 40px; border-radius: var(--radius-sm); flex: none;
    background: var(--surface-2); color: var(--text-soft);
    display: flex; align-items: center; justify-content: center; font-size: 17px;
}
.fu-icon .icon { width: 18px; height: 18px; }
.fu-info { flex: 1; min-width: 0; }
.fu-info strong { font-size: 13.5px; font-weight: 500; display: block; }
.fu-info .reason { color: var(--text-soft); font-size: 12.5px; margin-top: 3px; display: block; }
.fu-info .when { color: var(--text-faint); font-size: 11.5px; margin-top: 3px; display: block; }
.fu-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.fu-overdue { background: var(--red-soft); }
.purch-status {
    height: 30px; max-width: 140px; font-size: 12px;
    border-radius: var(--radius-full); padding: 0 10px;
}

/* ============================================================
   Configurações
   ============================================================ */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.settings-grid .full { grid-column: 1 / -1; }
.settings-section { padding: 22px 24px; margin-bottom: 16px; }
.settings-section h2 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.settings-section p.desc { color: var(--text-soft); font-size: 13px; margin: 0 0 18px; max-width: 720px; }
.user-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border-soft); }
.user-row:last-child { border-bottom: 0; }
.user-row .u-info { flex: 1; min-width: 0; }
.user-row .u-info strong { font-size: 13.5px; font-weight: 600; display: block; }
.user-row .u-info small { color: var(--text-faint); font-size: 11.5px; }

/* Plataformas de IA */
#platform-list { display: flex; flex-direction: column; gap: 8px; }
.platform-option {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 12px 14px; text-align: left; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
    transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.platform-option:hover { border-color: var(--border-strong); }
.platform-option.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-ring); }
.platform-dot {
    width: 32px; height: 32px; border-radius: var(--radius-sm); flex: none;
    display: flex; align-items: center; justify-content: center;
    background: var(--text); color: var(--surface); font-weight: 600; font-size: 13px;
}
.platform-option.selected .platform-dot { background: var(--accent); color: var(--on-accent); }
.platform-name { flex: 1; font-size: 13.5px; font-weight: 500; }
.platform-key-state {
    font-size: 11px; font-weight: 600; white-space: nowrap; padding: 3px 9px;
    border-radius: var(--radius-full); background: var(--surface-2); color: var(--text-soft);
}
.platform-key-state.has { background: var(--green-soft); color: var(--green-dark); }
.platform-check { width: 18px; height: 18px; border-radius: 50%; flex: none; border: 2px solid var(--border-strong); position: relative; }
.platform-option.selected .platform-check { border-color: var(--accent); }
.platform-option.selected .platform-check::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }

/* ============================================================
   Filtros e listas de cartões
   ============================================================ */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filter-bar select, .filter-bar input[type="date"], .filter-bar input[type="text"] { width: auto; min-width: 0; }
.filter-bar .search-box input { width: 100%; }
.filter-bar .btn { flex: none; }
.filter-bar .spacer { flex: 1 1 auto; }

.search-box { position: relative; flex: 1 1 280px; min-width: 200px; }
.search-box .icon {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    color: var(--text-faint); width: 16px; height: 16px; pointer-events: none;
}
.search-box input { padding-left: 36px; }

.active-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip-filter {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 8px 4px 12px; border-radius: var(--radius-full);
    background: var(--accent-soft); color: var(--accent-dark);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
    font-size: 12px; font-weight: 500; cursor: pointer;
    transition: background var(--t-fast);
}
.chip-filter:hover { background: var(--accent-soft-2); }
.chip-filter .icon { width: 12px; height: 12px; }

.result-count { color: var(--text-soft); font-size: 12.5px; }

.list-cards { display: flex; flex-direction: column; gap: 10px; }
.lcard {
    display: flex; gap: 14px; align-items: center;
    padding: 14px 18px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow-xs);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.lcard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.lcard-avatar {
    width: 42px; height: 42px; border-radius: var(--radius-sm); flex: none;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 15px; color: #fff; letter-spacing: .02em;
}
.av-0 { background: #6366F1; } .av-1 { background: #0EA5E9; } .av-2 { background: #10B981; }
.av-3 { background: #F59E0B; } .av-4 { background: #EF4444; } .av-5 { background: #8B5CF6; }
.av-6 { background: #14B8A6; } .av-7 { background: #EC4899; }
.lcard-body { flex: 1; min-width: 0; }
.lcard-title { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; flex-wrap: wrap; }
.lcard-title .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lcard-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; color: var(--text-soft); font-size: 12.5px; }
.lcard-meta span { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.lcard-meta .icon { width: 14px; height: 14px; color: var(--text-faint); flex: none; }
.lcard-meta .meta-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.lcard-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.lcard-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.lcard-right .lcard-time { color: var(--text-faint); font-size: 11.5px; display: flex; align-items: center; gap: 5px; }
.lcard-right .lcard-time .icon { width: 13px; height: 13px; }
.lcard-right .chev { color: var(--text-faint); }
.lcard-right .chev .icon { width: 17px; height: 17px; }
.lcard-actions { display: flex; align-items: center; gap: 4px; }
.lcard-chat:hover { background: var(--accent-soft); color: var(--accent); }
.lcard-trash:hover, .lcard-delete:hover { background: var(--red-soft); color: var(--red); }
.lcard-check { display: flex; align-items: center; padding: 4px; cursor: pointer; flex: none; }
.lcard-check input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }

/* Mini interruptor da IA (por cliente) */
.ai-mini { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; flex: none; }
.ai-mini input { position: absolute; opacity: 0; width: 0; height: 0; }
.ai-mini-track {
    width: 30px; height: 17px; border-radius: var(--radius-full);
    background: var(--surface-3); position: relative;
    transition: background var(--t-fast); display: inline-block;
}
.ai-mini-track::after {
    content: ""; position: absolute; top: 2px; left: 2px;
    width: 13px; height: 13px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 2px rgba(16,24,40,.2); transition: left var(--t-base) var(--ease);
}
.ai-mini.on .ai-mini-track { background: var(--accent); }
.ai-mini.on .ai-mini-track::after { left: 15px; }

/* Estado vazio */
.empty-state {
    text-align: center; padding: 64px 20px; color: var(--text-faint);
    border: 1px dashed var(--border); border-radius: var(--radius);
    background: var(--surface);
}
.empty-state .icon { width: 40px; height: 40px; margin: 0 auto 14px; display: block; color: var(--text-faint); opacity: .8; }
.empty-state strong { display: block; color: var(--text); font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.empty-state p { margin: 0 auto 18px; max-width: 380px; font-size: 13.5px; color: var(--text-soft); }

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 37%, var(--surface-2) 63%);
    background-size: 400% 100%;
    animation: skeleton 1.4s ease infinite;
    border-radius: var(--radius-xs);
}
@keyframes skeleton { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
.skeleton-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; }
.skeleton-row + .skeleton-row { border-top: 1px solid var(--border-soft); }
.skeleton-circle { width: 42px; height: 42px; border-radius: var(--radius-sm); flex: none; }
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-line { height: 10px; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }

/* ============================================================
   Modais e painel lateral (sheet)
   ============================================================ */
.modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(17, 24, 39, .45);
    backdrop-filter: blur(2px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 56px 16px; overflow-y: auto;
    animation: fade-in var(--t-fast) var(--ease);
}
.modal {
    width: 100%; max-width: 460px; padding: 24px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    animation: modal-in var(--t-base) var(--ease);
}
.modal.wide { max-width: 620px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-head h2 { font-size: 17px; font-weight: 600; }
.modal .desc { color: var(--text-soft); font-size: 13px; margin: 0 0 20px; }
.modal .form-actions { margin-top: 22px; padding-top: 0; border-top: 0; }
.confirm-line { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); font-size: 13.5px; }
.confirm-line span { color: var(--text-soft); }

/* Painel lateral (desliza da direita) */
.sheet-overlay {
    position: fixed; inset: 0; z-index: 210;
    background: rgba(17, 24, 39, .38);
    backdrop-filter: blur(2px);
    animation: fade-in var(--t-fast) var(--ease);
}
.sheet {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 211;
    width: min(440px, 100vw);
    display: flex; flex-direction: column;
    background: var(--surface); border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: sheet-in var(--t-base) var(--ease);
}
@keyframes sheet-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.sheet-head {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 18px 20px; border-bottom: 1px solid var(--border); flex: none;
}
.sheet-head h2 { font-size: 16px; font-weight: 600; }
.sheet-body { flex: 1; overflow-y: auto; padding: 20px; }
.sheet-foot {
    display: flex; gap: 10px; justify-content: flex-end;
    padding: 16px 20px; border-top: 1px solid var(--border); flex: none;
    background: var(--surface-2);
}

/* ============================================================
   Toasts
   ============================================================ */
.toast-stack {
    position: fixed; right: 20px; bottom: 20px; z-index: 250;
    display: flex; flex-direction: column; gap: 10px;
    width: min(360px, calc(100vw - 32px));
}
.toast {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 13px 15px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow-lg);
    font-size: 13.5px; color: var(--text);
    animation: toast-in var(--t-base) var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.toast .t-ico { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--text-soft); }
.toast.success .t-ico { color: var(--green); }
.toast.error .t-ico { color: var(--red); }
.toast.warn .t-ico { color: var(--amber); }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-weight: 600; display: block; }
.toast .t-msg { color: var(--text-soft); font-size: 12.5px; display: block; margin-top: 2px; }
.toast .t-action {
    border: 0; background: transparent; color: var(--accent); font-weight: 600;
    font-size: 12.5px; cursor: pointer; padding: 2px 4px; flex: none;
}
.toast .t-close { border: 0; background: transparent; color: var(--text-faint); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 4px; flex: none; }

/* ============================================================
   Paleta de comandos (Ctrl+K)
   ============================================================ */
.cmdk-overlay {
    position: fixed; inset: 0; z-index: 260;
    background: rgba(17, 24, 39, .4); backdrop-filter: blur(2px);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 12vh 16px; animation: fade-in var(--t-fast) var(--ease);
}
.cmdk {
    width: 100%; max-width: 560px; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    animation: modal-in var(--t-base) var(--ease);
}
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.cmdk-input .icon { color: var(--text-faint); }
.cmdk-input input { border: 0; box-shadow: none; height: 28px; padding: 0; background: transparent; font-size: 15px; }
.cmdk-input input:focus { box-shadow: none; border: 0; }
.cmdk-list { max-height: 340px; overflow-y: auto; padding: 8px; }
.cmdk-group { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); padding: 10px 10px 6px; }
.cmdk-item {
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 10px 12px; border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--text); font-size: 13.5px;
    cursor: pointer; text-align: left;
}
.cmdk-item .icon { color: var(--text-faint); width: 17px; height: 17px; }
.cmdk-item .kbd { margin-left: auto; font-size: 11px; color: var(--text-faint); font-family: var(--mono); }
.cmdk-item:hover, .cmdk-item.active { background: var(--accent-soft); color: var(--accent); }
.cmdk-item:hover .icon, .cmdk-item.active .icon { color: var(--accent); }
.cmdk-foot { display: flex; gap: 14px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-faint); background: var(--surface-2); }

/* ============================================================
   Login
   ============================================================ */
.login-body {
    background: var(--bg);
    background-image: radial-gradient(900px 420px at 50% -10%, var(--accent-soft), transparent 70%);
    display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-wrap { width: 100%; max-width: 400px; }
.login-card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
    padding: 36px 32px 28px;
}
.login-brand { text-align: center; margin-bottom: 28px; }
.login-brand .brand-dot { margin: 0 auto 14px; display: grid; width: 44px; height: 44px; border-radius: 12px; }
.login-brand .brand-dot .icon { width: 22px; height: 22px; }
.login-brand h1 { font-size: 20px; font-weight: 600; }
.login-brand p { color: var(--text-soft); font-size: 13px; margin: 6px 0 0; }
.login-card .f-label { margin: 16px 0 6px; }
.login-card .btn, .login-card button[type="submit"] { margin-top: 24px; width: 100%; height: 44px; }
.login-foot { text-align: center; color: var(--text-faint); font-size: 11.5px; margin-top: 22px; }

/* ============================================================
   Propostas / Campanhas / Serviços
   ============================================================ */
.proposals-layout {
    display: grid; gap: 16px; align-items: start;
    grid-template-columns: 380px minmax(0, 1fr);
}
@media (max-width: 1100px) { .proposals-layout { grid-template-columns: 1fr; } }
.prop-composer { position: sticky; top: calc(var(--topbar-h) + 20px); }
.prop-search { margin-bottom: 10px; }
#po-cliente { max-height: 160px; }

.svc-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.svc-opt {
    position: relative; display: flex; flex-direction: column; gap: 8px;
    padding: 14px; cursor: pointer; user-select: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}
.svc-opt:hover { border-color: var(--border-strong); }
.svc-opt.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-ring); }

.svc-head { display: flex; align-items: flex-start; gap: 10px; min-width: 0; padding-right: 24px; }
.svc-nome { font-size: 14px; font-weight: 500; line-height: 1.35; color: var(--text); }
.svc-desc {
    margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--text-soft);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.svc-fields { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.svc-tipo-input, .svc-preco-input {
    height: 32px; padding: 0 8px; font-size: 12.5px;
    border: 1px solid var(--border); border-radius: var(--radius-xs);
    background: var(--surface); color: var(--text);
}
.svc-tipo-input { width: 96px; flex: none; }
.svc-preco-input { width: 104px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }

/* Antes de incluir o serviço, os campos não capturam o clique: o clique
   em QUALQUER parte do cartão o seleciona. Depois de incluído, os campos
   ficam normais para editar. */
.svc-opt:not(.selected) .svc-tipo-input,
.svc-opt:not(.selected) .svc-preco-input { pointer-events: none; opacity: .5; }

.svc-check-badge {
    position: absolute; top: 10px; right: 10px; display: none; place-items: center;
    width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
}
.svc-check-badge .icon { width: 12px; height: 12px; }
.svc-opt.selected .svc-check-badge { display: grid; }

.prop-total-bar {
    display: flex; align-items: center; justify-content: space-between;
    margin-top: 14px; padding: 14px 16px;
    border-radius: var(--radius); background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
}
.prop-total-bar span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); }
.prop-total-bar strong { font-size: 20px; font-weight: 600; letter-spacing: -.02em; color: var(--accent-dark); font-variant-numeric: tabular-nums; }

.ficha-svc { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prop-svc-card { cursor: pointer; user-select: none; transition: border-color var(--t-fast), background var(--t-fast); }
.prop-svc-card:hover { border-color: var(--accent); }
.prop-svc-card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.prop-svc-nome { font-size: 12.5px; font-weight: 600; }
.ficha-svc .prop-svc-tipo { width: 68px; height: 26px; padding: 0 4px; font-size: 11px; }
.ficha-svc .prop-svc-preco { width: 86px; height: 26px; padding: 0 6px; font-size: 11.5px; text-align: right; }
.ficha-svc .prop-svc-preco:disabled, .ficha-svc .prop-svc-tipo:disabled { opacity: .45; cursor: not-allowed; }

.prop-pending { border-left: 3px solid var(--amber); }
.prop-filter { padding: 0 10px; height: 34px; font-size: 12.5px; }
.prop-table td { vertical-align: middle; }
.prop-table .td-main { min-width: 160px; }
.prop-itens { display: flex; flex-wrap: wrap; gap: 4px; }
.prop-item-chip {
    display: inline-block; padding: 2px 9px; border-radius: var(--radius-full);
    background: var(--surface-2); border: 1px solid var(--border);
    font-size: 11px; color: var(--text-soft); white-space: nowrap;
}
.prop-total-cell { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

.hub-cards { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
@media (max-width: 900px) { .hub-cards { grid-template-columns: 1fr; } }
.hub-card {
    display: flex; align-items: center; gap: 16px;
    padding: 20px; text-decoration: none; color: var(--text);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    transition: border-color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
.hub-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-md); transform: translateY(-1px); color: var(--text); }
.hub-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--radius); flex: none; background: var(--surface-2); color: var(--text-soft); }
.hub-icon .icon { width: 22px; height: 22px; }
.hub-icon-online { background: var(--accent-soft); color: var(--accent); }
.hub-icon-pdf { background: var(--amber-soft); color: var(--amber-dark); }
.hub-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hub-info strong { font-size: 15px; font-weight: 600; }
.hub-info small { color: var(--text-soft); font-size: 12.5px; line-height: 1.5; }
.hub-arrow { width: 18px; height: 18px; color: var(--text-faint); flex: none; transition: transform var(--t-fast), color var(--t-fast); }
.hub-card:hover .hub-arrow { color: var(--accent); transform: translateX(3px); }

.online-wrap { padding: 0; }
.online-wrap .form-row { margin-bottom: 20px; }

/* Campanhas */
.steps { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step {
    display: inline-flex; align-items: center; gap: 8px;
    height: 34px; padding: 0 14px; border-radius: var(--radius-full);
    background: var(--surface-2); color: var(--text-faint);
    font-size: 12.5px; font-weight: 600;
}
.step.active { background: var(--accent-soft); color: var(--accent); }
.progress { height: 6px; border-radius: var(--radius-full); background: var(--surface-3); overflow: hidden; }
.progress-bar { height: 100%; border-radius: var(--radius-full); background: var(--accent); transition: width var(--t-base) var(--ease); }
.chart-anim { transition: width 1s var(--ease); }
.preview-box { padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.preview-bubble {
    display: inline-block; max-width: 100%; padding: 12px 14px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) var(--radius) 4px;
    font-size: 13.5px; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow-xs);
}
.var-bar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.msg-composer { overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.msg-composer:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.msg-composer textarea { border: 0; border-radius: 0; box-shadow: none !important; padding: 14px; min-height: 104px; }
.composer-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--border-soft); }
.camp-thumb { position: relative; display: inline-block; margin: 12px 0 0 12px; }
.camp-thumb img { display: block; max-width: 120px; max-height: 100px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.camp-thumb-x {
    position: absolute; top: -7px; right: -7px; width: 22px; height: 22px;
    border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
    color: var(--red); font-weight: 600; line-height: 1; cursor: pointer; box-shadow: var(--shadow-xs);
}

/* Slides (templates de proposta) */
.slide-thumbs { display: flex; flex-wrap: wrap; gap: 10px; }
.slide-thumb { position: relative; }
.slide-thumb img { display: block; width: 88px; height: 62px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.slide-num { position: absolute; left: 5px; bottom: 5px; padding: 1px 6px; border-radius: var(--radius-full); background: rgba(17,24,39,.75); color: #fff; font-size: 10px; font-weight: 600; }
.slide-del {
    position: absolute; top: -7px; right: -7px; display: flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--surface); color: var(--red); cursor: pointer; box-shadow: var(--shadow-xs);
}
.slide-del:hover { background: var(--red); border-color: var(--red); color: #fff; }
.slide-strip { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.slide-strip img { width: 44px; height: 30px; object-fit: cover; border-radius: var(--radius-xs); border: 1px solid var(--border); }
.slide-more { align-self: center; padding: 0 4px; font-size: 11px; font-weight: 600; color: var(--text-soft); }

/* Duplicados */
.dup-group { border-left: 3px solid var(--amber); }
.dup-opt { border-bottom: 1px solid var(--border-soft); }
.dup-opt:last-of-type { border-bottom: 0; }
.dup-opt input[type="radio"] { accent-color: var(--accent); }

/* Outros */
.qr-item { display: flex; align-items: center; gap: 12px; }
.icon-badge { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-soft); }
.icon-badge-group { display: flex; gap: 8px; flex-wrap: wrap; }
.eyebrow, .eyebrow-line { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.eyebrow-num { font-size: 11px; font-weight: 600; color: var(--accent); }
.section-shell { padding: 22px 24px; margin-bottom: 16px; }
.section-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.reveal { animation: reveal var(--t-base) var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.playing { color: var(--accent); }
.check { color: var(--green); }
.blue { color: #2563EB; }
.light { font-weight: 400; }
.white { color: #fff; }
.ok { color: var(--green-dark); }
.warn { color: var(--amber-dark); }
.t-title { font-size: 14px; font-weight: 600; }
.sub { font-size: 12.5px; color: var(--text-soft); }
.p { margin: 0 0 6px; font-size: 13.5px; }
.stat-card, .stats-band { padding: 18px 20px; }
.grid-4 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-combined, .grid-servico, .grid-steps, .grid-steps-sm { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.invest-row, .invest-row-name, .invest-row-price { display: flex; align-items: center; gap: 10px; }
.invest-row { justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
.pain-card, .why-block { padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.why-title, .included-title, .combined-kicker { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; }
.combined-col, .combined-divider { min-width: 0; }
.checklist { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-soft); }
.preview-bubble, .slide-strip { max-width: 100%; }
@media (max-width: 780px) { .grid-combined, .grid-servico, .grid-steps, .grid-steps-sm { grid-template-columns: 1fr; } }

/* ============================================================
   Navegação inferior (mobile) + FAB
   ============================================================ */
.bottom-nav { display: none; }
.fab { display: none; }

@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: none; }
    body.sidebar-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
    body.sidebar-collapsed .main, .main { margin-left: 0; }
    body.sidebar-collapsed .brand { justify-content: flex-start; padding: 0 18px; }
    body.sidebar-collapsed .brand > div:last-child,
    body.sidebar-collapsed .nav-item > span,
    body.sidebar-collapsed .nav-chev,
    body.sidebar-collapsed .nav-sub,
    body.sidebar-collapsed .sidebar-user-info,
    body.sidebar-collapsed .sidebar-user .logout-form { display: revert; }
    body.sidebar-collapsed .nav { padding: 12px 12px 8px; }
    body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 0 12px; }

    .topbar { padding: 0 14px; }
    .content { padding: 18px 16px 96px; }
    .page-head { margin-bottom: 18px; }
    .page-title { font-size: 22px; }

    /* Barra inferior com os 5 caminhos principais */
    .bottom-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
        display: grid; grid-template-columns: repeat(5, 1fr);
        background: color-mix(in srgb, var(--surface) 94%, transparent);
        backdrop-filter: blur(12px);
        border-top: 1px solid var(--border);
        padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    }
    .bottom-nav a {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
        min-height: 48px; padding: 4px 0; border-radius: var(--radius-sm);
        color: var(--text-faint); font-size: 10.5px; font-weight: 500;
    }
    .bottom-nav a .icon { width: 20px; height: 20px; }
    .bottom-nav a.active { color: var(--accent); }
    .bottom-nav a.active .icon { color: var(--accent); }
    .bottom-nav .bn-badge {
        position: absolute; transform: translate(14px, -12px);
        min-width: 15px; height: 15px; padding: 0 4px; border-radius: var(--radius-full);
        background: var(--red); color: #fff; font-size: 9.5px; font-weight: 600; line-height: 15px; text-align: center;
    }

    /* FAB: ação principal da tela */
    .fab {
        position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 56;
        display: inline-flex; align-items: center; justify-content: center;
        width: 52px; height: 52px; border: 0; border-radius: 50%;
        background: var(--accent); color: var(--on-accent);
        box-shadow: 0 8px 24px rgba(79, 70, 229, .35);
        cursor: pointer;
    }
    .fab .icon { width: 22px; height: 22px; }
    .fab:active { transform: scale(.96); }

    /* Painel lateral vira folha que sobe */
    .sheet {
        top: auto; left: 0; right: 0; bottom: 0; width: 100%;
        max-height: 88vh; border-left: 0; border-top: 1px solid var(--border);
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        animation: sheet-up var(--t-base) var(--ease);
    }
    @keyframes sheet-up { from { transform: translateY(20px); opacity: .7; } to { transform: none; opacity: 1; } }
    .sheet::before {
        content: ""; display: block; width: 40px; height: 4px; border-radius: 2px;
        background: var(--border-strong); margin: 10px auto 0;
    }

    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .stat .stat-value { font-size: 24px; }
    .chat-card { height: calc(100vh - 150px); }
    .modal { padding: 20px; }
    .toast-stack { right: 12px; left: 12px; bottom: 84px; width: auto; }
}

@media (max-width: 640px) {
    .content { padding: 14px 12px 96px; }
    .card-pad, .ficha-section, .settings-section { padding: 16px; }
    .page-title { font-size: 20px; }
    .fu-item { padding: 12px 14px; gap: 12px; flex-wrap: wrap; }
    .fu-actions { width: 100%; justify-content: flex-end; }
    .lcard { padding: 12px 14px; gap: 12px; }
    .lcard-right .chev { display: none; }
    .msg { max-width: 88%; }
    .table td { padding: 0 12px; }
    .table th { padding: 10px 12px; }
    .emoji-panel { left: 8px; right: 8px; width: auto; }
    .token-box { flex-wrap: wrap; }
    .topbar .switch-label { display: none; }
    .page-actions .btn { flex: 1 1 auto; }
    .mk-hide { display: none !important; }
}

/* Scrollbars discretos */
.chat-scroll::-webkit-scrollbar, .table-wrap::-webkit-scrollbar, .nav::-webkit-scrollbar, .notes-list::-webkit-scrollbar, .sheet-body::-webkit-scrollbar, .cmdk-list::-webkit-scrollbar {
    width: 8px; height: 8px;
}
.chat-scroll::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb, .nav::-webkit-scrollbar-thumb,
.notes-list::-webkit-scrollbar-thumb, .sheet-body::-webkit-scrollbar-thumb, .cmdk-list::-webkit-scrollbar-thumb {
    background: var(--border-strong); border-radius: 8px;
}
.chat-scroll::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track, .nav::-webkit-scrollbar-track,
.notes-list::-webkit-scrollbar-track, .sheet-body::-webkit-scrollbar-track, .cmdk-list::-webkit-scrollbar-track { background: transparent; }

/* Impressão */
@media print {
    .sidebar, .topbar, .bottom-nav, .fab, .toast-stack, .filter-bar, .page-actions { display: none !important; }
    .main { margin-left: 0 !important; }
    .content { padding: 0; max-width: none; }
    .card { border-color: #ddd; box-shadow: none; }
}

/* ============================================================
   Menu lateral: mais respiro entre os itens
   ============================================================ */
.nav { gap: 6px; padding: 14px 12px 10px; }
.nav-item { height: 42px; padding: 0 12px; font-size: 13.5px; }
.nav-item .icon { width: 19px; height: 19px; }
.nav-section { padding: 22px 12px 10px; }
.nav-section:first-child { padding-top: 4px; }
.nav-sub { margin-top: 4px; }
.nav-sub-inner { display: flex; flex-direction: column; gap: 2px; }
.nav-sub-item { height: 36px; padding-left: 42px; }
.nav-item.active::before { height: 22px; }
.sidebar-user { padding: 14px 12px; }

/* Ajustes finos do cabeçalho de página e das tabelas */
.page-head { margin-bottom: 26px; }
.table th { background: var(--surface-2); }
.table tbody tr { cursor: default; }
.table tbody tr.client-row { cursor: pointer; }
.tag-row .tag-chip { font-size: 11px; }

/* Selects "pílula" dentro de tabelas: sem aparência nativa (estável no
   modo escuro, onde o controle nativo do sistema desenhava por cima). */
.stage-select,
.purch-status {
    background-color: var(--surface-2) !important;
    background-image: none !important;
    border: 0;
    color: var(--text-soft);
    padding: 0 10px;
    line-height: 26px;
    box-shadow: none;
}
.stage-select.st-novo, .stage-select.st-perdido { color: var(--text-soft); }
.stage-select.st-qualificacao, .stage-select.st-oferta { color: var(--accent-dark); background-color: var(--accent-soft) !important; }
.stage-select.st-negociacao { color: var(--amber-dark); background-color: var(--amber-soft) !important; }
.stage-select.st-fechamento { color: var(--green-dark); background-color: var(--green-soft) !important; }
.stage-select option { color: var(--text); background: var(--surface); }
.purch-status { height: 30px; border: 1px solid var(--border); }

/* Formulários de duas colunas viram uma coluna no celular/tablet pequeno */
@media (max-width: 700px) {
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .stat-grid { grid-template-columns: 1fr; }
}

/* Botão "fantasma" também parece botão: contorno visível em vez de link */
.btn-ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text-soft);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }

/* ============================================================
   Menu lateral: MAIS respiro (pedido do cliente - ainda colado)
   ============================================================ */
.nav { gap: 10px; padding: 18px 12px 14px; }
.nav-item { height: 44px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.nav-item .icon { width: 19px; height: 19px; }
.nav-section {
    padding: 30px 14px 12px;
    font-size: 10.5px;
}
.nav-section:first-child { padding-top: 6px; }
.sidebar-user { padding: 16px 14px; }
.logout-form { margin-left: 2px; }

/* A etapa precisa caber o texto inteiro ("Apresentação de Oferta") */
.stage-select { min-width: 0; }
.stage-select.st-oferta, .stage-select.st-qualificacao { padding: 0 12px; }
@media (min-width: 981px) {
    body:not(.sidebar-collapsed) .nav-item { letter-spacing: -.01em; }
}

/* ============================================================
   Correção do menu: os itens NÃO podem encolher.
   Com muitos itens, o flex-shrink comprimia todos (ficavam com ~20px
   de altura e pareciam "grudados"). Agora mantêm 44px e a lista rola.
   ============================================================ */
.nav > * { flex: none; }
.nav-item { min-height: 44px; flex: none; }
.nav-section, .nav-group, .nav-sub { flex: none; }

/* Tabelas com larguras fixas: as colunas param de "esticar" sozinhas.
   A coluna sem width declarado (nome do cliente) fica com o espaço restante. */
.table.table-fixed { table-layout: fixed; width: 100%; }
.table.table-fixed td, .table.table-fixed th { overflow: hidden; }
.table.table-fixed .td-main { white-space: normal; }

/* Etiquetas na linha do cliente: só ocupam espaço quando existem */
.client-row .tag-row, .conv-row .tag-row { margin-top: 7px; }
.client-row .tag-row:empty, .conv-row .tag-row:empty { display: none; }
.client-row .tag-chip, .conv-row .tag-chip { font-size: 11px; padding: 2px 6px 2px 9px; }

/* Cabeçalho de tabela com largura fixa: quebra em duas linhas em vez de cortar */
.table.table-fixed th { white-space: normal; line-height: 1.25; }
/* Ações da linha: cabem exatamente na coluna (sem cortar o último botão) */
.table .lcard-actions { gap: 2px; }
.table .lcard-actions .icon-btn { width: 30px; height: 30px; }

/* ============================================================
   Menu lateral: altura final dos itens (cliente pediu ~10px menos)
   44px + 10px de espaço → 36px + 8px por item
   ============================================================ */
.nav { gap: 8px; padding: 16px 12px 12px; }
.nav-item { height: 36px; min-height: 36px; padding: 0 12px; font-size: 13.5px; }
.nav-item .icon { width: 18px; height: 18px; }
.nav-section { padding: 22px 14px 8px; }
.nav-section:first-child { padding-top: 4px; }
.nav-sub { margin-top: 2px; }
.nav-sub-item { height: 34px; padding-left: 42px; }
body.sidebar-collapsed .nav-item { height: 36px; min-height: 36px; }

/* Menu lateral: mais 10px a menos por item (36+8 → 30+4 = 34px no total) */
.nav { gap: 4px; padding: 14px 10px 10px; }
.nav-item { height: 30px; min-height: 30px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.nav-item .icon { width: 17px; height: 17px; }
.nav-section { padding: 16px 14px 6px; font-size: 10px; }
.nav-section:first-child { padding-top: 2px; }
.nav-sub-item { height: 28px; padding-left: 40px; font-size: 12.5px; }
body.sidebar-collapsed .nav-item { height: 30px; min-height: 30px; }
body.sidebar-collapsed .nav-item .icon { width: 18px; height: 18px; }
.nav-item.active::before { height: 18px; }

/* ============================================================
   Menu lateral (recolhido ou não) NUNCA mostra barra de rolagem.
   A lista continua rolando com a roda do mouse / trackpad, só não
   desenha a barra - que num menu de 72px ficava feia e cortava os ícones.
   ============================================================ */
.sidebar .nav {
    scrollbar-width: none;        /* Firefox */
    -ms-overflow-style: none;     /* Edge/IE */
    overflow-x: hidden;
}
.sidebar .nav::-webkit-scrollbar { width: 0; height: 0; display: none; }
body.sidebar-collapsed .sidebar .nav { padding: 10px 8px; }
body.sidebar-collapsed .sidebar { overflow: hidden; }

/* ============================================================
   Ficha do lead/cliente: rótulo EM CIMA do valor.
   Antes o rótulo ocupava 132px fixos e o texto ficava espremido no
   painel estreito do chat; agora o valor usa a largura toda.
   ============================================================ */
.ficha-section .f-item, .ficha .f-item {
    display: block;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-soft);
}
.ficha-section .f-item:last-child, .ficha .f-item:last-child { border-bottom: 0; }
.ficha-section .f-key, .ficha .f-key {
    display: block;
    flex: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--text-faint);
    margin-bottom: 4px;
}
.ficha-section .f-val, .ficha .f-val {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text);
    word-break: break-word;
    margin: 0;
}
/* Painel lateral do chat um pouco mais largo (a ficha respira melhor) */
.chat-layout { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1100px) { .chat-layout { grid-template-columns: 1fr; } }
/* Etiquetas na ficha do chat */
.ficha-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.ficha-tags .tag-add { flex: 1; min-width: 130px; }

/* Opção de etiqueta no painel lateral (marcar/desmarcar) */
.tag-opt {
    display: flex; align-items: center; gap: 10px; width: 100%;
    padding: 10px 12px; margin-bottom: 6px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; text-align: left;
    transition: border-color var(--t-fast), background var(--t-fast);
}
.tag-opt:hover { border-color: var(--border-strong); background: var(--surface-2); }
.tag-opt.on { border-color: color-mix(in srgb, var(--tg, var(--accent)) 45%, transparent); background: color-mix(in srgb, var(--tg, var(--accent)) 8%, var(--surface)); }
.tag-opt .tag-chip { pointer-events: none; }
.tag-opt-check {
    margin-left: auto; width: 20px; height: 20px; flex: none;
    display: grid; place-items: center;
    border: 1.5px solid var(--border); border-radius: 50%;
    color: var(--on-accent);
}
.tag-opt-check .icon { width: 13px; height: 13px; }
.tag-opt.on .tag-opt-check { background: var(--tg, var(--accent)); border-color: var(--tg, var(--accent)); }

/* ============================================================
   POLÍTICA DE PESOS DE FONTE - somente 400, 500 e 600.
   ------------------------------------------------------------
   Motivo: pesos "quebrados" (550, 650) ou 600/700 espalhados por quase
   tudo fazem o navegador arredondar para NEGRITO quando a fonte instalada
   não tem todos os pesos (ex: uma Inter estática que só tem 400 e 700).
   O painel inteiro ficava com cara de "tudo bold".
    400 = texto corrido (parágrafos, valores, mensagens)
    500 = rótulos, botões, chips, cabeçalhos de tabela, nomes
    600 = títulos de página/card e números dos indicadores
   Nada acima de 600 é usado no painel.
   ============================================================ */
body { font-weight: 400; }
strong, b { font-weight: 600; }

/* Rótulos, chips, selos e cabeçalhos de tabela: meio-termo, sem pesar */
.table th,
.status-chip,
.stage-badge,
.stage-select,
.tag-chip,
.mini-chip,
.chip,
.chip-filter,
.nav-section,
.nav-badge,
.kcol-title,
.kcol-count,
.f-obs-head,
.tl-day,
.platform-key-state,
.slide-num,
.slide-more,
.eyebrow,
.eyebrow-line,
.eyebrow-num,
.t-title,
.toast .t-action,
.cmdk-group,
.cmdk-item,
.prop-total-bar span,
.prop-svc-nome,
.prop-item-chip,
.lcard-title,
.user-row .u-info strong,
.svc-info strong,
.avatar,
.pagination .page-btn.active,
.msg-tag,
.step,
.pick-all,
.ficha-section .f-key,
.ficha .f-key {
    font-weight: 500;
}

/* Títulos e números: semibold (nunca bold) */
h1, h2, h3, h4,
.page-title,
.card-title,
.brand strong,
.topbar-title,
.stat .stat-value,
.settings-section h2,
.modal-head h2,
.sheet-head h2,
.login-brand h1,
.prop-total-bar strong,
.prop-total-cell,
.hub-info strong,
.section-title,
.empty-state strong {
    font-weight: 600;
}
/* ============================================================
   Sugestão de resposta da IA no chat
   ============================================================ */
.ai-btn { color: var(--accent); }
.ai-btn:hover { background: var(--accent-soft); color: var(--accent-hover); }

.ai-suggest {
    flex: none;
    margin: 0;
    padding: 14px 16px;
    background: var(--accent-soft);
    border-top: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
    animation: ai-in var(--t-base) var(--ease);
}
@keyframes ai-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.ai-suggest-head {
    display: flex; align-items: center; gap: 8px;
    margin-bottom: 8px; flex-wrap: wrap;
}
.ai-suggest-head strong { font-size: 13px; font-weight: 600; color: var(--accent-dark); }
.ai-suggest-head .icon-btn { margin-left: auto; }

.ai-suggest-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: var(--radius-full);
    background: var(--accent); color: var(--on-accent);
    font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
}
.ai-suggest-badge .icon { width: 13px; height: 13px; }

.ai-suggest-text {
    padding: 12px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
}
.ai-suggest-text.is-loading {
    display: flex; align-items: center; gap: 10px;
    color: var(--text-soft);
}

.ai-suggest-actions {
    display: flex; align-items: center; gap: 8px;
    margin-top: 10px; flex-wrap: wrap;
}
.ai-suggest-actions .spacer { flex: 1 1 auto; }

.chat-lock-ico { display: inline-flex; color: var(--text-faint); }


/* ============================================================
   UTILITÁRIOS - gerados a partir do CSS que estava escrito
   inline nas telas. Regra do projeto: nada de style="..."
   estático no HTML; só valores dinâmicos (cores do banco,
   larguras calculadas em %) continuam inline.
   ============================================================ */
.u-...-2f43 { ...; }
.u-align-self-center-6b92 { align-self:center; }
.u-background-var-border-1px-solid-color-mix-in-srg-f8a4 { background:var(--accent-soft);border:1px solid color-mix(in srgb, var(--accent) 22%, transparent);border-radius:var(--radius);padding:10px 14px; }
.u-background-var-padding-8px-10px-border-radius-va-e9d6 { background:var(--surface-2);padding:8px 10px;border-radius:var(--radius-sm); }
.u-border-left-color-var-8d37 { border-left-color:var(--amber); }
.u-border-0-0123 { border:0; }
.u-border-0-border-radius-0-0-var-var-7169 { border:0;border-radius:0 0 var(--radius) var(--radius); }
.u-color-4338ca-font-weight-600-b4c2 { color:#4338ca;font-weight:600; }
.u-color-64748b-margin-0-6adb { color:#64748b;margin:0; }
.u-color-var-bb2b { color:var(--accent); }
.u-color-var-ad0d { color:var(--amber); }
.u-color-var-b6ee { color:var(--amber-dark); }
.u-color-var-c081 { color:var(--green-dark); }
.u-color-var-primary-6a5cff-a601 { color:var(--primary,#6a5cff); }
.u-color-var-e093 { color:var(--red); }
.u-color-var-margin-top-3px-max-width-220px-word-br-e3b5 { color:var(--red);margin-top:3px;max-width:220px;word-break:break-word; }
.u-color-var-792d { color:var(--text-soft); }
.u-cursor-default-b1ac { cursor:default; }
.u-cursor-pointer-b202 { cursor:pointer; }
.u-display-block-color-var-font-size-15px-margin-bo-d211 { display:block;color:var(--text);font-size:15px;margin-bottom:6px; }
.u-display-block-font-size-13.5px-font-weight-500-w-6d6c { display:block;font-size:13.5px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.u-display-block-text-align-center-margin-top-8px-5978 { display:block;text-align:center;margin-top:8px; }
.u-display-block-white-space-nowrap-overflow-hidden-fd5d { display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.u-display-block-width-100%-text-align-left-padding-855b { display:block;width:100%;text-align:left;padding:8px 10px;border:0;background:transparent;border-radius:7px;cursor:pointer;font-size:13px; }
.u-display-flex-align-items-center-gap-10px-c367 { display:flex;align-items:center;gap:10px; }
.u-display-flex-align-items-center-gap-11px-min-wid-fb7e { display:flex;align-items:center;gap:11px;min-width:0; }
.u-display-flex-align-items-center-gap-11px-padding-415d { display:flex;align-items:center;gap:11px;padding:10px 12px; }
.u-display-flex-align-items-center-gap-11px-padding-26c4 { display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:var(--radius-sm);color:inherit; }
.u-display-flex-align-items-center-gap-6px-c59a { display:flex;align-items:center;gap:6px; }
.u-display-flex-align-items-center-gap-8px-flex-wra-736d { display:flex;align-items:center;gap:8px;flex-wrap:wrap;border-top:1px solid var(--border-soft);margin-top:14px;padding-top:12px; }
.u-display-flex-align-items-center-gap-8px-flex-1-1-aae1 { display:flex;align-items:center;gap:8px;flex:1 1 320px;min-width:240px; }
.u-display-flex-align-items-flex-start-gap-11px-min-c94b { display:flex;align-items:flex-start;gap:11px;min-width:0; }
.u-display-flex-flex-wrap-wrap-gap-16px-align-items-45e7 { display:flex;flex-wrap:wrap;gap:16px;align-items:flex-start; }
.u-display-flex-flex-wrap-wrap-gap-6px-flex-1-min-w-81ab { display:flex;flex-wrap:wrap;gap:6px;flex:1;min-width:220px;align-items:stretch; }
.u-display-flex-gap-10px-flex-wrap-wrap-align-items-b3e1 { display:flex;gap:10px;flex-wrap:wrap;align-items:flex-end;margin-bottom:14px; }
.u-display-flex-gap-10px-flex-wrap-wrap-margin-bott-b44d { display:flex;gap:10px;flex-wrap:wrap;margin-bottom:14px; }
.u-display-flex-gap-2px-justify-content-flex-end-ff61 { display:flex;gap:2px;justify-content:flex-end; }
.u-display-flex-gap-6px-align-items-center-margin-t-8258 { display:flex;gap:6px;align-items:center;margin-top:8px; }
.u-display-flex-gap-6px-flex-wrap-wrap-justify-cont-5a96 { display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end; }
.u-display-flex-gap-8px-align-items-flex-end-flex-w-c8d7 { display:flex;gap:8px;align-items:flex-end;flex-wrap:wrap; }
.u-display-flex-gap-8px-align-items-flex-start-padd-16de { display:flex;gap:8px;align-items:flex-start;padding:4px 0; }
.u-display-flex-justify-content-flex-end-b95a { display:flex;justify-content:flex-end; }
.u-display-flex-justify-content-space-between-font--7251 { display:flex;justify-content:space-between;font-size:12.5px;margin-bottom:4px; }
.u-display-flex-justify-content-space-between-font--099b { display:flex;justify-content:space-between;font-size:12.5px;margin-bottom:5px; }
.u-display-inline-flex-align-items-center-gap-6px-fabb { display:inline-flex;align-items:center;gap:6px; }
.u-display-inline-flex-align-items-center-gap-6px-m-7553 { display:inline-flex;align-items:center;gap:6px;margin-top:6px;color:inherit;text-decoration:underline; }
.u-display-inline-flex-align-items-center-gap-7px-6dca { display:inline-flex;align-items:center;gap:7px; }
.u-display-none-margin-top-10px-5905 { display:none;margin-top:10px; }
.u-display-none-margin-top-12px-68ac { display:none;margin-top:12px; }
.u-display-none-margin-top-8px-dcb2 { display:none;margin-top:8px; }
.u-fill-var-stroke-var-d4e3 { fill:var(--accent);stroke:var(--surface); }
.u-fill-var-ffe8 { fill:var(--text-faint); }
.u-flex-direction-column-align-items-flex-end-gap-6-c5ae { flex-direction:column;align-items:flex-end;gap:6px; }
.u-flex-direction-row-3c0e { flex-direction:row; }
.u-flex-direction-row-flex-wrap-wrap-gap-6px-122f { flex-direction:row;flex-wrap:wrap;gap:6px; }
.u-flex-wrap-wrap-9012 { flex-wrap:wrap; }
.u-flex-wrap-wrap-gap-10px-694e { flex-wrap:wrap;gap:10px; }
.u-flex-wrap-wrap-gap-8px-margin-top-10px-7a44 { flex-wrap:wrap;gap:8px;margin-top:10px; }
.u-flex-1-da5c { flex:1; }
.u-flex-1-1-200px-b7e7 { flex:1 1 200px; }
.u-flex-1-1-240px-2ae4 { flex:1 1 240px; }
.u-flex-1-min-width-0-89bd { flex:1;min-width:0; }
.u-flex-1-min-width-0-max-width-340px-height-32px-f-fae0 { flex:1;min-width:0;max-width:340px;height:32px;font-size:12px; }
.u-flex-1-min-width-140px-8371 { flex:1;min-width:140px; }
.u-flex-1-min-width-180px-810b { flex:1;min-width:180px; }
.u-flex-1-min-width-240px-7b62 { flex:1;min-width:240px; }
.u-flex-2-1-280px-0516 { flex:2 1 280px; }
.u-flex-none-ff9c { flex:none; }
.u-font-family-ui-monospace-consolas-monospace-font-10c4 { font-family:ui-monospace,Consolas,monospace;font-size:12px; }
.u-font-family-var-6ccd { font-family:var(--mono); }
.u-font-family-var-font-size-11px-d9a2 { font-family:var(--mono);font-size:11px; }
.u-font-family-var-font-size-12.5px-color-var-f8fd { font-family:var(--mono);font-size:12.5px;color:var(--text); }
.u-font-family-var-margin-left-4px-e946 { font-family:var(--mono);margin-left:4px; }
.u-font-size-14px-font-weight-500-b03b { font-size:14px;font-weight:500; }
.u-font-size-17px-74d4 { font-size:17px; }
.u-font-size-28px-margin-0-0-8px-1b01 { font-size:28px;margin:0 0 8px; }
.u-font-weight-400-text-transform-none-a50a { font-weight:400;text-transform:none; }
.u-font-weight-500-1e29 { font-weight:500; }
.u-grid-template-columns-340px-minmax-0-1fr-7f47 { grid-template-columns: 340px minmax(0,1fr); }
.u-height-14px-e3eb { height:14px; }
.u-height-200px-9cd8 { height:200px; }
.u-height-auto-padding-0-a2d0 { height:auto;padding:0; }
.u-justify-content-flex-end-36b7 { justify-content:flex-end; }
.u-justify-content-space-between-daae { justify-content:space-between; }
.u-margin-bottom-12px-fa3e { margin-bottom:12px; }
.u-margin-bottom-14px-6179 { margin-bottom:14px; }
.u-margin-bottom-16px-8e86 { margin-bottom:16px; }
.u-margin-bottom-4px-a58b { margin-bottom:4px; }
.u-margin-bottom-6px-2937 { margin-bottom:6px; }
.u-margin-bottom-8px-d517 { margin-bottom:8px; }
.u-margin-left-auto-8345 { margin-left:auto; }
.u-margin-left-auto-display-flex-gap-8px-flex-wrap--e8ca { margin-left:auto;display:flex;gap:8px;flex-wrap:wrap; }
.u-margin-left-auto-font-weight-400-7b27 { margin-left:auto;font-weight:400; }
.u-margin-top-10px-5371 { margin-top:10px; }
.u-margin-top-12px-0025 { margin-top:12px; }
.u-margin-top-12px-font-size-12px-c07b { margin-top:12px;font-size:12px; }
.u-margin-top-14px-553a { margin-top:14px; }
.u-margin-top-14px-display-flex-align-items-center--b34c { margin-top:14px;display:flex;align-items:center;gap:10px; }
.u-margin-top-16px-b004 { margin-top:16px; }
.u-margin-top-48px-0f87 { margin-top:48px; }
.u-margin-top-4px-a18a { margin-top:4px; }
.u-margin-top-8px-d431 { margin-top:8px; }
.u-margin-top-8px-font-size-12px-color-94a3b8-dae9 { margin-top:8px;font-size:12px;color:#94a3b8; }
.u-margin-0-1386 { margin:0; }
.u-margin-0-0-10px-0998 { margin:0 0 10px; }
.u-margin-0-0-14px-2280 { margin:0 0 14px; }
.u-margin-0-0-8px-4c7b { margin:0 0 8px; }
.u-margin-0-display-inline-flex-gap-4px-align-items-427a { margin:0;display:inline-flex;gap:4px;align-items:center; }
.u-margin-14px-ef00 { margin:14px; }
.u-margin-6px-0-0-0f9e { margin:6px 0 0; }
.u-margin-8px-0-0-00dd { margin:8px 0 0; }
.u-max-width-100%-a293 { max-width:100%; }
.u-max-width-190px-de03 { max-width:190px; }
.u-max-width-230px-8cfe { max-width:230px; }
.u-max-width-240px-border-radius-8px-display-block--a93a { max-width:240px;border-radius:8px;display:block;margin-top:6px;cursor:zoom-in; }
.u-max-width-250px-border-radius-8px-display-block--b4d5 { max-width:250px;border-radius:8px;display:block;margin-top:6px; }
.u-max-width-250px-margin-top-6px-display-block-f9c4 { max-width:250px;margin-top:6px;display:block; }
.u-max-width-260px-c3b4 { max-width:260px; }
.u-max-width-260px-border-1px-solid-var-border-radi-1da2 { max-width:260px;border:1px solid var(--border);border-radius:var(--radius); }
.u-max-width-340px-284b { max-width:340px; }
.u-max-width-620px-a687 { max-width:620px; }
.u-min-height-130px-29ea { min-height:130px; }
.u-min-height-420px-104c { min-height:420px; }
.u-min-height-70px-89ac { min-height:70px; }
.u-min-height-80px-2780 { min-height:80px; }
.u-min-height-80px-font-family-var-font-size-12px-d4eb { min-height:80px;font-family:var(--mono);font-size:12px; }
.u-min-width-0-3f9f { min-width:0; }
.u-min-width-0-flex-1-a7af { min-width:0;flex:1; }
.u-min-width-1020px-28b0 { min-width:1020px; }
.u-min-width-130px-bd12 { min-width:130px; }
.u-min-width-150px-4387 { min-width:150px; }
.u-min-width-170px-b66c { min-width:170px; }
.u-min-width-520px-fd68 { min-width:520px; }
.u-min-width-640px-a5f1 { min-width:640px; }
.u-min-width-780px-0ade { min-width:780px; }
.u-min-width-820px-65e6 { min-width:820px; }
.u-min-width-860px-d40a { min-width:860px; }
.u-min-width-980px-d202 { min-width:980px; }
.u-padding-0-57ce { padding:0; }
.u-padding-0-10px-14px-3364 { padding:0 10px 14px; }
.u-padding-0-22px-18px-f0a3 { padding:0 22px 18px; }
.u-padding-0-gap-4px-eccf { padding:0;gap:4px; }
.u-padding-10px-0-416c { padding:10px 0; }
.u-padding-10px-12px-f5c0 { padding:10px 12px; }
.u-padding-12px-0-align-items-flex-start-5aaf { padding:12px 0;align-items:flex-start; }
.u-padding-12px-16px-margin-0-border-top-1px-solid--bf21 { padding:12px 16px;margin:0;border-top:1px solid var(--border-soft); }
.u-padding-20px-22px-0-margin-bottom-12px-c8ec { padding:20px 22px 0;margin-bottom:12px; }
.u-padding-26px-16px-eb09 { padding:26px 16px; }
.u-padding-8px-0-e1de { padding:8px 0; }
.u-stop-color-var-stop-opacity-.35-2c01 { stop-color:var(--accent);stop-opacity:.35; }
.u-stop-color-var-stop-opacity-0-748f { stop-color:var(--accent);stop-opacity:0; }
.u-stroke-var-90c5 { stroke:var(--accent); }
.u-stroke-var-5f16 { stroke:var(--border-soft); }
.u-text-align-center-1307 { text-align:center; }
.u-text-align-right-f6e3 { text-align:right; }
.u-white-space-nowrap-overflow-hidden-text-overflow-93a2 { white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
.u-white-space-nowrap-overflow-hidden-text-overflow-9c3a { white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block; }
.u-width-110px-1a30 { width:110px; }
.u-width-112px-6f36 { width:112px; }
.u-width-120px-088c { width:120px; }
.u-width-120px-height-10px-07b9 { width:120px;height:10px; }
.u-width-130px-7291 { width:130px; }
.u-width-140px-2f01 { width:140px; }
.u-width-150px-9578 { width:150px; }
.u-width-180px-1dfd { width:180px; }
.u-width-200px-height-200px-border-1px-solid-var-bo-5467 { width:200px;height:200px;border:1px solid var(--border);border-radius:var(--radius);display:block;margin:0 auto 12px; }
.u-width-30px-height-30px-a2ef { width:30px;height:30px; }
.u-width-34px-height-34px-font-size-13px-border-rad-7e1c { width:34px;height:34px;font-size:13px;border-radius:9px; }
.u-width-36px-a4f3 { width:36px; }
.u-width-38px-height-38px-font-size-14px-border-rad-8f52 { width:38px;height:38px;font-size:14px;border-radius:10px; }
.u-width-44px-90a2 { width:44px; }
.u-width-52px-height-52px-font-size-19px-border-rad-9685 { width:52px;height:52px;font-size:19px;border-radius:14px; }
.u-width-70px-f95e { width:70px; }
.u-width-auto-4f15 { width:auto; }
.u-word-break-break-all-bb1a { word-break:break-all; }

/* Campo que só aparece quando "Outro" é escolhido (origem/serviço) */
.field-extra { margin-top: 8px; }

/* O select de etapa não deve esticar no cabeçalho da conversa */
.stage-select { width: auto; }

/* Campos do cartão de serviço: precisam vencer a regra geral
   input[type="text"] { width: 100% } (senão o preço fica gigante). */
.svc-opt .svc-tipo-input { width: 96px; flex: none; }
.svc-opt .svc-preco-input { width: 104px; flex: none; text-align: right; font-variant-numeric: tabular-nums; }
.svc-opt .svc-fields { display: flex; align-items: center; gap: 8px; }

/* Total da proposta (gerador): rótulo + detalhe + valor */
.po-total { align-items: center; }
.po-total-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.po-total-label {
    font-size: 11px; font-weight: 600; letter-spacing: .08em;
    text-transform: uppercase; color: var(--accent-dark);
}
.po-total-detail { font-size: 12px; color: var(--text-soft); }

@media (max-width: 560px) {
    .po-total { flex-direction: column; align-items: flex-start; gap: 6px; }
    .po-total strong { font-size: 22px; }
}
