:root {
    --brand: var(--app-brand, #4e73df);
    --brand-dark: var(--app-brand-dark, #2e59d9);
    --ink: #20242b;
    --muted: #667085;
    --line: #dfe5f5;
    --surface: #ffffff;
    --surface-soft: #f5f7ff;
    --success: #15803d;
    --danger: #b42318;
    --shadow: 0 18px 45px rgba(32, 36, 43, 0.12);
}

.site-dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(3px);
}

.site-dialog {
    width: min(440px, 100%);
    overflow: hidden;
    border: 1px solid var(--line, #dfe5f5);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
}

.site-dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 18px;
    background: var(--site-dialog-color, var(--brand));
    color: #fff;
}

.site-dialog-head button {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}

.site-dialog-body {
    padding: 24px 20px;
    color: var(--ink, #20242b);
    line-height: 1.5;
    white-space: pre-wrap;
}

.site-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 20px 18px;
}

.site-dialog-actions button {
    min-height: 40px;
    padding: 8px 17px;
    border-radius: 9px;
    font-weight: 700;
    cursor: pointer;
}

.site-dialog-cancel {
    border: 1px solid #cfd6e3;
    background: #fff;
    color: #344054;
}

.site-dialog-confirm {
    border: 1px solid var(--site-dialog-color, var(--brand));
    background: var(--site-dialog-color, var(--brand));
    color: #fff;
}

/* Confirmações legadas também seguem a identidade visual configurada. */
.swal2-popup { border-radius: 16px !important; font-family: inherit !important; }
.swal2-title { color: var(--ink, #20242b) !important; font-size: 1.35rem !important; }
.swal2-confirm { background: var(--brand, #4e73df) !important; border-radius: 9px !important; font-weight: 700 !important; }
.swal2-cancel { border-radius: 9px !important; font-weight: 700 !important; }

* {
    box-sizing: border-box;
}

body.pilot-body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    font-family: "Segoe UI", Arial, sans-serif;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(245, 247, 255, 0.96));
}

body.sisprime-login-page {
    background: #f7f8f7;
}

.pilot-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 48px;
}

.conversion-shell {
    width: min(1600px, calc(100% - 24px));
}

.app-header-shell {
    padding: 22px 0 0;
}

body.app-theme .app-header-shell {
    width: auto;
    max-width: none;
    margin: 0 12px;
}

.app-standard-header {
    margin-bottom: 0;
}

.pilot-topbar {
    position: relative;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(230, 224, 214, 0.9);
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(32, 36, 43, 0.08);
    backdrop-filter: blur(12px);
}

.pilot-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.pilot-brand-copy {
    min-width: 0;
}

.pilot-brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.pilot-logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid var(--line);
}

.home-logo {
    width: 92px;
    height: 92px;
    border: 0;
    border-radius: 50%;
    object-fit: contain;
}

.pilot-brand-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
}

.pilot-brand-subtitle {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
}

.pilot-user {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.pilot-user strong {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 0.85rem;
}

.profile-menu {
    position: relative;
    z-index: 3000;
}

.profile-menu-mobile {
    display: none;
}

.profile-menu summary {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink);
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 800;
    list-style: none;
}

.profile-menu summary::-webkit-details-marker {
    display: none;
}

.profile-menu summary::after {
    content: "▾";
    margin-left: 8px;
    color: var(--brand);
    font-size: 0.78rem;
}

.profile-menu[open] summary::after {
    content: "▴";
}

.profile-menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 5000;
    width: min(320px, calc(100vw - 32px));
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(32, 36, 43, 0.16);
}

.profile-menu-panel a,
.profile-menu-action {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.88rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.profile-menu-panel a:hover,
.profile-menu-action:hover {
    background: var(--surface-soft);
    color: var(--brand-dark);
}

.profile-menu-panel .danger {
    color: var(--danger);
}

.support-form {
    display: grid;
    gap: 9px;
    margin: 8px 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #f8fafc;
}

.support-form[hidden] {
    display: none;
}

.support-form label {
    display: grid;
    gap: 5px;
    color: #344054;
    font-size: 0.78rem;
    font-weight: 800;
}

.support-form input,
.support-form textarea {
    width: 100%;
    min-height: 36px;
    padding: 8px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font: inherit;
    font-size: 0.86rem;
}

.support-form textarea {
    min-height: 92px;
    resize: vertical;
}

.support-submit {
    min-height: 36px;
    border: 0;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.pilot-hero {
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    gap: 28px;
    align-items: stretch;
    margin-top: 28px;
}

.pilot-welcome {
    padding: 34px;
    border-radius: 22px;
    background: linear-gradient(145deg, var(--brand-dark), var(--brand));
    color: #fff;
    box-shadow: var(--shadow);
    overflow: hidden;
    position: relative;
}

.pilot-welcome::after {
    content: "";
    position: absolute;
    inset: auto -70px -90px auto;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--brand) 26%, transparent);
}

