:root {
    --primary: #0b2a4a;
    --primary-dark: #061a30;
    --primary-light: #eaf3ff;
    --secondary: #1f6fb2;
    --background: #f3f7fb;
    --surface: #ffffff;
    --border: #dbe5f0;
    --text-main: #142033;
    --text-muted: #64748b;
    --success: #12834c;
    --danger: #c73333;
    --warning: #c77700;
    --info: #2563eb;
    --radius: 14px;
    --shadow: 0 18px 45px rgba(15, 23, 42, .08);
    --shadow-soft: 0 10px 25px rgba(15, 23, 42, .06);
    --focus: 0 0 0 .22rem rgba(31, 111, 178, .18);
    --azul: var(--primary);
    --azul-2: var(--secondary);
    --azul-3: var(--primary-light);
    --cinza: var(--background);
    --borda: var(--border);
    --texto: var(--text-main);
    --muted: var(--text-muted);
    --verde: var(--success);
    --vermelho: var(--danger);
    --laranja: var(--warning);
    --amarelo: #b7791f;
}

* { letter-spacing: 0; }
body {
    background: var(--cinza);
    color: var(--texto);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 280px;
    background: #08203f;
    color: white;
    padding: 24px 18px;
    position: fixed;
    inset: 0 auto 0 0;
    border-right: 1px solid rgba(255,255,255,.08);
}
.brand { display: grid; gap: 4px; padding: 4px 12px 24px; margin-bottom: 8px; }
.brand strong { font-size: 34px; line-height: 1; font-weight: 900; }
.brand span { font-size: 13px; color: rgba(255,255,255,.72); }
.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.86);
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 8px;
    margin-bottom: 5px;
    font-weight: 650;
}
.sidebar nav a span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    font-size: 12px;
}
.sidebar nav a:hover { background: rgba(255,255,255,.12); color: white; }
.content { margin-left: 280px; padding: 24px; width: calc(100% - 280px); }
.topbar {
    background: rgba(255,255,255,.92);
    border: 1px solid var(--borda);
    border-radius: 8px;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 12px 30px rgba(15,23,42,.06);
}
.topbar strong { color: var(--azul); }
.topbar small { display: block; color: var(--muted); margin-top: 2px; }
.user-pill {
    background: var(--azul-3);
    color: var(--azul);
    border: 1px solid #cfe0f3;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}
.page-title { margin: 26px 0 18px; }
.page-title h2 { font-weight: 850; color: var(--azul); margin: 0; }
.page-title p { max-width: 900px; color: var(--muted); margin: 8px 0 0; }
.eyebrow {
    display: block;
    color: var(--azul-2);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.metric {
    position: relative;
    min-height: 124px;
    background: white;
    border: 1px solid var(--borda);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15,23,42,.06);
}
.metric i {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--azul-3);
    color: var(--azul);
    font-style: normal;
    font-weight: 850;
}
.metric span { display: block; color: var(--muted); font-size: 13px; font-weight: 700; }
.metric strong { display: block; color: var(--azul); font-size: 26px; margin-top: 9px; line-height: 1.15; }
.metric.compact { min-height: 92px; padding: 16px; }
.metric.compact strong { font-size: 24px; }
.metric.success strong { color: var(--verde); }
.metric.danger strong { color: var(--vermelho); }
.metric.warning strong { color: var(--laranja); }
.card {
    border: 1px solid var(--borda);
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(15,23,42,.06);
}
.card-header {
    background: white;
    border-bottom: 1px solid var(--borda);
    border-radius: 8px 8px 0 0 !important;
    font-weight: 800;
    color: var(--azul);
}
.filter-bar {
    background: white;
    border: 1px solid var(--borda);
    border-radius: 8px;
    padding: 18px;
    box-shadow: 0 12px 30px rgba(15,23,42,.06);
}
label { color: #34445c; font-size: 13px; font-weight: 750; margin-bottom: 6px; }
.form-control, .form-select {
    border-color: #cfd9e7;
    border-radius: 8px;
    min-height: 42px;
}
.form-control:focus, .form-select:focus {
    border-color: var(--azul-2);
    box-shadow: 0 0 0 .18rem rgba(18,62,109,.16);
}
.btn { border-radius: 8px; font-weight: 750; }
.btn-primary { background: var(--azul-2); border-color: var(--azul-2); }
.btn-primary:hover { background: var(--azul); border-color: var(--azul); }
.btn-success { background: var(--verde); border-color: var(--verde); }
.btn-danger { background: var(--vermelho); border-color: var(--vermelho); }
.badge-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e5edf7;
    color: var(--azul);
    font-size: 11px;
    font-weight: 850;
}
.status-fechado { background: #e6f6ee; color: var(--verde); }
.status-perdido { background: #fdeaea; color: var(--vermelho); }
.status-negociacao, .status-proposta { background: #fff3d6; color: var(--laranja); }
.status-lead { background: #edf2f7; color: #43536a; }
.status-oportunidade { background: #e8f1fb; color: var(--azul-2); }
.professional-table { min-width: 900px; }
.opportunities-table { min-width: 2200px; }
.professional-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7f9fc;
    color: #34445c;
    border-bottom: 1px solid var(--borda);
    font-size: 12px;
    text-transform: uppercase;
}
.professional-table tbody td { border-color: #edf2f7; vertical-align: middle; }
.professional-table tbody tr:hover { background: #f8fbff; }
.action-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.sheet-detect {
    height: 100%;
    padding: 14px;
    border: 1px solid var(--borda);
    border-radius: 8px;
    background: #f8fbff;
}
.sheet-detect.active {
    border-color: var(--azul-2);
    background: var(--azul-3);
}
.sheet-detect strong,
.sheet-detect span,
.sheet-detect small {
    display: block;
}
.sheet-detect strong { color: var(--azul); }
.sheet-detect span { color: #34445c; font-weight: 750; margin-top: 5px; }
.sheet-detect small { color: var(--muted); margin-top: 4px; }
.editable-preview { min-width: 2600px; }
.editable-preview th:first-child,
.editable-preview td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: inherit;
}
.preview-input { min-width: 128px; }
.preview-input[data-field="cliente_nome"],
.preview-input[data-field="produto_nome"],
.preview-input[data-field="aplicacao"] { min-width: 190px; }
.required-empty .preview-input {
    border-color: var(--vermelho);
    background: #fff5f5;
}
.row-error {
    min-width: 220px;
    color: var(--vermelho);
    font-size: 12px;
    font-weight: 750;
}
.row-removed {
    opacity: .48;
    text-decoration: line-through;
}
.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    background: #08203f;
}
.login-shell {
    width: min(980px, 96vw);
    display: grid;
    grid-template-columns: 1.1fr .9fr;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 28px 80px rgba(0,0,0,.28);
}
.login-intro {
    min-height: 520px;
    padding: 48px;
    color: white;
    background: #08203f;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-intro .eyebrow { color: #b9d4f3; }
.login-intro h1 { font-size: 82px; font-weight: 950; margin: 0; line-height: .95; }
.login-intro p { font-size: 22px; color: rgba(255,255,255,.78); margin: 12px 0 0; }
.login-card {
    width: 100%;
    padding: 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.login-card h2 { color: var(--azul); font-size: 28px; font-weight: 850; margin: 0 0 6px; }
.login-card p { color: var(--muted); margin-bottom: 28px; }
.kanban { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; }
.kanban-col { background: white; border: 1px solid var(--borda); border-radius: 8px; padding: 14px; min-height: 400px; box-shadow: 0 12px 30px rgba(15,23,42,.06); }
.kanban-col h5 { color: var(--azul); font-size: 14px; font-weight: 850; }
.kanban-card { background: #f8fafc; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.kanban-card small, .kanban-card span { display: block; color: var(--muted); }

@media (max-width: 900px) {
    .sidebar { position: static; width: 100%; padding: 16px; }
    .sidebar nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
    .sidebar nav a { margin: 0; padding: 10px; }
    .app-shell { display: block; }
    .content { margin: 0; width: 100%; padding: 14px; }
    .topbar { display: grid; gap: 12px; }
    .page-title.d-flex { align-items: flex-start !important; gap: 12px; flex-direction: column; }
    .professional-table { min-width: 780px; }
    .login-shell { grid-template-columns: 1fr; }
    .login-intro { min-height: 260px; padding: 34px; }
    .login-intro h1 { font-size: 56px; }
    .login-card { padding: 32px; }
}

/* Executive CRM layer */
body { background: #eef3f8; }
.sidebar { transition: width .22s ease, padding .22s ease; box-shadow: 8px 0 28px rgba(8,32,63,.13); }
.sidebar-toggle {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 8px;
    background: rgba(255,255,255,.1);
    color: #fff;
    font-weight: 900;
    margin: 0 0 16px 10px;
}
.sidebar-collapsed .sidebar { width: 86px; padding-inline: 14px; }
.sidebar-collapsed .content { margin-left: 86px; width: calc(100% - 86px); }
.sidebar-collapsed .brand span,
.sidebar-collapsed .sidebar nav a em { display: none; }
.sidebar-collapsed .brand strong { font-size: 24px; }
.sidebar-collapsed .sidebar nav a { justify-content: center; padding: 10px; }
.sidebar-collapsed .sidebar nav a span { margin: 0; }
.content { transition: margin-left .22s ease, width .22s ease; }
.topbar { border: 0; box-shadow: 0 16px 45px rgba(15,23,42,.08); }
.executive-head {
    margin: 28px 0 18px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: stretch;
}
.executive-head h2 { margin: 0; color: #071d36; font-size: 32px; font-weight: 900; }
.executive-head p { color: var(--muted); margin: 6px 0 0; }
.compact-head { align-items: center; }
.executive-summary {
    min-width: 260px;
    background: #071d36;
    color: #fff;
    border-radius: 8px;
    padding: 18px 20px;
    box-shadow: 0 18px 42px rgba(7,29,54,.20);
}
.executive-summary span { display: block; color: rgba(255,255,255,.68); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.executive-summary strong { display: block; font-size: 25px; margin-top: 6px; }
.executive-filter-bar,
.panel,
.side-filters,
.opportunity-list-panel,
.quick-detail-panel {
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(203,213,225,.88);
    border-radius: 8px;
    box-shadow: 0 16px 45px rgba(15,23,42,.07);
}
.executive-filter-bar { padding: 18px; }
.filter-title,
.panel-head,
.table-toolbar,
.side-filter-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}
.filter-title strong,
.table-toolbar strong { color: #071d36; font-size: 16px; font-weight: 900; }
.filter-title span,
.table-toolbar span,
.panel-head span { display: block; color: var(--muted); font-size: 12px; }
.filter-actions { display: flex; gap: 8px; }
.executive-filter-grid {
    margin-top: 14px;
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    gap: 12px;
}
.executive-filter-grid label,
.side-filters label { display: grid; gap: 6px; margin: 0; }
.executive-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.metric.executive { min-height: 132px; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease; }
.metric.executive:hover,
.panel:hover,
.opportunity-list-panel:hover { transform: translateY(-2px); box-shadow: 0 22px 55px rgba(15,23,42,.10); }
.metric.executive small { display: block; color: var(--muted); margin-top: 8px; font-weight: 700; }
.metric.executive.hot strong { color: #0f766e; }
.fit-text { font-size: 20px !important; overflow-wrap: anywhere; }
.executive-grid { display: grid; grid-template-columns: 1.45fr .85fr; gap: 14px; }
.executive-grid.charts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.panel { padding: 18px; min-width: 0; }
.panel-wide { grid-column: span 1; }
.panel-head { margin-bottom: 14px; }
.panel-head h3 { margin: 0; color: #071d36; font-size: 16px; font-weight: 900; }
.panel-head a { color: var(--azul-2); font-weight: 800; text-decoration: none; }
.funnel-chart,
.bar-list,
.alert-stack { display: grid; gap: 11px; }
.funnel-row,
.bar-row {
    display: grid;
    grid-template-columns: minmax(110px, .8fr) 2fr minmax(70px, auto);
    align-items: center;
    gap: 10px;
}
.funnel-row span,
.bar-row span { color: #34445c; font-size: 12px; font-weight: 850; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-row div,
.bar-row div { height: 12px; border-radius: 999px; background: #edf2f7; overflow: hidden; }
.funnel-row i,
.bar-row i { display: block; height: 100%; min-width: 4px; border-radius: inherit; background: #123e6d; }
.funnel-row:nth-child(3) i,
.funnel-row:nth-child(4) i { background: #b96a00; }
.funnel-row:nth-child(5) i { background: #138a4d; }
.funnel-row:nth-child(6) i { background: #c33131; }
.funnel-row strong,
.bar-row strong { color: #071d36; font-size: 12px; text-align: right; }
.insight { border: 1px solid #e2e8f0; border-left: 4px solid #123e6d; border-radius: 8px; padding: 12px; background: #f8fafc; }
.insight b { display: block; color: var(--azul-2); font-size: 11px; text-transform: uppercase; }
.insight strong { display: block; color: #071d36; margin-top: 3px; }
.insight span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
.executive-table a,
.premium-table a { color: #071d36; text-decoration: none; }
.executive-table small,
.premium-table small { display: block; color: var(--muted); margin-top: 3px; }
.opportunities-workspace {
    display: grid;
    grid-template-columns: 292px minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: start;
}
.side-filters { position: sticky; top: 18px; padding: 16px; max-height: calc(100vh - 36px); overflow: auto; }
.side-filters form { display: grid; gap: 12px; }
.side-filter-head a { font-size: 12px; color: var(--azul-2); font-weight: 850; text-decoration: none; }
.opportunity-list-panel { padding: 16px; min-width: 0; }
.table-toolbar { margin-bottom: 12px; }
.table-toolbar a { color: var(--azul-2); font-weight: 850; text-decoration: none; }
.premium-table { min-width: 1600px; }
.premium-table tbody tr { cursor: pointer; }
.premium-table tbody tr.is-selected { background: #edf7ff; box-shadow: inset 3px 0 0 #123e6d; }
.quick-actions { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
.quick-actions form { display: inline-flex; gap: 6px; align-items: center; }
.quick-actions .form-select { min-height: 32px; min-width: 132px; }
.quick-detail-panel { position: sticky; top: 18px; padding: 16px; }
.quick-detail { display: grid; gap: 10px; }
.quick-detail.empty { color: var(--muted); }
.quick-detail strong { color: #071d36; }
.quick-detail .detail-line { border-top: 1px solid #edf2f7; padding-top: 9px; }
.quick-detail .detail-line b { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.quick-detail .detail-line span { display: block; color: #172033; font-weight: 800; margin-top: 2px; }
.badge-status { box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.btn, .form-control, .form-select { transition: box-shadow .16s ease, transform .16s ease, border-color .16s ease; }
.btn:hover { transform: translateY(-1px); }

@media (max-width: 1280px) {
    .executive-filter-grid { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
    .executive-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .opportunities-workspace { grid-template-columns: 280px minmax(0, 1fr); }
    .quick-detail-panel { grid-column: 1 / -1; position: static; }
}
@media (max-width: 900px) {
    .sidebar-toggle { display: none; }
    .sidebar-collapsed .sidebar { width: 100%; }
    .sidebar-collapsed .content { margin: 0; width: 100%; }
    .executive-head { display: grid; }
    .executive-summary { min-width: 0; }
    .executive-filter-grid,
    .executive-kpis,
    .executive-grid,
    .executive-grid.charts,
    .opportunities-workspace { grid-template-columns: 1fr; }
    .side-filters,
    .quick-detail-panel { position: static; max-height: none; }
}

/* CRM Phase 1 */
.crm-form { display: grid; gap: 0; }
.crm-form .panel h3,
.crm-detail-grid .panel h3 { font-size: 16px; }
.crm-form-actions {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 0 4px;
    background: linear-gradient(180deg, rgba(238,243,248,0), #eef3f8 38%);
}
.crm-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
    gap: 14px;
    align-items: stretch;
}
.deal-hero {
    display: grid;
    gap: 14px;
    background: linear-gradient(135deg, #071d36 0%, #123e6d 100%);
    color: #fff;
}
.deal-hero .badge-status { width: fit-content; }
.deal-status-line { display: grid; gap: 6px; }
.deal-status-line strong { font-size: 34px; line-height: 1.05; }
.deal-status-line small { color: rgba(255,255,255,.72); font-weight: 750; }
.quick-status-form {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) minmax(220px, 1.4fr) auto;
    gap: 10px;
    align-items: end;
}
.quick-status-form label { color: rgba(255,255,255,.78); }
.loss-reason-note {
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.16);
}
.next-action-card strong { display: block; color: #071d36; font-size: 18px; }
.next-action-card small { display: block; color: var(--muted); margin-top: 8px; font-weight: 750; }

.score-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0;
}
.score-strip div {
    border: 1px solid #dbe5f0;
    border-radius: 8px;
    padding: 10px 12px;
    background: #f8fbff;
}
.score-strip span {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}
.score-strip strong {
    display: block;
    color: #071d36;
    font-size: 18px;
    margin-top: 3px;
    overflow-wrap: anywhere;
}
.score-alto div { border-color: #bce7cf; background: #f1fbf6; }
.score-alto strong { color: var(--success); }
.score-medio div { border-color: #f5dfa3; background: #fffaf0; }
.score-medio strong { color: var(--warning); }
.score-baixo div { border-color: #f4bebe; background: #fff5f5; }
.score-baixo strong { color: var(--danger); }
.required-commercial-field label::after,
.required-commercial-field > label::after {
    content: ' *';
    color: var(--danger);
}
.commercial-timeline .timeline-item { position: relative; }
.timeline-oportunidade { border-left-color: var(--secondary); }
.timeline-interacao { border-left-color: var(--success); }
.timeline-anexo { border-left-color: var(--warning); }
.timeline-auditoria { border-left-color: #6b7280; }
@media (max-width: 720px) {
    .score-strip { grid-template-columns: 1fr; }
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.info-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.info-grid div,
.notes-box {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
    min-width: 0;
}
.info-grid b,
.notes-box b {
    display: block;
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 4px;
}
.info-grid span,
.notes-box span { display: block; color: #172033; font-weight: 800; overflow-wrap: anywhere; }
.interaction-form textarea { resize: vertical; }
.checkline {
    min-height: 42px;
    width: 100%;
    border: 1px solid #cfd9e7;
    border-radius: 8px;
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: #fff;
}
.attachment-form { display: grid; grid-template-columns: 1.1fr 1fr auto; gap: 10px; align-items: end; }
.attachment-list { display: grid; gap: 8px; }
.attachment-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px;
    background: #f8fafc;
}
.attachment-item strong,
.attachment-item span { display: block; }
.attachment-item span { color: var(--muted); font-size: 12px; margin-top: 2px; }
.timeline { display: grid; gap: 10px; }
.timeline-item {
    border: 1px solid #e2e8f0;
    border-left: 4px solid #123e6d;
    border-radius: 8px;
    background: #fff;
    padding: 13px;
}
.timeline-item.internal { border-left-color: #6b7280; background: #f8fafc; }
.timeline-item strong { color: #071d36; }
.timeline-item span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.timeline-item p { margin: 9px 0 0; color: #172033; }
.timeline-item small { display: block; color: var(--azul-2); margin-top: 8px; font-weight: 800; }
.empty-state {
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    padding: 14px;
    color: var(--muted);
    background: #f8fafc;
}
.loss-reason-field.is-hidden { display: none !important; }
.quick-actions .loss-reason-field { min-width: 150px; }
@media (max-width: 1100px) {
    .crm-detail-grid,
    .quick-status-form,
    .attachment-form { grid-template-columns: 1fr; }
    .info-grid,
    .info-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .info-grid,
    .info-grid.two-cols { grid-template-columns: 1fr; }
    .attachment-item { display: grid; }
    .crm-form-actions { justify-content: stretch; }
    .crm-form-actions .btn { flex: 1; }
}

/* Executive Dashboard Phase 2 */
.compact-rank { min-width: 760px; }
.compact-rank th,
.compact-rank td { font-size: 12px; }
.rank-list { display: grid; gap: 9px; }
.rank-item {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
}
.rank-item > span {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #123e6d;
    color: #fff;
    font-weight: 900;
    font-size: 12px;
}
.rank-item strong,
.rank-item small { display: block; }
.rank-item strong { color: #071d36; overflow-wrap: anywhere; }
.rank-item small { color: var(--muted); font-size: 12px; margin-top: 2px; }
.rank-item b { color: #071d36; font-size: 12px; white-space: nowrap; }


/* Executive Director Phase 2 */
.director-filter-grid { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.director-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.director-table { min-width: 980px; }
.insight-alta { border-left-color: var(--danger); background: #fff5f5; }
.insight-media { border-left-color: var(--warning); background: #fffaf0; }
.insight-positiva,
.insight-ok { border-left-color: var(--success); background: #f1fbf6; }
@media (max-width: 1100px) {
    .director-filter-grid,
    .director-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .director-filter-grid,
    .director-kpis { grid-template-columns: 1fr; }
}

/* Management Phase 3 */
.management-alerts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.management-filter-grid { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.management-table { min-width: 1200px; }
.management-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    border-radius: 999px;
    padding: 5px 8px;
    font-size: 10px;
    font-weight: 900;
    background: #e5edf7;
    color: #123e6d;
}
.badge-vencida { background: #fdeaea; color: #c33131; }
.badge-hoje { background: #fff3d6; color: #b96a00; }
.badge-7_dias { background: #e6f6ee; color: #138a4d; }
.badge-futura { background: #edf2f7; color: #43536a; }
.badge-ok { background: #e6f6ee; color: #138a4d; }
.badge-sem_acao { background: #fdeaea; color: #c33131; }
.badge-encerrada { background: #edf2f7; color: #43536a; }
.management-rank { grid-template-columns: 34px minmax(0, 1fr) minmax(100px, auto); }
.management-form {
    display: grid;
    grid-template-columns: 120px minmax(180px, 1fr) 150px minmax(160px, 1fr) auto;
    gap: 10px;
    align-items: end;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}
.management-form.compact { grid-template-columns: minmax(0, 1fr) auto; }
.meta-entity.is-hidden { display: none; }
.reason-list { display: grid; gap: 8px; }
.reason-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
}
.reason-item span { font-weight: 850; color: #071d36; }

/* Checkmob agenda and commercial central */
.agenda-filter summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    cursor: pointer;
    list-style: none;
}
.agenda-filter summary::-webkit-details-marker { display: none; }
.agenda-filter summary strong { color: #071d36; font-size: 16px; font-weight: 900; }
.agenda-filter summary span { color: var(--muted); font-size: 12px; }
.agenda-filter-grid { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
.agenda-kpis,
.central-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.central-kpis { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.agenda-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
    gap: 14px;
}
.agenda-card-list,
.central-list {
    display: grid;
    gap: 10px;
}
.agenda-card {
    display: grid;
    grid-template-columns: minmax(130px, .35fr) minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #123e6d;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}
.agenda-tarefa { border-left-color: var(--warning); }
.agenda-card-time strong,
.agenda-card-time span,
.agenda-card-body strong,
.agenda-card-body span,
.agenda-card-body small,
.central-item strong,
.central-item span,
.central-item small {
    display: block;
}
.agenda-card-time strong { color: #071d36; font-size: 13px; }
.agenda-card-time span { color: var(--azul-2); font-size: 11px; font-weight: 900; margin-top: 4px; }
.agenda-card-body strong,
.central-item strong { color: #071d36; overflow-wrap: anywhere; }
.agenda-card-body span,
.central-item span { color: #34445c; font-size: 13px; font-weight: 750; margin-top: 3px; }
.agenda-card-body small,
.central-item small { color: var(--muted); font-size: 12px; margin-top: 3px; }
.month-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.month-cell {
    min-height: 96px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 11px;
}
.month-cell strong,
.month-cell span,
.month-cell small { display: block; }
.month-cell strong { color: #071d36; }
.month-cell span { color: var(--azul-2); font-weight: 900; margin-top: 6px; }
.month-cell small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.agenda-table { min-width: 1300px; }
.timeline-visita { border-left-color: var(--success); }
.timeline-tarefa { border-left-color: var(--warning); }
.timeline-alert { border-left-color: var(--danger); background: #fff5f5; }
.central-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}
.central-item {
    display: block;
    text-decoration: none;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #123e6d;
    border-radius: 8px;
    background: #f8fafc;
    padding: 11px;
}
.central-item:hover { background: #edf7ff; }
.central-item.danger { border-left-color: var(--danger); }
.central-item.warning { border-left-color: var(--warning); }

/* Checkmob visits */
.checkmob-visits-panel { padding: 14px; }
.checkmob-visits-wrap {
    border: 1px solid #E0E8F1;
    border-radius: 8px;
    overflow: auto;
    background: #fff;
}
.checkmob-visits-table {
    min-width: 1320px;
    border-collapse: separate;
    border-spacing: 0;
    color: #172033;
}
.checkmob-visits-table thead th {
    padding: 14px 16px;
    background: #F8FAFC;
    border-bottom: 1px solid #DDE6EF;
}
.checkmob-visits-table tbody td {
    padding: 17px 16px;
    border-bottom: 1px solid #EEF3F7;
    vertical-align: middle;
}
.checkmob-visits-table tbody tr:nth-child(even) { background: #FCFEFF; }
.checkmob-visits-table tbody tr:hover { background: #F3F8FC; }
.checkmob-visits-table .col-client { min-width: 230px; }
.checkmob-visits-table .col-seller { min-width: 245px; }
.checkmob-visits-table .col-date { min-width: 135px; }
.checkmob-visits-table .col-city { min-width: 125px; }
.checkmob-visits-table .col-type { min-width: 150px; }
.checkmob-visits-table .col-status { min-width: 120px; }
.checkmob-visits-table .col-check { min-width: 170px; }
.checkmob-visits-table .col-geo { min-width: 96px; }
.checkmob-visits-table .col-note { min-width: 250px; }
.visit-identity,
.visit-person,
.visit-date,
.visit-location,
.visit-checks {
    display: grid;
    gap: 4px;
    min-width: 0;
}
.visit-identity strong,
.visit-person strong,
.visit-location strong,
.visit-date strong {
    color: #071D36;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
}
.visit-identity small,
.visit-person small,
.visit-location small,
.visit-date small,
.visit-checks b,
.visit-checks span,
.muted-dash {
    color: #64748B;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.3;
}
.visit-person small {
    max-width: 230px;
    word-break: break-word;
}
.visit-location small {
    width: fit-content;
    padding: 2px 7px;
    border-radius: 999px;
    background: #EEF3F7;
    color: #526477;
}
.visit-type {
    display: block;
    max-width: 150px;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}
.visit-checks span {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    max-width: 160px;
}
.visit-checks b {
    min-width: 46px;
    color: #94A3B8;
}
.checkmob-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    min-height: 28px;
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.checkmob-status-badge.is-success {
    background: #E8F7ED;
    border-color: #BCE7CF;
    color: #178A45;
}
.checkmob-status-badge.is-warning {
    background: #FFF4E5;
    border-color: #F5D7A8;
    color: #B96A00;
}
.checkmob-status-badge.is-danger {
    background: #FDECEC;
    border-color: #F4BEBE;
    color: #C33131;
}
.checkmob-status-badge.is-neutral {
    background: #EEF3F7;
    border-color: #D8E2EC;
    color: #526477;
}
.map-link {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid #C8D8E6;
    border-radius: 999px;
    background: #F4F8FC;
    color: #1F5D8C;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}
.map-link svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}
.map-link:hover {
    background: #EAF3FB;
    border-color: #A9C2D6;
    color: #17496F;
}
.visit-note {
    display: -webkit-box;
    max-width: 280px;
    overflow: hidden;
    color: #334155;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}
.visit-note.is-empty {
    color: #94A3B8;
    font-style: italic;
}

@media (max-width: 1280px) {
    .central-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .central-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .agenda-filter-grid,
    .agenda-kpis,
    .central-kpis,
    .agenda-layout,
    .central-board { grid-template-columns: 1fr; }
    .agenda-card { grid-template-columns: 1fr; }
    .month-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .month-grid { grid-template-columns: 1fr; }
    .agenda-card .btn { width: 100%; }
}
@media (max-width: 760px) {
    .checkmob-visits-panel {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .checkmob-visits-wrap {
        border: 0;
        border-radius: 0;
        overflow: visible;
        background: transparent;
    }
    .checkmob-visits-table {
        display: block;
        min-width: 0;
        width: 100%;
    }
    .checkmob-visits-table thead { display: none; }
    .checkmob-visits-table tbody {
        display: grid;
        gap: 12px;
    }
    .checkmob-visits-table tbody tr {
        display: grid;
        padding: 12px 14px;
        border: 1px solid #DDE6EF;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 12px 28px rgba(15,23,42,.06);
    }
    .checkmob-visits-table tbody tr:nth-child(even),
    .checkmob-visits-table tbody tr:hover { background: #fff; }
    .checkmob-visits-table tbody td {
        display: grid;
        gap: 5px;
        padding: 10px 0;
        border-bottom: 1px solid #EEF3F7;
    }
    .checkmob-visits-table tbody td:last-child { border-bottom: 0; }
    .checkmob-visits-table tbody td::before {
        content: attr(data-label);
        color: #94A3B8;
        font-size: 10px;
        font-weight: 600;
        text-transform: uppercase;
    }
    .checkmob-visits-table td[colspan]::before { display: none; }
    .visit-person small,
    .visit-type,
    .visit-note {
        max-width: none;
    }
    .visit-checks span {
        max-width: none;
        justify-content: flex-start;
    }
}
@media (max-width: 1200px) {
    .management-alerts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .management-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .management-alerts,
    .management-filter-grid,
    .management-form,
    .management-form.compact { grid-template-columns: 1fr; }
}

/* Reports Phase 4 */
.report-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.report-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.report-action {
    display: grid;
    gap: 5px;
    min-height: 112px;
    padding: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    color: #172033;
    text-decoration: none;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.report-action:hover {
    transform: translateY(-2px);
    border-color: #123e6d;
    box-shadow: 0 18px 42px rgba(15,23,42,.10);
    color: #071d36;
}
.report-action.primary {
    background: #071d36;
    color: #fff;
    border-color: #071d36;
}
.report-action strong { font-size: 15px; font-weight: 900; }
.report-action span { color: var(--muted); font-size: 12px; line-height: 1.35; }
.report-action.primary span { color: rgba(255,255,255,.72); }
@media (max-width: 1200px) {
    .report-actions,
    .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .report-actions,
    .report-kpis { grid-template-columns: 1fr; }
}

/* Premium visual system override */
html { scroll-behavior: smooth; }
* { letter-spacing: 0; }
body {
    background: var(--background);
    color: var(--text-main);
    font-size: 15px;
    min-width: 320px;
}
a { color: var(--secondary); }
a:hover { color: var(--primary); }
.app-shell { min-height: 100vh; background: radial-gradient(circle at top right, rgba(31,111,178,.10), transparent 32%), var(--background); }
.sidebar {
    width: 292px;
    background: linear-gradient(180deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 18px 16px;
    position: fixed;
    inset: 0 auto 0 0;
    border-right: 1px solid rgba(255,255,255,.10);
    box-shadow: 18px 0 45px rgba(6, 26, 48, .18);
    z-index: 1030;
    display: flex;
    flex-direction: column;
}
.sidebar-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand { padding: 8px 10px 18px; margin: 0; }
.brand strong { font-size: 32px; letter-spacing: 0; }
.brand span { color: rgba(255,255,255,.70); font-weight: 700; }
.sidebar-toggle,
.sidebar-close,
.mobile-menu-btn {
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 12px;
    background: rgba(255,255,255,.10);
    color: #fff;
    min-width: 42px;
    height: 42px;
    font-weight: 900;
}
.sidebar-close { display: none; font-size: 28px; line-height: 1; }
.sidebar nav { display: grid; gap: 5px; margin-top: 12px; overflow-y: auto; padding-right: 2px; }
.sidebar nav a,
.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 11px;
    color: rgba(255,255,255,.86);
    text-decoration: none;
    padding: 11px 12px;
    border-radius: 12px;
    font-weight: 800;
    transition: background .16s ease, transform .16s ease, color .16s ease;
}
.sidebar nav a span,
.sidebar-logout span {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255,255,255,.11);
    color: #fff;
    font-size: 12px;
    flex: 0 0 auto;
}
.sidebar nav a:hover,
.sidebar-logout:hover { background: rgba(255,255,255,.12); color: #fff; transform: translateX(2px); }
.sidebar-logout { margin-top: auto; border: 1px solid rgba(255,255,255,.10); }
.content {
    margin-left: 292px;
    width: calc(100% - 292px);
    padding: 22px clamp(16px, 2vw, 34px) 38px;
}
.topbar {
    position: sticky;
    top: 14px;
    z-index: 1010;
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(219,229,240,.85);
    border-radius: var(--radius);
    padding: 14px 16px;
    box-shadow: var(--shadow-soft);
}
.topbar-left,
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.topbar strong { color: var(--primary-dark); font-size: 16px; }
.topbar small { color: var(--text-muted); font-weight: 700; }
.mobile-menu-btn { display: none; background: var(--primary); color: #fff; border-color: var(--primary); }
.user-pill {
    background: var(--primary-light);
    color: var(--primary);
    border: 1px solid #cde0f5;
    border-radius: 999px;
    padding: 8px 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 900;
}
.user-pill small { color: var(--secondary); margin: 0; }
.logout-btn {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 999px;
    text-decoration: none;
    background: #fff;
    border: 1px solid var(--border);
    color: var(--primary);
    font-weight: 850;
}
.flash-stack { margin-top: 14px; }
.alert { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow-soft); }
.sidebar-collapsed .sidebar { width: 88px; padding-inline: 14px; }
.sidebar-collapsed .content { margin-left: 88px; width: calc(100% - 88px); }
.sidebar-collapsed .brand span,
.sidebar-collapsed .sidebar nav a em,
.sidebar-collapsed .sidebar-logout em { display: none; }
.sidebar-collapsed .brand strong { font-size: 24px; }
.sidebar-collapsed .sidebar nav a,
.sidebar-collapsed .sidebar-logout { justify-content: center; padding-inline: 8px; }

.page-title,
.executive-head {
    margin: 28px 0 18px;
    padding: 0;
}
.page-title h2,
.executive-head h2 { color: var(--primary-dark); font-weight: 950; letter-spacing: 0; }
.page-title p,
.executive-head p { color: var(--text-muted); }
.eyebrow { color: var(--secondary); font-size: 11px; font-weight: 950; letter-spacing: .04em; }
.executive-summary { border-radius: var(--radius); background: linear-gradient(135deg, var(--primary-dark), var(--primary)); box-shadow: var(--shadow); }

.card,
.panel,
.filter-bar,
.executive-filter-bar,
.side-filters,
.opportunity-list-panel,
.quick-detail-panel,
.metric,
.kanban-col,
.login-shell {
    border: 1px solid rgba(219,229,240,.95);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    background: var(--surface);
}
.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    border-bottom: 1px solid var(--border);
    color: var(--primary-dark);
    font-weight: 900;
    background: linear-gradient(180deg, #fff, #f9fbfd);
    padding: 14px 16px;
}
.card-body,
.panel { padding: 18px; }
.metric,
.metric.executive {
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.metric:hover,
.panel:hover,
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.metric span { color: var(--text-muted); font-weight: 850; }
.metric strong { color: var(--primary-dark); overflow-wrap: anywhere; }
.metric.success strong { color: var(--success); }
.metric.danger strong { color: var(--danger); }
.metric.warning strong { color: var(--warning); }
.metric i { border-radius: 12px; background: var(--primary-light); color: var(--secondary); }
.executive-kpis,
.report-kpis,
.management-alerts { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.executive-filter-bar,
.filter-bar {
    padding: 18px;
    border-radius: var(--radius);
    background: rgba(255,255,255,.96);
}
.filter-title { border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 14px; }
.filter-title strong::before { content: "▾"; display: inline-grid; place-items: center; margin-right: 8px; color: var(--secondary); }
.executive-filter-grid { grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 13px; }
label { color: var(--text-main); font-size: 13px; font-weight: 850; }
.form-control,
.form-select {
    min-height: 44px;
    border-radius: 12px;
    border-color: #ccd8e6;
    color: var(--text-main);
    font-weight: 650;
}
.form-control:focus,
.form-select:focus { border-color: var(--secondary); box-shadow: var(--focus); }
.form-control::placeholder { color: #94a3b8; }
.btn {
    min-height: 40px;
    border-radius: 12px;
    font-weight: 900;
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--secondary); border-color: var(--secondary); box-shadow: 0 10px 20px rgba(31,111,178,.18); }
.btn-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-outline-primary { color: var(--secondary); border-color: #b8d3ed; }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-light,
.btn-outline-secondary { border-color: var(--border); background: #fff; color: var(--primary); }

.table-responsive {
    border-radius: var(--radius);
    scrollbar-width: thin;
    scrollbar-color: #b8c7d9 #edf2f7;
}
.table { margin-bottom: 0; }
.table thead th,
.professional-table thead th {
    background: #f7fafc;
    color: #475569;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 950;
    text-transform: uppercase;
    white-space: nowrap;
}
.table tbody td { border-color: #edf2f7; vertical-align: middle; }
.table tbody tr { transition: background .14s ease; }
.table tbody tr:hover { background: #f8fbff; }
.table td strong { color: var(--primary-dark); }
.table td a { text-decoration: none; font-weight: 850; }
.action-buttons,
.quick-actions { gap: 8px; }
.empty-state,
td[colspan] { color: var(--text-muted); }

.badge-status,
.badge-lead,
.badge-oportunidade,
.badge-proposta,
.badge-negociacao,
.badge-fechado,
.badge-perdido {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    min-height: 28px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 950;
    border: 1px solid transparent;
    white-space: nowrap;
}
.status-lead,
.badge-lead { background: #eef3f8; color: #475569; border-color: #d8e2ec; }
.status-oportunidade,
.badge-oportunidade { background: #eaf3ff; color: var(--secondary); border-color: #c9dff5; }
.status-proposta,
.badge-proposta { background: #fff8db; color: #9a6a00; border-color: #f5dfa3; }
.status-negociacao,
.badge-negociacao { background: #fff1dd; color: var(--warning); border-color: #ffd5a8; }
.status-fechado,
.badge-fechado { background: #e7f7ef; color: var(--success); border-color: #bce7cf; }
.status-perdido,
.badge-perdido { background: #fdecec; color: var(--danger); border-color: #f4bebe; }

.crm-form .panel,
form.card,
.card.card-body { border-radius: var(--radius); }
.crm-form-actions,
.form-actions-sticky {
    border-top: 1px solid rgba(219,229,240,.9);
    padding: 16px 0 0;
}
.info-grid div,
.notes-box,
.attachment-item,
.timeline-item,
.rank-item,
.reason-item,
.report-action,
.sheet-detect { border-radius: var(--radius); }
.deal-hero { border-radius: var(--radius); }
.kanban { gap: 16px; padding-bottom: 10px; }
.kanban-col { min-width: 250px; padding: 14px; }
.kanban-col h5 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 36px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 12px;
}
.kanban-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 20px rgba(15,23,42,.05);
    transition: transform .16s ease, box-shadow .16s ease;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-soft); }

.premium-login-page {
    min-height: 100vh;
    background: radial-gradient(circle at 15% 10%, rgba(31,111,178,.28), transparent 32%), linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 24px;
}
.premium-login-shell {
    width: min(1040px, 96vw);
    grid-template-columns: 1.05fr .95fr;
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 35px 90px rgba(0,0,0,.30);
}
.premium-login-intro {
    background: linear-gradient(160deg, rgba(6,26,48,.96), rgba(11,42,74,.92));
    padding: 56px;
}
.premium-login-intro h1 { font-size: clamp(58px, 9vw, 104px); }
.premium-login-intro p { max-width: 460px; font-size: 20px; }
.login-highlights { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 28px; }
.login-highlights span { padding: 8px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: rgba(255,255,255,.82); font-weight: 850; }
.premium-login-card { padding: 52px; }
.login-card-head span { color: var(--secondary); font-weight: 950; text-transform: uppercase; font-size: 12px; }
.login-form { display: grid; gap: 12px; }
.login-form .btn { min-height: 48px; margin-top: 8px; }

.mobile-backdrop { display: none; }
.is-loading { position: relative; pointer-events: none; opacity: .78; }
.is-loading::after { content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; display: inline-block; margin-left: 8px; vertical-align: -3px; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1600px) {
    .content { padding-inline: 44px; }
    .executive-filter-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
}
@media (max-width: 1180px) {
    .content { padding: 18px; }
    .executive-grid,
    .executive-grid.charts,
    .crm-detail-grid { grid-template-columns: 1fr; }
    .opportunities-workspace { grid-template-columns: 280px minmax(0,1fr); }
    .quick-detail-panel { grid-column: 1 / -1; position: static; }
}
@media (max-width: 900px) {
    body.sidebar-open { overflow: hidden; }
    .sidebar {
        width: min(326px, 88vw);
        transform: translateX(-105%);
        transition: transform .22s ease;
        padding: 18px;
    }
    body.sidebar-open .sidebar { transform: translateX(0); }
    .sidebar-close { display: inline-grid; place-items: center; }
    .sidebar-toggle { display: none; }
    .mobile-backdrop {
        position: fixed;
        inset: 0;
        background: rgba(6,26,48,.48);
        z-index: 1020;
        backdrop-filter: blur(2px);
    }
    body.sidebar-open .mobile-backdrop { display: block; }
    .content,
    .sidebar-collapsed .content { margin-left: 0; width: 100%; padding: 14px; }
    .mobile-menu-btn { display: inline-grid; place-items: center; }
    .topbar { top: 8px; border-radius: 14px; }
    .topbar { align-items: flex-start; gap: 12px; }
    .topbar-actions { margin-left: auto; }
    .logout-btn { display: none; }
    .user-pill { padding: 7px 10px; }
    .user-pill small { display: none; }
    .page-title,
    .executive-head,
    .compact-head { display: grid !important; gap: 12px; margin-top: 18px; }
    .executive-head h2,
    .page-title h2 { font-size: 26px; }
    .executive-summary { min-width: 0; }
    .executive-filter-bar.is-collapsed .executive-filter-grid,
    .filter-bar.is-collapsed .row { display: none; }
    .filter-title { cursor: pointer; }
    .card-body,
    .panel { padding: 14px; }
    .side-filters { position: static; max-height: none; }
    .opportunities-workspace { grid-template-columns: 1fr; }
    .table-responsive { overflow-x: auto; border: 1px solid var(--border); }
    .btn { min-height: 44px; }
    .quick-actions,
    .action-buttons { flex-wrap: wrap; }
    .quick-actions form { flex-wrap: wrap; width: 100%; }
    .quick-actions .form-select { flex: 1 1 145px; }
    .login-shell.premium-login-shell { grid-template-columns: 1fr; }
    .premium-login-intro { min-height: 240px; padding: 34px; }
    .premium-login-card { padding: 32px; }
}
@media (max-width: 560px) {
    body { font-size: 14px; }
    .content { padding: 10px; }
    .topbar { padding: 11px; }
    .topbar strong { font-size: 14px; }
    .topbar small { display: none; }
    .executive-filter-grid,
    .management-filter-grid { grid-template-columns: 1fr; }
    .metric strong { font-size: 22px; }
    .card,
    .panel,
    .metric,
    .executive-filter-bar { border-radius: 12px; }
    .premium-login-page { padding: 12px; }
    .premium-login-intro { padding: 28px; }
    .premium-login-card { padding: 24px; }
    .login-highlights span { font-size: 12px; }
}


/* IBG HUB visual alignment */
:root {
    --primary: #0F3557;
    --primary-dark: #0B2B48;
    --primary-light: #EEF5FB;
    --secondary: #2D6FA3;
    --background: #F4F7FB;
    --surface: #FFFFFF;
    --border: #E6ECF2;
    --text-main: #172033;
    --text-muted: #69778A;
    --success: #178A45;
    --danger: #D63B3B;
    --warning: #C67A00;
    --info: #2D6FA3;
    --radius: 18px;
    --shadow: 0 2px 10px rgba(15,35,95,.04);
    --shadow-soft: 0 8px 22px rgba(15,35,95,.055);
    --focus: 0 0 0 .2rem rgba(45,111,163,.15);
    --azul: var(--primary);
    --azul-2: var(--secondary);
    --azul-3: var(--primary-light);
    --cinza: var(--background);
    --borda: var(--border);
    --texto: var(--text-main);
    --muted: var(--text-muted);
    --verde: var(--success);
    --vermelho: var(--danger);
    --laranja: var(--warning);
}

html { background: var(--background); }
body {
    background: var(--background) !important;
    color: var(--text-main);
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 400;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.app-shell { background: var(--background); }
.content {
    padding: 30px 34px;
    transition: margin-left .22s ease, width .22s ease;
}

.sidebar {
    background: #0F3557 !important;
    color: rgba(255,255,255,.82);
    padding: 22px 16px;
    border-right: 1px solid rgba(255,255,255,.07);
    box-shadow: none !important;
}
.sidebar-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}
.brand {
    padding: 2px 10px 22px;
    margin-bottom: 6px;
    gap: 3px;
}
.brand strong {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0;
    color: #FFFFFF;
}
.brand span {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255,255,255,.64);
}
.sidebar-toggle,
.sidebar-close {
    border: 1px solid rgba(255,255,255,.12);
    background: rgba(255,255,255,.055);
    color: rgba(255,255,255,.76);
    border-radius: 10px;
    font-weight: 600;
}
.sidebar-toggle {
    width: 34px;
    height: 34px;
    margin: 0 0 14px 10px;
}
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a,
.sidebar-logout {
    color: rgba(255,255,255,.76);
    padding: 9px 10px;
    border-radius: 10px;
    margin-bottom: 2px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}
.sidebar nav a span,
.sidebar-logout span {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: transparent;
    color: rgba(255,255,255,.68);
    font-size: 10px;
    font-weight: 600;
}
.sidebar nav a:hover,
.sidebar-logout:hover {
    background: rgba(255,255,255,.075);
    color: rgba(255,255,255,.96);
    transform: none;
}
.sidebar nav a:hover span,
.sidebar-logout:hover span { background: rgba(255,255,255,.08); color: rgba(255,255,255,.9); }
.sidebar-collapsed .brand strong { font-size: 22px; }
.sidebar-collapsed .sidebar nav a { padding: 9px; }

.topbar {
    background: rgba(255,255,255,.96) !important;
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    padding: 14px 18px;
    box-shadow: 0 2px 10px rgba(15,35,95,.035) !important;
    backdrop-filter: blur(10px);
}
.topbar strong {
    color: #152A3F;
    font-size: 15px;
    font-weight: 700;
}
.topbar small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 400;
}
.user-pill {
    background: #F1F6FB;
    color: #244761;
    border: 1px solid #E1EAF2;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.user-pill span { font-weight: 600; }
.user-pill small { color: #7A8797; }
.logout-btn,
.btn-primary {
    background: #1F5D8C !important;
    border-color: #1F5D8C !important;
    color: #FFFFFF !important;
}
.logout-btn:hover,
.btn-primary:hover {
    background: #184F78 !important;
    border-color: #184F78 !important;
}

.page-title,
.executive-head { margin: 32px 0 22px; }
.page-title h2,
.executive-head h2 {
    color: #152A3F;
    font-size: 30px;
    font-weight: 700;
    letter-spacing: 0;
}
.page-title p,
.executive-head p {
    color: var(--text-muted);
    font-weight: 400;
    max-width: 920px;
    line-height: 1.55;
}
.eyebrow {
    color: #4F7897;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
}

.card,
.metric,
.panel,
.executive-filter-bar,
.filter-bar,
.side-filters,
.opportunity-list-panel,
.quick-detail-panel,
.kanban-col,
.kanban-card,
.info-grid div,
.notes-box,
.attachment-item,
.timeline-item,
.empty-state,
.sheet-detect,
.insight {
    border: 1px solid var(--border) !important;
    border-radius: 18px !important;
    box-shadow: 0 2px 10px rgba(15,35,95,.04) !important;
    background: var(--surface);
}
.card-body,
.panel,
.executive-filter-bar,
.filter-bar,
.opportunity-list-panel,
.quick-detail-panel,
.side-filters { padding: 22px; }
.card-header {
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
    border-radius: 18px 18px 0 0 !important;
    color: #152A3F;
    font-weight: 600;
    padding: 15px 20px;
}
.metric {
    min-height: 122px;
    padding: 22px;
}
.metric span,
.metric.executive small,
.filter-title span,
.table-toolbar span,
.panel-head span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
}
.metric strong {
    color: #152A3F;
    font-size: 24px;
    font-weight: 700;
    margin-top: 8px;
}
.metric i {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    background: #EEF5FB;
    color: #315E7C;
    font-weight: 600;
}
.metric.executive,
.panel,
.opportunity-list-panel,
.kanban-card { transition: box-shadow .16s ease, transform .16s ease; }
.metric.executive:hover,
.panel:hover,
.opportunity-list-panel:hover,
.kanban-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 22px rgba(15,35,95,.055) !important;
}
.executive-summary,
.deal-hero {
    background: #0F3557 !important;
    border-radius: 18px;
    box-shadow: 0 8px 24px rgba(15,35,95,.12) !important;
}
.executive-summary span { font-weight: 500; color: rgba(255,255,255,.72); }
.executive-summary strong { font-weight: 700; }

label {
    color: #42566A;
    font-size: 12px;
    font-weight: 600;
}
.form-control,
.form-select {
    min-height: 42px;
    border-color: #DDE6EF;
    border-radius: 12px;
    color: #172033;
    font-size: 14px;
    font-weight: 400;
    box-shadow: none !important;
}
.form-control:focus,
.form-select:focus {
    border-color: #78A4C4;
    box-shadow: var(--focus) !important;
}
.btn {
    border-radius: 12px;
    font-weight: 600;
    box-shadow: none !important;
}
.btn:hover { transform: none; }
.btn-outline-primary { color: #1F5D8C; border-color: #A9C2D6; }
.btn-outline-primary:hover { background: #EEF5FB; border-color: #8FB0C9; color: #17496F; }
.btn-light,
.btn-outline-secondary { border-color: #DDE6EF; color: #526477; background: #FFFFFF; }
.btn-light:hover,
.btn-outline-secondary:hover { background: #F4F7FB; color: #334155; border-color: #CFDAE6; }

.professional-table,
.premium-table,
.executive-table { font-size: 13px; }
.professional-table thead th,
.premium-table thead th,
.executive-table thead th {
    background: #F7FAFD;
    color: #526477;
    border-bottom: 1px solid var(--border);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .03em;
    padding: 12px 14px;
}
.professional-table tbody td,
.premium-table tbody td,
.executive-table tbody td {
    border-color: #EEF3F7;
    padding: 13px 14px;
    vertical-align: middle;
}
.professional-table tbody tr:nth-child(even),
.premium-table tbody tr:nth-child(even),
.executive-table tbody tr:nth-child(even) { background: #FBFDFF; }
.professional-table tbody tr:hover,
.premium-table tbody tr:hover,
.executive-table tbody tr:hover { background: #F3F8FC; }
.table-responsive {
    border-radius: 16px;
    border-color: var(--border) !important;
}

.badge-status,
.badge {
    border-radius: 999px;
    font-weight: 600;
    box-shadow: none !important;
}
.badge-status {
    min-width: 82px;
    padding: 6px 10px;
    background: #EEF3F7;
    color: #526477;
    font-size: 11px;
}
.status-negociacao,
.status-proposta { background: #FFF4E5 !important; color: #C67A00 !important; }
.status-fechado { background: #E8F7ED !important; color: #178A45 !important; }
.status-perdido { background: #FDECEC !important; color: #D63B3B !important; }
.status-lead { background: #EEF3F7 !important; color: #526477 !important; }
.status-oportunidade { background: #EAF3FB !important; color: #2D6FA3 !important; }
.text-bg-primary { background: #EAF3FB !important; color: #2D6FA3 !important; }
.text-bg-success { background: #E8F7ED !important; color: #178A45 !important; }
.text-bg-warning { background: #FFF4E5 !important; color: #C67A00 !important; }
.text-bg-danger { background: #FDECEC !important; color: #D63B3B !important; }
.text-bg-secondary,
.text-bg-light { background: #EEF3F7 !important; color: #526477 !important; }

.filter-title strong,
.table-toolbar strong,
.panel-head h3,
.side-filter-head strong,
.kanban-col h5,
.next-action-card strong,
.quick-detail strong,
.deal-status-line strong {
    color: #152A3F;
    font-weight: 700;
}
.panel-head h3 { font-size: 15px; }
.funnel-row span,
.bar-row span {
    color: #526477;
    font-weight: 500;
}
.funnel-row div,
.bar-row div { background: #EDF3F8; height: 10px; }
.funnel-row i,
.bar-row i { background: #2D6FA3; }
.funnel-row:nth-child(3) i,
.funnel-row:nth-child(4) i { background: #D9A64E; }
.funnel-row:nth-child(5) i { background: #4FA36D; }
.funnel-row:nth-child(6) i { background: #D96969; }
.insight {
    border-left: 3px solid #8FB0C9 !important;
    background: #FBFDFF;
}
.insight b { color: #4F7897; font-weight: 600; }
.insight strong { color: #152A3F; font-weight: 700; }

.login-page,
.premium-login-page {
    background: #F4F7FB !important;
}
.login-shell,
.premium-login-shell {
    border-radius: 22px;
    border: 1px solid var(--border);
    box-shadow: 0 18px 48px rgba(15,35,95,.10);
}
.login-intro,
.premium-login-intro {
    background: #0F3557 !important;
}
.login-intro h1,
.premium-login-intro h1 { font-weight: 700; }
.login-intro p,
.premium-login-intro p { font-size: 18px; color: rgba(255,255,255,.76); }
.login-highlights span {
    border-color: rgba(255,255,255,.16);
    color: rgba(255,255,255,.76);
    font-weight: 500;
}
.login-card h2,
.login-card-head h2 { color: #152A3F; font-weight: 700; }
.login-card-head span { color: #4F7897; font-weight: 600; }

@media (max-width: 900px) {
    .sidebar {
        background: #0F3557 !important;
        box-shadow: 12px 0 30px rgba(15,35,95,.16) !important;
    }
    .content,
    .sidebar-collapsed .content { padding: 16px; }
    .topbar { border-radius: 16px !important; }
    .card-body,
    .panel,
    .executive-filter-bar,
    .filter-bar,
    .opportunity-list-panel,
    .quick-detail-panel,
    .side-filters { padding: 18px; }
    .executive-head h2,
    .page-title h2 { font-size: 25px; }
    .mobile-backdrop { background: rgba(15,53,87,.42); }
}

@media (max-width: 560px) {
    .content { padding: 12px; }
    .metric strong { font-size: 21px; }
    .card,
    .panel,
    .metric,
    .executive-filter-bar,
    .filter-bar { border-radius: 16px !important; }
    .premium-login-card { padding: 26px; }
    .premium-login-intro { padding: 30px; }
}

/* Checkmob Integration */
.integration-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.integration-actions form { margin: 0; }
.sync-box strong, .sync-box span { display: block; }
.sync-box strong { color: #071d36; font-size: 20px; }
.sync-box span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.inline-link-form { display: contents; }
.checkmob-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.badge-sucesso { background: #e6f6ee; color: #138a4d; }
.badge-erro { background: #fdeaea; color: #c33131; }
.badge-parcial { background: #fff3d6; color: #b96a00; }
.badge-iniciado { background: #e8f1fb; color: var(--azul-2); }
@media (max-width: 1100px) { .checkmob-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 700px) { .checkmob-kpis { grid-template-columns: 1fr; } .integration-actions { display: grid; } }

/* Final Checkmob visits overrides */
.panel.checkmob-visits-panel { padding: 14px; }
.panel.checkmob-visits-panel .checkmob-visits-wrap {
    border: 1px solid #E0E8F1;
    border-radius: 8px;
}
.panel.checkmob-visits-panel .checkmob-visits-table thead th {
    padding: 14px 16px;
    letter-spacing: 0;
}
.panel.checkmob-visits-panel .checkmob-visits-table tbody td {
    padding: 17px 16px;
    border-bottom: 1px solid #EEF3F7;
}

@media (max-width: 760px) {
    .panel.checkmob-visits-panel {
        padding: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
    }
    .panel.checkmob-visits-panel .checkmob-visits-wrap {
        border: 0;
        border-radius: 0;
        overflow: visible;
        background: transparent;
    }
    .panel.checkmob-visits-panel .checkmob-visits-table tbody td {
        padding: 10px 0;
    }
}

/* Compact corporate sidebar */
.app-sidebar.sidebar {
    width: 260px;
    padding: 16px 12px;
    background: #0F3557 !important;
    color: rgba(255,255,255,.76);
    border-right: 1px solid rgba(255,255,255,.10);
    box-shadow: none !important;
    overflow: visible;
}
.app-sidebar .sidebar-head {
    align-items: center;
    gap: 8px;
    padding: 0 2px 10px;
}
.sidebar-brand {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #F8FAFC;
    text-decoration: none;
}
.sidebar-brand:hover { color: #fff; }
.sidebar-brand-mark {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.14);
    border-radius: 12px;
    background: rgba(255,255,255,.08);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex: 0 0 auto;
}
.sidebar-brand-copy {
    display: grid;
    gap: 0;
    min-width: 0;
}
.sidebar-brand-copy strong {
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.1;
}
.sidebar-brand-copy small {
    color: rgba(255,255,255,.62);
    font-size: 11px;
    font-weight: 500;
}
.app-sidebar .sidebar-toggle,
.app-sidebar .sidebar-close,
.mobile-menu-btn {
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 10px;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.78);
    box-shadow: none !important;
}
.app-sidebar .sidebar-toggle {
    width: 34px;
    min-width: 34px;
    height: 34px;
    margin: 0 0 12px 2px;
}
.app-sidebar .sidebar-close { display: none; }
.sidebar-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}
.app-sidebar .sidebar-link > span,
.app-sidebar .sidebar-logout > span,
.app-sidebar .sidebar-group-label > span {
    width: auto;
    height: auto;
    display: inline;
    place-items: initial;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    flex: 0 1 auto;
}
.sidebar-section {
    display: grid;
    gap: 4px;
    min-height: 0;
    margin-top: 2px;
    padding-right: 2px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.18) transparent;
}
.sidebar-section::-webkit-scrollbar { width: 6px; }
.sidebar-section::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,.18);
    border-radius: 999px;
}
.sidebar-group {
    display: grid;
    gap: 3px;
}
.sidebar-group-header,
.sidebar-link,
.app-sidebar .sidebar-logout {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255,255,255,.72);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}
.sidebar-group-header {
    justify-content: space-between;
    cursor: pointer;
}
.sidebar-group-label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.sidebar-group-header:hover,
.sidebar-link:hover,
.app-sidebar .sidebar-logout:hover {
    background: rgba(255,255,255,.08);
    color: #F8FAFC;
    transform: none;
}
.sidebar-group-header > .sidebar-icon:last-child {
    width: 15px;
    height: 15px;
    opacity: .62;
    transition: transform .16s ease;
}
.sidebar-group.is-open .sidebar-group-header > .sidebar-icon:last-child {
    transform: rotate(180deg);
}
.sidebar-group.is-open .sidebar-group-header {
    background: rgba(255,255,255,.08);
}
.sidebar-group.is-active .sidebar-group-header,
.sidebar-link.active {
    background: rgba(255,255,255,.14);
    color: #FFFFFF;
}
.sidebar-submenu {
    display: grid;
    gap: 2px;
    margin: 0 0 4px 28px;
    padding: 3px 0 4px 10px;
    border-left: 1px solid rgba(255,255,255,.10);
}
.sidebar-submenu[hidden] { display: none !important; }
.sidebar-submenu .sidebar-link {
    min-height: 31px;
    padding: 7px 9px;
    color: rgba(255,255,255,.68);
    font-size: 12px;
}
.sidebar-submenu .sidebar-link.active {
    background: rgba(255,255,255,.12);
    color: #fff;
}
.sidebar-link.is-disabled {
    cursor: not-allowed;
    opacity: .45;
}
.app-sidebar .sidebar-logout {
    margin-top: auto;
    border: 1px solid rgba(255,255,255,.10);
}
.content {
    margin-left: 260px;
    width: calc(100% - 260px);
}
body.sidebar-collapsed .app-sidebar.sidebar {
    width: 78px;
    padding-inline: 10px;
}
body.sidebar-collapsed .content {
    margin-left: 78px;
    width: calc(100% - 78px);
}
body.sidebar-collapsed .sidebar-brand {
    justify-content: center;
}
body.sidebar-collapsed .sidebar-brand-copy,
body.sidebar-collapsed .sidebar-group-label span,
body.sidebar-collapsed .sidebar-link span,
body.sidebar-collapsed .app-sidebar .sidebar-logout span,
body.sidebar-collapsed .sidebar-group-header > .sidebar-icon:last-child {
    display: none;
}
body.sidebar-collapsed .app-sidebar .sidebar-toggle,
body.sidebar-collapsed .sidebar-group-header,
body.sidebar-collapsed .sidebar-link-main,
body.sidebar-collapsed .app-sidebar .sidebar-logout {
    justify-content: center;
}
body.sidebar-collapsed .sidebar-group-label {
    justify-content: center;
}
body.sidebar-collapsed .sidebar-submenu {
    display: none !important;
}
body.sidebar-collapsed .sidebar-group-header,
body.sidebar-collapsed .sidebar-link-main,
body.sidebar-collapsed .app-sidebar .sidebar-logout {
    position: relative;
}
body.sidebar-collapsed .sidebar-group-header:hover::after,
body.sidebar-collapsed .sidebar-link-main:hover::after,
body.sidebar-collapsed .app-sidebar .sidebar-logout:hover::after {
    content: attr(data-title);
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: 1100;
    min-width: max-content;
    padding: 7px 9px;
    border-radius: 8px;
    background: #152A3F;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 10px 22px rgba(15,35,95,.18);
}

@media (max-width: 900px) {
    .app-sidebar.sidebar,
    body.sidebar-collapsed .app-sidebar.sidebar {
        width: min(310px, 88vw);
        padding: 16px 12px;
        transform: translateX(-105%);
        transition: transform .22s ease;
    }
    body.sidebar-open .app-sidebar.sidebar {
        transform: translateX(0);
    }
    .app-sidebar .sidebar-close { display: inline-grid; }
    .app-sidebar .sidebar-toggle { display: none; }
    body.sidebar-collapsed .sidebar-brand {
        justify-content: flex-start;
    }
    body.sidebar-collapsed .sidebar-brand-copy {
        display: grid;
    }
    body.sidebar-collapsed .sidebar-group-label span,
    body.sidebar-collapsed .sidebar-link span,
    body.sidebar-collapsed .app-sidebar .sidebar-logout span {
        display: inline;
    }
    body.sidebar-collapsed .sidebar-group-header > .sidebar-icon:last-child {
        display: block;
    }
    body.sidebar-collapsed .sidebar-submenu:not([hidden]) {
        display: grid !important;
    }
    body.sidebar-collapsed .sidebar-group-header,
    body.sidebar-collapsed .sidebar-link-main,
    body.sidebar-collapsed .app-sidebar .sidebar-logout {
        justify-content: flex-start;
    }
    body.sidebar-collapsed .sidebar-group-header:hover::after,
    body.sidebar-collapsed .sidebar-link-main:hover::after,
    body.sidebar-collapsed .app-sidebar .sidebar-logout:hover::after {
        display: none;
    }
    .content,
    body.sidebar-collapsed .content {
        margin-left: 0;
        width: 100%;
    }
}

/* CRM Comercial Fase 1 */
.status-qualificacao { background: #EAF3FB !important; color: #2D6FA3 !important; }
.status-visita { background: #E8F7ED !important; color: #178A45 !important; }
.status-juridico { background: #EEF3F7 !important; color: #475569 !important; }
.status-fechamento,
.status-implantacao { background: #E8F7ED !important; color: #178A45 !important; }
.status-ativa,
.status-cliente { background: #E8F7ED !important; color: #178A45 !important; }
.status-prospect { background: #EAF3FB !important; color: #2D6FA3 !important; }
.status-inativa { background: #EEF3F7 !important; color: #526477 !important; }

.score-quente div { border-color: #bce7cf; background: #f1fbf6; }
.score-quente strong { color: var(--success); }
.score-media div { border-color: #f5dfa3; background: #fffaf0; }
.score-media strong { color: var(--warning); }
.score-fria div { border-color: #d8e2ec; background: #f8fafc; }
.score-fria strong { color: #526477; }
.score-critica div { border-color: #f4bebe; background: #fff5f5; }
.score-critica strong { color: var(--danger); }

.crm-filter-panel { padding: 14px; }
.crm-table { min-width: 1180px; }
.crm-table td strong,
.crm-table td small,
.professional-table td small {
    display: block;
}
.crm-table td small,
.professional-table td small {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 3px;
}
.crm-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
}
.crm-kpi {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow-soft);
    padding: 14px;
}
.crm-kpi span,
.crm-kpi strong {
    display: block;
}
.crm-kpi span {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}
.crm-kpi strong {
    color: var(--primary-dark);
    font-size: 24px;
    line-height: 1.1;
    margin-top: 5px;
}
.crm-kpi.danger strong { color: var(--danger); }
.crm-kpi.warning strong { color: var(--warning); }

.quality-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.quality-card {
    min-width: 0;
}

.quality-description {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
    margin: 0 0 14px;
}

.quality-list {
    display: grid;
    gap: 8px;
}

.quality-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    color: inherit;
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 10px 12px;
    text-decoration: none;
}

.quality-item:hover {
    border-color: rgba(11, 79, 138, .35);
    background: rgba(11, 79, 138, .04);
}

.quality-item strong,
.quality-item span,
.quality-item small {
    overflow-wrap: anywhere;
}

.quality-item span,
.quality-item small {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.health-pill-list {
    display: grid;
    gap: 10px;
}

.health-pill {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-width: 0;
    padding: 12px;
}

.health-pill strong,
.health-pill span {
    overflow-wrap: anywhere;
}

.health-pill span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 750;
}

.pilot-banner {
    border: 1px solid rgba(11, 79, 138, .16);
    border-radius: 8px;
    background: #edf6ff;
    color: #123e6d;
    font-size: 13px;
    font-weight: 850;
    margin: 0 0 14px;
    padding: 10px 14px;
}

.feedback-fab {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 60;
    border-radius: 999px;
    background: #123e6d;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .18);
    color: #fff;
    font-size: 13px;
    font-weight: 900;
    padding: 12px 16px;
    text-decoration: none;
}

.feedback-fab:hover {
    background: #0b4f8a;
    color: #fff;
}

.log-snippet {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #0f172a;
    color: #dbeafe;
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
    max-height: 340px;
    overflow: auto;
    padding: 12px;
    white-space: pre-wrap;
}

@media (max-width: 980px) {
    .quality-grid {
        grid-template-columns: 1fr;
    }
    .feedback-fab {
        right: 14px;
        bottom: 14px;
    }
}

.crm-mini-list {
    display: grid;
    gap: 9px;
}
.crm-mini-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-left: 4px solid #123e6d;
    border-radius: 8px;
    background: #f8fafc;
    padding: 11px;
}
.crm-mini-item strong,
.crm-mini-item span,
.crm-mini-item small,
.crm-mini-item a {
    display: block;
}
.crm-mini-item strong { color: var(--primary-dark); }
.crm-mini-item span,
.crm-mini-item small {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 3px;
    overflow-wrap: anywhere;
}
.crm-mini-item a {
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}
.task-vencida { border-left-color: var(--danger); background: #fff5f5; }
.task-concluida { border-left-color: var(--success); }
.task-cancelada { border-left-color: #94a3b8; }

.compact-crm-form {
    display: grid;
    gap: 10px;
}
.compact-crm-form .checkline { margin: 0; }

.task-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 74px;
    min-height: 26px;
    border-radius: 999px;
    padding: 5px 9px;
    font-size: 10px;
    font-weight: 800;
    background: #EEF3F7;
    color: #526477;
}
.priority-baixa { background: #EAF3FB; color: #2D6FA3; }
.priority-media { background: #EEF3F7; color: #526477; }
.priority-alta { background: #FFF4E5; color: #C67A00; }
.priority-critica,
.task-vencida { background: #FDECEC; color: #D63B3B; }
.task-aberta,
.task-em_andamento { background: #EAF3FB; color: #2D6FA3; }
.task-concluida { background: #E8F7ED; color: #178A45; }
.task-cancelada { background: #EEF3F7; color: #526477; }

.followup-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}
.followup-board .panel-wide { grid-column: 1 / -1; }
.followup-board .central-list {
    max-height: 430px;
    overflow: auto;
    padding-right: 3px;
}
.wide-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.timeline-visita_checkmob { border-left-color: var(--success); }
.kanban-rdstyle {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}
.kanban-col-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}
.kanban-col-head h5 { margin: 0; }
.kanban-col-head span,
.kanban-col-head strong {
    display: block;
}
.kanban-col-head span {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 3px;
}
.kanban-col-head strong {
    color: var(--primary-dark);
    font-size: 13px;
    white-space: nowrap;
}
.kanban-dropzone {
    min-height: 280px;
}
.kanban-card.is-dragging {
    opacity: .55;
}
.kanban-col.is-drop-target {
    outline: 2px solid rgba(18, 62, 109, .28);
    background: #f6fbff;
}
.kanban-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}
.playbook-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.playbook-grid > div {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #f8fafc;
    padding: 12px;
}
.playbook-grid b {
    display: block;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.playbook-grid p,
.playbook-grid ul {
    margin: 0;
    color: #172033;
    font-weight: 650;
}
.playbook-grid ul {
    padding-left: 18px;
}

@media (max-width: 1200px) {
    .crm-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .followup-board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .crm-kpi-grid,
    .followup-board,
    .wide-list,
    .playbook-grid { grid-template-columns: 1fr; }
    .crm-mini-item { grid-template-columns: 1fr; }
}
