.dashboard-shell { min-height: 100vh; background: #f2f6f4; color: #133746; font-family: var(--font-body), sans-serif; }
.dashboard-topbar { height: 78px; padding: 0 max(24px, calc((100vw - 1440px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 30px; background: #103e49; color: white; }
.dashboard-brand img { width: 176px; height: auto; display: block; }
.dashboard-top-actions { display: flex; align-items: center; gap: 9px; }
.dashboard-top-actions > span, .dashboard-top-actions button, .dashboard-top-actions a { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; gap: 7px; border: 0; border-radius: 999px; color: white; font-size: 11px; font-weight: 800; cursor: pointer; }
.dashboard-top-actions > span { background: rgba(255,255,255,.1); color: #dff7e9; }
.dashboard-top-actions button { background: #f0f6f5; color: #143d49; }
.dashboard-top-actions .csv-button { background: #e9a85a; color: #143d49; }
.dashboard-top-actions > a:last-child { background: rgba(255,255,255,.08); color: #dbe7e9; }
.dashboard-main { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 50px 0 80px; }
.dashboard-title { margin-bottom: 29px; display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; }
.dashboard-title p { margin: 0 0 5px; color: #73848a; font-size: 12px; }
.dashboard-title h1 { margin: 0; color: #103946; font-size: clamp(40px, 5vw, 64px); line-height: 1; letter-spacing: -.06em; }
.dashboard-title div > span { display: block; margin-top: 11px; color: #667a81; font-size: 14px; }
.active-pill { padding: 9px 14px; display: flex; align-items: center; gap: 8px; background: #ecfbf1; border: 1px solid #c4e9d0; border-radius: 999px; color: #147442; font-size: 11px; font-weight: 800; white-space: nowrap; }
.active-pill i { width: 8px; height: 8px; background: #29b968; border-radius: 50%; box-shadow: 0 0 0 5px rgba(41,185,104,.12); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.metric-card { min-height: 146px; padding: 23px; position: relative; overflow: hidden; background: white; border: 1px solid #d6e1de; border-radius: 16px; }
.metric-card::after { content: ""; width: 100px; height: 100px; position: absolute; right: -27px; bottom: -50px; border: 16px solid #eef3f1; border-radius: 50%; }
.metric-card p { margin: 0 0 16px; color: #718087; font-size: 10px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.metric-card strong { display: block; color: #103946; font-family: var(--font-display), sans-serif; font-size: 39px; line-height: 1; letter-spacing: -.05em; }
.metric-card > span { display: block; margin-top: 10px; color: #667a81; font-size: 11px; }
.metric-card.featured { background: #114955; border-color: #114955; }
.metric-card.featured p, .metric-card.featured > span { color: #cae0e3; }
.metric-card.featured strong { color: #f1b45b; }
.metric-card.featured::after { border-color: rgba(255,255,255,.07); }
.dashboard-insights { margin-top: 14px; display: grid; grid-template-columns: 2.3fr .9fr; gap: 14px; }
.pulse-card, .origin-card { min-height: 334px; padding: 25px; background: white; border: 1px solid #d6e1de; border-radius: 16px; }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin: 0; font-size: 18px; letter-spacing: -.03em; }
.panel-heading p { margin: 5px 0 0; color: #718087; font-size: 11px; }
.panel-heading > span { color: #718087; font-family: var(--font-display), sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.bar-chart { height: 235px; margin-top: 20px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 16px; align-items: stretch; border-bottom: 1px solid #dce5e2; background: repeating-linear-gradient(to bottom, transparent 0, transparent 56px, #f0f4f2 57px); }
.bar-column { display: grid; grid-template-rows: 18px 1fr 25px; gap: 4px; text-align: center; }
.bar-column strong { font-size: 10px; }
.bar-column > div { display: flex; align-items: flex-end; justify-content: center; }
.bar-column i { width: min(58px, 75%); display: block; background: #efac52; border-radius: 8px 8px 2px 2px; min-height: 4px; }
.bar-column span { color: #6f8187; font-family: var(--font-display), sans-serif; font-size: 9px; font-weight: 700; }
.origin-list { margin-top: 28px; display: grid; gap: 20px; }
.origin-list p { margin: 0 0 7px; display: flex; justify-content: space-between; color: #61757c; font-size: 11px; font-weight: 800; }
.origin-list p strong { color: #153e4a; }
.origin-list > div > i { height: 7px; display: block; overflow: hidden; background: #edf2f0; border-radius: 999px; }
.origin-list b { height: 100%; display: block; background: #1b6775; border-radius: inherit; }
.origin-list b.prioritario { background: #ee4060; }
.origin-list b.em_analise { background: #efac52; }
.origin-list b.orientacao_inicial { background: #217585; }
.triage-strip { margin-top: 14px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.triage-strip article { min-height: 88px; padding: 18px; background: #eaf0ee; border: 1px solid transparent; border-radius: 13px; }
.triage-strip article.prioritario { background: #fff0f2; }
.triage-strip p { margin: 0 0 15px; color: #687a80; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.triage-strip strong { color: #103946; font-family: var(--font-display), sans-serif; font-size: 24px; }
.triage-strip .prioritario strong { color: #ee3155; }
.triage-strip .consent-pending { background: #fff8e8; border-color: #f2dfb3; }
.triage-strip .consent-pending strong { color: #986310; }
.pipeline-strip { margin-top: 10px; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.pipeline-strip article { min-height: 72px; padding: 14px; background: white; border: 1px solid #d6e1de; border-radius: 11px; }
.pipeline-strip p { margin: 0 0 10px; color: #687a80; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.pipeline-strip strong { color: #103946; font-family: var(--font-display), sans-serif; font-size: 20px; }
.pipeline-strip .qualificado { background: #f0f8fb; border-color: #cee5eb; }
.pipeline-strip .convertido { background: #edfaf2; border-color: #c5e8d1; }
.pipeline-strip .convertido strong { color: #16804a; }
.pipeline-strip .perdido { background: #faf4f4; }
.contacts-panel { margin-top: 14px; background: white; border: 1px solid #d6e1de; border-radius: 16px; overflow: hidden; }
.contacts-heading { padding: 23px 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; border-bottom: 1px solid #dce5e2; }
.contacts-heading h2 { margin: 0; font-size: 19px; }
.contacts-heading p { margin: 4px 0 0; color: #718087; font-size: 11px; }
.contacts-heading > span { padding: 8px 12px; display: inline-flex; gap: 6px; align-items: center; background: #ecfbf1; border: 1px solid #c4e9d0; border-radius: 999px; color: #157846; font-size: 10px; font-weight: 800; }
.filters { padding: 14px 20px; display: grid; grid-template-columns: 1.5fr .7fr .7fr .75fr auto; gap: 8px; background: #fbfcfb; border-bottom: 1px solid #dce5e2; }
.filters label { height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 8px; background: white; border: 1px solid #d6e1de; border-radius: 9px; color: #819096; }
.filters input { width: 100%; border: 0; outline: 0; color: #173b47; font-size: 12px; }
.filters select, .filters button { height: 42px; padding: 0 12px; background: white; border: 1px solid #d6e1de; border-radius: 9px; color: #21434e; font-size: 11px; cursor: pointer; }
.filters button { font-weight: 800; color: #6e8086; }
.contacts-table-wrap { overflow-x: auto; }
.contacts-table { width: 100%; min-width: 1280px; border-collapse: collapse; font-size: 11px; }
.contacts-table th { padding: 13px 14px; background: #f7faf8; color: #718087; font-size: 8px; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.contacts-table td { padding: 13px 14px; border-top: 1px solid #e5ebe9; color: #36545e; vertical-align: middle; }
.contacts-table td strong { display: block; color: #153e4a; font-size: 12px; }
.contacts-table td > span:not(.triage-badge) { display: block; margin-top: 3px; color: #7b8b90; font-family: var(--font-display), sans-serif; font-size: 8px; }
.contacts-table td > a { color: #00627b; font-weight: 800; }
.triage-badge { padding: 6px 8px; display: inline-flex; align-items: center; gap: 5px; background: #eef5f6; border-radius: 999px; color: #206879; font-size: 9px; font-weight: 800; white-space: nowrap; }
.triage-badge i { width: 5px; height: 5px; background: currentColor; border-radius: 50%; }
.triage-badge.prioritario { background: #ffe9ed; color: #ce2446; }
.triage-badge.em_analise { background: #fff4df; color: #936012; }
.status-form { margin: 0; }
.status-select { min-width: 132px; height: 31px; padding: 0 28px 0 9px; border: 1px solid #d1dfdc; border-radius: 8px; background: #f4f8f7; color: #31535e; font-size: 9px; font-weight: 800; cursor: pointer; }
.status-select.qualificado { background: #edf7fa; color: #17677a; }
.status-select.convertido { background: #eaf9f0; color: #137844; }
.status-select.perdido { background: #fff0f2; color: #a8374b; }
.meta-badge { padding: 6px 8px; display: inline-flex; align-items: center; border-radius: 999px; background: #fff4df; color: #8f5c0e; font-size: 9px; font-weight: 900; white-space: nowrap; }
.meta-badge.sent { background: #eaf9f0; color: #137844; }
.meta-badge.failed { background: #fff0f2; color: #b1324a; }
.meta-badge.not-authorized { background: #f0f3f3; color: #708086; }
.meta-retry-form { margin-top: 5px; }
.meta-retry-form button { padding: 0; border: 0; background: transparent; color: #17677a; font-size: 8px; font-weight: 900; text-decoration: underline; cursor: pointer; }
.meta-authorize-form { margin-top: 5px; }
.meta-authorize-form button { padding: 0; border: 0; background: transparent; color: #80550e; font-size: 8px; font-weight: 900; text-decoration: underline; cursor: pointer; }
.row-actions { display: flex; gap: 6px; }
.row-actions button, .row-actions a { min-height: 32px; padding: 0 10px; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #d6e1de; border-radius: 8px; background: white; color: #21434e; font-size: 9px; font-weight: 800; cursor: pointer; }
.row-actions a { background: #27ad62; border-color: #27ad62; color: white; }
.dashboard-state { min-height: 250px; padding: 45px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #718087; text-align: center; }
.dashboard-state h3 { margin: 5px 0 0; color: #153e4a; }
.dashboard-state p { margin: 0; }
.dashboard-state button { padding: 10px 14px; border: 0; border-radius: 8px; background: #103e49; color: white; cursor: pointer; }
.error-state { color: #b83c4f; }

.lead-modal { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; }
.modal-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(8,28,37,.55); cursor: default; }
.lead-modal article { width: min(570px, 94vw); height: 100%; padding: 34px; position: relative; z-index: 1; overflow-y: auto; background: white; box-shadow: -25px 0 70px rgba(8,28,37,.2); }
.modal-close { width: 38px; height: 38px; position: absolute; right: 24px; top: 24px; display: grid; place-items: center; border: 1px solid #d9e2e0; border-radius: 50%; background: white; cursor: pointer; }
.modal-close svg { width: 18px; }
.modal-kicker { margin: 12px 0 8px; color: #d47c58; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.lead-modal h2 { margin: 0 0 13px; font-size: 33px; letter-spacing: -.04em; }
.modal-status-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; }
.modal-status-row label { display: grid; gap: 5px; color: #7b898e; font-size: 8px; font-weight: 900; text-transform: uppercase; }
.modal-status-row .status-select { min-width: 165px; }
.lead-modal dl { margin: 27px 0; display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.lead-modal dl > div { padding: 13px; background: #f5f8f6; border-radius: 9px; }
.lead-modal dl .full { grid-column: 1 / -1; }
.lead-modal dt { margin-bottom: 5px; color: #7b898e; font-size: 9px; font-weight: 900; text-transform: uppercase; }
.lead-modal dd { margin: 0; color: #244650; font-size: 12px; line-height: 1.5; }
.modal-whatsapp { min-height: 50px; padding: 0 16px; display: flex; align-items: center; justify-content: center; gap: 8px; background: #27ad62; border-radius: 9px; color: white; font-size: 12px; font-weight: 800; }
.modal-whatsapp svg:last-child { margin-left: auto; }
.modal-meta-retry { margin: -10px 0 12px; }
.modal-meta-retry button { width: 100%; min-height: 42px; border: 1px solid #bad9df; border-radius: 9px; background: #edf7fa; color: #17677a; font-size: 11px; font-weight: 900; cursor: pointer; }
.modal-meta-authorize { margin: -10px 0 12px; }
.modal-meta-authorize button { width: 100%; min-height: 42px; border: 1px solid #e5c77f; border-radius: 9px; background: #fff8e8; color: #80550e; font-size: 11px; font-weight: 900; cursor: pointer; }

.access-denied { min-height: 100vh; padding: 30px; display: grid; place-items: center; background: #f5f8f6; }
.access-denied section { max-width: 580px; padding: 45px; background: white; border: 1px solid #d6e1de; border-radius: 16px; text-align: center; }
.access-denied img { width: 200px; }
.access-denied p { margin: 30px 0 10px; color: #d47c58; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.access-denied h1 { margin: 0 0 25px; font-size: 34px; }
.access-denied a { padding: 12px 16px; display: inline-flex; background: #103e49; border-radius: 8px; color: white; font-weight: 800; font-size: 12px; }

@media (max-width: 1050px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-insights { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
  .pipeline-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .dashboard-topbar { height: auto; padding: 14px 18px; align-items: flex-start; }
  .dashboard-top-actions > span, .dashboard-top-actions button, .dashboard-top-actions > a:last-child { display: none; }
  .dashboard-brand img { width: 145px; }
  .dashboard-main { width: min(100% - 26px, 1440px); padding-top: 34px; }
  .dashboard-title { align-items: flex-start; flex-direction: column; }
  .metric-grid, .triage-strip, .pipeline-strip { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr; }
  .bar-chart { gap: 4px; }
  .contacts-heading { align-items: flex-start; flex-direction: column; }
  .lead-modal article { padding: 26px 20px; }
  .lead-modal dl { grid-template-columns: 1fr; }
  .lead-modal dl .full { grid-column: auto; }
  .modal-status-row { align-items: flex-start; flex-direction: column; }
}

.login-card { width: min(440px, calc(100% - 32px)); padding: 38px; background: white; border: 1px solid #d6e1de; border-radius: 18px; box-shadow: 0 25px 70px rgba(16,62,73,.13); }
.login-card img { width: 190px; display: block; margin: 0 auto 30px; }
.login-card .eyebrow { text-align: center; }
.login-card h1 { margin: 0 0 10px; font-size: 34px; text-align: center; }
.login-card > p:not(.eyebrow):not(.login-error) { margin: 0 0 25px; color: #718087; font-size: 13px; line-height: 1.6; text-align: center; }
.login-card label { margin-top: 14px; display: block; color: #304a55; font-size: 12px; font-weight: 800; }
.login-card input { width: 100%; height: 46px; margin-top: 7px; padding: 0 12px; border: 1px solid #d6e1de; border-radius: 9px; outline: 0; }
.login-card input:focus { border-color: #1b6775; box-shadow: 0 0 0 3px rgba(27,103,117,.1); }
.login-card button { width: 100%; height: 48px; margin-top: 20px; border: 0; border-radius: 9px; background: #103e49; color: white; font-weight: 800; cursor: pointer; }
.login-card .login-error { margin: 0 0 16px; padding: 10px; background: #fff0f2; border-radius: 8px; color: #be2d49; font-size: 12px; text-align: center; }
.row-actions .view-button { background: white; border-color: #d6e1de; color: #21434e; }
.empty-row td { padding: 45px; color: #718087; text-align: center; }
.lead-modal .modal-backdrop { display: block; }