.pilot-kicker {
    margin: 0 0 14px;
    color: color-mix(in srgb, #fff 72%, var(--brand));
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.pilot-welcome h1 {
    position: relative;
    margin: 0;
    max-width: 620px;
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1;
    letter-spacing: 0;
}

.pilot-welcome p {
    position: relative;
    max-width: 560px;
    margin: 18px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1rem;
    line-height: 1.7;
}

.pilot-stats {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 30px;
}

.pilot-stat {
    padding: 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.13);
}

.pilot-stat b {
    display: block;
    font-size: 1.15rem;
}

.pilot-stat span {
    display: block;
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.76rem;
}

.pilot-panel {
    padding: 22px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.pilot-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.pilot-section-title h2 {
    margin: 0;
    font-size: 1.15rem;
}

.pilot-section-title span {
    color: var(--muted);
    font-size: 0.86rem;
}

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

.pilot-card {
    display: flex;
    flex-direction: column;
    min-height: 128px;
    padding: 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink);
    text-decoration: none;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.pilot-card:hover {
    transform: translateY(-3px);
    border-color: rgba(184, 134, 47, 0.55);
    box-shadow: 0 16px 32px rgba(32, 36, 43, 0.12);
    color: var(--ink);
}

.pilot-card-featured {
    grid-column: 1 / -1;
    min-height: 138px;
    background: linear-gradient(135deg, #f4f6fb, #ffffff);
}

.pilot-card-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 12px;
    color: #fff;
    background: var(--brand);
    font-weight: 800;
}

.pilot-card-title {
    font-weight: 800;
    font-size: 1.02rem;
}

.pilot-card-text {
    margin-top: 7px;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.pilot-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.dash-layout {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 18px;
    margin-top: 22px;
}

.conversion-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
}

.dash-main {
    min-width: 0;
}

.dash-main,
.dash-side,
.dash-panel {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 30px rgba(32, 36, 43, 0.08);
}

.dash-main,
.dash-side {
    padding: 18px;
}

.dash-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.dash-title h1,
.dash-title h2 {
    margin: 0;
    font-size: 1.2rem;
}

.dash-title p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    min-height: 118px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.metric-label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    margin-top: 10px;
    color: var(--ink);
    font-size: 1.55rem;
    font-weight: 850;
    line-height: 1.1;
}

.metric-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.pipeline {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.pipeline-card {
    padding: 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
}

.pipeline-card strong {
    display: block;
    font-size: 1.35rem;
}

.pipeline-card span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.86rem;
}

.pipeline-bar {
    height: 8px;
    margin-top: 12px;
    border-radius: 99px;
    background: #edf1fb;
    overflow: hidden;
}

.pipeline-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--brand);
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.92rem;
}

.dash-table th,
.dash-table td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.dash-table th {
    color: var(--muted);
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-table tr:last-child td {
    border-bottom: 0;
}

.conversion-table {
    table-layout: fixed;
    min-width: 1145px;
}

.conversion-table .col-codigo {
    width: 86px;
}

.conversion-table .col-cliente {
    width: 162px;
}

.conversion-table .col-valor {
    width: 118px;
}

.conversion-table .col-status {
    width: 126px;
}

.conversion-table .col-tipo {
    width: 162px;
}

.conversion-table .col-pagamento {
    width: 150px;
}

.conversion-table .col-vendedor {
    width: 132px;
}

.conversion-table .col-data {
    width: 128px;
}

.conversion-table .col-obs {
    width: 58px;
}

.budget-code-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--brand-dark);
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.budget-code-link:hover {
    border-color: var(--brand);
    background: #fff;
    box-shadow: 0 8px 18px color-mix(in srgb, var(--brand) 14%, transparent);
}

.conversion-table th,
.conversion-table td {
    padding: 11px 8px;
}

.conversion-table th,
.conversion-table td {
    overflow-wrap: anywhere;
    word-break: normal;
}

