:root {
    color-scheme: light;
    --ink: #17231f;
    --muted: #6d7975;
    --line: #e1e8e5;
    --surface: #ffffff;
    --canvas: #f6f8f7;
    --brand: #0b5c4d;
    --brand-strong: #07483d;
    --brand-soft: #edf6f3;
    --gold: #b77d08;
    --red: #b4312e;
    --shadow: 0 10px 28px rgba(20, 48, 39, .065);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--canvas); }
body { min-height: 100vh; margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 3px solid #e2a927; outline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.7rem, 3vw, 2.7rem); letter-spacing: -.045em; line-height: 1.05; }
h2 { margin-bottom: .65rem; font-size: clamp(1.25rem, 2vw, 1.65rem); letter-spacing: -.025em; }
h3 { margin-bottom: .5rem; }
p { color: var(--muted); line-height: 1.65; }
small { color: var(--muted); }

.app-shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
    position: sticky; top: 0; z-index: 20; height: 100vh; padding: 22px 14px 16px;
    display: flex; flex-direction: column; background: #102f29; color: #fff;
}
.brand { display: flex; align-items: center; gap: 11px; margin: 0 6px 24px; text-decoration: none; font-size: 1rem; font-weight: 850; }
.brand small { display: block; margin-top: 2px; color: #a9c8bd; font-size: .72rem; font-weight: 600; }
.brand-logo { display: block; height: auto; object-fit: contain; }
.brand-logo-sidebar { width: 42px; height: 42px; flex: 0 0 auto; }
.sidebar nav { display: grid; gap: 3px; }
.sidebar nav a, .sidebar-foot a, .sidebar-foot button { min-height: 40px; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; color: #d7e6e1; text-align: left; text-decoration: none; cursor: pointer; }
.sidebar nav a:hover, .sidebar nav a:focus-visible, .sidebar nav a.active, .sidebar-foot a:hover, .sidebar-foot button:hover { background: rgba(255,255,255,.11); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,.12); font-weight: 800; box-shadow: inset 3px 0 #e2a927; }
.sidebar nav a.active-parent { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.nav-subitem { min-height: 31px; margin: -2px 0 2px 14px; padding: 6px 11px; color: rgba(255,255,255,.7); font-size: .76rem; font-weight: 500; }
.sidebar nav a.nav-subitem.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 700; box-shadow: inset 2px 0 #e2a927; }
.sidebar-foot { display: grid; gap: 4px; margin-top: auto; padding-top: 20px; border-top: 1px solid rgba(255,255,255,.12); }
.sidebar-foot form, .sidebar-foot button { width: 100%; }
.sidebar-foot .sidebar-portal-link { margin-bottom: 4px; background: #efb72f; color: #17362e; font-weight: 850; }
.sidebar-foot .sidebar-portal-link:hover { background: #ffd46b; color: #102a24; }
.sidebar-backdrop { display: none; }

.workspace { min-width: 0; }
.topbar { min-height: 86px; padding: 18px clamp(20px, 3vw, 34px); display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); }
.topbar .eyebrow { margin-bottom: 5px; }
.user-chip { margin-left: auto; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; text-align: right; }
.user-chip span { display: block; font-weight: 800; }
.user-chip small { display: block; margin-top: 2px; }
.menu-button { display: none; border: 0; background: transparent; font-size: 1.65rem; cursor: pointer; }
.topbar-title { min-width: 0; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: clamp(18px, 3vw, 34px); }

.eyebrow { margin-bottom: 8px; color: var(--brand); font-size: .72rem; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.card, .hero-card, .metric, .column { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 4px 16px rgba(22, 55, 44, .035); }
.card { padding: clamp(18px, 2.5vw, 26px); }
.card.compact { padding: 18px 22px; }
.card.narrow { max-width: 720px; margin: 0 auto; }
.hero-card { padding: clamp(24px, 3.5vw, 40px); background: linear-gradient(135deg, #fff, #f2f8f6); }
.hero-card h2 { max-width: 850px; font-size: clamp(1.8rem, 4vw, 3.5rem); line-height: 1.03; }
.hero-card p { max-width: 880px; font-size: 1.05rem; }
.grid { display: grid; gap: 20px; margin-bottom: 20px; }
.grid.two, .grid.form-list { grid-template-columns: minmax(300px, .8fr) minmax(430px, 1.2fr); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 20px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.metric { padding: 19px; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.metric:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric.static { cursor: default; }
.metric.static:hover { transform: none; box-shadow: 0 8px 28px rgba(22, 55, 44, .05); }
.metric span { display: block; color: var(--brand); font-size: clamp(1.8rem, 4vw, 2.65rem); font-weight: 900; letter-spacing: -.05em; }
.metric small { font-weight: 700; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid label { display: grid; align-content: start; gap: 7px; color: var(--ink); font-size: .9rem; font-weight: 750; }
.form-grid label.wide, .form-grid .wide, .form-grid .help, .form-grid button.full { grid-column: 1 / -1; }
input, select, textarea { width: 100%; min-height: 43px; padding: 9px 11px; border: 1px solid #d4ddda; border-radius: 9px; outline: none; background: #fff; color: var(--ink); }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(11,92,77,.11); }
.button { min-height: 42px; padding: 9px 15px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #cbd5d1; border-radius: 9px; background: #fff; color: var(--ink); font-weight: 800; text-decoration: none; cursor: pointer; }
.button:hover { border-color: var(--brand); }
.button.primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.button.primary:hover { background: var(--brand-strong); }
.button.danger { border-color: #b94d43; background: #b94d43; color: #fff; }
.button.danger:hover { border-color: #963a32; background: #963a32; }
.button:disabled { cursor: not-allowed; opacity: .5; }
.button.small { min-height: 36px; padding: 7px 11px; font-size: .82rem; }
.button.full { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px; }
.confirm-import { min-width: min(100%, 460px); display: grid; gap: 10px; }
.confirm-check { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.confirm-check input { width: 18px; min-height: 18px; margin-top: 2px; flex: 0 0 auto; }
.inline, .search { display: flex; align-items: flex-end; gap: 8px; }
.inline label { min-width: 230px; }
.search { margin-bottom: 18px; }
.search input { max-width: 420px; }
.search button { min-height: 45px; padding: 9px 15px; border: 0; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 800; }
.top-space { margin-top: 18px; }
details summary { cursor: pointer; font-weight: 850; }

.rows { display: grid; gap: 1px; margin-top: 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--line); }
.row { min-height: 68px; padding: 13px 15px; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: #fff; }
.row strong, .row small { display: block; }
.row small { margin-top: 4px; }
.row .right { display: flex; align-items: flex-end; gap: 8px; text-align: right; }
.row.is-done { opacity: .64; }
.row.is-mine { position: relative; z-index: 1; background: #edf9f4; box-shadow: inset 4px 0 0 #178765; }
.row.is-overdue { background: #fff4c7; box-shadow: inset 4px 0 0 #d89b14; }
.mine-badge { border-color: #b9dfd1; background: #dff3eb; color: #0c6c50; }
.overdue-badge { border-color: #efd17c; background: #ffe79a; color: #795000; }
.pill { display: inline-flex; padding: 5px 8px; border: 1px solid #dce7e3; border-radius: 999px; background: #f4f7f6; color: #49615a; font-size: .74rem; font-weight: 800; }
.priority-high { background: #fde7e5; color: var(--red); }
.priority-low { background: #edf1f0; color: #53625d; }
.empty { padding: 25px; border: 1px dashed #c6d5cf; border-radius: 12px; background: #f7faf9; text-align: center; }
.small-empty { padding: 12px; }
.text-link { display: inline-block; margin-top: 16px; color: var(--brand); font-weight: 800; }

.stage-summary { display: grid; gap: 17px; margin-top: 22px; }
.stage-summary-row { display: grid; gap: 8px; }
.stage-summary-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; }
.stage-summary-heading strong, .stage-summary-heading small { display: block; }
.stage-summary-heading small { margin-top: 3px; }
.stage-summary-heading .right { display: flex; align-items: center; gap: 9px; text-align: right; }
.stage-summary-track { height: 12px; overflow: hidden; border-radius: 999px; background: #e5efeb; }
.stage-summary-track span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #28a483); }

.pipeline-guide { margin: 12px 0 14px; padding: 11px 14px; display: flex; align-items: baseline; gap: 10px; border: 1px solid #cfe2da; border-radius: 12px; background: #edf7f3; color: var(--muted); font-size: .84rem; line-height: 1.5; }
.pipeline-guide strong { flex: 0 0 auto; color: var(--brand-strong); }
.kanban { display: grid; grid-auto-columns: minmax(260px, 320px); grid-auto-flow: column; gap: 12px; padding: 4px 0 18px; overflow-x: auto; scrollbar-gutter: stable; scroll-snap-type: x proximity; }
.kanban::-webkit-scrollbar { height: 12px; }
.kanban::-webkit-scrollbar-track { border-radius: 999px; background: #dfe9e5; }
.kanban::-webkit-scrollbar-thumb { border: 3px solid #dfe9e5; border-radius: 999px; background: #6f9488; }
.column { min-height: 300px; padding: 10px; scroll-snap-align: start; background: #f1f4f3; box-shadow: none; }
.column-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 5px 12px; }
.column-head span { min-width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: .74rem; font-weight: 850; }
.deal-card { margin-bottom: 9px; padding: 13px; border: 1px solid #dde5e2; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(20,48,39,.035); }
.deal-card > strong, .deal-card > small, .deal-card > span { display: block; }
.deal-card > small { margin: 5px 0 12px; }
.deal-card > span { margin-bottom: 12px; color: var(--brand); font-weight: 900; }
.deal-card.mirrored { border-color: #c8dcd5; border-left: 3px solid #6fae99; background: #fff; }
.deal-card > span.source-badge { width: fit-content; margin: 0 0 9px; padding: 4px 7px; display: inline-flex; border: 1px solid #d9e8e3; border-radius: 999px; background: #f2f7f5; color: #47695f; font-size: .69rem; font-weight: 850; }
.deal-card form { display: grid; gap: 8px; }
.deal-card label span { display: block; margin-bottom: 5px; font-size: .78rem; font-weight: 750; }
.deal-link { display: block; color: var(--ink); font-weight: 900; line-height: 1.3; text-decoration: none; }
.deal-link:hover, .deal-link:focus-visible { color: var(--brand); text-decoration: underline; }
.move-panel { margin-top: 4px; border: 0; padding: 0; text-align: center; }
.move-panel summary { display: inline; min-height: 0; padding: 0; border: 0; list-style: none; background: transparent; color: #0b6b57; cursor: pointer; font-size: .72rem; font-weight: 400; line-height: 1.35; text-align: center; text-decoration: none; box-shadow: none; }
.move-panel summary::-webkit-details-marker { display: none; }
.move-panel summary::marker { content: ""; }
.move-panel summary:hover { background: transparent; color: #075c4a; }
.move-panel summary:focus-visible { outline: 2px solid #4c9b85; outline-offset: 3px; border-radius: 3px; }
.move-panel form { margin-top: 10px; text-align: left; }
.move-panel textarea { min-height: 76px; }

.deal-hero { margin-bottom: 20px; padding: clamp(22px, 4vw, 38px); display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(250px, .8fr); gap: 28px; border: 1px solid var(--line); border-radius: 20px; background: linear-gradient(145deg, #fff, #edf8f4); box-shadow: var(--shadow); }
.deal-hero h2 { margin: 7px 0 12px; font-size: clamp(2rem, 4vw, 3.2rem); }
.deal-hero p { margin-bottom: 0; color: var(--muted); line-height: 1.65; }
.back-link { margin: 0 0 18px; }
.deal-meta { padding: 20px; display: flex; flex-direction: column; align-items: flex-start; gap: 9px; border-radius: 16px; background: rgba(255,255,255,.8); }
.deal-meta > strong { color: var(--brand); font-size: 1.7rem; }
.deal-meta > small { color: var(--muted); }
.deal-meta .source-badge { width: fit-content; padding: 6px 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: .74rem; font-weight: 900; }
.deal-layout { margin-bottom: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.deal-action-card { padding: 0; overflow: hidden; }
.deal-action-card details { height: 100%; }
.deal-action-card summary { min-height: 104px; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 18px; list-style-position: inside; }
.deal-action-card summary::marker { color: var(--brand); }
.deal-action-card summary > span:first-child { display: inline-grid; gap: 7px; vertical-align: middle; }
.deal-action-card summary .eyebrow { margin: 0; }
.deal-action-card summary strong { color: var(--ink); font-size: 1.22rem; line-height: 1.25; }
.deal-action-card .summary-hint { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: #eef5f2; color: var(--brand); font-size: .72rem; font-weight: 800; }
.deal-action-card details[open] summary { border-bottom: 1px solid var(--line); background: #fbfdfc; }
.deal-action-card details[open] .summary-hint { background: #e2f1eb; }
.deal-action-form { padding: 22px 24px 24px; }

/* O funil usa toda a largura livre e so cria rolagem quando as etapas nao cabem. */
.page-pipeline .content { width: 100%; padding: clamp(14px, 1.7vw, 24px); }
.page-pipeline .kanban { grid-auto-columns: minmax(216px, 1fr); gap: 8px; }
.page-pipeline .column { padding: 8px; }
.page-pipeline .column-head { position: sticky; top: 0; z-index: 2; min-height: 48px; gap: 8px; align-items: flex-start; padding: 5px 3px 10px; background: #f1f4f3; font-size: .87rem; }
.page-pipeline .column-head strong { line-height: 1.25; }
.page-pipeline .deal-card { padding: 10px; }
.page-pipeline .deal-card > small { margin-bottom: 9px; }
.page-pipeline .deal-card > span { margin-bottom: 9px; }

.timeline { display: grid; gap: 18px; }
.timeline article { display: grid; grid-template-columns: max-content 1fr; gap: 13px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.timeline article:last-child { padding-bottom: 0; border-bottom: 0; }
.timeline p { margin: 7px 0; white-space: normal; }
.check-list { padding-left: 22px; line-height: 1.9; }
.step { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--brand); font-weight: 900; }
.big-value { margin-top: 18px; color: var(--brand); font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 950; letter-spacing: -.05em; }
.big-value.secondary { color: var(--gold); }
.notice { margin-top: 20px; border-color: #e9d49f; background: #fffaf0; }
.help, .security-note { margin-bottom: 0; color: var(--muted); font-size: .88rem; }
.flash { margin-bottom: 20px; padding: 13px 16px; border-radius: 11px; font-weight: 750; }
.flash.success { border: 1px solid #abd7c7; background: #e6f7f0; color: #075845; }
.flash.error { border: 1px solid #e9b7b4; background: #fff0ef; color: #8f2927; }

.reconciliation-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0; }
.reconciliation-summary span { padding: 13px 15px; border: 1px solid var(--line); border-radius: 12px; background: #f8faf9; color: var(--muted); }
.reconciliation-summary strong { margin-right: 5px; color: var(--ink); font-size: 1.25rem; }
.reconciliation-summary .complete { border-color: #abd7c7; background: #eaf7f2; }
.reconciliation-summary .attention { border-color: #ead49a; background: #fff8e7; }
.reconciliation-summary .review { border-color: #e9b7b4; background: #fff0ef; }
.reconciliation-list { display: grid; gap: 10px; }
.reconciliation-item { padding: 14px 15px; border: 1px solid var(--line); border-left-width: 5px; border-radius: 12px; background: #fff; }
.reconciliation-item.status-complete { border-left-color: #2a8b70; }
.reconciliation-item.status-attention { border-left-color: #c18b00; }
.reconciliation-item.status-review { border-left-color: var(--red); }
.reconciliation-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.reconciliation-title strong, .reconciliation-title small { display: block; }
.reconciliation-title small { margin-top: 4px; }
.reconciliation-item p { margin: 10px 0; color: var(--muted); font-size: .86rem; }
.reconciliation-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .76rem; font-weight: 700; }

.login-page { padding: 24px; display: grid; place-items: center; background: radial-gradient(circle at 14% 14%, #e8f2ef 0, transparent 35%), #f3f6f5; }
.login-shell { width: min(1000px, 100%); display: grid; grid-template-columns: 1.15fr .85fr; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 18px 55px rgba(13, 52, 42, .11); }
.login-brand { min-height: 550px; padding: clamp(35px, 6vw, 70px); display: flex; flex-direction: column; justify-content: center; background: linear-gradient(145deg, #0e332b, #0b6c59); color: #fff; }
.brand-logo-login { width: min(310px, 82%); margin-bottom: 32px; }
.login-brand .eyebrow, .login-brand p { color: #d5e8e1; }
.login-brand h1 { font-size: clamp(3rem, 8vw, 5.2rem); }
.environment { width: fit-content; margin-top: 28px; padding: 9px 12px; border: 1px solid rgba(255,255,255,.2); border-radius: 999px; color: #e6f3ef; font-size: .78rem; font-weight: 750; }
.login-card { padding: clamp(30px, 5vw, 60px); display: flex; flex-direction: column; justify-content: center; }
.login-card .form-grid { grid-template-columns: 1fr; }
.login-card .form-grid label, .login-card .form-grid .help, .login-card .form-grid button { grid-column: auto; }
.login-card .code-input { text-align: center; font-size: 1.7rem; font-weight: 850; letter-spacing: .32em; }
.login-card .login-secondary { margin-top: 12px; }
.unavailable-shell { grid-template-columns: 1.1fr .9fr; }

@media (max-width: 1050px) {
    .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.two, .grid.form-list { grid-template-columns: 1fr; }
    .grid.three { grid-template-columns: 1fr; }
    .deal-hero, .deal-layout { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .app-shell { grid-template-columns: 1fr; }
    .sidebar { position: fixed; left: 0; transform: translateX(-105%); width: min(310px, 88vw); transition: transform .2s ease; box-shadow: 18px 0 50px rgba(0,0,0,.2); }
    body.menu-open { overflow: hidden; }
    body.menu-open .sidebar { transform: translateX(0); }
    .sidebar-backdrop { position: fixed; inset: 0; z-index: 15; border: 0; background: rgba(4, 25, 20, .52); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
    body.menu-open .sidebar-backdrop { display: block; opacity: 1; pointer-events: auto; }
    .menu-button { display: inline-grid; place-items: center; }
    .topbar { min-height: 88px; padding: 17px 18px; }
    .topbar .user-chip { display: none; }
    .content { padding: 18px 14px 36px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid label.wide, .form-grid .wide, .form-grid .help, .form-grid button.full { grid-column: auto; }
    .row, .section-head { align-items: stretch; flex-direction: column; }
    .row .right { align-items: flex-start; text-align: left; }
    .stage-summary-heading { align-items: stretch; flex-direction: column; gap: 7px; }
    .stage-summary-heading .right { justify-content: space-between; text-align: left; }
    .inline { align-items: stretch; flex-direction: column; }
    .inline label { min-width: 0; }
    .login-page { padding: 12px; }
    .login-shell, .unavailable-shell { grid-template-columns: 1fr; }
    .login-brand { min-height: 300px; }
    .reconciliation-summary { grid-template-columns: 1fr; }
    .reconciliation-title { align-items: stretch; flex-direction: column; }
    .reconciliation-title .pill { width: fit-content; }
    .page-pipeline .content { padding: 18px 14px 36px; }
    .page-pipeline .kanban { grid-auto-columns: minmax(260px, 86vw); gap: 12px; }
    .pipeline-guide { align-items: flex-start; flex-direction: column; gap: 3px; }
}

@media (max-width: 480px) {
    .metric-grid { grid-template-columns: 1fr; }
    .card { padding: 18px 15px; }
    .login-brand, .login-card { padding: 28px 22px; }
    .topbar { gap: 12px; }
    .topbar h1 { font-size: 1.55rem; }
}

/* Refinamento visual profundo - 2026-08-09
   Camada isolada para aproximar o CRM de paineis Kanban leves sem alterar fluxos. */
:root {
    --canvas: #f4f7f9;
    --surface: #ffffff;
    --surface-soft: #f7fafb;
    --line: #dfe7eb;
    --line-strong: #cfdadf;
    --ink: #17251f;
    --muted: #6d7d76;
    --brand: #086b57;
    --brand-dark: #092f27;
    --brand-soft: #e6f4ef;
    --blue: #2f6db2;
    --blue-soft: #eaf2fb;
    --gold: #b57b00;
    --gold-soft: #fff4d5;
    --red: #c94d43;
    --red-soft: #ffefed;
    --violet: #7650b8;
    --violet-soft: #f1ebfb;
    --shadow: 0 5px 18px rgba(31, 52, 64, .055);
}

body { background: var(--canvas); }

@media (min-width: 761px) {
    .app-shell { grid-template-columns: 204px minmax(0, 1fr); }
    .sidebar { width: 204px; }
}

.sidebar { padding: 22px 14px; background: linear-gradient(180deg, #092f27 0%, #0b4035 100%); box-shadow: 5px 0 22px rgba(9, 47, 39, .08); }
.brand { gap: 10px; margin: 0 4px 24px; }
.brand-logo-sidebar { width: 38px; height: 38px; border-radius: 10px; }
.brand span { font-size: .98rem; letter-spacing: -.02em; }
.brand small { margin-top: 2px; font-size: .69rem; opacity: .67; }
.sidebar nav { gap: 3px; }
.sidebar nav a { min-height: 40px; padding: 9px 11px; border-radius: 9px; color: rgba(255,255,255,.77); font-size: .84rem; font-weight: 650; }
.sidebar nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.sidebar nav a.active { background: rgba(255,255,255,.12); box-shadow: inset 3px 0 0 #efb72f; color: #fff; }

.topbar { position: sticky; top: 0; z-index: 12; min-height: 74px; padding: 13px clamp(20px, 3vw, 38px); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); backdrop-filter: blur(10px); }
.topbar .eyebrow { margin-bottom: 3px; font-size: .66rem; }
.topbar h1 { font-size: clamp(1.65rem, 2.5vw, 2.35rem); letter-spacing: -.045em; }
.portal-switch { margin-left: auto; }
.portal-switch button { min-height: 44px; padding: 10px 15px; border: 0; border-radius: 12px; background: #0d6657; color: #fff; font: inherit; font-size: .82rem; font-weight: 850; cursor: pointer; box-shadow: 0 8px 20px rgba(13,102,87,.16); }
.portal-switch button:hover, .portal-switch button:focus-visible { background: #084f44; transform: translateY(-1px); }
.portal-switch + .user-chip { margin-left: 0; }
.user-chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; box-shadow: none; }
.user-chip strong { font-size: .85rem; }
.user-chip small { font-size: .68rem; }

.content { width: min(1580px, 100%); padding: 22px clamp(18px, 2.4vw, 34px) 42px; }
.grid { gap: 14px; }
.grid.two { gap: 16px; }
.metric-grid { gap: 12px; }
.metric, .card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.card { padding: 20px; }
.metric { position: relative; min-height: 112px; padding: 17px 18px; overflow: hidden; }
.metric::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--brand); }
.metric:nth-child(4n + 2)::before { background: #3484c6; }
.metric:nth-child(4n + 3)::before { background: #e4a62b; }
.metric:nth-child(4n + 4)::before { background: #7650b8; }
.metric small { font-size: .7rem; letter-spacing: .045em; text-transform: uppercase; }
.metric strong { margin-top: 10px; font-size: clamp(1.5rem, 3vw, 2.15rem); letter-spacing: -.045em; }
.card h2 { font-size: clamp(1.18rem, 2vw, 1.48rem); letter-spacing: -.025em; }
.card h3 { font-size: 1rem; }
.eyebrow { color: var(--brand); letter-spacing: .12em; }
.section-head { margin-bottom: 14px; }
.section-head p { margin-top: 4px; font-size: .84rem; }

input, select, textarea { min-height: 42px; padding: 9px 11px; border-color: var(--line-strong); border-radius: 9px; background: #fff; font-size: .88rem; }
textarea { min-height: 100px; }
input:focus, select:focus, textarea:focus { border-color: #5ca491; box-shadow: 0 0 0 3px rgba(8, 107, 87, .09); }
label { gap: 6px; font-size: .78rem; }
button, .button { min-height: 40px; padding: 9px 14px; border-radius: 9px; box-shadow: none; font-size: .82rem; }
button:hover, .button:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(8,107,87,.12); }
.button.secondary, button.secondary { background: #fff; }
.form-grid { gap: 12px; }
.row { padding: 13px 0; border-bottom-color: #e8edef; }
.row strong { font-size: .88rem; }
.row small { font-size: .73rem; }

.pill { min-height: 24px; padding: 4px 8px; border: 0; border-radius: 999px; background: var(--brand-soft); color: #116451; font-size: .67rem; font-weight: 800; }
.pill.warning { background: var(--gold-soft); color: #8a6200; }
.pill.danger { background: var(--red-soft); color: #a33b34; }
.pill.info { background: var(--blue-soft); color: #2d6099; }
.pill.violet { background: var(--violet-soft); color: #6542a1; }
.flash { border-radius: 9px; box-shadow: none; font-size: .85rem; }

.page-pipeline .content { width: 100%; max-width: none; padding: 18px 18px 34px; }
.page-pipeline .card:first-child { padding: 16px 18px; }
.pipeline-section-head { align-items: flex-start; }
.pipeline-header-actions { min-width: 0; display: grid; justify-items: end; gap: 9px; }
.pipeline-toolbar { flex-wrap: wrap; justify-content: flex-end; }
.pipeline-toolbar > label:nth-of-type(2) { min-width: 280px; }
.pipeline-visibility-form { justify-content: flex-end; }
.pipeline-visibility-form > label { min-width: min(310px, 100%); }
.pipeline-visibility-form .button { align-self: end; }
.pipeline-status-filters { min-height: 43px; margin: 0; padding: 3px 10px 6px; display: flex; align-items: center; gap: 10px; border: 1px solid #d4ddda; border-radius: 9px; background: #fff; }
.pipeline-status-filters legend { padding: 0 4px; color: var(--muted); font-size: .65rem; }
.pipeline-toolbar .pipeline-status-option { min-width: 0; display: inline-flex; align-items: center; gap: 5px; color: #465852; cursor: pointer; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.pipeline-status-option input { width: 16px; min-height: 16px; margin: 0; accent-color: var(--brand); }
.pipeline-actions-card { position: relative; min-height: 90px; display: flex; align-items: flex-start; gap: 20px; }
.pipeline-add-panel { min-width: 0; flex: 1; }
.pipeline-recover-note { min-width: 0; flex: 1; display: grid; gap: 5px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.pipeline-recover-note strong { color: var(--ink); font-size: .88rem; }
.pipeline-recover-note .text-link { width: fit-content; margin-top: 4px; font-size: .74rem; font-weight: 600; }
.pipeline-total-panel { position: relative; z-index: 8; width: min(440px, 100%); margin-left: auto; }
.pipeline-total-panel > summary { min-height: 52px; display: flex; align-items: center; justify-content: flex-end; gap: 15px; list-style: none; cursor: pointer; text-align: right; }
.pipeline-total-panel > summary::-webkit-details-marker { display: none; }
.pipeline-total-panel > summary::marker { content: ""; }
.pipeline-total-summary-copy { min-width: 0; display: grid; justify-items: end; gap: 2px; }
.pipeline-total-summary-copy small { color: var(--muted); font-size: .68rem; font-weight: 400; }
.pipeline-total-summary-copy strong { color: var(--ink); font-size: clamp(1.3rem, 2.3vw, 1.75rem); font-weight: 650; letter-spacing: -.035em; line-height: 1.1; }
.pipeline-total-summary-copy > span { color: var(--muted); font-size: .64rem; font-weight: 400; }
.pipeline-total-open-label { flex: 0 0 auto; padding: 6px 9px; border: 1px solid #cddbd6; border-radius: 999px; color: var(--brand); font-size: .66rem; font-weight: 700; }
.pipeline-total-panel[open] .pipeline-total-open-label { background: var(--brand-soft); }
.pipeline-total-options { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(440px, calc(100vw - 50px)); padding: 12px; border: 1px solid #cfdad7; border-radius: 11px; background: #fff; box-shadow: 0 16px 34px rgba(24, 58, 48, .16); text-align: left; }
.pipeline-total-stage-list { max-height: 290px; padding: 5px 2px; display: grid; gap: 3px; overflow-y: auto; }
.pipeline-total-option { min-width: 0; padding: 7px 8px; display: flex; align-items: flex-start; gap: 8px; border-radius: 7px; color: #465852; cursor: pointer; font-size: .72rem; font-weight: 400; line-height: 1.35; }
.pipeline-total-option:hover { background: #f1f7f4; }
.pipeline-total-option input { width: 16px; min-height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--brand); }
.pipeline-total-all { margin-bottom: 5px; border-bottom: 1px solid var(--line); border-radius: 0; color: var(--ink); font-weight: 700; }
.pipeline-total-help { margin-top: 8px; padding: 9px 8px 2px; display: block; border-top: 1px solid var(--line); color: var(--muted); font-size: .64rem; font-weight: 400; line-height: 1.45; }
.page-pipeline .kanban { grid-auto-columns: minmax(196px, 1fr); gap: 10px; padding: 0 0 12px; scroll-snap-type: x proximity; }
.page-pipeline .column { position: relative; padding: 10px; border: 1px solid #dfe7ea; border-radius: 11px; background: #eef3f5; box-shadow: none; scroll-snap-align: start; }
.page-pipeline .column::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; border-radius: 11px 11px 0 0; background: #4f8fbe; }
.page-pipeline .column:nth-child(5n + 2)::before { background: #2a9a7a; }
.page-pipeline .column:nth-child(5n + 3)::before { background: #e3a62b; }
.page-pipeline .column:nth-child(5n + 4)::before { background: #8a64c5; }
.page-pipeline .column:nth-child(5n + 5)::before { background: #d4675f; }
.page-pipeline .column-head { min-height: 64px; padding: 3px 1px 8px; background: transparent; }
.page-pipeline .column-heading { min-width: 0; display: grid; gap: 5px; }
.page-pipeline .column-head strong { max-width: 145px; font-size: .78rem; line-height: 1.2; }
.page-pipeline .column-total { color: var(--muted); font-size: .66rem; font-weight: 400; line-height: 1.35; }
.page-pipeline .column-head span { min-width: 24px; height: 24px; border: 0; background: #fff; color: #50615a; font-size: .68rem; }
.page-pipeline .deal-card { margin-bottom: 8px; padding: 12px; border: 1px solid #d9e3e6; border-radius: 9px; background: #fff; box-shadow: 0 2px 6px rgba(38, 60, 70, .045); }
.page-pipeline .deal-card:hover { border-color: #a8c9c0; box-shadow: 0 6px 15px rgba(38, 60, 70, .08); }
.page-pipeline .deal-card.needs-task { border-color: #e1aaa6; background: #fff0ef; box-shadow: inset 3px 0 0 #c7443e; }
.page-pipeline .deal-card.needs-task:hover { border-color: #c7443e; box-shadow: inset 3px 0 0 #c7443e, 0 6px 15px rgba(132, 41, 35, .1); }
.task-alert-badge { display: inline-flex; width: fit-content; padding: 4px 7px; border: 1px solid #e3aaa6; border-radius: 999px; background: #fbdedb; color: #9b2d28; font-size: .6rem; font-weight: 850; }
.deal-quick-actions { display: grid; justify-items: center; gap: 7px; margin-top: 4px; }
.deal-schedule-link { display: inline; min-height: 0; padding: 0; border: 0; background: transparent; color: #0b6b57; font-size: .72rem; font-weight: 400; line-height: 1.35; text-align: center; text-decoration: none; box-shadow: none; }
.deal-schedule-link:hover { background: transparent; color: #075c4a; transform: none; box-shadow: none; }
.deal-schedule-link:focus-visible { outline: 2px solid #4c9b85; outline-offset: 3px; border-radius: 3px; box-shadow: none; }
.page-pipeline .deal-link { margin-bottom: 7px; font-size: .76rem; line-height: 1.28; }
.page-pipeline .deal-card > small { margin: 4px 0 8px; font-size: .66rem; line-height: 1.35; }
.page-pipeline .deal-card > small.deal-order-meta { margin: -2px 0 8px; color: #63736e; }
.page-pipeline .deal-card > small.deal-order-meta.is-overdue { color: #9a5d00; font-weight: 800; }
.page-pipeline .deal-card > span:not(.source-badge) { margin-bottom: 8px; font-size: .79rem; }
.page-pipeline .deal-card > span.source-badge { margin-bottom: 7px; font-size: .57rem; }
.page-pipeline .deal-card form { gap: 6px; }
.page-pipeline .deal-card label span { margin-bottom: 4px; font-size: .67rem; }
.page-pipeline .deal-card select,
.page-pipeline .deal-card input,
.page-pipeline .deal-card textarea { min-height: 36px; padding: 7px 9px; font-size: .72rem; }
.page-pipeline .deal-card button { min-height: 35px; padding: 7px 10px; font-size: .72rem; }
.pipeline-guide { padding: 9px 12px; border-radius: 9px; font-size: .74rem; }

#nova-tarefa { scroll-margin-top: 24px; }
.task-action-card.is-action-focus { border-color: #68ad9d; background: #f4fbf8; box-shadow: 0 0 0 3px rgba(11, 118, 95, .1), var(--shadow); }
.task-form-help { grid-column: 1 / -1; margin: 0 0 2px; padding: 10px 12px; border-radius: 9px; background: #eaf6f2; color: #3d6259; font-size: .8rem; line-height: 1.45; }

.timeline { gap: 10px; }
.timeline article { gap: 11px; padding: 12px 0; border-bottom-color: #e8edef; }
.timeline p { margin: 4px 0; font-size: .84rem; }
.step { width: 32px; height: 32px; border-radius: 9px; font-size: .78rem; }
.deal-hero, .deal-layout { gap: 14px; }
.deal-hero .card, .deal-layout .card { box-shadow: var(--shadow); }
.reconciliation-item { padding: 12px 13px; border-radius: 9px; }

.login-page { background: radial-gradient(circle at 12% 12%, #e9f3f0 0, transparent 32%), #f4f7f8; }
.login-shell { border-radius: 16px; box-shadow: 0 20px 55px rgba(20,46,39,.1); }
.login-brand { background: linear-gradient(145deg, #092f27, #0b6b58); }
.login-card h2 { letter-spacing: -.035em; }

@media (max-width: 760px) {
    .sidebar { width: min(300px, 88vw); }
    .topbar { min-height: 76px; padding: 14px 16px; }
    .portal-switch { margin-left: auto; }
    .portal-switch button { min-height: 40px; padding: 8px 11px; font-size: .74rem; }
    .content, .page-pipeline .content { padding: 16px 13px 32px; }
    .pipeline-actions-card { min-height: 0; flex-direction: column; }
    .pipeline-header-actions { width: 100%; justify-items: stretch; }
    .pipeline-toolbar, .pipeline-visibility-form { justify-content: stretch; }
    .pipeline-toolbar > label, .pipeline-toolbar > label:nth-of-type(2), .pipeline-visibility-form > label { width: 100%; min-width: 0; }
    .pipeline-status-filters { width: 100%; flex-wrap: wrap; }
    .pipeline-total-panel { width: 100%; margin-left: 0; }
    .pipeline-total-panel > summary { justify-content: space-between; text-align: left; }
    .pipeline-total-summary-copy { justify-items: start; }
    .pipeline-total-options { position: static; width: 100%; margin-top: 10px; box-shadow: none; }
    .page-pipeline .kanban { grid-auto-columns: minmax(252px, 86vw); }
}

@media (max-width: 480px) {
    .card { padding: 17px 14px; }
    .metric { min-height: 0; }
}

/* Ficha comercial e relatorios gerenciais — 2026-08-09 */
.page-deal .content, .page-reports .content { width: min(1680px, 100%); }
.deal-status-header { margin-bottom: 14px; padding: clamp(22px, 3vw, 34px); display: flex; align-items: flex-end; justify-content: space-between; gap: 28px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow); }
.deal-status-header h2 { max-width: 920px; margin: 8px 0 10px; font-size: clamp(2rem, 3.8vw, 3.45rem); letter-spacing: -.055em; line-height: 1.02; }
.deal-title-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.deal-description { max-width: 900px; margin: 0; font-size: .92rem; }
.deal-status { width: fit-content; min-height: 27px; padding: 5px 10px; display: inline-flex; align-items: center; border-radius: 999px; font-size: .7rem; font-weight: 900; letter-spacing: .035em; text-transform: uppercase; }
.deal-status.status-open { background: var(--blue-soft); color: #285f99; }
.deal-status.status-won { background: #ddf5eb; color: #087050; }
.deal-status.status-lost { background: var(--red-soft); color: #a23c34; }
.deal-code-label { padding: 5px 9px; border-radius: 7px; background: var(--surface-soft); color: var(--muted); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .72rem; font-weight: 800; }
.deal-status-value { min-width: 260px; display: grid; justify-items: end; gap: 7px; text-align: right; }
.deal-status-value small, .deal-status-value span { color: var(--muted); }
.deal-status-value strong { color: var(--brand); font-size: clamp(1.65rem, 3vw, 2.55rem); letter-spacing: -.045em; }
.deal-stage-panel { margin-bottom: 14px; }
.deal-stage-panel .section-head { align-items: flex-start; }
.deal-stage-strip { margin: 20px 0 0; padding: 0; display: grid; grid-auto-columns: minmax(130px, 1fr); grid-auto-flow: column; overflow-x: auto; list-style: none; }
.deal-stage-strip li { position: relative; min-width: 130px; padding: 0 13px 11px 0; display: grid; grid-template-columns: 27px 1fr; align-items: center; gap: 8px; color: var(--muted); font-size: .72rem; font-weight: 750; line-height: 1.25; }
.deal-stage-strip li::after { content: ""; position: absolute; left: 27px; right: 0; bottom: 0; height: 3px; background: #dce5e8; }
.deal-stage-strip li.is-complete::after, .deal-stage-strip li.is-current::after { background: #55a58f; }
.deal-stage-strip li.is-current { color: var(--ink); }
.stage-number { width: 27px; height: 27px; display: grid; place-items: center; border: 2px solid #d4dfe2; border-radius: 999px; background: #fff; color: #70807a; font-size: .68rem; font-weight: 900; }
.is-complete .stage-number { border-color: #77b8a6; background: #e8f5f1; color: #0a6a55; }
.is-current .stage-number { border-color: var(--brand); background: var(--brand); color: #fff; box-shadow: 0 0 0 4px rgba(8, 107, 87, .1); }
.deal-stage-note { margin: 13px 0 0; font-size: .78rem; }
.deal-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, 330px); align-items: start; gap: 14px; }
.deal-main, .deal-side { min-width: 0; display: grid; gap: 14px; }
.deal-side { position: sticky; top: 88px; }
.deal-quick-panel .section-head { align-items: flex-start; }
.deal-mini-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.deal-mini-stats span { padding: 7px 9px; border-radius: 8px; background: var(--surface-soft); color: var(--muted); font-size: .72rem; }
.deal-mini-stats strong { color: var(--ink); }
.deal-primary-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.deal-priority-note { margin: 14px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--gold-soft); color: #785500; font-size: .8rem; }
#nova-atividade, #nova-tarefa, #situacao-negocio { scroll-margin-top: 96px; }
.deal-action-card.is-action-focus { border-color: #68ad9d; background: #f4fbf8; box-shadow: 0 0 0 3px rgba(11, 118, 95, .1), var(--shadow); }
.lifecycle-shortcut { color: #8e3b34; }
.deal-lifecycle-card { padding: 0; overflow: hidden; border-left: 4px solid #b94d43; }
.deal-lifecycle-card.is-reopening { border-left-color: var(--brand); }
.deal-lifecycle-card details > summary { min-height: 82px; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 18px; list-style-position: inside; }
.deal-lifecycle-card details > summary::marker { color: #b94d43; }
.deal-lifecycle-card.is-reopening details > summary::marker { color: var(--brand); }
.deal-lifecycle-card details > summary > span:first-child { display: inline-grid; gap: 5px; vertical-align: middle; }
.deal-lifecycle-card details > summary .eyebrow { margin: 0; }
.deal-lifecycle-card details > summary strong { color: var(--ink); font-size: 1.08rem; }
.deal-lifecycle-card .summary-hint { flex: 0 0 auto; padding: 7px 10px; border-radius: 999px; background: var(--red-soft); color: #963a32; font-size: .72rem; font-weight: 800; }
.deal-lifecycle-card.is-reopening .summary-hint { background: var(--brand-soft); color: var(--brand); }
.deal-lifecycle-card details[open] > summary { border-bottom: 1px solid var(--line); background: #fffafa; }
.deal-lifecycle-card.is-reopening details[open] > summary { background: #f4fbf8; }
.deal-lifecycle-card.is-action-focus { box-shadow: 0 0 0 3px rgba(185, 77, 67, .1), var(--shadow); }
.deal-lifecycle-card.is-reopening.is-action-focus { box-shadow: 0 0 0 3px rgba(11, 118, 95, .1), var(--shadow); }
.lifecycle-warning { margin: 0; padding: 18px 20px; background: #fff8e7; color: #785500; line-height: 1.5; }
.deal-history-card .section-head, .deal-task-card .section-head { align-items: flex-start; }
.deal-timeline { margin-top: 18px; display: grid; }
.deal-timeline article { position: relative; min-width: 0; padding: 0 0 19px 31px; display: block; }
.deal-timeline article::before { content: ""; position: absolute; left: 7px; top: 13px; bottom: -5px; width: 2px; background: #e1e8e7; }
.deal-timeline article:last-child::before { display: none; }
.timeline-marker { position: absolute; z-index: 1; left: 0; top: 5px; width: 16px; height: 16px; border: 3px solid #fff; border-radius: 999px; background: #5b9bc8; box-shadow: 0 0 0 2px #cfe0ed; }
.deal-timeline article.is-task .timeline-marker { background: #d29a26; box-shadow: 0 0 0 2px #f3dfae; }
.deal-timeline article.status-completed .timeline-marker { background: #249270; box-shadow: 0 0 0 2px #bae0d4; }
.deal-timeline article.status-overdue .timeline-marker { background: #c34d43; box-shadow: 0 0 0 2px #efc2bd; }
.timeline-entry { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.timeline-entry-head { margin-bottom: 9px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.timeline-entry > strong { display: block; font-size: .9rem; }
.timeline-entry p { margin: 7px 0; font-size: .82rem; line-height: 1.55; }
.deal-side-card { padding: 18px; }
.deal-side-card h2 { font-size: 1.15rem; }
.deal-data-list { margin: 15px 0 0; display: grid; gap: 0; }
.deal-data-list > div { padding: 10px 0; display: grid; gap: 5px; border-bottom: 1px solid #e9eef0; }
.deal-data-list > div:last-child { border-bottom: 0; }
.deal-data-list dt { color: var(--muted); font-size: .68rem; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.deal-data-list dd { margin: 0; color: var(--ink); font-size: .82rem; font-weight: 720; overflow-wrap: anywhere; }
.copy-field { margin-top: 14px; display: grid; gap: 6px; }
.copy-field > span:first-child { color: var(--muted); font-size: .7rem; font-weight: 800; }
.copy-field > span:last-child { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.copy-field code { min-width: 0; padding: 9px 10px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); color: var(--ink); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.channel-status { margin: 14px 0 0; padding: 10px 11px; border-radius: 8px; background: #fff8e7; color: #775b19; font-size: .74rem; line-height: 1.5; }
.channel-status strong { display: block; color: #614b17; }

.reports-intro { margin-bottom: 14px; padding: 4px 2px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.reports-intro h2 { margin-bottom: 7px; font-size: clamp(1.65rem, 3vw, 2.45rem); }
.reports-intro p { max-width: 820px; margin-bottom: 0; }
.reports-period { padding: 8px 11px; border-radius: 999px; background: var(--blue-soft); color: #2d6099; font-size: .72rem; font-weight: 850; }
.report-metric-grid { margin-bottom: 14px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.report-metric { position: relative; min-height: 160px; padding: 18px; display: grid; align-content: start; gap: 7px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.report-metric::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--brand); }
.report-metric:nth-child(3n + 2)::before { background: #3b82bd; }
.report-metric:nth-child(3n + 3)::before { background: #d69a26; }
.report-metric > small { color: var(--muted); font-size: .68rem; font-weight: 850; letter-spacing: .045em; text-transform: uppercase; }
.report-metric > strong { margin-top: 4px; color: var(--ink); font-size: clamp(1.35rem, 2.8vw, 2.1rem); letter-spacing: -.045em; }
.report-metric > span { color: var(--muted); font-size: .78rem; }
.report-metric > em { width: fit-content; margin-top: auto; padding: 5px 7px; border-radius: 7px; font-size: .68rem; font-style: normal; font-weight: 800; }
.comparison-up { background: #e7f5ef; color: #0d6b51; }
.comparison-down { background: var(--red-soft); color: #9e3c35; }
.comparison-neutral { background: var(--surface-soft); color: var(--muted); }
.reports-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, .85fr); gap: 14px; }
.report-chart-card { min-width: 0; }
.report-chart-card .text-link { margin-top: 0; }
.report-stage-chart, .report-month-chart { margin-top: 18px; display: grid; gap: 14px; }
.report-stage-row { display: grid; gap: 7px; }
.report-stage-label { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.report-stage-label > span:last-child { text-align: right; }
.report-stage-label strong, .report-stage-label small { display: block; }
.report-stage-label strong { font-size: .82rem; }
.report-stage-label small { margin-top: 3px; font-size: .68rem; }
.report-bar-track { height: 10px; overflow: hidden; border-radius: 999px; background: #e7edef; }
.report-bar-track > span { height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, #2e806b, #62ae9a); }
.bar-size-0 { width: 0; }
.bar-size-5 { width: 5%; }
.bar-size-10 { width: 10%; }
.bar-size-15 { width: 15%; }
.bar-size-20 { width: 20%; }
.bar-size-25 { width: 25%; }
.bar-size-30 { width: 30%; }
.bar-size-35 { width: 35%; }
.bar-size-40 { width: 40%; }
.bar-size-45 { width: 45%; }
.bar-size-50 { width: 50%; }
.bar-size-55 { width: 55%; }
.bar-size-60 { width: 60%; }
.bar-size-65 { width: 65%; }
.bar-size-70 { width: 70%; }
.bar-size-75 { width: 75%; }
.bar-size-80 { width: 80%; }
.bar-size-85 { width: 85%; }
.bar-size-90 { width: 90%; }
.bar-size-95 { width: 95%; }
.bar-size-100 { width: 100%; }
.report-legend { display: flex; gap: 12px; color: var(--muted); font-size: .7rem; font-weight: 800; }
.report-legend span::before { content: ""; width: 8px; height: 8px; margin-right: 5px; display: inline-block; border-radius: 999px; }
.report-legend .is-won::before, .report-month-bars .is-won { background: #2b9b77; }
.report-legend .is-lost::before, .report-month-bars .is-lost { background: #cf5c53; }
.report-month-row { display: grid; grid-template-columns: 48px minmax(90px, 1fr) minmax(116px, auto); align-items: center; gap: 10px; }
.report-month-row > strong { font-size: .74rem; }
.report-month-row > div:last-child { display: flex; justify-content: flex-end; gap: 7px; color: var(--muted); font-size: .65rem; }
.report-month-row > div:last-child small { min-width: 76px; text-align: right; }
.report-month-bars { height: 13px; display: flex; overflow: hidden; border-radius: 999px; background: #e7edef; }
.report-month-bars span { height: 100%; display: block; }

.backup-intro { margin-bottom: 16px; padding: clamp(22px, 3vw, 32px); display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, .6fr); align-items: center; gap: 28px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, #fff 0%, #edf7f3 100%); box-shadow: var(--shadow); }
.backup-intro h2 { margin: 5px 0 9px; font-size: clamp(1.7rem, 3vw, 2.6rem); letter-spacing: -.045em; }
.backup-intro > div:first-child > p:last-child { max-width: 760px; margin: 0; color: var(--muted); line-height: 1.6; }
.backup-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.backup-summary span { min-width: 0; padding: 13px 10px; display: grid; gap: 3px; border: 1px solid #cfe2da; border-radius: 10px; background: rgba(255,255,255,.86); color: var(--muted); font-size: .68rem; text-align: center; text-transform: uppercase; }
.backup-summary strong { color: var(--brand); font-size: 1.35rem; letter-spacing: -.035em; }
.backup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.backup-card { min-height: 470px; display: flex; flex-direction: column; }
.backup-card > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.backup-icon { width: 48px; height: 48px; margin-bottom: 17px; display: grid; place-items: center; border-radius: 13px; background: #dff2e9; color: #087050; font-size: 1.08rem; font-weight: 950; letter-spacing: -.05em; }
.backup-icon.restore { background: var(--blue-soft); color: var(--blue); font-size: .82rem; letter-spacing: 0; }
.backup-details { margin: 5px 0 22px; padding-left: 21px; display: grid; gap: 9px; color: var(--muted); font-size: .86rem; line-height: 1.45; }
.backup-details li::marker { color: var(--brand); }
.backup-form { margin-top: auto; padding-top: 17px; display: grid; gap: 14px; border-top: 1px solid var(--line); }
.backup-form .confirm-check { min-height: 46px; }
.backup-card.restore .button.secondary { border-color: #b7cbd7; color: #285f99; }
.backup-warning { margin-top: 16px; border-color: #ead49a; background: #fffaf0; }
.backup-warning > p { margin: 5px 0 0; color: var(--muted); line-height: 1.55; }

/* Painel de controle dos funis — preparado e bloqueado durante o Agendor */
.page-settings .content { width: min(1680px, 100%); }
.control-hero { margin-bottom: 14px; padding: clamp(24px, 3vw, 36px); display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; border: 1px solid #c9ded7; border-radius: 14px; background: linear-gradient(135deg, #083d32 0%, #0b745d 100%); color: #fff; box-shadow: var(--shadow); }
.control-hero.is-locked { border-color: #e0c986; background: linear-gradient(135deg, #3e3210 0%, #80631a 100%); }
.control-hero .eyebrow { color: #bfe2d8; }
.control-hero.is-locked .eyebrow { color: #f2dea4; }
.control-hero h2 { margin: 6px 0 9px; color: #fff; font-size: clamp(1.8rem, 3.5vw, 3rem); letter-spacing: -.05em; }
.control-hero p:last-child { max-width: 850px; margin: 0; color: rgba(255,255,255,.8); line-height: 1.6; }
.control-state { flex: 0 0 auto; padding: 9px 13px; border: 1px solid rgba(255,255,255,.32); border-radius: 999px; background: rgba(255,255,255,.13); font-size: .72rem; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; }
.control-lock { margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-color: #ead49a; background: #fffaf0; }
.control-lock p { max-width: 1050px; margin: 5px 0 0; color: var(--muted); line-height: 1.55; }
.control-selector { margin-bottom: 14px; }
.control-selector > div { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.control-selector h2 { margin: 3px 0 0; }
.control-selector form { min-width: min(500px, 100%); align-items: flex-end; }
.control-selector form label { flex: 1 1 300px; }
.control-metrics { margin-bottom: 14px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.control-metrics span { min-width: 0; padding: 15px 17px; display: flex; align-items: baseline; gap: 7px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--muted); font-size: .75rem; box-shadow: var(--shadow); }
.control-metrics strong { color: var(--ink); font-size: 1.4rem; letter-spacing: -.035em; }
.control-metrics .attention { border-color: #e7ce87; background: #fff9e8; color: #7c5a0d; }
.control-metrics .attention strong { color: #8a6200; }
.control-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(370px, .65fr); align-items: start; gap: 14px; }
.control-stage-card { min-width: 0; }
.control-stage-list { display: grid; gap: 8px; }
.control-stage { min-width: 0; padding: 12px 14px; display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-left: 4px solid #9bada7; border-radius: 10px; background: #fff; }
.control-stage.is-agendor { border-left-color: #4b91c6; }
.control-stage.is-duplicate { border-color: #dfbf65; border-left-color: #d29a26; background: #fffaf0; }
.control-stage-number { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 999px; background: var(--surface-soft); color: var(--muted); font-size: .68rem; font-weight: 900; }
.control-stage > div:nth-child(2) { min-width: 0; }
.control-stage > div:nth-child(2) > strong { display: block; overflow-wrap: anywhere; font-size: .86rem; }
.control-stage > div:nth-child(2) > small { display: block; margin-top: 3px; font-size: .66rem; }
.control-stage-tags { margin-top: 7px; display: flex; flex-wrap: wrap; gap: 5px; }
.control-stage-count { min-width: 62px; text-align: right; }
.control-stage-count strong, .control-stage-count small { display: block; }
.control-stage-count strong { font-size: 1.15rem; }
.control-stage-count small { font-size: .62rem; }
.control-actions { min-width: 0; display: grid; gap: 14px; }
.control-action-card { min-width: 0; }
.control-action-card > h2 { margin: 4px 0 6px; font-size: 1.22rem; }
.control-action-card > p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.control-action-card.merge { border-color: #dfc888; }
.control-form { margin-top: 15px; }
.control-form fieldset { min-width: 0; margin: 0; padding: 15px 0 0; display: grid; gap: 11px; border: 0; border-top: 1px solid var(--line); }
.control-form fieldset[disabled] { opacity: .58; }
.control-form fieldset[disabled] button { cursor: not-allowed; transform: none; box-shadow: none; }
.control-next-step { margin-top: 14px; border-color: #d4e1dd; background: #f5faf8; }
.control-next-step p { margin: 5px 0 0; color: var(--muted); line-height: 1.55; }

@media (max-width: 1180px) {
    .deal-workspace, .reports-grid, .backup-intro, .control-layout { grid-template-columns: 1fr; }
    .deal-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .control-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
    .deal-status-header, .reports-intro, .control-hero, .control-lock, .control-selector > div { align-items: stretch; flex-direction: column; }
    .deal-status-value { min-width: 0; justify-items: start; text-align: left; }
    .deal-side, .report-metric-grid, .backup-grid, .control-actions { grid-template-columns: 1fr; }
    .backup-card { min-height: 0; }
    .deal-layout { grid-template-columns: 1fr; }
    .control-selector form { min-width: 0; }
    .control-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
    .deal-status-header { padding: 19px 15px; }
    .deal-status-header h2 { font-size: 2rem; }
    .deal-stage-panel, .deal-quick-panel, .deal-history-card, .deal-task-card { padding: 16px 14px; }
    .deal-lifecycle-card details > summary { padding: 16px 14px; }
    .deal-primary-actions .button { width: 100%; }
    .deal-mini-stats { width: 100%; }
    .deal-mini-stats span { flex: 1 1 auto; }
    .timeline-entry-head, .report-stage-label { align-items: flex-start; flex-direction: column; }
    .report-stage-label > span:last-child { text-align: left; }
    .report-month-row { grid-template-columns: 40px minmax(72px, 1fr); }
    .report-month-row > div:last-child { grid-column: 1 / -1; justify-content: flex-start; }
    .backup-summary { grid-template-columns: 1fr; }
    .backup-summary span { grid-template-columns: auto 1fr; align-items: baseline; text-align: left; }
    .control-metrics { grid-template-columns: 1fr; }
    .control-stage { grid-template-columns: 30px minmax(0, 1fr); }
    .control-stage-count { grid-column: 2; display: flex; align-items: baseline; gap: 5px; text-align: left; }
}

.conversation-launcher { position: fixed; right: 22px; bottom: 22px; z-index: 65; display: flex; align-items: center; gap: 9px; min-height: 48px; padding: 10px 16px; border: 0; border-radius: 999px; background: #073f35; color: #fff; font: inherit; font-weight: 800; box-shadow: 0 12px 30px rgba(7,63,53,.28); cursor: pointer; }
.conversation-launcher strong { display: grid; place-items: center; min-width: 23px; height: 23px; padding: 0 6px; border-radius: 999px; background: #e21b2d; color: #fff; font-size: .76rem; }
.conversation-launcher.has-unread { box-shadow: 0 0 0 6px rgba(226,27,45,.17), 0 16px 38px rgba(226,27,45,.35); }
.conversation-launcher.is-alerting { transform-origin: 50% 50%; animation: conversation-launcher-alarm .34s linear infinite; }
@keyframes conversation-launcher-alarm {
    0%, 100% { transform: translate3d(0,0,0) rotate(0deg) scale(1); }
    10% { transform: translate3d(-9px,-3px,0) rotate(-7deg) scale(1.04); }
    20% { transform: translate3d(8px,2px,0) rotate(6deg) scale(1.06); }
    30% { transform: translate3d(-7px,4px,0) rotate(-5deg) scale(1.03); }
    40% { transform: translate3d(10px,-2px,0) rotate(8deg) scale(1.07); }
    50% { transform: translate3d(-10px,1px,0) rotate(-8deg) scale(1.04); }
    60% { transform: translate3d(8px,3px,0) rotate(6deg) scale(1.06); }
    70% { transform: translate3d(-6px,-4px,0) rotate(-5deg) scale(1.03); }
    80% { transform: translate3d(9px,2px,0) rotate(7deg) scale(1.06); }
    90% { transform: translate3d(-8px,-1px,0) rotate(-6deg) scale(1.04); }
}
.conversation-inbox { position: fixed; inset: 0 0 0 auto; z-index: 70; width: min(460px, 100vw); display: flex; flex-direction: column; padding: 22px; background: #f7fbfa; border-left: 1px solid #cddeda; box-shadow: -16px 0 38px rgba(11,49,43,.2); transform: translateX(104%); transition: transform .24s ease; }
.conversation-inbox[aria-hidden="false"] { transform: translateX(0); }
.conversation-inbox > header, .conversation-thread > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.conversation-inbox > header h2 { margin: 2px 0 0; font-size: 1.8rem; }
.conversation-inbox > header button, #conversation-back { width: 42px; height: 42px; border: 1px solid #bdd3ce; border-radius: 50%; background: #fff; color: #073f35; font-size: 1.5rem; cursor: pointer; }
.conversation-help { margin: 15px 0; padding: 12px 14px; border-radius: 12px; background: #e6f2ef; color: #49645e; line-height: 1.45; }
.conversation-columns { min-height: 0; flex: 1; position: relative; display: grid; }
.conversation-list, .conversation-thread { min-height: 0; overflow: auto; }
.conversation-list.is-thread-open { display: none; }
.conversation-item { width: 100%; margin: 0 0 9px; padding: 13px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 10px; border: 1px solid #d4e2df; border-radius: 14px; background: #fff; color: #15241f; text-align: left; cursor: pointer; }
.conversation-item.unread { border-color: #0b806d; background: #edfaf6; }
.conversation-item span { display: grid; gap: 3px; min-width: 0; }
.conversation-item small { color: #657a75; }
.conversation-item b { display: grid; place-items: center; min-width: 25px; height: 25px; border-radius: 50%; background: #e21b2d; color: #fff; }
.conversation-item p { grid-column: 1 / -1; margin: 5px 0 0; color: #4d625d; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conversation-thread { display: flex; flex-direction: column; }
.conversation-thread[hidden] { display: none; }
.conversation-thread > header { justify-content: flex-start; padding-bottom: 12px; border-bottom: 1px solid #d4e2df; }
.conversation-thread > header div { display: grid; gap: 3px; }
.conversation-thread > header small { color: #667b76; }
.conversation-attention { width: 100%; margin: 10px 0 0; padding: 11px 13px; display: grid; gap: 2px; border: 1px solid #b61022; border-radius: 12px; background: #e21b2d; color: #fff; text-align: left; font: inherit; cursor: pointer; box-shadow: 0 0 0 4px rgba(226,27,45,.12); animation: conversation-attention-pulse 1.1s ease-in-out infinite; }
.conversation-attention[hidden] { display: none; }
.conversation-attention strong { font-size: .88rem; }
.conversation-attention span { color: #fff; font-size: .76rem; }
@keyframes conversation-attention-pulse { 50% { box-shadow: 0 0 0 8px rgba(226,27,45,.22); } }
.conversation-messages { min-height: 0; flex: 1; overflow: auto; padding: 14px 2px; }
.conversation-delete-panel { display: grid; gap: 8px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid #efc5ca; border-radius: 12px; background: #fff7f8; color: #75202a; font-size: .82rem; }
.conversation-delete-panel:empty { display: none; }
.conversation-delete-panel.is-information { border-color: #cddfdb; background: #f4f9f8; color: #49645f; }
.conversation-delete-panel p, .conversation-delete-panel small { margin: 0; }
.conversation-delete-panel div { display: flex; flex-wrap: wrap; gap: 8px; }
.conversation-delete-panel button { min-height: 36px; padding: 7px 11px; border: 1px solid #a51424; border-radius: 9px; background: #fff; color: #a51424; font: inherit; font-weight: 800; cursor: pointer; }
.conversation-delete-panel .conversation-delete-approve { background: #a51424; color: #fff; }
.conversation-delete-panel .conversation-delete-reject { border-color: #687b77; color: #41534f; }
.conversation-item em { display: inline-flex; margin-top: 7px; padding: 3px 7px; border-radius: 999px; background: #fff0d5; color: #805600; font-size: .72rem; font-style: normal; font-weight: 800; }
.conversation-message { max-width: 88%; margin: 0 0 10px; padding: 11px 13px; border-radius: 14px 14px 14px 3px; background: #fff; border: 1px solid #d5e3df; }
.conversation-message.operator { margin-left: auto; border-radius: 14px 14px 3px 14px; background: #dff4ee; border-color: #b8ddd3; }
.conversation-message p { margin: 4px 0 7px; white-space: pre-wrap; }
.conversation-message small { color: #71837f; font-size: .76rem; }
#conversation-reply { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid #d4e2df; }
#conversation-reply textarea { min-height: 176px; resize: vertical; }
.conversation-visitor-details { padding: 10px 12px; border: 1px solid #bfded6; border-radius: 12px; background: #eff9f6; color: #174c42; }
.conversation-visitor-details > strong { display: block; margin-bottom: 7px; }
.conversation-visitor-details dl { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 0; }
.conversation-visitor-details dl div { min-width: 0; padding: 7px 8px; border-radius: 8px; background: rgba(255,255,255,.72); }
.conversation-visitor-details dt { color: #5d756f; font-size: .72rem; }
.conversation-visitor-details dd { margin: 2px 0 0; overflow-wrap: anywhere; font-size: .82rem; font-weight: 700; }
.conversation-inbox > footer { padding-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #667b76; font-size: .78rem; }
.conversation-sound-test { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #9fc7bd; border-radius: 999px; background: #fff; color: #075d4e; font: inherit; font-weight: 800; cursor: pointer; }
.empty-state { padding: 22px; color: #667b76; text-align: center; }
.empty-state.error { color: #a61727; }
@media (min-width: 900px) { body.conversation-inbox-open .workspace { padding-right: min(460px, 34vw); transition: padding-right .24s ease; } }
@media (max-width: 560px) { .conversation-visitor-details dl { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .conversation-launcher.is-alerting, .conversation-attention { animation: none; } }