.conversion-table th {
    line-height: 1.25;
}

.conversion-table .conversion-select,
.conversion-table .sale-input {
    width: 100%;
    min-width: 0;
    font-size: 0.86rem;
}

.conversion-table td[data-label="Valor"],
.conversion-table td[data-label="Data"] {
    white-space: nowrap;
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.status-em-espera {
    background: #fff6d8;
    color: #8a5a00;
}

.status-aprovado {
    background: #dcfce7;
    color: #166534;
}

.status-declinado {
    background: #fee2e2;
    color: #991b1b;
}

.side-nav {
    display: grid;
    gap: 10px;
}

.side-menu summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--ink);
    cursor: default;
    font-size: 1.08rem;
    font-weight: 850;
    list-style: none;
}

.side-menu summary::-webkit-details-marker {
    display: none;
}

.side-menu p {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.88rem;
}

.menu-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--brand-dark);
    font-size: 1rem;
}

.side-link {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-weight: 800;
}

.side-link-icon {
    width: 22px;
    flex: 0 0 22px;
    text-align: center;
    color: var(--brand);
    font-size: 1rem;
}

.side-link:hover {
    border-color: var(--brand);
    color: var(--brand-dark);
}

.conversion-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.conversion-search {
    min-height: 40px;
    width: min(360px, 100%);
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.conversion-select {
    min-height: 38px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    max-width: 100%;
}

.sale-fields {
    display: none;
    min-width: 280px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-soft);
}

.sale-fields.is-visible {
    display: grid;
    gap: 10px;
}

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

.sale-field {
    display: grid;
    gap: 5px;
}

.sale-field label {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.sale-input {
    min-height: 38px;
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.sale-total-line {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: var(--muted);
    font-size: 0.84rem;
}

.save-state {
    min-height: 18px;
    color: var(--success);
    font-size: 0.78rem;
    font-weight: 800;
}

.note-button {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--brand-dark);
    cursor: pointer;
    font-size: 1rem;
}

.note-button:hover,
.note-button.has-note {
    border-color: var(--brand);
    background: var(--surface-soft);
}

.note-modal[hidden] {
    display: none;
}

.modal {
    z-index: 20000 !important;
}

.modal-backdrop {
    z-index: 19990 !important;
}

.swal2-container {
    z-index: 21000 !important;
}

.modal-open .pilot-topbar,
.modal-open .profile-menu,
.modal-open .profile-menu-panel {
    z-index: 1 !important;
}

.note-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: grid;
    place-items: center;
    padding: 18px;
}

.note-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.note-modal-box {
    position: relative;
    z-index: 1;
    width: min(560px, 100%);
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(32, 36, 43, 0.22);
}

.note-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.note-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.note-close {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
}

.note-textarea {
    width: 100%;
    min-height: 220px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    resize: vertical;
    font: inherit;
    line-height: 1.5;
    white-space: pre-wrap;
}

.note-textarea:focus {
    outline: 3px solid color-mix(in srgb, var(--brand) 18%, transparent);
    border-color: var(--brand);
}

.note-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.pilot-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.86rem;
    transition: transform 160ms ease, background 160ms ease;
}

.pilot-btn:hover {
    transform: translateY(-1px);
    background: var(--surface-soft);
    color: var(--ink);
}

.pilot-btn-primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.pilot-btn-primary:hover {
    background: var(--brand-dark);
    color: #fff;
}

.pilot-btn-danger {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

.pilot-btn-danger:hover {
    background: #8f1d14;
    color: #fff;
}

.auth-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.auth-card {
    width: min(920px, 100%);
    display: grid;
    grid-template-columns: 0.95fr 1.05fr;
    overflow: hidden;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.auth-card-wide {
    width: min(1080px, 100%);
}

.auth-side {
    padding: 34px;
    background: linear-gradient(145deg, var(--brand-dark), var(--brand));
    color: #fff;
}

body.sisprime-login-page .auth-side {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
    color: #1f2933;
}

.auth-side img {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    object-fit: cover;
    border: 0;
    box-shadow: none;
}

.auth-side .sisprime-login-logo {
    width: min(360px, 100%);
    height: auto;
    padding: 0;
    border-radius: 0;
    background: #fff;
    object-fit: contain;
}

.auth-side h1 {
    margin: 28px 0 12px;
    font-size: clamp(2rem, 5vw, 3.3rem);
    line-height: 1;
    letter-spacing: 0;
}

.auth-side p {
    margin: 0;
    color: rgba(255, 255, 255, 0.76);
    line-height: 1.65;
}

body.sisprime-login-page .auth-side p {
    margin-top: 22px;
    color: #53615e;
}

.auth-form {
    padding: 38px;
    align-self: center;
}

.auth-form h2 {
    margin: 0 0 8px;
    font-size: 1.45rem;
}

.auth-form .hint {
    margin: 0 0 24px;
    color: var(--muted);
}

.form-field {
    margin-bottom: 16px;
}

.form-field label {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
    color: var(--ink);
}

.form-field input {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-size: 1rem;
}

.form-field input:focus {
    outline: 3px solid color-mix(in srgb, var(--brand) 18%, transparent);
    border-color: var(--brand);
}

.auth-submit {
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    border: 0;
    border-radius: 12px;
    background: var(--brand);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.auth-submit:hover {
    background: var(--brand-dark);
}

.auth-link-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.auth-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    font-weight: 800;
    text-decoration: none;
}

.auth-secondary:hover {
    border-color: var(--brand);
    color: var(--brand-dark);
}

.auth-forgot-link {
    border-color: transparent;
    background: transparent;
}

.auth-forgot-link:hover,
.auth-forgot-link:focus-visible {
    border-color: transparent;
    background: rgba(15, 61, 54, 0.06);
    box-shadow: 0 10px 22px rgba(15, 61, 54, 0.12);
    color: var(--brand-dark);
}

.auth-forgot-link:active {
    background: rgba(15, 61, 54, 0.1);
    box-shadow: 0 6px 14px rgba(15, 61, 54, 0.14) inset;
}

.auth-register-link {
    margin-top: 24px;
}

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

.auth-message {
    margin: 16px 0 0;
    padding: 12px;
    border-radius: 12px;
    background: #fff1f0;
    color: var(--danger);
    font-weight: 700;
}

.flash-error {
    color: var(--danger);
}

.flash-success {
    color: var(--success);
}

body.app-theme {
    background:
        linear-gradient(180deg, #f8f9fc 0%, #f4f6fb 100%) !important;
}

body.app-theme .page-header {
    padding: 18px 20px !important;
    margin-bottom: 24px !important;
    border: 1px solid var(--line) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    box-shadow: 0 10px 28px rgba(32, 36, 43, 0.08) !important;
}

body.app-theme .container-fluid > .page-header.legacy-home-header {
    display: none !important;
}

body.app-theme .card-custom {
    border: 1px solid var(--line) !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 34px rgba(32, 36, 43, 0.1) !important;
}

body.app-theme .card-header-custom,
body.app-theme .table th {
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%) !important;
}

body.app-theme .btn-custom-primary {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
}

body.app-theme .btn-custom-primary:hover {
    background-color: var(--brand-dark) !important;
    border-color: var(--brand-dark) !important;
}

body.app-theme .btn-primary,
body.app-theme .page-link.active,
body.app-theme .active > .page-link {
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
}

body.app-theme .btn-primary:hover,
body.app-theme .btn-primary:focus {
    background-color: var(--brand-dark) !important;
    border-color: var(--brand-dark) !important;
}

body.app-theme .btn-outline-primary {
    color: var(--brand) !important;
    border-color: var(--brand) !important;
}

body.app-theme .btn-outline-primary:hover,
body.app-theme .btn-outline-primary:focus {
    color: #fff !important;
    background-color: var(--brand) !important;
    border-color: var(--brand) !important;
}

body.app-theme .bg-primary {
    background-color: var(--brand) !important;
}

body.app-theme .text-primary {
    color: var(--brand) !important;
}

body.app-theme .border-primary {
    border-color: var(--brand) !important;
}

body.app-theme .spinner-border.text-primary {
    color: var(--brand) !important;
}

body.app-theme .form-control:focus,
body.app-theme .form-select:focus,
body.app-theme .select2-container--default .select2-selection--single:focus,
body.app-theme .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: var(--brand) !important;
    box-shadow: 0 0 0 0.2rem color-mix(in srgb, var(--brand) 25%, transparent) !important;
}

body.app-theme .dynamic-field {
    border-left-color: var(--brand) !important;
}

body.app-theme .info-dropdown {
    border-color: var(--brand) !important;
    box-shadow: 0 4px 15px color-mix(in srgb, var(--brand) 30%, transparent) !important;
}

body.app-theme .info-dropdown .dropdown-title,
body.app-theme .info-dropdown .dropdown-title i,
body.app-theme .info-dropdown .info-label,
body.app-theme .clickable-cell .text-primary {
    color: var(--brand) !important;
}

body.app-theme .info-dropdown .dropdown-title {
    border-bottom-color: var(--brand) !important;
}

body.app-theme .table tbody tr.selected {
    background-color: color-mix(in srgb, var(--brand) 12%, white) !important;
}

body.app-theme .table tbody tr.selected .selecionar-orcamento {
    accent-color: var(--brand) !important;
}

body.app-theme .filtro-section {
    border: 1px solid var(--line) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
}

@media (max-width: 1100px) {
    .dash-layout,
    .conversion-layout {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .conversion-layout {
        grid-template-columns: 1fr;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body.pilot-body {
        background-attachment: scroll;
        background-size: min(520px, 94vw);
    }

    .pilot-shell {
        width: min(100% - 20px, 760px);
        padding: 10px 0 28px;
    }

    .pilot-topbar,
    .pilot-user {
        align-items: stretch;
        flex-direction: column;
    }

    .pilot-topbar {
        gap: 12px;
        padding: 12px;
        border-radius: 14px;
    }

    .pilot-brand {
        align-items: center;
    }

    .pilot-brand-copy {
        flex: 1;
    }

    .pilot-brand-row {
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .pilot-logo {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .profile-menu-desktop {
        display: none;
    }

    .profile-menu-mobile {
        display: block;
        flex: 0 1 auto;
        max-width: 52vw;
    }

    .profile-menu-mobile summary {
        min-height: 34px;
        max-width: 100%;
        padding: 0 10px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .pilot-user .pilot-btn,
    .pilot-user strong,
    .profile-menu-desktop,
    .profile-menu-desktop summary {
        width: 100%;
    }

    .profile-menu-panel {
        width: min(230px, 82vw);
        margin-top: 8px;
    }

    .profile-menu-mobile .profile-menu-panel {
        right: 0;
    }

    .pilot-hero,
    .auth-card,
    .dash-layout,
    .conversion-layout {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 12px;
    }

    .pilot-grid,
    .pilot-stats,
    .pipeline {
        grid-template-columns: 1fr;
    }

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

    .dash-main,
    .dash-side,
    .dash-panel {
        border-radius: 14px;
    }

    .dash-main,
    .dash-side {
        padding: 12px;
    }

    .dash-title {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .dash-title h1 {
        font-size: 1.22rem;
        line-height: 1.25;
    }

    .dash-title h2 {
        font-size: 1.05rem;
    }

    .dash-title .pilot-btn,
    .conversion-toolbar .pilot-btn {
        width: 100%;
    }

    .side-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .side-menu .side-nav,
    .side-menu p {
        display: none;
    }

    .side-menu summary {
        cursor: pointer;
    }

    .side-menu[open] .side-nav {
        display: grid;
    }

    .side-menu[open] p {
        display: block;
    }

    .side-link {
        min-height: 48px;
        padding: 12px;
        align-items: center;
    }

    .metric-card {
        min-height: 104px;
        padding: 13px;
    }

    .metric-value {
        font-size: 1.22rem;
        overflow-wrap: anywhere;
    }

    .conversion-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .conversion-toolbar > div:last-child {
        width: 100%;
    }

    .conversion-search,
    .conversion-select {
        width: 100%;
    }

    .sale-grid,
    .report-summary {
        grid-template-columns: 1fr;
    }

    .pilot-welcome,
    .pilot-panel,
    .auth-side,
    .auth-form {
        padding: 24px;
    }

    .auth-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .side-nav {
        grid-template-columns: 1fr;
    }

    .dash-panel[style],
    .dash-main,
    .dash-side {
        padding: 12px !important;
    }

    .responsive-table {
        border-collapse: separate;
        border-spacing: 0 10px;
        min-width: 0;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 14px;
        background: #fff;
    }

    .responsive-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 9px 0;
        border-bottom: 1px solid #eef2fb;
        text-align: right;
    }

    .responsive-table td:last-child {
        border-bottom: 0;
    }

    .responsive-table td::before {
        content: attr(data-label);
        flex: 0 0 96px;
        color: var(--muted);
        font-size: 0.74rem;
        font-weight: 800;
        text-align: left;
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .responsive-table td[colspan] {
        text-align: left;
    }

    .responsive-table td[colspan]::before {
        display: none;
    }
}
