:root {
    --app-bg: #071120;
    --app-bg-soft: #0c1728;
    --panel: #07101f;
    --panel-soft: #111c30;
    --panel-strong: #172945;
    --line: rgba(145, 163, 194, .2);
    --line-soft: rgba(145, 163, 194, .1);
    --input: #0b1830;
    --text: #eef4ff;
    --text-strong: #ffffff;
    --muted: #98a7bd;
    --muted-strong: #cdd8e8;
    --brand: #416a9d;
    --brand-strong: #34a5ff;
    --button: #416a9d;
    --button-hover: #4c79b0;
    --danger: #ff5b66;
    --success: #17c979;
    --warning: #ffd24d;
    --shadow: rgba(0, 0, 0, .32);
    /* Mesma paleta de status usada no AppVendas (public/appvendas/assets/appvendas.css),
       para as telas de extensões/mensalidades ficarem visualmente iguais nos dois apps. */
    --app-blue: #7da9df;
    --app-orange: #ffc15d;
    --app-red: #ff7268;
    --app-green: #51d584;
    --motion-duration-fast: 180ms;
    --motion-duration: 260ms;
    --motion-duration-slow: 360ms;
    --motion-ease: cubic-bezier(.22, 1, .36, 1);
    --motion-ease-emphasis: cubic-bezier(.16, 1, .3, 1);
    color-scheme: dark;
}

@font-face {
    font-family: "Inter";
    src: url("/assets/fonts/inter/Inter-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("/assets/fonts/inter/Inter-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("/assets/fonts/inter/Inter-SemiBold.ttf") format("truetype");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Inter";
    src: url("/assets/fonts/inter/Inter-Bold.ttf") format("truetype");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Poppins";
    src: url("/assets/fonts/poppins/Poppins-Medium.ttf") format("truetype");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

/* Ajustes finais de hierarquia da tela de Integracoes. */
.integrations-main .integration-provider-head {
    min-height: 62px;
    padding: 0 0 20px;
    border-bottom: 1px solid var(--line-soft);
}

.integrations-main .integration-provider-head > div { gap: 14px; }
.integrations-main .integration-provider-head .integration-provider-mark { width: 46px; height: 46px; border-radius: 8px; }
.integrations-main .integration-provider-head h2 { font-size: 20px; font-weight: 850; }
.integrations-main .integration-provider-head p { color: var(--muted); font-weight: 600; }

.integrations-main .integration-section { gap: 20px; border-top: 0; padding: 0; }
.integrations-main .integration-fields-grid { gap: 16px; }
.integrations-main .integration-fields-grid label { color: var(--muted-strong); font-weight: 800; }

.integrations-main .integration-environment select,
.integrations-main .integration-fields-grid input,
.integrations-main .integration-fields-grid select {
    height: 42px;
    min-height: 42px;
    margin-top: 6px;
    border-color: var(--line-soft);
    border-radius: 6px;
    background: var(--input);
    color: var(--text-strong);
    font-weight: 650;
}

.integrations-main .integration-enable { min-height: 38px; gap: 10px; color: var(--muted-strong); font-size: 12px; font-weight: 800; }
.integrations-main .integration-enable input { width: 17px; height: 17px; flex-basis: 17px; }
.integrations-main .integration-hint { margin: 4px 0 0; color: var(--muted); font-size: 12px; font-weight: 600; }

.integrations-main .integration-operation-summary,
.integrations-main .integration-token-status {
    gap: 12px;
    border-color: var(--line-soft);
    border-radius: 12px;
    padding: 20px 22px;
    background: var(--panel);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: 0 3px 12px var(--shadow);
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.integrations-main .integration-operation-summary:hover,
.integrations-main .integration-token-status:hover {
    border-color: var(--brand);
    box-shadow: 0 8px 20px var(--shadow);
    transform: translateY(-1px);
}

.integrations-main .integration-operation-summary strong {
    color: var(--text-strong);
    font-weight: 850;
    font-size: 15px;
}
.integrations-main .integration-connect-card { border-color: var(--line-soft); border-radius: 8px; padding: 18px; background: var(--panel-soft); }
.integrations-main .integration-connect-card.is-connected { border-color: var(--success); background: color-mix(in srgb, var(--success) 12%, var(--panel-soft)); }

.integrations-main .form-actions,
.integrations-main .integration-save-row,
.integrations-main .integration-connect-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding-top: 4px; }

.integrations-main .form-actions button,
.integrations-main .form-actions .button-like,
.integrations-main .integration-connect-actions button,
.integrations-main .integration-connect-actions .button-like {
    min-height: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    border-radius: 6px;
    padding: 0 15px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.integrations-main .secondary-action,
.integrations-main .button-like.secondary-action { border-color: var(--line-soft); background: var(--panel); color: var(--text-strong); }
.integrations-main .secondary-action:hover,
.integrations-main .button-like.secondary-action:hover { border-color: var(--brand); background: var(--panel-soft); }

:root[data-theme="light"] {
    --app-bg: #f4f4f5;
    --app-bg-soft: #ffffff;
    --panel: #ffffff;
    --panel-soft: #eef1f6;
    --panel-strong: #e9eef6;
    --line: rgba(16, 24, 40, .13);
    --line-soft: rgba(16, 24, 40, .08);
    --input: #f1f4f9;
    --text: #101828;
    --text-strong: #071120;
    --muted: #7a7f8c;
    --muted-strong: #5f6470;
    --brand: #416a9d;
    --brand-strong: #0f8ee8;
    --button: #416a9d;
    --button-hover: #315b8c;
    --shadow: rgba(16, 24, 40, .12);
    --app-blue: #3d6598;
    --app-orange: #f59b00;
    --app-red: #c9352b;
    --app-green: #05bf45;
    color-scheme: light;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 50% 38%, rgba(67, 106, 157, .66) 0, rgba(41, 70, 113, .48) 18%, rgba(13, 28, 54, .96) 46%, #071120 78%),
        #071120;
    font: 16px/1.45 Arial, Helvetica, sans-serif;
    overflow: hidden;
}

:root[data-theme="light"] body {
    background:
        radial-gradient(circle at 50% 38%, rgba(65, 106, 157, .2) 0, rgba(235, 241, 249, .9) 34%, #f7f8fb 78%),
        #f7f8fb;
}

body.is-dashboard {
    overflow: auto;
    background: var(--app-bg);
}

.page {
    min-height: 100svh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(100%, 354px);
    display: grid;
    justify-items: center;
    gap: 26px;
}

.brand {
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
}

.brand-logo {
    width: 72px;
    height: auto;
    max-height: 72px;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .34));
}

.login-shell > .brand .brand-logo { width: 92px; max-height: 92px; }
.user-modal .brand-logo { width: 82px; max-height: 82px; }

:root[data-theme="light"] .brand-logo {
    filter: invert(1) drop-shadow(0 2px 3px rgba(0, 0, 0, .12));
}

.brand-text {
    display: grid;
    line-height: 1;
}

.brand-text strong {
    color: rgba(255, 255, 255, .76);
    font-size: 16px;
    font-weight: 500;
}

.brand-text em {
    color: #fff;
    font-size: 16px;
    font-style: italic;
    font-weight: 800;
}

:root[data-theme="light"] .brand-text strong,
:root[data-theme="light"] .brand-text em {
    color: var(--text-strong);
}

.login-card {
    width: 100%;
    min-height: 413px;
    padding: 30px 32px 26px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(37, 63, 101, .62), rgba(14, 26, 50, .76));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 28px 80px var(--shadow);
}

:root[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, .82);
}

.login-card h1 {
    margin: 0 0 26px;
    font-size: 21px;
    line-height: 1.15;
    font-weight: 800;
    text-align: center;
}

.field {
    display: grid;
    gap: 5px;
    margin-bottom: 23px;
}

label {
    color: var(--muted-strong);
    font-size: 15px;
    font-weight: 700;
}

input {
    width: 100%;
    height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 16px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    outline: 0;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .24);
    transition: border-color .16s ease, box-shadow .16s ease;
}

input::placeholder { color: var(--muted); }
input:focus {
    border-color: rgba(91, 154, 219, .72);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .22), 0 0 0 4px rgba(33, 162, 255, .13);
}

.password-control { position: relative; }
.password-control input { padding-right: 48px; }

button,
.button-like {
    font: inherit;
}

.login-card > button,
.modal-actions button {
    width: 100%;
    height: 48px;
    margin: 3px 0 21px;
    border: 0;
    border-radius: 11px;
    color: #fff;
    background: var(--button);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 9px 18px rgba(0, 0, 0, .22);
    transition: background .16s ease, transform .16s ease;
}

.login-card > button:hover,
.modal-actions button:hover {
    background: var(--button-hover);
    transform: translateY(-1px);
}

.toggle-password {
    position: absolute;
    right: 9px;
    bottom: 7px;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    margin: 0;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    padding: 0;
    font-size: 0;
    cursor: pointer;
}

.toggle-password:hover {
    color: var(--text-strong);
    background: rgba(127, 139, 160, .12);
}

.toggle-password svg {
    width: 18px;
    height: 18px;
}

.actions {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.actions p { margin: 0; }

.alert {
    margin: -8px 0 16px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 128, 128, .28);
    border-radius: 8px;
    color: #ffd6d6;
    background: rgba(159, 36, 36, .22);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.alert.is-success {
    border-color: rgba(101, 255, 171, .24);
    color: #c9ffdf;
    background: rgba(18, 136, 58, .2);
}

a {
    color: var(--brand-strong);
    font-weight: 800;
    text-decoration: none;
}

a:hover { text-decoration: underline; }

.certificate {
    display: grid;
    grid-template-columns: 31px 1fr;
    align-items: center;
    gap: 12px;
    min-width: 191px;
    padding: 13px 22px;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--text-strong);
    background: rgba(26, 39, 66, .62);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 18px 52px var(--shadow);
}

:root[data-theme="light"] .certificate { background: rgba(255, 255, 255, .8); }

.shield {
    width: 23px;
    height: 27px;
    display: grid;
    place-items: center;
}

.shield svg {
    width: 23px;
    height: 27px;
    display: block;
}

.certificate strong {
    display: block;
    font-size: 14px;
    line-height: 1.08;
}

.certificate span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.1;
}

body:not(.is-dashboard) {
    min-height: 100dvh;
    height: 100dvh;
    color: #fff;
    background:
        radial-gradient(circle 300px at 50% 50%, rgba(37, 99, 235, .15) 0%, rgba(37, 99, 235, .08) 42%, rgba(37, 99, 235, 0) 72%),
        radial-gradient(circle at 50% 50%, #3b608f 0%, #253c5d 30%, #1a2943 50%, #0f172a 70%, #090f1b 100%);
    font-family: "Inter", Arial, sans-serif;
    overflow: hidden;
}

body:not(.is-dashboard) .page {
    min-height: 100dvh;
    height: 100dvh;
    padding: 28px 16px;
    background: transparent;
    overflow: hidden;
}

body:not(.is-dashboard) .login-shell {
    width: min(354px, calc(100% - 32px));
    gap: 24px;
}

body:not(.is-dashboard) .login-shell > .brand {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
}

body:not(.is-dashboard) .login-shell > .brand .brand-logo {
    width: 92px;
    height: 92px;
    max-height: 92px;
    object-fit: contain;
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .18));
}

:root[data-theme="light"] body:not(.is-dashboard) .login-shell > .brand .brand-logo {
    filter: drop-shadow(0 10px 24px rgba(0, 0, 0, .18));
}

body:not(.is-dashboard) .login-card {
    position: relative;
    display: grid;
    gap: 20px;
    width: 100%;
    min-height: 0;
    padding: 34px 28px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 24px;
    background: rgba(30, 41, 59, .40);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, .50);
    backdrop-filter: blur(8px);
}

body:not(.is-dashboard) .login-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .40), transparent);
    pointer-events: none;
}

:root[data-theme="light"] body:not(.is-dashboard) .login-card {
    background: rgba(30, 41, 59, .40);
}

body:not(.is-dashboard) .login-card h1 {
    margin: 0;
    padding-bottom: 8px;
    color: #fff;
    font-family: "Inter", Arial, sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: 0;
    text-align: center;
}

body:not(.is-dashboard) .login-card .field {
    gap: 8px;
    margin: 0;
}

body:not(.is-dashboard) .login-card label {
    color: #cbd5e1;
    font-family: "Inter", Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    letter-spacing: 0;
}

body:not(.is-dashboard) .login-card input {
    height: 48px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 12px;
    padding: 0 17px;
    color: #fff;
    background: rgba(2, 6, 23, .50);
    box-shadow: none;
    font-family: "Inter", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
}

body:not(.is-dashboard) .login-card input::placeholder {
    color: #64748b;
}

body:not(.is-dashboard) .login-card input:focus {
    border-color: rgba(59, 96, 143, .95);
    box-shadow: 0 0 0 4px rgba(59, 96, 143, .25);
}

body:not(.is-dashboard) .login-card .password-control input {
    padding-right: 48px;
}

body:not(.is-dashboard) .login-card .toggle-password {
    top: 8px;
    right: 8px;
    bottom: auto;
    color: #94a3b8;
    border-radius: 10px;
}

body:not(.is-dashboard) .login-card .toggle-password:hover {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

body:not(.is-dashboard) .login-card > button {
    height: 48px;
    margin: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b608f 0%, #37577e 100%);
    box-shadow: 0 10px 24px rgba(59, 96, 143, .35);
    font-family: "Inter", Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .5px;
}

body:not(.is-dashboard) .login-card > button:hover {
    background: linear-gradient(135deg, #416a9d 0%, #3b608f 100%);
    transform: translateY(-1px);
}

body:not(.is-dashboard) .login-card .actions {
    gap: 5px;
    color: #cbd5e1;
    font-family: "Inter", Arial, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    letter-spacing: 0;
}

body:not(.is-dashboard) .login-card .actions a {
    color: #38b6ff;
    font-weight: 500;
}

body:not(.is-dashboard) .login-card .alert {
    margin: 0;
    border-color: rgba(248, 113, 113, .30);
    border-radius: 12px;
    color: #fecaca;
    background: rgba(127, 29, 29, .28);
    font-family: "Inter", Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
}

body:not(.is-dashboard) .login-card .alert.is-success {
    border-color: rgba(74, 222, 128, .26);
    color: #bbf7d0;
    background: rgba(20, 83, 45, .26);
}

body:not(.is-dashboard) .certificate {
    grid-template-columns: 24px 1fr;
    gap: 12px;
    justify-self: center;
    min-width: 191px;
    margin-top: -8px;
    padding: 13px 21px;
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: 16px;
    color: #cbd5e1;
    background: rgba(255, 255, 255, .03);
    box-shadow: none;
    backdrop-filter: blur(2px);
    text-decoration: none;
}

:root[data-theme="light"] body:not(.is-dashboard) .certificate {
    background: rgba(255, 255, 255, .03);
}

body:not(.is-dashboard) .certificate:hover {
    border-color: rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .055);
    text-decoration: none;
}

body:not(.is-dashboard) .certificate .shield,
body:not(.is-dashboard) .certificate .shield svg {
    width: 24px;
    height: 24px;
}

body:not(.is-dashboard) .certificate .shield svg {
    display: block;
    color: #cbd5e1;
}

body:not(.is-dashboard) .certificate strong {
    color: #fff;
    font-family: "Inter", Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 16px;
    letter-spacing: 0;
}

body:not(.is-dashboard) .certificate span {
    color: #cbd5e1;
    font-family: "Inter", Arial, sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 15px;
    letter-spacing: 0;
}

body:not(.is-dashboard) .certificate > span:last-child {
    display: grid;
    gap: 1px;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 36%, rgba(67, 106, 157, .62) 0, rgba(41, 70, 113, .4) 24%, rgba(7, 17, 32, .94) 68%),
        rgba(7, 17, 32, .88);
}

:root[data-theme="light"] .modal-backdrop {
    background: rgba(247, 248, 251, .9);
}

.modal-backdrop.is-open { display: grid; }

.user-modal {
    width: min(100%, 430px);
    display: grid;
    justify-items: center;
    gap: 20px;
}

.modal-card {
    width: 100%;
    padding: 26px 32px 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(37, 63, 101, .74), rgba(14, 26, 50, .86));
    box-shadow: 0 34px 90px var(--shadow);
}

:root[data-theme="light"] .modal-card { background: #fff; }

.modal-card h2 {
    margin: 0 0 20px;
    font-size: 23px;
    text-align: center;
}

.modal-card .field { margin-bottom: 14px; }
.modal-card input {
    height: 39px;
    border-radius: 9px;
}

.modal-actions {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.modal-actions button {
    margin: 0;
    height: 44px;
    border-radius: 10px;
}

.modal-actions .cancel-button {
    background: #2a303b;
    box-shadow: none;
}

:root[data-theme="light"] .modal-actions .cancel-button { background: #e5e7eb; color: #111827; }
.modal-actions .cancel-button:hover { background: #343b49; }
:root[data-theme="light"] .modal-actions .cancel-button:hover { background: #d4d8df; }

.dashboard {
    width: 100%;
    min-height: 100svh;
    display: grid;
    grid-template-columns: 248px minmax(0, 1fr);
    background: var(--app-bg);
    color: var(--text);
}

.dashboard-home {
    --app-bg: #0e1728;
    --app-bg-soft: #080f1d;
    --panel: #090f1b;
    --panel-soft: #111b2d;
    --panel-strong: #121e32;
    --line: rgba(148, 163, 184, .16);
    --line-soft: rgba(148, 163, 184, .11);
    --input: #0c1627;
    --text: #d7e0ee;
    --text-strong: #f8fafc;
    --muted: #7f8ba1;
    --muted-strong: #b9c4d4;
    --brand: #1d4ed8;
    --brand-strong: #38bdf8;
    --success: #22c55e;
    --warning: #fbbf24;
    --danger: #ef4444;
    background: #0e1728;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100svh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px 18px max(12px, env(safe-area-inset-bottom));
    border-right: 1px solid rgba(148, 163, 184, .13);
    background: linear-gradient(180deg, #07101f 0%, #070d18 100%);
    overflow: hidden;
}

.sidebar > div:first-child {
    min-height: 0;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.side-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0 0 6px;
}

.logo-sidebar {
    width: 194px;
    max-height: 46px;
    object-fit: contain;
    filter: none;
}

.logo-sidebar-light { display: none; }
:root[data-theme="light"] .logo-sidebar-dark { display: none; }
:root[data-theme="light"] .logo-sidebar-light { display: block; }
.dashboard-home .logo-sidebar-dark,
:root[data-theme="light"] .dashboard-home .logo-sidebar-dark { display: block; }
.dashboard-home .logo-sidebar-light,
:root[data-theme="light"] .dashboard-home .logo-sidebar-light { display: none; }

.side-nav {
    display: grid;
    align-content: start;
    gap: 7px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 2px 10px 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .34) transparent;
}

.side-nav::-webkit-scrollbar {
    width: 6px;
}

.side-nav::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .34);
}

.side-nav::-webkit-scrollbar-track {
    background: transparent;
}

.side-nav:has(.menu-group--settings.is-open) {
    scrollbar-width: none;
}

.side-nav:has(.menu-group--settings.is-open)::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.menu-title {
    margin: 13px 10px 5px;
    color: rgba(148, 163, 184, .72);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.nav-button {
    width: 100%;
    min-height: 40px;
    display: grid;
    grid-template-columns: 20px 1fr 16px;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border: 0;
    border-radius: 10px;
    color: #8f9db2;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background .16s ease, color .16s ease, transform .16s ease;
}

a.nav-button:hover {
    text-decoration: none;
}

.nav-button svg {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    display: block;
}

.figma-icon {
    width: 18px;
    height: 18px;
    min-width: 18px;
    display: block;
}

.figma-chevron {
    width: 16px;
    height: 16px;
    display: block;
}

.figma-chevron-expanded,
.menu-group.is-open .figma-chevron-collapsed {
    display: none;
}

.menu-group.is-open .figma-chevron-expanded {
    display: block;
}

.figma-cert-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.figma-logout-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.nav-button:hover,
.nav-button:focus-visible,
.nav-button.is-active,
.menu-group.is-open > .nav-button {
    color: #f8fafc;
    background: rgba(31, 47, 74, .82);
    outline: 0;
    text-decoration: none;
    transform: translateY(-1px);
}

:root[data-theme="light"] .menu-group.is-open > .nav-button {
    color: #fff;
    background: var(--brand);
}

.nav-button .chev {
    justify-self: end;
    font-size: 20px;
    line-height: 1;
    color: currentColor;
    transition: transform .16s ease;
}

.menu-group.is-open .chev { transform: rotate(90deg); }

.submenu {
    display: none;
    position: relative;
    margin: 4px 0 8px 25px;
    padding-left: 16px;
    gap: 3px;
}

.menu-group.is-open .submenu { display: grid; }

.menu-group--settings.is-open > .submenu {
    max-height: min(318px, calc(100svh - 430px));
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .34) transparent;
}

.menu-group--settings.is-open > .submenu::-webkit-scrollbar {
    width: 6px;
}

.menu-group--settings.is-open > .submenu::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .34);
}

@media (min-width: 769px) and (max-height: 760px) {
    .menu-group--settings.is-open > .submenu {
        max-height: min(290px, calc(100svh - 390px));
    }
}

.submenu::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--line);
}

.submenu::after {
    content: "";
    position: absolute;
    left: -1px;
    top: 6px;
    width: 3px;
    height: 20px;
    border-radius: 99px;
    background: var(--brand-strong);
}

.submenu button,
.submenu a {
    width: 100%;
    min-height: 31px;
    display: flex;
    align-items: center;
    border: 0;
    border-radius: 8px;
    padding: 0 10px;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: background .16s ease, color .16s ease;
}

.submenu button:hover,
.submenu button:focus-visible,
.submenu button.is-active,
.submenu a:hover,
.submenu a:focus-visible,
.submenu a.is-active {
    color: var(--brand-strong);
    background: rgba(65, 106, 157, .45);
    outline: 0;
    text-decoration: none;
}

.submenu-group {
    display: grid;
    gap: 5px;
    padding: 4px 0 2px;
}

.submenu-group-title {
    padding: 4px 10px 2px;
    color: color-mix(in srgb, var(--muted) 78%, transparent);
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .08em;
    text-transform: uppercase;
}

:root[data-theme="light"] .submenu button.is-active,
:root[data-theme="light"] .submenu a.is-active {
    color: #fff;
    background: #111827;
}

.sidebar-bottom {
    display: grid;
    flex: 0 0 auto;
    width: calc(100% + 32px);
    align-self: end;
    gap: 0;
    min-height: 0;
    margin: 8px -16px 0;
    background: #070d18;
}

.cert-mini {
    display: grid;
    grid-template-columns: 27px 1fr;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    margin: 0 18px 10px;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 12px;
    color: var(--text-strong);
    background: rgba(15, 23, 42, .86);
}

:root[data-theme="light"] .cert-mini {
    background: #fff;
    box-shadow: 0 12px 34px rgba(16, 24, 40, .06);
}

.dashboard-home .cert-mini,
:root[data-theme="light"] .dashboard-home .cert-mini {
    background: rgba(15, 23, 42, .86);
    box-shadow: none;
}

.cert-mini .shield {
    width: 27px;
    height: 27px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
}

:root[data-theme="light"] .cert-mini .shield {
    color: var(--text-strong);
    background: #edf0f5;
}

.dashboard-home .cert-mini .shield,
:root[data-theme="light"] .dashboard-home .cert-mini .shield {
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.cert-mini .shield svg {
    width: 15px;
    height: 18px;
}

.cert-mini .shield svg path {
    stroke: currentColor;
}

.cert-mini strong {
    display: block;
    font-size: 11px;
    line-height: 1.12;
}

.cert-mini span {
    color: var(--muted);
    font-size: 10px;
}

.user-strip {
    min-height: 54px;
    display: grid;
    grid-template-columns: 28px 1fr 24px;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-top: 1px solid rgba(148, 163, 184, .13);
    color: var(--text-strong);
}

.user-strip.has-company-switch {
    grid-template-columns: 28px minmax(0, 1fr) 28px 24px;
}

.user-strip-info {
    min-width: 0;
}

.avatar {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, #c58bff, #e0b184);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    object-fit: cover;
}

.user-strip strong {
    display: block;
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-strip span {
    display: block;
    color: var(--muted);
    font-size: 11px;
}

.logout-icon {
    display: grid;
    place-items: center;
    color: var(--muted-strong);
}

.company-switch-trigger {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(70, 112, 170, .12);
    color: var(--muted-strong);
    cursor: pointer;
    transition: background .18s ease, color .18s ease, border-color .18s ease;
}

.company-switch-trigger:hover {
    border-color: rgba(70, 112, 170, .45);
    background: rgba(70, 112, 170, .2);
    color: var(--text-strong);
}

@media (min-width: 769px) and (max-height: 760px) {
    .sidebar {
        gap: 10px;
        padding-top: 18px;
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }

    .side-logo {
        margin-bottom: 2px;
    }

    .side-nav {
        gap: 5px;
        padding-bottom: 6px;
    }

    .menu-title {
        margin-top: 9px;
        margin-bottom: 3px;
    }

    .cert-mini {
        min-height: 40px;
        margin-bottom: 6px;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .user-strip {
        min-height: 50px;
        padding-top: 8px;
        padding-bottom: 8px;
    }
}

.company-switch-card {
    max-width: 560px;
}

.company-switch-actions {
    margin-top: 2px;
}

.company-switch-current-highlight {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(70, 112, 170, .25);
    border-radius: 10px;
    background: rgba(70, 112, 170, .08);
}

.company-switch-current-highlight span {
    flex-shrink: 0;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
    color: var(--brand-strong);
    background: rgba(70, 112, 170, .15);
    border-radius: 999px;
    padding: 4px 10px;
}

.company-switch-current-highlight strong {
    flex: 1;
    min-width: 0;
    color: var(--text-strong);
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-switch-current-highlight small {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 12px;
}

.company-switch-list {
    margin-top: 14px;
    padding: 6px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--panel);
}

.company-switch-row {
    display: flex;
    align-items: center;
    gap: 4px;
    border-radius: 9px;
    transition: background .12s ease;
}

.company-switch-row:hover {
    background: rgba(70, 112, 170, .08);
}

.company-switch-row-select {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
    padding: 9px 12px;
    border: none;
    border-radius: 9px;
    background: none;
    text-align: left;
    cursor: pointer;
}

.company-switch-row-select strong {
    font-size: 13.5px;
    color: var(--text-strong);
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-switch-row-select small {
    color: var(--muted);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.company-switch-row .icon-button {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    margin-right: 4px;
    border: none;
    border-radius: 8px;
    background: none;
    color: var(--muted);
}

.company-switch-row .icon-button svg {
    width: 17px;
    height: 17px;
}

.company-switch-row .icon-button:hover {
    background: rgba(217, 45, 32, .12);
    color: #d92d20;
}

.dash-main {
    min-width: 0;
    padding: 29px 30px 28px;
    background: #0e1728;
}

.dashboard-welcome-main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
}

.dashboard-welcome-card {
    width: min(100%, 420px);
    display: grid;
    justify-items: center;
    gap: 16px;
    padding: 40px 36px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(37, 63, 101, .74), rgba(14, 26, 50, .86));
    box-shadow: 0 34px 90px var(--shadow);
}

:root[data-theme="light"] .dashboard-welcome-card { background: #fff; }

.dashboard-welcome-logo {
    max-width: 160px;
    max-height: 160px;
    object-fit: contain;
}

.dashboard-welcome-card h2 {
    margin: 0;
    font-size: 23px;
    color: var(--text-strong);
}

.dashboard-welcome-card p {
    margin: 0;
    color: var(--text-muted, var(--text));
}

.dash-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 24px;
}

.dash-top h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 30px;
    line-height: 1.1;
}

.dash-top p {
    margin: 7px 0 0;
    color: #9aa6b8;
    font-size: 14px;
    font-weight: 700;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.search-box {
    width: min(360px, 32vw);
    height: 42px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 12px;
    background: #090f1b;
    color: #77849a;
    font-size: 13px;
}

.icon-button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, .12);
    border-radius: 12px;
    background: #090f1b;
    color: var(--muted-strong);
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}

.icon-button:hover {
    color: var(--text-strong);
    background: var(--panel-soft);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.stat-card,
.chart-card,
.recent-card {
    border: 1px solid rgba(148, 163, 184, .11);
    border-radius: 20px;
    background: #090f1b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 18px 45px rgba(2, 6, 23, .16);
}

:root[data-theme="light"] .stat-card,
:root[data-theme="light"] .chart-card,
:root[data-theme="light"] .recent-card {
    box-shadow: 0 12px 34px rgba(16, 24, 40, .05);
}

.stat-card {
    min-height: 132px;
    padding: 20px;
    position: relative;
}

.stat-card small {
    display: block;
    color: #a6b1c3;
    font-size: 13px;
    margin-bottom: 25px;
}

.stat-card strong {
    display: block;
    color: var(--text-strong);
    font-size: 25px;
    line-height: 1;
}

.stat-card span {
    display: block;
    margin-top: 12px;
    color: var(--success);
    font-size: 12px;
    font-weight: 800;
}

.stat-card span.is-down { color: var(--danger); }
.stat-card span.is-neutral { color: #8b97a9; }

.stat-icon {
    position: absolute;
    top: 17px;
    right: 17px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(56, 189, 248, .16);
    border-radius: 11px;
    color: #38bdf8;
    background: rgba(15, 23, 42, .9);
}

.stat-icon svg {
    width: 19px;
    height: 19px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 2.15fr) minmax(290px, .9fr);
    gap: 18px;
    align-items: stretch;
}

.chart-card,
.recent-card {
    height: clamp(420px, calc(100svh - 260px), 620px);
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.chart-card,
.recent-card {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 62px;
    margin-bottom: 0;
    padding: 0 22px;
    border-bottom: 1px solid rgba(148, 163, 184, .11);
}

.card-head h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 16px;
    font-weight: 850;
}

.card-head a {
    color: #38bdf8;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.bars {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    align-items: end;
    gap: clamp(10px, 2vw, 24px);
    padding: 34px 20px 8px;
}

.bar-pair {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.bar-group {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    width: 100%;
    justify-content: center;
}

.bar {
    width: clamp(28px, 4.3vw, 56px);
    border-radius: 4px 4px 0 0;
    background: #31557f;
}

.bar.is-bright { background: #3190c9; }

.bar-pair small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.revenue-chart {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    padding: 14px 22px 18px;
    gap: 10px;
}

.revenue-chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 38px;
    margin: 0 0 2px;
    flex-wrap: wrap;
}

.revenue-fonte-select {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(148, 163, 184, .18);
    background: #0f1729 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'><path d='M4 6l4 4 4-4' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>") no-repeat right 10px center;
    background-size: 12px;
    color: var(--text-strong);
    font-size: 11.5px;
    font-weight: 700;
    padding: 8px 30px 8px 12px;
    border-radius: 10px;
    cursor: pointer;
}

.revenue-fonte-select:focus { outline: 2px solid rgba(14, 165, 233, .4); outline-offset: 1px; }

.revenue-chart-periods {
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 12px;
    background: #0f1729;
    border: 1px solid rgba(148, 163, 184, .11);
    overflow-x: auto;
}

.revenue-period-btn {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.revenue-period-btn:hover { color: var(--text-strong); }

.revenue-period-btn.is-active {
    color: #fff;
    background: linear-gradient(135deg, #0284c7, #14b8a6);
    box-shadow: 0 4px 12px rgba(14, 165, 233, .35);
}

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

.revenue-chart-summary div {
    display: grid;
    gap: 2px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, .08);
    border-radius: 12px;
    background: rgba(15, 23, 42, .56);
}

.revenue-chart-summary small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.revenue-chart-summary strong {
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 800;
}

.revenue-chart-summary strong.is-down { color: var(--danger); }
.revenue-chart-summary div:last-child strong:not(.is-down) { color: #10b981; }
.revenue-chart-summary div:nth-child(1) strong { color: #8b5cf6; }
.revenue-chart-summary div:nth-child(2) strong { color: #0ea5e9; }

.revenue-chart-canvas {
    position: relative;
    min-height: 0;
    width: 100%;
    height: 100%;
    min-height: 260px;
    padding: 2px 0 0;
}

.revenue-chart-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.revenue-chart-grid line {
    stroke: rgba(148, 163, 184, .12);
    stroke-width: 1;
    stroke-dasharray: 4 6;
}

.revenue-chart-axis-label {
    fill: #748299;
    font-size: 10px;
    font-weight: 600;
}

.revenue-chart-axis-label.is-x-axis {
    font-size: 10.5px;
    fill: var(--muted-strong);
}

.revenue-chart-axis-line {
    stroke: rgba(148, 163, 184, .26);
    stroke-width: 1.2;
}

.revenue-chart-area {
    pointer-events: none;
}

.revenue-chart-line {
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.revenue-chart-line.is-previsto {
    stroke: #64748b;
    stroke-width: 1.8;
    stroke-dasharray: 3 4;
    opacity: .75;
}

.revenue-chart-line.is-recebido {
    stroke: #14b8a6;
}

.revenue-chart-dot {
    pointer-events: none;
    transition: r var(--motion-duration-fast) var(--motion-ease);
}

.revenue-chart-dot.is-previsto {
    fill: #64748b;
    opacity: .75;
}

.revenue-chart-dot.is-recebido {
    fill: var(--panel);
    stroke: #14b8a6;
    stroke-width: 2;
}

.revenue-chart-hover-band {
    stroke: rgba(148, 163, 184, .3);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    pointer-events: none;
}

.revenue-chart-overlay rect { cursor: pointer; }

.revenue-chart-overlay rect:hover { fill: transparent; }

.revenue-chart-canvas.is-loading { opacity: .55; pointer-events: none; }

.revenue-chart-tooltip {
    position: absolute;
    z-index: 3;
    transform: translate(-50%, -120%);
    min-width: 168px;
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel-strong);
    box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    pointer-events: none;
    display: grid;
    gap: 5px;
}

.revenue-chart-tooltip.is-right-aligned { transform: translate(-90%, -120%); }

.revenue-chart-tooltip strong {
    color: var(--text-strong);
    font-size: 12.5px;
}

.revenue-chart-tooltip span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
}

.revenue-chart-tooltip span b {
    margin-left: auto;
    color: var(--text-strong);
    font-weight: 700;
}

.revenue-chart-legend {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.revenue-chart-legend span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.legend-dot.is-recebido { background: linear-gradient(90deg, #14b8a6, #0ea5e9); }
.legend-dot.is-previsto { background: #64748b; }

.recent-list {
    display: grid;
    align-content: start;
    gap: 0;
    overflow: auto;
}

.sale-row {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) minmax(82px, auto);
    align-items: center;
    gap: 12px;
    min-height: 75px;
    padding: 0 22px;
    border-bottom: 1px solid rgba(148, 163, 184, .09);
}

.sale-row:last-child { border-bottom: 0; }

.sale-avatar {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(56, 189, 248, .13);
    color: #38bdf8;
}

.sale-client {
    min-width: 0;
    display: grid;
    gap: 3px;
    align-content: center;
}

.sale-row strong {
    display: block;
    color: var(--text-strong);
    font-size: 13px;
    line-height: 1.25;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.sale-row small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.sale-value {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 4px;
    color: var(--text-strong);
    text-align: right;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.dashboard:not(.dashboard-home) {
    grid-template-columns: 268px minmax(0, 1fr);
}

.dashboard:not(.dashboard-home) .sidebar {
    gap: 12px;
    padding: 24px 16px 0;
    border-right: 1px solid var(--line);
    background: var(--app-bg-soft);
}

.dashboard:not(.dashboard-home) .logo-sidebar {
    width: 206px;
    max-height: 48px;
}

.dashboard:not(.dashboard-home) .side-nav {
    gap: 8px;
}

.dashboard:not(.dashboard-home) .menu-title {
    margin: 12px 10px 4px;
    color: var(--muted);
}

.dashboard:not(.dashboard-home) .nav-button {
    min-height: 42px;
    border-radius: 8px;
    color: var(--muted-strong);
    font-size: 15px;
}

.dashboard:not(.dashboard-home) .nav-button:hover,
.dashboard:not(.dashboard-home) .nav-button:focus-visible,
.dashboard:not(.dashboard-home) .nav-button.is-active,
.dashboard:not(.dashboard-home) .menu-group.is-open > .nav-button {
    color: var(--text-strong);
    background: var(--panel-soft);
}

.menu-group--rotacerta > .nav-button {
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    background: #eff6ff;
}
.rotacerta-menu-logo {
    display: block;
    width: 27px;
    height: 27px;
    min-width: 27px;
    border-radius: 5px;
    object-fit: cover;
}
.dashboard:not(.dashboard-home) .menu-group--rotacerta > .nav-button:hover,
.dashboard:not(.dashboard-home) .menu-group--rotacerta > .nav-button:focus-visible,
.dashboard:not(.dashboard-home) .menu-group--rotacerta.is-open > .nav-button {
    border-color: #2563ea;
    color: #fff;
    background: #2563ea;
    box-shadow: 0 5px 12px rgba(37, 99, 234, .2);
}
.menu-group--rotacerta .submenu::before { background: #bfdbfe; }
.menu-group--rotacerta .submenu::after { background: #2563ea; }
.menu-group--rotacerta .submenu button:hover,
.menu-group--rotacerta .submenu button:focus-visible,
.menu-group--rotacerta .submenu a:hover,
.menu-group--rotacerta .submenu a:focus-visible {
    color: #1d4ed8;
    background: #eff6ff;
}
:root[data-theme="light"] .menu-group--rotacerta .submenu button.is-active,
:root[data-theme="light"] .menu-group--rotacerta .submenu a.is-active {
    color: #fff;
    background: #2563ea;
}
:root[data-theme="dark"] .dashboard .menu-group--rotacerta > .nav-button {
    border-color: #1e3a8a;
    color: #dbeafe;
    background: #172554;
}
:root[data-theme="dark"] .dashboard .menu-group--rotacerta > .nav-button:hover,
:root[data-theme="dark"] .dashboard .menu-group--rotacerta > .nav-button:focus-visible,
:root[data-theme="dark"] .dashboard .menu-group--rotacerta.is-open > .nav-button {
    border-color: #3b82f6;
    color: #fff;
    background: #2563ea;
}
:root[data-theme="dark"] .menu-group--rotacerta .submenu button:hover,
:root[data-theme="dark"] .menu-group--rotacerta .submenu button:focus-visible,
:root[data-theme="dark"] .menu-group--rotacerta .submenu a:hover,
:root[data-theme="dark"] .menu-group--rotacerta .submenu a:focus-visible {
    color: #dbeafe;
    background: #1e3a8a;
}
:root[data-theme="dark"] .menu-group--rotacerta .submenu button.is-active,
:root[data-theme="dark"] .menu-group--rotacerta .submenu a.is-active {
    color: #fff;
    background: #2563ea;
}

.dashboard:not(.dashboard-home) .sidebar-bottom {
    background: var(--app-bg-soft);
}

.dashboard:not(.dashboard-home) .cert-mini {
    margin: 0 16px 8px;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: rgba(255, 255, 255, .03);
}

:root[data-theme="light"] .dashboard:not(.dashboard-home) .cert-mini {
    background: #fff;
    box-shadow: 0 12px 34px rgba(16, 24, 40, .06);
}

:root[data-theme="light"] .dashboard:not(.dashboard-home) .cert-mini .shield {
    color: var(--text-strong);
    background: #edf0f5;
}

.dashboard:not(.dashboard-home) .user-strip {
    height: 48px;
    padding: 8px 16px;
    border-top: 1px solid var(--line);
}

.dashboard:not(.dashboard-home) .dash-main {
    padding: 34px 32px 28px;
    background: transparent;
}

.dashboard:not(.dashboard-home) .dash-top {
    margin-bottom: 30px;
}

.dashboard:not(.dashboard-home) .dash-top h1 {
    font-size: 28px;
}

.dashboard:not(.dashboard-home) .dash-top p {
    margin: 4px 0 0;
    color: var(--muted);
}

.dashboard:not(.dashboard-home) .search-box,
.dashboard:not(.dashboard-home) .icon-button {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
}

.dashboard:not(.dashboard-home) .search-box {
    color: var(--muted);
}

.dashboard:not(.dashboard-home) .stats-grid {
    gap: 20px;
    margin-bottom: 30px;
}

.dashboard:not(.dashboard-home) .stat-card,
.dashboard:not(.dashboard-home) .chart-card,
.dashboard:not(.dashboard-home) .recent-card {
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .02);
}

:root[data-theme="light"] .dashboard:not(.dashboard-home) .stat-card,
:root[data-theme="light"] .dashboard:not(.dashboard-home) .chart-card,
:root[data-theme="light"] .dashboard:not(.dashboard-home) .recent-card {
    box-shadow: 0 12px 34px rgba(16, 24, 40, .05);
}

.dashboard:not(.dashboard-home) .stat-card {
    min-height: 126px;
}

.dashboard:not(.dashboard-home) .stat-card small {
    color: var(--muted-strong);
    margin-bottom: 24px;
}

.dashboard:not(.dashboard-home) .stat-card strong {
    font-size: 26px;
}

.dashboard:not(.dashboard-home) .stat-icon {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    color: var(--brand-strong);
    background: rgba(52, 165, 255, .18);
}

.dashboard:not(.dashboard-home) .dashboard-grid {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 20px;
}

.dashboard:not(.dashboard-home) .chart-card,
.dashboard:not(.dashboard-home) .recent-card {
    height: clamp(360px, calc(100svh - 300px), 560px);
}

.dashboard:not(.dashboard-home) .card-head {
    min-height: 58px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line-soft);
}

.dashboard:not(.dashboard-home) .card-head h2 {
    font-size: 17px;
    font-weight: 700;
}

.dashboard:not(.dashboard-home) .card-head a {
    color: var(--brand-strong);
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
}

.dashboard:not(.dashboard-home) .recent-list {
    overflow: hidden;
}

.dashboard:not(.dashboard-home) .sale-row {
    grid-template-columns: 34px 1fr auto;
    min-height: 72px;
    padding: 0 20px;
    border-bottom: 1px solid var(--line-soft);
}

.dashboard:not(.dashboard-home) .sale-avatar {
    width: 29px;
    height: 29px;
    background: rgba(52, 165, 255, .18);
    color: var(--brand-strong);
}

.dashboard-home {
    font-family: "Inter";
    background: var(--app-bg);
}

:root[data-theme="dark"] .dashboard-home {
    --app-bg: #0e1728;
    --app-bg-soft: #080f1d;
    --panel: #090f1b;
    --panel-soft: #111b2d;
    --panel-strong: #121e32;
    --line: rgba(148, 163, 184, .16);
    --line-soft: rgba(148, 163, 184, .11);
    --input: #0c1627;
    --text: #d7e0ee;
    --text-strong: #f8fafc;
    --muted: #7f8ba1;
    --muted-strong: #b9c4d4;
    --brand: #1d4ed8;
    --brand-strong: #38bdf8;
    --success: #22c55e;
    --warning: #fbbf24;
    --danger: #ef4444;
    --home-sidebar-bg: linear-gradient(180deg, #07101f 0%, #070d18 100%);
    --home-sidebar-bottom-bg: #070d18;
    --home-card-bg: #090f1b;
    --home-inner-bg: rgba(15, 23, 42, .56);
    --home-control-bg: #090f1b;
    --home-pill-bg: #0f1729;
    --home-icon-bg: rgba(15, 23, 42, .9);
    --home-icon-border: rgba(56, 189, 248, .16);
    --home-nav-text: #8f9db2;
    --home-nav-active-bg: #3B608F;
    --home-heading-subtle: #9aa6b8;
    --home-card-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 18px 45px rgba(2, 6, 23, .16);
    --figma-icon-primary: #f8fafc;
    --figma-icon-secondary: #cbd5e1;
    --figma-icon-muted: #94a3b8;
    --figma-icon-accent: #38b6ff;
    --figma-icon-positive: #02bd37;
    --figma-icon-negative: var(--danger);
}

:root[data-theme="light"] .dashboard-home {
    --app-bg: #f5f7fb;
    --app-bg-soft: #ffffff;
    --panel: #ffffff;
    --panel-soft: #eef3f9;
    --panel-strong: #ffffff;
    --line: rgba(15, 23, 42, .14);
    --line-soft: rgba(15, 23, 42, .09);
    --input: #f1f5f9;
    --text: #334155;
    --text-strong: #0f172a;
    --muted: #64748b;
    --muted-strong: #475569;
    --brand: #2563eb;
    --brand-strong: #0284c7;
    --success: #16a34a;
    --warning: #b45309;
    --danger: #dc2626;
    --home-sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --home-sidebar-bottom-bg: #ffffff;
    --home-card-bg: #ffffff;
    --home-inner-bg: #f8fafc;
    --home-control-bg: #ffffff;
    --home-pill-bg: #f1f5f9;
    --home-icon-bg: #f1f8ff;
    --home-icon-border: rgba(2, 132, 199, .14);
    --home-nav-text: #64748b;
    --home-nav-active-bg: #3B608F;
    --home-heading-subtle: #64748b;
    --home-card-shadow: 0 14px 35px rgba(15, 23, 42, .07);
    --figma-icon-primary: #0f172a;
    --figma-icon-secondary: #475569;
    --figma-icon-muted: #64748b;
    --figma-icon-accent: #0284c7;
    --figma-icon-positive: #02bd37;
    --figma-icon-negative: var(--danger);
}

.dashboard-home .sidebar {
    border-right-color: var(--line);
    background: var(--home-sidebar-bg);
}

.dashboard-home .sidebar-bottom {
    background: var(--home-sidebar-bottom-bg);
}

:root[data-theme="dark"] .dashboard-home .logo-sidebar-dark { display: block; }
:root[data-theme="dark"] .dashboard-home .logo-sidebar-light { display: none; }
:root[data-theme="light"] .dashboard-home .logo-sidebar-dark { display: none; }
:root[data-theme="light"] .dashboard-home .logo-sidebar-light { display: block; }

.dashboard-home .menu-title {
    color: color-mix(in srgb, var(--muted) 78%, transparent);
}

.dashboard-home .nav-button {
    color: var(--home-nav-text);
}

.dashboard-home .nav-button:hover,
.dashboard-home .nav-button:focus-visible {
    color: var(--text-strong);
    background: color-mix(in srgb, var(--home-nav-active-bg) 22%, transparent);
}

.dashboard-home .nav-button.is-active,
.dashboard-home .menu-group.is-open > .nav-button {
    color: #FFFFFF;
    background: var(--home-nav-active-bg);
}

.dashboard-home .cert-mini {
    border-color: var(--line-soft);
    background: var(--home-inner-bg);
    box-shadow: none;
}

:root[data-theme="light"] .dashboard-home .cert-mini,
:root[data-theme="dark"] .dashboard-home .cert-mini {
    background: var(--home-inner-bg);
    box-shadow: none;
}

.dashboard-home .cert-mini .shield {
    color: var(--brand-strong);
    background: var(--home-icon-bg);
}

:root[data-theme="light"] .dashboard-home .cert-mini .shield,
:root[data-theme="dark"] .dashboard-home .cert-mini .shield {
    color: var(--brand-strong);
    background: var(--home-icon-bg);
}

.dashboard-home .user-strip {
    border-top-color: var(--line);
}

.dashboard-home .dash-main {
    background: var(--app-bg);
}

.dashboard-home .dash-top p {
    color: var(--home-heading-subtle);
}

.dashboard-home .search-box,
.dashboard-home .icon-button {
    border-color: var(--line-soft);
    background: var(--home-control-bg);
}

.dashboard-home .search-box {
    color: var(--muted);
}

.dashboard-home .theme-icon-light { display: none; }
:root[data-theme="dark"] .dashboard-home .theme-icon-dark { display: none; }
:root[data-theme="dark"] .dashboard-home .theme-icon-light { display: block; }

.dashboard-home .stat-card,
.dashboard-home .chart-card,
.dashboard-home .recent-card {
    border-color: var(--line-soft);
    background: var(--home-card-bg);
    box-shadow: var(--home-card-shadow);
}

.dashboard-home .revenue-chart-dot.is-recebido {
    fill: var(--home-card-bg);
}

.dashboard-home .stat-card small {
    color: var(--muted-strong);
}

.dashboard-home .stat-icon {
    border-color: var(--home-icon-border);
    color: var(--brand-strong);
    background: var(--home-icon-bg);
}

.dashboard-home .stat-card span.is-neutral {
    color: var(--muted);
}

.dashboard-home .card-head {
    border-bottom-color: var(--line-soft);
}

.dashboard-home .card-head a {
    color: var(--brand-strong);
}

.dashboard-home .revenue-chart-periods,
.dashboard-home .revenue-chart-summary div {
    border-color: var(--line-soft);
    background: var(--home-pill-bg);
}

.dashboard-home .revenue-fonte-select {
    border-color: var(--line-soft);
    background-color: var(--home-pill-bg);
    color: var(--text-strong);
}

.dashboard-home .revenue-chart-grid line {
    stroke: var(--line-soft);
}

.dashboard-home .revenue-chart-axis-label {
    fill: var(--muted);
}

.dashboard-home .sale-row {
    border-bottom-color: var(--line-soft);
}

.dashboard-home .sale-avatar {
    color: var(--brand-strong);
    background: var(--home-icon-bg);
}

.dashboard-home .recent-card .badge {
    border: 1px solid rgba(34, 197, 94, .28);
    color: #22c55e;
    background: rgba(34, 197, 94, .12);
}

.dashboard-home .recent-card .badge.is-pending {
    border-color: rgba(251, 191, 36, .32);
    color: var(--warning);
    background: rgba(251, 191, 36, .13);
}

:root[data-theme="light"] .dashboard-home .recent-card .badge {
    border-color: rgba(22, 163, 74, .24);
    color: #15803d;
    background: #dcfce7;
}

:root[data-theme="light"] .dashboard-home .recent-card .badge.is-pending {
    border-color: rgba(217, 119, 6, .24);
    color: #b45309;
    background: #fef3c7;
}

.dashboard-home .dash-top h1 {
    font-family: "Inter";
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 0;
}

.dashboard-home .dash-top p {
    font-family: "Inter";
    font-size: 14px;
    font-weight: 400;
    letter-spacing: 0;
}

.dashboard-home .menu-title {
    font-family: "Inter";
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
}

.dashboard-home .nav-button,
.dashboard-home .submenu button,
.dashboard-home .submenu a {
    font-family: "Inter";
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.dashboard-home .user-strip strong {
    font-family: "Inter";
    font-size: 13px;
    font-weight: 600;
}

.dashboard-home .user-strip span {
    font-family: "Inter";
    font-size: 11px;
    font-weight: 400;
}

.dashboard-home .search-box {
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
}

.dashboard-home .stat-card small {
    font-family: "Inter";
    font-size: 13px;
    font-weight: 500;
}

.dashboard-home .stat-card strong {
    font-family: "Inter";
    font-size: 24px;
    font-weight: 700;
}

.dashboard-home .stat-card span {
    font-family: "Inter";
    font-size: 12px;
    font-weight: 400;
}

.dashboard-home .card-head h2 {
    font-family: "Inter";
    font-size: 16px;
    font-weight: 600;
}

.dashboard-home .card-head a,
.dashboard-home .revenue-period-btn,
.dashboard-home .revenue-chart-summary,
.dashboard-home .revenue-chart-legend,
.dashboard-home .sale-row {
    font-family: "Inter";
}

.dashboard-home .nav-button svg {
    width: 18px !important;
    height: 18px !important;
}

.dashboard-home .figma-icon {
    width: 18px;
    height: 18px;
    display: block;
    flex: 0 0 18px;
}

.dashboard-home .nav-button .chev {
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    font-size: 0;
    transform: none;
}

.dashboard-home .menu-group.is-open .chev {
    transform: none;
}

.dashboard-home .figma-chevron {
    width: 16px;
    height: 16px;
    display: block;
}

.dashboard-home .figma-chevron-expanded,
.dashboard-home .menu-group.is-open .figma-chevron-collapsed {
    display: none;
}

.dashboard-home .menu-group.is-open .figma-chevron-expanded {
    display: block;
}

.dashboard-home .search-box svg,
.dashboard-home .figma-search-icon {
    width: 16px !important;
    height: 16px !important;
    display: block;
}

.dashboard-home .icon-button svg,
.dashboard-home .figma-theme-icon {
    width: 20px !important;
    height: 20px !important;
    display: block;
}

.dashboard-home .figma-icon--theme-sun {
    display: none;
}

:root[data-theme="dark"] .dashboard-home .figma-icon--theme-moon {
    display: none;
}

:root[data-theme="dark"] .dashboard-home .figma-icon--theme-sun {
    display: block;
}

.dashboard-home .stat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--home-icon-border);
    background: var(--home-icon-bg);
}

.dashboard-home .stat-icon svg,
.dashboard-home .figma-card-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.dashboard-home .stat-card span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.dashboard-home .figma-trend-icon {
    width: 14px;
    height: 14px;
    display: block;
    flex: 0 0 14px;
}

.dashboard-home .sale-avatar svg,
.dashboard-home .figma-recent-user-icon {
    width: 16px !important;
    height: 16px !important;
    display: block;
}

.dashboard-home .logout-icon svg,
.dashboard-home .figma-logout-icon {
    width: 20px !important;
    height: 20px !important;
    display: block;
}

.dashboard-home .figma-cert-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.dashboard-home .figma-icon {
    display: block;
    flex: 0 0 auto;
    color: inherit;
}

.dashboard-home .figma-icon[hidden] {
    display: none !important;
}

.dashboard-home .figma-icon--sidebar {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    color: var(--figma-icon-secondary);
}

.dashboard-home .nav-button:hover .figma-icon--sidebar,
.dashboard-home .nav-button:focus-visible .figma-icon--sidebar {
    color: var(--figma-icon-primary);
}

.dashboard-home .nav-button.is-active .figma-icon--sidebar,
.dashboard-home .menu-group.is-open > .nav-button .figma-icon--sidebar {
    color: #FFFFFF;
}

.dashboard-home .nav-button .figma-icon--chevron {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    color: var(--figma-icon-muted);
    transition: transform .16s ease, color .16s ease;
}

.dashboard-home .menu-group.is-open > .nav-button .figma-icon--chevron {
    color: #FFFFFF;
    transform: rotate(90deg);
}

.dashboard-home .figma-chevron-expanded,
.dashboard-home .menu-group.is-open .figma-chevron-collapsed {
    display: none;
}

.dashboard-home .menu-group.is-open .figma-chevron-expanded {
    display: block;
}

.dashboard-home .figma-icon--logout {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    color: var(--figma-icon-muted);
}

.dashboard-home .logout-icon:hover .figma-icon--logout,
.dashboard-home .logout-icon:focus-visible .figma-icon--logout {
    color: var(--figma-icon-secondary);
}

.dashboard-home .figma-icon--cert {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    color: var(--figma-icon-accent);
}

.dashboard-home .figma-icon--search {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    color: var(--figma-icon-muted);
}

.dashboard-home .figma-icon--theme {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    color: var(--figma-icon-muted);
}

.dashboard-home .icon-button .figma-icon--theme-sun {
    display: none !important;
}

:root[data-theme="dark"] .dashboard-home .icon-button .figma-icon--theme-moon {
    display: none !important;
}

:root[data-theme="dark"] .dashboard-home .icon-button .figma-icon--theme-sun {
    display: block !important;
}

:root[data-theme="light"] .dashboard-home .icon-button .figma-icon--theme-moon {
    display: block !important;
}

:root[data-theme="light"] .dashboard-home .icon-button .figma-icon--theme-sun {
    display: none !important;
}

.dashboard-home .icon-button:hover .figma-icon--theme,
.dashboard-home .icon-button:focus-visible .figma-icon--theme {
    color: var(--figma-icon-secondary);
}

.dashboard-home .figma-icon--card {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px;
    color: var(--figma-icon-accent);
}

.dashboard-home .figma-icon--trend {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px;
    color: var(--figma-icon-positive);
}

.dashboard-home .stat-card span.is-down .figma-icon--trend {
    color: var(--figma-icon-negative);
}

.dashboard-home .figma-icon--recent-user {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    color: var(--figma-icon-accent);
}

.page-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 22px;
    margin-bottom: 30px;
}

.page-top > div:first-child {
    flex: 0 0 auto;
    min-width: max-content;
}

.page-top h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 28px;
    line-height: 1.1;
    white-space: nowrap;
}

.page-top p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.list-actions,
.form-actions {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
    white-space: nowrap;
}

.bulk-options {
    position: relative;
    flex: 0 0 auto;
}

.bulk-options-toggle {
    min-width: 104px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid #c9d5e8;
    border-radius: 10px;
    background: linear-gradient(180deg, #fff, #f5f8fc);
    color: var(--brand);
    box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
    font-weight: 900;
}

.bulk-options-toggle::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.bulk-options-toggle:hover,
.bulk-options.is-open .bulk-options-toggle {
    border-color: rgba(48, 101, 164, .45);
    background: #eef4ff;
    transform: translateY(-1px);
}

.bulk-options-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 80;
    min-width: 178px;
    display: none;
    padding: 6px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .16);
}

.bulk-options.is-open .bulk-options-menu {
    display: grid;
    gap: 4px;
}

.bulk-options-menu button {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-strong);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
}

.bulk-options-menu button:hover,
.bulk-options-menu button:focus-visible {
    background: #eef4ff;
    outline: 0;
}

.search-input {
    width: clamp(280px, 30vw, 430px);
    height: 44px;
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    color: var(--muted);
    background: var(--panel);
}

.search-input svg {
    width: 18px;
    height: 18px;
}

.search-input input {
    height: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text-strong);
    font-size: 13px;
}

.order-origin-filter {
    width: 128px;
    height: 44px;
    margin: 0;
    padding: 0 36px 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background-color: var(--panel);
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 850;
}

.receivable-top-actions .search-input {
    width: clamp(300px, 32vw, 470px);
}

.lembrete-contas-pagar-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.lembrete-contas-pagar-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
}

.lembrete-contas-pagar-switch-track {
    width: 36px;
    height: 20px;
    border-radius: 999px;
    background: var(--panel-strong);
    border: 1px solid var(--line);
    position: relative;
    transition: background .15s ease;
    flex: none;
}

.lembrete-contas-pagar-switch-thumb {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--muted-strong);
    transition: transform .15s ease, background .15s ease;
}

.lembrete-contas-pagar-switch input:checked + .lembrete-contas-pagar-switch-track {
    background: var(--success);
    border-color: var(--success);
}

.lembrete-contas-pagar-switch input:checked + .lembrete-contas-pagar-switch-track .lembrete-contas-pagar-switch-thumb {
    transform: translateX(16px);
    background: #fff;
}

.lembrete-contas-pagar-switch-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--muted-strong);
    white-space: nowrap;
}

.lembrete-contas-pagar-modal-list {
    display: grid;
    gap: 10px;
    max-height: 340px;
    overflow-y: auto;
    margin: 12px 0;
}

.lembrete-contas-pagar-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
}

.lembrete-contas-pagar-modal-item div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.lembrete-contas-pagar-modal-item strong {
    font-size: 13px;
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lembrete-contas-pagar-modal-item small {
    font-size: 12px;
    color: var(--muted);
}

.lembrete-contas-pagar-modal-item b {
    color: var(--warning);
    white-space: nowrap;
}

.lembrete-contas-pagar-fixo {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 18px 10px;
    padding: 8px 10px;
    border: 1px solid rgba(148, 163, 184, .14);
    border-radius: 12px;
    background: rgba(15, 23, 42, .86);
    text-decoration: none;
}

:root[data-theme="light"] .lembrete-contas-pagar-fixo {
    background: #fff;
    box-shadow: 0 12px 34px rgba(16, 24, 40, .06);
}

.lembrete-fixo-pill {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.lembrete-fixo-pill.is-hoje {
    background: rgba(234, 179, 8, .18);
    color: #eab308;
}

.lembrete-fixo-pill.is-amanha {
    background: rgba(52, 165, 255, .18);
    color: var(--brand-strong);
}

.lembrete-fixo-pill.is-depois {
    background: rgba(148, 163, 184, .18);
    color: var(--muted-strong);
}

.filter-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(2, 8, 23, .66);
    backdrop-filter: blur(8px);
}

.filter-modal.is-open {
    display: grid;
}

.receivable-filters {
    width: min(760px, 100%);
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 16px;
    padding: 24px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 20px;
    background: var(--list-surface, var(--panel));
    box-shadow: 0 28px 80px rgba(2, 8, 23, .28);
    font-family: "Poppins";
    letter-spacing: 0;
}

:root[data-theme="light"] .filter-modal {
    background: rgba(15, 23, 42, .34);
}

.filter-modal-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--list-border, var(--line-soft));
}

.filter-modal-head h2 {
    margin: 0;
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
}

.filter-modal-head p {
    margin: 5px 0 0;
    color: var(--list-text-secondary, var(--muted));
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
}

.filter-modal-head button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    color: var(--list-text-primary, var(--text-strong));
    background: var(--list-surface-soft, var(--panel-soft));
    font-size: 23px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
}

.receivable-filters label {
    display: grid;
    gap: 7px;
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0;
}

.receivable-filters input,
.receivable-filters select {
    width: 100%;
    height: 44px;
    min-width: 0;
    padding: 0 12px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    color: var(--list-text-primary, var(--text-strong));
    background: var(--list-surface, var(--input));
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.receivable-filter-actions {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.bulk-edit-drawer {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    justify-content: flex-end;
    background: rgba(15, 23, 42, .45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
}

.bulk-edit-drawer.is-open {
    opacity: 1;
    pointer-events: auto;
}

.bulk-edit-drawer-panel {
    display: flex;
    flex-direction: column;
    width: min(420px, 100%);
    height: 100%;
    background: var(--list-surface, var(--card));
    box-shadow: -8px 0 24px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    transition: transform .2s ease;
    overflow-y: auto;
}

.bulk-edit-drawer.is-open .bulk-edit-drawer-panel {
    transform: translateX(0);
}

.bulk-edit-drawer-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--list-border, var(--line-soft));
}

.bulk-edit-drawer-head h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.bulk-edit-drawer-head p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.bulk-edit-drawer-link {
    padding: 0;
    border: none;
    background: transparent;
    color: var(--accent, #2f6fed);
    font-size: 13px;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.bulk-edit-drawer-link.is-active {
    color: #16a34a;
}

.bulk-edit-drawer-head button {
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-muted);
}

.bulk-edit-drawer-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    flex: 1 1 auto;
}

.bulk-edit-drawer-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #f3c86b;
    border-radius: 10px;
    background: #fdf3de;
    color: #8a5a00;
    font-family: "Poppins";
    font-size: 12.5px;
    font-weight: 500;
}

.bulk-edit-drawer-body label {
    display: grid;
    gap: 7px;
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
}

.bulk-edit-drawer-body input,
.bulk-edit-drawer-body select {
    width: 100%;
    height: 44px;
    min-width: 0;
    padding: 0 12px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    color: var(--list-text-primary, var(--text-strong));
    background: var(--list-surface, var(--input));
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
}

.bulk-edit-drawer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid var(--list-border, var(--line-soft));
}

.filter-mode-tabs {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
}

.filter-forma-pagamento-field {
    display: grid;
    gap: 7px;
}

.filter-forma-pagamento-titulo {
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
}

.filter-forma-pagamento-lista {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding: 12px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    background: var(--list-surface, var(--input));
    max-height: 160px;
    overflow-y: auto;
}

.filter-forma-pagamento-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
    color: var(--list-text-primary, var(--text-strong));
    cursor: pointer;
}

.filter-forma-pagamento-item input {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.filter-mode-tab {
    flex: 1;
    height: 40px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    background: var(--list-surface, var(--input));
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.filter-mode-tab[aria-selected="true"] {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.filter-mode-panel {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.filter-mode-panel:not(.filter-mode-panel-periodo) {
    grid-template-columns: minmax(0, 1fr);
}

.filter-mode-panel[hidden] {
    display: none;
}

.receivable-filter-actions .primary-action,
.receivable-filter-actions .ghost-action {
    min-height: 44px;
    padding-inline: 18px;
}

.ghost-action,
.primary-action,
.secondary-action,
.cancel-action {
    flex: 0 0 auto;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 18px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    color: var(--text-strong);
    background: var(--panel);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
    white-space: nowrap;
}

.ghost-action svg {
    width: 18px;
    height: 18px;
}

.primary-action {
    min-width: 158px;
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

.primary-action:hover,
.secondary-action:hover,
.cancel-action:hover,
.ghost-action:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

/* Avisos flutuantes (toasts): pilha no canto inferior direito, para nao
   cobrir os botoes do cabecalho das telas. 3 tipos: sucesso (verde),
   atencao (ambar - inclui avisos informativos) e erro (vermelho). O script
   em app.js move cada .page-alert para a .toast-stack e monta icone, titulo,
   botao de fechar e barra de tempo. */
.toast-stack {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    width: min(400px, calc(100vw - 32px));
    pointer-events: none;
}

.toast-stack:empty {
    display: none;
}

.page-alert {
    --toast-cor: #dc2626;
    --toast-fundo-icone: rgba(220, 38, 38, .12);
    box-sizing: border-box;
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 11000;
    width: min(400px, calc(100vw - 32px));
    max-width: min(400px, calc(100vw - 32px));
    margin: 0;
    padding: 12px 40px 14px 14px;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
    overflow: hidden;
    border: 1px solid var(--line-soft, #e2e8f0);
    border-left: 4px solid var(--toast-cor);
    border-radius: 12px;
    color: var(--text-strong, #0f172a);
    background: var(--panel, #fff);
    box-shadow: 0 12px 32px rgba(15, 23, 42, .16), 0 2px 6px rgba(15, 23, 42, .08);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    pointer-events: auto;
    animation: toast-in .24s ease-out both;
}

.toast-stack .page-alert {
    position: relative;
    right: auto;
    bottom: auto;
    top: auto !important;
    width: 100%;
    max-width: 100%;
}

.page-alert.is-success {
    --toast-cor: #16a34a;
    --toast-fundo-icone: rgba(22, 163, 74, .12);
}

.page-alert.is-warning,
.page-alert.is-info {
    --toast-cor: #d97706;
    --toast-fundo-icone: rgba(217, 119, 6, .14);
}

.page-alert-icone {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--toast-cor);
    background: var(--toast-fundo-icone);
}

.page-alert-icone svg {
    width: 18px;
    height: 18px;
}

.page-alert-corpo {
    min-width: 0;
    padding-top: 1px;
}

.page-alert-titulo {
    display: block;
    margin-bottom: 2px;
    color: var(--toast-cor);
    font-size: 13px;
    font-weight: 800;
}

.page-alert-texto {
    display: block;
    color: var(--text-strong, #0f172a);
    overflow-wrap: anywhere;
}

.page-alert-texto a {
    color: var(--toast-cor);
    font-weight: 700;
}

.page-alert-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    color: var(--muted, #64748b);
    background: transparent;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.page-alert-close:hover {
    color: var(--text-strong, #0f172a);
    background: color-mix(in srgb, currentColor 10%, transparent);
}

.page-alert-tempo {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: var(--toast-cor);
    opacity: .35;
    transform-origin: left center;
    animation: toast-tempo linear forwards;
    animation-duration: var(--toast-duracao, 8s);
}

.page-alert:hover .page-alert-tempo {
    animation-play-state: paused;
}

.page-alert.is-hiding {
    opacity: 0;
    transform: translateX(calc(100% + 32px));
    transition: opacity .22s ease, transform .22s ease;
}

@keyframes toast-tempo {
    from { transform: scaleX(1); }
    to { transform: scaleX(0); }
}

/* No PDV o canto inferior tem os botoes de fechamento da venda. */
body:has(.pdv-counter) .toast-stack {
    top: 84px;
    bottom: auto;
    right: 50%;
    transform: translateX(50%);
    align-items: center;
}

@media (max-width: 640px) {
    .toast-stack {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }
}

.ciot-minimum-freight-alert {
    display: grid;
    gap: 6px;
    margin: 0 0 18px;
    padding: 18px 20px;
    border: 1px solid #f59e0b;
    border-left: 8px solid #d97706;
    border-radius: 12px;
    color: #7c2d12;
    background: #fffbeb;
    box-shadow: 0 18px 42px rgba(146, 64, 14, .14);
}

.ciot-minimum-freight-alert strong {
    color: #7c2d12;
    font-size: 18px;
    font-weight: 950;
}

.ciot-minimum-freight-alert span {
    color: #92400e;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.45;
}

.lookup-status {
    display: none;
    position: fixed;
    top: 22px;
    right: 24px;
    z-index: 42;
    max-width: min(360px, calc(100vw - 32px));
    margin: 0;
    padding: 11px 14px;
    border: 1px solid rgba(65, 106, 157, .18);
    border-radius: 12px;
    color: var(--brand-strong);
    background: color-mix(in srgb, var(--panel) 88%, rgba(65, 106, 157, .28));
    box-shadow: 0 18px 48px rgba(0, 0, 0, .18);
    backdrop-filter: blur(12px);
    font-size: 13px;
    font-weight: 800;
    transform: translateX(calc(100% + 32px));
    opacity: 0;
    transition: opacity .22s ease, transform .22s ease;
}

.lookup-status.is-visible {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.lookup-status.is-hiding {
    opacity: 0;
    transform: translateX(calc(100% + 32px));
}

.lookup-status.is-error {
    border-color: rgba(255, 91, 102, .26);
    color: var(--danger);
    background: color-mix(in srgb, var(--panel) 88%, rgba(255, 91, 102, .2));
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateX(calc(100% + 32px));
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.contacts-card,
.form-card {
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--panel);
    overflow: visible;
}

:root[data-theme="light"] .contacts-card,
:root[data-theme="light"] .form-card {
    box-shadow: 0 12px 34px rgba(16, 24, 40, .05);
}

.contacts-card {
    height: min(calc(100svh - 170px), 638px);
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.contacts-card > [data-bulk-payables-form] {
    display: none;
}

.contacts-card > [data-bulk-receivables-delete-form] {
    display: none;
}

.payables-table {
    align-content: start;
}

.contacts-card:has(.payables-table) {
    height: min(calc(100svh - 170px), 638px);
    max-height: none;
}

.payables-table .contacts-scroll {
    max-height: calc(64px * 8);
}

.payables-table .contacts-head {
    min-height: 42px;
}

.payables-table .contacts-row > span:nth-child(2),
.payables-table .contacts-row > div:nth-child(3) {
    min-width: 0;
    overflow: hidden;
}

.payables-table .contacts-row > div:nth-child(3) strong,
.payables-table .contacts-row > div:nth-child(3) small,
.payables-table .contacts-row > span:nth-child(2) {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.payables-table .contacts-row > div:nth-child(3) small {
    font-size: 11px;
}

.finance-accounts-card {
    height: min(calc(100svh - 170px), 620px);
}

.contacts-table {
    min-width: 900px;
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.contacts-scroll {
    min-height: 0;
    height: 100%;
    max-height: calc(64px * 8);
    overflow-y: auto;
    overflow-x: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .34) transparent;
}

.contacts-scroll::-webkit-scrollbar {
    width: 7px;
}

.contacts-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .34);
}

.contacts-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.contacts-head,
.contacts-row {
    display: grid;
    grid-template-columns: 2.1fr 1.4fr 1fr 1.1fr .55fr .45fr;
    align-items: center;
    gap: 16px;
    padding: 0 22px;
}

.users-table .contacts-head,
.users-table .contacts-row {
    grid-template-columns: 2fr 1.8fr .8fr 1fr .45fr;
}

.online-users-table .contacts-head,
.online-users-table .contacts-row {
    grid-template-columns: 1.4fr 1.6fr 1.2fr 1fr .8fr 1fr .9fr .9fr;
}

.online-users-table .btn-link {
    background: none;
    border: 1px solid #f1a3a3;
    color: #c53030;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
}

.online-users-table .btn-link:hover {
    background: #fdeaea;
}

.online-users-table .btn-link:disabled {
    opacity: .6;
    cursor: default;
}

.online-live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 800;
}

.online-live-indicator em {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--success);
    font-style: normal;
    animation: online-dot-pulse 1.6s ease-in-out infinite;
}

@keyframes online-dot-pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(23, 201, 121, .5); }
    50% { opacity: .55; box-shadow: 0 0 0 5px rgba(23, 201, 121, 0); }
}

.etiquetas-table .contacts-head,
.etiquetas-table .contacts-row {
    grid-template-columns: 2.2fr 1.4fr .8fr .6fr .45fr;
}

.products-table .contacts-head,
.products-table .contacts-row {
    grid-template-columns: .3fr .5fr 2.1fr 1fr .9fr .55fr .9fr .75fr .45fr;
}

.product-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-thumb img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--list-border, var(--line-soft));
}

.product-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px dashed var(--list-border, var(--line-soft));
    color: var(--text-muted);
}

.sellers-table .contacts-head,
.sellers-table .contacts-row {
    grid-template-columns: 2fr 1.8fr .8fr 1.15fr .45fr;
}

.resellers-table .contacts-head,
.resellers-table .contacts-row {
    grid-template-columns: 2.2fr 1.3fr 1.3fr .45fr;
}

.commissions-table .contacts-head,
.commissions-table .contacts-row {
    grid-template-columns: 2.1fr 1.25fr .8fr 1.25fr .9fr .8fr .45fr;
}

.receivables-table .contacts-head,
.receivables-table .contacts-row {
    grid-template-columns: 34px 1.5fr 1.8fr .85fr .85fr .85fr .85fr .45fr;
}

.payables-table .contacts-head,
.payables-table .contacts-row {
    grid-template-columns: 34px 1.5fr 1.8fr .85fr .85fr .85fr .85fr .45fr;
}

.finance-accounts-table .contacts-head,
.finance-accounts-table .contacts-row {
    grid-template-columns: 1.8fr .85fr 1fr 1.15fr .9fr .45fr;
}

/* Cobrancas WhatsApp (Financas) - so a lista rola, o resto da pagina fica
   fixo (cabecalho + filtros nao crescem, o card da lista ocupa o espaco
   restante e rola por dentro). */
.wa-cobrancas-main {
    display: flex;
    flex-direction: column;
    height: 100svh;
    box-sizing: border-box;
    overflow: hidden;
}

.wa-cobrancas-main .page-top,
.wa-cobrancas-main .page-alert,
.wa-cobrancas-main .wa-cobrancas-filtros {
    flex: 0 0 auto;
}

.wa-cobrancas-main .contacts-card {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
}

.wa-cobrancas-filtros {
    padding: 16px 20px;
    margin-bottom: 16px;
    flex: 0 0 auto;
}

.wa-filtros-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: end;
    gap: 14px;
}

.wa-filtros-row label {
    display: grid;
    gap: 6px;
    flex: 0 1 150px;
    min-width: 110px;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted-strong);
}

.wa-filtros-row label.wa-filtro-cliente {
    flex: 1 1 220px;
}

.wa-filtros-row label.wa-filtro-data {
    flex: 0 0 172px;
    min-width: 172px;
}

.wa-filtros-row input,
.wa-filtros-row select {
    width: 100%;
    height: 42px;
    padding: 0 14px;
}

.wa-filtros-row input[type="date"] {
    padding: 0 10px 0 14px;
}

.wa-filtros-row .primary-action {
    flex: 0 0 auto;
    height: 42px;
    margin: 0;
    white-space: nowrap;
}

/* .contacts-table (base site-wide) so tem overflow-x na faixa de linhas
   (.contacts-scroll); o cabecalho (.contacts-head) fica de fora e cortava
   em telas estreitas. Aqui o wrap por fora rola cabecalho + linhas juntos. */
.whatsapp-cobrancas-wrap {
    min-height: 0;
    height: 100%;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .34) transparent;
}

.whatsapp-cobrancas-wrap::-webkit-scrollbar {
    height: 8px;
}

.whatsapp-cobrancas-wrap::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .34);
}

.whatsapp-cobrancas-wrap::-webkit-scrollbar-track {
    background: transparent;
}

.whatsapp-cobrancas-wrap .contacts-table {
    min-width: 960px !important;
}

.whatsapp-cobrancas-wrap .contacts-scroll {
    overflow-x: visible;
}

.whatsapp-cobrancas-table .contacts-head,
.whatsapp-cobrancas-table .contacts-row {
    /* minmax() com piso em px garante overflow real (fr puro so' comprime,
       nunca estoura o container) - e' o que faz o wrap por fora rolar de
       verdade em telas estreitas, em vez de cortar a coluna de Acoes. */
    grid-template-columns:
        28px minmax(200px, 1.9fr) minmax(130px, 1.15fr) minmax(95px, .85fr)
        minmax(105px, .95fr) minmax(125px, 1.1fr) minmax(140px, 1.15fr) minmax(60px, .55fr);
    gap: 20px;
    padding: 0 24px;
}

.whatsapp-cobrancas-table .contacts-row > span:first-child,
.whatsapp-cobrancas-table .contacts-head > span:first-child {
    overflow: visible;
}

.whatsapp-cobrancas-table .contacts-head {
    min-height: 44px;
}

.whatsapp-cobrancas-table .contacts-row {
    min-height: 68px;
}

.whatsapp-cobrancas-table .contacts-row > div,
.whatsapp-cobrancas-table .contacts-row > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.whatsapp-cobrancas-table .contacts-row strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.whatsapp-cobrancas-table .contacts-row small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-erro-hint {
    display: inline-block !important;
    margin-left: 4px;
    cursor: help;
}

.wa-tick {
    display: inline-block;
    vertical-align: -1px;
    margin-left: 5px;
    color: #8696a0;
}

.wa-tick.is-lida {
    color: #53bdeb;
}

.whatsapp-cobrancas-table .action-cell {
    justify-self: end;
}

/* Painel do chat "Conversar" - reaproveitado pelo widget flutuante global
   (.wa-float-panel, ver mais abaixo), que substituiu o antigo modal
   centralizado de tela cheia. */
.wa-chat-panel {
    position: relative;
    width: min(420px, 100%);
    height: min(640px, 100%);
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
}

.wa-chat-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #075e54;
    color: #fff;
}

.wa-chat-avatar {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
}

.wa-chat-header-info {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 2px;
}

.wa-chat-header-info strong {
    font-size: 14px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-chat-header-info small {
    font-size: 11.5px;
    opacity: .8;
}

.wa-chat-close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.wa-chat-close:hover {
    background: rgba(255, 255, 255, .14);
}

.wa-chat-negociacao-cell {
    flex: 0 0 auto;
}

.wa-chat-negociacao-cell .wa-chat-icon-btn {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.wa-chat-negociacao-cell .wa-chat-icon-btn:hover {
    background: rgba(255, 255, 255, .14);
}

.wa-chat-negociacao-menu [data-wa-chat-negociacao-nova] {
    font-weight: 700;
    color: var(--brand);
}

.wa-chat-negociacao-vazio {
    display: block;
    padding: 6px 4px;
    color: var(--muted);
}

/* Widget flutuante global (app/views/partials/whatsapp-chat-widget.php) -
   mesma "carcaça" .wa-chat-panel do chat, so que ancorada no canto da tela
   em vez de centralizada num overlay, pra conviver com o resto da pagina e
   sobreviver a troca de tela (o JS reabre sozinho via localStorage). */
.wa-float-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10100;
    transition: box-shadow .15s ease;
}

.wa-float-widget[hidden] {
    display: none;
}

.wa-float-widget.is-arrastando {
    transition: none;
}

.wa-float-widget.is-arrastando .wa-float-panel,
.wa-float-widget.is-arrastando .wa-float-bubble {
    box-shadow: 0 26px 50px var(--shadow);
}

[data-wa-float-drag-handle] {
    cursor: grab;
    touch-action: none;
}

.is-arrastando [data-wa-float-drag-handle] {
    cursor: grabbing;
}

.wa-float-bubble {
    display: none;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 0;
    background: #075e54;
    color: #fff;
    box-shadow: 0 12px 28px var(--shadow);
    cursor: grab;
    font-weight: 800;
}

.wa-float-widget.is-minimizado .wa-float-bubble {
    display: flex;
}

.wa-float-widget.is-minimizado .wa-float-panel {
    display: none;
}

.wa-float-bubble-avatar {
    font-size: 15px;
}

.wa-float-panel {
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 100px));
    box-shadow: 0 24px 60px var(--shadow);
}

@media (max-width: 900px) {
    .wa-float-panel {
        width: calc(100vw - 24px);
    }
}

/* Lista de clientes cadastrados (falar com outro cliente) - bolha e painel
   proprios, sempre disponiveis (nao dependem de uma conversa ja aberta). */
.wa-contatos-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10099;
}

.wa-contatos-launcher:not([hidden]) {
    display: flex;
}

.wa-contatos-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 10101;
    width: min(380px, calc(100vw - 32px));
    height: min(560px, calc(100vh - 100px));
    box-shadow: 0 24px 60px var(--shadow);
}

/* .wa-chat-panel (reaproveitada aqui pro visual) define display:flex sem
   condicional nenhuma - isso vence o [hidden] nativo do navegador (mesma
   especificidade, mas estilo do autor tem prioridade sobre o padrao do user
   agent), entao sem essa regra o painel de contatos nunca ficava escondido. */
.wa-contatos-panel[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .wa-contatos-panel {
        width: calc(100vw - 24px);
    }
}

.wa-contatos-busca {
    flex: 0 0 auto;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line-soft);
}

.wa-contatos-busca input {
    width: 100%;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--panel-soft);
    color: var(--text);
}

.wa-contatos-lista {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 6px;
}

.wa-contato-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.wa-contato-item:hover {
    background: var(--panel-soft);
}

.wa-contato-avatar {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #075e54;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

.wa-contato-info {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.wa-contato-info strong {
    font-size: 13.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-contato-info small {
    font-size: 11.5px;
    color: var(--muted);
}

.wa-chat-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #e5ddd5;
    background-image: linear-gradient(rgba(255, 255, 255, .4), rgba(255, 255, 255, .4));
}

.wa-chat-empty {
    margin: auto;
    color: #667781;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
}

.wa-bubble {
    position: relative;
    max-width: 78%;
    padding: 7px 9px 8px;
    border-radius: 8px;
    font-size: 13.5px;
    line-height: 1.4;
    box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}

.wa-bubble-citacao {
    margin-bottom: 4px;
    padding: 4px 8px;
    border-left: 3px solid #06cf9c;
    border-radius: 4px;
    background: rgba(0, 0, 0, .06);
    color: #667781;
    font-size: 12.5px;
    line-height: 1.3;
    max-height: 2.6em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wa-bubble-acoes {
    position: absolute;
    top: -14px;
    display: flex;
    gap: 3px;
    opacity: 0;
    transition: opacity .12s ease;
}

.wa-bubble.is-in .wa-bubble-acoes { left: 4px; }
.wa-bubble.is-out .wa-bubble-acoes { right: 4px; }

.wa-bubble:hover .wa-bubble-acoes {
    opacity: 1;
}

.wa-bubble-responder,
.wa-bubble-reagir {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    color: #667781;
    font-size: 13px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .2);
    cursor: pointer;
}

.wa-bubble-reacao-badge {
    position: absolute;
    bottom: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    font-size: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.wa-bubble.is-in .wa-bubble-reacao-badge { right: -6px; }
.wa-bubble.is-out .wa-bubble-reacao-badge { left: -6px; }

.wa-reacao-picker {
    position: absolute;
    z-index: 5;
    display: flex;
    gap: 2px;
    padding: 4px 6px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

.wa-reacao-picker[hidden] {
    display: none;
}

.wa-reacao-picker button {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: transparent;
    font-size: 17px;
    cursor: pointer;
    transition: transform .1s ease;
}

.wa-reacao-picker button:hover {
    background: rgba(0, 0, 0, .06);
    transform: scale(1.15);
}

.wa-chat-reply-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: #f0f2f5;
    border-top: 1px solid rgba(0, 0, 0, .08);
}

.wa-chat-reply-preview[hidden] {
    display: none;
}

.wa-chat-reply-preview-linha {
    flex: 1;
    min-width: 0;
    padding: 4px 8px;
    border-left: 3px solid #06cf9c;
    border-radius: 4px;
    background: rgba(0, 0, 0, .04);
}

.wa-chat-reply-preview-linha strong {
    display: block;
    color: #06cf9c;
    font-size: 12px;
}

.wa-chat-reply-preview-linha span {
    display: block;
    overflow: hidden;
    color: #667781;
    font-size: 12.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wa-chat-reply-preview button {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #667781;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.wa-chat-reply-preview button:hover {
    background: rgba(0, 0, 0, .06);
}

.wa-bubble.is-in {
    align-self: flex-start;
    background: #fff;
    color: #111b21;
    border-top-left-radius: 0;
}

.wa-bubble.is-out {
    align-self: flex-end;
    background: #d9fdd3;
    color: #111b21;
    border-top-right-radius: 0;
}

.wa-bubble-texto {
    white-space: pre-wrap;
    word-break: break-word;
}

.wa-bubble-rodape {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
    font-size: 10.5px;
    color: #667781;
}

.wa-bubble-tick .wa-tick {
    margin-left: 0;
    vertical-align: -1px;
}

.wa-bubble-midia-btn {
    display: block;
    width: 100%;
    min-width: 180px;
    margin: 0;
    padding: 9px 12px;
    border: 1px dashed rgba(0, 0, 0, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .5);
    color: #111b21;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

.wa-bubble-midia-btn:hover {
    background: rgba(255, 255, 255, .8);
}

.wa-bubble-midia-btn:disabled {
    opacity: .7;
    cursor: default;
}

.wa-bubble-media-img {
    display: block;
    max-width: 100%;
    max-height: 260px;
    border-radius: 6px;
    object-fit: cover;
    cursor: zoom-in;
}

.wa-lightbox {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .85);
    border-radius: inherit;
}

.wa-lightbox[hidden] {
    display: none;
}

.wa-lightbox img {
    max-width: 92%;
    max-height: 92%;
    object-fit: contain;
    cursor: zoom-out;
    border-radius: 4px;
}

.wa-lightbox-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

/* Modal "Historico de envios" */
.wa-historico-modal {
    position: fixed;
    inset: 0;
    z-index: 10100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(11, 20, 26, .55);
    padding: 24px;
}

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

.wa-historico-panel {
    width: min(460px, 100%);
    height: min(560px, 100%);
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
}

.wa-historico-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-soft);
}

.wa-historico-header strong {
    display: block;
    font-size: 15px;
    font-weight: 850;
    color: var(--text-strong);
}

.wa-historico-header small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.wa-historico-header .wa-chat-close {
    background: transparent;
    color: var(--muted);
}

.wa-historico-header .wa-chat-close:hover {
    background: var(--panel-soft);
    color: var(--text-strong);
}

.wa-historico-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 14px;
}

.wa-historico-item {
    padding: 12px 4px;
    border-bottom: 1px solid var(--line-soft);
}

.wa-historico-item:last-child {
    border-bottom: 0;
}

.wa-historico-item-topo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12.5px;
    font-weight: 800;
    color: var(--text-strong);
}

.wa-historico-item-detalhes {
    margin-top: 4px;
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.5;
}

.wa-cobranca-config-panel {
    width: min(560px, 100%);
    height: auto;
    max-height: 92vh;
}

.wa-cobranca-config-panel .wa-historico-body {
    padding: 18px;
}

.wa-tel-panel {
    width: min(420px, 100%);
    height: auto;
    max-height: 92vh;
}

.wa-contatos-sync-panel {
    width: min(480px, 100%);
    height: min(600px, 100%);
}

.wa-contatos-sync-titulo {
    margin: 12px 4px 4px;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.wa-contatos-sync-titulo:first-child {
    margin-top: 4px;
}

.wa-contatos-sync-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 4px;
    border-bottom: 1px solid var(--line-soft);
}

.wa-contatos-sync-item:last-child {
    border-bottom: 0;
}

.wa-contatos-sync-item strong {
    display: block;
    font-size: 13px;
    color: var(--text-strong);
}

.wa-contatos-sync-item small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11.5px;
}

.wa-contatos-sync-item.is-vinculado small {
    color: #1fa855;
}

.wa-contatos-sync-actions {
    flex: 0 0 auto;
    padding: 14px 18px;
    border-top: 1px solid var(--line-soft);
}

.wa-contatos-sync-actions .primary-action {
    width: 100%;
}

.wa-tel-panel .wa-historico-body {
    padding: 18px;
}

.wa-tel-label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted-strong);
}

.wa-tel-label input {
    width: 100%;
    height: 42px;
}

.wa-lightbox-close:hover {
    background: rgba(255, 255, 255, .28);
}

.wa-bubble-media-video {
    display: block;
    max-width: 100%;
    max-height: 260px;
    border-radius: 6px;
}

.wa-bubble audio {
    display: block;
    max-width: 240px;
}

.wa-bubble-texto a {
    color: #0a6cff;
    font-weight: 700;
    text-decoration: none;
}

.wa-bubble-texto a:hover {
    text-decoration: underline;
}

.wa-chat-input-bar {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 12px;
    background: var(--panel-soft);
    border-top: 1px solid var(--line-soft);
}

.wa-chat-input-bar textarea {
    flex: 1 1 auto;
    resize: none;
    max-height: 90px;
    height: 40px;
    padding: 9px 14px;
    border-radius: 20px;
    border: 1px solid var(--line-soft);
    background: var(--panel);
    color: var(--text-strong);
    font: inherit;
    font-size: 13.5px;
}

.wa-chat-input-bar button {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: #25d366;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.wa-chat-input-bar button:hover {
    background: #1fbd5a;
}

.wa-chat-input-bar .wa-chat-icon-btn {
    background: transparent;
    color: #667781;
}

.wa-chat-input-bar .wa-chat-icon-btn:hover {
    background: rgba(0, 0, 0, .06);
    color: #111b21;
}

.wa-chat-emoji-wrap {
    position: relative;
    flex: 0 0 auto;
}

.wa-chat-emoji-picker {
    position: absolute;
    bottom: 48px;
    left: 0;
    z-index: 5;
    width: 220px;
    max-height: 180px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 16px 38px var(--shadow, rgba(0, 0, 0, .25));
}

.wa-chat-emoji-picker[hidden] {
    display: none;
}

.wa-chat-emoji-picker button {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 17px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.wa-chat-emoji-picker button:hover {
    background: var(--panel-soft);
}

.empty-state {
    padding: 44px 22px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.fiscal-report-table .contacts-head,
.fiscal-report-table .contacts-row {
    grid-template-columns: 1fr 1.7fr 1.5fr 1fr .85fr .85fr .85fr;
}

.rcr-report-table .contacts-head,
.rcr-report-table .contacts-row {
    grid-template-columns: 1.6fr 1fr 1fr 1fr .85fr .85fr .85fr;
}

.rcr-report-table.contacts-table {
    height: auto;
}

.rcg-report-table .contacts-head,
.rcg-report-table .contacts-row {
    grid-template-columns: .7fr .9fr .9fr 1.1fr 1.1fr .9fr .9fr .9fr;
}

.rcg-report-table.contacts-table {
    height: auto;
}

.rcg-report-table .contacts-row > *:nth-child(n+5) {
    text-align: right;
}

.rv-pedidos-table .contacts-head,
.rv-pedidos-table .contacts-row {
    grid-template-columns: .9fr .8fr .75fr 1.1fr .95fr .9fr .85fr .85fr;
}

.rv-produtos-table .contacts-head,
.rv-produtos-table .contacts-row {
    grid-template-columns: 1.8fr .7fr .9fr .9fr .85fr .85fr .7fr;
}

.rp-produtos-table .contacts-head,
.rp-produtos-table .contacts-row {
    grid-template-columns: 1.9fr 1fr .8fr .9fr .9fr .95fr .9fr .7fr .7fr;
}

.rp-produtos-table .contacts-row > *:nth-child(n+3):nth-child(-n+8),
.rp-produtos-table .contacts-head > *:nth-child(n+3):nth-child(-n+8) {
    text-align: right;
}

.rp-produtos-table .contacts-row > *:last-child,
.rp-produtos-table .contacts-head > *:last-child {
    text-align: center;
}

.rp-produtos-table .contacts-row > div:first-child {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.rp-produtos-table .contacts-row > div:first-child small {
    color: var(--muted);
    font-size: 11px;
}

.rp-produtos-table.contacts-table {
    height: auto;
}

.ri-inventario-table .contacts-head,
.ri-inventario-table .contacts-row {
    grid-template-columns: .7fr 2.4fr .5fr .9fr .9fr 1fr 1.3fr;
}

.ri-inventario-table .contacts-row > *:nth-child(n+4):nth-child(-n+6),
.ri-inventario-table .contacts-head > *:nth-child(n+4):nth-child(-n+6) {
    text-align: right;
}

.ri-inventario-table.contacts-table {
    height: auto;
}

.print-table.ri-print-table th:nth-child(n+4):nth-child(-n+6),
.print-table.ri-print-table td:nth-child(n+4):nth-child(-n+6) {
    text-align: right;
}

.print-table.ri-print-table th,
.print-table.ri-print-table td {
    padding: 4px 6px;
    font-size: 10px;
}

.print-table.ri-print-table th:last-child,
.print-table.ri-print-table td:last-child {
    text-align: left;
    white-space: nowrap;
}

.ri-termo {
    break-inside: avoid;
}

.ri-termo p {
    margin: 6px 0 40px;
    line-height: 1.6;
    text-align: justify;
}

.ri-assinaturas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    text-align: center;
}

.ri-assinaturas > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ri-assinaturas .ri-linha {
    border-top: 1px solid #000;
    margin-bottom: 4px;
}

.rv-custo-aviso {
    margin: 4px 0 18px;
    color: var(--muted);
    font-size: 12px;
    font-style: italic;
}

.rv-pedidos-table .contacts-row > *:nth-last-child(-n+3),
.rv-pedidos-table .contacts-head > *:nth-last-child(-n+3),
.rv-produtos-table .contacts-row > *:nth-last-child(-n+3),
.rv-produtos-table .contacts-head > *:nth-last-child(-n+3) {
    text-align: right;
}

.rv-pedidos-table.contacts-table,
.rv-produtos-table.contacts-table {
    height: auto;
}

.rv-pedidos-detalhado {
    padding: 14px 22px 18px;
    display: grid;
    gap: 12px;
}

.rv-pedido-block {
    padding: 12px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--panel-soft);
}

.rv-pedido-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    color: var(--muted-strong);
    font-size: 13px;
}

.rv-pedido-head strong {
    color: var(--text-strong);
}

.rv-subtable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.rv-subtable th,
.rv-subtable td {
    padding: 6px 8px;
    border-bottom: 1px solid var(--line-soft);
    text-align: left;
    color: var(--text);
}

.rv-subtable th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
}

.rv-subtable td.num,
.rv-subtable th.num {
    text-align: right;
}

.rv-sem-itens {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-card.fiscal-report-group {
    height: auto;
    min-height: 0;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .rcr-report-table.contacts-table {
    height: auto;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .rv-pedidos-table.contacts-table,
.dashboard:has(.contacts-card):not(.dashboard-home) .rv-produtos-table.contacts-table {
    height: auto;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-filters-row.rcr-report-filters-row {
    grid-template-columns: minmax(160px, 200px) minmax(140px, 170px) minmax(140px, 170px) minmax(140px, 190px);
}

.rcr-client-head.page-top {
    align-items: center !important;
    justify-content: space-between !important;
    margin-bottom: 0 !important;
    min-height: 56px !important;
    padding: 14px 22px !important;
}

.rcr-client-head .fiscal-report-group-title,
.rcr-client-head .fiscal-report-group-title h3 {
    margin: 0;
    line-height: 1.2;
}

.fiscal-report-group.contacts-card {
    height: auto;
    max-height: none;
    display: block;
    margin-top: 20px;
    padding-bottom: 18px;
}

.fiscal-report-group .contacts-table {
    display: block;
    min-width: 0;
}

.fiscal-report-group .contacts-scroll {
    max-height: min(60vh, 620px) !important;
    height: auto !important;
    overflow-x: auto;
    padding-bottom: 24px;
}

.fiscal-report-group .contacts-row {
    min-height: 54px !important;
    border-bottom: 1px solid var(--line-soft);
}

.fiscal-report-group .contacts-row:last-child {
    border-bottom: 0;
}

.fiscal-report-group-head {
    padding: 16px 22px;
    margin-bottom: 0;
}

.fiscal-report-group-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.fiscal-report-group-title h3 {
    margin: 0;
    color: var(--text-strong);
    font-size: 15px;
}

.fiscal-report-group-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--brand-strong);
}

.fiscal-report-group-icon svg {
    width: 16px;
    height: 16px;
}

.fiscal-report-group-head > span {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 700;
}

.fiscal-report-key {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 11.5px;
    font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

.fiscal-report-form {
    display: grid;
    gap: 22px;
}

.fiscal-report-filters-row {
    display: flex;
    align-items: flex-end;
    flex-wrap: nowrap;
    gap: 16px;
    overflow-x: auto;
}

.fiscal-report-filters-row label {
    display: grid;
    flex: 0 0 auto;
    gap: 9px;
    margin: 0;
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.fiscal-report-filters-row input,
.fiscal-report-filters-row select {
    width: 170px;
    min-height: 44px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-weight: 700;
    outline: 0;
}

.rcg-filters-line {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}

.rcg-filters-line + .rcg-filters-line {
    margin-top: 18px;
}

.rcg-filters-line > label {
    display: grid;
    flex: 0 0 auto;
    gap: 9px;
    margin: 0;
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.rcg-filters-line > label > input {
    width: 200px;
    min-height: 44px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-weight: 700;
    outline: 0;
}

.rcg-date-group {
    display: grid;
    flex: 0 0 auto;
    gap: 9px;
    padding: 10px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: var(--panel-soft);
}

.rcg-date-group-label {
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.rcg-date-group-fields {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.rcg-date-group-fields label {
    display: grid;
    gap: 7px;
    margin: 0;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 700;
}

.rcg-date-group-fields input {
    width: 160px;
    min-height: 44px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-weight: 700;
    outline: 0;
}

@media (max-width: 640px) {
    .rcg-date-group-fields {
        flex-wrap: wrap;
    }

    .rcg-date-group-fields input,
    .rcg-filters-line > label > input {
        width: 100%;
    }
}

.fiscal-report-form-actions {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    flex: 0 0 auto;
    gap: 10px;
    margin-left: auto;
    padding-left: 12px;
}

.fiscal-report-types-label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.fiscal-report-types-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fiscal-type-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel-soft);
    color: var(--muted-strong);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.fiscal-type-chip svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.fiscal-type-chip input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--brand-strong);
}

.fiscal-type-chip:has(input:checked) {
    border-color: var(--brand-strong);
    background: color-mix(in srgb, var(--brand-strong) 12%, var(--panel-soft));
    color: var(--text-strong);
}

.fiscal-report-stats {
    margin-top: 20px;
}

.fiscal-report-summary-head {
    padding: 20px 22px 0;
    margin-bottom: 0;
}

.fiscal-report-summary-head h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 17px;
}

.fiscal-report-summary-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.dashboard:has(.fiscal-report-form) .dash-main {
    padding: 32px;
    background: var(--list-page-bg);
}

.dashboard:has(.fiscal-report-form) .page-top {
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.dashboard:has(.fiscal-report-form) .page-top h1 {
    color: var(--list-text-primary);
    font-family: "Poppins";
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
}

.dashboard:has(.fiscal-report-form) .page-top p {
    margin-top: 4px;
    color: var(--list-text-secondary);
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
}

.dashboard:has(.fiscal-report-form) .form-card {
    border-color: var(--list-border);
    border-radius: 20px;
    background: var(--list-surface);
    box-shadow: none;
    overflow: hidden;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-form {
    gap: 20px;
    padding: 24px;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-filters-row {
    display: grid;
    grid-template-columns: minmax(160px, 180px) minmax(150px, 180px) minmax(0, 1fr);
    align-items: end;
    gap: 16px;
    overflow: visible;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-filters-row label {
    gap: 7px;
    color: var(--list-text-primary);
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0;
    white-space: normal;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-filters-row input,
.dashboard:has(.fiscal-report-form) .fiscal-report-filters-row select {
    width: 100%;
    min-height: 44px;
    border-color: var(--list-border);
    border-radius: 10px;
    color: var(--list-text-primary);
    background: var(--list-surface);
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    box-shadow: none;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-form-actions {
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: 0;
    padding-left: 0;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-form-actions .primary-action,
.dashboard:has(.fiscal-report-form) .fiscal-report-form-actions .ghost-action {
    min-height: 44px;
    border-radius: 10px;
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-types {
    padding-top: 18px;
    border-top: 1px solid var(--list-border);
}

.dashboard:has(.fiscal-report-form) .fiscal-report-types-label {
    margin-bottom: 12px;
    color: var(--list-text-secondary);
    font-family: "Inter";
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .6px;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-types-list {
    gap: 8px;
}

.dashboard:has(.fiscal-report-form) .fiscal-type-chip {
    min-height: 40px;
    padding: 0 12px;
    border-color: var(--list-border);
    border-radius: 10px;
    color: var(--list-text-secondary);
    background: var(--list-surface-soft);
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
}

.dashboard:has(.fiscal-report-form) .fiscal-type-chip:has(input:checked) {
    border-color: #3b608f;
    color: #ffffff;
    background: #3b608f;
}

.dashboard:has(.fiscal-report-form) .fiscal-type-chip input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b608f;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-stats {
    gap: 18px;
    margin-top: 20px;
    margin-bottom: 20px;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-stats .stat-card {
    min-height: 116px;
    border-color: var(--list-border);
    border-radius: 12px;
    background: var(--list-surface);
    box-shadow: none;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-stats .stat-card small {
    color: var(--list-text-secondary);
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-stats .stat-card strong {
    color: var(--list-text-primary);
    font-family: "Poppins";
    font-size: 18px;
    font-weight: 600;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-summary-head {
    padding: 0;
    margin: 0 0 16px;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-summary-head h2 {
    margin: 0;
    color: var(--list-text-primary);
    font-family: "Poppins";
    font-size: 20px;
    font-weight: 600;
    line-height: 1.2;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-summary-head p {
    color: var(--list-text-secondary);
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group.contacts-card {
    margin-top: 16px;
    padding-bottom: 0;
    border-color: var(--list-border);
    border-radius: 20px;
    background: var(--list-surface);
    overflow: hidden;
    box-shadow: none;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group-head {
    min-height: 64px;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--list-border);
    background: var(--list-surface);
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group-title {
    gap: 10px;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group-title h3 {
    color: var(--list-text-primary);
    font-family: "Poppins";
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group-icon {
    width: 32px;
    height: 32px;
    border: 1px solid var(--list-border);
    border-radius: 10px;
    color: #3b608f;
    background: var(--list-surface-soft);
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group-head > span {
    color: var(--list-text-secondary);
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group .contacts-table {
    min-width: 960px;
    background: var(--list-surface);
}

.dashboard:has(.fiscal-report-form) .fiscal-report-table .contacts-head,
.dashboard:has(.fiscal-report-form) .fiscal-report-table .contacts-row {
    grid-template-columns: minmax(110px, .9fr) minmax(180px, 1.6fr) minmax(160px, 1.3fr) minmax(120px, .9fr) minmax(112px, .85fr) minmax(112px, .85fr) minmax(100px, .8fr);
    gap: 14px;
    padding-right: 20px;
    padding-left: 20px;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-table .contacts-head {
    min-height: 50px;
    border-bottom: 1px solid var(--list-border);
    color: var(--list-text-primary);
    font-family: "Inter";
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group .contacts-scroll {
    max-height: min(58vh, 600px) !important;
    padding-bottom: 0;
    overflow: auto;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group .contacts-row {
    min-height: 64px !important;
    border-bottom-color: var(--list-row-border);
    color: var(--list-text-secondary);
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group .contacts-row:hover {
    background: var(--list-hover-bg);
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group .contacts-row > span,
.dashboard:has(.fiscal-report-form) .fiscal-report-group .contacts-row > strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-key {
    color: var(--list-text-secondary);
    font-size: 11px;
}

.dashboard:has(.fiscal-report-form) .fiscal-report-group .type-pill {
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 20px;
    font-family: "Poppins";
    font-size: 11px;
    font-weight: 600;
}

@media (max-width: 1120px) {
    .dashboard:has(.fiscal-report-form) .fiscal-report-filters-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard:has(.fiscal-report-form) .fiscal-report-form-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .dashboard:has(.fiscal-report-form) .dash-main {
        padding: 24px 16px;
    }

    .dashboard:has(.fiscal-report-form) .fiscal-report-form {
        padding: 20px;
    }

    .dashboard:has(.fiscal-report-form) .fiscal-report-filters-row {
        grid-template-columns: 1fr;
    }

    .dashboard:has(.fiscal-report-form) .fiscal-report-form-actions .primary-action,
    .dashboard:has(.fiscal-report-form) .fiscal-report-form-actions .ghost-action {
        width: 100%;
    }
}

.stock-table .contacts-head,
.stock-table .contacts-row {
    grid-template-columns: minmax(210px, 2fr) minmax(108px, .85fr) 54px minmax(82px, .75fr) minmax(96px, .8fr) minmax(108px, .8fr) 42px;
    gap: 12px;
}

.stock-history-table .contacts-head,
.stock-history-table .contacts-row {
    grid-template-columns: minmax(118px, .9fr) minmax(210px, 1.8fr) minmax(86px, .75fr) minmax(80px, .75fr) minmax(128px, 1fr) minmax(96px, .8fr);
    gap: 12px;
}

.tiny-stock-reconciliation-table .contacts-head,
.tiny-stock-reconciliation-table .contacts-row {
    grid-template-columns: minmax(190px, 1.7fr) 82px 82px 92px minmax(160px, 1.35fr) 100px 132px;
    gap: 10px;
}

.tiny-stock-reconciliation-table .contacts-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.purchase-table .contacts-head,
.purchase-table .contacts-row {
    grid-template-columns: minmax(180px, 1.25fr) minmax(220px, 1.4fr) 110px 110px 170px 90px;
    gap: 12px;
}

.purchase-items-table .contacts-head,
.purchase-items-table .contacts-row {
    grid-template-columns: 56px minmax(260px, 1fr) 120px 110px 110px;
    gap: 12px;
}

.mp-finance-table .contacts-head,
.mp-finance-table .contacts-row {
    grid-template-columns: .9fr 1.35fr 1.3fr 1fr .75fr .8fr .45fr;
}

.cashflow-table .contacts-head,
.cashflow-table .contacts-row {
    grid-template-columns: minmax(74px, .75fr) minmax(150px, 1.8fr) minmax(72px, .75fr) minmax(86px, 1fr) minmax(80px, .85fr) minmax(100px, 1.1fr) minmax(88px, .9fr) 48px;
    gap: 12px;
}

.cashflow-table .contacts-head > *,
.cashflow-table .contacts-row > * {
    min-width: 0;
}

.cashflow-table .contacts-row > span,
.cashflow-table .contacts-row > strong,
.cashflow-table .contacts-row > div:not(.action-cell) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cashflow-table .contacts-row > span.cashflow-cliente {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.25;
    align-self: center;
}

.cashflow-table .contacts-row > div:not(.action-cell) strong,
.cashflow-table .contacts-row > div:not(.action-cell) small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cashflow-table .contacts-row > div.cashflow-historico,
.cashflow-table .contacts-row > div.cashflow-historico strong {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.25;
}

.cashflow-table .contacts-row > div.cashflow-historico {
    align-self: center;
}

.cashflow-account-tabs {
    display: flex;
    min-height: 50px;
    margin: 12px 12px 0;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
}

.cashflow-account-tab {
    display: flex;
    flex: 1 0 180px;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 20px;
    border-right: 1px solid var(--line);
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 10%, var(--panel));
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.cashflow-account-tab:last-child {
    border-right: 0;
}

.cashflow-account-tab:first-child {
    border-radius: 9px 0 0 9px;
}

.cashflow-account-tab:last-child {
    border-radius: 0 9px 9px 0;
}

.cashflow-account-tab:hover {
    color: var(--text-strong);
    background: color-mix(in srgb, var(--brand) 18%, var(--panel));
}

.cashflow-account-tab.is-active {
    color: #fff;
    background: var(--brand);
    box-shadow: inset 0 -3px 0 var(--brand-strong);
}

.cashflow-card {
    height: min(calc(100svh - 180px), 690px);
    min-width: 0;
    max-width: 100%;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.cashflow-card .contacts-scroll {
    max-height: none;
}

.cashflow-card .cashflow-table {
    width: 100%;
    min-width: 0;
}

.cashflow-filters {
    width: min(820px, 100%);
    grid-template-columns: minmax(170px, .8fr) repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
}

.cashflow-filters .receivable-filter-actions {
    margin-top: 2px;
    padding-top: 16px;
    border-top: 1px solid var(--list-border, var(--line-soft));
}

/* .cashflow-filters tem so 3 colunas explicitas (vs. as 12 que a util
   .span-12 pressupoe) - usar span-12 aqui criava colunas implicitas extras
   e desalinhava todo o modal. grid-column: 1/-1 sempre cobre a grade real,
   qualquer que seja o numero de colunas. */
.cashflow-filters .filter-forma-pagamento-field {
    grid-column: 1 / -1;
}

.accounts-filters {
    width: min(900px, 100%);
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    padding: 24px;
}

.accounts-filters .filter-modal-head {
    padding-bottom: 16px;
    border-bottom: 1px solid var(--list-border, var(--line-soft));
}

.accounts-filters .accounts-filter-party {
    grid-column: span 2;
}

.accounts-filters .accounts-filter-period {
    grid-column: span 2;
}

.receivable-filters .filter-date-range {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.receivable-filters .filter-date-range legend {
    padding: 0;
    margin-bottom: 7px;
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
    grid-column: 1 / -1;
    float: left;
    width: 100%;
}

.receivable-filters .filter-date-range-wide {
    grid-column: 1 / -1;
}

.receivable-filters .filter-date-presets {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: -6px;
    font-family: "Poppins";
    font-size: 12px;
    color: var(--muted);
}

.receivable-filters .filter-date-presets button {
    height: 30px;
    padding: 0 12px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 999px;
    background: transparent;
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.receivable-filters .filter-date-presets button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.orders-filters-modal .filter-mode-panel {
    grid-column: span 2;
}

.orders-filters-modal .orders-filter-status {
    grid-column: span 2;
}

.orders-filters-modal .filter-forma-pagamento-field {
    grid-column: 1 / -1;
}

.orders-filters-modal .filter-mode-panel-periodo {
    grid-template-columns: 1fr 1fr;
}

.accounts-filters .receivable-filter-actions {
    margin-top: 2px;
    padding-top: 16px;
    border-top: 1px solid var(--list-border, var(--line-soft));
}

@media (min-width: 769px) {
    .cashflow-dashboard {
        height: 100svh;
        min-height: 0;
        overflow: hidden;
    }

    .cashflow-dashboard .dash-main {
        height: 100svh;
        min-height: 0;
        display: grid;
        grid-template-rows: auto minmax(0, 1fr);
        gap: 18px;
        overflow: hidden;
        padding-right: 48px;
        padding-left: 48px;
    }

    .dashboard-home {
        height: 100svh;
        min-height: 0;
        overflow: hidden;
    }

    .dashboard-home .dash-main {
        height: 100svh;
        min-height: 0;
        display: grid;
        grid-template-rows: auto auto minmax(0, 1fr);
        overflow: hidden;
    }

    .dashboard-home .stats-grid,
    .dashboard-home .dash-top {
        min-height: 0;
    }

    .dashboard-home .dashboard-grid {
        min-height: 0;
        height: 100%;
    }

    .dashboard-home .chart-card,
    .dashboard-home .recent-card {
        height: 100%;
        min-height: 0;
    }

    .dashboard-home .recent-list {
        overflow-y: auto;
    }

    .cashflow-dashboard .page-top {
        margin-bottom: 0;
    }

    .cashflow-dashboard .page-top > div:first-child {
        min-width: 0;
    }

    .cashflow-dashboard .page-top p {
        white-space: normal;
    }

    .cashflow-dashboard .receivable-top-actions .search-input {
        width: clamp(260px, 25vw, 360px);
    }

    .cashflow-dashboard .cashflow-card {
        height: auto;
        min-height: 0;
    }
}

@media (min-width: 769px) {
    .purchase-dashboard {
        height: 100svh;
        min-height: 0;
        overflow: hidden;
    }

    .purchase-dashboard .dash-main {
        height: 100svh;
        min-height: 0;
        display: flex;
        flex-direction: column;
        gap: 18px;
        overflow: hidden;
    }

    .purchase-dashboard .dash-main > .contacts-card {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

    .purchase-dashboard .contacts-card .contacts-scroll {
        max-height: none;
    }
}

@media (max-width: 700px) {
    .cashflow-filters {
        grid-template-columns: 1fr;
    }

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

    .accounts-filters .accounts-filter-party,
    .accounts-filters .accounts-filter-period,
    .orders-filters-modal .filter-mode-panel,
    .orders-filters-modal .orders-filter-status {
        grid-column: 1 / -1;
    }
}

@media (max-width: 480px) {
    .accounts-filters {
        grid-template-columns: 1fr;
        padding: 20px;
    }
}

.orders-table .contacts-head,
.orders-table .contacts-row {
    grid-template-columns: minmax(145px, .95fr) minmax(150px, 1.45fr) .82fr minmax(145px, 1.15fr) minmax(120px, .92fr) .82fr .42fr;
}

.orders-table.quotes-table .contacts-head,
.orders-table.quotes-table .contacts-row {
    grid-template-columns: minmax(145px, .95fr) minmax(180px, 1.7fr) .9fr .82fr .42fr;
}

.fiscal-list-document {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    max-width: 100%;
    min-height: 36px;
    padding: 5px 8px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    color: var(--list-text-primary, var(--text-strong));
    background: var(--list-surface-soft, var(--panel-soft));
}

.fiscal-list-document img {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    object-fit: contain;
}

.fiscal-list-document > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.fiscal-list-document strong {
    color: currentColor;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.1;
}

.fiscal-list-document small {
    width: fit-content;
    max-width: 100%;
    border: 0;
    border-radius: 999px;
    padding: 0;
    color: currentColor;
    background: transparent;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.fiscal-list-document.is-authorized {
    border-color: rgba(34, 197, 94, .35);
    color: #86efac;
    background: rgba(34, 197, 94, .14);
}

.fiscal-list-document.is-cancelled,
.fiscal-list-document.is-error {
    border-color: rgba(239, 68, 68, .35);
    color: #fca5a5;
    background: rgba(239, 68, 68, .14);
}

.fiscal-list-document.is-rejected {
    border-color: rgba(245, 158, 11, .35);
    color: #fcd34d;
    background: rgba(245, 158, 11, .14);
}

:root[data-theme="light"] .fiscal-list-document.is-authorized {
    color: #047857;
    background: #dcfce7;
}

:root[data-theme="light"] .fiscal-list-document.is-cancelled,
:root[data-theme="light"] .fiscal-list-document.is-error {
    color: #b91c1c;
    background: #fee2e2;
}

:root[data-theme="light"] .fiscal-list-document.is-rejected {
    color: #b45309;
    background: #fef3c7;
}

.fiscal-list-empty {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.order-receivable-indicator {
    display: block;
    margin-top: 4px;
    color: var(--success);
    font-size: 11px;
    font-weight: 800;
}

.order-stock-indicator {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    font-weight: 800;
}

.order-stock-indicator.is-lancado {
    color: var(--success);
}

.order-stock-indicator.is-pendente {
    color: var(--muted);
}

.order-payment-cell {
    display: grid;
    align-content: center;
    gap: 3px;
    min-width: 0;
}

.order-payment-method {
    display: block;
    max-width: 100%;
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-payment-status {
    width: fit-content;
    max-width: 100%;
    margin-top: 0;
    color: var(--list-text-secondary, var(--muted));
    font-family: "Poppins";
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-origin-pill {
    min-width: 18px;
    min-height: 18px;
    margin-left: 0;
    padding: 0 5px;
    font-size: 9px;
    line-height: 1;
    vertical-align: middle;
}

.order-origin-pill.is-pdv {
    border-color: #17c979;
    color: #047857;
    background: rgba(23, 201, 121, .14);
}

.order-origin-pill.is-order {
    border-color: #5a96ff;
    color: #2563eb;
    background: rgba(90, 150, 255, .12);
}

.order-origin-pill.is-consignment {
    border-color: #f0b84f;
    color: #b7791f;
    background: rgba(240, 184, 79, .16);
}

.order-origin-pill.is-tele-venda {
    border-color: #8b5cf6;
    color: #6d28d9;
    background: rgba(139, 92, 246, .16);
}

.order-tiny-badge {
    width: 16px;
    height: 16px;
    margin-left: 6px;
    vertical-align: middle;
    object-fit: contain;
    border-radius: 3px;
}

.orders-footer-totals {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 30px;
    color: var(--text-strong);
}

.orders-footer-totals strong {
    display: grid;
    gap: 3px;
    min-width: 88px;
    text-align: right;
    font-size: 13px;
    font-weight: 950;
}

.orders-footer-totals small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.consignments-table .contacts-head,
.consignments-table .contacts-row {
    grid-template-columns: .9fr 1.7fr .8fr .9fr .8fr .95fr .95fr .45fr;
}

.consign-items-list,
.consign-settle-list {
    display: grid;
    gap: 8px;
}

.consign-items-head,
.consign-item-row {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) 150px 160px;
    gap: 10px;
    align-items: end;
}

.consign-items-head,
.consign-settle-head {
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.consign-item-row select,
.consign-item-row input,
.consign-settle-row input {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font-weight: 800;
}

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

.consign-summary article {
    display: grid;
    gap: 5px;
    min-height: 72px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 12px;
    background: color-mix(in srgb, var(--input) 78%, var(--panel) 22%);
}

.consign-summary span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.consign-summary strong {
    color: var(--text-strong);
    font-size: 15px;
    font-weight: 950;
}

.consign-settle-head,
.consign-settle-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.6fr) repeat(4, minmax(82px, .55fr)) minmax(118px, .7fr) minmax(118px, .7fr);
    gap: 8px;
    align-items: center;
}

.consign-settle-row {
    min-height: 58px;
    border-bottom: 1px solid var(--line-soft);
    padding: 7px 0;
}

.consign-settle-row strong,
.consign-settle-row span {
    color: var(--text-strong);
    font-weight: 850;
}

.consign-settle-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.nfce-list-status {
    width: fit-content;
    max-width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 4px;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 950;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
}

.nfce-list-status.is-authorized {
    color: #047857;
    background: #d1fae5;
}

.nfce-list-status.is-error {
    color: #b91c1c;
    background: #fff7ed;
}

.receivable-totals {
    min-width: min(620px, 100%);
    display: grid;
    gap: 5px;
    color: var(--text-strong);
    font-size: 12px;
}

.receivable-total-head,
.receivable-total-values {
    display: grid;
    grid-template-columns: .7fr 1.15fr 1.15fr 1.15fr 1.15fr;
    align-items: center;
    gap: 14px;
    text-align: right;
}

.receivable-total-head {
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.receivable-total-head span:first-child,
.receivable-total-values strong:first-child {
    text-align: left;
}

.receivable-totals span,
.receivable-totals strong {
    white-space: nowrap;
}

.receivable-totals .is-danger {
    color: var(--danger);
}

.cashflow-totals {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.cashflow-totals strong {
    margin-left: 6px;
    color: var(--text-strong);
}

/* Fluxo de caixa: resumo, barra de filtros, analise por categoria e lista */
.dashboard.cashflow-dashboard {
    height: auto;
    min-height: 100svh;
    overflow: visible;
}

.cashflow-dashboard .dash-main {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: auto;
    min-height: 100svh;
    overflow: visible;
}

.cf-resumo {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 10px;
}

.cf-resumo .doc-resumo-card {
    overflow: hidden;
}

.cf-resumo .doc-resumo-card strong {
    font-size: 17px;
    white-space: nowrap;
}

.dashboard.cashflow-dashboard:not(.dashboard-home) .cf-table .contacts-row {
    min-height: 54px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.cf-card .cashflow-account-tabs {
    min-height: 38px;
    margin: 8px 12px 0;
}

.cf-card .cashflow-account-tab {
    min-height: 38px;
    padding: 0 14px;
    font-size: 12px;
}

.cf-card .cf-table .contacts-head {
    min-height: 40px;
}

.cf-table .cashflow-historico strong {
    font-size: 13px;
}

.cashflow-dashboard .page-top {
    margin-bottom: 12px;
}

.cf-analise {
    margin-bottom: 10px;
}

.cf-filterbar {
    display: grid;
    gap: 12px;
    padding: 4px 18px 16px;
}

.cf-filtros > summary small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-quick {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}

.cf-segmented {
    display: inline-flex;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-soft);
}

.cf-segmented a {
    padding: 8px 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.cf-segmented a + a {
    border-left: 1px solid var(--line);
}

.cf-segmented a.is-active {
    color: #fff;
    background: var(--brand);
}

.cf-chips {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.cf-chip {
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: var(--panel);
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.cf-chip:hover {
    color: var(--text-strong);
    border-color: var(--brand);
}

.cf-chip.is-active {
    color: var(--brand);
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, var(--panel));
}

.cf-filter-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
}

.cf-field-busca {
    grid-column: span 2;
}

.cf-field {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.cf-field input,
.cf-field select {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--text-strong);
    background: var(--panel);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
}

.cf-filter-actions {
    display: flex;
    gap: 8px;
}

.cf-analise {
    display: block;
    margin-bottom: 10px;
    padding: 0;
}

.cf-analise > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 12px;
    padding: 14px 18px;
    color: var(--text-strong);
    font-size: 15px;
    font-weight: 900;
    cursor: pointer;
}

.cf-analise > summary small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.cf-analise-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 28px;
    padding: 0 18px 16px;
}

.cf-analise-col h3 {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .4px;
    text-transform: uppercase;
}

.cf-analise-col h3 strong {
    font-size: 14px;
    letter-spacing: 0;
}

.cf-cat-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 10px;
    padding: 7px 8px;
    border-radius: 8px;
    color: var(--text-strong);
    text-decoration: none;
}

.cf-cat-row:hover,
.cf-cat-row.is-active {
    background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

.cf-cat-name {
    overflow: hidden;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cf-cat-value {
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}

.cf-cat-value small {
    margin-left: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.cf-cat-bar {
    grid-column: 1 / -1;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line-soft, var(--line));
}

.cf-cat-bar i {
    display: block;
    height: 100%;
    border-radius: inherit;
}

.cf-analise-col.is-entradas .cf-cat-bar i {
    background: var(--success);
}

.cf-analise-col.is-saidas .cf-cat-bar i {
    background: #ef4444;
}

.cf-mais > summary {
    padding: 6px 8px;
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.dashboard.cashflow-dashboard:not(.dashboard-home) .cf-card.contacts-card,
.dashboard.cashflow-dashboard:not(.dashboard-home) .cf-analise.contacts-card {
    height: auto;
    min-height: 0;
}

.dashboard.cashflow-dashboard:not(.dashboard-home) .cf-card.contacts-card {
    grid-template-rows: auto auto auto;
}

.cf-card .contacts-scroll {
    max-height: min(62svh, 640px);
}

/* Desktop: a pagina ocupa a tela e so a lista rola (os paineis encolhidos liberam espaco para ela). */
@media (min-width: 769px) {
    .dashboard.cashflow-dashboard {
        height: 100svh;
        min-height: 0;
        overflow: hidden;
    }

    .cashflow-dashboard .dash-main {
        height: 100svh;
        min-height: 0;
        overflow-y: auto;
    }

    .cashflow-dashboard .dash-main > * {
        flex: 0 0 auto;
    }

    .dashboard.cashflow-dashboard:not(.dashboard-home) .cf-card.contacts-card {
        flex: 1 1 auto;
        min-height: min(560px, 75svh);
        grid-template-rows: auto minmax(0, 1fr) auto;
    }

    .cf-card .cf-table {
        min-height: 0;
    }

    .cf-card .contacts-scroll {
        max-height: none;
    }
}

.cashflow-table.cf-table .contacts-head,
.cashflow-table.cf-table .contacts-row {
    grid-template-columns: minmax(78px, .7fr) minmax(170px, 2fr) minmax(110px, 1.1fr) minmax(110px, 1.1fr) minmax(76px, .8fr) minmax(110px, 1fr) 48px;
}

.cf-table .cashflow-historico small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    white-space: normal;
}

.cf-table .contacts-row > span.cf-cat-cell {
    overflow: visible;
    white-space: normal;
}

.cf-cat-pill {
    display: inline-block;
    max-width: 100%;
    padding: 4px 10px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line));
    border-radius: 999px;
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 9%, var(--panel));
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.cf-cat-pill.is-empty {
    border-style: dashed;
    border-color: var(--line);
    color: var(--muted);
    background: transparent;
    font-weight: 600;
}

.cf-cat-pill:hover {
    border-color: var(--brand);
}

.cf-valor small {
    display: block;
    margin-top: 1px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
}

@media (max-width: 760px) {
    .cf-resumo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cf-table {
        overflow-x: auto;
    }

    .cf-table .contacts-head,
    .cf-table .contacts-row,
    .cf-table .contacts-scroll {
        min-width: 760px;
    }

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

    .cf-field-busca {
        grid-column: 1 / -1;
    }

    .cf-analise-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .cf-segmented {
        width: 100%;
    }

    .cf-segmented a {
        flex: 1;
        text-align: center;
    }
}

.cashflow-saldo-real {
    padding-left: 18px;
    border-left: 1px solid var(--line-soft);
}

.cashflow-saldo-real strong {
    font-size: 13px;
}

.cash-in {
    color: var(--success);
}

.cash-out {
    color: var(--danger);
}

.stock-main {
    height: 100svh;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-height: 0;
    overflow: hidden;
}

.stock-main .page-top {
    align-items: flex-start;
}

.stock-main .page-top > div:first-child {
    min-width: 0;
}

.stock-main .page-top p {
    white-space: normal;
}

.stock-main .list-actions {
    flex-wrap: wrap;
    min-width: min(100%, 600px);
}

.stock-main .search-input {
    flex: 1 1 280px;
    width: auto;
}

.filter-select {
    min-width: 160px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--panel);
    font-weight: 800;
}

.date-filter {
    min-width: 138px;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--panel);
    font-weight: 800;
}

.mp-finance-top {
    display: grid;
    grid-template-columns: minmax(250px, 390px) minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    margin-bottom: 16px;
}

.mp-finance-top > div:first-child {
    min-width: 0;
}

.mp-finance-top h1,
.mp-finance-top p {
    white-space: normal;
}

.mp-finance-actions {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) minmax(132px, .58fr) minmax(132px, .58fr) 138px 138px auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow: visible;
    padding-bottom: 0;
}

.mp-finance-actions .search-input {
    width: auto;
    min-width: 0;
}

.mp-finance-actions .filter-select,
.mp-finance-actions .date-filter,
.mp-finance-actions .secondary-action {
    width: 100%;
    min-width: 0;
}

.mp-sync-form {
    display: flex;
    justify-content: flex-end;
    min-width: 0;
}

.mp-sync-form .primary-action {
    height: 44px;
    padding-inline: 18px;
    white-space: nowrap;
}

.mp-finance-summary {
    margin-bottom: 2px;
}

.mp-finance-card {
    height: min(calc(100svh - 230px), 700px);
}

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

.stock-summary article {
    min-height: 86px;
    display: grid;
    align-content: center;
    gap: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 16px 18px;
    background: var(--panel);
    box-shadow: var(--shadow);
}

.stock-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.stock-summary strong {
    color: var(--text-strong);
    font-size: 24px;
    line-height: 1;
}

.stock-movement-card {
    height: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 20px;
}

.stock-movement-head {
    display: flex;
    align-items: baseline;
    gap: 12px;
    min-width: 0;
}

.stock-movement-head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.35;
    white-space: nowrap;
}

.stock-movement-card h2,
.section-inline-head h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 18px;
}

.stock-movement-fields {
    display: grid;
    grid-template-columns: minmax(240px, 1.7fr) minmax(130px, .65fr) minmax(150px, .7fr) minmax(200px, 1fr) auto;
    align-items: end;
    gap: 12px;
    min-width: 0;
}

.stock-movement-card label {
    display: grid;
    gap: 7px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
}

.stock-movement-card input,
.stock-movement-card select,
.stock-movement-card textarea {
    width: 100%;
    min-height: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--text-strong);
    background: var(--panel);
    font: inherit;
    font-weight: 700;
    resize: vertical;
}

.stock-movement-card .primary-action {
    min-height: 44px;
    align-self: end;
    white-space: nowrap;
}

.stock-card,
.stock-history-card {
    min-width: 0;
    overflow: hidden;
}

.stock-card {
    width: 100%;
    height: auto;
    min-height: 0;
    flex: 1 1 auto;
}

.stock-card .contacts-table {
    height: 100%;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.stock-card .contacts-scroll {
    min-height: 0;
}

.stock-row-options {
    width: 32px;
    height: 32px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}

.stock-row-options:hover,
.stock-row-options:focus-visible {
    color: var(--brand);
    border-color: color-mix(in srgb, var(--brand) 45%, var(--line-soft));
    background: color-mix(in srgb, var(--brand) 8%, transparent);
}

.stock-history-card {
    height: auto;
    min-height: 0;
}

.stock-history-card .contacts-table {
    grid-template-rows: auto auto;
}

.stock-history-card .contacts-scroll {
    max-height: 260px;
}

.stock-history-card .empty-row {
    min-height: 72px;
    display: flex;
    align-items: center;
}

.purchase-sync-status {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    margin-top: 14px;
    border: 1px solid rgba(66, 111, 164, .24);
    border-radius: 10px;
    background: rgba(66, 111, 164, .08);
    color: var(--text);
    padding: 10px 12px;
    line-height: 1.35;
}

.purchase-sync-status strong {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.purchase-sync-status span {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.purchase-table .contacts-row small,
.purchase-items-table .contacts-row small {
    overflow-wrap: anywhere;
}

.purchase-open-row {
    cursor: pointer;
}

.purchase-open-row:hover {
    background: rgba(66, 111, 164, .12);
}

.purchase-open-row:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: -2px;
}

.purchase-import-card {
    max-width: 720px;
}

.purchase-import-card form {
    display: grid;
    gap: 12px;
    padding-top: 12px;
}

.purchase-search-actions {
    min-width: 120px;
}

.purchase-page-top {
    align-items: flex-start;
    gap: 16px;
}

.purchase-page-top > div:first-child {
    flex: 1 1 320px;
    min-width: 280px;
    max-width: 520px;
}

.purchase-page-top p {
    white-space: normal;
    line-height: 1.35;
}

.purchase-top-actions {
    flex: 1 1 320px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    justify-content: flex-end;
}

.purchase-top-actions .search-input {
    width: 100%;
    min-width: 0;
}

.purchase-top-actions .ghost-action,
.purchase-top-actions .secondary-action,
.purchase-top-actions .primary-action {
    width: auto;
    min-width: 120px;
}

.purchase-top-actions .action-cell {
    min-width: 0;
}

.purchase-search-actions > .primary-action {
    width: 100%;
}

.purchase-list-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(92px, auto));
    gap: 18px;
    align-items: center;
}

.purchase-list-totals span {
    display: grid;
    gap: 2px;
    color: var(--text);
    font-weight: 900;
    text-align: center;
}

.purchase-list-totals strong {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.purchase-search-modal-card {
    width: min(980px, calc(100vw - 28px));
    max-height: min(90vh, 820px);
    overflow: auto;
}

.purchase-modal-summary {
    margin: 12px 0;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.purchase-modal-summary article {
    min-width: 0;
    padding: 14px 12px;
}

.purchase-modal-summary strong {
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-size: clamp(17px, 1.5vw, 22px);
    line-height: 1.08;
}

.purchase-modal-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    padding-top: 12px;
}

.purchase-modal-form.compact {
    grid-template-columns: minmax(0, 1fr) minmax(180px, 240px);
}

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

.ciot-viagem-form .purchase-modal-actions {
    grid-column: 1 / -1;
}

.purchase-modal-form label {
    display: grid;
    gap: 8px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 800;
}

.purchase-modal-form input,
.purchase-modal-form select,
.purchase-modal-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-weight: 750;
    outline: 0;
}

.purchase-modal-form textarea {
    min-height: 92px;
    padding-top: 10px;
    resize: vertical;
}

.purchase-modal-form input:focus,
.purchase-modal-form select:focus,
.purchase-modal-form textarea:focus {
    border-color: rgba(66, 111, 164, .58);
    box-shadow: 0 0 0 3px rgba(66, 111, 164, .14);
}

.purchase-modal-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.purchase-timer-status {
    display: grid;
    gap: 4px;
    margin: 12px 0 4px;
    border: 1px solid rgba(66, 111, 164, .28);
    border-radius: 10px;
    background: rgba(66, 111, 164, .08);
    padding: 11px 12px;
}

.purchase-timer-status strong {
    color: var(--text-strong);
    font-size: 14px;
}

.purchase-timer-status span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.checkbox-line {
    height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
}

.checkbox-line input {
    width: 16px;
    height: 16px;
    margin: 0;
}

.ghost-action.is-danger {
    border-color: rgba(244, 84, 108, .38);
    color: var(--danger);
}

.purchase-search-log {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.purchase-search-log h3 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
}

.purchase-search-log div {
    display: grid;
    grid-template-columns: minmax(120px, .7fr) minmax(120px, .55fr) minmax(0, 1.75fr);
    gap: 10px;
    align-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 9px 10px;
    background: var(--panel-soft);
}

.purchase-search-log strong,
.purchase-search-log span,
.purchase-search-log small {
    min-width: 0;
}

.purchase-search-log small {
    color: var(--muted);
    font-weight: 750;
    overflow-wrap: anywhere;
}

.purchase-danfe-modal-card {
    width: 80vw;
    max-width: 1680px;
    min-width: min(980px, calc(100vw - 18px));
    max-height: min(92vh, 860px);
    overflow: auto;
}

.purchase-danfe-modal-card [data-purchase-danfe-content] {
    min-width: 0;
}

.purchase-stock-modal-card {
    width: min(1280px, calc(100vw - 24px));
    max-width: min(1280px, calc(100vw - 24px));
    max-height: min(92vh, 860px);
    overflow: auto;
}

.purchase-stock-map {
    display: grid;
    gap: 14px;
}

.purchase-stock-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 12px;
    background: rgba(66, 111, 164, .08);
}

.purchase-stock-head h3 {
    margin: 0 0 4px;
    font-size: 18px;
}

.purchase-stock-head p {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.purchase-cost-mode {
    display: grid;
    grid-template-columns: minmax(220px, 1.1fr) repeat(3, minmax(170px, 1fr));
    gap: 10px;
    align-items: stretch;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 12px;
    background: var(--panel);
}

.purchase-cost-mode > div,
.purchase-cost-mode label {
    min-width: 0;
}

.purchase-cost-mode > div strong,
.purchase-cost-mode label span {
    display: block;
    color: var(--text-strong);
    font-weight: 950;
}

.purchase-cost-mode > div span,
.purchase-cost-mode label small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
}

.purchase-cost-mode label {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3px 8px;
    align-content: start;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    background: color-mix(in srgb, var(--input) 82%, transparent);
}

.purchase-cost-mode label input {
    grid-row: 1 / span 2;
    margin-top: 2px;
}

.purchase-stock-list {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    overflow: hidden;
}

.purchase-stock-list-head,
.purchase-stock-row {
    display: grid;
    grid-template-columns: minmax(240px, 1.35fr) minmax(220px, 1.1fr) minmax(150px, .65fr) minmax(240px, 1fr);
    gap: 12px;
    align-items: center;
    padding: 10px 12px;
}

.purchase-stock-list-head {
    background: rgba(66, 111, 164, .12);
    color: var(--text);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.purchase-stock-row {
    border-top: 1px solid var(--line-soft);
}

.purchase-stock-row > *,
.purchase-stock-list-head > * {
    min-width: 0;
}

.purchase-stock-row strong {
    display: block;
    overflow-wrap: anywhere;
}

.purchase-stock-row small {
    display: block;
    color: var(--muted);
    font-weight: 700;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.purchase-stock-row label {
    margin: 0;
}

.purchase-stock-row select {
    width: 100%;
}

.purchase-stock-actions {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(220px, 1fr);
    gap: 12px;
    justify-content: end;
}

.purchase-danfe {
    background: #fff;
    color: #07122a;
    border: 1px solid #1f4f8c;
    border-radius: 10px;
    padding: 16px;
    font-family: Arial, Helvetica, sans-serif;
}

.purchase-danfe-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 12px;
    align-items: stretch;
    border-bottom: 2px solid #07122a;
    padding-bottom: 10px;
}

.purchase-danfe-header h3 {
    margin: 0 0 5px;
    font-size: 17px;
    line-height: 1.2;
    text-transform: uppercase;
}

.purchase-danfe-header p,
.purchase-danfe-access span,
.purchase-danfe-grid span,
.purchase-danfe-footer span {
    margin: 0;
    color: #26334d;
    font-size: 12px;
    font-weight: 700;
}

.purchase-danfe-box {
    border: 1px solid #07122a;
    border-radius: 8px;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 10px;
}

.purchase-danfe-box strong {
    font-size: 22px;
}

.purchase-danfe-box span {
    font-size: 12px;
    font-weight: 700;
}

.purchase-danfe-access {
    text-align: center;
    padding: 10px 0;
    border-bottom: 1px dashed #07122a;
}

.purchase-danfe-access strong {
    display: block;
    font-size: 14px;
    letter-spacing: .4px;
    overflow-wrap: anywhere;
}

.purchase-danfe-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 0;
    border-bottom: 1px dashed #07122a;
}

.purchase-danfe-grid div,
.purchase-danfe-footer div {
    border: 1px solid #c7d2e2;
    border-radius: 8px;
    padding: 8px;
}

.purchase-danfe-grid strong,
.purchase-danfe-footer strong {
    display: block;
    margin-top: 3px;
    font-size: 14px;
}

.purchase-danfe-warning {
    margin: 10px 0;
    border-radius: 8px;
    background: rgba(245, 158, 11, .16);
    color: #8a4b00;
    padding: 10px;
    font-weight: 800;
}

.purchase-danfe-section {
    padding-top: 10px;
}

.purchase-danfe-section h4 {
    margin: 0 0 8px;
    font-size: 15px;
    text-transform: uppercase;
}

.purchase-danfe-items {
    border: 1px solid #07122a;
    border-radius: 8px;
    overflow: hidden;
}

.purchase-danfe-items-head,
.purchase-danfe-item {
    display: grid;
    grid-template-columns: 76px minmax(220px, 1fr) 80px 54px 92px 92px;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
}

.purchase-danfe-items-head {
    background: #eef3f9;
    font-weight: 900;
    font-size: 12px;
    text-transform: uppercase;
}

.purchase-danfe-item {
    border-top: 1px solid #d8e0ec;
    font-size: 13px;
}

.purchase-danfe-item span:nth-child(2) {
    font-weight: 800;
}

.purchase-danfe-empty {
    padding: 18px;
    text-align: center;
    color: #667085;
    font-weight: 800;
}

.purchase-danfe-footer {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.purchase-nfe-view {
    border-color: #d7dde8;
    border-radius: 8px;
    box-shadow: none;
    font-size: 13px;
    max-width: 100%;
    overflow-x: hidden;
}

.purchase-nfe-title {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    border-bottom: 1px solid #d7dde8;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.purchase-nfe-title h3 {
    margin: 0;
    font-size: 20px;
    color: #07122a;
}

.purchase-nfe-title p {
    margin: 4px 0 0;
    color: #667085;
    font-weight: 700;
}

.purchase-nfe-status span {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 900;
}

.purchase-nfe-status .is-ok {
    color: #067647;
    background: #d1fadf;
}

.purchase-nfe-status .is-warn {
    color: #92400e;
    background: #fef3c7;
}

.purchase-nfe-status .is-error {
    color: #b42318;
    background: #fee4e2;
}

.purchase-nfe-message {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    border: 1px solid #e4e9f2;
    background: #f8fafc;
    border-radius: 8px;
    padding: 10px;
    color: #475467;
    overflow-wrap: anywhere;
}

.purchase-nfe-panel {
    border-top: 1px solid #d7dde8;
    padding-top: 12px;
    margin-top: 12px;
}

.purchase-nfe-panel h4 {
    margin: 0 0 10px;
    color: #07122a;
    font-size: 15px;
}

.purchase-nfe-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 8px;
}

.purchase-nfe-grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.purchase-nfe-grid.three { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.purchase-nfe-grid.four { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.purchase-nfe-grid.six { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.purchase-nfe-grid div {
    min-width: 0;
}

.purchase-manifest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.purchase-manifest-form {
    min-width: 0;
}

.purchase-manifest-option {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #d0d5dd;
    border-radius: 10px;
    background: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.purchase-manifest-option:hover:not(.is-disabled):not(:disabled) {
    border-color: #1d4ed8;
    box-shadow: 0 0 0 1px rgba(29, 78, 216, .15);
}

.purchase-manifest-option-head {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.purchase-manifest-option-head strong {
    color: #07122a;
    font-size: 13px;
}

.purchase-manifest-option-head small {
    margin-left: auto;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
}

.purchase-manifest-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #17a34a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    flex: none;
}

.purchase-manifest-option.is-active {
    border-color: #17a34a;
    background: #f0fdf4;
    box-shadow: 0 0 0 1px rgba(23, 163, 74, .2);
}

.purchase-manifest-option.is-active .purchase-manifest-option-head strong {
    color: #15803d;
}

.purchase-manifest-option.is-disabled,
.purchase-manifest-option:disabled {
    border-color: #e4e7ec;
    background: #f9fafb;
    color: #98a2b3;
    cursor: not-allowed;
}

.purchase-manifest-option.is-disabled .purchase-manifest-option-head strong,
.purchase-manifest-option:disabled .purchase-manifest-option-head strong {
    color: #98a2b3;
}

.purchase-manifest-just .purchase-manifest-option {
    cursor: default;
}

.purchase-manifest-just textarea {
    min-height: 60px;
    padding: 8px 10px;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    font: inherit;
    resize: vertical;
}

.purchase-manifest-just textarea:disabled {
    background: #f9fafb;
    color: #98a2b3;
}

.purchase-manifest-just button {
    align-self: flex-start;
}

.purchase-nfe-grid span,
.purchase-nfe-address,
.purchase-nfe-info {
    color: #667085;
    font-size: 12px;
    font-weight: 700;
}

.purchase-nfe-grid strong {
    display: block;
    margin-top: 3px;
    color: #07122a;
    font-size: 13px;
    overflow-wrap: anywhere;
}

.purchase-nfe-address,
.purchase-nfe-info {
    margin: 6px 0 0;
    color: #344054;
    line-height: 1.45;
}

.purchase-nfe-items {
    border: 1px solid #d7dde8;
    border-radius: 8px;
    overflow: hidden;
    min-width: 0;
}

.purchase-nfe-items-head,
.purchase-nfe-item {
    display: grid;
    grid-template-columns: 42px minmax(0, 1.8fr) minmax(74px, .7fr) 44px minmax(62px, .55fr) minmax(76px, .65fr) minmax(76px, .65fr);
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    min-width: 0;
}

.purchase-nfe-items-head {
    background: #f2f5f9;
    color: #07122a;
    font-size: 12px;
    font-weight: 900;
}

.purchase-nfe-item {
    border-top: 1px solid #edf1f7;
    color: #344054;
}

.purchase-nfe-item > *,
.purchase-nfe-items-head > *,
.purchase-nfe-payments > div > * {
    min-width: 0;
    overflow-wrap: anywhere;
}

.purchase-nfe-item strong {
    color: #07122a;
}

.purchase-nfe-payments {
    border: 1px solid #d7dde8;
    border-radius: 8px;
    overflow: hidden;
}

.purchase-nfe-payments > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(110px, 140px);
    gap: 10px;
    padding: 8px 10px;
    border-top: 1px solid #edf1f7;
}

.purchase-nfe-payments > div:first-child {
    border-top: 0;
}

.purchase-nfe-payments-head {
    background: #f2f5f9;
    color: #07122a;
    font-weight: 900;
}

.purchase-contra-nfe {
    display: grid;
    gap: 12px;
    background: #fff;
    color: #07122a;
    border: 1px solid #d7dde8;
    border-radius: 10px;
    padding: 14px;
}

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

.purchase-contra-form-grid label,
.purchase-contra-full {
    display: grid;
    gap: 6px;
    margin: 0;
}

.purchase-contra-form-grid span,
.purchase-contra-full span {
    color: #07122a;
    font-size: 12px;
    font-weight: 900;
}

.purchase-contra-form-grid input,
.purchase-contra-form-grid select,
.purchase-contra-full textarea {
    width: 100%;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--input);
    color: var(--text-strong);
    font-weight: 800;
}

.purchase-contra-full {
    margin-top: 12px;
}

.purchase-contra-print {
    display: grid;
    gap: 4px;
    margin-top: 10px;
    border: 1px dashed #98a2b3;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.purchase-contra-print strong {
    color: #07122a;
    font-size: 16px;
}

.purchase-contra-print span {
    color: #344054;
    font-weight: 800;
}

.purchase-contra-pdf-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
    gap: 14px;
    margin-top: 12px;
    align-items: stretch;
}

.purchase-contra-pdf-frame {
    width: 100%;
    height: min(68vh, 720px);
    min-height: 520px;
    border: 1px solid #d7dde8;
    border-radius: 8px;
    background: #fff;
}

.purchase-contra-pdf-side {
    display: grid;
    align-content: start;
    gap: 10px;
    border: 1px solid #d7dde8;
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.purchase-contra-pdf-side strong {
    color: #07122a;
    font-size: 16px;
}

.purchase-contra-pdf-side span,
.purchase-contra-pdf-side small {
    color: #667085;
    font-weight: 800;
}

.purchase-contra-pdf-side div {
    border-top: 1px solid #d7dde8;
    padding-top: 8px;
}

.purchase-contra-pdf-side b {
    display: block;
    margin-top: 3px;
    color: #07122a;
    overflow-wrap: anywhere;
}

.purchase-entry-danfe-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.purchase-entry-danfe-frame {
    width: 100%;
    height: min(68vh, 720px);
    min-height: 520px;
    border: 1px solid #d7dde8;
    border-radius: 8px;
    background: #fff;
}

.purchase-entry-danfe-side {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid #d7dde8;
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.purchase-entry-danfe-side strong {
    color: #07122a;
    font-size: 16px;
}

.purchase-entry-danfe-side span,
.purchase-entry-danfe-side small {
    color: #667085;
    font-weight: 800;
}

.purchase-entry-danfe-side div {
    border-left: 1px solid #d7dde8;
    padding-left: 10px;
}

.purchase-entry-danfe-side b {
    display: block;
    margin-top: 3px;
    color: #07122a;
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .purchase-contra-pdf-layout,
    .purchase-entry-danfe-layout {
        grid-template-columns: 1fr;
    }
}

.purchase-contra-cancel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(180px, 240px);
    gap: 12px;
    align-items: end;
    margin-top: 12px;
    border-top: 1px solid #d7dde8;
    padding-top: 12px;
}

.purchase-contra-cancel label {
    display: grid;
    gap: 6px;
    margin: 0;
}

.purchase-contra-cancel span {
    color: #07122a;
    font-size: 12px;
    font-weight: 900;
}

.purchase-contra-cancel input {
    width: 100%;
}

.stock-main .contacts-table {
    width: 100%;
    min-width: 0;
}

.stock-main .contacts-scroll {
    overflow-x: auto;
    overflow-y: auto;
}

.stock-main .contacts-head,
.stock-main .contacts-row {
    min-width: 720px;
    padding-right: 18px;
    padding-left: 18px;
}

.stock-main .contacts-head > span,
.stock-main .contacts-row > span,
.stock-main .contacts-row > div,
.stock-main .contacts-row strong {
    min-width: 0;
}

.stock-main .contacts-row > span,
.stock-main .contacts-row small,
.stock-main .contacts-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stock-row {
    color: inherit;
    text-decoration: none;
}

.stock-row .is-positive {
    color: var(--success);
}

.stock-row .is-zero {
    color: var(--muted);
}

.stock-row .is-negative {
    color: var(--danger);
}

.section-inline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px 0;
}

.section-inline-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

@media (max-width: 1100px) {
    .stock-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .purchase-page-top {
        display: grid;
        grid-template-columns: 1fr;
    }

    .purchase-page-top > div:first-child {
        max-width: none;
    }

    .purchase-top-actions {
        width: 100%;
    }

    .purchase-modal-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .purchase-modal-form,
    .purchase-modal-form.compact,
    .purchase-search-log div {
        grid-template-columns: 1fr;
    }

    .purchase-cost-mode {
        grid-template-columns: 1fr;
    }

    .purchase-stock-list-head {
        display: none;
    }

    .purchase-stock-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .purchase-stock-actions {
        grid-template-columns: 1fr;
    }

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

    .stock-movement-card .primary-action {
        grid-column: 1 / -1;
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 760px) {
    .purchase-top-actions {
        justify-content: stretch;
    }

    .purchase-top-actions .ghost-action,
    .purchase-top-actions .action-cell {
        flex: 1 1 140px;
    }

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

@media (max-width: 860px) {
    .stock-movement-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .stock-movement-head p {
        white-space: normal;
    }

    .stock-movement-fields {
        grid-template-columns: 1fr;
    }

    .stock-movement-card .primary-action {
        grid-column: auto;
        justify-content: center;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .stock-summary {
        grid-template-columns: 1fr;
    }

    .section-inline-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .stock-card {
        height: 440px;
    }
}

.user-list-name {
    min-width: 0;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.user-list-name .avatar {
    width: 34px;
    height: 34px;
}

.contacts-head {
    min-height: 52px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.contacts-row {
    min-height: 64px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
}

.contacts-row:hover {
    background: rgba(65, 106, 157, .08);
}

.contacts-row strong {
    display: block;
    color: var(--text-strong);
    font-size: 15px;
    line-height: 1.18;
}

.contacts-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.contact-name-cell {
    min-width: 0;
}

.contact-name-cell strong,
.contact-fantasia {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.contact-fantasia {
    color: var(--brand-strong);
    font-style: italic;
    font-weight: 600;
}

.type-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 11px;
    border: 1px solid #5a96ff;
    border-radius: 999px;
    color: #5a96ff;
    background: rgba(90, 150, 255, .1);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.type-pill.is-supplier {
    border-color: #b66cff;
    color: #b66cff;
    background: rgba(182, 108, 255, .12);
}

.type-pill.is-admin {
    border-color: #17c979;
    color: #17c979;
    background: rgba(23, 201, 121, .12);
}

.type-pill.is-service {
    border-color: #f0b84f;
    color: #f0b84f;
    background: rgba(240, 184, 79, .12);
}

.type-pill.is-generated-os {
    border-color: #C084FC;
    color: #C084FC;
    background: rgba(192, 132, 252, .14);
    text-decoration: none;
}

.type-pill[class*="is-status-"] {
    min-width: 78px;
    justify-content: center;
}

.type-pill.is-status-faturado {
    border-color: #2563eb;
    color: #2563eb;
    background: rgba(37, 99, 235, .12);
}

.type-pill.is-status-entregue {
    border-color: #159947;
    color: #127a3a;
    background: rgba(21, 153, 71, .12);
}

.type-pill.is-status-aberto {
    border-color: #2563eb;
    color: #1d4ed8;
    background: rgba(37, 99, 235, .12);
}

.type-pill.is-status-rascunho {
    border-color: #94A3B8;
    color: #94A3B8;
    background: rgba(148, 163, 184, .14);
}

.type-pill.is-status-enviado {
    border-color: #38B6FF;
    color: #38B6FF;
    background: rgba(56, 182, 255, .14);
}

.type-pill.is-status-aprovado,
.type-pill.is-status-aprovada {
    border-color: #02BD37;
    color: #02BD37;
    background: rgba(2, 189, 55, .14);
}

.type-pill.is-status-recusado {
    border-color: #F59E0B;
    color: #F59E0B;
    background: rgba(245, 158, 11, .16);
}

.type-pill.is-status-aberta {
    border-color: #2563eb;
    color: #1d4ed8;
    background: rgba(37, 99, 235, .12);
}

.type-pill.is-status-em_andamento {
    border-color: #ca8a04;
    color: #92650a;
    background: rgba(234, 179, 8, .16);
}

.type-pill.is-status-concluida {
    border-color: #159947;
    color: #127a3a;
    background: rgba(21, 153, 71, .12);
}

.type-pill.is-status-parcial {
    border-color: #ca8a04;
    color: #92650a;
    background: rgba(234, 179, 8, .16);
}

.type-pill.is-status-pago {
    border-color: #159947;
    color: #127a3a;
    background: rgba(21, 153, 71, .12);
}

.type-pill.is-cert-ok {
    border-color: #159947;
    color: #127a3a;
    background: rgba(21, 153, 71, .12);
}

.type-pill.is-cert-alerta {
    border-color: #ca8a04;
    color: #92650a;
    background: rgba(234, 179, 8, .16);
}

.type-pill.is-cert-vencido {
    border-color: #dc2626;
    color: #b91c1c;
    background: rgba(220, 38, 38, .12);
}

.cert-divider {
    margin: 28px 0 24px;
    border: none;
    border-top: 1px solid var(--line-soft);
}

.cert-section h3 {
    margin: 0 0 4px;
    font-size: 18px;
    color: var(--text-strong);
}

.cert-section-sub {
    margin: 0 0 16px;
    color: var(--muted);
    font-size: 13px;
}

.cert-status-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    color: var(--muted-strong);
    font-size: 13px;
}

.cert-aviso-config {
    color: var(--warning);
    font-weight: 700;
}

.cert-form {
    display: grid;
    gap: 12px;
    align-content: start;
    max-width: 480px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
}

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

.cf-section {
    margin-bottom: 20px;
}

.cf-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-strong);
    cursor: pointer;
}

.cf-toggle input {
    width: 18px;
    height: 18px;
}

.cert-alert-card {
    position: sticky;
    top: 12px;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 16px;
    padding: 14px 44px 14px 18px;
    border: 1px solid;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
    transition: opacity .2s ease, transform .2s ease;
}

.cert-alert-card.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

.cert-alert-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
}

.cert-alert-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, .08);
}

.cert-alert-card strong {
    display: block;
    font-size: 14px;
}

.cert-alert-card span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    opacity: .85;
}

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

.cert-alert-card.is-warning {
    border-color: #ca8a04;
    color: #92650a;
    background: rgba(234, 179, 8, .12);
}

.cert-alert-card.is-danger {
    border-color: #dc2626;
    color: #b91c1c;
    background: rgba(220, 38, 38, .1);
}

.cert-form label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted-strong);
}

.type-pill.is-curva-a {
    border-color: #159947;
    color: #127a3a;
    background: rgba(21, 153, 71, .12);
}

.type-pill.is-curva-b {
    border-color: #ca8a04;
    color: #92650a;
    background: rgba(234, 179, 8, .16);
}

.type-pill.is-curva-c {
    border-color: #6b7280;
    color: #4b5563;
    background: rgba(107, 114, 128, .12);
}

.type-pill.is-status-atrasado,
.type-pill.is-status-vencido {
    border-color: #dc2626;
    color: #b91c1c;
    background: rgba(220, 38, 38, .12);
}

.type-pill.is-status-cancelado,
.type-pill.is-status-cancelada {
    border-color: #FF0000;
    color: #FF0000;
    background: rgba(255, 0, 0, .12);
}

.type-pill.is-status-aguardando_pagamento {
    border-color: #f0b84f;
    color: #b7791f;
    background: rgba(240, 184, 79, .14);
}

.type-pill.is-status-expirado {
    border-color: #8a94a6;
    color: #64748b;
    background: rgba(100, 116, 139, .14);
}

.contacts-row .is-due-today {
    color: #92650a;
    background: rgba(234, 179, 8, .18);
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 8px;
    display: inline-block;
}

.type-pill.is-status-estornado {
    border-color: #f0b84f;
    color: #b7791f;
    background: rgba(240, 184, 79, .14);
}

.type-pill.is-status-entrada {
    border-color: #159947;
    color: #127a3a;
    background: rgba(21, 153, 71, .12);
}

.type-pill.is-status-saida {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(255, 91, 102, .12);
}

.type-pill.is-stock-entrada {
    border-color: #17c979;
    color: #17c979;
    background: rgba(23, 201, 121, .12);
}

.type-pill.is-stock-saida {
    border-color: var(--danger);
    color: var(--danger);
    background: rgba(255, 91, 102, .12);
}

.type-pill.is-stock-ajuste {
    border-color: #5a96ff;
    color: #5a96ff;
    background: rgba(90, 150, 255, .1);
}

.dots-button {
    width: 36px;
    height: 32px;
    margin: 0;
    border: 0;
    border-radius: 7px;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    font-size: 18px;
    line-height: 1;
    letter-spacing: .08em;
    cursor: pointer;
}

.dots-button:hover,
.action-cell.is-open .dots-button {
    color: var(--brand);
    background: var(--panel-soft);
}

.action-cell {
    position: relative;
    justify-self: end;
    z-index: 4;
}

.action-cell--inline {
    justify-self: auto;
    display: inline-flex;
}

.dots-button--labeled {
    width: auto;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: normal;
}

.row-actions-menu {
    position: fixed;
    top: var(--row-menu-top, 0);
    left: var(--row-menu-left, 0);
    right: auto;
    z-index: 10050;
    min-width: 210px;
    max-width: min(290px, calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    overflow-y: visible;
    display: none;
    gap: 4px;
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 16px 38px var(--shadow);
}

.action-cell.is-open .row-actions-menu {
    display: grid;
}

.action-cell.is-open {
    z-index: 90;
}

.row-actions-menu form {
    display: contents;
}

.row-actions-menu a,
.row-actions-menu button {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    margin: 0;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--panel-soft);
    box-shadow: none;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.row-actions-menu a:hover,
.row-actions-menu button:hover {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
    text-decoration: none;
}

.row-actions-menu button[data-confirm-delete] {
    border-color: rgba(255, 91, 102, .32);
    color: var(--danger);
    background: rgba(255, 91, 102, .08);
}

.row-actions-menu button[data-confirm-delete]:hover {
    border-color: var(--danger);
    background: var(--danger);
    color: #fff;
}

/* O menu de pedidos usa details nativo para continuar funcional mesmo sem JavaScript. */
.orders-table .order-action-menu > summary {
    display: grid;
    place-items: center;
    list-style: none;
}

.orders-table .order-action-menu > summary::-webkit-details-marker {
    display: none;
}

.orders-table .order-action-menu .row-actions-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    left: auto;
    z-index: 1000;
}

.orders-table .order-action-menu[open] .row-actions-menu {
    display: grid;
}

.orders-table .order-action-menu[open] {
    z-index: 100;
}

.list-actions .ghost-action.is-danger {
    color: var(--danger);
    border-color: color-mix(in srgb, var(--danger) 42%, var(--line-soft));
}

.list-actions .ghost-action:disabled {
    opacity: .48;
    cursor: not-allowed;
}

.contacts-head input[type="checkbox"],
.contacts-row input[type="checkbox"] {
    appearance: none;
    width: 17px;
    height: 17px;
    min-height: 17px;
    display: grid;
    place-content: center;
    margin: 0;
    border: 1.5px solid color-mix(in srgb, var(--muted) 48%, transparent);
    border-radius: 4px;
    background: var(--panel);
    accent-color: var(--brand);
    cursor: pointer;
}

.contacts-head input[type="checkbox"]::before,
.contacts-row input[type="checkbox"]::before {
    content: "";
    width: 8px;
    height: 8px;
    transform: scale(0);
    border-radius: 2px;
    background: var(--brand);
    transition: transform .12s ease;
}

.contacts-head input[type="checkbox"]:checked,
.contacts-row input[type="checkbox"]:checked {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 12%, var(--panel));
}

.contacts-head input[type="checkbox"]:checked::before,
.contacts-row input[type="checkbox"]:checked::before {
    transform: scale(1);
}

.settle-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, .58);
}

.settle-modal.is-open {
    display: flex;
}

.settle-modal-card {
    width: min(680px, 96vw);
    max-height: calc(100vh - 48px);
    display: grid;
    align-content: start;
    gap: 22px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 20px;
    background: var(--panel);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .28);
    overflow-y: auto;
}

.pdv-aviso-emissao-modal {
    z-index: 95;
}

.document-status-card {
    width: min(440px, 94vw);
}

.pdv-aviso-emissao-card {
    width: min(420px, 92vw);
    justify-items: center;
    text-align: center;
    border: 2px solid var(--warning);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .35), 0 0 0 6px color-mix(in srgb, var(--warning) 18%, transparent);
}

.pdv-aviso-emissao-icon {
    font-size: 40px;
    line-height: 1;
}

.pdv-aviso-emissao-card h2 {
    margin: 0;
    font-size: 20px;
}

.pdv-aviso-emissao-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.pdv-aviso-emissao-timer {
    font-family: "Poppins", monospace;
    font-size: 44px;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--warning);
}

.pdv-aviso-emissao-modal.is-expired .pdv-aviso-emissao-card {
    border-color: var(--danger);
}

.pdv-aviso-emissao-modal.is-expired .pdv-aviso-emissao-timer {
    color: var(--danger);
}

.pdv-aviso-emissao-card .settle-actions {
    width: 100%;
    justify-content: center;
}

.pdv-emissao-automatica-loading-card {
    width: min(420px, 92vw);
    justify-items: center;
    text-align: center;
    border: 2px solid var(--brand-strong);
    box-shadow: 0 26px 80px rgba(0, 0, 0, .35), 0 0 0 6px color-mix(in srgb, var(--brand-strong) 18%, transparent);
}

.pdv-emissao-automatica-loading-card h2 {
    margin: 0;
    font-size: 20px;
}

.pdv-emissao-automatica-loading-card p {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.pdv-emissao-automatica-loading-card .pdv-aviso-emissao-icon {
    animation: pdv-emissao-automatica-spin 1.2s linear infinite;
}

@keyframes pdv-emissao-automatica-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.settle-modal-card.purchase-stock-modal-card {
    width: min(1280px, calc(100vw - 24px));
    max-width: min(1280px, calc(100vw - 24px));
}

.purchase-stock-modal-card .purchase-stock-list-head,
.purchase-stock-modal-card .purchase-stock-row {
    grid-template-columns: minmax(260px, 1.15fr) minmax(240px, 1fr);
}

.purchase-stock-modal-card .purchase-stock-list-head span:nth-child(3),
.purchase-stock-modal-card .purchase-stock-list-head span:nth-child(4) {
    display: none;
}

.purchase-stock-modal-card .purchase-stock-row label {
    display: grid;
    gap: 6px;
}

.purchase-stock-modal-card .purchase-stock-row label:nth-of-type(1)::before {
    content: "Ação";
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.purchase-stock-modal-card .purchase-stock-row label:nth-of-type(2)::before {
    content: "Produto cadastrado para lançar";
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.settle-modal-card h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 24px;
    font-weight: 950;
}

.settle-batch-hint {
    margin: -12px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.settle-batch-list {
    display: grid;
    gap: 1px;
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--line-soft);
}

.settle-batch-item {
    display: grid;
    grid-template-columns: 1.4fr 1.4fr auto;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--panel);
    font-size: 13px;
}

.settle-batch-item span:first-child {
    color: var(--text-strong);
    font-weight: 700;
}

.settle-batch-item span:nth-child(2) {
    color: var(--muted);
}

.settle-batch-item strong {
    color: var(--text-strong);
    text-align: right;
}

.settle-batch-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--panel-soft);
    border: 1px solid var(--line-soft);
}

.settle-batch-total span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.settle-batch-total strong {
    color: #0ea5e9;
    font-size: 20px;
    font-weight: 900;
}

.system-confirm-card {
    width: min(392px, calc(100vw - 32px));
    gap: 18px;
    padding: 22px;
    border-color: var(--line-soft);
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 24px 70px rgba(2, 8, 23, .28);
    overflow: hidden;
}

.system-confirm-card .payments-modal-head {
    align-items: center;
}

.system-confirm-card .payments-modal-head h2 {
    color: var(--text-strong);
    font-family: "Inter", Arial, sans-serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 24px;
    letter-spacing: 0;
}

.system-confirm-card .payments-modal-head p {
    max-width: 360px;
    margin-top: 6px;
    color: var(--muted);
    font-family: "Inter", Arial, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    letter-spacing: 0;
}

.system-confirm-card .settle-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    justify-content: flex-end;
}

.system-confirm-modal {
    /* Esse modal de confirmacao pode ser aberto por cima de qualquer outro
       modal do sistema (ex.: dentro do historico de estoque, que ja usa
       .item-edit-modal com z-index 120) - precisa ficar sempre no topo. */
    z-index: 200;
}

.system-confirm-modal.is-logout .system-confirm-card {
    border-radius: 8px;
}

.system-confirm-modal.is-logout {
    background: rgba(15, 23, 42, .56);
    backdrop-filter: blur(4px);
}

.system-confirm-modal.is-logout .secondary-action,
.system-confirm-modal.is-logout .primary-action {
    min-width: 0;
    min-height: 44px;
    border-radius: 8px;
    font-family: "Inter", Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0;
}

.system-confirm-modal.is-logout .primary-action {
    border-color: #3B608F;
    background: #3B608F;
    box-shadow: 0 10px 22px rgba(59, 96, 143, .24);
}

.system-confirm-modal.is-logout .primary-action:hover {
    border-color: #34567f;
    background: #34567f;
}

.system-confirm-modal.is-logout .secondary-action {
    border-color: var(--line-soft);
    color: var(--text-strong);
    background: var(--panel-soft);
}

.system-confirm-modal.is-logout .secondary-action:hover {
    background: color-mix(in srgb, var(--panel-soft) 86%, #3B608F 14%);
}

.payments-modal-card {
    width: min(860px, 96vw);
}

.payments-modal-card:has(.payments-list-audit) {
    width: min(1080px, 96vw);
}

.payments-list-audit {
    overflow-x: auto;
}

.payments-list-audit .payments-list-head,
.payments-list-audit .payments-list-row {
    grid-template-columns: 90px 64px 120px 130px 130px minmax(160px, 1fr) 110px;
    min-width: 820px;
}

.payments-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.payments-modal-head p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.payments-modal-head button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    color: var(--text-strong);
    background: var(--panel-soft);
    cursor: pointer;
    font-size: 22px;
    font-weight: 900;
    line-height: 1;
}

.payments-list {
    overflow: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
}

.payments-list-head,
.payments-list-row {
    display: grid;
    grid-template-columns: 90px 130px 150px minmax(180px, 1fr) 110px;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
}

.payments-list-head {
    color: var(--text-strong);
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.payments-list-row {
    min-height: 54px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.payments-list-row strong {
    color: var(--text-strong);
    text-align: right;
}

.payments-list-row.is-match {
    background: rgba(21, 153, 71, .08);
    box-shadow: inset 3px 0 0 #159947;
}

.cte-notas-list .payments-list-head,
.cte-notas-list .payments-list-row {
    grid-template-columns: 90px minmax(200px, 1fr) 130px minmax(220px, 300px);
}

.cte-notas-list .payments-list-row form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.cte-notas-list .payments-list-row input[type="number"] {
    width: 100px;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
}

.cte-notas-list .payments-list-row select {
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    font-weight: 750;
    font-size: 12px;
    background: var(--input);
    color: var(--text-strong);
}

.cte-notas-list .payments-list-row .primary-action,
.cte-notas-list .payments-list-row .secondary-action {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.ciot-notas-list .payments-list-head,
.ciot-notas-list .payments-list-row {
    grid-template-columns: 110px minmax(200px, 1fr) 130px 200px;
}

.ciot-notas-list .payments-list-row .primary-action,
.ciot-notas-list .payments-list-row .secondary-action {
    padding: 6px 10px;
    font-size: 12px;
    white-space: nowrap;
}

.ciot-notas-list.mdfe-cte-select .payments-list-head,
.ciot-notas-list.mdfe-cte-select .payments-list-row {
    grid-template-columns: 34px 110px minmax(200px, 1fr) 90px 110px;
}

.payments-list-row-selectable {
    cursor: pointer;
}

.payments-list-row-selectable input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

.cte-notas-totals {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 14px 20px 18px;
}

.cte-notas-totals > span {
    padding-bottom: 6px;
    font-size: 12px;
}

.cte-notas-totals .list-totals {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
}

.cte-notas-totals .list-totals > span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-top: 1px solid var(--line-soft);
}

.cte-notas-totals .list-totals > span:first-child {
    border-top: 0;
}

.cte-notas-totals .list-totals small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.cte-notas-totals .list-totals strong {
    font-size: 15px;
    color: var(--text-strong);
}

.cte-notas-totals .list-totals > span:last-child {
    margin-top: 4px;
    border-top: 2px solid var(--line-soft);
}

.cte-notas-totals .list-totals > span:last-child small,
.cte-notas-totals .list-totals > span:last-child strong {
    color: var(--brand);
}

.cte-notas-totals .list-totals > span:last-child strong {
    font-size: 18px;
}

.payments-list-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #159947;
    color: #127a3a;
    background: rgba(21, 153, 71, .12);
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
    white-space: nowrap;
}

.payments-empty {
    padding: 18px 14px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.payments-actions {
    grid-template-columns: minmax(180px, 260px);
    justify-content: end;
}

.pdv-page {
    gap: 18px;
}

.pdv-top {
    align-items: center;
}

.pdv-clock {
    display: grid;
    gap: 3px;
    min-width: 150px;
    padding: 12px 16px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel);
    text-align: right;
}

.pdv-clock strong {
    color: var(--text-strong);
    font-size: 15px;
    font-weight: 950;
}

.pdv-clock span {
    color: var(--success);
    font-size: 12px;
    font-weight: 900;
}

.pdv-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    gap: 18px;
    min-height: calc(100vh - 150px);
}

.pdv-sale,
.pdv-summary {
    min-width: 0;
}

.pdv-sale {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
}

.pdv-product-entry,
.pdv-panel,
.pdv-totals,
.pdv-cart {
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 18px 44px rgba(15, 23, 42, .06);
}

.pdv-product-entry {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 110px 150px;
    gap: 12px;
    align-items: end;
    padding: 16px;
}

.pdv-product-entry label,
.pdv-panel label,
.pdv-totals label {
    display: grid;
    gap: 7px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 900;
}

.pdv-product-entry input,
.pdv-panel input,
.pdv-panel select,
.pdv-totals input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-weight: 850;
    outline: 0;
}

.pdv-cart {
    overflow: hidden;
}

.pdv-cart-head,
.pdv-cart-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 100px 120px 120px 42px;
    gap: 12px;
    align-items: center;
}

.pdv-cart-head {
    padding: 13px 16px;
    color: var(--pdv-text, #001747);
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.pdv-cart-body {
    max-height: calc(100vh - 285px);
    overflow-y: auto;
}

.pdv-cart-row {
    min-height: 68px;
    padding: 12px 16px;
    border-top: 1px solid var(--line-soft);
}

.pdv-cart-row strong {
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 950;
}

.pdv-cart-row span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.pdv-cart-row input {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text-strong);
    background: var(--input);
    font-weight: 900;
    text-align: center;
}

.pdv-cart-row button {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 9%, var(--panel-soft));
    cursor: pointer;
    font-size: 20px;
    font-weight: 950;
}

.pdv-empty {
    padding: 26px 16px;
    color: var(--pdv-muted, #64748b);
    font-size: 14px;
    font-weight: 850;
    text-align: center;
}

.pdv-summary {
    display: grid;
    align-content: start;
    gap: 14px;
}

.pdv-panel,
.pdv-totals {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.pdv-panel h2 {
    margin: 0 0 2px;
    color: var(--text-strong);
    font-size: 17px;
    font-weight: 950;
}

.pdv-totals > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 850;
}

.pdv-totals strong {
    color: var(--text-strong);
    font-size: 18px;
    font-weight: 950;
}

.pdv-grand-total {
    margin-top: 4px;
    padding-top: 13px;
    border-top: 1px solid var(--line-soft);
}

.pdv-grand-total strong {
    color: var(--brand);
    font-size: 30px;
}

.pdv-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.pdv-actions .primary-action,
.pdv-actions .cancel-action {
    min-height: 50px;
}

.pdv-receipt-card {
    width: min(460px, calc(100vw - 20px));
    max-height: calc(100svh - 16px);
    align-content: start;
    overflow: hidden;
    padding: 10px;
    gap: 8px;
}

.pdv-receipt-card .payments-modal-head,
.pdv-receipt-card .settle-actions {
    flex: 0 0 auto;
}

.pdv-receipt-card [data-pdv-receipt-print-area] {
    max-height: calc(100svh - 132px);
    overflow-y: auto;
    overflow-x: hidden;
}

.pdv-receipt {
    width: 80mm;
    max-width: 100%;
    box-sizing: border-box;
    display: grid;
    gap: 3px;
    margin: 0 auto;
    color: #000;
    background: #fff;
    padding: 2mm;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 12px;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.pdv-receipt-card .payments-modal-head {
    align-items: center;
}

.pdv-receipt-card .payments-modal-head h2 {
    font-size: 18px;
}

.pdv-receipt-card .payments-modal-head p {
    margin-top: 2px;
    font-size: 12px;
}

.pdv-receipt-card .settle-actions {
    gap: 8px;
}

.pdv-receipt-card .primary-action,
.pdv-receipt-card .cancel-action {
    min-height: 38px;
    padding-inline: 12px;
    font-size: 12px;
}

.nfce-modal-card {
    width: min(420px, calc(100vw - 28px));
    max-height: calc(100dvh - 28px);
    gap: 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.nfce-document-choice {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.nfce-document-choice[hidden] {
    display: none;
}

.nfce-document-choice .inline-check {
    position: relative;
    min-height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 850;
    cursor: pointer;
}

.nfce-document-choice .inline-check input {
    position: absolute;
    width: 1px;
    min-height: 1px;
    opacity: 0;
    pointer-events: none;
}

.nfce-document-choice .inline-check:has(input:checked) {
    border-color: var(--brand);
    color: var(--brand);
    background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

.lancamento-choice {
    display: grid;
    gap: 10px;
}

.boletos-modal-lista {
    display: grid;
    gap: 8px;
    max-height: 320px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.boleto-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line-soft, #e5e7eb);
    border-radius: 10px;
    flex-wrap: wrap;
    background: var(--panel-2, #f9fafb);
}

.boleto-item strong {
    font-size: 13.5px;
}

.boleto-item-desc {
    display: block;
    font-size: 12.5px;
    color: var(--text-soft, #6b7280);
    margin-top: 3px;
}

.boleto-item-status {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .02em;
}

.boleto-item-status.is-aberto { background: #fef3c7; color: #92400e; }
.boleto-item-status.is-pago { background: #dcfce7; color: #166534; }
.boleto-item-status.is-cancelado { background: #f2f4f7; color: #667085; }
.boleto-item-status.is-sem-boleto { background: #eef2ff; color: #4338ca; }

.boleto-item-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex: 0 0 auto;
}

.boleto-item-actions a,
.boleto-item-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 30px;
    padding: 0 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid var(--line-soft, #d0d5dd);
    background: #fff;
    color: var(--text-strong, #344054);
    text-decoration: none;
}

.boleto-item-actions a:hover,
.boleto-item-actions button:hover {
    background: var(--panel-2, #f9fafb);
}

.boleto-item-actions a[data-boleto-ver] {
    border-color: var(--brand);
    color: var(--brand);
}

.boleto-item-actions button[data-boleto-cancelar] {
    border-color: #f2b8b5;
    color: #912018;
}

.boleto-item-actions button[data-boleto-cancelar]:hover {
    background: #fef4f3;
}

.boleto-item-actions button:disabled,
.boleto-item-actions a[aria-disabled="true"] {
    opacity: .55;
    cursor: not-allowed;
}

.lancamento-choice .radio-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 10px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text-strong);
    background: var(--panel-soft);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background .12s ease, border-color .12s ease;
}

.lancamento-choice .radio-card input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.lancamento-choice .radio-card::before {
    content: '';
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border: 2px solid var(--line);
    border-radius: 50%;
    background: var(--panel);
    transition: border-color .12s ease, box-shadow .12s ease;
}

.lancamento-choice .radio-card:has(input:checked) {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 10%, var(--panel));
}

.lancamento-choice .radio-card:has(input:checked)::before {
    border-color: var(--brand);
    box-shadow: inset 0 0 0 3.5px var(--brand);
}

.lancamento-choice .radio-card:hover {
    border-color: var(--brand);
}

.settle-actions.entrega-modal-actions {
    grid-template-columns: 1fr;
    gap: 10px;
}

.nfce-cpf-field {
    display: grid;
    gap: 6px;
    color: var(--text-strong);
    font-weight: 900;
    font-size: 13px;
}

.nfce-cpf-field input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 14px;
    color: var(--text-strong);
    background: var(--panel);
    font-weight: 850;
}

.nfce-modal-note {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.nfce-tomador-status {
    min-height: 16px;
    margin: -6px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.nfce-tomador-status.is-error {
    color: var(--danger);
}

.nfce-cpf-registration {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.nfce-cpf-registration[hidden] {
    display: none;
}

.nfce-cpf-registration > strong {
    color: var(--text-strong);
    font-size: 13px;
}

.nfce-cpf-registration > p {
    margin: -5px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.nfce-cpf-registration .form-grid {
    gap: 10px;
}

.nfce-cpf-registration label {
    display: grid;
    gap: 5px;
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 800;
}

.nfce-cpf-registration input {
    min-height: 38px;
    padding-inline: 10px;
    font-size: 12px;
}

.nfce-return-card {
    width: min(680px, calc(100vw - 28px));
    max-height: calc(100svh - 24px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: hidden;
}

.nfce-return-card .payments-modal-head a {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--text-strong);
    background: var(--panel-soft);
    text-decoration: none;
    font-size: 22px;
    font-weight: 950;
}

.cte-cancel-modal-card {
    width: min(560px, calc(100vw - 28px));
    gap: 18px;
}

.cte-cancel-modal-card .payments-modal-head a {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    color: var(--text-strong);
    background: var(--panel-soft);
    text-decoration: none;
    font-size: 22px;
    font-weight: 950;
}

.cte-cancel-reason {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.cte-cancel-reason textarea {
    width: 100%;
    min-height: 132px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    padding: 12px 14px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.45;
    outline: 0;
    resize: vertical;
    text-transform: none;
}

.cte-cancel-reason textarea:focus {
    border-color: rgba(37, 99, 235, .48);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

.cte-cancel-actions {
    gap: 12px;
}

.cte-cancel-actions .primary-action,
.cte-cancel-actions .cancel-action {
    width: 100%;
}

.nfce-return-summary {
    min-height: 0;
    flex: 0 0 auto;
    display: grid;
    gap: 8px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 800;
    overflow: visible;
    overflow-wrap: anywhere;
}

.nfce-return-summary p {
    margin: 0;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 10px;
    color: #7f1d1d;
    background: #fee2e2;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.nfce-return-json {
    min-height: 138px;
    max-height: none;
    flex: 1 1 auto;
    overflow: auto;
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-strong);
    background: var(--panel);
    font-size: 12px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.nfce-return-card > .cte-cancel-reason {
    flex: 0 0 auto;
    gap: 8px;
    max-height: 190px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel-soft);
}

.nfce-return-card > .cte-cancel-reason input[type="date"],
.nfce-return-card > .cte-cancel-reason input[type="text"] {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    outline: 0;
}

.nfce-return-card > .cte-cancel-reason small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
    line-height: 1.35;
    text-transform: none;
    overflow-wrap: anywhere;
}

.receipt-center {
    display: grid;
    gap: 2px;
    text-align: center;
}

.receipt-company {
    display: grid;
    grid-template-columns: 17mm 1fr;
    align-items: center;
    gap: 4px;
}

.receipt-company img {
    width: 16mm;
    height: 16mm;
    object-fit: contain;
}

.receipt-company div {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.receipt-company strong,
.receipt-title,
.receipt-payment-title {
    font-weight: 900;
}

.receipt-company strong {
    font-size: 11.2px;
    line-height: 1.05;
}

.receipt-company span {
    font-size: 10.8px;
    line-height: 1.06;
    overflow-wrap: anywhere;
}

.pdv-receipt hr {
    width: 100%;
    border: 0;
    border-top: 2px solid #000;
    margin: 2px 0;
}

.receipt-title {
    text-align: center;
    font-size: 10.8px;
    line-height: 1.12;
}

.receipt-title strong {
    font-size: 11px;
}

.receipt-consumer {
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    padding: 3px 0;
    text-align: center;
    font-weight: 950;
}

.receipt-items-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 8mm 7mm 13mm 13mm;
    gap: 2px;
    border-bottom: 2px solid #000;
    font-weight: 900;
    font-size: 10px;
}

.receipt-items-head span:not(:first-child) {
    text-align: right;
}

.receipt-line {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 11px;
}

.receipt-line span:last-child,
.receipt-line strong {
    text-align: right;
}

.receipt-items {
    display: grid;
    gap: 1px;
}

.receipt-item {
    display: grid;
    gap: 1px;
    border-bottom: 1px solid #000;
}

.receipt-item strong {
    font-size: 10.2px;
    line-height: 1.08;
    white-space: normal;
}

.receipt-item div {
    display: grid;
    grid-template-columns: 1fr 7mm 13mm 13mm;
    gap: 2px;
    font-size: 10.4px;
    font-weight: 700;
}

.receipt-item span {
    text-align: right;
}

.receipt-total {
    font-size: 11.4px;
    font-weight: 950;
}

.receipt-payment-title {
    margin-bottom: 2px;
}

.receipt-note {
    display: grid;
    gap: 1px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.receipt-access-key {
    display: grid;
    gap: 1px;
    text-align: center;
    font-size: 8.7px;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.receipt-access-key strong {
    font-size: 9px;
}

.receipt-qr-block {
    display: grid;
    grid-template-columns: 30mm 1fr;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
}

.receipt-qr {
    width: 29mm;
    height: 29mm;
}

.receipt-qr img,
.receipt-qr canvas {
    width: 29mm !important;
    height: 29mm !important;
}

.receipt-barcode {
    width: 29mm;
    height: 29mm;
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 1px;
    padding: 1mm 0;
    background: #fff;
    overflow: hidden;
}

.receipt-barcode i {
    display: block;
    min-width: 1px;
    height: 100%;
    background: #000;
}

.receipt-qr-block > div:last-child {
    min-width: 0;
    display: grid;
    gap: 1px;
    text-align: center;
    overflow-wrap: anywhere;
}

.receipt-consumer-block {
    font-size: 8.9px;
    line-height: 1.08;
}

.receipt-consumer-block strong {
    font-size: 9.1px;
}

.receipt-tax {
    text-align: center;
    font-size: 8.5px;
    line-height: 1.12;
    margin-top: 2px;
}

.receipt-nfe-simplified .receipt-title {
    font-size: 10px;
    text-transform: uppercase;
}

.receipt-nfe-simplified .receipt-access-key {
    font-size: 8.2px;
}

.receipt-nfe-simplified .receipt-items-head,
.receipt-nfe-simplified .receipt-item strong,
.receipt-nfe-simplified .receipt-item div {
    font-size: 9px;
}

.receipt-nfe-simplified {
    gap: 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.14;
}

.nfe-simple-company {
    display: grid;
    grid-template-columns: 19mm 1fr;
    gap: 3px;
    align-items: start;
    text-align: center;
    margin-bottom: 3px;
}

.nfe-simple-company img {
    width: 18mm;
    height: 18mm;
    object-fit: contain;
}

.nfe-simple-company div {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.nfe-simple-company strong {
    font-size: 12px;
    line-height: 1.08;
}

.nfe-simple-company span {
    font-size: 12px;
    line-height: 1.08;
}

.nfe-simple-title {
    display: grid;
    gap: 1px;
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    padding: 3px 0;
    text-align: center;
    font-size: 12px;
    line-height: 1.12;
}

.nfe-simple-title strong {
    font-size: 12px;
}

.nfe-wide-barcode {
    width: 100%;
    height: 22mm;
    display: grid;
    place-items: center;
    padding: 1mm 0;
    background: #fff;
    overflow: hidden;
}

.nfe-wide-barcode svg {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: 20mm !important;
}

.receipt-nfe-simplified .nfe-simple-company img {
    width: 18mm !important;
    height: 18mm !important;
    max-width: 18mm !important;
    max-height: 18mm !important;
}

.nfe-access-key {
    display: grid;
    gap: 1px;
    border-bottom: 1px dashed #000;
    padding-bottom: 3px;
    text-align: center;
    font-size: 11px;
    line-height: 1.14;
    overflow-wrap: anywhere;
}

.nfe-access-key strong {
    font-size: 12px;
}

.nfe-data-lines {
    display: grid;
    gap: 1px;
    border-bottom: 1px dashed #000;
    padding: 3px 0;
}

.nfe-data-lines div {
    display: grid;
    grid-template-columns: 30mm 1fr;
    gap: 3px;
    font-size: 12px;
}

.nfe-data-lines strong,
.nfe-simple-section h3,
.nfe-total-line {
    font-weight: 950;
}

.nfe-simple-section {
    display: grid;
    gap: 1px;
    border-bottom: 1px dashed #000;
    padding: 3px 0;
}

.nfe-simple-section h3 {
    margin: 0;
    font-size: 12px;
    line-height: 1.1;
}

.nfe-simple-section p {
    margin: 0;
    font-size: 12px;
    line-height: 1.12;
}

.nfe-products-head,
.nfe-product-row {
    display: grid;
    grid-template-columns: 9mm minmax(0, 1fr) 7mm 6mm 10mm 11mm;
    gap: 1px;
    align-items: start;
}

.nfe-products-head {
    font-size: 11px;
    font-weight: 950;
    border-bottom: 1px solid #000;
}

.nfe-product-row {
    padding: 2px 0;
    font-size: 11px;
    line-height: 1.1;
}

.nfe-product-row strong {
    font-size: 11px;
    line-height: 1.1;
    font-weight: 700;
    word-break: break-word;
}

.nfe-products-head span:nth-child(n+3),
.nfe-product-row span:nth-child(n+3) {
    text-align: right;
}

.nfe-total-line {
    padding: 3px 0;
    border-bottom: 1px dashed #000;
    text-align: right;
    font-size: 12px;
}

.nfe-pay-head,
.nfe-pay-row {
    display: grid;
    grid-template-columns: 1fr 30mm;
    gap: 4px;
    font-size: 11px;
}

.nfe-pay-head {
    font-weight: 950;
    border-bottom: 1px dashed #000;
}

.nfe-pay-head span:last-child,
.nfe-pay-row span:last-child {
    text-align: right;
}

.nfe-additional p {
    font-size: 11px;
}

.nfe-printed-at {
    padding-top: 2px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.receipt-mp-card {
    min-height: 18mm;
    display: grid;
    grid-template-columns: 18mm minmax(0, 1fr);
    align-items: start;
    gap: 4px;
    margin-top: 4px;
    padding: 3px 5px;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 9px;
    line-height: 1.08;
}

.receipt-mp-card > div:last-child {
    min-width: 0;
    display: grid;
    gap: 1px;
}

.receipt-mp-card span,
.receipt-brand-card span {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.receipt-mp-card strong,
.receipt-brand-card strong {
    display: block;
    min-width: 0;
    overflow-wrap: anywhere;
}

.receipt-mp-logo {
    width: 15mm;
    height: 10mm;
    display: block;
    object-fit: contain;
}

.receipt-thanks {
    margin-top: 2px;
    font-weight: 950;
    font-size: 10px;
}

.receipt-items + hr + .receipt-thanks {
    display: none !important;
}

@media (max-width: 980px) {
    .pdv-shell {
        grid-template-columns: 1fr;
    }

    .pdv-product-entry {
        grid-template-columns: 1fr;
    }

    .pdv-cart-head,
    .pdv-cart-row {
        grid-template-columns: minmax(160px, 1fr) 80px 96px 96px 36px;
    }
}

@media print {
    @page {
        size: 80mm auto;
        margin: 0;
    }

    html,
    body {
        width: 80mm !important;
        min-width: 80mm !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        overflow: visible !important;
    }

    body * {
        visibility: hidden !important;
    }

    [data-pdv-receipt-print-area],
    [data-pdv-receipt-print-area] * {
        visibility: visible !important;
    }

    [data-pdv-receipt-print-area] {
        position: absolute;
        top: 0;
        left: 50%;
        width: 72mm;
        max-width: 72mm;
        min-height: auto;
        max-height: none !important;
        margin: 0;
        padding: 0 !important;
        overflow: visible !important;
        box-shadow: none;
        border-radius: 0;
        transform: translateX(-50%);
    }

    .pdv-receipt {
        width: 72mm;
        max-width: 72mm;
        gap: 3px;
        padding: 2mm;
        font-size: 12px;
        line-height: 1.12;
        border-radius: 0;
    }

    .receipt-company {
        grid-template-columns: 17mm 1fr;
        gap: 4px;
    }

    .receipt-company img {
        width: 16mm;
        height: 16mm;
    }

    .receipt-nfe-simplified .nfe-simple-company img {
        width: 18mm !important;
        height: 18mm !important;
        max-width: 18mm !important;
        max-height: 18mm !important;
        object-fit: contain !important;
    }

    .receipt-nfe-simplified .nfe-wide-barcode {
        width: 100% !important;
        height: 22mm !important;
        display: grid !important;
        place-items: center !important;
        background: #fff !important;
    }

    .receipt-nfe-simplified .nfe-wide-barcode svg {
        width: 100% !important;
        max-width: 100% !important;
        height: 20mm !important;
    }

    .receipt-qr {
        width: 29mm;
        height: 29mm;
    }

    .receipt-qr img,
    .receipt-qr canvas {
        width: 29mm !important;
        height: 29mm !important;
    }

    .receipt-qr-block {
        grid-template-columns: 30mm 1fr;
        gap: 4px;
    }

    .receipt-mp-card,
    .receipt-brand-card {
        min-height: 18mm;
        font-size: 9px;
    }

    .no-print {
        display: none !important;
    }
}

.receipt-brand-card {
    min-height: 18mm;
    display: grid;
    grid-template-columns: 18mm 1fr;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 3px 5px;
    border: 1px solid #000;
    border-radius: 4px;
    font-size: 9px;
    line-height: 1.08;
}

.receipt-brand-card > img {
    width: 15mm;
    height: 10mm;
    object-fit: contain;
}

.receipt-brand-card > div:last-child {
    min-width: 0;
    display: grid;
    gap: 1px;
}

/* PDV full-screen counter */
.pdv-screen {
    /* O PDV tem paleta própria, separada do resto do sistema (Perfil de
       Cores > PDV). Qualquer elemento dentro do PDV que use as variáveis
       gerais do tema (--panel, --brand, --text-strong etc.) passa a herdar
       automaticamente os valores do PDV a partir daqui, sem precisar trocar
       var() por var() em cada regra — inclusive em partes futuras. */
    --app-bg: var(--pdv-bg, #f7f7f8);
    --panel: var(--pdv-panel, #fff);
    --panel-soft: var(--pdv-panel-soft, #eef1f6);
    --panel-strong: var(--pdv-neutral, #4b5563);
    --input: var(--pdv-panel, #fff);
    --line: var(--pdv-line, #d1d5db);
    --line-soft: var(--pdv-line, #d1d5db);
    --text: var(--pdv-text, #001747);
    --text-strong: var(--pdv-text, #001747);
    --muted: var(--pdv-muted, #64748b);
    --muted-strong: var(--pdv-muted, #334c76);
    --brand: var(--pdv-accent, #416a9d);
    --brand-strong: var(--pdv-accent, #416a9d);
    --danger: var(--pdv-danger, #ef4444);
    --success: var(--pdv-success, #16a34a);
    --warning: var(--pdv-warning, #d97706);

    min-height: 100vh;
    overflow: hidden;
    background: var(--pdv-bg, #f7f7f8);
    color: var(--pdv-text, #001747);
}

.pdv-header {
    height: 76px;
    display: grid;
    grid-template-columns: 48px 120px 40px minmax(180px, 1fr) auto auto minmax(220px, auto);
    align-items: center;
    gap: 22px;
    padding: 0 22px;
    color: #fff;
    background: var(--pdv-header, #223b5a);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .32);
}

.pdv-menu-button {
    width: 32px;
    display: grid;
    gap: 5px;
    color: #fff;
    text-decoration: none;
}

.pdv-menu-button span {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
}

.pdv-brand {
    display: grid;
    line-height: .92;
}

.pdv-brand span {
    font-size: 15px;
    font-weight: 500;
    letter-spacing: .02em;
}

.pdv-brand strong {
    font-size: 24px;
    font-weight: 950;
}

.pdv-mode {
    font-size: 25px;
    font-weight: 950;
    letter-spacing: .02em;
}

.pdv-date,
.pdv-time {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 25px;
    font-weight: 950;
    white-space: nowrap;
}

.pdv-date span,
.pdv-time span {
    font-size: 22px;
}

.pdv-sale-number {
    display: grid;
    justify-items: center;
    line-height: 1.15;
}

.pdv-sale-number span {
    font-size: 18px;
    font-weight: 950;
}

.pdv-sale-number strong {
    font-size: 17px;
    font-weight: 950;
}

.pdv-push-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

.pdv-push-toggle.is-active {
    border-color: #34d399;
    background: rgba(52, 211, 153, .22);
}

.pdv-alert {
    position: fixed;
    z-index: 30;
    right: 18px;
    top: 88px;
    width: min(420px, calc(100vw - 36px));
}

.pdv-counter {
    height: calc(100vh - 76px);
    display: grid;
    grid-template-columns: minmax(420px, 43%) minmax(520px, 1fr);
    grid-template-rows: minmax(0, 1fr) 166px;
    grid-template-areas:
        "entry items"
        "entry close";
    gap: 12px 26px;
    padding: 14px 34px 18px;
}

.pdv-entry-card {
    grid-area: entry;
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: 32px;
    padding: 20px 22px 46px;
    border-radius: 18px;
    color: #fff;
    background: var(--pdv-header, #223b5a);
    box-shadow: 0 0 5px rgba(0, 0, 0, .78);
}

.pdv-field {
    display: grid;
    gap: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: 950;
}

.pdv-field input,
.pdv-field select {
    width: 100%;
    min-height: 57px;
    border: 0;
    border-radius: 6px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 24px;
    font-weight: 500;
    outline: 0;
}

.pdv-product-field .product-search {
    position: relative;
}

.pdv-product-field input {
    padding-right: 58px;
}

.stock-balance-chip.is-positive { color: #30c878; }
.stock-balance-chip.is-negative { color: #ef5b5b; }

.pdv-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    width: 38px;
    height: 38px;
    transform: translateY(-50%);
    border: 0;
    color: var(--pdv-accent, #416a9d);
    background: transparent;
    cursor: pointer;
    font-size: 40px;
    font-weight: 950;
    line-height: 1;
}

.pdv-entry-grid {
    display: grid;
    grid-template-columns: minmax(130px, 150px) minmax(160px, 180px);
    justify-content: space-between;
    gap: 28px;
}

.pdv-entry-grid input {
    text-align: center;
    font-size: 18px;
    font-weight: 950;
}

.pdv-line-total {
    display: grid;
    grid-template-columns: auto 64px minmax(190px, 238px);
    align-items: center;
    align-self: center;
    gap: 26px;
}

.pdv-line-total strong,
.pdv-line-total span {
    color: #fff;
    font-size: 25px;
    font-weight: 950;
}

.pdv-line-total input {
    min-height: 57px;
    border: 0;
    border-radius: 6px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 22px;
    font-weight: 950;
}

.pdv-add-button,
.pdv-cancel-button,
.pdv-finish-button {
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--pdv-accent, #416a9d);
    cursor: pointer;
    font-size: 18px;
    font-weight: 950;
}

.pdv-add-button {
    min-height: 65px;
    margin-top: auto;
    font-size: 25px;
}

.pdv-items-card {
    grid-area: items;
    min-width: 0;
    padding: 16px 22px 36px;
    border: 1px solid var(--pdv-line, rgba(0, 23, 71, .4));
    border-radius: 10px;
    background: var(--pdv-panel, #fff);
    box-shadow: 0 0 6px rgba(0, 0, 0, .45);
}

.pdv-items-table {
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid var(--pdv-accent, #416a9d);
    border-radius: 5px;
}

.pdv-items-head,
.pdv-cart-row {
    display: grid;
    grid-template-columns: 44px minmax(160px, 1fr) 66px 84px 84px 68px;
    align-items: center;
    gap: 6px;
}

.pdv-items-head {
    min-height: 56px;
    padding: 0 16px;
    border-bottom: 1px solid var(--pdv-accent, #416a9d);
    color: var(--pdv-text, #001747);
    font-size: 24px;
    font-weight: 950;
}

.pdv-items-head > span:first-child,
.pdv-items-head > span:nth-child(3) {
    text-align: center;
}

.pdv-items-body {
    min-height: 0;
    overflow-y: auto;
}

.pdv-cart-row {
    min-height: 54px;
    padding: 9px 16px;
    border-bottom: 1px solid var(--pdv-line, rgba(65, 106, 157, .25));
    color: var(--pdv-text, #001747);
    font-size: 14px;
    font-weight: 950;
}

.pdv-cart-row > strong:first-child,
.pdv-cart-row > strong:nth-child(3) {
    text-align: center;
}

.pdv-cart-row div strong {
    display: block;
    max-width: 100%;
    overflow: hidden;
    color: var(--pdv-text, #001747);
    text-overflow: ellipsis;
}

.pdv-cart-row div span {
    display: block;
    margin-top: 3px;
    color: var(--pdv-muted, #334c76);
    font-size: 12px;
}

.pdv-row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.pdv-row-actions button {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    color: #fff;
    background: var(--pdv-accent, #416a9d);
}

.pdv-row-actions button svg {
    width: 15px;
    height: 15px;
}

.pdv-row-actions button:last-child {
    background: var(--pdv-danger, #ef4444);
}

.pdv-empty {
    padding: 26px 16px;
    color: var(--muted);
    font-size: 15px;
    font-weight: 850;
    text-align: center;
}

.pdv-close-card {
    grid-area: close;
    display: grid;
    grid-template-rows: 1fr auto;
    gap: 28px;
    padding: 14px 18px 20px;
    border-radius: 18px;
    color: #fff;
    background: var(--pdv-header, #223b5a);
    box-shadow: 0 0 6px rgba(0, 0, 0, .55);
}

.pdv-close-total {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 32px;
    padding-right: 18px;
}

.pdv-close-total span {
    font-size: 25px;
    font-weight: 950;
}

.pdv-close-total strong {
    min-width: 150px;
    min-height: 56px;
    display: grid;
    place-items: center;
    border-radius: 5px;
    color: var(--pdv-text, #001747);
    background: var(--pdv-panel, #fff);
    font-size: 24px;
    font-weight: 950;
}

.pdv-close-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 0 22px;
}

.pdv-cancel-button,
.pdv-finish-button {
    min-height: 44px;
}

.pdv-finish-button:disabled {
    opacity: .58;
    cursor: not-allowed;
}

.pdv-payment-card {
    width: min(1180px, 96vw);
}

.pdv-payment-closeout {
    gap: 22px;
    padding: 20px 20px 22px;
    background: var(--pdv-panel, #fff);
    max-height: calc(100svh - 24px);
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
}

.pdv-payment-closeout .payments-modal-head {
    align-items: center;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
}

.pdv-payment-closeout .payments-modal-head h2 {
    text-align: center;
    color: var(--pdv-text, #07184a);
    font-size: 31px;
}

.pdv-back-button {
    width: 44px;
    min-height: 44px;
    border: 0;
    color: var(--pdv-accent, #41699b);
    background: transparent;
    font-size: 34px;
    font-weight: 950;
    cursor: pointer;
}

.pdv-closeout-box {
    display: grid;
    grid-template-columns: minmax(360px, .92fr) minmax(420px, 1.08fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 22px;
    border: 1.5px solid var(--pdv-accent, #41699b);
    border-radius: 8px;
    padding: 20px;
    min-height: 0;
    max-height: calc(100svh - 108px);
    overflow-y: auto;
}

.pdv-paid-panel {
    display: grid;
    grid-template-rows: auto minmax(132px, 1fr) auto;
    gap: 0;
    min-height: 0;
}

.pdv-paid-head,
.pdv-paid-row {
    display: grid;
    grid-template-columns: 1fr 1fr .8fr;
    align-items: center;
    text-align: center;
}

.pdv-paid-head {
    min-height: 42px;
    border-radius: 6px 6px 0 0;
    color: #fff;
    background: var(--pdv-header, #243b59);
    font-size: 14px;
    font-weight: 950;
}

.pdv-paid-list {
    min-height: 132px;
    max-height: 238px;
    overflow: auto;
    border: 1px solid var(--pdv-line, #d1d5db);
    border-top: 0;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, .14);
}

.pdv-paid-row {
    min-height: 36px;
    border-bottom: 1px solid var(--pdv-line, #d1d5db);
    color: var(--pdv-text, #050f35);
    font-size: 14px;
    font-weight: 900;
}

.pdv-paid-empty {
    padding: 36px 18px;
    color: var(--pdv-muted, #6b7280);
    text-align: center;
    font-weight: 850;
}

.pdv-closeout-totals {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
    align-items: end;
    margin-top: 24px;
}

.pdv-closeout-totals label {
    display: grid;
    gap: 4px;
    color: var(--pdv-text, #07184a);
    font-size: 18px;
    font-weight: 950;
}

.pdv-closeout-totals input,
.pdv-closeout-totals strong {
    min-height: 52px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: 0 14px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 25px;
    font-weight: 950;
}

.pdv-pay-panel {
    display: grid;
    gap: 20px;
    align-content: start;
    min-height: 286px;
    border-radius: 6px;
    padding: 24px 32px 30px;
    color: #fff;
    background: var(--pdv-header, #243b59);
    box-shadow: 0 4px 12px rgba(15, 23, 42, .3);
}

.pdv-pay-panel h3 {
    margin: 0;
    text-align: center;
    font-size: 25px;
    font-weight: 950;
}

.pdv-pay-grid {
    display: grid;
    grid-template-columns: minmax(170px, 1fr) 90px minmax(150px, 1fr);
    gap: 14px;
    align-items: end;
}

.pdv-pay-grid label {
    display: grid;
    gap: 8px;
    color: #fff;
    font-size: 17px;
    font-weight: 950;
}

.pdv-pay-grid input,
.pdv-pay-grid select {
    width: 100%;
    min-height: 52px;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0 14px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 18px;
    font-weight: 950;
}

.pdv-pay-grid button {
    grid-column: 1 / -1;
    min-height: 64px;
    margin: 18px auto 0;
    width: min(405px, 100%);
    border: 0;
    border-radius: 6px;
    color: #fff;
    background: var(--pdv-accent, #41699b);
    font-size: 25px;
    font-weight: 950;
    cursor: pointer;
}

.pdv-pay-grid button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.pdv-final-actions {
    grid-column: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-height: 760px) {
    .settle-modal:has(.pdv-payment-closeout) {
        padding: 8px;
    }

    .pdv-payment-closeout {
        gap: 10px;
        max-height: calc(100svh - 16px);
        padding: 12px;
    }

    .pdv-payment-closeout .payments-modal-head h2 {
        font-size: 25px;
    }

    .pdv-closeout-box {
        max-height: calc(100svh - 78px);
        gap: 14px 18px;
        padding: 14px;
    }

    .pdv-paid-panel {
        grid-template-rows: auto minmax(105px, 1fr) auto;
    }

    .pdv-paid-list {
        min-height: 105px;
        max-height: 170px;
    }

    .pdv-closeout-totals {
        gap: 16px;
        margin-top: 14px;
    }

    .pdv-closeout-totals label {
        font-size: 15px;
    }

    .pdv-closeout-totals input,
    .pdv-closeout-totals strong {
        min-height: 46px;
        font-size: 20px;
    }

    .pdv-pay-panel {
        min-height: 245px;
        gap: 14px;
        padding: 20px 28px 24px;
    }

    .pdv-pay-grid input,
    .pdv-pay-grid select {
        min-height: 46px;
    }

    .pdv-pay-grid button {
        min-height: 52px;
        margin-top: 10px;
        font-size: 21px;
    }

    .pdv-payment-closeout .pdv-final-actions button {
        min-height: 64px;
        font-size: 19px;
    }
}

.pdv-final-actions button {
    min-height: 88px;
    border: 0;
    border-radius: 14px;
    color: #fff;
    background: var(--pdv-accent, #41699b);
    font-size: 24px;
    font-weight: 950;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pdv-final-actions button:disabled {
    opacity: .42;
    background: var(--pdv-muted, #8090a5);
    cursor: not-allowed;
    transform: none;
}

.pdv-notice-modal.is-open {
    z-index: 10100;
}

.pdv-notice-card {
    width: min(430px, calc(100vw - 32px));
    gap: 18px;
}

.pdv-notice-card .payments-modal-head {
    align-items: center;
}

.pdv-notice-card .payments-modal-head p {
    max-width: 340px;
    font-size: 14px;
    line-height: 1.45;
}

.pdv-notice-card .settle-actions {
    justify-content: flex-end;
}

.is-hidden {
    display: none !important;
}

.pdv-tele-venda-card {
    width: min(460px, calc(100vw - 32px));
    gap: 18px;
}

.pdv-tele-venda-card .payments-modal-head p {
    max-width: 360px;
    font-size: 13px;
    line-height: 1.4;
}

.pdv-tele-venda-link-box {
    display: flex;
}

.pdv-tele-venda-link-box input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: 0 14px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 14px;
    font-weight: 650;
}

.pdv-tele-venda-link-modal .settle-actions {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.pdv-action-icon {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    margin-right: 9px;
}

.pdv-payment-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border-radius: 8px;
    color: #fff;
    background: var(--pdv-header, #223b5a);
}

.pdv-payment-total span,
.pdv-payment-total strong {
    font-size: 22px;
    font-weight: 950;
}

.pdv-payment-methods {
    display: grid;
    gap: 10px;
}

.pdv-payment-methods-head,
.pdv-payment-balance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pdv-payment-methods-head strong,
.pdv-payment-balance strong {
    color: var(--text-strong);
    font-weight: 950;
}

.pdv-payment-methods-head button {
    min-height: 34px;
    border: 0;
    border-radius: 8px;
    padding: 0 14px;
    color: #fff;
    background: var(--brand);
    font-weight: 900;
    cursor: pointer;
}

.pdv-payment-rows {
    display: grid;
    gap: 8px;
    max-height: min(28vh, 250px);
    overflow: auto;
    padding-right: 2px;
}

.pdv-payment-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(130px, 1fr) 118px 92px 34px;
    align-items: end;
    gap: 8px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: color-mix(in srgb, var(--input) 72%, transparent);
}

.pdv-payment-row label {
    gap: 5px;
    font-size: 12px;
}

.pdv-payment-row input,
.pdv-payment-row select {
    min-height: 40px;
}

.pdv-payment-row > button {
    width: 34px;
    min-height: 40px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--pdv-neutral, #4b5563);
    font-size: 20px;
    font-weight: 950;
    cursor: pointer;
}

.pdv-payment-row > button:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.pdv-card-installments {
    opacity: .42;
}

.pdv-card-installments.is-visible {
    opacity: 1;
}

.pdv-payment-balance {
    padding-top: 2px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 900;
}

.pdv-payment-balance .is-balanced,
.pdv-payment-balance strong.is-balanced {
    color: var(--pdv-success, #16a34a);
}

.pdv-mercado-pago-card {
    width: min(860px, 96vw);
    max-height: calc(100dvh - 24px);
    gap: clamp(10px, 1.6vh, 18px);
    padding: clamp(14px, 2vh, 20px);
    overflow: hidden;
}

.pdv-mp-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pdv-mp-summary div {
    display: grid;
    gap: 6px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--input);
}

.pdv-mp-summary span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
}

.pdv-mp-summary strong {
    color: var(--text-strong);
    font-size: 20px;
    font-weight: 950;
}

.pdv-mp-note {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
    line-height: 1.45;
}

.pdv-mp-qrcode {
    display: grid;
    grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: clamp(10px, 1.5vh, 16px);
    background: var(--panel-soft);
}

.pdv-mp-qrcode[hidden],
.pdv-mp-point[hidden] {
    display: none !important;
}

.pdv-mp-qr-render {
    width: min(280px, 34vh);
    min-width: 210px;
    min-height: 0;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    border: 8px solid #fff;
    border-radius: 8px;
    background: #fff;
}

.pdv-mp-qr-render img,
.pdv-mp-qr-render canvas {
    width: 100% !important;
    max-width: 280px;
    height: auto !important;
}

.pdv-mp-qr-copy {
    min-width: 0;
    display: grid;
    gap: 9px;
}

.pdv-mp-qr-copy strong {
    color: var(--text-strong);
    font-size: 13px;
}

.pdv-mp-qr-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pdv-mp-qr-head span {
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--pdv-warning, #9a6700);
    background: color-mix(in srgb, var(--pdv-warning, #d97706) 18%, var(--pdv-panel, #fff4ce));
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.pdv-mp-qr-head span.is-expiring {
    color: var(--pdv-danger, #b42318);
    background: color-mix(in srgb, var(--pdv-danger, #ef4444) 14%, var(--pdv-panel, #fff1f2));
}

.pdv-mp-qr-copy textarea {
    width: 100%;
    min-height: 92px;
    resize: none;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 10px;
    color: var(--muted-strong);
    background: var(--input);
    font: 11px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.pdv-mp-qr-copy button {
    min-height: 40px;
    border: 1px solid var(--brand);
    border-radius: 8px;
    color: var(--brand-strong);
    background: var(--panel);
    font-weight: 900;
    cursor: pointer;
}

.pdv-mp-point {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 18px;
    background: var(--panel-soft);
}

.pdv-mp-point-icon {
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: var(--brand);
    font-size: 27px;
}

.pdv-mp-point div { display: grid; gap: 4px; }
.pdv-mp-point strong { color: var(--text-strong); font-size: 15px; }
.pdv-mp-point p { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; }

.pdv-mp-feedback {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 11px 13px;
    color: var(--muted-strong);
    background: var(--panel-soft);
}

.pdv-mp-feedback-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: var(--pdv-warning, #d97706);
    font-size: 13px;
    font-weight: 950;
}

.pdv-mp-feedback > div { min-width: 0; display: grid; gap: 2px; }
.pdv-mp-feedback strong { color: var(--text-strong); font-size: 14px; font-weight: 950; }
.pdv-mp-feedback p { margin: 0; color: var(--muted-strong); font-size: 12px; font-weight: 750; line-height: 1.35; }

.pdv-mp-feedback.is-approved {
    border-color: var(--pdv-success, #16a34a);
    background: color-mix(in srgb, var(--pdv-success, #16a34a) 14%, var(--pdv-panel, #ecfdf3));
}

.pdv-mp-feedback.is-approved .pdv-mp-feedback-icon { background: var(--pdv-success, #16a34a); }

.pdv-mp-feedback.is-error {
    border-color: var(--pdv-danger, #ef4444);
    background: color-mix(in srgb, var(--pdv-danger, #ef4444) 14%, var(--pdv-panel, #fff1f2));
}

.pdv-mp-feedback.is-error .pdv-mp-feedback-icon { background: var(--pdv-danger, #dc2626); }

@media (max-height: 720px) and (min-width: 621px) {
    .settle-modal:has(.pdv-mercado-pago-card) { padding: 8px; }
    .pdv-mercado-pago-card { max-height: calc(100dvh - 16px); gap: 8px; padding: 12px; }
    .pdv-mercado-pago-card .payments-modal-head h2 { font-size: 20px; }
    .pdv-mp-summary div { gap: 2px; padding: 8px 12px; }
    .pdv-mp-summary strong { font-size: 17px; }
    .pdv-mp-qr-render { width: min(230px, 31vh); min-width: 180px; }
    .pdv-mp-qr-copy textarea { min-height: 58px; }
    .pdv-mp-qrcode { grid-template-columns: minmax(180px, 230px) minmax(0, 1fr); }
    .pdv-mp-point { padding: 12px; }
}

@media (max-width: 620px) {
    .pdv-mp-qrcode {
        grid-template-columns: 1fr;
    }

    .pdv-mp-qr-render {
        width: min(190px, 28vh);
        min-width: 160px;
        justify-self: center;
    }

    .pdv-mp-qr-copy textarea { min-height: 48px; }
}

@media (max-width: 1060px) {
    .pdv-header {
        grid-template-columns: 38px 92px 34px 1fr;
        height: auto;
        min-height: 76px;
        gap: 12px;
    }

    .pdv-push-toggle {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }

    .pdv-date,
    .pdv-time,
    .pdv-sale-number {
        display: none;
    }

    .pdv-counter {
        height: auto;
        min-height: calc(100vh - 76px);
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "entry"
            "items"
            "close";
        padding: 14px;
    }

    .pdv-close-card {
        grid-area: close;
    }
}

.pdv-screen .pdv-counter {
    height: calc(100vh - 76px);
    grid-template-columns: minmax(430px, 42%) minmax(560px, 1fr);
    grid-template-rows: minmax(0, 1fr) 166px;
    grid-template-areas:
        "entry items"
        "entry close";
    padding: 14px 34px 18px;
}

.pdv-screen .pdv-entry-card {
    grid-area: entry;
    min-height: 0;
    grid-template-rows: auto auto minmax(110px, 1fr) auto;
    gap: clamp(22px, 4.5vh, 54px);
}

.pdv-screen .pdv-items-card {
    grid-area: items;
    min-height: 0;
}

.pdv-screen .pdv-close-card {
    grid-area: close;
}

.pdv-screen .pdv-items-head,
.pdv-screen .pdv-cart-row {
    grid-template-columns: 44px minmax(160px, 1fr) 66px 84px 84px 68px;
    gap: 6px;
}

.pdv-screen .pdv-items-head {
    padding: 0 14px;
    font-size: 18px;
}

.pdv-screen .pdv-cart-row {
    min-height: 52px;
    padding: 8px 14px;
}

.pdv-screen .pdv-row-actions {
    min-width: 66px;
}

.pdv-screen .pdv-row-actions button {
    width: 30px;
}

.pdv-screen .pdv-add-button {
    width: 100%;
    align-self: end;
    min-height: 64px;
    margin-top: 0;
}

@media (max-width: 1060px) {
    .pdv-screen .pdv-counter {
        height: auto;
        min-height: calc(100vh - 76px);
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        grid-template-areas:
            "entry"
            "items"
            "close";
        padding: 14px;
    }
}

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

.settle-grid label {
    display: grid;
    gap: 7px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 900;
}

.settle-grid input,
.settle-grid select,
.settle-grid textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-weight: 800;
    outline: 0;
}

.settle-grid textarea {
    min-height: 98px;
    padding-block: 12px;
    resize: vertical;
}

.settle-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 34px;
}

.settle-actions .primary-action,
.settle-actions .cancel-action {
    min-height: 45px;
    justify-content: center;
}

.empty-row {
    padding: 36px 24px;
    color: var(--muted);
    font-weight: 800;
}

.contacts-footer {
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 24px;
    border-top: 1px solid var(--line-soft);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}

.pager {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pager button,
.pager a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    color: var(--muted-strong);
    background: var(--panel);
    box-shadow: none;
    text-decoration: none;
}

.pager button.is-active,
.pager a.is-active {
    color: #fff;
    background: var(--brand);
}

.pager a.is-disabled {
    opacity: .45;
    pointer-events: none;
}

.customer-form {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.form-page-main {
    height: 100svh;
    overflow: hidden;
}

.customer-form .page-top {
    flex: 0 0 auto;
    margin-bottom: 18px;
}

.form-card {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 30px 28px 32px;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .34) transparent;
}

.form-card::-webkit-scrollbar {
    width: 7px;
}

.form-card::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .34);
}

.form-card::-webkit-scrollbar-track {
    background: transparent;
}

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

.form-grid label,
.form-grid .form-field {
    display: grid;
    gap: 9px;
    margin: 0;
    color: var(--text-strong);
    font-size: 14px;
}

.form-grid input,
.form-grid select,
.form-grid textarea {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0 14px;
    color: var(--text-strong);
    background: var(--input);
    font: inherit;
    font-weight: 700;
    outline: 0;
}

.input-with-action {
    position: relative;
    display: block;
}

.input-with-action input {
    padding-right: 46px;
}

.lookup-button {
    position: absolute;
    right: 7px;
    top: 50%;
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    margin: 0;
    border: 0;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    cursor: pointer;
}

.lookup-button:hover {
    color: var(--text-strong);
    background: rgba(65, 106, 157, .12);
    transform: translateY(-50%);
}

.lookup-button {
    transform: translateY(-50%);
}

.lookup-button svg {
    width: 18px;
    height: 18px;
}

.order-service-search .lookup-button[hidden] {
    display: none;
}

.sales-item-entry:not(.is-service-mode) .order-service-search input {
    padding-right: 14px;
}

.logo-upload {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
    min-height: 132px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 14px;
    background: var(--input);
}

.logo-preview {
    width: 100px;
    height: 100px;
    display: grid;
    place-items: center;
    border: 1px dashed color-mix(in srgb, var(--muted) 46%, transparent);
    border-radius: 14px;
    color: var(--muted);
    background: color-mix(in srgb, var(--panel) 78%, transparent);
    overflow: hidden;
    font-size: 12px;
    font-weight: 800;
    text-align: center;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.profile-preview {
    border-radius: 50%;
}

.profile-preview img {
    object-fit: cover;
    padding: 0;
}

.logo-upload-copy {
    min-width: 0;
    display: grid;
    gap: 7px;
}

.logo-upload-copy strong,
.logo-upload-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logo-upload-copy span {
    color: var(--muted);
    font-size: 12px;
}

.dashboard:not(.dashboard-home) input[type="file"] {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    color: var(--muted);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}

.dashboard:not(.dashboard-home) input[type="file"]::file-selector-button,
.dashboard:not(.dashboard-home) input[type="file"]::-webkit-file-upload-button {
    flex: 0 0 auto;
    height: 30px;
    margin-right: 12px;
    padding: 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text-strong);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--motion-duration-fast, .15s) var(--motion-ease, ease);
}

.dashboard:not(.dashboard-home) input[type="file"]::file-selector-button:hover,
.dashboard:not(.dashboard-home) input[type="file"]::-webkit-file-upload-button:hover {
    border-color: var(--brand);
    color: var(--brand);
}

.file-input {
    min-height: 42px !important;
    padding: 9px 12px !important;
    cursor: pointer;
}

.permissions-card {
    display: grid;
    gap: 10px;
    margin-top: 4px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 16px;
    background: var(--input);
}

.permissions-card > strong {
    color: var(--text-strong);
    font-size: 14px;
}

.permissions-card > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

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

.permissions-group-title {
    margin: 6px 0 -2px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.seller-create-user-toggle {
    min-height: 42px;
    display: flex !important;
    align-items: center;
    gap: 9px !important;
    align-self: end;
    padding-bottom: 4px;
}

.seller-create-user-toggle input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--brand);
}

/* Cadastro do vendedor: padroes das vendas (categoria e marcadores clicaveis), no ritmo dos rotulos do formulario (14px/700 + 9px ate o campo de 44px) */
.seller-form .categoria-conta-campo, .vendedor-marcadores { min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.seller-form .categoria-conta-titulo, .vendedor-marcadores-titulo { font-size: 14px; font-weight: 700; line-height: 20px; }
.seller-form .categoria-conta-campo select { height: 44px; }
.vendedor-marcadores-lista { display: flex; flex-wrap: wrap; gap: 6px; min-height: 44px; box-sizing: border-box; align-content: center; padding: 6px 8px; border: 1px solid var(--line, #dbe3ef); border-radius: 8px; }
.vendedor-marcador-opcao { display: inline-flex !important; max-width: 100%; cursor: pointer; }
.vendedor-marcador-opcao .marcador-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.vendedor-marcador-opcao input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.vendedor-marcador-opcao .marcador-tag { padding: 6px 10px; font-size: 12px; opacity: .55; background: transparent; }
.vendedor-marcador-opcao input:checked + .marcador-tag { opacity: 1; font-weight: 800; background: color-mix(in srgb, var(--marcador-cor, #64748b) 18%, transparent); }
.vendedor-marcador-opcao input:checked + .marcador-tag::after { content: "✓"; }
.vendedor-marcador-opcao input:focus-visible + .marcador-tag { outline: 2px solid var(--brand, #2563eb); outline-offset: 2px; }
.vendedor-marcadores-vazio { margin: 0; min-height: 44px; display: flex; align-items: center; color: var(--muted); font-size: 13px; }

.form-hint {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.seller-user-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    padding: 14px;
    background: color-mix(in srgb, var(--input) 86%, var(--brand) 4%);
}

/* O display: grid acima vencia o atributo hidden: os campos do novo usuario apareciam com a opcao desmarcada */
.seller-user-fields[hidden] {
    display: none;
}

.permission-option {
    min-height: 42px;
    display: flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px !important;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0 12px;
    background: var(--panel);
    cursor: pointer;
}

.permission-option input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--brand);
}

.permission-option span {
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 800;
}

.form-grid textarea {
    min-height: 94px;
    padding-top: 14px;
    resize: vertical;
}

.product-card {
    padding-top: 24px;
}

.order-card {
    padding-top: 24px;
}

.order-items {
    display: grid;
    border: 1px solid var(--line-soft);
    border-radius: 14px;
    background: var(--input);
    overflow: hidden;
}

.order-items-head,
.order-item-row {
    display: grid;
    grid-template-columns: 1.45fr 1.6fr .55fr .45fr .75fr .65fr .75fr;
    gap: 8px;
    align-items: center;
    padding: 9px 12px;
}

.sales-order-form .page-top {
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 1100px;
    margin-inline: auto;
    margin-bottom: 36px;
}

.sales-order-form .page-top > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.sales-grid {
    gap: 16px 16px;
}

.sales-grid label {
    gap: 5px;
    font-size: 12px;
    font-weight: 950;
}

.sales-grid input,
.sales-grid select,
.sales-grid textarea {
    min-height: 40px;
    border-radius: 9px;
    font-size: 14px;
    text-align: left;
}

.sales-grid input[readonly] {
    color: var(--text-strong);
    background: var(--input);
}

.sales-divider {
    height: 1px;
    border-top: 2px solid color-mix(in srgb, var(--brand) 62%, transparent);
}

.icon-only-action {
    min-width: 56px;
}

.sales-order-form .form-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
}

.sales-order-form .order-card {
    max-width: 1100px;
    margin-inline: auto;
    padding: 26px 30px 34px;
}

.sales-order-form .ghost-action,
.sales-order-form .primary-action,
.sales-order-form .cancel-action {
    min-height: 34px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 950;
}

.sales-order-form .primary-action {
    min-width: 150px;
}

.sales-order-form .cancel-action {
    min-width: 150px;
    color: #fff;
    background: #3f4248;
}

.sales-order-form .icon-only-action {
    min-width: 56px;
    width: 56px;
    padding-inline: 0;
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.consignment-form-main {
    height: 100svh;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 28px;
}

.consignment-form-main .page-top {
    position: sticky;
    top: 0;
    z-index: 12;
    align-items: center;
    width: min(1100px, 100%);
    margin: 0 auto 18px;
    padding: 14px 18px;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .10);
}

.consignment-form-main .page-top > div:first-child {
    min-width: 0;
}

.consignment-form-main .page-top h1,
.consignment-form-main .page-top p {
    white-space: normal;
}

.consignment-form-main .page-top .form-actions {
    flex-wrap: wrap;
}

.consignment-form-main .customer-form {
    height: auto;
    min-height: 0;
    display: block;
}

.consignment-form-main .form-card {
    overflow: visible;
}

.consignment-form-main .order-card,
.consignment-form-main .form-bottom-actions {
    max-width: 1100px;
    margin-inline: auto;
}

.consignment-compact-card {
    margin-bottom: 16px;
}

.consignment-items-table {
    min-width: 0;
    width: 100%;
    table-layout: fixed;
}

.consignment-items-table th,
.consignment-items-table td {
    padding: 9px 8px;
    font-size: 12px;
    white-space: normal;
}

.consignment-items-table th:nth-child(2),
.consignment-items-table td:nth-child(2) {
    width: 26%;
}

.consignment-items-table th:not(:nth-child(2)),
.consignment-items-table td:not(:nth-child(2)) {
    text-align: center;
}

.print-page {
    min-height: 100svh;
    padding: 28px;
    background: #eef2f7;
    color: #071a3b;
    font-family: Arial, Helvetica, sans-serif;
}

.print-actions {
    width: min(980px, 100%);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin: 0 auto 16px;
}

.print-sheet {
    width: min(980px, 100%);
    margin: 0 auto;
    padding: 34px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .14);
}

.etiquetas-print-page {
    min-height: 100svh;
    padding: 28px;
    background: #eef2f7;
    color: #071a3b;
    font-family: Arial, Helvetica, sans-serif;
}

.etiquetas-print-page .print-actions {
    justify-content: flex-start;
    align-items: center;
}

.etiquetas-qtd-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #45526b;
}

.etiquetas-qtd-field input {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid #d7dee9;
    border-radius: 8px;
    font-size: 14px;
}

.product-labels-modal-card {
    width: min(760px, calc(100vw - 32px));
    max-height: min(780px, calc(100svh - 32px));
    overflow: auto;
    padding: 22px;
    border-radius: 8px;
    background: var(--panel);
    box-shadow: 0 22px 60px rgba(15, 23, 42, .24);
}

.product-labels-controls {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 12px;
    margin: 18px 0;
}

.product-labels-controls label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.product-labels-controls input {
    width: 92px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--input);
    color: var(--text-strong);
    font: inherit;
}

.product-labels-warning {
    flex: 1 1 180px;
    color: #b42318;
    font-size: 12px;
    font-weight: 750;
}

.product-labels-preview {
    display: grid;
    grid-template-columns: repeat(3, 33mm);
    grid-auto-rows: 22mm;
    width: 99mm;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    background: #fff;
}

.product-print-label {
    display: flex;
    box-sizing: border-box;
    width: 33mm;
    height: 22mm;
    padding: 1mm;
    overflow: hidden;
    color: #000;
    font-family: Arial, sans-serif;
}

.product-print-label-qr {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 13mm;
    height: 20mm;
    margin-top: .3mm;
    margin-left: 2.9mm;
}

.product-print-label-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 17mm;
    margin-top: .3mm;
    padding-left: 2mm;
    overflow: hidden;
}

.product-print-label-description {
    font-size: 9px;
    line-height: 1;
}

.product-print-label-price {
    margin-top: 1mm;
    font-size: 12px;
    font-weight: bold;
}

@media print {
    @page { size: 99mm 22mm; margin: 0; }

    html:has(#product-labels-print-area),
    body:has(#product-labels-print-area) {
        width: 99mm;
        height: 22mm;
        margin: 0;
        padding: 0;
    }

    body:has(#product-labels-print-area) * { visibility: hidden; }

    #product-labels-print-area,
    #product-labels-print-area * { visibility: visible; }

    #product-labels-print-area {
        position: absolute;
        top: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(3, 33mm);
        grid-auto-rows: 22mm;
        width: 99mm;
        overflow: visible;
        box-shadow: none;
    }

}

#area_etiquetas {
    width: fit-content;
    margin: 0 auto;
    padding: 20px;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(15, 23, 42, .14);
}

.print-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
    padding-bottom: 20px;
    border-bottom: 2px solid #315f9d;
}

.print-brand {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.print-brand img {
    max-width: 110px;
    max-height: 64px;
    object-fit: contain;
}

.print-brand strong,
.print-title h1 {
    display: block;
    margin: 0 0 6px;
    color: #001845;
    font-size: 22px;
}

.print-brand span,
.print-title span,
.print-box span,
.print-footer span {
    display: block;
    color: #475569;
    font-size: 12px;
    line-height: 1.45;
}

.print-title {
    text-align: right;
}

.print-title strong {
    display: block;
    color: #315f9d;
    font-size: 26px;
}

.print-box-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-top: 18px;
}

.print-box {
    min-height: 112px;
    padding: 14px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
}

.print-box h2,
.print-section h2 {
    margin: 0 0 10px;
    color: #001845;
    font-size: 15px;
}

.print-box strong {
    display: block;
    margin-bottom: 6px;
    color: #001845;
    font-size: 14px;
}

.print-section {
    margin-top: 20px;
    break-inside: auto;
    page-break-inside: auto;
}

.print-section h2 {
    break-after: avoid-page;
    page-break-after: avoid;
}

.print-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #cbd5e1;
}

.print-table thead {
    display: table-header-group;
}

.print-table tfoot {
    display: table-row-group;
}

.print-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
}

.print-table th,
.print-table td {
    padding: 8px 9px;
    border-bottom: 1px solid #dbe3ef;
    border-right: 1px solid #dbe3ef;
    color: #0f172a;
    font-size: 12px;
    text-align: left;
    vertical-align: top;
}

.print-table th {
    color: #001845;
    background: #eaf1fb;
    font-weight: 800;
}

.print-table th:nth-child(4),
.print-table th:nth-child(5),
.print-table th:nth-child(6),
.print-table th:nth-child(7),
.print-table td:nth-child(4),
.print-table td:nth-child(5),
.print-table td:nth-child(6),
.print-table td:nth-child(7) {
    text-align: right;
}

.rcr-print-table th:nth-child(4),
.rcr-print-table th:nth-child(5),
.rcr-print-table th:nth-child(6),
.rcr-print-table th:nth-child(7),
.rcr-print-table td:nth-child(4),
.rcr-print-table td:nth-child(5),
.rcr-print-table td:nth-child(6),
.rcr-print-table td:nth-child(7) {
    text-align: left;
}

.rcr-print-table th:nth-child(8),
.rcr-print-table th:nth-child(9),
.rcr-print-table th:nth-child(10),
.rcr-print-table td:nth-child(8),
.rcr-print-table td:nth-child(9),
.rcr-print-table td:nth-child(10) {
    text-align: right;
}

.rcg-print-table th:nth-child(6),
.rcg-print-table th:nth-child(7),
.rcg-print-table th:nth-child(8),
.rcg-print-table td:nth-child(6),
.rcg-print-table td:nth-child(7),
.rcg-print-table td:nth-child(8) {
    text-align: right;
}

.rcg-print-itens-titulo {
    margin: 10px 0 6px;
    color: #001845;
    font-size: 13px;
    font-weight: 800;
}

.rcg-print-itens-table {
    margin-bottom: 14px;
}

.rcg-print-itens-table th,
.rcg-print-itens-table td {
    font-size: 11px;
    padding: 6px 8px;
}

.rcg-print-itens-table th:nth-child(n+4),
.rcg-print-itens-table td:nth-child(n+4) {
    text-align: right;
}

.rv-print-table th,
.rv-print-table td,
.rv-print-table-produtos th,
.rv-print-table-produtos td {
    text-align: left;
}

.rv-print-table th:nth-last-child(-n+3),
.rv-print-table td:nth-last-child(-n+3),
.rv-print-table-produtos th:nth-last-child(-n+3),
.rv-print-table-produtos td:nth-last-child(-n+3) {
    text-align: right;
}

.rv-custo-aviso-print {
    margin: 6px 0 0;
    color: #64748b;
    font-size: 10px;
    font-style: italic;
}

.fiscal-print-table th:nth-child(4),
.fiscal-print-table th:nth-child(5),
.fiscal-print-table th:nth-child(6),
.fiscal-print-table td:nth-child(4),
.fiscal-print-table td:nth-child(5),
.fiscal-print-table td:nth-child(6) {
    text-align: left;
}

.fiscal-print-table th:last-child,
.fiscal-print-table td:last-child {
    text-align: right;
}

.print-table-total td {
    border-top: 2px solid #94a3b8;
    background: #eaf1fb;
    color: #001845;
    font-weight: 800;
}

.print-totals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-top: 18px;
}

.print-totals div {
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    text-align: right;
}

.print-totals span {
    display: block;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
}

.print-totals strong {
    display: block;
    margin-top: 4px;
    color: #001845;
    font-size: 17px;
}

.print-notes {
    min-height: 70px;
    margin: 0;
    padding: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #0f172a;
    font-size: 12px;
    line-height: 1.5;
}

.print-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 24px;
    padding-top: 12px;
    border-top: 1px solid #cbd5e1;
}

@media print {
    @page {
        size: A4;
        margin: 12mm;
    }

    html:has(.print-page),
    body:has(.print-page) {
        width: auto !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    body {
        background: #fff !important;
    }

    body:has(.print-page) * {
        visibility: visible !important;
    }

    .print-page {
        min-height: auto;
        padding: 0;
        background: #fff;
        overflow: visible;
    }

    .print-actions {
        display: none !important;
        visibility: hidden !important;
    }

    .print-sheet {
        width: 100%;
        margin: 0;
        padding: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

.sales-order-items .order-items-head,
.sales-order-items .order-item-row {
    grid-template-columns: 2.8fr .6fr .42fr .56fr .72fr .72fr 42px;
}

.sales-order-items .order-item-row {
    padding-inline: 0;
    border-bottom: 0;
}

.sales-order-items {
    border: 0;
    border-radius: 0;
    background: transparent;
}

.sales-order-items .order-items-head {
    border-bottom: 0;
    padding-inline: 0;
}

.sales-order-items .order-items-body {
    gap: 10px;
}

.sales-item-entry {
    display: grid;
    grid-template-columns: minmax(280px, 2.7fr) minmax(96px, .68fr) minmax(62px, .42fr) minmax(98px, .6fr) minmax(104px, .72fr) minmax(98px, .68fr) 58px;
    gap: 14px;
    align-items: end;
}

.sales-item-entry.is-service-mode {
    grid-template-columns: minmax(280px, 1fr) minmax(150px, 220px) 58px;
}

.sales-item-entry.is-service-mode [data-service-hide] {
    display: none;
}

.product-search {
    position: relative;
}

.catalog-field-head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    min-height: 18px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.catalog-field-head .field-link-button {
    min-height: auto;
    border: 0;
    padding: 0;
    color: var(--brand-strong);
    background: transparent;
    font: inherit;
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.catalog-field-head .field-link-button:hover,
.catalog-field-head .field-link-button:focus-visible {
    color: var(--brand);
    text-decoration: underline;
}

.product-suggestions {
    position: absolute;
    z-index: 50;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    display: none;
    max-height: 220px;
    overflow: auto;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 18px 42px color-mix(in srgb, #000 22%, transparent);
}

.product-suggestions.is-open {
    display: grid;
}

.product-suggestions button {
    display: grid;
    gap: 3px;
    width: 100%;
    margin: 0;
    padding: 10px 12px;
    border: 0;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-strong);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.product-suggestions button:hover,
.product-suggestions button:focus-visible,
.product-suggestions button.is-active {
    background: color-mix(in srgb, var(--brand) 14%, transparent);
}

.product-suggestions button:last-child {
    border-bottom: 0;
}

.product-suggestions strong {
    font-size: 12px;
    font-weight: 900;
}

.product-suggestions span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.stock-balance-chip {
    display: inline-block;
    margin-left: 6px;
    font-style: normal;
    font-weight: 900;
}

.product-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    vertical-align: middle;
}

.product-type-badge.is-produto {
    color: #1f7aec;
    background: color-mix(in srgb, #1f7aec 16%, transparent);
}

.product-type-badge.is-servico {
    color: #9a5bf0;
    background: color-mix(in srgb, #9a5bf0 16%, transparent);
}

.order-lines-wrap {
    overflow-x: hidden;
    border: 1px solid color-mix(in srgb, var(--brand) 50%, var(--line-soft));
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel) 90%, var(--brand) 3%);
}

.order-lines-table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
}

.order-lines-table th,
.order-lines-table td {
    padding: 8px 7px;
    border-bottom: 1px solid var(--line-soft);
    border-right: 1px solid color-mix(in srgb, var(--line-soft) 80%, transparent);
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 850;
    vertical-align: middle;
}

.order-lines-table th {
    color: var(--text-strong);
    background: color-mix(in srgb, var(--panel) 82%, var(--brand) 8%);
    font-size: 10px;
    font-weight: 950;
    text-align: left;
}

.order-lines-table td:first-child,
.order-lines-table td:nth-child(4),
.order-lines-table td:nth-child(5),
.order-lines-table td:nth-child(6),
.order-lines-table td:nth-child(7),
.order-lines-table td:nth-child(8),
.order-lines-table th:first-child,
.order-lines-table th:nth-child(4),
.order-lines-table th:nth-child(5),
.order-lines-table th:nth-child(6),
.order-lines-table th:nth-child(7),
.order-lines-table th:nth-child(8) {
    text-align: center;
}

.order-lines-table td:nth-child(2),
.order-lines-table td:nth-child(3) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.order-lines-table th:nth-child(1),
.order-lines-table td:nth-child(1) {
    width: 4%;
}

.order-lines-table th:nth-child(2),
.order-lines-table td:nth-child(2) {
    width: 15%;
}

.order-lines-table th:nth-child(3),
.order-lines-table td:nth-child(3) {
    width: 28%;
}

.order-lines-table th:nth-child(4),
.order-lines-table td:nth-child(4) {
    width: 5%;
}

.order-lines-table th:nth-child(5),
.order-lines-table td:nth-child(5) {
    width: 10%;
}

.order-lines-table th:nth-child(6),
.order-lines-table td:nth-child(6),
.order-lines-table th:nth-child(7),
.order-lines-table td:nth-child(7),
.order-lines-table th:nth-child(8),
.order-lines-table td:nth-child(8) {
    width: 11%;
}

.order-lines-table th:nth-child(9),
.order-lines-table td:nth-child(9) {
    width: 8%;
}

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

.line-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.line-actions button {
    display: inline-grid;
    place-items: center;
    width: 26px;
    height: 26px;
    margin: 0;
    border: 0;
    border-radius: 7px;
    color: var(--brand);
    background: transparent;
    font-size: 16px;
    font-weight: 950;
    cursor: pointer;
}

.line-actions svg {
    width: 16px;
    height: 16px;
}

.line-actions button:hover,
.line-actions button:focus-visible {
    color: #fff;
    background: var(--brand);
}

.line-confirm {
    width: 58px;
    height: 40px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--brand);
    font-size: 22px;
    font-weight: 950;
}

.item-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    place-items: center;
    padding: 20px;
    background: rgba(5, 13, 28, .64);
    backdrop-filter: blur(8px);
}

.item-edit-modal.is-open {
    display: grid;
}

.item-edit-dialog {
    width: min(620px, 100%);
    border: 1px solid var(--line-soft);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 28px 80px rgba(0, 0, 0, .32);
    overflow: hidden;
}

.item-edit-dialog header,
.item-edit-dialog footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line-soft);
}

.item-edit-dialog footer {
    justify-content: flex-end;
    border-top: 1px solid var(--line-soft);
    border-bottom: 0;
}

.item-edit-dialog h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 22px;
}

.item-edit-dialog header button {
    width: 34px;
    height: 34px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    color: var(--text-strong);
    background: color-mix(in srgb, var(--panel) 82%, var(--brand) 8%);
    font-size: 24px;
    cursor: pointer;
}

.stock-history-modal .item-edit-dialog {
    width: min(920px, 96vw);
    max-height: min(720px, 88vh);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.stock-history-modal-body {
    min-height: 180px;
    overflow: auto;
    padding: 0 22px;
}

.stock-history-modal-row {
    display: grid;
    grid-template-columns: 130px 92px 94px 148px minmax(170px, 1fr) 32px;
    align-items: start;
    gap: 12px;
    min-height: 58px;
    padding-block: 10px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--text);
    font-size: 13px;
}

.stock-history-modal-row small {
    color: var(--muted);
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.4;
}

.stock-history-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.stock-history-delete svg {
    width: 16px;
    height: 16px;
}

.stock-history-delete:hover {
    background: #dc262622;
    color: #dc2626;
}

.stock-options-modal .item-edit-dialog,
.stock-movement-modal .item-edit-dialog {
    width: min(560px, 96vw);
}

.stock-options-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 24px 22px;
}

.stock-options-body button {
    min-height: 76px;
    justify-content: center;
}

.stock-options-extra {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0 22px 22px;
    margin-top: -8px;
    border-top: 1px solid var(--list-border, var(--line-soft));
    padding-top: 16px;
}

.stock-options-extra .ghost-action {
    width: 100%;
    min-height: 44px;
    white-space: normal;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
}

.stock-options-extra .ghost-action svg {
    flex-shrink: 0;
}

.stock-options-hint {
    margin: 0;
    padding: 10px 12px;
    border: 1px dashed var(--list-border, var(--line-soft));
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 12.5px;
}

.stock-options-converted {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.stock-options-converted .stock-options-hint {
    border-style: solid;
    border-color: #16a34a55;
    color: #16a34a;
}

.stock-options-extra .ghost-action.is-link {
    border: none;
    background: transparent;
    min-height: auto;
    padding: 0;
    color: var(--brand);
    text-decoration: underline;
    font-size: 12px;
}

.stock-movement-modal-form {
    display: grid;
    gap: 14px;
    padding: 22px;
}

.stock-movement-modal-form label {
    display: grid;
    gap: 7px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
}

.stock-movement-error {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid #dc262655;
    border-radius: 10px;
    background: #dc26260f;
}

.stock-movement-error p {
    margin: 0;
    color: #dc2626;
    font-size: 12.5px;
    font-weight: 700;
}

.stock-movement-error .ghost-action {
    align-self: flex-start;
    min-height: 36px;
    padding: 0 14px;
    font-size: 12.5px;
}

.stock-movement-modal-form input,
.stock-movement-modal-form select,
.stock-movement-modal-form textarea {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--input);
    color: var(--text-strong);
    font: inherit;
    font-weight: 700;
}

.stock-movement-modal-form textarea { height: auto; resize: vertical; }
.stock-movement-modal-form footer { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }

.stock-list-footer .list-totals {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.stock-list-footer {
    gap: 18px;
}

.stock-list-footer > span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.stock-list-footer .list-totals > span {
    min-width: 112px;
    display: grid;
    gap: 2px;
    padding: 6px 10px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    background: var(--list-surface-soft, var(--panel-soft));
    text-align: right;
}

.stock-list-footer .list-totals small {
    color: var(--list-text-secondary, var(--muted));
    font-family: "Inter";
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    white-space: nowrap;
}

.stock-list-footer .list-totals strong {
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .stock-history-modal-body { padding: 0 14px; }
    .stock-history-modal-row { grid-template-columns: 1fr 1fr; padding-block: 10px; }
    .stock-history-modal-row small { grid-column: 1 / -1; }
    .stock-options-body { grid-template-columns: 1fr; padding: 16px; }
    .stock-movement-modal-form { padding: 16px; }
}

.item-edit-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    padding: 22px;
}

.item-edit-grid label {
    display: grid;
    gap: 6px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 950;
}

.installments-table {
    display: grid;
    gap: 14px;
    margin-top: 4px;
}

.installments-head,
.installment-row {
    display: grid;
    grid-template-columns: .45fr 1.15fr 1.35fr 1.15fr 2.2fr;
    gap: 12px;
    align-items: center;
}

.installments-body {
    display: grid;
    gap: 10px;
}

.installments-head {
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 950;
}

.installment-row input,
.installment-row select {
    min-height: 38px;
}

.installment-field {
    /* Alinha o input pelo rodape da linha, independente do rotulo acima
       quebrar em 1 ou 2 linhas ("Intervalo (Dias)" x "Forma de recebimento")
       - sem isso o grid estica cada label pra altura da linha e distribui
       o espaco sobrando de forma diferente em cada uma, desalinhando os
       inputs entre si (ver print do usuario). */
    align-self: end;
}

.installment-auto-option {
    min-height: 40px;
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    margin-top: -4px;
    padding-bottom: 3px;
}

.installment-auto-option input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--brand);
}

.installment-auto-option span {
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 850;
}

.generate-installments {
    min-height: 40px;
    align-self: end;
    /* Espaco extra alem do gap padrao do grid - encostado no campo de data
       ficava dificil de ler onde um campo termina e o botao comeca. */
    margin: 0 0 0 14px;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--brand);
    font-weight: 900;
}

.sales-grid textarea {
    min-height: 100px;
}

.order-items-head {
    border-bottom: 1px solid var(--line-soft);
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.order-items-body {
    display: grid;
    gap: 0;
}

.order-item-row {
    border-bottom: 1px solid var(--line-soft);
}

.order-item-row:last-child {
    border-bottom: 0;
}

.order-item-row input,
.order-item-row select {
    min-height: 38px;
    border-radius: 8px;
    font-size: 12px;
}

.order-item-row [readonly] {
    color: var(--text-strong);
    background: var(--input);
}

.order-summary {
    display: flex;
    justify-content: flex-end;
    gap: 18px;
    border-top: 2px solid var(--brand);
    padding-top: 14px;
}

.order-summary span {
    min-width: 170px;
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.order-summary strong {
    color: var(--text-strong);
    font-size: 22px;
}

.product-grid {
    gap: 16px 18px;
}

.product-grid label {
    display: grid;
    gap: 7px;
    align-content: start;
    font-size: 12px;
    font-weight: 920;
}

.product-grid input,
.product-grid select,
.product-grid textarea {
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    color: var(--text-strong);
    background: var(--input);
    box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 5%, transparent);
    font-size: 13px;
    font-weight: 750;
    box-sizing: border-box;
}

.product-grid select {
    appearance: none;
    padding-right: 34px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 18px,
        calc(100% - 12px) 18px;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

.product-grid input:focus,
.product-grid select:focus,
.product-grid textarea:focus {
    border-color: color-mix(in srgb, var(--brand) 72%, var(--line-soft));
    outline: 0;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent);
}

.product-grid textarea {
    min-height: 108px;
    padding-top: 12px;
    line-height: 1.45;
}

.mini-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 16px;
    align-items: start;
}

.fiscal-code-row {
    align-items: end;
    margin-top: -2px;
    padding: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 12px;
    background: color-mix(in srgb, var(--panel) 90%, var(--brand) 4%);
}

.is-disabled-field {
    opacity: .58;
}

.is-disabled-field input,
.is-disabled-field button,
.is-disabled-field select,
.is-disabled-field textarea {
    cursor: not-allowed;
}

.is-disabled-field input,
.is-disabled-field select,
.is-disabled-field textarea {
    background: color-mix(in srgb, var(--input) 68%, var(--panel) 32%);
}

.ai-warning {
    color: var(--danger);
    font-size: 11px;
    font-weight: 700;
}

.ai-action {
    width: 100%;
    min-height: 40px;
    margin: 0;
    border: 0;
    border-radius: 9px;
    color: #fff;
    background: var(--brand);
    font-size: 13px;
    font-weight: 900;
}

.form-section-title {
    min-height: 22px;
    display: flex;
    align-items: center;
    border-top: 2px solid var(--brand);
    padding-top: 6px;
    color: var(--text-strong);
    font-size: 15px;
    font-weight: 950;
}

.catalog-active-field {
    justify-content: flex-start;
    align-self: start;
    min-height: 24px;
    padding: 0;
}

.catalog-app-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.catalog-app-fields {
    display: grid;
    align-content: start;
    gap: 12px;
}

.catalog-inputs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.catalog-app-fields label,
.catalog-inputs-grid label {
    min-height: auto;
}

.field-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 5px;
}

.field-link-row button {
    border: 0;
    color: var(--brand-strong);
    background: transparent;
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.field-link-row button:hover {
    text-decoration: underline;
}

.category-search,
.category-search input {
    width: 100%;
}

.check-line {
    min-height: 42px;
    display: flex !important;
    align-items: center;
    gap: 7px !important;
    padding-bottom: 4px;
}

.check-line input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--brand);
}

.image-upload-small {
    position: relative;
    width: 100%;
    height: 78px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    color: var(--muted);
    background: var(--input);
    overflow: hidden;
    text-align: center;
    font-size: 12px;
    font-weight: 750;
}

.image-upload-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-upload-small input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.product-grid label.span-1 {
    white-space: nowrap;
}

.product-images-panel {
    align-self: stretch;
    display: grid;
    gap: 8px;
    min-width: 0;
}

.product-images-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.product-images-head strong {
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
}

.image-add-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-add-button {
    width: auto;
    height: 32px;
    min-height: 32px;
    display: flex !important;
    align-items: center;
    place-items: center;
    padding: 0 12px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.image-add-button input {
    display: none;
}

.product-image-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 178px;
    overflow: auto;
    padding-right: 2px;
}

.product-image-item {
    min-width: 0;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 58px 30px;
    align-items: center;
    gap: 9px;
    min-height: 54px;
    padding: 6px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: color-mix(in srgb, var(--input) 82%, var(--panel) 18%);
}

.product-image-thumb {
    width: 48px;
    height: 40px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--input);
    overflow: hidden;
    cursor: zoom-in;
}

.product-image-item img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.product-image-info {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.product-image-info strong {
    overflow: hidden;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-image-info span {
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-cover-choice {
    min-height: auto;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px !important;
    color: var(--muted-strong);
    font-size: 11px;
    font-weight: 850;
    white-space: nowrap;
    overflow: hidden;
}

.image-cover-choice input[type="radio"] {
    width: 13px;
    min-height: 13px;
    accent-color: var(--brand);
}

.image-delete-button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    color: var(--danger);
    background: color-mix(in srgb, var(--panel) 80%, var(--danger) 6%);
    cursor: pointer;
}

.image-delete-button:hover {
    color: #fff;
    background: var(--danger);
}

.image-delete-button svg {
    width: 15px;
    height: 15px;
}

.image-help {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.image-search-modal-card {
    width: min(720px, 100%);
    max-height: 84vh;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 20px;
    background: var(--list-surface, var(--panel));
    box-shadow: 0 28px 80px rgba(2, 8, 23, .28);
    overflow: hidden;
}

.image-search-form {
    display: flex;
    gap: 8px;
}

.image-search-form input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    color: var(--list-text-primary, var(--text-strong));
    background: var(--list-surface, var(--input));
    font-family: "Poppins";
    font-size: 14px;
}

.image-search-status {
    color: var(--text-muted);
    font-size: 13px;
    min-height: 18px;
}

.image-search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding-right: 4px;
}

.image-search-result {
    position: relative;
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: var(--list-surface, var(--input));
}

.image-search-result img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-search-result.is-loading::after {
    content: "";
    position: absolute;
    inset: 0;
    display: flex;
    background: rgba(2, 8, 23, .55);
}

.image-search-result:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.image-search-bulk-card {
    width: min(820px, 100%);
}

.image-search-bulk-setup {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.image-search-bulk-setup label {
    display: grid;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-strong);
}

.image-search-bulk-setup select {
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    color: var(--list-text-primary, var(--text-strong));
    background: var(--list-surface, var(--input));
    font-family: "Poppins";
    font-size: 14px;
}

.image-search-bulk-scope-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.image-search-bulk-progress {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 0;
    overflow: hidden;
}

.image-search-bulk-progress-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-strong);
}

.image-search-bulk-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    padding-right: 4px;
}

.image-search-bulk-item {
    padding: 12px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 12px;
}

.image-search-bulk-item.is-done {
    border-color: var(--success, #17c979);
}

.image-search-bulk-item-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.image-search-bulk-item-status {
    color: var(--text-muted);
    font-size: 12px;
    white-space: nowrap;
}

.image-search-bulk-item-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 8px;
}

.image-search-bulk-item-results .image-search-result {
    aspect-ratio: 1;
}

.image-search-bulk-skip {
    grid-column: 1 / -1;
    min-height: 36px;
}

.image-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    place-items: center;
    padding: 28px;
    background: rgba(2, 8, 20, .76);
}

.image-preview-modal.is-open {
    display: grid;
}

.image-preview-modal img {
    max-width: min(900px, 92vw);
    max-height: 84vh;
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 28px 70px rgba(0, 0, 0, .34);
}

.image-preview-modal button {
    position: absolute;
    top: 22px;
    right: 24px;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    font-size: 24px;
    cursor: pointer;
}

.category-modal {
    position: fixed;
    inset: 0;
    z-index: 88;
    display: none;
    place-items: center;
    padding: 22px;
    background: rgba(2, 8, 20, .68);
}

.category-modal.is-open {
    display: grid;
}

.category-modal-card {
    width: min(440px, 94vw);
    display: grid;
    gap: 14px;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    padding: 18px;
    background: var(--panel);
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
}

.category-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.category-modal-head h2 {
    margin: 0;
    color: var(--text-strong);
    font-size: 20px;
}

.category-modal-head p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.category-modal-head button {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    color: var(--text-strong);
    background: var(--input);
    cursor: pointer;
    font-size: 22px;
}

.category-create-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.category-create-row input {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font-weight: 750;
}

.category-create-row button {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    padding: 0 14px;
    color: #fff;
    background: var(--brand);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
}

.category-list {
    display: grid;
    gap: 7px;
    max-height: 260px;
    overflow: auto;
}

.category-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 6px 7px 6px 12px;
    background: color-mix(in srgb, var(--input) 82%, var(--panel) 18%);
}

.category-row button:first-child {
    min-width: 0;
    overflow: hidden;
    border: 0;
    color: var(--text-strong);
    background: transparent;
    cursor: pointer;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 850;
}

.category-delete-button {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    color: var(--danger);
    background: color-mix(in srgb, var(--panel) 82%, var(--danger) 6%);
    cursor: pointer;
}

.category-delete-button:hover {
    color: #fff;
    background: var(--danger);
}

.category-delete-button svg {
    width: 15px;
    height: 15px;
}

.category-empty {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.image-count {
    display: grid;
    gap: 8px;
    align-items: end;
}

.product-grid > .span-1 {
    min-width: 0;
}

.product-grid > .span-1 input {
    padding-inline: 8px;
    text-align: center;
}

.image-count strong {
    color: var(--text-strong);
    font-size: 12px;
}

.image-count button {
    width: 38px;
    height: 38px;
    margin: 0;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    color: #fff;
    background: var(--brand);
    font-size: 28px;
    line-height: 1;
}

.consign-quick-settle-action {
    display: flex;
    align-items: flex-end;
}

.consign-quick-settle-action .primary-action {
    width: 100%;
    min-height: 44px;
}

.consign-quick-settle-hint {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.consign-settle-row.is-staged {
    background: color-mix(in srgb, var(--brand-strong) 10%, transparent);
    border-radius: 8px;
}

.consign-scan-summary {
    margin: 0;
    color: var(--brand-strong);
    font-size: 13px;
    font-weight: 700;
}

[data-consign-settle-search].is-scan-invalid {
    border-color: var(--danger, #d64545);
    animation: consignScanInvalid 0.4s ease;
}

@keyframes consignScanInvalid {
    0%, 100% { background: transparent; }
    50% { background: color-mix(in srgb, var(--danger, #d64545) 15%, transparent); }
}

.consign-scan-toggle-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.consign-scan-toggle-hint {
    margin: 0;
    color: var(--brand-strong);
    font-size: 12.5px;
    font-weight: 600;
}

.consign-quick-settle.is-scanning {
    outline: 2px solid var(--brand-strong);
    outline-offset: 4px;
    border-radius: 12px;
}

.consign-quick-settle.is-scanning [data-consign-scan-toggle] {
    background: var(--danger, #d64545);
    border-color: var(--danger, #d64545);
}

.revendedor-faixas-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0;
}

.revendedor-faixa-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
}

.revendedor-faixa-row label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
}

.revendedor-faixa-row button {
    height: 40px;
    white-space: nowrap;
}

.span-1 { grid-column: span 1; }
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-10 { grid-column: span 10; }
.span-11 { grid-column: span 11; }
.span-12 { grid-column: span 12; }

.badge {
    display: inline-block;
    margin-top: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    color: #72ff9d;
    background: rgba(18, 136, 58, .35);
    font-size: 10px;
    line-height: 1.25;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.badge.is-pending {
    color: var(--warning);
    background: rgba(146, 105, 0, .35);
}

@media (max-width: 1420px) {
    .mp-finance-top {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .mp-finance-actions {
        grid-column: 1 / -1;
        grid-row: 2;
        grid-template-columns: minmax(260px, 1.2fr) minmax(132px, .55fr) minmax(132px, .55fr) 138px 138px auto;
    }

    .mp-sync-form {
        grid-column: 2;
        grid-row: 1;
        justify-content: flex-end;
    }

    .mp-finance-card {
        height: min(calc(100svh - 290px), 680px);
    }
}

@media (max-width: 1260px) {
    .dashboard {
        grid-template-columns: 238px minmax(0, 1fr);
    }

    .sidebar { padding-inline: 12px; }
    .side-logo { margin-left: 0; }
    .logo-sidebar { width: 184px; max-height: 44px; }
    .nav-button {
        min-height: 38px;
        padding-inline: 9px;
        font-size: 13px;
    }
    .submenu { margin-left: 22px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .page-top {
        display: grid;
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .page-top > div:first-child {
        min-width: 0;
    }
    .page-top h1,
    .page-top p {
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .list-actions,
    .form-actions {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 2px;
    }
    .search-input {
        flex: 0 0 360px;
        width: 360px;
    }
    .mp-finance-top {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
    }
    .mp-finance-actions {
        grid-template-columns: minmax(240px, 1fr) minmax(124px, .45fr) minmax(124px, .45fr) 132px 132px auto;
        overflow-x: auto;
    }
    .mp-finance-actions .search-input {
        flex-basis: auto;
        width: auto;
    }
    .receivable-filter-actions {
        justify-content: flex-start;
    }
    .chart-card,
    .recent-card {
        height: auto;
        min-height: 360px;
    }
    .bars {
        height: 300px;
    }
    .contacts-card {
        height: calc(100svh - 220px);
        min-height: 420px;
    }
    .sales-item-entry {
        grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(90px, .4fr)) 42px;
    }
    .sales-item-entry label:first-child {
        grid-column: span 5;
    }
    .sales-item-entry label:nth-child(5),
    .sales-item-entry label:nth-child(6) {
        grid-column: span 2;
    }
}

@media (max-width: 1040px) {
    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sales-item-entry {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .sales-item-entry label,
    .sales-item-entry label:first-child,
    .sales-item-entry label:nth-child(5),
    .sales-item-entry label:nth-child(6) {
        grid-column: span 1;
    }
    .sales-item-entry .line-confirm {
        width: 100%;
    }
}

@media (max-width: 900px) {
    body.is-dashboard { overflow: auto; }

    .dashboard {
        display: block;
    }

    .sidebar {
        position: static;
        height: auto;
        min-height: auto;
        max-width: 100%;
        gap: 14px;
        padding: 16px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .side-logo {
        margin: 0;
        justify-content: center;
    }

    .logo-sidebar { width: 142px; max-height: 38px; }

    .side-nav {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 4px;
    }

    .menu-title,
    .submenu {
        display: none !important;
    }

    .menu-group { flex: 0 0 auto; }

    .nav-button {
        width: auto;
        min-width: 48px;
        min-height: 44px;
        grid-template-columns: 20px auto;
        padding: 0 14px;
        gap: 9px;
        white-space: nowrap;
        font-size: 14px;
    }

    .nav-button .chev { display: none; }

    .sidebar-bottom {
        margin: 0;
        display: none;
    }

    .dash-main { padding: 22px 16px; }
    .mp-finance-top {
        grid-template-columns: 1fr;
    }
    .mp-finance-actions {
        grid-column: auto;
        grid-row: auto;
        grid-template-columns: minmax(240px, 1fr) minmax(130px, .55fr) minmax(130px, .55fr) 136px 136px auto;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .mp-sync-form {
        grid-column: auto;
        grid-row: auto;
        justify-content: flex-start;
    }
    .mp-finance-card {
        height: auto;
        min-height: 460px;
    }
    .form-page-main {
        height: auto;
        min-height: 100svh;
        overflow: visible;
    }
    .customer-form {
        height: auto;
        display: block;
    }
    .form-card {
        max-height: none;
        overflow: visible;
    }
    .logo-upload {
        grid-template-columns: 1fr;
    }
    .mini-grid,
    .catalog-panel,
    .catalog-app-layout,
    .catalog-inputs-grid {
        grid-template-columns: 1fr;
    }
    .order-items {
        overflow-x: auto;
    }
    .order-items-head,
    .order-item-row {
        min-width: 900px;
    }
    .order-summary {
        display: grid;
        justify-content: stretch;
    }
    .permissions-grid {
        grid-template-columns: 1fr;
    }
    .seller-user-fields {
        grid-template-columns: 1fr;
    }
    .dash-top { display: grid; }
    .top-actions,
    .search-box { width: 100%; }
    .receivable-filters {
        grid-template-columns: 1fr;
    }
    .contacts-footer {
        align-items: flex-start;
        flex-direction: column;
        padding-block: 12px;
    }
    .receivable-totals {
        justify-content: flex-start;
    }
    .bars { gap: 12px; }
    .bar { width: 32px; }
    .chart-card,
    .recent-card {
        min-height: 320px;
    }
}

@media (max-width: 640px) {
    body { overflow: auto; }
    .page { padding: 34px 17px; }
    .login-shell { gap: 24px; }
    .login-card {
        min-height: auto;
        padding: 30px 24px 28px;
        border-radius: 22px;
    }
    .login-card h1 {
        margin-bottom: 26px;
        font-size: 22px;
    }
    label { font-size: 16px; }
    input { height: 50px; }
    .login-card > button { height: 50px; font-size: 17px; }
    .actions { font-size: 14px; }
    .stats-grid { grid-template-columns: 1fr; }
    .chart-card,
    .recent-card { min-height: 320px; }
    .bars { height: 220px; }
    .sale-row {
        grid-template-columns: 30px 1fr;
    }
    .sale-value {
        grid-column: 2;
        align-items: flex-start;
        text-align: left;
        white-space: normal;
    }
}

/* Integracoes */
.integrations-form {
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 6px;
}

.integrations-form > .page-top { grid-row: 1; }
.integrations-form > .integration-tabs { grid-row: 2; }
.integrations-form > .integrations-card {
    min-height: 0;
    grid-row: 3;
}

.integrations-feedback:empty {
    display: none;
}

.integrations-feedback {
    position: fixed;
    top: 18px;
    right: 24px;
    z-index: 620;
    display: grid;
    gap: 10px;
    width: min(420px, calc(100vw - 48px));
    pointer-events: none;
}

.integrations-feedback .page-alert {
    pointer-events: auto;
    box-shadow: 0 10px 26px rgba(15, 32, 56, .18);
}

.integrations-card {
    display: grid;
    align-content: start;
    gap: 20px;
    padding: 22px 24px 26px;
}

.integration-tabs {
    min-width: 0;
    min-height: 72px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--panel);
    box-shadow: var(--shadow);
    scrollbar-width: thin;
}

.integration-tab {
    width: 150px;
    min-width: 150px;
    height: 54px;
    min-height: 54px;
    flex: 0 0 150px;
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-rows: 1fr auto;
    align-items: center;
    gap: 0 9px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 7px 11px;
    color: var(--muted-strong);
    background: var(--panel-soft);
    text-align: left;
    text-decoration: none;
}

.integration-tab strong {
    font-size: 13px;
    white-space: nowrap;
}

.integration-tab small {
    grid-column: 2;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.integration-tab.is-active {
    border-color: var(--brand);
    color: var(--text-strong);
    background: color-mix(in srgb, var(--brand) 8%, var(--panel));
    box-shadow: inset 0 -2px 0 var(--brand);
}

.integration-tab:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.integration-panel {
    display: none;
}

.integration-panel.is-active {
    display: block;
}

.integration-bubble-stack.is-active {
    grid-row: 4;
    grid-column: 1 / -1;
    min-width: 0;
    max-height: calc(100vh - 115px);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: grid;
    gap: 16px;
    align-content: start;
}

.integration-bubble-stack .bubble-section-divider {
    border-top: 1px solid #dfe5ed;
    margin-top: 14px;
    padding-top: 14px;
}

.integration-provider-head-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.danger-action-outline {
    border: 1px solid #f2b8b5;
    background: transparent;
    color: #912018;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.danger-action-outline:hover {
    background: #fef4f3;
}

.integration-hidden-form {
    display: none;
}

.integration-danger-modal-field {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted-strong);
    margin-top: 4px;
}

.integration-danger-modal-field input {
    font-weight: 400;
}

.sinc-bubble-relatorio-wrap {
    max-height: 420px;
    overflow: auto;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
}

.sinc-bubble-relatorio-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.sinc-bubble-relatorio-tabela th {
    position: sticky;
    top: 0;
    background: var(--panel-soft);
    text-align: left;
    padding: 8px 10px;
    font-weight: 800;
    color: var(--muted-strong);
    border-bottom: 1px solid var(--line-soft);
}

.sinc-bubble-relatorio-tabela td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--line-soft);
}

.sinc-bubble-linha-excluir td {
    background: #fef4f3;
    color: #912018;
}

.sinc-bubble-linha-incluir td {
    background: #fff8e6;
    color: #8a5a00;
}

.sinc-bubble-linha-erro td {
    background: #f5f5f5;
    color: var(--muted);
}

.integration-provider-mark {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    grid-row: 1 / 3;
    border-radius: 8px;
    color: #fff;
    font-size: 11px;
    font-weight: 950;
}

.integration-provider-mark.mp { background: #168ddb; }
.integration-provider-mark.rc { background: #426aa1; }
.integration-provider-mark.sp { background: #d71920; }
.integration-provider-mark.ps { background: #0082c8; }
.integration-provider-mark.wa { background: #24b866; }
.integration-provider-mark.os { background: #e5484d; }
.integration-provider-mark.ef { background: #26364b; }
.integration-provider-mark.tn { background: #2764c4; }
.integration-provider-mark.pd { background: #0f8a75; }
.integration-provider-mark.bd { background: #4b5563; }

/* Superficie unificada da tela de Integracoes. */
.integrations-main {
    background: #f6f8fb;
}

.integrations-form {
    gap: 6px;
}

.integrations-form > .page-top {
    min-height: 52px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    padding: 0 2px;
}

.integrations-form > .page-top h1 {
    margin-bottom: 1px;
    font-size: 22px;
    line-height: 1.1;
}

.integrations-form > .page-top p {
    font-size: 12px;
    font-weight: 650;
}

.integration-tabs {
    min-height: 40px;
    gap: 6px;
    padding: 4px;
    border-color: #e6ebf1;
    background: #fbfcfe;
    box-shadow: 0 2px 8px rgba(21, 39, 66, .03);
}

.integration-tab {
    width: auto;
    min-width: 92px;
    height: 32px;
    min-height: 32px;
    flex: 0 0 auto;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 0 7px;
    border-color: transparent;
    background: transparent;
    padding: 2px 10px;
    opacity: .82;
    transition: background .16s ease, border-color .16s ease, opacity .16s ease, transform .16s ease;
}

.integration-tab:hover:not(:disabled) {
    border-color: #dde5f0;
    background: #fff;
    opacity: 1;
    transform: translateY(-1px);
}

.integration-tab.is-active {
    border-color: #356ca7;
    background: #eef5ff;
    opacity: 1;
    box-shadow: inset 0 -2px 0 #356ca7;
}

.integration-tab strong {
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.integration-tab small {
    font-size: 8.5px;
    font-weight: 700;
    white-space: nowrap;
}

.integration-tab .integration-provider-mark {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    font-size: 6.5px;
}

.integrations-card {
    min-height: 0;
    border: 1px solid #dfe5ed;
    border-radius: 8px;
    padding: 20px 22px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(19, 39, 64, .06);
}

.integration-section {
    gap: 20px;
    border-top: 0;
    padding: 0;
}

.integration-provider-head {
    min-height: 62px;
    padding: 0 0 20px;
    border-bottom: 1px solid #e4e9f0;
}

.integration-provider-head > div {
    min-width: 0;
    gap: 14px;
}

.integration-provider-head .integration-provider-mark {
    width: 46px;
    height: 46px;
    border-radius: 8px;
    box-shadow: 0 5px 11px rgba(36, 82, 136, .16);
}

.integration-provider-head h2 {
    font-size: 20px;
    font-weight: 850;
}

.integration-provider-head p,
.integration-section-head p {
    color: #6e7d91;
    font-size: 12px;
    font-weight: 600;
}

.integration-fields-grid {
    gap: 16px;
}

.integration-fields-grid label,
.integration-environment {
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 800;
}

.integration-environment select,
.integration-fields-grid input,
.integration-fields-grid select {
    height: 42px;
    min-height: 42px;
    margin-top: 6px;
    border-color: var(--line-soft);
    border-radius: 6px;
    background: var(--input);
    box-shadow: none;
    color: var(--text-strong);
    font-weight: 650;
}

.integration-environment select:focus,
.integration-fields-grid input:focus,
.integration-fields-grid select:focus {
    border-color: var(--brand);
    background: var(--panel);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent);
}

.integration-enable {
    min-height: 38px;
    gap: 10px;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 800;
}

.integration-enable input,
.integration-check input {
    width: 17px;
    height: 17px;
    flex-basis: 17px;
}

.integration-operation-summary,
.integration-token-status {
    gap: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: 13px 15px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.integration-operation-summary strong {
    color: var(--text-strong);
    font-weight: 850;
}

.integration-connect-card {
    border-color: var(--line-soft);
    border-radius: 8px;
    padding: 18px;
    background: var(--panel-soft);
}

.integration-connect-card.is-connected {
    border-color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, var(--panel-soft));
}

.integrations-card .form-actions,
.integrations-card .integration-save-row,
.integration-connect-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 4px;
}

.integrations-card .form-actions button,
.integrations-card .form-actions .button-like,
.integrations-card .integration-connect-actions button,
.integrations-card .integration-connect-actions .button-like {
    min-height: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    border-radius: 6px;
    padding: 0 15px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.integrations-card .secondary-action,
.integrations-card .button-like.secondary-action {
    border-color: #c8d5e4;
    background: #fff;
    color: #294c72;
}

.integrations-card .secondary-action:hover,
.integrations-card .button-like.secondary-action:hover {
    border-color: #86a9ce;
    background: #f4f8fc;
}

@media (max-width: 760px) {
    .integrations-card { min-height: 0; padding: 20px 16px; }
    .integration-provider-head { align-items: flex-start; gap: 14px; }
    .integration-provider-head .integration-enable { padding-top: 4px; }
    .integrations-card .form-actions > * { flex: 1 1 100%; }
}

.integration-provider-head,
.integration-provider-head > div,
.integration-section-head,
.integration-enable,
.integration-check {
    display: flex;
    align-items: center;
}

.integration-provider-head {
    justify-content: space-between;
    gap: 20px;
    padding: 2px 2px 0;
}

.integration-provider-head > div {
    gap: 12px;
}

.integration-provider-head .integration-provider-mark {
    width: 44px;
    height: 44px;
    font-size: 13px;
}

.integration-provider-head h2,
.integration-section h3 {
    margin: 0;
    color: var(--text-strong);
}

.integration-provider-head h2 { font-size: 21px; }
.integration-section h3 { font-size: 16px; }

.integration-provider-head p,
.integration-section-head p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.integration-enable,
.integration-check {
    gap: 9px;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 850;
}

.integration-enable input,
.integration-check input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    accent-color: var(--brand);
}

.integration-section {
    display: grid;
    gap: 16px;
    border-top: 2px solid color-mix(in srgb, var(--brand) 72%, var(--line-soft));
    padding: 17px 2px 2px;
}

.integration-section-head {
    justify-content: space-between;
    gap: 18px;
}

.integration-environment {
    width: min(220px, 100%);
    display: grid;
    gap: 6px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 850;
}

.integration-environment select,
.integration-fields-grid input,
.integration-fields-grid select {
    width: 100%;
    height: 44px;
    min-height: 44px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 13px;
    font-weight: 750;
}

.integration-token-status {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 12px 14px;
    background: var(--panel-soft);
}

.integration-connect-card {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 16px;
    background: var(--panel-soft);
}

.integration-connect-card.is-connected {
    border-color: color-mix(in srgb, #0ea66b 42%, var(--line-soft));
    background: color-mix(in srgb, #0ea66b 6%, var(--panel));
}

.integration-connect-card[hidden] {
    display: none;
}

/* Tamanho de checkbox previsivel independente de onde o "Ativar X" aparece
   (pagina de Integracoes, WhatsApp ou modal) - sem depender da ancestral
   ".integrations-main" ganhar a guerra de especificidade com o input{} base. */
.integration-enable input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 18px;
    flex: 0 0 18px;
}

.integration-connect-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #fff;
    background: #159ad6;
    font-size: 14px;
    font-weight: 950;
}

.integration-connect-card.is-connected .integration-connect-icon {
    background: #0ea66b;
    font-size: 22px;
}

.integration-connect-icon.wa {
    background: #24b866;
}

/* Selo de status no cabecalho (Central/Conectado/Verificando...) - diferente
   do .integration-connect-icon (caixa fixa 52x52 pra siglas tipo "WA"), este
   e' uma pilula que acompanha o tamanho do texto, sem cortar. */
.wa-header-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    background: #24b866;
    color: #fff;
    font-size: 12.5px;
    font-weight: 800;
    white-space: nowrap;
}

.wa-header-badge::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.wa-header-badge.is-checking {
    background: #159ad6;
}

.wa-header-badge.is-off {
    background: #94a3b8;
}

/* So o card principal rola - cabecalho e alertas ficam fixos, sem scroll
   de pagina (mesmo padrao da tela Cobrancas WhatsApp). */
.wa-whatsapp-main {
    display: flex;
    flex-direction: column;
    height: 100svh;
    box-sizing: border-box;
    overflow: hidden;
}

.wa-whatsapp-main .page-top,
.wa-whatsapp-main .page-alert {
    flex: 0 0 auto;
}

.wa-whatsapp-main .form-card.integrations-card {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.whatsapp-qrcode-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 280px;
    margin: 0 auto;
    padding: 20px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    text-align: center;
}

.whatsapp-qrcode-panel[hidden] {
    display: none;
}

.whatsapp-qrcode-panel img {
    width: 220px;
    height: 220px;
    border-radius: 8px;
    border: 1px solid var(--line-soft);
    padding: 8px;
    background: #fff;
}

.whatsapp-qrcode-panel p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.4;
}

.whatsapp-modo-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.whatsapp-modo-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    background: var(--panel);
    transition: border-color .15s ease, background .15s ease;
}

.whatsapp-modo-option:hover {
    border-color: var(--brand);
}

.whatsapp-modo-option.is-active {
    border-color: var(--brand);
    background: color-mix(in srgb, var(--brand) 6%, var(--panel));
}

.whatsapp-modo-option input[type="radio"] {
    width: 18px;
    height: 18px;
    margin: 3px 0 0;
    flex: 0 0 auto;
    accent-color: var(--brand);
}

.whatsapp-modo-option span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.whatsapp-modo-option strong {
    font-size: 13.5px;
    color: var(--text-strong);
}

.whatsapp-modo-option small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    font-weight: 650;
}

.integration-connect-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.integration-connect-copy strong {
    color: var(--text-strong);
    font-size: 16px;
    font-weight: 950;
}

.integration-connect-copy p,
.integration-connect-copy small {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
}

.integration-connect-copy small {
    color: #0a8b5a;
    font-weight: 850;
}

.integration-connect-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.integration-connect-actions button {
    min-height: 42px;
    margin: 0;
    border-radius: 8px;
    padding: 0 17px;
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.integration-connect-actions .secondary-action {
    border: 1px solid var(--brand);
    color: var(--brand-strong);
    background: var(--panel);
}

.button-like {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.integration-mobile-connect {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 156px auto;
    align-items: center;
    gap: 16px;
    border: 1px dashed color-mix(in srgb, var(--brand) 48%, var(--line-soft));
    border-radius: 8px;
    padding: 14px 16px;
    background: color-mix(in srgb, var(--brand) 5%, var(--panel));
}

.integration-mobile-connect strong {
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 950;
}

.integration-mobile-connect p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
}

.integration-mobile-connect .secondary-action {
    min-height: 40px;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 0 16px;
    color: var(--brand-strong);
    background: var(--panel);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.integration-oauth-qr {
    width: 156px;
    height: 156px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 10px;
    background: #fff;
}

.integration-oauth-qr canvas,
.integration-oauth-qr img,
.integration-oauth-qr svg {
    width: 132px !important;
    height: 132px !important;
}

.integration-oauth-qr span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}

.credentials-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    place-items: center;
    padding: 16px;
    background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(5px);
}

.credentials-modal.is-open {
    display: grid;
}

.credentials-card {
    width: min(760px, calc(100vw - 32px));
    max-height: calc(100dvh - 40px);
    overflow: auto;
}

.token-update-card {
    width: min(560px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 22px 24px;
}

.token-update-card h2 {
    margin-bottom: 6px;
    text-align: left;
}

.token-update-card .modal-head {
    margin-bottom: 18px;
}

.token-update-card .credentials-field {
    grid-template-columns: minmax(0, 1fr) auto;
}

.token-update-card .integration-save-row {
    margin-top: 18px;
    justify-content: flex-end;
}

.credentials-list {
    display: grid;
    gap: 12px;
}

.credentials-list label {
    display: grid;
    gap: 6px;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 850;
}

.credentials-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

.credentials-field input {
    width: 100%;
    height: 42px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--text-strong);
    background: var(--input);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 750;
}

.credentials-field button {
    min-width: 74px;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 0 12px;
    color: var(--brand-strong);
    background: var(--panel);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.credentials-warning {
    margin-top: 14px;
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--muted-strong);
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 750;
}

.integration-token-status > div:not(.integration-status-pill) {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.integration-token-status span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 850;
}

.integration-token-status strong {
    overflow: hidden;
    color: var(--text-strong);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.integration-api-actions button {
    min-height: 42px;
    margin: 0;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
}

.integration-api-actions .primary-action {
    color: #fff;
    background: var(--brand);
}

.integration-api-actions .secondary-action {
    color: var(--brand-strong);
    background: var(--panel);
}

.integration-api-actions button:disabled {
    border-color: var(--line-soft);
    color: var(--muted);
    background: var(--panel-soft);
    cursor: not-allowed;
    opacity: .72;
}

.integration-status-pill {
    border: 1px solid var(--line-soft);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--muted-strong);
    background: var(--panel);
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.integration-status-pill.is-ready {
    border-color: color-mix(in srgb, #0ea66b 45%, var(--line-soft));
    color: #0a8b5a;
    background: color-mix(in srgb, #0ea66b 9%, var(--panel));
}

.integration-fields-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 16px;
}

.integration-fields-grid label {
    min-width: 0;
    display: grid;
    align-content: end;
    gap: 7px;
    margin: 0;
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 850;
}

.integration-fields-grid label > small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    line-height: 1.35;
}

.integration-secret {
    width: 100%;
}

.integration-secret .toggle-password {
    bottom: 6px;
    color: var(--muted) !important;
}

.integration-secret .toggle-password:hover {
    color: var(--text-strong) !important;
}

.integration-fields-grid.operational {
    grid-template-columns: repeat(2, minmax(0, 1fr)) repeat(2, max-content);
    align-items: end;
}

.integration-fields-grid.operational .integration-check {
    min-height: 44px;
    padding: 0 6px;
}

.integration-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}

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

.integration-link-pedidos {
    grid-column: 1 / -1;
}

.integration-payment-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 11px 13px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.integration-payment-methods .integration-check {
    min-height: 24px;
}

.integration-fields-grid .span-two {
    grid-column: 1 / -1;
}

.integration-mp-resources .integration-section-head > button {
    min-height: 40px;
    margin: 0;
    border: 1px solid var(--brand);
    border-radius: 8px;
    padding: 0 16px;
    color: var(--brand-strong);
    background: var(--panel);
    font-weight: 850;
    cursor: pointer;
}

.integration-resource-status {
    border-radius: 7px;
    padding: 9px 12px;
    color: var(--muted-strong);
    background: var(--panel-soft);
    font-size: 12px;
    font-weight: 750;
}

.integration-resource-status.is-success { color: #087c52; }
.integration-resource-status.is-error { color: #c33b49; }

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

.integration-resource-card {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 14px;
    background: var(--panel-soft);
}

.integration-resource-card h4 {
    margin: 0;
    color: var(--text-strong);
    font-size: 14px;
}

.integration-resource-card label,
.integration-resource-fields label {
    min-width: 0;
    display: grid;
    gap: 6px;
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 850;
}

.integration-resource-card input,
.integration-resource-card select {
    width: 100%;
    height: 42px;
    min-height: 42px;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    padding: 0 11px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 12px;
    font-weight: 750;
}

.integration-resource-card > button,
.integration-resource-fields > button {
    min-height: 40px;
    margin: 0;
    border: 0;
    border-radius: 7px;
    padding: 0 13px;
    color: #fff;
    background: var(--brand);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.integration-resource-card button:disabled { opacity: .55; cursor: wait; }

.integration-resource-create {
    border-top: 1px solid var(--line-soft);
    padding-top: 10px;
}

.integration-resource-create summary {
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 900;
    cursor: pointer;
}

.integration-resource-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding-top: 12px;
}

.integration-resource-fields .span-two { grid-column: 1 / -1; }

.integration-print-fields {
    display: grid;
    gap: 10px;
    padding-top: 12px;
}

.integration-print-fields label {
    display: grid;
    gap: 6px;
}

.integration-print-fields textarea {
    width: 100%;
    min-height: 88px;
    resize: vertical;
    border: 1px solid var(--line-soft);
    border-radius: 7px;
    padding: 10px 11px;
    color: var(--text-strong);
    background: var(--input);
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
}

.integration-print-preview {
    width: 100%;
    border: 1px dashed var(--line-soft);
    border-radius: 8px;
    padding: 8px;
    background: var(--panel);
}

.integration-print-preview img {
    width: 100%;
    max-height: 150px;
    object-fit: contain;
    display: block;
}

.integration-operation-summary {
    display: grid;
    gap: 9px;
}

.integration-operation-summary span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line-soft);
    padding: 7px 0;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 700;
}

.integration-operation-summary strong { color: var(--text-strong); }

.bubble-sync-order-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0 0 0 20px;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 700;
}

.bubble-sync-order-list li strong { color: var(--text-strong); }

.bubble-sync-order-list li small {
    display: block;
    color: var(--muted);
    font-weight: 600;
}

.integration-force-full {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-strong);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.integration-force-full input {
    margin: 0;
}

@media (max-width: 1180px) {
    .integration-fields-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

    .integration-resource-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .integrations-form {
        gap: 10px;
    }

    .integration-tabs {
        min-height: 68px;
        padding: 6px 8px;
    }

    .integrations-card {
        padding-inline: 16px;
    }

    .integration-provider-head,
    .integration-section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .integration-token-status,
    .integration-fields-grid,
    .integration-fields-grid.operational,
    .integration-fields-grid.compact {
        grid-template-columns: 1fr;
    }

    .integration-fields-grid .span-two {
        grid-column: auto;
    }

    .integration-status-pill {
        justify-self: start;
    }

    .integration-connect-card {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .integration-connect-icon {
        width: 44px;
        height: 44px;
    }

    .integration-connect-actions {
        grid-column: 1 / -1;
        flex-wrap: wrap;
    }

    .integration-mobile-connect {
        grid-template-columns: 1fr;
    }

    .integration-oauth-qr {
        justify-self: start;
    }

    .credentials-field {
        grid-template-columns: 1fr;
    }

    .integration-resource-fields { grid-template-columns: 1fr; }
    .integration-resource-fields .span-two { grid-column: auto; }
}

/* Rota Certa / CIOT */
.form-help {
    margin: 6px 0 12px;
    color: var(--muted);
    font-size: 13px;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    cursor: pointer;
    font-weight: 600;
}

.checkbox-option input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}
.ciot-table .contacts-head,
.ciot-table .contacts-row {
    grid-template-columns: minmax(170px, 1.45fr) 74px 118px 92px 82px 104px 42px;
    column-gap: 10px;
}
.ciot-table .contacts-head > span,
.ciot-table .contacts-row > span,
.ciot-table .contacts-row > strong,
.ciot-table .contacts-row > div {
    min-width: 0;
}
.ciot-table .contacts-head > span {
    white-space: nowrap;
}
.ciot-table .contacts-row .status-pill {
    min-width: 0;
    width: fit-content;
    max-width: 100%;
    padding-inline: 10px;
}
.ciot-table .action-cell {
    justify-content: center;
}
.cte-table .contacts-head,
.cte-table .contacts-row {
    grid-template-columns: 38px minmax(82px, .56fr) minmax(62px, .44fr) minmax(86px, .56fr) minmax(120px, .84fr) minmax(130px, .92fr) minmax(90px, .6fr) minmax(100px, .66fr) minmax(70px, .44fr) 42px;
    column-gap: 8px;
    row-gap: 8px;
}
.cte-card {
    height: min(calc(100svh - 170px), 638px);
    min-height: 0;
}
.cte-card .contacts-table {
    width: 100%;
    min-width: 0;
}
.cte-card .contacts-scroll {
    max-height: none;
}
.cte-table .contacts-head {
    min-height: 44px;
}
.cte-table .contacts-row {
    min-height: 58px;
    padding-top: 8px;
    padding-bottom: 8px;
}
.cte-table .contacts-row > *,
.cte-main-cell {
    min-width: 0;
}
.cte-main-cell strong,
.cte-main-cell small,
.cte-key-cell {
    display: block;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.35;
}
.cte-key-cell {
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    font-weight: 700;
    word-break: break-all;
}
.cte-insurance-cell {
    min-width: 0;
    display: grid;
    gap: 4px;
    align-content: center;
}
.cte-insurance-cell .status-pill {
    width: fit-content;
}
.cte-insurance-cell small {
    display: block;
    max-width: 100%;
    color: var(--muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    font-weight: 800;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-all;
}
.cte-table .contacts-row > strong:nth-child(3) {
    font-size: 14px;
    white-space: normal;
    overflow-wrap: break-word;
}
.cte-table .status-pill {
    justify-self: start;
}
.cte-select-cell,
.mdfe-select-cell {
    display: grid;
    place-items: center;
    width: 28px;
    justify-self: center;
}
.cte-select-cell input,
.mdfe-select-cell input {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    margin: 0;
    border: 2px solid var(--line-soft);
    border-radius: 4px;
    background: var(--input);
    accent-color: var(--brand);
    cursor: pointer;
}
.cte-select-cell input:checked,
.mdfe-select-cell input:checked {
    border-color: var(--brand);
    background:
        linear-gradient(45deg, transparent 52%, #fff 52% 62%, transparent 62%) 2px 0 / 6px 10px no-repeat,
        linear-gradient(-45deg, transparent 48%, #fff 48% 58%, transparent 58%) 5px 0 / 7px 10px no-repeat,
        var(--brand);
}
.cte-select-cell input:disabled,
.mdfe-select-cell input:disabled {
    cursor: not-allowed;
    opacity: .45;
}
.cte-table .contacts-row > span,
.cte-table .contacts-row > strong {
    align-self: center;
}
.cte-table .contacts-row > span:not(.status-pill):not(.cte-insurance-icon):not(.cte-select-cell),
.cte-table .contacts-row > strong {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.35;
}
.cte-insurance-icon {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    justify-self: center;
    color: #f59e0b;
}
.cte-insurance-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.cte-insurance-icon.is-ok {
    color: #22c55e;
}
.cte-insurance-icon.is-error {
    color: #ef4444;
}
.cte-insurance-icon.is-pending {
    color: #f59e0b;
}
.mdfe-table .contacts-head,
.mdfe-table .contacts-row {
    grid-template-columns: 38px minmax(82px, .56fr) minmax(62px, .42fr) minmax(78px, .5fr) minmax(82px, .5fr) minmax(104px, .68fr) minmax(86px, .56fr) minmax(70px, .46fr) minmax(110px, .72fr) minmax(70px, .44fr) 42px;
    column-gap: 8px;
    row-gap: 8px;
}
.cte-table .contacts-head > *,
.cte-table .contacts-row > *,
.mdfe-table .contacts-head > *,
.mdfe-table .contacts-row > * {
    min-width: 0;
}
.cte-table .action-cell,
.mdfe-table .action-cell {
    width: 42px;
    justify-self: end;
}
.cte-table .dots-button,
.mdfe-table .dots-button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    justify-self: end;
}
.mdfe-table .contacts-row strong,
.mdfe-table .contacts-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mdfe-table .contacts-row > span,
.mdfe-table .contacts-row > strong {
    align-self: center;
}
.mdfe-table .contacts-row > span:not(.status-pill):not(.mdfe-insurance-icon):not(.mdfe-select-cell),
.mdfe-table .contacts-row > strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mdfe-insurance-icon {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    justify-self: center;
    color: #f59e0b;
}
.mdfe-insurance-icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.mdfe-insurance-icon.is-ok {
    color: #22c55e;
}
.mdfe-insurance-icon.is-error {
    color: #ef4444;
}
.mdfe-insurance-icon.is-pending {
    color: #f59e0b;
}
.mdfe-doc-list {
    display: grid;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel-soft);
}
.mdfe-doc-list label {
    min-height: 58px;
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, .22);
    border-radius: 8px;
    background: var(--panel);
}
.mdfe-doc-list span,
.mdfe-doc-list strong,
.mdfe-doc-list small {
    min-width: 0;
}
.mdfe-doc-list strong,
.mdfe-doc-list small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mdfe-doc-list small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}
.cte-file-field input[type="file"] {
    height: auto;
    min-height: 54px;
    padding: 14px;
    border-style: dashed;
    line-height: 1.3;
}
.cte-file-field small {
    display: block;
    margin-top: 8px;
}
.trips-table.contacts-table {
    min-width: 0;
}
.trip-doc-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.doc-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}
.doc-badge.is-partial {
    background: rgba(217, 158, 12, .16);
    color: #a06400;
}
.doc-badge.is-done {
    background: rgba(21, 153, 71, .14);
    color: #159947;
}
.doc-badge.is-locked {
    background: rgba(220, 38, 38, .12);
    color: #dc2626;
}
.trips-table .contacts-head,
.trips-table .contacts-row {
    grid-template-columns: minmax(125px, .85fr) minmax(175px, 1.2fr) minmax(140px, 1fr) 64px 90px minmax(110px, .8fr) 48px;
}
.drivers-table .contacts-head,
.drivers-table .contacts-row {
    grid-template-columns: minmax(150px, 1.1fr) minmax(100px, .7fr) minmax(150px, 1fr) minmax(64px, .45fr) 92px 136px 64px;
    min-width: 0;
}
.drivers-table .efrete-cel { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.drivers-table .efrete-cel small { color: var(--muted); font-size: 11px; line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; }
.vehicles-table .contacts-head,
.vehicles-table .contacts-row {
    grid-template-columns: minmax(150px, 1fr) minmax(90px, .6fr) minmax(100px, .65fr) minmax(150px, 1fr) 92px 136px 64px;
}
.vehicles-table .efrete-cel { display: grid; gap: 3px; justify-items: start; min-width: 0; }
.vehicles-table .efrete-cel small { color: var(--muted); font-size: 11px; line-height: 1.25; white-space: normal; overflow: visible; text-overflow: clip; }
.routes-table .contacts-head,
.routes-table .contacts-row {
    grid-template-columns: minmax(180px, 1fr) minmax(170px, .9fr) minmax(170px, .9fr) minmax(120px, .75fr) 96px 86px;
}
.sales-routes-table .contacts-head,
.sales-routes-table .contacts-row {
    grid-template-columns: minmax(120px, .75fr) minmax(130px, .85fr) minmax(170px, 1fr) minmax(120px, .85fr) 96px 110px 86px;
}
.sales-routes-table .contacts-row > div {
    min-width: 0;
}
.sales-routes-table .contacts-row strong,
.sales-routes-table .contacts-row small {
    overflow-wrap: anywhere;
}
.trips-table .contacts-row > div {
    min-width: 0;
}
.drivers-table .contacts-row > div {
    min-width: 0;
}
.vehicles-table .contacts-row > div,
.routes-table .contacts-row > div {
    min-width: 0;
}
.trips-table .contacts-row strong,
.trips-table .contacts-row small,
.drivers-table .contacts-row strong,
.drivers-table .contacts-row small,
.vehicles-table .contacts-row strong,
.vehicles-table .contacts-row small,
.routes-table .contacts-row strong,
.routes-table .contacts-row small {
    overflow-wrap: anywhere;
}
.status-pill {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    justify-content: center;
    min-height: 26px;
    padding: 3px 12px;
    border-radius: 999px;
    border: 1px solid rgba(66, 106, 161, .35);
    background: rgba(66, 106, 161, .12);
    color: var(--accent-strong, #315f9b);
    font-weight: 800;
    font-size: 13px;
    white-space: nowrap;
}
.status-encerrado,
.status-encerrada { background: rgba(99, 102, 241, .14); color: #4338ca; border-color: rgba(99, 102, 241, .35); }
.status-erro { background: rgba(220, 38, 38, .14); color: #b91c1c; border-color: rgba(220, 38, 38, .35); }
.status-rascunho { background: rgba(100, 116, 139, .14); color: #475569; border-color: rgba(100, 116, 139, .35); }
.status-autorizada { background: rgba(16, 185, 129, .12); color: #047857; border-color: rgba(16, 185, 129, .35); }
.status-manifestado { background: rgba(37, 99, 235, .13); color: #1d4ed8; border-color: rgba(37, 99, 235, .35); }
.status-rejeitada { background: rgba(220, 38, 38, .14); color: #b91c1c; border-color: rgba(220, 38, 38, .35); }
.status-cancelada { background: rgba(100, 116, 139, .16); color: #334155; border-color: rgba(100, 116, 139, .4); }
.trip-status-finalizada { background: rgba(16, 185, 129, .12); color: #047857; border-color: rgba(16, 185, 129, .35); }
.trip-status-cancelada { background: rgba(220, 38, 38, .14); color: #b91c1c; border-color: rgba(220, 38, 38, .35); }
.trip-status-em-andamento { background: rgba(245, 158, 11, .14); color: #92400e; border-color: rgba(245, 158, 11, .35); }
.trip-status-pronta-para-iniciar { background: rgba(66, 106, 161, .12); color: var(--accent-strong, #315f9b); border-color: rgba(66, 106, 161, .35); }
.trip-status-rascunho { background: rgba(107, 114, 128, .12); color: #4b5563; border-color: rgba(107, 114, 128, .32); }
.ciot-preview-card { margin-top: 18px; }
.ciot-preview-header,
.ciot-preview-layout {
    display: grid;
    gap: 18px;
}
.ciot-preview-header {
    grid-template-columns: 1fr auto;
    align-items: center;
    border-bottom: 2px solid var(--accent, #426aa1);
    padding-bottom: 14px;
}
.ciot-preview-header h2,
.ciot-preview-header p { margin: 0; }
.ciot-preview-layout { grid-template-columns: minmax(280px, .85fr) minmax(0, 1.4fr); align-items: stretch; }
.ciot-cte-list {
    display: grid;
    gap: 10px;
    align-content: start;
}
.ciot-cte-list h3 { margin: 0 0 4px; }
.ciot-cte-item {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--border, #d8dee9);
    border-radius: 10px;
    background: var(--surface-muted, #f3f6fb);
}
.ciot-cte-item span,
.ciot-cte-item small { color: var(--muted, #6b7280); overflow-wrap: anywhere; }

/* Padrao visual compartilhado para listagens administrativas (Figma 357:4). */
:root[data-theme="dark"] {
    --list-page-bg: var(--app-bg);
    --list-surface: var(--panel);
    --list-surface-soft: var(--panel-soft);
    --list-border: var(--line-soft);
    --list-row-border: rgba(148, 163, 184, .18);
    --list-text-primary: var(--text-strong);
    --list-text-secondary: var(--muted);
    --list-action-bg: var(--brand);
    --list-action-border: var(--brand);
    --list-action-text: #ffffff;
    --list-hover-bg: rgba(59, 96, 143, .16);
}

:root[data-theme="light"] {
    --list-page-bg: #f4f4f5;
    --list-surface: #ffffff;
    --list-surface-soft: #fafafa;
    --list-border: #e4e4e7;
    --list-row-border: rgba(131, 131, 131, .25);
    --list-text-primary: #090f1b;
    --list-text-secondary: #71717a;
    --list-action-bg: #3b608f;
    --list-action-border: #3b608f;
    --list-action-text: #ffffff;
    --list-hover-bg: rgba(59, 96, 143, .06);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .dash-main {
    padding: 32px;
    background: var(--list-page-bg);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .page-top {
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 20px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .page-top h1 {
    color: var(--list-text-primary);
    font-family: "Poppins";
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .page-top p {
    margin-top: 4px;
    color: var(--list-text-secondary);
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .list-actions {
    gap: 12px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .search-input {
    width: 320px;
    height: 44px;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    padding: 0 14px;
    border-color: var(--list-border);
    border-radius: 10px;
    color: var(--list-text-secondary);
    background: var(--list-surface);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .search-input svg {
    width: 18px;
    height: 18px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .search-input input {
    color: var(--list-text-primary);
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .search-input input::placeholder {
    color: var(--list-text-secondary);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .ghost-action,
.dashboard:has(.contacts-card):not(.dashboard-home) .primary-action {
    min-width: 0;
    min-height: 44px;
    gap: 8px;
    padding: 0 20px;
    border-radius: 10px;
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .ghost-action {
    border-color: var(--list-border);
    color: var(--list-text-primary);
    background: var(--list-surface);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .ghost-action svg {
    width: 16px;
    height: 16px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .primary-action {
    border-color: var(--list-action-border);
    color: var(--list-action-text);
    background: var(--list-action-bg);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .primary-action > span {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    font-size: 18px;
    line-height: 1;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-card {
    height: calc(100svh - 140px);
    min-height: 420px;
    border-color: var(--list-border);
    border-radius: 20px;
    background: var(--list-surface);
    overflow: hidden;
    box-shadow: none;
}

:root[data-theme="light"] .dashboard:has(.contacts-card):not(.dashboard-home) .contacts-card {
    box-shadow: none;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table {
    min-width: 900px;
    height: 100%;
    min-height: 0;
    background: var(--list-surface);
    align-self: stretch;
    overflow: hidden;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-card > [data-bulk-receivables-delete-form],
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-card > [data-bulk-payables-form] {
    display: none;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-scroll {
    max-height: none;
    height: 100%;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-head,
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row {
    gap: 14px;
    padding-right: 20px;
    padding-left: 20px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-head {
    min-height: 50px;
    border-bottom-color: var(--list-border);
    color: var(--list-text-primary);
    font-family: "Inter";
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .6px;
    text-transform: uppercase;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row {
    min-height: 68px;
    border-bottom-color: var(--list-row-border);
    color: var(--list-text-secondary);
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row:hover {
    background: var(--list-hover-bg);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > span,
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > strong,
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > div:not(.action-cell) {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row strong {
    color: var(--list-text-primary);
    font-family: "Poppins";
    font-size: 15px;
    font-weight: 500;
    line-height: 1.25;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row small {
    margin-top: 3px;
    color: var(--list-text-secondary);
    font-family: "Poppins";
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > span:not(:has(.type-pill)) {
    color: var(--list-text-secondary);
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .contacts-row > span:has(.is-generated-os) {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill,
.dashboard:has(.contacts-card):not(.dashboard-home) .status-pill {
    min-height: 24px;
    padding: 3px 9px;
    border-radius: 20px;
    font-family: "Poppins";
    font-size: 11px;
    font-weight: 600;
    line-height: 1.15;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill {
    border-color: #3b82f6;
    color: #60a5fa;
    background: rgba(59, 130, 246, .12);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-rascunho {
    border-color: #94A3B8;
    color: #94A3B8;
    background: rgba(148, 163, 184, .14);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-enviado {
    border-color: #38B6FF;
    color: #38B6FF;
    background: rgba(56, 182, 255, .14);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-aprovado,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-aprovada {
    border-color: #02BD37;
    color: #02BD37;
    background: rgba(2, 189, 55, .14);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-recusado {
    border-color: #F59E0B;
    color: #F59E0B;
    background: rgba(245, 158, 11, .16);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-cancelado,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-cancelada {
    border-color: #FF0000;
    color: #FF0000;
    background: rgba(255, 0, 0, .12);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-generated-os {
    border-color: #C084FC;
    color: #C084FC;
    background: rgba(192, 132, 252, .14);
    text-decoration: none;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-supplier {
    border-color: #a855f7;
    color: #c084fc;
    background: rgba(168, 85, 247, .10);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-admin,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-pago,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-entregue,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-entrada,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-stock-entrada {
    border-color: #22c55e;
    color: #16a34a;
    background: rgba(34, 197, 94, .12);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-service,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-parcial,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-aguardando_pagamento,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-estornado {
    border-color: #f59e0b;
    color: #d97706;
    background: rgba(245, 158, 11, .12);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-atrasado,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-vencido,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-saida,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-stock-saida {
    border-color: #ef4444;
    color: #dc2626;
    background: rgba(239, 68, 68, .12);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-expirado,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-stock-ajuste {
    border-color: #94a3b8;
    color: #64748b;
    background: rgba(100, 116, 139, .12);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .order-origin-pill {
    min-width: 18px;
    min-height: 18px;
    padding: 0 5px;
    font-size: 9px;
    line-height: 1;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .order-origin-pill.is-pdv {
    border-color: #17c979;
    color: #047857;
    background: rgba(23, 201, 121, .14);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .order-origin-pill.is-order {
    border-color: #5a96ff;
    color: #2563eb;
    background: rgba(90, 150, 255, .12);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .order-origin-pill.is-consignment {
    border-color: #f0b84f;
    color: #b7791f;
    background: rgba(240, 184, 79, .16);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .order-origin-pill.is-tele-venda {
    border-color: #8b5cf6;
    color: #6d28d9;
    background: rgba(139, 92, 246, .16);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .order-reference-line {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: none;
    min-width: 0;
    overflow: visible;
    white-space: nowrap;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .order-reference-line strong {
    font-size: 16px;
    line-height: 1.2;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .contacts-row > div:first-child:not(.action-cell) {
    overflow: visible;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .action-cell {
    justify-self: center;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-head > span:last-child {
    text-align: center;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .dots-button {
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 8px;
    color: var(--list-text-secondary);
    font-size: 0;
    letter-spacing: 0;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .dots-button::before {
    content: "";
    width: 20px;
    height: 20px;
    display: block;
    background: currentColor;
    -webkit-mask: radial-gradient(circle at 5px 10px, #000 0 2px, transparent 2.1px), radial-gradient(circle at 10px 10px, #000 0 2px, transparent 2.1px), radial-gradient(circle at 15px 10px, #000 0 2px, transparent 2.1px);
    mask: radial-gradient(circle at 5px 10px, #000 0 2px, transparent 2.1px), radial-gradient(circle at 10px 10px, #000 0 2px, transparent 2.1px), radial-gradient(circle at 15px 10px, #000 0 2px, transparent 2.1px);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .dots-button:hover,
.dashboard:has(.contacts-card):not(.dashboard-home) .action-cell.is-open .dots-button {
    color: var(--list-text-primary);
    background: var(--list-surface-soft);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .row-actions-menu {
    border-color: var(--list-border);
    border-radius: 12px;
    background: var(--list-surface);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .row-actions-menu a,
.dashboard:has(.contacts-card):not(.dashboard-home) .row-actions-menu button {
    min-height: 38px;
    border-color: transparent;
    border-radius: 8px;
    color: var(--list-text-primary);
    background: transparent;
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .row-actions-menu a:hover,
.dashboard:has(.contacts-card):not(.dashboard-home) .row-actions-menu button:hover {
    border-color: transparent;
    background: var(--list-hover-bg);
    color: var(--list-text-primary);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .empty-row {
    min-height: 80px;
    display: grid;
    place-items: center;
    padding: 24px;
    color: var(--list-text-secondary);
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-footer {
    min-height: 56px;
    padding: 12px 20px;
    border-top: 1px solid var(--list-border);
    color: var(--list-text-secondary);
    background: var(--list-surface);
    font-family: "Inter";
    font-size: 13px;
    font-weight: 400;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .pager {
    gap: 8px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .pager a,
.dashboard:has(.contacts-card):not(.dashboard-home) .pager button {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-color: var(--list-border);
    border-radius: 8px;
    color: var(--list-text-primary);
    background: transparent;
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 400;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .pager svg {
    width: 16px;
    height: 16px;
    display: block;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .pager > :first-child,
.dashboard:has(.contacts-card):not(.dashboard-home) .pager > :last-child {
    font-size: 0;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .pager > :first-child:not(:has(svg))::before,
.dashboard:has(.contacts-card):not(.dashboard-home) .pager > :last-child:not(:has(svg))::before {
    content: "";
    width: 16px;
    height: 16px;
    display: block;
    background: currentColor;
    -webkit-mask: linear-gradient(45deg, transparent 42%, #000 43% 57%, transparent 58%), linear-gradient(-45deg, transparent 42%, #000 43% 57%, transparent 58%);
    mask: linear-gradient(45deg, transparent 42%, #000 43% 57%, transparent 58%), linear-gradient(-45deg, transparent 42%, #000 43% 57%, transparent 58%);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .pager > :first-child:not(:has(svg))::before {
    transform: rotate(180deg);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .pager a.is-active,
.dashboard:has(.contacts-card):not(.dashboard-home) .pager button.is-active {
    border-color: var(--list-action-border);
    color: #ffffff;
    background: var(--list-action-bg);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .pager a.is-disabled {
    opacity: .42;
    pointer-events: none;
}

@media (max-width: 1120px) {
    .dashboard:has(.contacts-card):not(.dashboard-home) .page-top {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dashboard:has(.contacts-card):not(.dashboard-home) .list-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
        overflow: visible;
    }

    .dashboard:has(.contacts-card):not(.dashboard-home) .search-input {
        flex: 1 1 320px;
        width: auto;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .dashboard:has(.contacts-card):not(.dashboard-home) .dash-main {
        padding: 24px 16px;
    }

    .dashboard:has(.contacts-card):not(.dashboard-home) .page-top h1,
    .dashboard:has(.contacts-card):not(.dashboard-home) .page-top p {
        white-space: normal;
    }

    .dashboard:has(.contacts-card):not(.dashboard-home) .list-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .dashboard:has(.contacts-card):not(.dashboard-home) .search-input,
    .dashboard:has(.contacts-card):not(.dashboard-home) .ghost-action,
    .dashboard:has(.contacts-card):not(.dashboard-home) .primary-action {
        width: 100%;
    }

    .dashboard:has(.contacts-card):not(.dashboard-home) .contacts-card {
        height: min(calc(100svh - 180px), 620px);
        min-height: 320px;
    }

    .dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table {
        min-width: 760px;
        height: 100%;
    }

    .dashboard:has(.contacts-card):not(.dashboard-home) .contacts-footer {
        align-items: flex-start;
        gap: 12px;
    }
}

/* Sidebar unificada: todas as telas autenticadas usam o mesmo padrão do Dashboard. */
:root[data-theme="dark"] .dashboard,
:root[data-theme="dark"] .dashboard:not(.dashboard-home),
:root[data-theme="dark"] .dashboard-home {
    --home-sidebar-bg: linear-gradient(180deg, #07101f 0%, #070d18 100%);
    --home-sidebar-bottom-bg: #070d18;
    --home-inner-bg: rgba(15, 23, 42, .56);
    --home-icon-bg: rgba(15, 23, 42, .9);
    --home-nav-text: #8f9db2;
    --home-nav-active-bg: #3B608F;
    --figma-icon-primary: #f8fafc;
    --figma-icon-secondary: #cbd5e1;
    --figma-icon-muted: #94a3b8;
    --figma-icon-accent: #38b6ff;
}

:root[data-theme="light"] .dashboard,
:root[data-theme="light"] .dashboard:not(.dashboard-home),
:root[data-theme="light"] .dashboard-home {
    --home-sidebar-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    --home-sidebar-bottom-bg: #ffffff;
    --home-inner-bg: #f8fafc;
    --home-icon-bg: #f1f8ff;
    --home-nav-text: #64748b;
    --home-nav-active-bg: #3B608F;
    --figma-icon-primary: #0f172a;
    --figma-icon-secondary: #475569;
    --figma-icon-muted: #64748b;
    --figma-icon-accent: #0284c7;
}

.dashboard .sidebar,
.dashboard:not(.dashboard-home) .sidebar,
.dashboard-home .sidebar {
    gap: 14px;
    padding: 24px 18px max(12px, env(safe-area-inset-bottom));
    border-right-color: var(--line);
    background: var(--home-sidebar-bg);
}

.dashboard .logo-sidebar,
.dashboard:not(.dashboard-home) .logo-sidebar,
.dashboard-home .logo-sidebar {
    width: 194px;
    max-height: 46px;
}

:root[data-theme="dark"] .dashboard .logo-sidebar-dark,
:root[data-theme="dark"] .dashboard:not(.dashboard-home) .logo-sidebar-dark,
:root[data-theme="dark"] .dashboard-home .logo-sidebar-dark {
    display: block;
}

:root[data-theme="dark"] .dashboard .logo-sidebar-light,
:root[data-theme="dark"] .dashboard:not(.dashboard-home) .logo-sidebar-light,
:root[data-theme="dark"] .dashboard-home .logo-sidebar-light {
    display: none;
}

:root[data-theme="light"] .dashboard .logo-sidebar-dark,
:root[data-theme="light"] .dashboard:not(.dashboard-home) .logo-sidebar-dark,
:root[data-theme="light"] .dashboard-home .logo-sidebar-dark {
    display: none;
}

:root[data-theme="light"] .dashboard .logo-sidebar-light,
:root[data-theme="light"] .dashboard:not(.dashboard-home) .logo-sidebar-light,
:root[data-theme="light"] .dashboard-home .logo-sidebar-light {
    display: block;
}

.dashboard .sidebar-bottom,
.dashboard:not(.dashboard-home) .sidebar-bottom,
.dashboard-home .sidebar-bottom {
    background: var(--home-sidebar-bottom-bg);
}

.dashboard .side-nav,
.dashboard:not(.dashboard-home) .side-nav,
.dashboard-home .side-nav {
    gap: 7px;
}

.dashboard .menu-title,
.dashboard:not(.dashboard-home) .menu-title,
.dashboard-home .menu-title {
    margin: 13px 10px 5px;
    color: color-mix(in srgb, var(--muted) 78%, transparent);
    font-family: "Inter";
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
}

.dashboard .nav-button,
.dashboard:not(.dashboard-home) .nav-button,
.dashboard-home .nav-button {
    min-height: 40px;
    border-radius: 10px;
    color: var(--home-nav-text);
    font-family: "Inter";
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.dashboard .submenu button,
.dashboard .submenu a,
.dashboard:not(.dashboard-home) .submenu button,
.dashboard:not(.dashboard-home) .submenu a,
.dashboard-home .submenu button,
.dashboard-home .submenu a {
    min-height: 31px;
    color: var(--muted);
    font-family: "Inter";
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
}

.dashboard .submenu-group-title,
.dashboard:not(.dashboard-home) .submenu-group-title,
.dashboard-home .submenu-group-title {
    font-family: "Inter";
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
}

.dashboard .submenu button:hover,
.dashboard .submenu button:focus-visible,
.dashboard .submenu button.is-active,
.dashboard .submenu a:hover,
.dashboard .submenu a:focus-visible,
.dashboard .submenu a.is-active,
.dashboard:not(.dashboard-home) .submenu button:hover,
.dashboard:not(.dashboard-home) .submenu button:focus-visible,
.dashboard:not(.dashboard-home) .submenu button.is-active,
.dashboard:not(.dashboard-home) .submenu a:hover,
.dashboard:not(.dashboard-home) .submenu a:focus-visible,
.dashboard:not(.dashboard-home) .submenu a.is-active,
.dashboard-home .submenu button:hover,
.dashboard-home .submenu button:focus-visible,
.dashboard-home .submenu button.is-active,
.dashboard-home .submenu a:hover,
.dashboard-home .submenu a:focus-visible,
.dashboard-home .submenu a.is-active {
    color: #FFFFFF;
    background: var(--home-nav-active-bg);
}

.dashboard .nav-button:hover,
.dashboard .nav-button:focus-visible,
.dashboard:not(.dashboard-home) .nav-button:hover,
.dashboard:not(.dashboard-home) .nav-button:focus-visible,
.dashboard-home .nav-button:hover,
.dashboard-home .nav-button:focus-visible {
    color: var(--text-strong);
    background: color-mix(in srgb, var(--home-nav-active-bg) 22%, transparent);
}

.dashboard .nav-button.is-active,
.dashboard .menu-group.is-open > .nav-button,
.dashboard:not(.dashboard-home) .nav-button.is-active,
.dashboard:not(.dashboard-home) .menu-group.is-open > .nav-button,
.dashboard-home .nav-button.is-active,
.dashboard-home .menu-group.is-open > .nav-button {
    color: #FFFFFF;
    background: var(--home-nav-active-bg);
}

.dashboard .figma-icon--sidebar,
.dashboard:not(.dashboard-home) .figma-icon--sidebar,
.dashboard-home .figma-icon--sidebar {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    color: var(--figma-icon-secondary);
}

.dashboard .nav-button:hover .figma-icon--sidebar,
.dashboard .nav-button:focus-visible .figma-icon--sidebar,
.dashboard:not(.dashboard-home) .nav-button:hover .figma-icon--sidebar,
.dashboard:not(.dashboard-home) .nav-button:focus-visible .figma-icon--sidebar,
.dashboard-home .nav-button:hover .figma-icon--sidebar,
.dashboard-home .nav-button:focus-visible .figma-icon--sidebar {
    color: var(--figma-icon-primary);
}

.dashboard .nav-button.is-active .figma-icon--sidebar,
.dashboard .menu-group.is-open > .nav-button .figma-icon--sidebar,
.dashboard:not(.dashboard-home) .nav-button.is-active .figma-icon--sidebar,
.dashboard:not(.dashboard-home) .menu-group.is-open > .nav-button .figma-icon--sidebar,
.dashboard-home .nav-button.is-active .figma-icon--sidebar,
.dashboard-home .menu-group.is-open > .nav-button .figma-icon--sidebar {
    color: #FFFFFF;
}

.dashboard .nav-button .chev,
.dashboard:not(.dashboard-home) .nav-button .chev,
.dashboard-home .nav-button .chev {
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
    font-size: 0;
    transform: none;
}

.dashboard .nav-button .figma-icon--chevron,
.dashboard:not(.dashboard-home) .nav-button .figma-icon--chevron,
.dashboard-home .nav-button .figma-icon--chevron {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px;
    color: var(--figma-icon-muted);
    transition: transform .16s ease, color .16s ease;
}

.dashboard .menu-group.is-open .chev,
.dashboard:not(.dashboard-home) .menu-group.is-open .chev,
.dashboard-home .menu-group.is-open .chev {
    transform: none;
}

.dashboard .menu-group.is-open > .nav-button .figma-icon--chevron,
.dashboard:not(.dashboard-home) .menu-group.is-open > .nav-button .figma-icon--chevron,
.dashboard-home .menu-group.is-open > .nav-button .figma-icon--chevron {
    color: #FFFFFF;
    transform: rotate(90deg);
}

.dashboard .cert-mini,
.dashboard:not(.dashboard-home) .cert-mini,
.dashboard-home .cert-mini {
    margin: 0 18px 10px;
    padding: 9px 10px;
    border-color: var(--line-soft);
    border-radius: 12px;
    background: var(--home-inner-bg);
    box-shadow: none;
}

.dashboard .cert-mini .shield,
.dashboard:not(.dashboard-home) .cert-mini .shield,
.dashboard-home .cert-mini .shield {
    color: var(--figma-icon-accent);
    background: var(--home-icon-bg);
}

.dashboard .user-strip,
.dashboard:not(.dashboard-home) .user-strip,
.dashboard-home .user-strip {
    min-height: 54px;
    padding: 10px 18px;
    border-top-color: var(--line);
}

@media (max-width: 1100px) {
    .dashboard .logo-sidebar,
    .dashboard:not(.dashboard-home) .logo-sidebar,
    .dashboard-home .logo-sidebar {
        width: 184px;
        max-height: 44px;
    }
}

@media (max-width: 768px) {
    .dashboard .sidebar,
    .dashboard:not(.dashboard-home) .sidebar,
    .dashboard-home .sidebar {
        padding: 16px;
        border-right: 0;
    }

    .dashboard .logo-sidebar,
    .dashboard:not(.dashboard-home) .logo-sidebar,
    .dashboard-home .logo-sidebar {
        width: 142px;
        max-height: 38px;
    }

    .dashboard .nav-button,
    .dashboard:not(.dashboard-home) .nav-button,
    .dashboard-home .nav-button {
        width: auto;
        min-width: 48px;
        min-height: 44px;
        padding: 0 14px;
        white-space: nowrap;
    }
}
.json-preview {
    min-height: 360px;
    max-height: 560px;
    overflow: auto;
    margin: 0;
    padding: 16px;
    border-radius: 10px;
    border: 1px solid var(--border, #d8dee9);
    background: #071637;
    color: #e8f1ff;
    font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: pre-wrap;
}
@media (max-width: 980px) {
    .ciot-table .contacts-head,
    .ciot-table .contacts-row { grid-template-columns: minmax(180px, 1fr) 92px 86px 42px; }
    .ciot-table .contacts-head span:nth-child(2),
    .ciot-table .contacts-row > span:nth-child(2),
    .ciot-table .contacts-head span:nth-child(3),
    .ciot-table .contacts-row > strong:nth-child(3),
    .ciot-table .contacts-head span:nth-child(6),
    .ciot-table .contacts-row > span:nth-child(6) { display: none; }
    .cte-table .contacts-head,
    .cte-table .contacts-row { grid-template-columns: 82px minmax(150px, 1fr) 96px 48px; }
    .cte-table .contacts-head span:nth-child(1),
    .cte-table .contacts-row > .cte-select-cell,
    .cte-table .contacts-head span:nth-child(3),
    .cte-table .contacts-row > strong:nth-child(3),
    .cte-table .contacts-head span:nth-child(4),
    .cte-table .contacts-row > span:nth-child(4),
    .cte-table .contacts-head span:nth-child(6),
    .cte-table .contacts-row > span:nth-child(6),
    .cte-table .contacts-head span:nth-child(7),
    .cte-table .contacts-row > strong:nth-child(7),
    .cte-table .contacts-head span:nth-child(9),
    .cte-table .contacts-row > .cte-insurance-icon { display: none; }
    .mdfe-table .contacts-head,
    .mdfe-table .contacts-row { grid-template-columns: 38px 82px 70px minmax(92px, 1fr) 96px 48px; }
    .mdfe-table .contacts-head span:nth-child(4),
    .mdfe-table .contacts-row > span:nth-child(4),
    .mdfe-table .contacts-head span:nth-child(6),
    .mdfe-table .contacts-row > strong:nth-child(6),
    .mdfe-table .contacts-head span:nth-child(7),
    .mdfe-table .contacts-row > span:nth-child(7),
    .mdfe-table .contacts-head span:nth-child(8),
    .mdfe-table .contacts-row > span:nth-child(8),
    .mdfe-table .contacts-head span:nth-child(10),
    .mdfe-table .contacts-row > .mdfe-insurance-icon { display: none; }
    .trips-table .contacts-head,
    .trips-table .contacts-row { grid-template-columns: minmax(180px, 1fr) minmax(170px, 1fr) 96px 126px 64px; }
    .trips-table .contacts-head span:nth-child(3),
    .trips-table .contacts-row > div:nth-child(3),
    .trips-table .contacts-head span:nth-child(4),
    .trips-table .contacts-row > span:nth-child(4),
    .trips-table .contacts-head span:nth-child(5),
    .trips-table .contacts-row > strong:nth-child(5) { display: none; }
    .drivers-table .contacts-head,
    .drivers-table .contacts-row { grid-template-columns: minmax(180px, 1fr) minmax(150px, 1fr) 96px 86px; }
    .drivers-table .contacts-head span:nth-child(6),
    .drivers-table .contacts-row > .efrete-cel { display: none; }
    .drivers-table .contacts-head span:nth-child(2),
    .drivers-table .contacts-row > div:nth-child(2),
    .drivers-table .contacts-head span:nth-child(4),
    .drivers-table .contacts-row > span:nth-child(4) { display: none; }
    .vehicles-table .contacts-head,
    .vehicles-table .contacts-row { grid-template-columns: minmax(180px, 1fr) minmax(130px, .75fr) 110px 86px; }
    .vehicles-table .contacts-head span:nth-child(3),
    .vehicles-table .contacts-row > span:nth-child(3),
    .vehicles-table .contacts-head span:nth-child(4),
    .vehicles-table .contacts-row > div:nth-child(4),
    .vehicles-table .contacts-head span:nth-child(6),
    .vehicles-table .contacts-row > .efrete-cel { display: none; }
    .routes-table .contacts-head,
    .routes-table .contacts-row { grid-template-columns: minmax(180px, 1fr) minmax(170px, 1fr) 96px 86px; }
    .routes-table .contacts-head span:nth-child(3),
    .routes-table .contacts-row > span:nth-child(3),
    .routes-table .contacts-head span:nth-child(4),
    .routes-table .contacts-row > div:nth-child(4) { display: none; }
    .ciot-preview-layout { grid-template-columns: 1fr; }
}
.ciot-json-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(7, 22, 55, .58);
}

.vpo-trips-table .contacts-head,
.vpo-trips-table .contacts-row {
    grid-template-columns: minmax(150px, 1fr) minmax(165px, 1fr) minmax(140px, .75fr) minmax(190px, 1.1fr) minmax(112px, .55fr) 64px;
}

.vpo-trips-table .contacts-row > strong:nth-child(4) {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.25;
    font-size: 12px;
}

.vpo-trips-table .contacts-row > .status-pill {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
}

.vpo-modal .payments-modal-card {
    width: min(940px, 96vw);
    max-height: 92vh;
    overflow: auto;
}

.vpo-result {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
    padding: 14px;
    border: 1px solid rgba(100, 116, 139, .22);
    border-radius: 8px;
    background: rgba(248, 250, 252, .72);
}

.vpo-result h3 {
    margin: 0;
    font-size: 16px;
}

.vpo-result p {
    margin: 0;
    color: #647084;
}

.vpo-result details {
    border-top: 1px solid rgba(100, 116, 139, .22);
    padding-top: 10px;
}

.vpo-result pre {
    max-height: 260px;
    overflow: auto;
    margin: 10px 0 0;
    padding: 12px;
    border-radius: 8px;
    background: #111827;
    color: #e5e7eb;
    font-size: 12px;
}

.vpo-mini-table {
    display: grid;
    gap: 6px;
    overflow-x: auto;
}

.vpo-mini-table > div {
    display: grid;
    grid-template-columns: 120px minmax(180px, 1fr) 110px 90px 100px 100px;
    gap: 10px;
    min-width: 700px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(100, 116, 139, .16);
    font-size: 13px;
}

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

.vpo-summary-grid span {
    display: grid;
    gap: 4px;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid rgba(100, 116, 139, .18);
}

.vpo-summary-grid small {
    color: #647084;
    font-size: 12px;
}

.vpo-summary-grid strong {
    overflow-wrap: anywhere;
}

@media (max-width: 980px) {
    .vpo-trips-table .contacts-head,
    .vpo-trips-table .contacts-row {
        grid-template-columns: minmax(190px, 1fr) minmax(160px, 1fr) 104px 64px;
    }
    .vpo-trips-table .contacts-head span:nth-child(3),
    .vpo-trips-table .contacts-row > div:nth-child(3),
    .vpo-trips-table .contacts-head span:nth-child(4),
    .vpo-trips-table .contacts-row > strong:nth-child(4) {
        display: none;
    }
    .vpo-summary-grid {
        grid-template-columns: 1fr 1fr;
    }
}
.ciot-json-modal.is-open { display: flex; }
.ciot-json-dialog {
    width: min(1040px, 94vw);
    max-height: 90vh;
    display: grid;
    grid-template-rows: auto minmax(260px, 1fr) auto;
    gap: 14px;
    padding: 20px;
    border-radius: 14px;
    background: var(--surface, #fff);
    box-shadow: 0 24px 80px rgba(7, 22, 55, .28);
}
.ciot-json-header,
.ciot-json-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.ciot-json-header h2,
.ciot-json-header p { margin: 0; }
.ciot-json-modal-preview {
    max-height: 62vh;
    min-height: 320px;
}
.ciot-json-footer form { margin: 0; }
.ciot-cancel-dialog,
.ciot-pix-dialog {
    width: min(680px, 94vw);
    grid-template-rows: auto auto auto;
}
.ciot-cancel-form,
.ciot-pix-body {
    display: grid;
    gap: 14px;
}
.ciot-pix-body {
    justify-items: center;
}
.ciot-pix-qr {
    width: min(240px, 68vw);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    object-fit: contain;
    padding: 10px;
    border: 1px solid var(--border, #d8dee9);
    border-radius: 8px;
    background: #fff;
    color: var(--muted, #64748b);
    font-weight: 800;
    text-align: center;
}
.ciot-pix-qr canvas,
.ciot-pix-qr img,
.ciot-pix-qr svg {
    width: 220px !important;
    height: 220px !important;
    max-width: 100%;
    max-height: 100%;
}
.ciot-pix-info {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.ciot-pix-info span {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--border, #d8dee9);
    border-radius: 8px;
    background: var(--muted-surface, #f7f9fc);
}
.ciot-pix-info small {
    color: var(--muted, #64748b);
    font-weight: 700;
}
.danger-action {
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 0 16px;
    color: #fff;
    background: #b42318;
    font-weight: 800;
    cursor: pointer;
}
.danger-action:hover { background: #912018; }
.status-cancelado,
.status-pix-cancelado {
    background: #fee4e2;
    color: #b42318;
    border-color: #fda29b;
}
.status-pix-nao_gerado {
    background: #f2f4f7;
    color: #667085;
    border-color: #d0d5dd;
}
.status-pix-pendente {
    background: #fff6db;
    color: #92400e;
    border-color: #facc15;
}
.status-pix-pago {
    background: #dcfae6;
    color: #067647;
    border-color: #75e0a7;
}
.status-pix-erro {
    background: #fee4e2;
    color: #b42318;
    border-color: #fda29b;
}
.ciot-pix-copy-link {
    border: 0;
    background: transparent;
    color: var(--primary, #416a9d);
    font-weight: 800;
    text-decoration: underline;
    cursor: pointer;
}
.ciot-pix-copy-link:hover {
    color: #264f83;
}
@media (max-width: 720px) {
    .ciot-json-dialog { width: 96vw; padding: 14px; }
    .ciot-json-header,
    .ciot-json-footer { align-items: stretch; flex-direction: column; }
    .ciot-pix-info { grid-template-columns: 1fr; }
}

.ciot-table .contacts-head,
.ciot-table .contacts-row {
    display: grid !important;
    grid-template-columns: minmax(138px, 1.35fr) minmax(54px, .45fr) minmax(92px, .7fr) minmax(72px, .55fr) minmax(66px, .48fr) minmax(84px, .62fr) 38px !important;
    gap: 8px !important;
    padding-left: 16px;
    padding-right: 14px;
}
.ciot-table .contacts-head {
    min-height: 46px;
    font-size: 11px;
}
.ciot-table .contacts-row {
    min-height: 76px;
}
.ciot-table .contacts-row > div:first-child strong,
.ciot-table .contacts-row > div:first-child small,
.ciot-table .contacts-row > span,
.ciot-table .contacts-row > strong {
    overflow: hidden;
    text-overflow: ellipsis;
}
.ciot-table .contacts-row > span,
.ciot-table .contacts-row > strong {
    white-space: nowrap;
}
.ciot-table .contacts-head span:last-child,
.ciot-table .contacts-row .action-cell {
    justify-self: center;
}

/* Importação Bubble */
.bubble-import-page .page-top {
    align-items: flex-start;
}

.bubble-import-card {
    display: grid;
    gap: 22px;
    padding: 24px;
}

.bubble-import-section {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.bubble-download-form,
.bubble-upload-form,
.bubble-import-actions {
    display: grid;
    gap: 12px;
    align-items: end;
}

.bubble-download-form {
    grid-template-columns: minmax(260px, 1fr) auto;
}

.bubble-upload-form {
    grid-template-columns: minmax(240px, 420px) auto;
    align-items: end;
}

.bubble-download-form label,
.bubble-upload-form label,
.bubble-import-actions label {
    min-width: 0;
    margin: 0;
}

.bubble-download-form input,
.bubble-upload-form input,
.bubble-import-actions select {
    width: 100%;
}

.bubble-import-card .stats-grid {
    margin: 0;
}

.bubble-import-card .stat-card {
    min-height: 128px;
    overflow: hidden;
}

.bubble-import-card .stat-card span {
    overflow-wrap: anywhere;
}

.bubble-import-actions {
    grid-template-columns: minmax(190px, 240px) auto auto auto;
    justify-content: end;
    border-top: 2px solid var(--accent, #426aa1);
    padding-top: 18px;
}

.import-inline-alert,
.page-alert.is-info.import-inline-alert {
    position: static;
    max-width: none;
    padding: 12px 14px;
    border-color: rgba(66, 106, 161, .28);
    color: var(--muted-strong, #64748b);
    background: var(--surface-muted, #f3f6fb);
    box-shadow: none;
    animation: none;
    backdrop-filter: none;
    display: block;
    width: auto;
    border-left-width: 1px;
}

@media (max-width: 1020px) {
    .bubble-download-form,
    .bubble-upload-form,
    .bubble-import-actions {
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .bubble-download-form .primary-action,
    .bubble-upload-form .secondary-action,
    .bubble-import-actions .primary-action,
    .bubble-import-actions .secondary-action {
        width: 100%;
    }
}

/* Carregamento (overlay data-app-loading): cartao compacto e translucido, no estilo dos HUDs
   do macOS/iOS. A logo e a mesma (simbolo do tema atual) e pulsa de leve; um anel fino gira em
   volta dela. Entra com fade, leve subida e escala; sai mais rapido so com fade e escala. As
   animacoes ficam pausadas com o overlay fechado. Quando abre/fecha continua com o app.js. */
.app-loading-overlay {
    --alc-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --alc-acento: var(--brand-strong, #34a5ff);
    --alc-scrim: rgba(2, 6, 23, .34);
    --alc-cartao: color-mix(in srgb, var(--panel, #07101f) 78%, transparent);
    --alc-borda: rgba(255, 255, 255, .08);
    --alc-trilho: rgba(148, 163, 184, .16);
    --alc-placa: color-mix(in srgb, var(--panel-soft, #111c30) 70%, transparent);
    --alc-sombra:
        inset 0 1px 0 rgba(255, 255, 255, .05),
        0 1px 2px rgba(2, 6, 23, .24),
        0 24px 64px -16px rgba(2, 6, 23, .55);
    position: fixed;
    inset: 0;
    z-index: 999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--alc-scrim);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    -webkit-backdrop-filter: blur(6px) saturate(140%);
    backdrop-filter: blur(6px) saturate(140%);
    transition: opacity 240ms ease-out, visibility 0s linear 240ms;
}

:root[data-theme="light"] .app-loading-overlay {
    --alc-scrim: rgba(15, 23, 42, .16);
    --alc-cartao: color-mix(in srgb, var(--panel, #ffffff) 80%, transparent);
    --alc-borda: rgba(15, 23, 42, .07);
    --alc-trilho: rgba(15, 23, 42, .08);
    --alc-placa: color-mix(in srgb, var(--panel-soft, #eef1f6) 75%, transparent);
    --alc-sombra:
        inset 0 1px 0 rgba(255, 255, 255, .7),
        0 1px 2px rgba(15, 23, 42, .06),
        0 24px 60px -18px rgba(15, 23, 42, .28);
}

.app-loading-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 300ms var(--alc-ease), visibility 0s;
}

.app-loading-card {
    width: min(300px, calc(100vw - 48px));
    position: relative;
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 30px 28px 26px;
    border: 1px solid var(--alc-borda);
    border-radius: 22px;
    color: var(--text-strong);
    background: var(--alc-cartao);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    backdrop-filter: blur(28px) saturate(180%);
    box-shadow: var(--alc-sombra);
    opacity: 0;
    transform: translate3d(0, 6px, 0) scale(.97);
    transition: opacity 200ms ease-out, transform 240ms var(--alc-ease);
}

.app-loading-overlay.is-open .app-loading-card {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    transition: opacity 280ms var(--alc-ease), transform 340ms var(--alc-ease);
}

/* Anel de carregamento em volta da logo (substitui a orbita com pontos) */
.app-loading-orbit {
    position: absolute;
    top: 21px;
    left: 50%;
    width: 94px;
    height: 94px;
    margin-left: -47px;
    border-radius: 50%;
    box-shadow: inset 0 0 0 2px var(--alc-trilho);
    pointer-events: none;
}

.app-loading-orbit::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0 62%, color-mix(in srgb, var(--alc-acento) 35%, transparent) 80%, var(--alc-acento) 100%);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
    animation: appLoadingGiro 1.25s linear infinite;
}

.app-loading-orbit span { display: none; }

.app-loading-emblem {
    width: 76px;
    height: 76px;
    position: relative;
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    border-radius: 50%;
    background: var(--alc-placa);
}

/* A logo de sempre, so a versao do tema atual, com uma pulsacao sutil */
.app-loading-logo {
    position: absolute;
    width: 50px;
    height: 50px;
    object-fit: contain;
    animation: appLoadingPulso 2.4s ease-in-out infinite alternate;
}

.app-loading-logo-light { display: none; }
:root[data-theme="light"] .app-loading-logo-dark { display: none; }
:root[data-theme="light"] .app-loading-logo-light { display: block; }

.app-loading-overlay:not(.is-open) .app-loading-orbit::before,
.app-loading-overlay:not(.is-open) .app-loading-logo {
    animation-play-state: paused;
}

.sr-only {
    width: 1px;
    height: 1px;
    position: absolute;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.app-loading-card strong {
    position: relative;
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -.01em;
    line-height: 1.3;
    text-align: center;
}

.app-loading-card p {
    position: relative;
    max-width: 240px;
    margin: 0;
    color: var(--muted);
    font-family: "Inter", Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
    text-align: center;
}

/* O anel em volta da logo ja indica o carregamento */
.app-loading-progress { display: none; }

@keyframes appLoadingGiro {
    to { transform: rotate(360deg); }
}

@keyframes appLoadingPulso {
    from { opacity: .86; transform: scale(.965); }
    to { opacity: 1; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .app-loading-overlay,
    .app-loading-overlay.is-open,
    .app-loading-card,
    .app-loading-overlay.is-open .app-loading-card {
        transform: none;
        transition-duration: 1ms;
        transition-delay: 0s;
    }

    .app-loading-logo { animation: none; }
    .app-loading-orbit::before { animation-duration: 2.4s; }
}

.mdfe-doc-source-panel {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) auto;
    gap: 14px;
    align-items: end;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
}

.mdfe-xml-uploader {
    margin: 0;
}

.mdfe-doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.mdfe-uploaded-xml-list {
    grid-column: 1 / -1;
    display: grid;
    gap: 8px;
}

.mdfe-uploaded-xml-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(220px, 320px);
    gap: 10px;
    align-items: center;
    margin: 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.mdfe-uploaded-xml-row span {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.mdfe-uploaded-xml-row input {
    width: 100%;
}

.mdfe-doc-summary {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mdfe-doc-summary span,
.mdfe-doc-chips span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 30px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font-size: 12px;
    font-weight: 800;
}

.mdfe-doc-chips {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
}

.mdfe-doc-chips small {
    color: var(--muted);
    font-weight: 750;
}

.mdfe-doc-modal {
    display: none;
}

.mdfe-doc-modal.is-open {
    display: flex;
}

.mdfe-doc-modal-card {
    width: min(920px, calc(100vw - 32px));
    max-height: min(760px, calc(100vh - 40px));
}

.mdfe-doc-modal-list {
    display: grid;
    gap: 8px;
    max-height: min(480px, 54vh);
    overflow: auto;
    padding: 2px 2px 8px;
}

.mdfe-doc-option {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    margin: 0;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    cursor: pointer;
}

.mdfe-doc-option:hover {
    border-color: rgba(66, 133, 244, .42);
    background: var(--panel-strong);
}

.mdfe-doc-option input {
    width: 16px;
    height: 16px;
    margin-top: 2px;
}

.mdfe-doc-option span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.mdfe-doc-option strong {
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 900;
}

.mdfe-doc-option small {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.mdfe-doc-option.is-disabled {
    opacity: .58;
    cursor: not-allowed;
}

@media (max-width: 760px) {
    .mdfe-doc-source-panel {
        grid-template-columns: 1fr;
    }

    .mdfe-doc-actions {
        justify-content: stretch;
    }

    .mdfe-doc-actions .secondary-action {
        width: 100%;
    }

    .mdfe-uploaded-xml-row {
        grid-template-columns: 1fr;
    }
}

.mdfe-pick-option {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    text-align: left;
    font: inherit;
}

.mdfe-pick-option:focus-visible {
    outline: 3px solid rgba(52, 165, 255, .28);
    outline-offset: 2px;
}

.mdfe-fiscal-actions {
    justify-content: flex-start;
}

.money-input {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.logs-dashboard {
    position: relative;
    display: block;
    min-height: 100svh;
    overflow: hidden;
}

.logs-dashboard .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 920;
    width: min(294px, 88vw);
    height: 100svh;
    transform: translateX(-104%);
    transition: transform .22s ease;
    box-shadow: 18px 0 42px rgba(15, 23, 42, .22);
}

.logs-dashboard.is-menu-open .sidebar {
    transform: translateX(0);
}

.logs-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    display: block;
    border: 0;
    background: rgba(15, 23, 42, .42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}

.logs-dashboard.is-menu-open .logs-menu-backdrop {
    opacity: 1;
    pointer-events: auto;
}

body.logs-menu-open {
    overflow: hidden;
}

.logs-main {
    width: 100%;
    min-width: 0;
    min-height: 100svh;
    padding: 18px 22px;
}

.logs-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
}

.logs-title {
    flex: 1 1 auto;
    min-width: 0;
}

.logs-topbar h1 {
    margin: 0;
    color: var(--text-strong);
    font-size: 25px;
    line-height: 1.1;
}

.logs-topbar p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.logs-topbar-actions {
    flex: 0 1 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    min-width: 0;
}

.logs-retention-status {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.logs-retention-status.is-active {
    border-color: color-mix(in srgb, var(--success) 36%, var(--line));
    background: color-mix(in srgb, var(--success) 10%, var(--panel));
    color: var(--success);
}

.logs-menu-button {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    color: var(--brand);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .08);
    cursor: pointer;
}

.logs-menu-button:hover {
    border-color: rgba(65, 106, 157, .38);
    background: var(--panel-strong);
}

.logs-menu-button svg {
    width: 22px;
    height: 22px;
}

.logs-filters {
    display: grid;
    grid-template-columns: 190px 190px auto auto auto;
    align-items: end;
    gap: 10px;
    margin: 0;
}

.logs-filters label {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.logs-filters span {
    color: var(--text-strong);
    font-size: 11px;
    font-weight: 900;
}

.logs-filters input,
.logs-filters select {
    width: 100%;
    min-width: 0;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--input);
    color: var(--text);
    padding: 0 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}

.logs-filters .primary-action,
.logs-filters .secondary-action {
    height: 42px;
    min-height: 42px;
    padding: 0 16px;
}

.logs-advanced-filters {
    grid-column: auto;
    min-width: 0;
    position: relative;
    align-self: end;
    height: 42px;
}

.logs-advanced-filters summary {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--brand);
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    list-style: none;
}

.logs-advanced-filters summary::-webkit-details-marker {
    display: none;
}

.logs-advanced-filters summary::after {
    content: "";
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform .18s ease;
}

.logs-advanced-filters[open] summary::after {
    transform: translateY(2px) rotate(225deg);
}

.logs-advanced-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 45;
    width: min(1320px, calc(100vw - 28px));
    max-height: min(560px, calc(100svh - 118px));
    overflow-x: hidden;
    overflow-y: auto;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 22px 48px rgba(15, 23, 42, .18);
}

.logs-advanced-retention {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 10px;
}

.logs-advanced-grid {
    display: grid;
    grid-template-columns: minmax(190px, 1fr) minmax(250px, 1.15fr) minmax(360px, 1.45fr) minmax(180px, .8fr) minmax(220px, .95fr);
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel-soft);
}

.logs-event-filters {
    display: grid;
    grid-template-columns: repeat(6, minmax(175px, 1fr));
    gap: 6px 16px;
    margin: 8px 0 0;
    padding: 10px 12px;
    border: 0;
    border-radius: 10px;
    background: var(--panel);
}

.logs-event-filters label {
    min-height: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px;
    align-items: center;
    gap: 8px;
}

.logs-event-filters span {
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.logs-event-filters input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin: 0;
    padding: 0;
    accent-color: var(--brand);
}

.logs-card {
    height: calc(100svh - 120px);
    max-height: none;
}

.logs-table {
    min-width: 1180px;
}

.logs-table .contacts-head,
.logs-table .contacts-row {
    grid-template-columns: 136px minmax(170px, 1.05fr) minmax(180px, 1.1fr) 150px minmax(260px, 1.45fr) 180px 92px;
    gap: 12px;
}

.bubble-logs-table {
    min-width: 1040px;
}

.bubble-logs-table .contacts-head,
.bubble-logs-table .contacts-row {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 0;
    padding: 0;
}

.bubble-logs-table .contacts-head {
    min-height: 34px;
}

.bubble-logs-table .contacts-head span {
    min-height: 34px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    border-right: 1px solid var(--line);
}

.bubble-logs-table .contacts-head span:last-child {
    border-right: 0;
}

.logs-table .contacts-scroll {
    max-height: none;
    overflow-x: auto;
}

.log-row {
    min-height: 68px;
}

.bubble-log-row {
    align-items: stretch;
    min-height: 138px;
    border-bottom: 1px solid var(--line);
}

.bubble-log-row > div {
    min-width: 0;
    padding: 9px 12px;
    border-right: 1px solid var(--line);
}

.bubble-log-row > div:last-child {
    border-right: 0;
}

.bubble-log-identity {
    display: grid;
    align-content: start;
    gap: 6px;
}

.bubble-log-identity strong {
    white-space: normal;
    line-height: 1.25;
}

.bubble-log-identity span {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.bubble-log-message {
    display: grid;
    align-content: start;
    gap: 7px;
}

.bubble-log-message-head {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.bubble-log-message-head strong {
    font-size: 13px;
    white-space: normal;
}

.bubble-log-message p {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.bubble-log-message p b {
    color: var(--text-strong);
    font-weight: 900;
}

.bubble-log-message pre {
    max-height: none;
    margin: 0;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: var(--text);
    font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.bubble-log-collapsible {
    margin-top: 5px;
}

.bubble-log-collapsible summary {
    width: fit-content;
    cursor: pointer;
    color: var(--brand);
    font-size: 12px;
    font-weight: 900;
    list-style: none;
}

.bubble-log-collapsible summary::-webkit-details-marker {
    display: none;
}

.bubble-log-collapsible summary::before {
    content: "+";
    display: inline-block;
    margin-right: 6px;
    color: var(--muted);
    font-weight: 950;
}

.bubble-log-collapsible[open] summary::before {
    content: "-";
}

.bubble-log-collapsible pre {
    margin-top: 7px;
    padding: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel-soft);
}

.bubble-log-section,
.bubble-log-group {
    display: grid;
    gap: 5px;
    margin-top: 4px;
}

.bubble-log-section > strong,
.bubble-log-group > strong {
    color: var(--text-strong);
    font-size: 12px;
    font-weight: 900;
}

.bubble-log-fields {
    display: grid;
    gap: 3px 18px;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.bubble-log-fields p,
.bubble-log-group-item p {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.bubble-log-group {
    margin-top: 10px;
}

.bubble-log-group-item {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 3px 16px;
    padding: 8px 10px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: color-mix(in srgb, var(--panel-strong) 54%, transparent);
}

.bubble-log-group-item em {
    grid-column: 1 / -1;
    color: var(--brand);
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.log-row strong,
.log-row small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.log-row strong {
    display: block;
    color: var(--text-strong);
    font-size: 13px;
    font-weight: 900;
    white-space: nowrap;
}

.log-row small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.bubble-log-row strong,
.bubble-log-row small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.bubble-log-row .bubble-log-identity span,
.bubble-log-row .bubble-log-message p {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
}

.log-type {
    width: fit-content;
    min-width: 74px;
    margin-bottom: 5px;
    justify-content: center;
}

.log-type-acao {
    color: #805700;
    border-color: rgba(245, 158, 11, .42);
    background: rgba(245, 158, 11, .13);
}

.log-type-seguranca {
    color: #8b1f1f;
    border-color: rgba(239, 68, 68, .42);
    background: rgba(239, 68, 68, .12);
}

.log-type-erro {
    color: #7f1d1d;
    border-color: rgba(220, 38, 38, .5);
    background: rgba(254, 226, 226, .85);
}

.log-details {
    position: relative;
}

.log-details summary {
    width: 52px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-strong);
    color: var(--brand);
    cursor: pointer;
    font-size: 12px;
    font-weight: 900;
    list-style: none;
}

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

.log-details pre {
    position: absolute;
    right: 0;
    z-index: 20;
    width: min(560px, 80vw);
    max-height: 340px;
    margin: 8px 0 0;
    padding: 14px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel);
    box-shadow: 0 18px 38px rgba(15, 23, 42, .18);
    color: var(--text);
    font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    white-space: pre-wrap;
}

.logs-access-denied {
    height: min(calc(100svh - 170px), 420px);
}

.logs-retention-open {
    min-height: 40px;
    border-radius: 8px;
    font-weight: 900;
}

.logs-retention-card {
    width: min(740px, calc(100vw - 28px));
    max-height: none;
    overflow: visible;
    padding: 22px;
}

.logs-retention-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin: 14px 0;
}

.logs-retention-grid article,
.logs-retention-rules,
.logs-retention-last,
.logs-retention-note {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
}

.logs-retention-grid article {
    padding: 10px 12px;
}

.logs-retention-grid span,
.logs-retention-rules span,
.logs-retention-last span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.logs-retention-grid strong {
    display: block;
    margin-top: 5px;
    color: var(--text);
    font-size: 15px;
    line-height: 1.15;
}

.logs-retention-grid strong.is-success {
    color: var(--success);
}

.logs-retention-grid strong.is-muted {
    color: var(--muted);
}

.logs-retention-rules {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
}

.logs-retention-rules div,
.logs-retention-last,
.logs-retention-note {
    padding: 10px 12px;
}

.logs-retention-rules b,
.logs-retention-last strong,
.logs-retention-note strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
}

.logs-retention-last {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin-top: 10px;
}

.logs-retention-last strong {
    flex: 1 0 100%;
}

.logs-retention-note {
    margin-top: 10px;
}

.logs-retention-note code {
    display: block;
    margin-top: 6px;
    padding: 9px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere;
}

.logs-retention-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.logs-retention-actions form {
    margin: 0;
    min-width: 0;
}

.logs-retention-action-button {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 0 16px;
    background: var(--panel);
    color: var(--text-strong);
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 10px 22px rgba(15, 23, 42, .07);
    transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.logs-retention-action-button:hover {
    transform: translateY(-1px);
    border-color: rgba(65, 106, 157, .32);
    box-shadow: 0 14px 26px rgba(15, 23, 42, .1);
}

.logs-retention-action-button.is-primary {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.logs-retention-action-button.is-toggle {
    border-color: rgba(65, 106, 157, .25);
    background: color-mix(in srgb, var(--brand) 9%, var(--panel));
    color: var(--brand);
}

.logs-retention-action-button.is-close {
    background: var(--panel-soft);
}

.logs-flash {
    margin-bottom: 12px;
}

@media (max-width: 1180px) {
    .logs-topbar {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .logs-topbar-actions {
        width: 100%;
        justify-content: flex-start;
        margin-left: 60px;
    }

    .logs-filters {
        grid-template-columns: 190px 190px auto auto minmax(0, 1fr);
    }

    .logs-advanced-grid {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }

    .logs-event-filters {
        grid-template-columns: repeat(3, minmax(220px, 1fr));
    }

    .bubble-log-fields,
    .bubble-log-group-item {
        grid-template-columns: repeat(2, minmax(180px, 1fr));
    }
}

@media (max-width: 760px) {
    .logs-main {
        padding: 14px 12px;
    }

    .logs-topbar h1 {
        font-size: 23px;
    }

    .logs-topbar p {
        white-space: normal;
    }

    .logs-topbar {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .logs-topbar-actions {
        width: 100%;
        justify-content: space-between;
        margin-left: 0;
    }

    .logs-retention-open {
        width: auto;
        margin-left: 0;
    }

    .logs-filters {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .logs-advanced-filters {
        height: auto;
    }

    .logs-advanced-filters summary {
        width: 100%;
        justify-content: center;
    }

    .logs-advanced-panel {
        position: static;
        width: 100%;
        max-height: none;
        margin-top: 8px;
    }

    .logs-advanced-retention {
        align-items: stretch;
        flex-direction: column;
    }

    .logs-advanced-grid {
        grid-template-columns: 1fr;
    }

    .logs-event-filters {
        grid-template-columns: 1fr;
    }

    .bubble-log-fields,
    .bubble-log-group-item {
        grid-template-columns: 1fr;
    }

    .logs-card {
        height: calc(100svh - 338px);
        min-height: 420px;
    }

    .logs-retention-grid,
    .logs-retention-rules {
        grid-template-columns: 1fr;
    }

    .logs-retention-card {
        padding: 16px;
    }

    .logs-retention-actions,
    .logs-retention-actions form,
    .logs-retention-actions button {
        width: 100%;
    }
}


.database-backup-summary code,
.database-backup-list code {
    font-size: 11px;
    word-break: break-all;
}

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

.database-action-card {
    display: grid;
    align-content: start;
    gap: 12px;
    min-height: 260px;
    padding: 16px;
    border: 1px solid #dfe5ed;
    border-radius: 8px;
    background: #fbfcfe;
}

.database-action-card h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-strong);
}

.database-action-card p {
    margin: 0;
    color: var(--muted-strong);
    font-size: 13px;
    line-height: 1.45;
}

.database-action-card label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 800;
    color: var(--muted-strong);
}

.database-action-card input,
.database-action-card select {
    width: 100%;
}

.database-action-card.is-danger {
    border-color: #f2c8c8;
    background: #fffafa;
}

.database-backup-list {
    display: grid;
    gap: 0;
    overflow-x: auto;
    border: 1px solid #dfe5ed;
    border-radius: 8px;
}

.database-backup-row {
    grid-template-columns: minmax(240px, 1.3fr) 150px 90px 150px minmax(320px, 1.3fr);
    min-width: 1000px;
}

@media (max-width: 1100px) {
    .database-actions-grid {
        grid-template-columns: 1fr;
    }
}


.button-like.is-disabled {
    opacity: .55;
    pointer-events: none;
    cursor: not-allowed;
}


.database-action-card code {
    display: block;
    padding: 8px;
    border-radius: 6px;
    background: #eef2f7;
    color: #36465c;
    font-size: 11px;
    white-space: normal;
    word-break: break-word;
}

.extensao-row-nome {
    display: flex;
    align-items: center;
    gap: 10px;
}
.extensao-row-nome .store-card-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
}

.extensions-admin-card {
    min-height: 0;
}

.extensions-admin-table {
    height: 100%;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
}

.extensions-admin-table .contacts-head,
.extensions-admin-table .contacts-row {
    grid-template-columns: minmax(280px, 1.45fr) minmax(150px, .8fr) minmax(110px, .6fr) minmax(120px, .7fr) minmax(120px, .7fr) 72px;
}

.extensions-admin-table .contacts-scroll {
    height: 100%;
    min-height: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: auto;
}

.extensions-admin-table .extensao-row-nome > div {
    min-width: 0;
}

.extensions-admin-table .extensao-row-nome strong,
.extensions-admin-table .extensao-row-nome small {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.extensions-admin-table .extensao-row-nome strong {
    white-space: nowrap;
}

.extensions-admin-table .extensao-row-nome small {
    white-space: normal;
}

/* Mensalidades (admin) */
.mensalidades-table .contacts-head,
.mensalidades-table .contacts-row {
    grid-template-columns: 2fr 1fr .9fr 1.1fr .8fr;
}
.inline-actions {
    display: inline-flex;
    margin-right: 8px;
}
.inline-actions:last-child {
    margin-right: 0;
}

/* Aviso de mensalidade pendente/vencida */
.mensalidade-aviso-banner {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: min(460px, calc(100vw - 32px));
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--app-blue);
    background: var(--panel);
    color: var(--text-strong);
    box-shadow: 0 18px 48px var(--shadow);
}
.mensalidade-aviso-banner[hidden] {
    display: none;
}
.mensalidade-aviso-banner.is-vencida {
    border-color: var(--app-red);
    border-left-color: var(--app-red);
    background: var(--app-red);
    color: #fff;
}
.mensalidade-aviso-texto {
    flex: 1 1 auto;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.4;
}
.mensalidade-aviso-pagar {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: var(--app-blue);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}
.mensalidade-aviso-banner.is-vencida .mensalidade-aviso-pagar {
    background: #fff;
    color: var(--app-red);
}
.mensalidade-aviso-fechar {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.mensalidade-aviso-pill {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text-strong);
    font-size: 12.5px;
    font-weight: 800;
    box-shadow: 0 12px 30px var(--shadow);
    cursor: pointer;
}
.mensalidade-aviso-pill[hidden] {
    display: none;
}
.mensalidade-aviso-pill.is-vencida {
    border-color: var(--app-red);
    background: var(--app-red);
    color: #fff;
}
.mensalidade-aviso-pill-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--app-blue);
    flex: 0 0 auto;
}
.mensalidade-aviso-pill.is-vencida .mensalidade-aviso-pill-dot {
    background: #fff;
}
.mensalidade-modal-card {
    display: grid;
    gap: 16px;
}
.mensalidade-modal-qr {
    width: 132px;
    height: 132px;
    margin: 0 auto;
    border-radius: 8px;
    overflow: hidden;
}

.mensalidade-modal-pix {
    position: relative;
}

.mensalidade-modal-pix.is-vencido .mensalidade-modal-qr,
.mensalidade-modal-pix.is-vencido label {
    filter: blur(4px);
    opacity: .45;
    pointer-events: none;
    user-select: none;
}

.mensalidade-modal-pix-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 12px;
    background: rgba(15, 23, 42, .58);
    border-radius: 8px;
}

.mensalidade-modal-pix-overlay p {
    margin: 0;
    max-width: 280px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

/* Loja de Extensões */
.store-page {
    --store-surface: var(--list-surface, var(--panel));
    --store-surface-soft: var(--list-surface-soft, var(--panel-soft));
    --store-border: var(--list-border, var(--line-soft));
    --store-text: var(--list-text-primary, var(--text-strong));
    --store-muted: var(--list-text-secondary, var(--muted));
    --store-accent: #3B608F;
}

.store-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 12px;
}
.store-search-row .search-input {
    width: clamp(280px, 32vw, 440px);
    max-width: 100%;
    border-color: var(--store-border);
    border-radius: 8px;
    color: var(--store-muted);
    background: var(--store-surface);
    box-shadow: none;
}
.store-search-row .search-input input {
    color: var(--store-text);
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
}
.store-search-row .search-input input::placeholder {
    color: var(--store-muted);
}
.store-category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}
.store-chip {
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    border-radius: 8px;
    border: 1px solid var(--store-border);
    background: var(--store-surface);
    color: var(--store-muted);
    font-family: "Inter";
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-decoration: none;
    white-space: nowrap;
}
.store-chip:hover,
.store-chip:focus-visible {
    border-color: color-mix(in srgb, var(--store-accent) 42%, var(--store-border));
    background: var(--store-surface-soft);
    color: var(--store-text);
    outline: 0;
    text-decoration: none;
}
.store-chip.is-active {
    background: var(--store-accent);
    border-color: var(--store-accent);
    color: #fff;
}
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 16px;
}
.store-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 258px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--store-border);
    background: var(--store-surface);
    box-shadow: none;
}
.store-card-icon {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid color-mix(in srgb, var(--store-accent) 18%, var(--store-border));
    background: color-mix(in srgb, var(--store-accent) 12%, var(--store-surface));
    color: var(--store-accent);
    overflow: hidden;
}
.store-card-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.store-card-icon svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}
.store-card-name {
    color: var(--store-text);
    font-family: "Inter";
    font-size: 15px;
    font-weight: 600;
    line-height: 1.28;
    letter-spacing: 0;
}
.store-card-desc {
    color: var(--store-muted);
    font-family: "Poppins";
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.4;
    flex: 1;
}
.store-card-footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: 4px;
}
.store-card-price {
    color: var(--store-text);
    font-family: "Inter";
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
}
.store-card-footer form {
    margin: 0;
    display: block;
}
.store-card-footer .primary-action,
.store-card-footer .secondary-action {
    width: 100%;
    min-height: 40px;
    justify-content: center;
    box-sizing: border-box;
    border-radius: 8px;
    padding: 0 12px;
    font-family: "Inter";
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.store-card-footer .primary-action {
    border-color: var(--store-accent);
    color: #fff;
    background: var(--store-accent);
    box-shadow: 0 10px 22px rgba(59, 96, 143, .18);
}
.store-card-footer .primary-action:hover,
.store-card-footer .primary-action:focus-visible {
    border-color: #34567f;
    background: #34567f;
    outline: 0;
}
.store-card-footer .secondary-action {
    border-color: var(--store-border);
    color: var(--store-text);
    background: var(--store-surface-soft);
}
.store-card-footer .secondary-action:hover,
.store-card-footer .secondary-action:focus-visible {
    border-color: color-mix(in srgb, var(--store-accent) 42%, var(--store-border));
    background: color-mix(in srgb, var(--store-surface-soft) 86%, var(--store-accent) 14%);
    color: var(--store-text);
    outline: 0;
}
.store-card-status {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    color: var(--store-muted);
    font-family: "Inter";
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
}
.store-card-status.is-danger {
    color: #ef4444;
}

/* Minha Conta */
.conta-hero-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 24px;
    margin-bottom: 18px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--app-blue), var(--brand, #1e3f6b));
    color: #fff;
    box-shadow: 0 18px 48px var(--shadow);
}
.conta-hero-card.is-empty {
    background: var(--panel);
    color: var(--text-strong);
    border: 1px dashed var(--line);
    box-shadow: none;
}
.conta-hero-icon {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .18);
    overflow: hidden;
}
.conta-hero-card.is-empty .conta-hero-icon {
    background: var(--panel-soft);
    color: var(--muted);
}
.conta-hero-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.conta-hero-icon svg {
    width: 32px;
    height: 32px;
}
.conta-hero-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.conta-hero-tag {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .06em;
    opacity: .8;
}
.conta-hero-name {
    font-size: 22px;
    font-weight: 900;
}
.conta-hero-detail {
    font-size: 13px;
    font-weight: 700;
    opacity: .9;
}
.conta-summary-card {
    border: 1px solid var(--line);
    background: var(--panel-soft);
    color: var(--muted);
}
.conta-summary-card strong {
    color: var(--text-strong);
}

/* Perfil de Cores: usa .dash-main puro (sem .form-page-main/.integrations-main,
   que são sempre-claro e cortam o scroll) para herdar o scroll normal de
   página e o tema dark/light igual às demais telas administrativas. */
.perfil-cores-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}
.perfil-cores-tab {
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.perfil-cores-tab.is-active {
    border-color: var(--brand);
    background: var(--panel-soft);
    color: var(--text-strong);
}
.perfil-cores-sugestoes {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.perfil-cores-sugestoes span {
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 800;
}
.perfil-cores-sugestoes .secondary-action {
    height: 32px;
    min-width: 0;
    padding: 0 12px;
    font-size: 12px;
}
.perfil-cores-campo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel-soft);
    color: var(--text-strong);
    font-size: 12.5px;
    font-weight: 700;
}
.perfil-cores-campo input[type="color"] {
    width: 40px;
    height: 32px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    cursor: pointer;
}
.perfil-cores-campo input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}
.perfil-cores-campo input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}
.perfil-cores-campo input[type="color"]::-moz-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Listagens: primeira coluna mais compacta, com quebra natural apenas quando necessario. */
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > div:first-child:not(.action-cell),
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > strong:first-child,
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > span:first-child {
    min-width: 0;
    overflow: hidden;
    overflow-wrap: break-word;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > div:first-child:not(.action-cell) strong,
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > strong:first-child,
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > span:first-child {
    max-width: 100%;
    color: var(--list-text-primary);
    font-size: 14px;
    line-height: 1.28;
    white-space: normal;
    overflow-wrap: break-word;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-row > div:first-child:not(.action-cell) small {
    max-width: 100%;
    font-size: 11px;
    line-height: 1.25;
    white-space: normal;
    overflow-wrap: break-word;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .order-reference-line {
    width: max-content;
    max-width: 100%;
    overflow: visible;
    white-space: nowrap;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .order-reference-line strong {
    font-size: 16px;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .order-payment-cell {
    display: grid;
    align-content: center;
    gap: 3px;
    overflow: hidden;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .order-payment-method {
    max-width: 100%;
    color: var(--list-text-primary);
    font-size: 13px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .order-payment-status,
.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .order-receivable-indicator {
    max-width: 100%;
    margin-top: 0;
    color: var(--list-text-secondary);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .orders-table .order-receivable-indicator {
    color: var(--success);
}

/* Controles administrativos: inputs e dropdowns alinhados ao padrao Figma. */
.dashboard:not(.dashboard-home) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.dashboard:not(.dashboard-home) select,
.dashboard:not(.dashboard-home) textarea {
    min-height: 44px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    color: var(--list-text-primary, var(--text-strong));
    background-color: var(--list-surface, var(--input));
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    box-shadow: none;
}

.dashboard:not(.dashboard-home) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"])::placeholder,
.dashboard:not(.dashboard-home) textarea::placeholder {
    color: var(--list-text-secondary, var(--muted));
}

.dashboard:not(.dashboard-home) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]):focus,
.dashboard:not(.dashboard-home) select:focus,
.dashboard:not(.dashboard-home) textarea:focus {
    border-color: #3b608f;
    box-shadow: 0 0 0 3px rgba(59, 96, 143, .16);
    outline: 0;
}

.dashboard:not(.dashboard-home) select,
.dashboard:not(.dashboard-home) .order-origin-filter,
.dashboard:not(.dashboard-home) .filter-select,
.dashboard:not(.dashboard-home) .date-filter {
    height: 44px;
    padding: 0 36px 0 14px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .list-actions .ghost-action,
.dashboard:has(.contacts-card):not(.dashboard-home) .list-actions .secondary-action {
    min-height: 44px;
    border-color: var(--list-border);
    border-radius: 10px;
    color: var(--list-text-primary);
    background: var(--list-surface);
    font-family: "Poppins";
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    box-shadow: none;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .list-actions .ghost-action:hover,
.dashboard:has(.contacts-card):not(.dashboard-home) .list-actions .secondary-action:hover {
    color: var(--list-text-primary);
    background: var(--list-surface-soft);
    transform: none;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .list-actions .order-origin-filter,
.dashboard:has(.contacts-card):not(.dashboard-home) .list-actions .filter-select,
.dashboard:has(.contacts-card):not(.dashboard-home) .list-actions .date-filter {
    width: auto;
    min-width: 128px;
    border-color: var(--list-border);
    color: var(--list-text-primary);
    background-color: var(--list-surface);
}

.dashboard:has(.contacts-card):not(.dashboard-home) .search-input input {
    min-height: 0;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.dashboard:not(.dashboard-home) .search-input input,
.dashboard:not(.dashboard-home) .search-input input:focus {
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: 0 !important;
}

.dashboard:not(.dashboard-home) .search-input input::placeholder,
.dashboard:has(.contacts-card):not(.dashboard-home) .search-input input::placeholder {
    font-size: 12px;
    font-weight: 500;
    color: var(--list-text-secondary, var(--muted));
}

.dashboard .cert-mini,
.dashboard:not(.dashboard-home) .cert-mini,
.dashboard-home .cert-mini {
    grid-template-columns: 30px minmax(0, 1fr);
    min-height: 52px;
    gap: 10px;
    border-color: color-mix(in srgb, var(--line-soft) 78%, var(--home-nav-active-bg, #3B608F) 22%);
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--home-inner-bg) 88%, var(--home-nav-active-bg, #3B608F) 12%), var(--home-inner-bg));
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}

.dashboard .cert-mini:hover,
.dashboard .cert-mini:focus-visible,
.dashboard:not(.dashboard-home) .cert-mini:hover,
.dashboard:not(.dashboard-home) .cert-mini:focus-visible,
.dashboard-home .cert-mini:hover,
.dashboard-home .cert-mini:focus-visible {
    border-color: color-mix(in srgb, var(--home-nav-active-bg, #3B608F) 52%, var(--line-soft));
    background: color-mix(in srgb, var(--home-inner-bg) 88%, var(--home-nav-active-bg, #3B608F) 12%);
    text-decoration: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 24px rgba(2, 8, 23, .16);
    outline: 0;
    transform: translateY(-1px);
}

.dashboard .cert-mini > div,
.dashboard:not(.dashboard-home) .cert-mini > div,
.dashboard-home .cert-mini > div {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.dashboard .cert-mini,
.dashboard .cert-mini *,
.dashboard:not(.dashboard-home) .cert-mini,
.dashboard:not(.dashboard-home) .cert-mini *,
.dashboard-home .cert-mini,
.dashboard-home .cert-mini * {
    text-decoration: none !important;
}

.dashboard .cert-mini strong,
.dashboard:not(.dashboard-home) .cert-mini strong,
.dashboard-home .cert-mini strong {
    color: var(--text-strong);
    font-family: "Inter";
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0;
}

.dashboard .cert-mini > div > span,
.dashboard:not(.dashboard-home) .cert-mini > div > span,
.dashboard-home .cert-mini > div > span {
    color: var(--muted);
    font-family: "Inter";
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Movimento global: interacoes mais suaves e consistentes. */
.nav-button,
.submenu a,
.submenu button,
.ghost-action,
.primary-action,
.secondary-action,
.cancel-action,
.button-like,
.search-input,
.order-origin-filter,
.filter-select,
.date-filter,
.contacts-row,
.dots-button,
.row-actions-menu,
.pager a,
.pager button,
.stat-card,
.chart-card,
.recent-card,
.sale-row,
.type-pill,
.status-pill,
.fiscal-list-document,
.cert-mini,
.company-switch-trigger,
.logout-icon,
.receivable-filters,
.filter-modal-head button,
.dashboard:not(.dashboard-home) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.dashboard:not(.dashboard-home) select,
.dashboard:not(.dashboard-home) textarea {
    transition-duration: var(--motion-duration-fast);
    transition-timing-function: var(--motion-ease);
}

.nav-button,
.submenu a,
.submenu button,
.ghost-action,
.primary-action,
.secondary-action,
.cancel-action,
.button-like,
.search-input,
.order-origin-filter,
.filter-select,
.date-filter,
.dots-button,
.pager a,
.pager button,
.type-pill,
.status-pill,
.fiscal-list-document,
.filter-modal-head button,
.company-switch-trigger,
.logout-icon,
.dashboard:not(.dashboard-home) input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
.dashboard:not(.dashboard-home) select,
.dashboard:not(.dashboard-home) textarea {
    transition-property: background-color, background, border-color, color, box-shadow, opacity, transform;
}

.contacts-row,
.sale-row {
    transition-property: background-color, border-color, color, box-shadow;
}

.stat-card,
.chart-card,
.recent-card,
.cert-mini,
.receivable-filters {
    transition-property: background-color, background, border-color, box-shadow, opacity, transform;
}

.row-actions-menu,
.bulk-options-menu {
    transform-origin: top right;
    transition-property: opacity, transform, visibility, display;
    transition-duration: var(--motion-duration);
    transition-timing-function: var(--motion-ease-emphasis);
    transition-behavior: allow-discrete;
}

.action-cell.is-open .row-actions-menu,
.order-action-menu[open] .row-actions-menu,
.bulk-options.is-open .bulk-options-menu {
    animation: menu-soft-in var(--motion-duration) var(--motion-ease-emphasis) both;
}

.filter-modal.is-open .receivable-filters {
    animation: modal-soft-in var(--motion-duration-slow) var(--motion-ease-emphasis) both;
}

.submenu {
    display: grid;
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition:
        max-height var(--motion-duration-slow) var(--motion-ease-emphasis),
        margin var(--motion-duration) var(--motion-ease),
        opacity var(--motion-duration) var(--motion-ease);
}

.menu-group.is-open .submenu {
    display: grid;
    max-height: 460px;
    margin: 4px 0 8px 25px;
    opacity: 1;
    pointer-events: auto;
}

.settle-modal,
.filter-modal,
.modal-backdrop,
.item-edit-modal,
.image-preview-modal,
.category-modal,
.credentials-modal,
.ciot-json-modal,
.mdfe-doc-modal {
    opacity: 0;
    visibility: hidden;
    transition:
        opacity var(--motion-duration-slow) var(--motion-ease-emphasis),
        visibility var(--motion-duration-slow) var(--motion-ease-emphasis),
        display var(--motion-duration-slow) var(--motion-ease-emphasis);
    transition-behavior: allow-discrete;
}

.settle-modal.is-open,
.filter-modal.is-open,
.modal-backdrop.is-open,
.item-edit-modal.is-open,
.image-preview-modal.is-open,
.category-modal.is-open,
.credentials-modal.is-open,
.ciot-json-modal.is-open,
.mdfe-doc-modal.is-open {
    opacity: 1;
    visibility: visible;
}

.settle-modal-card,
.receivable-filters,
.modal-card,
.user-modal,
.item-edit-dialog,
.image-preview-modal img,
.category-modal-card,
.credentials-card,
.ciot-json-dialog,
.mdfe-doc-modal-card {
    opacity: 0;
    transform: translateY(10px) scale(.985);
    transition:
        opacity var(--motion-duration-slow) var(--motion-ease-emphasis),
        transform var(--motion-duration-slow) var(--motion-ease-emphasis);
}

.settle-modal.is-open .settle-modal-card,
.filter-modal.is-open .receivable-filters,
.modal-backdrop.is-open .modal-card,
.modal-backdrop.is-open .user-modal,
.item-edit-modal.is-open .item-edit-dialog,
.image-preview-modal.is-open img,
.category-modal.is-open .category-modal-card,
.credentials-modal.is-open .credentials-card,
.ciot-json-modal.is-open .ciot-json-dialog,
.mdfe-doc-modal.is-open .mdfe-doc-modal-card {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.row-actions-menu,
.bulk-options-menu,
.product-suggestions,
.category-suggestions,
.customer-suggestions,
.seller-suggestions {
    opacity: 0;
    transform: translateY(-6px) scale(.985);
    visibility: hidden;
}

.action-cell.is-open .row-actions-menu,
.order-action-menu[open] .row-actions-menu,
.bulk-options.is-open .bulk-options-menu,
.product-suggestions.is-open,
.category-suggestions.is-open,
.customer-suggestions.is-open,
.seller-suggestions.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    visibility: visible;
}

@starting-style {
    .settle-modal.is-open,
    .filter-modal.is-open,
    .modal-backdrop.is-open,
    .item-edit-modal.is-open,
    .image-preview-modal.is-open,
    .category-modal.is-open,
    .credentials-modal.is-open,
    .ciot-json-modal.is-open,
    .mdfe-doc-modal.is-open {
        opacity: 0;
    }

    .settle-modal.is-open .settle-modal-card,
    .filter-modal.is-open .receivable-filters,
    .modal-backdrop.is-open .modal-card,
    .modal-backdrop.is-open .user-modal,
    .item-edit-modal.is-open .item-edit-dialog,
    .image-preview-modal.is-open img,
    .category-modal.is-open .category-modal-card,
    .credentials-modal.is-open .credentials-card,
    .ciot-json-modal.is-open .ciot-json-dialog,
    .mdfe-doc-modal.is-open .mdfe-doc-modal-card {
        opacity: 0;
        transform: translateY(10px) scale(.985);
    }
}

.menu-group .chev,
.dashboard .nav-button .figma-icon--chevron,
.dashboard:not(.dashboard-home) .nav-button .figma-icon--chevron,
.dashboard-home .nav-button .figma-icon--chevron {
    transition-duration: var(--motion-duration);
    transition-timing-function: var(--motion-ease-emphasis);
}

.page-alert {
    animation-duration: var(--motion-duration-slow);
    animation-timing-function: var(--motion-ease-emphasis);
}

@keyframes menu-soft-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes modal-soft-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
/* Dashboard Apex: estilos isolados da tela inicial. */
:root[data-theme="dark"] .dashboard-next-header h1,:root[data-theme="dark"] .dashboard-panel-head h2,:root[data-theme="dark"] .dashboard-kpi strong{color:#e7eef8}:root[data-theme="dark"] .dashboard-kpi,:root[data-theme="dark"] .dashboard-panel,:root[data-theme="dark"] .dashboard-goal,:root[data-theme="dark"] .dashboard-next-filter{background:#101c2c;border-color:#26374b}:root[data-theme="dark"] .dashboard-next-filter,:root[data-theme="dark"] .dashboard-kpi small,:root[data-theme="dark"] .dashboard-next-header p,:root[data-theme="dark"] .dashboard-panel-head p,:root[data-theme="dark"] .dashboard-product-row,:root[data-theme="dark"] .dashboard-goal{color:#a8b7c9}:root[data-theme="dark"] .dashboard-product-row strong{color:#d5e0ed}:root[data-theme="dark"] .dashboard-goal-progress{background:#26374b}:root[data-theme="dark"] .dashboard-product-row>div{background:#203d45}
.dashboard-next .dashboard-primary-chart{height:370px;min-height:370px;overflow:hidden}.dashboard-next .dashboard-primary-chart .dashboard-apex-chart{display:block;position:relative;height:275px;min-height:275px;max-height:275px}.dashboard-period-form select{height:34px;border:1px solid #dce5ee;border-radius:7px;background:#fff;color:#55677d;padding:0 30px 0 11px;font-size:11px;font-weight:600;outline:none;cursor:pointer}:root[data-theme="dark"] .dashboard-period-form select{background:#101c2c;border-color:#26374b;color:#a8b7c9}
.dashboard-next .dashboard-next-main{display:flex!important;flex-direction:column!important;align-items:stretch!important}.dashboard-next .dashboard-primary-chart{position:relative!important;z-index:0!important;flex:0 0 370px!important;order:3!important;margin:0 0 14px!important}.dashboard-next .dashboard-secondary-grid{position:relative!important;z-index:1!important;top:auto!important;right:auto!important;bottom:auto!important;left:auto!important;transform:none!important;float:none!important;clear:both!important;flex:0 0 auto!important;order:4!important;margin:0!important}.dashboard-next .dashboard-goal{position:relative!important;z-index:1!important;flex:0 0 auto!important;order:5!important}
@media (min-width: 900px){.dashboard-next .dashboard-next-main{height:100svh;min-height:100svh;overflow:hidden;padding:16px 22px 14px!important}.dashboard-next-header{min-height:42px;margin-bottom:10px!important}.dashboard-kpis{gap:10px;margin-bottom:10px!important}.dashboard-kpi{min-height:64px;padding:10px 12px}.dashboard-kpi-icon{width:32px;height:32px;flex-basis:32px;font-size:17px}.dashboard-kpi strong{font-size:17px}.dashboard-kpi em{font-size:9px}.dashboard-next .dashboard-primary-chart{flex:1 1 auto!important;height:auto!important;min-height:210px!important;max-height:265px!important;margin-bottom:10px!important}.dashboard-next .dashboard-primary-chart .dashboard-apex-chart{height:calc(100% - 52px)!important;min-height:0!important;max-height:none!important}.dashboard-secondary-grid{height:170px;min-height:170px;gap:10px}.dashboard-secondary-grid .dashboard-panel{height:170px;overflow:hidden;padding:12px}.dashboard-secondary-grid .dashboard-apex-chart--small{height:118px;min-height:118px}.dashboard-products-list{margin-top:9px;gap:5px}.dashboard-product-row{font-size:10px}.dashboard-goal{min-height:42px;margin-top:10px!important;padding:7px 14px}.dashboard-goal-icon{font-size:20px}.dashboard-goal strong{font-size:15px}}
.dashboard-final .dashboard-next-main{display:block!important;height:auto!important;min-height:0!important;overflow:visible!important;padding:24px 28px 24px!important}.dashboard-final .dashboard-next-header{min-height:0;margin-bottom:16px!important}.dashboard-final .dashboard-kpis{gap:14px;margin-bottom:16px!important}.dashboard-final .dashboard-kpi{min-height:96px;padding:16px}.dashboard-final .dashboard-kpi-icon{width:38px;height:38px;flex-basis:38px;font-size:20px}.dashboard-final .dashboard-kpi strong{font-size:20px}.dashboard-final .dashboard-kpi em{font-size:10px}.dashboard-final .dashboard-primary-chart{display:block!important;height:auto!important;min-height:390px!important;max-height:none!important;margin:0 0 16px!important;overflow:hidden!important}.dashboard-final .dashboard-primary-chart .dashboard-apex-chart{height:320px!important;min-height:320px!important;max-height:320px!important}.dashboard-final .dashboard-secondary-grid{display:grid!important;position:relative!important;height:auto!important;min-height:0!important;margin:0!important;gap:16px!important}.dashboard-final .dashboard-secondary-grid .dashboard-panel{height:330px!important;overflow:hidden;padding:16px}.dashboard-final .dashboard-secondary-grid .dashboard-apex-chart--small{height:265px!important;min-height:265px!important}.dashboard-final .dashboard-goal{display:flex!important;position:relative!important;height:auto!important;min-height:52px!important;margin-top:16px!important;padding:10px 16px}.dashboard-date-form{display:flex;align-items:center;gap:7px;padding:4px 7px;border:1px solid #dce5ee;border-radius:7px;background:#fff}.dashboard-date-form input{height:30px;max-width:116px;border:0;background:transparent;color:#43556a;font-size:11px;font-weight:600;outline:0}.dashboard-date-form span{color:#93a1b1}.dashboard-date-form button,.dashboard-ranking-form select{height:28px;border:0;border-radius:5px;background:#edf4fb;color:#285382;font-size:10px;font-weight:800;padding:0 9px;cursor:pointer}.dashboard-ranking-form select{border:1px solid #dce5ee;background:#fff;height:30px}.dashboard-final .dashboard-products-list{margin-top:18px;gap:11px}.dashboard-final .dashboard-product-row{grid-template-columns:18px minmax(120px,1fr) minmax(110px,1.8fr) 42px;font-size:11px}.dashboard-final .dashboard-product-row strong{font-size:10px}@media(max-width:900px){.dashboard-final .dashboard-next-main{padding:18px 14px!important}.dashboard-date-form{width:100%;order:3}.dashboard-final .dashboard-primary-chart{min-height:350px!important}.dashboard-final .dashboard-primary-chart .dashboard-apex-chart{height:280px!important;min-height:280px!important}.dashboard-final .dashboard-secondary-grid .dashboard-panel{height:300px!important}.dashboard-final .dashboard-secondary-grid .dashboard-apex-chart--small{height:230px!important;min-height:230px!important}}
.dashboard-next .dashboard-next-main{padding:24px 28px 20px;max-width:1500px}.dashboard-next-header{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:18px}.dashboard-next-header h1{margin:0;color:#102a4c;font-size:25px;line-height:1.1}.dashboard-next-header p,.dashboard-panel-head p{margin:5px 0 0;color:#718096;font-size:12px}.dashboard-next-actions{display:flex;gap:9px;align-items:center;flex-wrap:wrap}.dashboard-next-filter{min-height:34px;display:inline-flex;align-items:center;padding:0 12px;border:1px solid #dce5ee;border-radius:7px;background:#fff;color:#55677d;font-size:11px;font-weight:600}.dashboard-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:14px}.dashboard-kpi,.dashboard-panel,.dashboard-goal{background:#fff;border:1px solid #e3eaf1;border-radius:8px;box-shadow:0 7px 18px rgba(25,47,72,.045)}.dashboard-kpi{min-height:86px;padding:15px;display:flex;gap:13px}.dashboard-kpi-icon{width:38px;height:38px;flex:0 0 38px;display:grid;place-items:center;border-radius:10px;font-weight:800;font-size:20px}.dashboard-kpi-icon.is-cyan{color:#009da7;background:#e4fbfa}.dashboard-kpi-icon.is-blue{color:#2460a9;background:#eaf2fd}.dashboard-kpi-icon.is-teal{color:#078b9a;background:#e4f8f8}.dashboard-kpi-icon.is-indigo{color:#3e5dc5;background:#eef0ff}.dashboard-kpi small{display:block;color:#66778b;font-size:11px}.dashboard-kpi strong{display:block;margin:3px 0;color:#142438;font-size:19px;line-height:1.12}.dashboard-kpi em{color:#168653;font-size:10px;font-style:normal;font-weight:700}.dashboard-panel{padding:15px 16px}.dashboard-panel-head{display:flex;justify-content:space-between;gap:14px}.dashboard-panel-head h2{margin:0;color:#183250;font-size:14px}.dashboard-panel-head>div:last-child{text-align:right}.dashboard-panel-head>div:last-child small{display:block;color:#728296;font-size:10px}.dashboard-panel-head>div:last-child strong{color:#134986;font-size:16px}.legend-line,.legend-bar{display:inline-block;vertical-align:middle;margin:0 4px 0 8px}.legend-line{width:13px;border-top:2px solid #00aeb7}.legend-bar{width:8px;height:8px;background:#123e70}.dashboard-primary-chart{margin-bottom:14px}.dashboard-apex-chart{min-height:275px;margin-top:5px}.dashboard-apex-chart--small{min-height:220px}.dashboard-secondary-grid{display:grid;grid-template-columns:1.05fr .95fr;gap:14px}.dashboard-products-list{margin-top:15px;display:grid;gap:9px}.dashboard-product-row{display:grid;grid-template-columns:18px minmax(80px,1fr) minmax(70px,1.5fr) 62px;gap:8px;align-items:center;font-size:11px;color:#4a5c70}.dashboard-product-row b{display:grid;place-items:center;width:16px;height:16px;color:#fff;background:#04aab2;border-radius:50%;font-size:10px}.dashboard-product-row span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dashboard-product-row>div{height:12px;border-radius:3px;overflow:hidden;background:#e4f4f4}.dashboard-product-row i{display:block;height:100%;border-radius:3px;background:#00aeb7}.dashboard-product-row strong{text-align:right;color:#26415d;font-size:10px}.dashboard-empty{margin:22px 0;color:#728296;font-size:12px}.dashboard-goal{display:flex;align-items:center;gap:14px;min-height:51px;padding:9px 16px;margin-top:14px;color:#687a8d;font-size:11px}.dashboard-goal-icon{color:#00aeb7;font-size:26px}.dashboard-goal small{display:block}.dashboard-goal strong{display:block;color:#00aeb7;font-size:17px}.dashboard-goal-progress{width:min(210px,30vw);height:9px;overflow:hidden;border-radius:999px;background:#e4eaf0}.dashboard-goal-progress i{display:block;height:100%;border-radius:inherit;background:#00aeb7}.dashboard-goal time{margin-left:auto;font-size:10px}@media(max-width:1100px){.dashboard-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-secondary-grid{grid-template-columns:1fr}.dashboard-next-header{flex-direction:column}}@media(max-width:640px){.dashboard-next .dashboard-next-main{padding:18px 14px}.dashboard-kpis{grid-template-columns:1fr}.dashboard-goal{flex-wrap:wrap}.dashboard-goal time{margin-left:0}.dashboard-goal-progress{width:100%;order:4}}

/* Dashboard: composição de desktop sem sobreposição, inteiramente visível na viewport. */
@media (min-width: 1px) {
    .dashboard-final { height: 100dvh !important; overflow: hidden !important; }
    .dashboard-final .dashboard-next-main {
        display: flex !important;
        flex-direction: column !important;
        height: 100dvh !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 16px 28px 14px !important;
        box-sizing: border-box;
    }
    .dashboard-final .dashboard-next-header { flex: 0 0 42px; margin-bottom: 10px !important; }
    .dashboard-final .dashboard-kpis { flex: 0 0 62px; margin-bottom: 10px !important; gap: 12px; }
    .dashboard-final .dashboard-kpi { min-height: 0; height: 62px; padding: 6px 14px; box-sizing: border-box; }
    .dashboard-final .dashboard-primary-chart { flex: 0 0 230px !important; min-height: 0 !important; height: 230px !important; max-height: 230px !important; margin: 0 0 10px !important; }
    .dashboard-final .dashboard-primary-chart .dashboard-apex-chart { height: calc(100% - 60px) !important; min-height: 0 !important; max-height: none !important; }
    .dashboard-final .dashboard-secondary-grid { flex: 0 0 225px !important; grid-template-columns: 1.05fr .95fr; gap: 14px !important; }
    .dashboard-final .dashboard-secondary-grid .dashboard-panel { height: 225px !important; min-height: 0; padding: 12px 14px; }
    .dashboard-final .dashboard-secondary-grid .dashboard-apex-chart--small { height: calc(100% - 48px) !important; min-height: 0 !important; }
    .dashboard-final .dashboard-products-list { margin-top: 9px; gap: 5px; }
    .dashboard-final .dashboard-product-row { font-size: 10px; }
    .dashboard-final .dashboard-goal { flex: 0 0 44px; min-height: 0 !important; margin-top: 10px !important; padding: 6px 14px; }
}

@media (min-width: 1px) {
    .dashboard-final .dashboard-products { padding-bottom: 12px !important; }
    .dashboard-final .dashboard-products-list { margin-top: 5px; gap: 3px; }
    .dashboard-final .dashboard-product-row { min-height: 16px; line-height: 1; }
}

#dashboard-faturamento-chart .apexcharts-bar-area {
    fill: #123e70 !important;
    fill-opacity: 1 !important;
    stroke: #123e70 !important;
    opacity: 1 !important;
}

@media (max-width: 900px) {
    .dashboard-final,
    .dashboard-final .dashboard-next-main { height: auto !important; overflow: visible !important; }
    .dashboard-final .dashboard-next-main { display: block !important; padding: 18px 14px !important; }
    .dashboard-final .dashboard-primary-chart { height: auto !important; min-height: 350px !important; max-height: none !important; }
    .dashboard-final .dashboard-primary-chart .dashboard-apex-chart { height: 280px !important; min-height: 280px !important; }
    .dashboard-final .dashboard-secondary-grid { display: grid !important; height: auto !important; }
    .dashboard-final .dashboard-secondary-grid .dashboard-panel { height: 300px !important; }
    .dashboard-final .dashboard-secondary-grid .dashboard-apex-chart--small { height: 230px !important; }
}

.mdfe-percurso-field {
    display: flex;
    align-items: center;
    gap: 6px;
}
.mdfe-percurso-field input {
    flex: 1;
    min-width: 0;
}
.mdfe-percurso-field [data-detect-mdfe-percurso] {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--panel);
    color: var(--muted-strong);
    cursor: pointer;
}
.mdfe-percurso-field [data-detect-mdfe-percurso]:hover {
    color: var(--text-strong);
}


.tiny-product-monitor {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--border-soft, #dbe4ee);
    border-radius: 8px;
    background: var(--surface-card, #fff);
}
.tiny-product-monitor-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}
.tiny-product-monitor-head h3 {
    margin: 0 0 4px;
    font-size: 15px;
}
.tiny-product-monitor-head p {
    margin: 0;
    color: var(--text-muted, #667085);
    font-size: 12px;
}
.tiny-product-monitor-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}
.tiny-product-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 10px 0 4px;
}
.tiny-product-step {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 5px;
    color: var(--text-muted, #667085);
    text-align: center;
    min-width: 0;
}
.tiny-product-step::before,
.tiny-product-step::after {
    content: "";
    position: absolute;
    top: 16px;
    height: 2px;
    background: var(--border-soft, #dbe4ee);
    width: 50%;
    z-index: 0;
}
.tiny-product-step::before { left: 0; }
.tiny-product-step::after { right: 0; }
.tiny-product-step:first-child::before,
.tiny-product-step:last-child::after { display: none; }
.tiny-product-step span {
    position: relative;
    z-index: 1;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid var(--border-soft, #dbe4ee);
    background: var(--surface-card, #fff);
    color: inherit;
    font-weight: 800;
    font-size: 12px;
}
.tiny-product-step strong {
    color: inherit;
    font-size: 12px;
    line-height: 1.15;
}
.tiny-product-step small {
    max-width: 100%;
    color: var(--text-muted, #667085);
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tiny-product-step.is-done,
.tiny-product-step.is-active { color: #168653; }
.tiny-product-step.is-done::before,
.tiny-product-step.is-done::after,
.tiny-product-step.is-active::before { background: #25a55f; }
.tiny-product-step.is-done span,
.tiny-product-step.is-active span { border-color: #25a55f; background: #e8f8ef; }
.tiny-product-step.is-error { color: #c33b49; }
.tiny-product-step.is-error span { border-color: #c33b49; background: #fff0f2; }
.tiny-product-step.is-paused { color: #9a6b00; }
.tiny-product-step.is-paused span { border-color: #c99722; background: #fff8e6; }
.tiny-product-monitor-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}
.tiny-product-monitor-grid span,
.tiny-product-monitor-events span {
    display: grid;
    gap: 3px;
    padding: 10px;
    border: 1px solid var(--border-soft, #dbe4ee);
    border-radius: 7px;
    min-width: 0;
}
.tiny-product-monitor-grid strong,
.tiny-product-monitor-events strong {
    color: var(--text-strong, #162033);
    font-size: 11px;
}
.tiny-product-monitor-grid em,
.tiny-product-monitor-events em {
    color: var(--text-muted, #667085);
    font-size: 11px;
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.tiny-product-monitor-events {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
}
:root[data-theme="dark"] .tiny-product-monitor,
:root[data-theme="dark"] .tiny-product-step span {
    background: #101c2c;
    border-color: #26374b;
}
:root[data-theme="dark"] .tiny-product-monitor-grid span,
:root[data-theme="dark"] .tiny-product-monitor-events span {
    border-color: #26374b;
}
@media (max-width: 900px) {
    .tiny-product-monitor-head,
    .tiny-product-monitor-actions { justify-content: flex-start; }
    .tiny-product-monitor-head { flex-direction: column; }
    .tiny-product-monitor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tiny-product-monitor-events { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .tiny-product-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; }
    .tiny-product-monitor-grid { grid-template-columns: 1fr; }
}

.cashflow-conta-receber-match {
    padding: 12px 14px;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: #f0fdf4;
}
.cashflow-conta-receber-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #166534;
    cursor: pointer;
}
.cashflow-conta-receber-check input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
:root[data-theme="dark"] .cashflow-conta-receber-match {
    background: #0f2417;
    border-color: #16522f;
}
:root[data-theme="dark"] .cashflow-conta-receber-check {
    color: #86efac;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .cashflow-conta-receber-match {
        background: #0f2417;
        border-color: #16522f;
    }
    :root:not([data-theme="light"]) .cashflow-conta-receber-check {
        color: #86efac;
    }
}

/* Seletor de cor moderno: gatilho compacto + popover */
.loja-cor-campo {
    display: grid;
    gap: 10px;
}

.loja-cor-titulo {
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
}

.color-picker {
    position: relative;
    width: min(620px, 100%);
    user-select: none;
}

.color-picker .cp-compacto {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}

.color-picker .cp-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 44px;
    padding: 0 12px 0 8px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 12px;
    background: var(--list-surface, var(--input));
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.color-picker .cp-toggle:hover,
.color-picker .cp-toggle[aria-expanded="true"] {
    border-color: var(--brand, #3b5f96);
}

.color-picker .cp-toggle-cor {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #7c3aed;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .2);
}

.color-picker .cp-toggle-hex {
    min-width: 62px;
    text-align: left;
    text-transform: uppercase;
}

.color-picker .cp-toggle-seta {
    transition: transform .15s ease;
}

.color-picker .cp-toggle[aria-expanded="true"] .cp-toggle-seta {
    transform: rotate(180deg);
}

.color-picker .cp-rapidas {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.color-picker .cp-amostra {
    padding: 0;
    border: 2px solid var(--list-surface, #fff);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .25);
    cursor: pointer;
    transition: transform .12s ease;
}

.color-picker .cp-rapidas .cp-amostra {
    width: 24px;
    height: 24px;
}

.color-picker .cp-amostra:hover {
    transform: scale(1.12);
}

.color-picker .cp-amostra.is-active {
    box-shadow: 0 0 0 2px var(--text-strong, #0f172a);
}

/* Popover */
.color-picker .cp-painel {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 80;
    width: 340px;
    max-width: calc(100vw - 32px);
    box-sizing: border-box;
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 22px;
    background: var(--list-surface, var(--panel));
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
    animation: cp-entrada .16s ease both;
}

.color-picker .cp-painel,
.color-picker .cp-painel * {
    min-width: 0;
}

.color-picker .cp-painel[hidden] {
    display: none;
}

@keyframes cp-entrada {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.985); }
    to { opacity: 1; transform: translate(-50%, -50%); }
}

.color-picker .cp-cabecalho {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.color-picker .cp-cabecalho strong {
    display: block;
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.color-picker .cp-cabecalho > div > span {
    display: block;
    margin-top: 2px;
    color: var(--list-text-secondary, var(--muted));
    font-family: "Poppins";
    font-size: 12px;
}

.color-picker .cp-cabecalho-acoes {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker .cp-previa {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: #7c3aed;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .15);
}

.color-picker .cp-fechar {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 12px;
    background: transparent;
    color: var(--list-text-primary, var(--text-strong));
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.color-picker .cp-fechar:hover {
    border-color: var(--brand, #3b5f96);
}

.color-picker .cp-area {
    position: relative;
    height: 180px;
    border-radius: 16px;
    background:
        linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
        linear-gradient(to right, #fff, rgba(255, 255, 255, 0)),
        var(--cp-matiz, #f00);
    cursor: crosshair;
    touch-action: none;
}

.color-picker .cp-area-thumb,
.color-picker .cp-hue-thumb {
    position: absolute;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-sizing: border-box;
}

.color-picker .cp-area-thumb {
    width: 22px;
    height: 22px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .3), 0 3px 8px rgba(0, 0, 0, .4);
}

.color-picker .cp-hue {
    position: relative;
    height: 12px;
    margin: 4px 0;
    border-radius: 999px;
    background: linear-gradient(to right, #f00 0%, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00 100%);
    cursor: pointer;
    touch-action: none;
}

.color-picker .cp-hue-thumb {
    top: 50%;
    width: 22px;
    height: 22px;
    border: 3px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .25), 0 3px 8px rgba(0, 0, 0, .35);
}

.color-picker .cp-linha-hex {
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-picker .cp-icone {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 12px;
    background: transparent;
    color: var(--list-text-primary, var(--text-strong));
    cursor: pointer;
}

.color-picker .cp-icone:hover {
    border-color: var(--brand, #3b5f96);
    color: var(--brand, #3b5f96);
}

.color-picker .cp-icone[hidden] {
    display: none;
}

.color-picker .cp-icone.is-copiado,
.color-picker .cp-copiar-mini.is-copiado {
    border-color: #16a34a;
    color: #16a34a;
}

.color-picker .cp-campo {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding: 0 6px 0 12px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 12px;
    background: transparent;
}

.color-picker .cp-campo:focus-within {
    border-color: var(--brand, #3b5f96);
}

.color-picker .cp-campo b {
    flex: 0 0 auto;
    color: var(--list-text-secondary, var(--muted));
    font-family: "Poppins";
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}

.color-picker .cp-campo input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 40px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--list-text-primary, var(--text-strong));
    font-family: "Poppins";
    font-size: 13px;
    font-weight: 500;
    outline: none;
}

.color-picker .cp-campo-hex {
    flex: 1;
}

.color-picker .cp-campo-hex input {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.color-picker .cp-formatos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.color-picker .cp-copiar-mini {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--list-text-secondary, var(--muted));
    cursor: pointer;
}

.color-picker .cp-copiar-mini:hover {
    background: rgba(100, 116, 139, .14);
    color: var(--brand, #3b5f96);
}

.color-picker .cp-rotulo {
    margin-bottom: -6px;
    color: var(--list-text-secondary, var(--muted));
    font-family: "Poppins";
    font-size: 12px;
    font-weight: 600;
}

.color-picker .cp-salvas {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
}

.color-picker .cp-slot {
    position: relative;
    aspect-ratio: 1 / 1;
}

.color-picker .cp-slot > button:first-child {
    width: 100%;
    height: 100%;
    padding: 0;
    border: 2px dashed var(--list-border, #cbd5e1);
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
}

.color-picker .cp-slot > button:first-child:hover {
    border-color: var(--brand, #3b5f96);
}

.color-picker .cp-slot.is-cheio > button:first-child {
    border: 2px solid var(--list-surface, #fff);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .25);
}

.color-picker .cp-slot.is-ativo > button:first-child {
    box-shadow: 0 0 0 2px var(--text-strong, #0f172a);
}

.color-picker .cp-slot-remover {
    position: absolute;
    top: -5px;
    right: -5px;
    display: none;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #0f172a;
    color: #fff;
    font-size: 11px;
    line-height: 16px;
    cursor: pointer;
}

.color-picker .cp-slot.is-cheio:hover .cp-slot-remover,
.color-picker .cp-slot.is-cheio:focus-within .cp-slot-remover {
    display: block;
}

@media (max-width: 560px) {
    .color-picker .cp-painel { width: min(340px, calc(100vw - 32px)); }
}

/* Sites de venda */
.sites-table .contacts-head,
.sites-table .contacts-row {
    grid-template-columns: 2.4fr 1.3fr .7fr 1fr .9fr .45fr;
}

.site-venda-identidade {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.site-venda-identidade > div {
    min-width: 0;
}

.site-venda-logo {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--site-cor, #7c3aed);
    color: #fff;
    font-weight: 700;
}

.site-venda-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

.site-venda-status {
    display: inline-flex;
    align-items: center;
    justify-self: start;
    height: 26px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(100, 116, 139, .14);
    color: var(--muted, #64748b);
    font-size: 12px;
    font-weight: 700;
}

.site-venda-status.is-ok {
    background: rgba(22, 163, 74, .14);
    color: #15803d;
}

.site-categorias {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px 16px;
    margin: 10px 0 14px;
    padding: 14px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 12px;
    max-height: 260px;
    overflow-y: auto;
}

.site-categorias small {
    color: var(--list-text-secondary, var(--muted));
}

[data-site-bloco][hidden] {
    display: none !important;
}


/* ---- Configurações > Mensalidades (tela única) ---- */
.mensalidades-table .contacts-head,
.mensalidades-table .contacts-row {
    grid-template-columns: 2fr .9fr 1.3fr .9fr .9fr 1.9fr;
}
.mens-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; margin: 4px 0 18px; }
.mens-month { display: flex; align-items: flex-end; gap: 8px; }
.mens-month label { display: grid; gap: 4px; }
.mens-month label small { color: var(--muted, #8b97a9); font-weight: 700; }
.mens-month .button-like { min-width: 40px; text-align: center; font-size: 20px; line-height: 1; padding: 8px 12px; }
.mens-stats { margin-bottom: 18px; }
.mens-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mens-previa small, .mensalidades-table .contacts-row small { display: block; opacity: .7; }
.mens-bloqueada { color: #e0533d; font-weight: 700; }
.mens-modal-wide { width: min(860px, 96vw); }
.mens-explica { margin: 0 0 12px; opacity: .85; }
.mens-extensoes { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.mens-chip { padding: 5px 11px; border-radius: 999px; background: rgba(148, 163, 184, .16); font-size: 12.5px; font-weight: 700; }
.mens-historico { display: grid; gap: 10px; max-height: 52vh; overflow: auto; padding-right: 4px; }
.mens-cobranca { border: 1px solid rgba(148, 163, 184, .22); border-radius: 14px; padding: 12px 14px; display: grid; gap: 8px; }
.mens-cobranca-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mens-valor { margin-left: auto; }
.mens-cobranca-info { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; opacity: .8; }
.mens-cobranca-acoes { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mens-cobranca-acoes form { margin: 0; }
.mens-nfse label { cursor: pointer; }
.mens-form { display: grid; gap: 14px; }
.mens-form label { display: grid; gap: 5px; font-weight: 700; }
.mens-form label small { font-weight: 500; opacity: .7; }
.mens-previa-box { display: grid; gap: 3px; padding: 12px 14px; border-radius: 12px; background: rgba(59, 130, 246, .09); }
.mens-previa-box small { opacity: .8; word-break: break-all; }
.mens-check { display: flex !important; gap: 10px; align-items: flex-start; font-weight: 500 !important; }
.mens-check input { margin-top: 3px; }
@media (max-width: 900px) {
    .mensalidades-table .contacts-head { display: none; }
    .mensalidades-table .contacts-row { grid-template-columns: 1fr 1fr; gap: 8px 12px; }
    .mens-valor { margin-left: 0; }
}

[data-pdv-conta-dinheiro][hidden], [data-pdv-mp-bloco][hidden] { display: none !important; }

/* Link "Cliente ja pagou? Toque aqui para conferir" do modal Mercado Pago do PDV (mesmo modelo da Loja Online) */
.pdv-mp-link { display: block; width: 100%; margin: 4px 0 2px; padding: 8px; border: 0; background: none; color: var(--accent, #2f6fed); font-size: 14px; font-weight: 700; text-align: center; text-decoration: underline; cursor: pointer; }
.pdv-mp-link[hidden] { display: none; }
.pdv-mp-link:disabled { opacity: .6; cursor: wait; }

/* Estado "Aguardando o pagamento..." com a bolinha pulsando (mesmo modelo da Loja Online) */
.pdv-mp-feedback.is-pending .pdv-mp-feedback-icon { position: relative; font-size: 0; background: transparent; }
.pdv-mp-feedback.is-pending .pdv-mp-feedback-icon::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent, #2f6fed);
    animation: pdv-mp-pulso 1.1s ease-in-out infinite;
}
@keyframes pdv-mp-pulso { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }

.cce-historico {
    margin-bottom: 12px;
}

.cce-historico-item {
    padding: 10px 12px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 12.5px;
    line-height: 1.5;
}

.cce-historico-item strong {
    display: block;
    font-size: 11.5px;
    color: var(--text-strong);
    margin-bottom: 2px;
}

.cce-historico-item span {
    display: block;
    color: var(--muted);
}

.cce-historico-item small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-weight: 650;
}

.cce-historico-item small.cce-erro {
    color: var(--danger, #d64545);
}

.mensalidade-modal-ajuste {
    margin: 0 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--blue, #3b5b8c) 10%, transparent);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

/* Cadastros > Links */
.links-table .contacts-head,
.links-table .contacts-row {
    grid-template-columns: 2.6fr .7fr .8fr .8fr .9fr .45fr;
}

.links-botoes { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.links-botao {
    display: flex; flex-direction: column; gap: 10px; padding: 14px;
    border: 1px solid var(--border, #e2e8f0); border-radius: 14px; background: var(--surface-2, rgba(148, 163, 184, .08));
}
.links-botao label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 700; }
.links-botao input, .links-botao select { width: 100%; }
.links-botao-topo { display: grid; grid-template-columns: 220px 1fr auto; gap: 10px; align-items: end; }
.links-botao-acoes { display: flex; gap: 6px; }
.links-botao-acoes button {
    width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border, #cbd5e1);
    background: transparent; color: inherit; font-size: 18px; cursor: pointer;
}
.links-botao-rodape { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.links-botao-imagem { flex: 1 1 260px; }
.links-botao-miniatura { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
@media (max-width: 720px) {
    .links-botao-topo { grid-template-columns: 1fr; }
}

.links-qr-card {
    width: min(480px, calc(100vw - 32px));
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr);
}
.links-qr-card > * { min-width: 0; box-sizing: border-box; }
.links-qr-previa { display: flex; justify-content: center; padding: 4px 0 2px; }
.links-qr-previa canvas { width: 240px; height: 240px; max-width: 100%; border-radius: 12px; border: 1px solid var(--border, #e2e8f0); background: #fff; }
.links-qr-tamanho { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.links-qr-tamanho select { width: 100%; box-sizing: border-box; }
.links-qr-botoes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.links-qr-botoes .primary-action { justify-content: center; min-width: 0; padding-left: 8px; padding-right: 8px; white-space: nowrap; }
.links-qr-dica { margin: 0; font-size: 12px; opacity: .75; }
@media (max-width: 420px) {
    .links-qr-botoes { grid-template-columns: minmax(0, 1fr); }
}

/* Titulos de coluna ordenaveis (listagens) */
.sort-head { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; cursor: pointer; white-space: nowrap; }
.sort-head:hover { opacity: .8; }
.sort-head .sort-icon { flex: 0 0 auto; }
.sort-head .sort-icon path { fill: currentColor; opacity: .28; }
.sort-head .sort-icon path.is-on { opacity: 1; }
.sort-head.is-active { color: var(--blue, #3b5b8c); }

/* ===== Inteligência Tributária (app/views/inteligencia-tributaria.php) ===== */
.it-page .it-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.it-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.it-tabs a { padding: 9px 14px; border: 1px solid var(--line-soft); border-radius: 10px; color: var(--text-strong); font-weight: 700; font-size: 14px; text-decoration: none; background: var(--panel); }
.it-tabs a:hover { border-color: var(--brand); }
.it-tabs a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.it-stats { margin-bottom: 18px; }
.it-notice { margin: 0 0 12px; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line-soft); border-left-width: 4px; background: var(--panel); color: var(--text-strong); font-size: 14px; line-height: 1.45; }
.it-notice a { color: inherit; }
.it-notice.is-success { border-left-color: var(--success); }
.it-notice.is-warning { border-left-color: var(--warning); }
.it-notice.is-error { border-left-color: var(--danger); }
.it-notice.is-info { border-left-color: var(--brand); }
.dashboard .dash-main.it-page .contacts-card.it-card { height: auto !important; min-height: 0 !important; display: block; overflow: visible !important; padding: 18px 20px; margin-bottom: 18px; }
.it-card h2 { margin: 0 0 12px; font-size: 17px; color: var(--text-strong); }
.it-card h3 { margin: 18px 0 8px; font-size: 15px; color: var(--text-strong); }
.it-help { margin: 8px 0 14px; color: #8b97a9; font-size: 13px; line-height: 1.5; }
.it-table-wrap { width: 100%; overflow-x: auto; }
.it-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--text-strong); }
.it-table caption { text-align: left; font-weight: 800; padding: 10px 0 6px; }
.it-table th { text-align: left; font-size: 12px; font-weight: 700; color: #8b97a9; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.it-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.it-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.it-table .it-total td { font-weight: 800; border-top: 2px solid var(--line-soft); }
.it-table .it-diff { color: var(--danger); font-weight: 800; }
.it-table .it-ok { color: var(--success); }
.it-table .it-muted td { opacity: .55; }
.it-table .it-empty { text-align: center; color: #8b97a9; padding: 18px; }
.it-table-wrap.is-sem-rolagem { overflow-x: visible; }
.it-table.is-compacta { table-layout: fixed; font-size: 13px; }
.it-table.is-compacta th { white-space: normal; line-height: 1.25; padding: 8px 6px; vertical-align: bottom; }
.it-table.is-compacta th.num { text-align: right; }
.it-table.is-compacta td { padding: 8px 6px; }
.it-table.is-compacta .it-note { display: block; font-size: 11px; font-weight: 400; white-space: normal; }
.it-table td.it-cel-ganha { background: rgba(34, 197, 94, .14); box-shadow: inset 3px 0 0 var(--success); }
.it-table td.it-cel-ganha strong, .it-table td.it-cel-ganha .it-dif { color: var(--success); }
.it-table td.it-cel-perde { background: rgba(239, 68, 68, .09); box-shadow: inset 3px 0 0 var(--danger); }
.it-table td.it-cel-perde strong, .it-table td.it-cel-perde .it-dif { color: var(--danger); }
.it-table .it-dif { display: block; font-size: 11px; font-weight: 700; white-space: nowrap; }
.it-legenda { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.it-chip { font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.it-chip.is-ganha { background: rgba(34, 197, 94, .16); color: var(--success); }
.it-chip.is-perde { background: rgba(239, 68, 68, .12); color: var(--danger); }
@media (max-width: 760px) { .it-table-wrap.is-sem-rolagem { overflow-x: auto; } .it-table.is-compacta { min-width: 720px; } }
.it-table-inputs input { width: 100%; min-height: 38px; border: 1px solid var(--line-soft); border-radius: 8px; padding: 0 10px; background: var(--input); color: var(--text-strong); font: inherit; text-align: right; }
.it-note { display: block; color: #8b97a9; font-size: 12px; margin-top: 2px; }
.it-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--panel-soft); color: var(--warning); font-size: 11px; font-weight: 800; }
/* Painel fiscal (Inteligencia Tributaria) */
.itp-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 10px; }
.itp-resumo-item { padding: 14px 16px; border: 1px solid var(--line-soft); border-left-width: 4px; border-radius: 12px; background: var(--panel); display: grid; gap: 2px; }
.itp-resumo-item strong { font-size: 26px; line-height: 1; color: var(--text-strong); }
.itp-resumo-item span { font-size: 13px; color: #8b97a9; }
.itp-resumo-item.is-risco { border-left-color: var(--danger); }
.itp-resumo-item.is-atencao { border-left-color: var(--warning); }
.itp-resumo-item.is-ok { border-left-color: var(--success); }
.itp-empresa { flex-shrink: 0; margin-bottom: 14px; padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--panel); }
.itp-empresa h2 { margin: 0; font-size: 17px; color: var(--text-strong); }
.itp-resumo { flex-shrink: 0; }
.itp-empresa-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.itp-empresa-topo h2 { margin: 0; }
.itp-empresa-topo small { color: #8b97a9; font-size: 13px; }
.itp-selo { padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1px solid var(--line-soft); color: var(--text-strong); white-space: nowrap; }
.itp-selo.is-risco { border-color: var(--danger); color: var(--danger); }
.itp-selo.is-atencao { border-color: var(--warning); color: var(--warning); }
.itp-selo.is-ok { border-color: var(--success); color: var(--success); }
.itp-grade { align-items: start; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.itp-ind { display: grid; gap: 3px; align-content: start; padding: 11px 13px; border: 1px solid var(--line-soft); border-left-width: 4px; border-radius: 10px; background: var(--panel); color: var(--text-strong); text-decoration: none; min-width: 0; }
a.itp-ind:hover, a.itp-ind:focus-visible { border-color: var(--brand); }
.itp-ind small { font-size: 12px; font-weight: 700; color: #8b97a9; }
.itp-ind strong { font-size: 16px; overflow-wrap: anywhere; }
.itp-ind span { font-size: 12px; line-height: 1.4; color: #8b97a9; }
.itp-ind.is-ok { border-left-color: var(--success); }
.itp-ind.is-atencao { border-left-color: var(--warning); }
.itp-ind.is-risco { border-left-color: var(--danger); }
.itp-ind.is-info { border-left-color: var(--brand); }
.itp-ind.is-sem_dados, .itp-ind.is-na { border-left-color: var(--line-soft); opacity: .8; }
.it-form { margin-top: 6px; }
.it-form small { color: #8b97a9; font-weight: 500; font-size: 12px; }
.it-form-action { display: flex; align-items: flex-end; justify-content: flex-end; margin-top: 12px; }
.it-subtitle { font-weight: 800; color: var(--text-strong); margin-top: 6px; }
.it-inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.it-inline-form input { flex: 1 1 260px; min-height: 44px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 0 14px; background: var(--input); color: var(--text-strong); font: inherit; }
.it-check { display: flex !important; grid-template-columns: none; align-items: center; gap: 8px; margin: 8px 0 !important; font-weight: 600; }
.it-check input { width: auto !important; min-height: 0 !important; }
.it-actions { display: flex; gap: 12px; align-items: center; white-space: nowrap; }
.it-actions form { margin: 0; }
.it-actions .link-button { border: 0; background: none; padding: 0; color: var(--danger); font: inherit; font-weight: 700; cursor: pointer; }
.it-params { margin: 0; padding-left: 18px; color: var(--text-strong); line-height: 1.8; }
.it-anexos { display: grid; gap: 8px; }
@media (max-width: 720px) {
    .dashboard .dash-main.it-page .contacts-card.it-card { padding: 14px; }
    .it-tabs a { flex: 1 1 auto; text-align: center; }
    .it-form-action { justify-content: stretch; }
    .it-form-action .primary-action { width: 100%; justify-content: center; }
}
.it-form input, .it-form select { min-width: 0; box-sizing: border-box; }

/* Financas > Estimativa de Faturamento (reaproveita it-card/it-table/it-notice da Inteligencia Tributaria) */
.ef-page .it-toolbar label { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: #8b97a9; }
.ef-page .it-toolbar select { min-height: 40px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 0 12px; background: var(--input); color: var(--text-strong); font: inherit; font-size: 14px; max-width: 100%; }
.ef-voltar { margin: 0 0 12px; font-size: 14px; color: var(--text-strong); }
.ef-voltar a, .ef-empresa-link { color: var(--brand); text-decoration: none; }
.ef-voltar a:hover, .ef-empresa-link:hover { text-decoration: underline; }
.ef-table .ef-base { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.ef-table tr.ef-estimado td { color: #8b97a9; font-style: italic; }
.ef-table tr.ef-estimado td.num { font-style: normal; }
.ef-limite-cell { min-width: 200px; }
.ef-meter { position: relative; height: 10px; margin: 6px 0 4px; border-radius: 999px; background: var(--line-soft); overflow: hidden; --ef-cor: var(--success); }
.ef-meter.is-atencao { --ef-cor: var(--warning); }
.ef-meter.is-excedido, .ef-meter.is-grave { --ef-cor: var(--danger); }
.ef-meter.is-info { --ef-cor: var(--brand); }
.ef-meter span { position: absolute; inset: 0 auto 0 0; border-radius: 999px; }
.ef-meter .ef-meter-proj { background: color-mix(in srgb, var(--ef-cor) 40%, transparent); }
.ef-meter .ef-meter-real { background: var(--ef-cor); }
.ef-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; color: var(--text-strong); background: color-mix(in srgb, var(--ef-cor, var(--success)) 18%, transparent); }
.ef-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ef-cor, var(--success)); }
.ef-pill.is-atencao { --ef-cor: var(--warning); }
.ef-pill.is-excedido, .ef-pill.is-grave { --ef-cor: var(--danger); }
.ef-pill.is-info { --ef-cor: var(--brand); }
.ef-alerta-texto { color: var(--danger) !important; font-weight: 700; }
.ef-limites { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.ef-limite { border: 1px solid var(--line-soft); border-radius: 12px; padding: 14px 16px; background: var(--panel); }
.ef-limite header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.ef-limite header strong { color: var(--text-strong); font-size: 15px; }
.ef-limite .it-help { margin: 8px 0 6px; }
.ef-limite-numeros { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 4px 0 0; font-size: 13px; color: #8b97a9; }
.ef-limite-numeros strong { color: var(--text-strong); }
.ef-legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.ef-legenda span { display: inline-block; width: 18px; height: 8px; border-radius: 999px; background: var(--success); }
.ef-legenda span.ef-legenda-proj { background: color-mix(in srgb, var(--success) 40%, transparent); margin-left: 8px; }
.ef-situacao { font-size: 12px; font-weight: 700; color: #8b97a9; white-space: nowrap; }
.ef-situacao.is-realizado { color: var(--text-strong); font-style: normal; }
.ef-como { margin: 0; padding-left: 18px; color: var(--text-strong); font-size: 14px; line-height: 1.6; }
.ef-como li + li { margin-top: 6px; }
@media (max-width: 720px) {
    .ef-limites { grid-template-columns: 1fr; }
    .ef-page .it-toolbar select { width: 100%; }
}

/* Formulario de nota fiscal: cabecalho completo, destinatario e abas de itens */
.field-hint {
    color: var(--text-muted, var(--muted));
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
}

.dest-links {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 22px;
    font-size: 13px;
    font-weight: 700;
}

.dest-links a,
.link-button {
    color: var(--brand);
    text-decoration: none;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}

.dest-links a:hover,
.link-button:hover {
    text-decoration: underline;
}

.nota-itens-titulo {
    border-top: 2px solid var(--brand);
}

.nota-tabs {
    display: flex;
    gap: 22px;
}

.nota-tab {
    padding: 4px 0 6px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-muted, var(--muted));
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.nota-tab.is-active {
    border-bottom-color: var(--brand);
    color: var(--text-strong);
}

.nota-tab-painel[hidden] {
    display: none !important;
}

.nota-tab-produtos-grid {
    padding: 0;
}

.nota-impostos-table input {
    width: 100%;
    min-width: 70px;
    min-height: 34px;
    padding: 0 8px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: var(--input);
    color: var(--text-strong);
    font: inherit;
}

.nota-total-destaque input {
    font-weight: 900;
    color: var(--brand);
}

/* Telas NFC-e / NFS-e (notas-pedido-lista.php) */
.doc-resumo {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

/* Indicadores compactos: rotulo, numero e valor na mesma linha. */
.doc-resumo-card {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    padding: 9px 14px;
    border: 1px solid var(--line-soft);
    border-left: 4px solid var(--muted, #94a3b8);
    border-radius: 10px;
    background: var(--panel);
}

.doc-resumo-card span {
    color: var(--muted, #64748b);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    white-space: nowrap;
}

.doc-resumo-card strong {
    margin-left: auto;
    color: var(--text-strong);
    font-size: 18px;
    font-weight: 900;
    line-height: 1.2;
}

.doc-resumo-card small {
    color: var(--muted, #64748b);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.doc-resumo-card.is-autorizada { border-left-color: #16a34a; }
.doc-resumo-card.is-cancelada { border-left-color: #d97706; }
.doc-resumo-card.is-rejeitada { border-left-color: #dc2626; }

.doc-pedido-table .contacts-head,
.doc-pedido-table .contacts-row {
    grid-template-columns: 1.3fr 1.7fr 1.15fr .9fr .9fr 1.1fr .45fr;
}

@media (max-width: 760px) {
    .doc-resumo {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* NFC-e / NFS-e: a pagina nao rola - so a lista (os cartoes de resumo ocupam
   altura extra, entao a lista ocupa o espaco que sobra em vez da altura fixa). */
.dashboard:has(.contacts-card):not(.dashboard-home) .dash-main.doc-pedido-main {
    display: flex;
    flex-direction: column;
    height: 100svh;
    box-sizing: border-box;
    overflow: hidden;
}

.doc-pedido-main > .page-top,
.doc-pedido-main > .doc-resumo {
    flex: 0 0 auto;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main > .contacts-card {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

/* Cabecalho das listas fiscais: filtros quebram linha em vez de espremer a
   busca ou cobrir o subtitulo. */
.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main > .page-top {
    flex-wrap: wrap;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main > .page-top > div:first-child {
    flex: 1 0 auto;
    max-width: 100%;
    min-width: 0;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main .list-actions {
    flex: 1 1 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main .search-input {
    flex: 1 1 180px;
    min-width: 160px;
    max-width: 340px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main .list-actions .filter-select {
    min-width: 0;
    width: 162px;
    flex: 0 0 auto;
    padding-left: 10px;
    padding-right: 6px;
    font-size: 13px;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main .list-actions input[type="date"].filter-select {
    width: 142px;
    padding-left: 10px;
    padding-right: 8px;
}

/* Itens do menu com descricao embaixo (NF-e / NFC-e / NFS-e). */
.dashboard .submenu a.submenu-doc,
.submenu a.submenu-doc {
    min-height: 40px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 1px;
    padding-top: 4px;
    padding-bottom: 4px;
    line-height: 1.2;
}

.submenu a.submenu-doc span {
    font-weight: 600;
}

.submenu a.submenu-doc small {
    font-size: 11px;
    font-weight: 500;
    opacity: .78;
    white-space: normal;
    max-width: 100%;
}

.mens-nfse-aviso {
    flex-basis: 100%;
    color: #b45309;
    font-size: 12px;
    font-weight: 600;
}

/* Mensalidades no padrao das listas (cabecalho em linha, indicadores
   compactos, so a lista rola). */
.mensalidades-table .contacts-head,
.mensalidades-table .contacts-row {
    grid-template-columns: 2.2fr .9fr 1fr 1fr .9fr .8fr .45fr;
}

.doc-pedido-main .mens-toolbar {
    margin: 0;
    flex-wrap: nowrap;
    align-items: center;
    gap: 10px;
}

.doc-pedido-main .mens-month {
    align-items: center;
    gap: 6px;
}

.doc-pedido-main .mens-month input[type="month"] {
    min-height: 44px;
    width: 150px;
    padding: 0 10px;
    border: 1px solid var(--line-soft);
    border-radius: 10px;
    background: var(--panel);
    color: var(--text-strong);
    font: inherit;
    font-weight: 700;
}

.doc-pedido-main .mens-month .button-like {
    min-height: 44px;
    min-width: 40px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mens-menu-arquivo {
    display: block;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.mens-menu-arquivo:hover {
    background: var(--panel-soft);
}

.row-actions-menu form:has(.mens-menu-arquivo) {
    margin: 0;
}

/* Botao "Opções ▾" (dots-button com texto): nas listas o dots-button vira
   icone de tres pontos - este mantem o texto. */
.dashboard:has(.contacts-card):not(.dashboard-home) .dots-button.dots-button--labeled {
    width: auto;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--list-border, var(--line-soft));
    border-radius: 10px;
    color: var(--list-text-primary, var(--text-strong));
    background: var(--list-surface, var(--panel));
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.dashboard:has(.contacts-card):not(.dashboard-home) .dots-button.dots-button--labeled::before {
    content: none;
}

/* Campo de arquivo escondido dentro de um <label> que serve de botao
   ("Anexar nota", "Anexar XMLs"): regras de input do modal/form passavam por
   cima do atributo hidden e mostravam o "Escolher arquivo". */
input[type="file"][hidden] {
    display: none !important;
}

.mens-nfse-emitindo {
    flex-basis: 100%;
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
}

/* Marcadores (etiquetas coloridas) das listagens */
.marcador-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 3px; }
.marcador-tag { display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-size: 11px; line-height: 1; padding: 3px 7px; border-radius: 999px; border: 1px solid color-mix(in srgb, var(--marcador-cor, #64748b) 55%, transparent); background: color-mix(in srgb, var(--marcador-cor, #64748b) 14%, transparent); color: inherit; white-space: nowrap; }
.marcador-tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--marcador-cor, #64748b); }
.order-tiny-numero { display: block; opacity: .7; }

/* Contas a pagar/receber: a descricao (historico) aparece completa, quebrando em mais de uma linha. */
.payables-table .contacts-row,
.receivables-table .contacts-row {
    padding-top: 10px;
    padding-bottom: 10px;
}
.payables-table .contacts-row > div:nth-child(3),
.receivables-table .contacts-row > div:nth-child(3) {
    overflow: visible;
}
.payables-table .contacts-row > div:nth-child(3) small,
.receivables-table .contacts-row > div:nth-child(3) small {
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

/* Fornecedor (pagar) e cliente (receber) tambem quebram linha quando o nome e longo. */
.payables-table .contacts-row > span:nth-child(2),
.receivables-table .contacts-row > span:nth-child(2) {
    display: block;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    line-height: 1.35;
}

/* Contas a receber / pagar: cartoes de totais clicaveis (mesmo estilo das telas de NFC-e) */
.contas-resumo {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}
a.doc-resumo-card {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow .15s ease, border-color .15s ease, transform .15s ease;
}
a.doc-resumo-card:hover {
    box-shadow: 0 2px 10px rgba(15, 23, 42, .10);
    transform: translateY(-1px);
}
a.doc-resumo-card.is-active {
    border-color: var(--brand, #2563eb);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand, #2563eb) 25%, transparent);
    background: color-mix(in srgb, var(--brand, #2563eb) 6%, var(--panel));
}
.doc-resumo-card.is-aberto { border-left-color: #2563eb; }
.doc-resumo-card.is-vencido { border-left-color: #dc2626; }
.doc-resumo-card.is-parcial { border-left-color: #d97706; }
.doc-resumo-card.is-pago { border-left-color: #16a34a; }
.doc-resumo-card.is-total { border-left-color: #64748b; }
@media (max-width: 1100px) {
    .contas-resumo { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .contas-resumo { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
/* Filtros do cabecalho (busca, situacao, marcador e periodo) sempre visiveis, quebrando linha se faltar espaco */
.contas-filtros-topo { flex-wrap: wrap; gap: 8px; align-items: center; }
.contas-filtros-topo .search-input { min-width: 220px; flex: 1 1 220px; }

/* Contas: botoes de acao ficam na linha do titulo; os filtros ocupam uma linha propria logo abaixo. */
.page-top .page-top-buttons {
    flex-wrap: nowrap;
    justify-content: flex-end;
    margin-left: auto;
}
.doc-pedido-main > .contas-filtros-topo {
    flex: 0 0 auto;
    display: flex;
    width: 100%;
    margin: -8px 0 12px;
}
.contas-filtros-topo .filter-select { max-width: 230px; min-width: 0; }
.contas-filtros-topo .search-input { max-width: none; }
/* Cartoes de total: so o numero, sem estourar a largura */
.contas-resumo .doc-resumo-card { overflow: hidden; }
.receivable-top-actions.contas-filtros-topo .search-input { width: clamp(200px, 22vw, 320px); flex: 1 1 200px; }

/* Cartao "Marcadores e dados do Tiny" nas telas de pedido e de contas */
.dados-tiny-card h2 { margin: 0 0 10px; font-size: 15px; }
.dados-tiny-marcadores { margin-bottom: 10px; }
.dados-tiny-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; margin: 0; }
.dados-tiny-lista > div { min-width: 0; }
.dados-tiny-lista dt { color: var(--muted, #64748b); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.dados-tiny-lista dd { margin: 2px 0 0; font-size: 13px; font-weight: 650; overflow-wrap: anywhere; white-space: normal; }

/* Estoque: quantidade em destaque colorido (verde = em estoque, laranja = zerado, vermelho = negativo) */
.stock-row .stock-qty { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 1px; padding: 4px 10px; border-radius: 10px; line-height: 1.15; min-width: 72px; width: fit-content; }
.stock-row .stock-qty b { font-size: 15px; font-weight: 900; }
.stock-row .stock-qty small { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; opacity: .85; }
.stock-row .stock-qty.is-positive { color: #15803d; background: color-mix(in srgb, #16a34a 14%, transparent); }
.stock-row .stock-qty.is-zero { color: #b45309; background: color-mix(in srgb, #f59e0b 16%, transparent); }
.stock-row .stock-qty.is-negative { color: #b91c1c; background: color-mix(in srgb, #dc2626 14%, transparent); }
.stock-table .contacts-head .sort-head { justify-content: flex-start; }

/* Estoque: todas as etiquetas de quantidade com o mesmo tamanho (visual organizado) */
.stock-table .contacts-head,
.stock-table .contacts-row {
    grid-template-columns: minmax(210px, 2fr) minmax(108px, .85fr) 54px 124px minmax(96px, .8fr) minmax(108px, .8fr) 42px;
}
.stock-row .stock-qty {
    box-sizing: border-box;
    width: 104px;
    min-width: 104px;
    height: 44px;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0 8px;
}
.stock-row .stock-qty b { font-size: 15px; }
.stock-row .stock-qty small { font-size: 9px; }

/* Nova conta a pagar: formulario em passos, com botoes de escolha e dicas */
.payable-wizard [hidden] { display: none !important; }
.payable-wizard .form-step-title { display: flex; align-items: center; gap: 12px; margin-top: 8px; padding: 0 0 10px; border-bottom: 1px solid var(--line-soft); }
.payable-wizard .form-step-title:first-child { margin-top: 0; }
.payable-wizard .form-step-title b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand, #3b5b8c); color: #fff; font-size: 14px; font-weight: 900; flex: 0 0 auto; }
.payable-wizard .form-step-title span { display: flex; flex-direction: column; font-size: 16px; font-weight: 900; color: var(--text-strong); }
.payable-wizard .form-step-title small { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.payable-wizard .field-hint { display: block; margin-top: 4px; font-size: 11px; font-weight: 600; color: var(--muted, #64748b); }
.payable-wizard .req { color: #dc2626; font-style: normal; font-weight: 900; }
.payable-wizard .field-money { font-size: 18px; font-weight: 800; }
.payable-wizard .field-money.is-readonly { background: var(--panel-soft, rgba(148, 163, 184, .12)); color: var(--text-strong); }
.payable-wizard input:focus, .payable-wizard select:focus { outline: 2px solid color-mix(in srgb, var(--brand, #3b5b8c) 55%, transparent); outline-offset: 1px; }
.seg-control { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.seg-option { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 16px; text-align: left; border: 2px solid var(--line-soft); border-radius: 12px; background: var(--panel); color: inherit; cursor: pointer; font: inherit; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.seg-option b { font-size: 14px; font-weight: 900; color: var(--text-strong); }
.seg-option small { font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.seg-option:hover { border-color: color-mix(in srgb, var(--brand, #3b5b8c) 45%, var(--line-soft)); }
.seg-option.is-on { border-color: var(--brand, #3b5b8c); background: color-mix(in srgb, var(--brand, #3b5b8c) 9%, var(--panel)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #3b5b8c) 18%, transparent); }
.seg-option.is-on b { color: var(--brand, #3b5b8c); }
.payable-wizard .gen-preview-action { display: flex; align-items: flex-end; }
.payable-wizard .gen-preview-action .generate-installments { width: 100%; }
@media (max-width: 760px) { .seg-control { grid-template-columns: 1fr; } }
.payable-wizard .gen-summary { margin: 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--brand, #3b5b8c) 9%, var(--panel)); color: var(--text-strong); font-size: 13px; font-weight: 800; }

/* Nova conta a pagar: alinhamento uniforme (rotulos na mesma linha, campos com a mesma altura) */
.payable-wizard .form-grid { align-items: start; row-gap: 14px; }
.payable-wizard .form-grid > label,
.payable-wizard .form-grid > .form-field { display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; align-self: start; min-width: 0; }
.payable-wizard .form-grid > label > span:first-child,
.payable-wizard .form-grid > .form-field > .catalog-field-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 20px; margin: 0; }
.payable-wizard .form-grid > label > span:first-child { justify-content: flex-start; }
.payable-wizard .form-grid input:not([type="checkbox"]):not([type="hidden"]),
.payable-wizard .form-grid select { height: 46px; min-height: 46px; box-sizing: border-box; margin: 0; width: 100%; }
.payable-wizard .form-grid .product-search { margin: 0; }
.payable-wizard .form-grid .field-hint { margin: 0; min-height: 14px; }
.payable-wizard .gen-preview-action { align-self: end; padding-top: 26px; }
.payable-wizard .gen-preview-action .generate-installments { height: 46px; width: 100%; }
.payable-wizard .installment-auto-option { flex-direction: row !important; align-items: center; gap: 10px !important; }
.payable-wizard .installment-auto-option input { width: auto !important; height: auto !important; min-height: 0 !important; }
.payable-wizard .pay-note { margin: 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, #f59e0b 14%, var(--panel)); color: var(--text-strong); font-size: 13px; font-weight: 700; }
.payable-wizard .form-grid > .gen-preview-action { align-self: start; padding-top: 26px; }

/* Listas de contas: vencimento com tempo relativo, botao Pagar na linha, barra de selecao, datas rotuladas */
.periodo-campo { display: inline-flex; flex-direction: column; gap: 2px; }
.periodo-campo > small { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #64748b); padding-left: 4px; }
.contas-filtros-topo .periodo-campo .filter-select { max-width: 160px; }
.due-cell { display: flex; flex-direction: column; gap: 2px; }
.due-rel { font-size: 11px; font-weight: 800; color: var(--muted, #64748b); }
.due-rel.is-late { color: #dc2626; }
.due-rel.is-today { color: #d97706; }
.due-rel.is-soon { color: #b45309; }
.contacts-row .sem-documento { color: var(--muted, #94a3b8); font-style: italic; font-size: 11px; }
.payables-table .contacts-head,
.payables-table .contacts-row { grid-template-columns: 34px 1.5fr 1.8fr 1fr .85fr .85fr .85fr 128px; }
.payables-table .action-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; position: relative; }
.row-pay-button { padding: 6px 12px; border: 0; border-radius: 8px; background: var(--brand, #3b5b8c); color: #fff; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; white-space: nowrap; }
.row-pay-button:hover { filter: brightness(1.1); }
.bulk-bar { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-radius: 14px; background: var(--text-strong, #0f172a); color: #fff; box-shadow: 0 10px 30px rgba(15, 23, 42, .35); font-size: 13px; font-weight: 700; }
.bulk-bar[hidden] { display: none; }
.bulk-bar button { border: 0; border-radius: 9px; padding: 8px 14px; font: inherit; font-weight: 800; cursor: pointer; }
.bulk-bar .bulk-primary { background: #22c55e; color: #06310f; }
.bulk-bar .bulk-secondary { background: rgba(255, 255, 255, .14); color: #fff; }
.bulk-bar .bulk-link { background: transparent; color: #cbd5e1; text-decoration: underline; padding-left: 4px; padding-right: 4px; }
.vencidas-fora-aviso { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 12px; }
.vencidas-fora-aviso a { margin-left: auto; font-weight: 800; text-decoration: underline; color: inherit; }
/* ajustes: datas rotuladas sem caixa dupla; valores sem quebrar linha */
.contas-filtros-topo .periodo-campo { display: flex; flex-direction: column; gap: 2px; border: 0 !important; background: none !important; padding: 0 !important; box-shadow: none !important; height: auto !important; min-height: 0 !important; width: auto; }
.contas-filtros-topo .periodo-campo .filter-select { margin: 0; }
.contas-filtros-topo .search-input { flex: 1 1 170px; min-width: 170px; }
.contas-filtros-topo .filter-select { max-width: 190px; }
.payables-table .contacts-head,
.payables-table .contacts-row { grid-template-columns: 34px 1.35fr 1.7fr 1fr 1.05fr 1.05fr .85fr 128px; }
.payables-table .contacts-row > strong { white-space: nowrap; }
.contacts-row .due-rel.is-late { color: #dc2626 !important; }
.contacts-row .due-rel.is-today { color: #d97706 !important; }
.contacts-row .due-rel.is-soon { color: #b45309 !important; }
.contas-filtros-topo .filter-select { max-width: 160px; }
.contas-filtros-topo .search-input { flex: 1 1 150px; min-width: 150px; }
.inline-aviso { padding: 10px 14px; border-radius: 10px; border: 1px solid color-mix(in srgb, #f59e0b 55%, transparent); background: color-mix(in srgb, #f59e0b 13%, var(--panel)); color: var(--text-strong); font-size: 13px; font-weight: 600; }
/* alinhamento: o rotulo da data flutua acima do campo, sem empurra-lo para baixo da linha dos filtros */
.contas-filtros-topo { padding-top: 14px; }
.contas-filtros-topo .periodo-campo { position: relative; gap: 0; }
.contas-filtros-topo .periodo-campo > small { position: absolute; left: 6px; top: -14px; padding: 0; line-height: 12px; white-space: nowrap; pointer-events: none; }

/* Contas a receber: mesma grade de contas a pagar (valores sem quebrar, acoes com botao Receber) */
.receivables-table .contacts-head,
.receivables-table .contacts-row { grid-template-columns: 34px 1.35fr 1.7fr 1fr 1.05fr 1.05fr 1fr 128px; }
.receivables-table .contacts-row > strong { white-space: nowrap; }
.receivables-table .action-cell { display: flex; align-items: center; justify-content: flex-end; gap: 6px; position: relative; }

/* Contas a receber: etiquetas nao invadem a coluna vizinha */
.receivables-table .contacts-row > *, .payables-table .contacts-row > * { min-width: 0; }
.receivables-table .marcador-tag, .payables-table .marcador-tag { max-width: 100%; white-space: normal; line-height: 1.25; border-radius: 10px; }
.receivables-table .contacts-head,
.receivables-table .contacts-row { grid-template-columns: 34px 1.6fr 1.6fr 1fr 1.05fr 1.05fr 1fr 128px; }

/* Devolucao de compra: escolha do tipo de nota e assistente em passos */
.nf-tipo-card { width: min(520px, 94vw); }
.nf-tipo-opcao { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel-soft, rgba(148, 163, 184, .08)); color: var(--text-strong); text-decoration: none; }
.nf-tipo-opcao b { font-size: 16px; font-weight: 900; }
.nf-tipo-opcao small { font-size: 13px; font-weight: 600; color: var(--muted, #64748b); }
.nf-tipo-opcao:hover, .nf-tipo-opcao:focus-visible { border-color: var(--brand, #3b5b8c); outline: 2px solid color-mix(in srgb, var(--brand, #3b5b8c) 45%, transparent); outline-offset: 1px; }
.nf-devolucao-atalho { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.nf-devolucao [hidden] { display: none !important; }
.nf-devolucao .inline-aviso { margin-bottom: 12px; }
.nf-devolucao .inline-aviso.is-erro { border-color: color-mix(in srgb, #dc2626 55%, transparent); background: color-mix(in srgb, #dc2626 11%, var(--panel)); }
.nfd-step { display: grid; gap: 12px; margin-bottom: 8px; }
.nfd-chosen { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border: 1px solid color-mix(in srgb, #16a34a 45%, transparent); border-radius: 12px; background: color-mix(in srgb, #16a34a 9%, var(--panel)); }
.nfd-chosen > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nfd-chosen small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #64748b); }
.nfd-chosen strong { font-size: 15px; color: var(--text-strong); overflow-wrap: anywhere; }
.nfd-search { display: flex; flex-direction: column; gap: 6px; font-weight: 800; color: var(--text-strong); }
.nfd-search input { height: 46px; box-sizing: border-box; width: 100%; }
.nfd-check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; font-weight: 700; color: var(--text-strong); }
.nfd-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-top: 10px; }
.nfd-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 14px; text-align: left; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); color: var(--text-strong); cursor: pointer; font: inherit; }
.nfd-card strong { font-size: 14px; }
.nfd-card small { font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.nfd-card:hover, .nfd-card:focus-visible { border-color: var(--brand, #3b5b8c); outline: 2px solid color-mix(in srgb, var(--brand, #3b5b8c) 40%, transparent); outline-offset: 1px; }
.nfd-vazio { grid-column: 1 / -1; margin: 6px 0; font-size: 13px; font-weight: 600; color: var(--muted, #64748b); }
.nfd-itens-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.nfd-itens-grid .nfd-cards { grid-template-columns: 1fr; }
.nfd-produto, .nfd-linha { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.nfd-produto > div:first-child, .nfd-linha > div:first-child { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nfd-produto strong, .nfd-linha strong { font-size: 14px; color: var(--text-strong); overflow-wrap: anywhere; }
.nfd-produto small, .nfd-linha small { font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.nfd-produto-acao { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.nfd-produto-acao input { width: 96px; height: 40px; box-sizing: border-box; text-align: right; }
.nfd-produto-acao .ghost-action, .nfd-produto-acao .row-pay-button { height: 40px; box-sizing: border-box; white-space: nowrap; }
.nfd-lista-devolucao { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel-soft, rgba(148, 163, 184, .06)); }
.nfd-lista-devolucao h3 { margin: 0 0 4px; font-size: 15px; color: var(--text-strong); }
.nfd-lista-devolucao h3 em { font-style: normal; display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--brand, #3b5b8c); color: #fff; font-size: 12px; }
.nfd-resumo { margin: 4px 0 0; font-size: 13px; font-weight: 800; color: var(--text-strong); }
.row-pay-button.is-remove { background: transparent; color: #dc2626; border: 1px solid color-mix(in srgb, #dc2626 55%, transparent); }
@media (max-width: 900px) { .nfd-itens-grid { grid-template-columns: 1fr; } .nfd-produto, .nfd-linha { flex-wrap: wrap; } }
.nf-devolucao, .nf-devolucao .form-card, .nf-devolucao .form-grid, .nfd-step, .nfd-itens-grid > div { min-width: 0; }
.nfd-check input[type="checkbox"] { width: 18px; height: 18px; min-height: 0; flex: 0 0 18px; margin: 0; padding: 0; }
.nf-devolucao { grid-template-columns: minmax(0, 1fr); }
.nfd-check { display: flex !important; flex-direction: row !important; align-items: center; justify-content: flex-start; }
.nfd-check span { margin: 0; }
.nfd-linha > div:first-child, .nfd-produto > div:first-child { flex: 1 1 0; }
.payable-wizard .nfd-produto-acao input { width: 96px; flex: 0 0 96px; min-width: 0; }
.nfd-produto, .nfd-linha { flex-wrap: wrap; }
.nfd-produto > div:first-child, .nfd-linha > div:first-child { flex: 1 1 200px; }
.nfd-produto-acao { margin-left: auto; }
.payable-wizard .nfd-produto-acao input { height: 44px; }

/* Lista de pedidos: resumo por status, pagamento legivel e botao principal por linha */
.doc-resumo-card.is-faturado { border-left-color: #7c3aed; }
.pedidos-resumo { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pedidos-resumo .doc-resumo-card { overflow: hidden; }
.pedidos-resumo .doc-resumo-card small { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; color: var(--muted, #64748b); white-space: nowrap; }
.order-origin-pill.is-wide { min-height: 20px; padding: 2px 8px; font-size: 10px; font-weight: 800; margin-left: 6px; }
.order-reference-line { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.order-payment-line { display: flex; align-items: center; gap: 6px; min-width: 0; }
.order-payment-icons { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.order-payment-icons img { height: 18px; width: auto; display: block; }
.order-payment-pill { width: fit-content; margin-top: 2px; font-size: 11px; }
.type-pill.is-status-neutro { border-color: var(--line-soft); color: var(--muted, #64748b); background: transparent; }
.orders-table:not(.quotes-table) .contacts-head,
.orders-table:not(.quotes-table) .contacts-row { grid-template-columns: minmax(145px, .95fr) minmax(150px, 1.35fr) .82fr minmax(165px, 1.2fr) minmax(120px, .9fr) .8fr minmax(150px, 150px); }
.orders-table.quotes-table .contacts-head,
.orders-table.quotes-table .contacts-row { grid-template-columns: minmax(145px, .95fr) minmax(180px, 1.7fr) .9fr .82fr minmax(150px, 150px); }
.order-action-wrap { display: flex; align-items: center; justify-content: flex-end; gap: 8px; position: relative; }
.order-action-wrap .row-pay-button { text-decoration: none; display: inline-flex; align-items: center; height: 32px; box-sizing: border-box; }
.row-pay-button.is-neutral { background: transparent; color: var(--text-strong); border: 1px solid var(--line-soft); }
.row-pay-button.is-neutral:hover { background: var(--panel-soft, rgba(148, 163, 184, .12)); filter: none; }
.orders-table .order-action-wrap .order-action-menu > summary { width: 32px; height: 32px; }
.pedidos-resumo .doc-resumo-card { flex-wrap: wrap; row-gap: 0; align-content: center; min-height: 64px; }
.pedidos-resumo .doc-resumo-card small { flex: 0 0 100%; order: 3; }
.pedidos-resumo .doc-resumo-card strong { font-size: 22px; }
.orders-table:not(.quotes-table) .contacts-row { min-height: 88px; padding-top: 10px; padding-bottom: 10px; }
.order-payment-cell { gap: 4px; }
.order-payment-cell .order-stock-indicator, .order-payment-cell .order-receivable-indicator { margin-top: 2px; }
.list-actions .filter-select[data-period-shortcut] { min-width: 190px; height: 44px; }
.list-actions .filter-select[data-period-shortcut] { min-width: 225px; padding-right: 34px; }

/* Formulario de pedido / orcamento / OS em passos */
.sales-order-form .form-step-title { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 0 0 10px; border-bottom: 1px solid var(--line-soft); }
.sales-order-form .form-step-title b { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand, #3b5b8c); color: #fff; font-size: 14px; font-weight: 900; flex: 0 0 auto; }
.sales-order-form .form-step-title span { display: flex; flex-direction: column; font-size: 16px; font-weight: 900; color: var(--text-strong); }
.sales-order-form .form-step-title small { margin-top: 2px; font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.sales-order-form .pedido-mais-detalhes { border: 1px dashed var(--line-soft); border-radius: 12px; padding: 4px 14px 14px; }
.sales-order-form .pedido-mais-detalhes > summary { cursor: pointer; padding: 10px 0; font-size: 13px; font-weight: 800; color: var(--muted, #64748b); list-style: none; }
.sales-order-form .pedido-mais-detalhes > summary::-webkit-details-marker { display: none; }
.sales-order-form .pedido-mais-detalhes > summary::before { content: "▸"; display: inline-block; margin-right: 8px; transition: transform .15s; }
.sales-order-form .pedido-mais-detalhes[open] > summary::before { transform: rotate(90deg); }
.sales-order-form .generate-installments { white-space: nowrap; height: 46px; align-self: end; }
.sales-order-form [hidden] { display: none !important; }
.sales-order-form .seg-control { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sales-order-form .gen-summary { margin: 0; padding: 10px 14px; border-radius: 10px; background: color-mix(in srgb, var(--brand, #3b5b8c) 9%, var(--panel)); color: var(--text-strong); font-size: 13px; font-weight: 800; }
.sales-order-form .installment-field > span { display: flex; align-items: center; gap: 4px; min-height: 20px; }
.sales-order-form .req { color: #dc2626; font-style: normal; font-weight: 900; }
@media (max-width: 760px) { .sales-order-form .seg-control { grid-template-columns: 1fr; } }
.sales-order-form .installment-field { align-self: start; }
.sales-order-form .installment-field select, .sales-order-form .installment-field input { height: 46px; min-height: 46px; box-sizing: border-box; }
.sales-order-form .seg-control.seg-control-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .sales-order-form .seg-control.seg-control-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .sales-order-form .seg-control.seg-control-4 { grid-template-columns: 1fr; } }
.sales-order-form .pedido-transporte { border: 1px solid var(--line-soft); border-radius: 12px; padding: 4px 14px 14px; background: var(--panel-soft, rgba(148, 163, 184, .05)); }
.sales-order-form .pedido-transporte > summary { cursor: pointer; padding: 10px 0; font-size: 14px; font-weight: 800; color: var(--text-strong); list-style: none; }
.sales-order-form .pedido-transporte > summary::-webkit-details-marker { display: none; }
.sales-order-form .pedido-transporte > summary::before { content: "▸"; display: inline-block; margin-right: 8px; transition: transform .15s; }
.sales-order-form .pedido-transporte[open] > summary::before { transform: rotate(90deg); }
.sales-order-form .pedido-transporte .product-search { position: relative; }
.sales-order-form .sales-grid > label > select { height: 46px; min-height: 46px; box-sizing: border-box; }
.doc-pedido-main > .page-alert, .doc-pedido-main > .inline-aviso { flex: 0 0 auto; }

/* Lista de pedidos: titulo e botoes na mesma linha, para sobrar altura para a lista */
.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main.pedidos-compacto > .page-top { flex-wrap: nowrap; align-items: center; gap: 16px; }
.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main.pedidos-compacto > .page-top > div:first-child { flex: 0 1 auto; min-width: 0; max-width: none; }
.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main.pedidos-compacto > .page-top > div:first-child p { white-space: normal; max-width: 300px; }
.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main.pedidos-compacto .list-actions { flex: 1 1 0; min-width: 0; flex-wrap: nowrap; justify-content: flex-end; }
.pedidos-compacto .list-actions .search-input { flex: 1 1 140px; min-width: 120px; max-width: 360px; }
.pedidos-compacto .list-actions .search-input input { min-width: 0; text-overflow: ellipsis; }
.pedidos-compacto .list-actions .filter-select[data-period-shortcut] { min-width: 170px; flex: 0 0 auto; }
.pedidos-compacto .list-actions .ghost-action, .pedidos-compacto .list-actions .primary-action { flex: 0 0 auto; white-space: nowrap; }
.dashboard:has(.contacts-card):not(.dashboard-home) .doc-pedido-main.pedidos-compacto > .page-top > div:first-child p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 330px; margin-top: 2px; }
.pedidos-compacto .pedidos-resumo { gap: 8px; margin-bottom: 8px; }
.pedidos-compacto .pedidos-resumo .doc-resumo-card { min-height: 0; padding-top: 7px; padding-bottom: 7px; }
.pedidos-compacto .pedidos-resumo .doc-resumo-card strong { font-size: 19px; line-height: 1.1; }
.pedidos-compacto > .page-top { margin-bottom: 10px; }

/* ECONF: janela de conciliacao financeira */
.econf-card { width: min(900px, 96vw); max-height: 92vh; overflow-y: auto; }
.econf-secao { display: grid; gap: 10px; margin-bottom: 14px; }
.econf-secao h3 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; color: var(--text-strong); }
.econf-secao h3 b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand, #3b5b8c); color: #fff; font-size: 12px; }
.econf-ajuda { margin: 0; font-size: 13px; font-weight: 600; color: var(--muted, #64748b); }
.econf-linhas { display: grid; gap: 10px; }
.econf-linha { display: grid; grid-template-columns: 150px 130px minmax(180px, 1fr) auto; gap: 8px 10px; align-items: end; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel-soft, rgba(148, 163, 184, .06)); }
.econf-linha label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--text-strong); min-width: 0; }
.econf-linha input, .econf-linha select { height: 42px; box-sizing: border-box; width: 100%; }
.econf-linha [hidden] { display: none !important; }
.econf-xpag { grid-column: 1 / 4; }
.econf-remover { height: 42px; width: 42px; border: 1px solid color-mix(in srgb, #dc2626 55%, transparent); border-radius: 10px; background: transparent; color: #dc2626; font-size: 20px; cursor: pointer; }
.econf-mais { grid-column: 1 / -1; justify-self: start; padding: 0; border: 0; background: none; color: var(--brand, #3b5b8c); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; text-decoration: underline; }
.econf-detalhe { grid-column: 1 / -1; display: grid; grid-template-columns: 1.3fr 70px 1.3fr 1fr 1fr; gap: 8px 10px; }
.econf-rodape-linhas { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.econf-total { margin: 0; font-size: 13px; font-weight: 800; color: var(--text-strong); }
.econf-vazio { margin: 4px 0; font-size: 13px; font-weight: 600; color: var(--muted, #64748b); }
.econf-evento { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 14px; margin-bottom: 8px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.econf-evento > div { display: grid; gap: 3px; min-width: 0; }
.econf-evento small { font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.econf-evento ul { margin: 4px 0 0; padding-left: 18px; font-size: 12px; color: var(--text-strong); }
.econf-erro-txt { color: #dc2626 !important; }
.econf-selo { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; border: 1px solid var(--line-soft); }
.econf-selo.is-registrado { color: #15803d; border-color: #16a34a; background: color-mix(in srgb, #16a34a 12%, transparent); }
.econf-selo.is-erro { color: #b91c1c; border-color: #dc2626; background: color-mix(in srgb, #dc2626 10%, transparent); }
.econf-selo.is-cancelado { color: var(--muted, #64748b); }
.econf-acoes { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.econf-acoes [hidden], .econf-modal [hidden] { display: none !important; }
.inline-aviso.is-ok { border-color: color-mix(in srgb, #16a34a 55%, transparent); background: color-mix(in srgb, #16a34a 11%, var(--panel)); }
@media (max-width: 760px) { .econf-linha { grid-template-columns: 1fr 1fr; } .econf-xpag { grid-column: 1 / -1; } .econf-detalhe { grid-template-columns: 1fr 1fr; } }

/* Boletos do pedido: botoes lado a lado sem cortar o texto */
[data-boletos-modal] .settle-actions { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 10px; }
[data-boletos-modal] .settle-actions .primary-action,
[data-boletos-modal] .settle-actions .cancel-action { width: 100%; min-width: 0; justify-content: center; padding-inline: 12px; white-space: normal; text-align: center; line-height: 1.15; }

/* NFE_EMAIL: janela "Nota fiscal eletronica" (emitir com envio por e-mail) */
.nfe-email-card { width: min(520px, 94vw); }
.nfe-email-modal [hidden] { display: none !important; }
.nfe-email-resumo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 14px 0 6px; }
.nfe-email-resumo > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.nfe-email-resumo small { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #64748b); }
.nfe-email-resumo strong { font-size: 15px; color: var(--text-strong); overflow-wrap: anywhere; }
.nfe-email-toggle { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel-soft, rgba(148, 163, 184, .06)); cursor: pointer; font-weight: 800; color: var(--text-strong); }
.nfe-email-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.nfe-email-toggle span:last-child { display: flex; flex-direction: column; gap: 2px; font-size: 14.5px; }
.nfe-email-toggle small { font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.nfe-email-chave { position: relative; flex: 0 0 44px; width: 44px; height: 24px; border-radius: 999px; background: color-mix(in srgb, var(--muted, #64748b) 45%, transparent); transition: background .15s; }
.nfe-email-chave::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.nfe-email-toggle input:checked + .nfe-email-chave { background: var(--brand, #2563eb); }
.nfe-email-toggle input:checked + .nfe-email-chave::after { transform: translateX(20px); }
.nfe-email-toggle input:focus-visible + .nfe-email-chave { outline: 2px solid color-mix(in srgb, var(--brand, #2563eb) 55%, transparent); outline-offset: 2px; }
.nfe-email-destino { display: grid; gap: 10px; margin: 6px 0 4px; }
.nfe-email-destino p { margin: 0; font-size: 14px; color: var(--text-strong); overflow-wrap: anywhere; }
.nfe-email-alterar { padding: 0; border: 0; background: none; font: inherit; font-weight: 800; color: var(--brand, #2563eb); text-decoration: underline; cursor: pointer; }
.nfe-email-destino label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 800; color: var(--text-strong); }
.nfe-email-destino input { height: 46px; box-sizing: border-box; width: 100%; }
.nfe-email-ultimo { font-size: 12px !important; font-weight: 600; color: var(--muted, #64748b) !important; }
.nfe-email-acoes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; margin-top: 16px; }
.nfe-email-acoes .cancel-action, .nfe-email-acoes .primary-action { width: 100%; min-height: 45px; justify-content: center; }

/* Viagens > Gerar CT-e: coluna de volumes por NF-e (frete cobrado por volume) */
.cte-notas-list .payments-list-head,
.cte-notas-list .payments-list-row { grid-template-columns: 90px minmax(200px, 1fr) 130px 110px minmax(220px, 300px); }
.cte-volumes { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; min-width: 0; font-weight: 800; color: var(--text-strong); }
.cte-volumes b { font-size: 16px; }
.cte-volumes small { font-size: 11px; font-weight: 700; color: var(--muted, #64748b); }
.cte-acao-gerado { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* Gerar CT-e da viagem: modal mais largo para caber a coluna de volumes e o formulario de frete sem quebrar linha */
.cte-modal-card { width: min(1180px, 96vw); max-height: 92vh; overflow-y: auto; }
.cte-notas-list .payments-list-head,
.cte-notas-list .payments-list-row { grid-template-columns: 90px minmax(200px, 1fr) 120px 110px minmax(380px, 440px); }
.cte-notas-list .payments-list-row form { flex-wrap: nowrap; }
@media (max-width: 1100px) {
    .cte-notas-list .payments-list-head,
    .cte-notas-list .payments-list-row { grid-template-columns: 80px minmax(160px, 1fr) 110px 100px minmax(300px, 380px); }
    .cte-notas-list .payments-list-row form { flex-wrap: wrap; }
}

/* Relatorio Contas a Receber: filtros de marcador e vendedor na mesma linha, alinhados */
.dashboard:has(.fiscal-report-form) .fiscal-report-filters-row.rcr-report-filters-row {
    grid-template-columns: minmax(160px, 1.2fr) repeat(2, minmax(140px, 170px)) repeat(2, minmax(140px, 200px)) minmax(120px, 160px);
}
@media (max-width: 1100px) {
    .dashboard:has(.fiscal-report-form) .fiscal-report-filters-row.rcr-report-filters-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .dashboard:has(.fiscal-report-form) .fiscal-report-filters-row.rcr-report-filters-row { grid-template-columns: 1fr 1fr; }
}

/* Relatorio Contas a Receber: filtros em 2 linhas de 3 campos (mesmo topo/altura) e rodape com situacao + botoes */
.dashboard:has(.fiscal-report-form) .fiscal-report-filters-row.rcr-report-filters-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
}
.rcr-report-filters-row > label { min-width: 0; }
.dashboard:has(.fiscal-report-form) .fiscal-report-filters-row.rcr-report-filters-row > label > input,
.dashboard:has(.fiscal-report-form) .fiscal-report-filters-row.rcr-report-filters-row > label > select {
    height: 46px;
    min-height: 46px;
    box-sizing: border-box;
    padding: 0 12px;
    border: 1px solid var(--line-soft, rgba(145, 163, 194, .18));
    border-radius: 10px;
    background-color: var(--input);
    color: var(--text-strong, inherit);
}
.rcr-filtros-rodape { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rcr-filtros-rodape .fiscal-report-types { flex: 1 1 360px; min-width: 0; }
.rcr-filtros-acoes { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.rcr-filtros-acoes .ghost-action, .rcr-filtros-acoes .primary-action { height: 44px; box-sizing: border-box; min-height: 44px; justify-content: center; }
@media (max-width: 760px) {
    .dashboard:has(.fiscal-report-form) .fiscal-report-filters-row.rcr-report-filters-row { grid-template-columns: 1fr 1fr; }
    .rcr-filtros-acoes { width: 100%; }
    .rcr-filtros-acoes > * { flex: 1 1 0; }
}
@media (max-width: 480px) {
    .dashboard:has(.fiscal-report-form) .fiscal-report-filters-row.rcr-report-filters-row { grid-template-columns: 1fr; }
}

/* MARCADORES: janela de marcadores (aplicar, criar, excluir) */
.marcadores-card { width: min(560px, 94vw); max-height: 92vh; overflow-y: auto; }
.marcadores-modal [hidden] { display: none !important; }
.marcadores-secao { display: grid; gap: 10px; margin: 14px 0 6px; }
.marcadores-secao h3 { margin: 0; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #64748b); }
.marcadores-lista { display: flex; flex-wrap: wrap; gap: 8px; max-height: 36vh; overflow-y: auto; padding: 2px; }
.marcadores-item { display: inline-flex; align-items: stretch; border: 1px solid var(--line-soft); border-radius: 999px; background: var(--panel); overflow: hidden; }
.marcadores-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px 0 10px; border: 0; background: transparent; color: var(--text-strong); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.marcadores-chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--marcador-cor, #64748b); flex: 0 0 auto; }
.marcadores-check { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; border: 1px solid var(--line-soft); font-size: 11px; line-height: 1; flex: 0 0 auto; }
.marcadores-item.is-aplicado { border-color: color-mix(in srgb, var(--marcador-cor, #2563eb) 60%, transparent); background: color-mix(in srgb, #2563eb 12%, var(--panel)); }
.marcadores-item.is-aplicado .marcadores-check { background: var(--brand, #2563eb); border-color: var(--brand, #2563eb); color: #fff; }
.marcadores-excluir { display: inline-grid; place-items: center; width: 36px; border: 0; border-left: 1px solid var(--line-soft); background: transparent; color: var(--muted, #64748b); font-size: 14px; cursor: pointer; }
.marcadores-excluir:hover, .marcadores-excluir:focus-visible { color: #dc2626; background: color-mix(in srgb, #dc2626 10%, transparent); }
.marcadores-chip:focus-visible, .marcadores-excluir:focus-visible, .marcadores-cor:focus-visible { outline: 2px solid color-mix(in srgb, var(--brand, #2563eb) 55%, transparent); outline-offset: 2px; }
.marcadores-vazio { margin: 4px 0; font-size: 13px; font-weight: 600; color: var(--muted, #64748b); }
.marcadores-novo { display: grid; gap: 12px; }
.marcadores-novo label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 800; color: var(--text-strong); }
.marcadores-novo input { height: 46px; box-sizing: border-box; width: 100%; }
.marcadores-cores { display: flex; flex-wrap: wrap; gap: 8px; }
.marcadores-cor { width: 28px; height: 28px; border-radius: 50%; border: 2px solid transparent; background: var(--cor); cursor: pointer; padding: 0; }
.marcadores-cor.is-ativa { border-color: var(--text-strong); box-shadow: 0 0 0 2px var(--panel) inset; }
.marcadores-novo .primary-action { height: 44px; justify-content: center; }
.marcadores-acoes { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Cabecalho de listas com busca + botoes (Produtos e Servicos, Clientes etc.): em telas medias a busca era esmagada
   ate sobrar so a lupa e o ultimo botao saia da tela. Agora a busca nunca fica menor que 220px e a linha quebra
   para baixo do titulo quando nao cabe tudo. Pedidos/documentos (pedidos-compacto) mantem as regras proprias. */
.dashboard:has(.contacts-card):not(.dashboard-home) .dash-main:not(.pedidos-compacto) .page-top:has(> .list-actions .search-input) {
    flex-wrap: wrap;
    row-gap: 14px;
}
.dashboard:has(.contacts-card):not(.dashboard-home) .dash-main:not(.pedidos-compacto) .page-top > .list-actions:has(.search-input) {
    flex: 1 1 650px;
    flex-wrap: wrap;
    justify-content: flex-end;
    row-gap: 10px;
    white-space: normal;
}
.dashboard:has(.contacts-card):not(.dashboard-home) .dash-main:not(.pedidos-compacto) .page-top > .list-actions .search-input {
    flex: 1 1 220px;
    min-width: 220px;
    max-width: 380px;
    width: auto;
}
.dashboard:has(.contacts-card):not(.dashboard-home) .dash-main:not(.pedidos-compacto) .page-top > .list-actions > .ghost-action,
.dashboard:has(.contacts-card):not(.dashboard-home) .dash-main:not(.pedidos-compacto) .page-top > .list-actions > .primary-action,
.dashboard:has(.contacts-card):not(.dashboard-home) .dash-main:not(.pedidos-compacto) .page-top > .list-actions .action-cell--inline { flex: 0 0 auto; white-space: nowrap; }
@media (max-width: 768px) {
    .dashboard:has(.contacts-card):not(.dashboard-home) .dash-main:not(.pedidos-compacto) .page-top > .list-actions .search-input { max-width: none; flex-basis: 100%; }
}

/* Contas a Receber: as duas datas do periodo ficam juntas (nao quebram em linhas separadas quando a barra de filtros enche) */
.periodo-grupo { display: flex; align-items: flex-end; gap: 12px; flex: 0 0 auto; }

/* CFT: barra de filtros de Contas a Receber no padrao do Tiny */
.cft-barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px; }
.cft-busca { position: relative; display: flex; align-items: center; flex: 1 1 240px; min-width: 200px; max-width: 320px; height: 42px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--input); }
.cft-busca input { flex: 1 1 auto; min-width: 0; height: 100%; padding: 0 42px 0 14px; border: 0; background: transparent; color: var(--text-strong); font: inherit; font-size: 13.5px; text-overflow: ellipsis; outline: 0; box-shadow: none; }
.cft-busca:focus-within { outline: 2px solid color-mix(in srgb, var(--brand, #2563eb) 45%, transparent); outline-offset: 1px; }
.cft-busca button { position: absolute; right: 3px; top: 3px; width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted, #64748b); cursor: pointer; display: grid; place-items: center; }
.cft-busca button:hover, .cft-busca button:focus-visible { color: var(--text-strong); background: color-mix(in srgb, var(--brand, #2563eb) 12%, transparent); }
.cft-grupo { position: relative; }
.cft-chip { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px; border: 1px solid var(--line-soft); border-radius: 999px; background: var(--panel); color: var(--text-strong); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.cft-chip b { font-weight: 800; }
.cft-chip:hover, .cft-chip:focus-visible, .cft-chip[aria-expanded="true"] { border-color: var(--brand, #2563eb); outline: 0; }
.cft-chip.is-ativo { border-color: var(--brand, #2563eb); background: color-mix(in srgb, var(--brand, #2563eb) 14%, var(--panel)); }
.cft-chip-filtros { color: var(--brand, #2563eb); }
.cft-limpar { display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 4px; color: var(--text-strong); font-size: 13px; font-weight: 600; text-decoration: none; }
.cft-limpar:hover, .cft-limpar:focus-visible { text-decoration: underline; }
.cft-pop { position: absolute; z-index: 60; top: calc(100% + 8px); left: 0; min-width: 230px; max-height: 60vh; overflow-y: auto; padding: 10px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 44px rgba(2, 8, 23, .35); display: grid; gap: 4px; }
.cft-pop[hidden] { display: none !important; }
.cft-pop-titulo { margin: 2px 6px 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #64748b); }
.cft-opcao { display: block; width: 100%; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--text-strong); font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; }
.cft-opcao:hover, .cft-opcao:focus-visible { background: color-mix(in srgb, var(--brand, #2563eb) 12%, transparent); outline: 0; }
.cft-opcao.is-marcada { background: color-mix(in srgb, var(--brand, #2563eb) 20%, transparent); font-weight: 800; }
.cft-pop-periodo { min-width: 280px; }
.cft-atalhos { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.cft-datas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 4px 4px; }
.cft-datas label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 800; color: var(--text-strong); }
.cft-datas input { height: 42px; box-sizing: border-box; width: 100%; }
.cft-aplicar { height: 42px; margin: 6px 4px 2px; justify-content: center; }
@media (max-width: 640px) { .cft-busca { max-width: none; flex-basis: 100%; } .cft-pop { position: fixed; left: 12px; right: 12px; top: auto; bottom: 12px; max-height: 70vh; } }

/* CFT: painel "filtros" (categoria, forma, marcador, vendedor) no padrao do Tiny */
.cft-pop-filtros { min-width: 320px; gap: 12px; padding: 16px; left: auto; right: 0; }
.cft-campo { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--text-strong); }
.cft-campo select { height: 46px; box-sizing: border-box; width: 100%; padding: 0 12px; border: 1px solid var(--line-soft, rgba(145, 163, 194, .18)); border-radius: 10px; background-color: var(--input); color: var(--text-strong); font: inherit; font-size: 14px; }
.cft-pop-acoes { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.cft-pop-acoes .cft-aplicar { height: 44px; margin: 0; padding: 0 26px; border-radius: 999px; justify-content: center; }
.cft-cancelar { padding: 0; border: 0; background: none; color: var(--text-strong); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.cft-cancelar:hover, .cft-cancelar:focus-visible { text-decoration: underline; }

/* LANCAR_CONTAS_COMPRA: janela de categoria ao lancar contas a pagar da NF-e de compra */
.lcc-card { width: min(520px, 94vw); }
.lcc-modal [hidden] { display: none !important; }
.lcc-resumo { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto; gap: 14px; padding: 14px 0 8px; }
.lcc-resumo > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lcc-resumo small, .lcc-campo small { font-size: 11px; font-weight: 700; color: var(--muted, #64748b); }
.lcc-resumo small { text-transform: uppercase; letter-spacing: .04em; }
.lcc-resumo strong { font-size: 14px; color: var(--text-strong); overflow-wrap: anywhere; }
.lcc-campo { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 800; color: var(--text-strong); }
.lcc-campo select { height: 46px; box-sizing: border-box; width: 100%; padding: 0 12px; border: 1px solid var(--line-soft, rgba(145, 163, 194, .18)); border-radius: 10px; background-color: var(--input); color: var(--text-strong); font: inherit; font-size: 14px; }
.lcc-nova { margin-top: 10px; display: grid; gap: 8px; }
.lcc-link { justify-self: start; padding: 0; border: 0; background: none; color: var(--brand, #2563eb); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; text-decoration: underline; }
.lcc-nova-campos { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.lcc-nova-campos input { height: 44px; box-sizing: border-box; width: 100%; }
.lcc-nova-campos .ghost-action { height: 44px; }
.lcc-acoes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px; margin-top: 16px; }
.lcc-acoes .cancel-action, .lcc-acoes .primary-action { width: 100%; min-height: 45px; justify-content: center; }

.lcc-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.lcc-link-excluir { color: #dc2626; }
.nfe-email-boleto { margin-top: 4px; }

.nfe-email-ajuda { font-weight: 600; color: var(--muted, #64748b); }
.nfe-email-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.nfe-email-chips:empty { display: none; }
.nfe-email-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 4px 4px 10px; border: 1px solid var(--line-soft); border-radius: 999px; background: color-mix(in srgb, var(--brand, #2563eb) 10%, var(--panel)); color: var(--text-strong); font-size: 12.5px; font-weight: 600; overflow-wrap: anywhere; }
.nfe-email-chip.is-invalido { border-color: #dc2626; background: color-mix(in srgb, #dc2626 12%, var(--panel)); color: #dc2626; }
.nfe-email-chip button { display: inline-grid; place-items: center; width: 20px; height: 20px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; }
.nfe-email-chip button:hover, .nfe-email-chip button:focus-visible { background: color-mix(in srgb, #dc2626 20%, transparent); outline: 0; }

/* EMAIL_STATUS: icone de e-mail enviado nas listas e janela de resumo */
.doc-status-com-icones { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.email-status-icone { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border: 1px solid transparent; border-radius: 50%; cursor: pointer; vertical-align: middle; margin-left: 6px; background: color-mix(in srgb, #64748b 18%, transparent); color: #64748b; }
.doc-status-com-icones .email-status-icone { margin-left: 0; }
.email-status-icone:hover, .email-status-icone:focus-visible { outline: 2px solid color-mix(in srgb, currentColor 45%, transparent); outline-offset: 2px; }
.email-status-icone.is-adiado { background: color-mix(in srgb, #d97706 18%, transparent); color: #d97706; }
.email-status-icone.is-entregue { background: color-mix(in srgb, #2563eb 18%, transparent); color: #2563eb; }
.email-status-icone.is-visualizado { background: color-mix(in srgb, #16a34a 20%, transparent); color: #16a34a; }
.email-status-icone.is-falha { background: color-mix(in srgb, #dc2626 18%, transparent); color: #dc2626; }
.email-status-card { width: min(520px, 94vw); max-height: 90vh; overflow-y: auto; }
.email-status-modal [hidden] { display: none !important; }
.email-status-lista { display: grid; gap: 14px; margin: 12px 0 4px; }
.email-status-envio { padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel-soft, rgba(148, 163, 184, .06)); display: grid; gap: 10px; }
.email-status-envio > header { display: flex; flex-direction: column; gap: 2px; }
.email-status-envio > header strong { font-size: 14px; color: var(--text-strong); }
.email-status-envio > header small, .email-status-passos small { font-size: 12px; font-weight: 600; color: var(--muted, #64748b); }
.email-status-passos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.email-status-passos li { display: flex; align-items: flex-start; gap: 10px; }
.email-status-passos li > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.email-status-passos strong { font-size: 13.5px; color: var(--text-strong); }
.email-status-passos i { flex: 0 0 14px; width: 14px; height: 14px; margin-top: 3px; border-radius: 50%; border: 2px solid var(--muted, #94a3b8); box-sizing: border-box; }
.email-status-passos .is-feito i { background: #2563eb; border-color: #2563eb; }
.email-status-passos .is-visto i { background: #16a34a; border-color: #16a34a; }
.email-status-passos .is-falha i { background: #dc2626; border-color: #dc2626; }
.email-status-passos .is-pendente strong { color: var(--muted, #64748b); font-weight: 600; }
.email-status-destinos { list-style: none; margin: 0; padding: 8px 0 0; border-top: 1px solid var(--line-soft); display: grid; gap: 5px; }
.email-status-destinos li { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--text-strong); overflow-wrap: anywhere; }
.email-status-destinos em { font-style: normal; font-weight: 800; white-space: nowrap; color: var(--muted, #64748b); }
.email-status-destinos em.is-entregue { color: #2563eb; }
.email-status-destinos em.is-falha { color: #dc2626; }
.email-status-destinos em.is-adiado { color: #d97706; }
.email-status-vazio { margin: 6px 0; font-size: 13px; font-weight: 600; color: var(--muted, #64748b); }
.email-status-rodape { display: flex; justify-content: flex-end; margin-top: 12px; }

/* Icone de e-mail enviado: circulo discreto, mesmo tamanho nas listas, alinhado ao centro da linha do status/documento */
.fiscal-linha-email { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; }
.contacts-row .email-status-icone, .email-status-icone {
    flex: 0 0 auto; display: inline-grid; place-items: center; box-sizing: border-box; width: 26px; height: 26px; min-width: 0; min-height: 0; margin: 0; padding: 0;
    border: 1px solid color-mix(in srgb, var(--email-cor, #64748b) 38%, transparent); border-radius: 50%; box-shadow: none; appearance: none; -webkit-appearance: none;
    background: color-mix(in srgb, var(--email-cor, #64748b) 14%, transparent); color: var(--email-cor, #64748b); cursor: pointer; line-height: 0; vertical-align: middle;
    transition: transform .12s ease, background-color .12s ease;
}
.email-status-icone svg { display: block; width: 14px; height: 14px; }
.email-status-icone:hover { transform: scale(1.1); background: color-mix(in srgb, var(--email-cor, #64748b) 24%, transparent); }
.email-status-icone:focus-visible { outline: 2px solid color-mix(in srgb, var(--email-cor, #64748b) 55%, transparent); outline-offset: 2px; }
.email-status-icone.is-adiado { --email-cor: #d97706; }
.email-status-icone.is-entregue { --email-cor: #2563eb; }
.email-status-icone.is-visualizado { --email-cor: #16a34a; }
.email-status-icone.is-falha { --email-cor: #dc2626; }

.email-status-tecnico { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 500; color: var(--muted, #64748b); overflow-wrap: anywhere; opacity: .85; }

/* Pedidos: o icone de e-mail vira um selo no canto do quadro do documento fiscal (nao alarga a coluna nem aperta o Total) */
.fiscal-linha-email { display: inline-block; position: relative; max-width: 100%; }
.fiscal-linha-email .email-status-icone {
    position: absolute; top: -9px; right: -9px; width: 22px; height: 22px;
    background: color-mix(in srgb, var(--email-cor, #64748b) 16%, var(--panel, #fff)); box-shadow: 0 0 0 2px var(--panel, #fff);
}
.fiscal-linha-email .email-status-icone svg { width: 12px; height: 12px; }
.fiscal-linha-email .email-status-icone:hover { transform: scale(1.12); }

/* ENTREGA_CATEGORIA: categoria das contas na janela "Efetuar lancamentos" */
.entrega-categoria { display: grid; gap: 8px; margin: 14px 0 4px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel-soft, rgba(148, 163, 184, .06)); }
.entrega-categoria[hidden], .entrega-categoria [hidden] { display: none !important; }
.entrega-categoria-campo { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 800; color: var(--text-strong); }
.entrega-categoria-campo select { height: 46px; box-sizing: border-box; width: 100%; padding: 0 12px; border: 1px solid var(--line-soft, rgba(145, 163, 194, .18)); border-radius: 10px; background-color: var(--input); color: var(--text-strong); font: inherit; font-size: 14px; }
.entrega-categoria-campo small { font-size: 11px; font-weight: 700; color: var(--muted, #64748b); }
.entrega-categoria-links { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.entrega-link { padding: 0; border: 0; background: none; color: var(--brand, #2563eb); font: inherit; font-size: 13px; font-weight: 800; text-decoration: underline; cursor: pointer; }
.entrega-link.is-excluir { color: #dc2626; }
.entrega-categoria-novos { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.entrega-categoria-novos input { height: 44px; box-sizing: border-box; width: 100%; }
.entrega-categoria-novos .ghost-action { height: 44px; }

/* Formulario do pedido: categoria das contas com "+ Nova" e "Excluir" no cabecalho do campo (nao mexe na altura do select) */
.categoria-conta-campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.categoria-conta-cabecalho { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.categoria-conta-cabecalho label { font-size: inherit; font-weight: inherit; }
.categoria-conta-links { display: inline-flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.categoria-conta-links .entrega-link { font-size: 12px; }
.categoria-conta-campo select { height: 46px; box-sizing: border-box; width: 100%; }
.categoria-conta-campo [hidden] { display: none !important; }

/* Mesmo ritmo dos demais campos da etapa (titulo de 20px + 5px + campo de 46px) */
.categoria-conta-campo { gap: 5px; }
.categoria-conta-cabecalho { height: 20px; align-items: center; }
.categoria-conta-links .entrega-link { height: 20px; min-height: 0; padding: 0; line-height: 20px; font-size: 12px; align-self: center; }
.categoria-conta-titulo { font-size: 12px; font-weight: 800; line-height: 20px; white-space: nowrap; color: inherit; }

/* Receber conta (baixa guiada) */
.rbx-card { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.rbx-resumo { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 1px; background: #e2e8f0; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; margin: 4px 0 16px; }
.rbx-resumo > div { background: #f8fafc; padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rbx-resumo small { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.rbx-resumo strong { font-size: 14px; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rbx-resumo .is-destaque { background: #ecfdf5; }
.rbx-resumo .is-destaque strong { color: #047857; font-size: 16px; }
.rbx-passo { margin-bottom: 16px; }
.rbx-passo h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; color: #1e293b; }
.rbx-passo h3 b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #0f766e; color: #fff; font-size: 12px; }
.rbx-opcoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.rbx-opcao { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-height: 62px; padding: 10px 14px; text-align: left; border: 2px solid #cbd5e1; border-radius: 10px; background: #fff; cursor: pointer; }
.rbx-opcao b { font-size: 15px; color: #0f172a; }
.rbx-opcao small { font-size: 12px; color: #64748b; }
.rbx-opcao.is-on { border-color: #0f766e; background: #f0fdfa; }
.rbx-campo { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 600; color: #334155; }
.rbx-campo input, .rbx-campo select, .rbx-campo textarea, .rbx-passo select, .rbx-data input { width: 100%; box-sizing: border-box; }
.rbx-campo input, .rbx-campo select, .rbx-passo select, .rbx-data input { height: 46px; }
.rbx-campo small { font-weight: 500; color: #64748b; min-height: 16px; }
.rbx-data { display: grid; grid-template-columns: 1fr 190px; gap: 10px; align-items: center; }
.rbx-atalhos { display: flex; gap: 8px; }
.rbx-atalho { flex: 1; height: 46px; border: 2px solid #cbd5e1; border-radius: 10px; background: #fff; font-weight: 600; color: #334155; cursor: pointer; }
.rbx-atalho.is-on { border-color: #0f766e; background: #f0fdfa; color: #0f766e; }
.rbx-duplo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rbx-mais { margin-bottom: 8px; }
.rbx-mais summary { cursor: pointer; font-size: 13px; color: #0f766e; font-weight: 600; }
.rbx-efeito { min-height: 18px; margin: 8px 0; font-size: 13px; color: #047857; }
.rbx-acoes button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 560px) { .rbx-resumo { grid-template-columns: 1fr 1fr; } .rbx-data, .rbx-duplo { grid-template-columns: 1fr; } }
.rbx-card .rbx-passo select, .rbx-card .rbx-campo select { height: 46px; min-height: 46px; }
.rbx-card .rbx-efeito { margin: 4px 0 12px; }
.rbx-campo[hidden] { display: none; }

/* Compras NF-e: importar e atalhos */
.purchase-quick { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.purchase-quick a { padding: 8px 14px; border: 1px solid #cbd5e1; border-radius: 999px; background: #fff; color: #334155; font-size: 13px; font-weight: 600; text-decoration: none; }
.purchase-quick a.is-on { background: #0f766e; border-color: #0f766e; color: #fff; }
.purchase-top-actions .row-actions-menu small { display: block; font-size: 11px; font-weight: 400; color: #64748b; margin-top: 2px; white-space: normal; }
.purchase-import-card { width: min(620px, calc(100vw - 32px)); }
.pimp-tabs { display: flex; gap: 6px; margin: 14px 0 4px; border-bottom: 1px solid #e2e8f0; }
.pimp-tabs button { height: 42px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 600; color: #64748b; cursor: pointer; }
.pimp-tabs button.is-on { color: #0f766e; border-bottom-color: #0f766e; }
.purchase-import-card .pimp-pane { display: grid; gap: 12px; padding-top: 14px; }
.purchase-import-card .pimp-pane[hidden] { display: none; }
.pimp-dica { margin: 0; font-size: 13px; color: #64748b; }
.purchase-import-card .pimp-pane label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; }
.purchase-import-card .pimp-pane input:not([type=file]) { height: 46px; box-sizing: border-box; width: 100%; }
.purchase-import-card .pimp-pane textarea { width: 100%; box-sizing: border-box; }
.purchase-import-card .pimp-pane .primary-action { height: 46px; }
.purchase-import-card .pimp-pane .primary-action:disabled { opacity: .5; cursor: not-allowed; }
.pimp-pane small { font-weight: 500; color: #64748b; }
.pimp-pane small.is-ok { color: #047857; }
.pimp-arquivo { align-content: center; justify-items: center; gap: 4px; min-height: 120px; border: 2px dashed #cbd5e1; border-radius: 12px; cursor: pointer; text-align: center; }
.pimp-arquivo input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pimp-arquivo b { color: #0f766e; font-size: 15px; }
.pimp-arquivo span { font-weight: 500; color: #64748b; }

/* Compras NF-e: busca automatica e NSU */
.psm-card { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; }
.psm-card form { display: block; padding: 0; gap: 0; }
.psm-status { display: flex; align-items: center; gap: 12px; margin: 14px 0; padding: 12px 14px; border-radius: 10px; border: 1px solid #fecaca; background: #fef2f2; }
.psm-status.is-on { border-color: #a7f3d0; background: #ecfdf5; }
.psm-status > i { width: 12px; height: 12px; border-radius: 50%; background: #dc2626; flex: none; }
.psm-status.is-on > i { background: #059669; }
.psm-status > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.psm-status strong { font-size: 15px; color: #0f172a; }
.psm-status span { font-size: 13px; color: #475569; }
.psm-status form { margin: 0; }
.psm-status .ghost-action { height: 38px; }
.psm-fatos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #e2e8f0; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; margin-bottom: 14px; }
.psm-fatos-4 { grid-template-columns: repeat(4, 1fr); }
.psm-fatos > div { background: #f8fafc; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.psm-fatos small { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.psm-fatos strong { font-size: 14px; color: #0f172a; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psm-card .psm-agora { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 14px; }
.psm-agora > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.psm-agora strong { font-size: 14px; color: #0f172a; }
.psm-agora span { font-size: 13px; color: #64748b; }
.psm-agora .primary-action { height: 46px; padding: 0 22px; flex: none; }
.psm-nsu label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; margin-top: 6px; }
.psm-nsu input { height: 46px; box-sizing: border-box; width: 100%; }
.psm-nsu { align-items: flex-end !important; }
.psm-config { padding: 14px; border: 1px solid #e2e8f0; border-radius: 10px; margin-bottom: 14px; }
.psm-config h3 { margin: 0 0 10px; font-size: 14px; color: #0f172a; }
.psm-dica { margin: -4px 0 12px; font-size: 13px; color: #64748b; }
.psm-opcao { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 10px; padding: 10px 0; cursor: pointer; }
.psm-opcao input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.psm-opcao span { display: flex; flex-direction: column; gap: 2px; }
.psm-opcao b { font-size: 14px; color: #0f172a; }
.psm-opcao small { font-size: 12px; color: #64748b; font-weight: 400; }
.psm-intervalo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 14px; font-weight: 600; color: #0f172a; }
.psm-intervalo span { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: #475569; }
.psm-intervalo input { width: 90px; height: 46px; box-sizing: border-box; text-align: center; }
.psm-avancado { margin: 4px 0 12px; }
.psm-avancado summary, .psm-log summary { cursor: pointer; font-size: 13px; font-weight: 600; color: #0f766e; }
.psm-avancado label { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; font-size: 13px; font-weight: 600; color: #334155; }
.psm-avancado input { height: 46px; box-sizing: border-box; width: 100%; }
.psm-avancado small { font-weight: 400; color: #64748b; }
.psm-config > .primary-action { width: 100%; height: 46px; margin-top: 6px; }
.psm-campos { display: grid !important; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-bottom: 12px; }
.psm-campos label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; }
.psm-campos input { height: 46px; box-sizing: border-box; width: 100%; }
.psm-campos .secondary-action { height: 46px; }
.psm-botoes { display: flex; gap: 10px; }
.psm-botoes form { flex: 1; }
.psm-botoes button { width: 100%; height: 46px; }
.psm-msg { margin: 0 0 12px; font-size: 13px; color: #475569; }
.psm-log { margin-bottom: 4px; }
.psm-log .purchase-search-log { margin-top: 8px; }
@media (max-width: 560px) { .psm-fatos, .psm-fatos-4, .psm-campos { grid-template-columns: 1fr 1fr; } .psm-agora { flex-direction: column; align-items: stretch !important; } }
.psm-card form.psm-config { padding: 14px; }
.psm-card form.psm-campos { gap: 12px; }
.psm-card form.psm-agora { gap: 16px; padding: 14px; }

/* Compras NF-e: linhas da lista */
.purchase-table .contacts-head, .purchase-table .contacts-row { grid-template-columns: minmax(170px, 1fr) minmax(220px, 1.4fr) 110px 120px minmax(230px, 1.3fr) 70px; align-items: center; }
.purchase-table .contacts-row > div, .purchase-table .contacts-row > strong { min-width: 0; }
.pl-doc, .pl-forn, .pl-data { display: flex; flex-direction: column; gap: 3px; }
.pl-doc strong { font-size: 14px; color: #0f172a; }
.pl-doc strong em { font-style: normal; font-weight: 500; font-size: 12px; color: #64748b; margin-left: 4px; }
.pl-doc small, .pl-forn small, .pl-data small { font-size: 12px; color: #64748b; }
.pl-forn strong { font-size: 14px; color: #0f172a; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pl-forn small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-data strong { font-size: 14px; font-weight: 600; }
.pl-total { font-size: 15px; color: #0f172a; font-variant-numeric: tabular-nums; }
.pl-status { display: flex; flex-wrap: wrap; gap: 5px; }
.pl-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11px; font-weight: 700; font-style: normal; white-space: nowrap; background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }
.pl-chip.is-ok, .pl-chip.is-status-pago { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pl-chip.is-pend, .pl-chip.is-status-pendente { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.pl-chip.is-aviso { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.pl-chip.is-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.pl-chip.is-status-vencido { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.pl-chip.is-neutro, .pl-chip.is-status-cancelado { background: #f1f5f9; color: #64748b; }
.purchase-table .contacts-row { padding-top: 12px; padding-bottom: 12px; min-height: 72px; }

/* Lancar estoque (compra NF-e) */
.settle-modal-card.purchase-stock-modal-card { width: min(860px, calc(100vw - 24px)); max-width: min(860px, calc(100vw - 24px)); }
.modal-viagem-form { display: grid; gap: 18px; }
.modal-viagem-step { display: grid; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.modal-viagem-step-head { display: flex; align-items: flex-start; gap: 10px; }
.modal-viagem-step-head > b { display: inline-grid; place-items: center; flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 12px; }
.modal-viagem-step-head > div { min-width: 0; }
.modal-viagem-step-head h3 { margin: 1px 0 3px; color: var(--text-strong); font-size: 15px; font-weight: 850; }
.modal-viagem-step-head p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
.modal-viagem-notas-count { margin-left: auto; padding: 5px 9px; border: 1px solid color-mix(in srgb, var(--brand) 35%, var(--line-soft)); border-radius: 999px; color: var(--brand); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.modal-viagem-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; }
.modal-viagem-grid label, .modal-viagem-keys, .modal-viagem-observacoes { display: grid; gap: 7px; color: var(--text-strong); font-size: 13px; font-weight: 800; }
.modal-viagem-grid select, .modal-viagem-keys textarea, .modal-viagem-observacoes textarea, .modal-viagem-note-filters select { width: 100%; border: 1px solid var(--line-soft); border-radius: 6px; background: var(--input); color: var(--text-strong); font: inherit; font-weight: 650; outline: 0; }
.modal-viagem-grid select, .modal-viagem-note-filters select { min-height: 42px; padding: 0 10px; }
.modal-viagem-grid select[multiple] { height: 116px; padding: 5px; }
.modal-viagem-span-6 { grid-column: span 6; }
.modal-viagem-span-12 { grid-column: 1 / -1; }
.modal-viagem-motoristas { display: grid; gap: 9px; }
.modal-viagem-field-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text-strong); font-size: 13px; font-weight: 800; }
.modal-viagem-field-head strong { color: var(--brand); font-size: 12px; font-variant-numeric: tabular-nums; }
.modal-viagem-motoristas > .search-input { width: auto; }
.modal-viagem-motoristas-list { display: grid; grid-template-columns: 1fr; max-height: 190px; overflow-y: auto; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.modal-viagem-grid .modal-viagem-motorista { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 10px; min-width: 0; padding: 11px 8px; border-bottom: 1px solid var(--line-soft); color: var(--text-strong); cursor: pointer; }
.modal-viagem-grid .modal-viagem-motorista:last-of-type { border-bottom: 0; }
.modal-viagem-grid .modal-viagem-motorista:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.modal-viagem-grid .modal-viagem-motorista:has(input:checked) { background: color-mix(in srgb, var(--brand) 10%, transparent); box-shadow: inset 3px 0 0 var(--brand); }
.modal-viagem-grid .modal-viagem-motorista input { width: 17px; min-height: 0; height: 17px; margin: 0; padding: 0; accent-color: var(--brand); }
.modal-viagem-grid .modal-viagem-motorista span { display: flex; align-items: baseline; min-width: 0; gap: 8px; }
.modal-viagem-grid .modal-viagem-motorista strong { overflow: hidden; color: var(--text-strong); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.modal-viagem-grid .modal-viagem-motorista small { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.modal-viagem-note-filters { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 10px; }
.modal-viagem-note-filters .search-input { width: auto; min-width: 0; }
.modal-viagem-notas-system { display: grid; gap: 10px; }
.modal-viagem-notas-system[hidden] { display: none; }
.modal-viagem-expand-link { justify-self: start; padding: 0; border: 0; background: transparent; color: var(--brand); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.modal-viagem-expand-link:hover { color: var(--brand-strong); }
.modal-viagem-cargo-notes { display: grid; gap: 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.modal-viagem-cargo-notes > strong { padding: 10px 4px 2px; color: var(--text-strong); font-size: 13px; }
.modal-viagem-cargo-notes > p { margin: 0; padding: 0 4px 9px; color: var(--muted); font-size: 11px; font-weight: 600; }
.modal-viagem-cargo-note { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line-soft); cursor: pointer; }
.modal-viagem-cargo-note:has(input:checked) { background: color-mix(in srgb, var(--brand) 8%, transparent); box-shadow: inset 3px 0 0 var(--brand); }
.modal-viagem-cargo-note input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.modal-viagem-notas-list { max-height: 270px; overflow-y: auto; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.modal-viagem-nota { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 11px 4px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.modal-viagem-nota:last-of-type { border-bottom: 0; }
.modal-viagem-nota:hover { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.modal-viagem-nota.is-disabled { opacity: .55; cursor: not-allowed; }
.modal-viagem-nota input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.modal-viagem-nota-main { display: grid; min-width: 0; gap: 2px; }
.modal-viagem-nota-main strong { color: var(--text-strong); font-size: 13px; overflow-wrap: anywhere; }
.modal-viagem-nota-main small, .modal-viagem-nota-value small { color: var(--muted); font-size: 11px; font-weight: 600; }
.modal-viagem-nota-key { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.modal-viagem-nota-value { display: grid; justify-items: end; gap: 2px; color: var(--text-strong); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.modal-viagem-empty-filter { margin: 0; padding: 18px 4px; color: var(--muted); font-size: 13px; text-align: center; }
.modal-viagem-external-notes { display: grid; gap: 7px; padding-top: 2px; color: var(--text-strong); font-size: 13px; }
.modal-viagem-external-notes > label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; font-weight: 650; overflow-wrap: anywhere; }
.modal-viagem-keys textarea, .modal-viagem-observacoes textarea { min-height: 78px; padding: 10px; resize: vertical; }
.modal-viagem-keys-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-viagem-keys-actions small { color: var(--muted); font-size: 11px; font-weight: 600; }
.modal-viagem-keys-actions .secondary-action { flex: 0 0 auto; min-height: 36px; }
.modal-viagem-keys-status { margin: 0; color: var(--success); font-size: 12px; font-weight: 700; }
.modal-viagem-keys-status.is-error { color: var(--danger); }
.modal-viagem-imported-notes { display: grid; gap: 0; border-top: 1px solid var(--line-soft); }
.modal-viagem-imported-note { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 9px; padding: 9px 4px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.modal-viagem-imported-note input { width: 17px; height: 17px; margin: 0; accent-color: var(--brand); }
.modal-viagem-imported-note span { display: grid; gap: 2px; min-width: 0; }
.modal-viagem-imported-note strong { color: var(--text-strong); font-size: 13px; }
.modal-viagem-imported-note small { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.modal-viagem-actions { position: sticky; bottom: -20px; z-index: 2; justify-content: flex-end; margin: 0; padding: 14px 0 0; background: var(--panel); }
@media (max-width: 680px) { .modal-viagem-span-6 { grid-column: 1 / -1; } .modal-viagem-note-filters { grid-template-columns: 1fr; } .modal-viagem-keys-actions { align-items: flex-start; flex-direction: column; } .modal-viagem-grid .modal-viagem-motorista span { display: grid; gap: 2px; } .modal-viagem-notas-count { align-self: center; } .modal-viagem-step-head { flex-wrap: wrap; } .modal-viagem-nota { grid-template-columns: auto minmax(0, 1fr); } .modal-viagem-nota-value { grid-column: 2; justify-items: start; } }
.pse-form { display: block; }
.pse-resumo { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 14px; margin: 12px 0 16px; border-radius: 10px; background: #f0fdfa; border: 1px solid #99f6e4; }
.pse-resumo > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pse-resumo strong { font-size: 14px; color: #0f172a; }
.pse-resumo span { font-size: 13px; color: #475569; }
.pse-resumo b { font-size: 18px; color: #0f766e; white-space: nowrap; }
.pse-bloco { margin-bottom: 18px; }
.pse-bloco h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15px; color: #1e293b; }
.pse-bloco h3 b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #0f766e; color: #fff; font-size: 12px; }
.pse-dica { margin: 0 0 10px; font-size: 13px; color: #64748b; }
.pse-itens { display: grid; gap: 10px; }
.pse-item { display: grid; grid-template-columns: minmax(200px, .9fr) minmax(280px, 1.4fr); gap: 14px; padding: 12px; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; border-left: 4px solid #0f766e; }
.pse-item[data-modo="novo"] { border-left-color: #f59e0b; }
.pse-nota { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pse-nota small { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.pse-nota strong { font-size: 14px; color: #0f172a; overflow-wrap: anywhere; }
.pse-nota span { font-size: 12px; color: #64748b; }
.pse-destino { display: grid; gap: 8px; min-width: 0; }
.pse-escolhas, .pse-custos { display: grid; gap: 6px; }
.pse-custos { grid-template-columns: repeat(3, 1fr); }
.pse-escolha { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 9px; padding: 8px 10px; margin: 0; border: 1.5px solid #e2e8f0; border-radius: 9px; cursor: pointer; background: #fff; }
.pse-escolha:has(input:checked) { border-color: #0f766e; background: #f0fdfa; }
.pse-escolha input { margin-top: 3px; flex: none; }
.pse-escolha span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pse-escolha b { font-size: 13px; color: #0f172a; }
.pse-escolha b em { font-style: normal; font-size: 10px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #0f766e; color: #fff; text-transform: uppercase; }
.pse-escolha small { font-size: 12px; font-weight: 400; color: #64748b; overflow-wrap: anywhere; }
.pse-produto { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 700; color: #334155; }
.pse-produto[hidden] { display: none; }
.pse-produto select { height: 46px; width: 100%; box-sizing: border-box; }
.pse-rodape { position: sticky; bottom: -1px; display: flex; justify-content: flex-end; gap: 10px; padding: 12px 0 2px; background: #fff; border-top: 1px solid #e2e8f0; }
.pse-rodape button { height: 46px; padding: 0 20px; }
@media (max-width: 700px) { .pse-item, .pse-custos { grid-template-columns: 1fr; } }
.pse-form .pse-escolha input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 2px 0 0; flex: none; appearance: auto; }
.lcc-card { width: min(560px, 94vw); }
.lcc-passo { margin-top: 10px; }
.lcc-passo h3, .lcc-titulo { display: flex; align-items: center; gap: 8px; margin: 14px 0 8px; font-size: 14px; color: var(--text-strong); }
.lcc-passo h3 b, .lcc-titulo b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #0f766e; color: #fff; font-size: 12px; }
.lcc-parcelas { border: 1px solid var(--line-soft, #e2e8f0); border-radius: 10px; overflow: hidden; max-height: 190px; overflow-y: auto; }
.lcc-parcelas > div { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; font-size: 13px; color: var(--muted, #64748b); }
.lcc-parcelas > div + div { border-top: 1px solid var(--line-soft, #e2e8f0); }
.lcc-parcelas strong { color: var(--text-strong); font-variant-numeric: tabular-nums; }
.lcc-fornecedor-nota { margin: 8px 0 0; font-size: 12px; color: var(--muted, #64748b); }
.pse-combo { position: relative; }
.pse-combo input { height: 46px; width: 100%; box-sizing: border-box; }
.pse-combo-lista { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; max-height: 240px; overflow-y: auto; margin: 0; padding: 4px; list-style: none; background: #fff; border: 1px solid #cbd5e1; border-radius: 10px; box-shadow: 0 10px 24px rgba(15, 23, 42, .18); }
.pse-combo-lista li { padding: 9px 10px; border-radius: 7px; font-size: 13px; color: #0f172a; cursor: pointer; }
.pse-combo-lista li.is-on, .pse-combo-lista li[data-i]:hover { background: #f0fdfa; color: #0f766e; }
.pse-combo-lista li.pse-combo-mais { color: #64748b; cursor: default; font-size: 12px; }
.pse-combo-lista[hidden] { display: none; }

/* Manifestacao do destinatario */
.pmf-situacao { display: flex; padding: 12px 14px; margin: 12px 0 8px; border-radius: 10px; border: 1px solid #e2e8f0; background: #f8fafc; }
.pmf-situacao.is-ok { background: #ecfdf5; border-color: #a7f3d0; }
.pmf-situacao.is-erro { background: #fef2f2; border-color: #fecaca; }
.pmf-situacao > div { display: flex; flex-direction: column; gap: 3px; }
.pmf-situacao strong { font-size: 14px; color: #0f172a; }
.pmf-situacao span { font-size: 13px; color: #475569; }
.pmf-dica { margin: 0 0 12px; font-size: 13px; color: #64748b; }
.pmf-lista { display: grid; gap: 10px; }
.purchase-manifest-form.pmf-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1.5px solid #e2e8f0; border-radius: 10px; background: #fff; }
.pmf-card.is-feita { background: #f8fafc; opacity: .8; }
.pmf-texto { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.pmf-texto strong { font-size: 14px; color: #0f172a; }
.pmf-texto strong em { font-style: normal; font-size: 10px; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #0f766e; color: #fff; text-transform: uppercase; }
.pmf-texto strong em.is-feita { background: #059669; text-transform: none; font-size: 11px; }
.pmf-texto span { font-size: 13px; color: #64748b; }
.pmf-texto textarea { width: 100%; box-sizing: border-box; margin-top: 6px; }
.pmf-card > button { height: 46px; min-width: 120px; flex: none; }
.pmf-card > button:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 600px) { .purchase-manifest-form.pmf-card { flex-direction: column; align-items: stretch; } }

/* Contra NF-e */
.pcn-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin: 12px 0; }
.pcn-topo > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pcn-topo strong { font-size: 16px; color: #0f172a; }
.pcn-topo span { font-size: 13px; color: #64748b; }
.pcn-status { flex: none; font-style: normal; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 999px; background: #fffbeb; color: #b45309; border: 1px solid #fde68a; white-space: nowrap; }
.pcn-status.is-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.pcn-status.is-erro { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.pcn-aviso { padding: 12px 14px; margin: 0 0 14px; border-radius: 10px; background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 13px; line-height: 1.4; }
.pcn-aviso.is-erro { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.pcn-bloco { margin-bottom: 16px; }
.pcn-bloco h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 15px; color: #1e293b; }
.pcn-bloco h3 b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #0f766e; color: #fff; font-size: 12px; }
.pcn-fatos { display: grid; grid-template-columns: 1.6fr 1.2fr 1fr 1fr; gap: 1px; background: #e2e8f0; border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; }
.pcn-fatos > div { background: #f8fafc; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pcn-fatos small { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.pcn-fatos strong { font-size: 13px; color: #0f172a; overflow-wrap: anywhere; }
.pcn-chave { margin-top: 8px; font-size: 13px; }
.pcn-chave summary, .pcn-cancelar summary { cursor: pointer; font-weight: 600; color: #0f766e; }
.pcn-chave span { display: block; margin-top: 6px; padding: 8px 10px; background: #f1f5f9; border-radius: 8px; color: #334155; letter-spacing: .04em; overflow-wrap: anywhere; }
.pcn-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pcn-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: #334155; }
.pcn-form select, .pcn-form input { height: 46px; box-sizing: border-box; width: 100%; }
.pcn-form textarea { width: 100%; box-sizing: border-box; }
.pcn-full { margin-top: 12px; }
.pcn-acoes-doc { display: flex; gap: 10px; margin: 12px 0; }
.pcn-acoes-doc .primary-action { height: 44px; display: inline-flex; align-items: center; padding: 0 18px; text-decoration: none; }
.pcn-pdf .purchase-contra-pdf-frame { width: 100%; }
.pcn-cancelar { margin-top: 8px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 10px; }
.pcn-cancelar .purchase-contra-cancel { margin-top: 10px; }
@media (max-width: 640px) { .pcn-fatos, .pcn-campos { grid-template-columns: 1fr 1fr; } .pcn-topo { flex-direction: column; } }
.purchase-contra-pdf-layout.pcn-pdf { display: block; }
.pcn-pdf .purchase-contra-pdf-frame { display: block; width: 100%; height: 560px; border: 1px solid #e2e8f0; border-radius: 10px; }

/* Detalhes da NF-e de compra */
.pd-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin: 12px 0 8px; }
.pd-titulo { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pd-titulo strong { font-size: 18px; color: #0f172a; }
.pd-titulo strong em { font-style: normal; font-weight: 500; font-size: 13px; color: #64748b; margin-left: 4px; }
.pd-titulo span { font-size: 13px; color: #475569; overflow-wrap: anywhere; }
.pd-total { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex: none; }
.pd-total small { font-size: 11px; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.pd-total strong { font-size: 20px; color: #0f766e; }
.pd-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 4px; }
.pd-emissao { margin-left: auto; font-size: 12px; color: #64748b; }
.pd-abas { display: flex; gap: 6px; margin: 14px 0 0; border-bottom: 1px solid #e2e8f0; }
.pd-abas button { height: 42px; padding: 0 16px; border: 0; border-bottom: 3px solid transparent; background: none; font-weight: 600; color: #64748b; cursor: pointer; }
.pd-abas button.is-on { color: #0f766e; border-bottom-color: #0f766e; }
.pd-acoes { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0; }
.pd-acoes a { height: 44px; display: inline-flex; align-items: center; padding: 0 18px; text-decoration: none; }
.pd [data-pd-painel][hidden] { display: none; }
.pd-frame { display: block; width: 100%; height: 620px; border: 1px solid #e2e8f0; border-radius: 10px; }

/* ESTOQUE_CONFERENCIA: alerta de estoque zerado/negativo/insuficiente antes de lancar a baixa */
.ecf-card { width: min(680px, 94vw); max-height: calc(100vh - 32px); overflow-y: auto; }
.ecf-modal [hidden] { display: none !important; }
.ecf-lista { display: grid; gap: 12px; margin: 14px 0; }
.ecf-item { border: 1px solid #e2e8f0; border-left: 4px solid #dc2626; border-radius: 10px; padding: 12px; background: #fff; }
.ecf-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ecf-topo strong { font-size: 14px; color: #0f172a; overflow-wrap: anywhere; }
.ecf-chip { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.ecf-chip.is-negativo { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.ecf-chip.is-insuficiente { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.ecf-chip.is-zerado { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.ecf-escolhas { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ecf-escolha { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 9px; padding: 9px 11px; margin: 0; border: 1.5px solid #e2e8f0; border-radius: 9px; cursor: pointer; }
.ecf-escolha:has(input:checked) { border-color: #0f766e; background: #f0fdfa; }
.ecf-escolha input[type=radio] { width: 18px; height: 18px; min-height: 0; padding: 0; margin: 2px 0 0; flex: none; appearance: auto; }
.ecf-escolha span { display: flex; flex-direction: column; gap: 1px; }
.ecf-escolha b { font-size: 13px; color: #0f172a; }
.ecf-escolha small { font-size: 12px; font-weight: 400; color: #64748b; }
.ecf-troca { margin-top: 10px; }
.ecf-troca input[type=search] { width: 100%; height: 46px; box-sizing: border-box; }
.ecf-resultados { margin-top: 6px; max-height: 210px; overflow-y: auto; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; padding: 4px; }
.ecf-opcao { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 7px; background: none; text-align: left; font-size: 13px; color: #0f172a; cursor: pointer; }
.ecf-opcao:hover { background: #f0fdfa; }
.ecf-opcao small { color: #64748b; }
.ecf-opcao em { font-style: normal; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ecf-opcao em.is-ok { color: #047857; }
.ecf-opcao em.is-sem { color: #b91c1c; }
.ecf-vazio { margin: 8px; font-size: 13px; color: #64748b; }
.ecf-escolhido { margin-top: 8px; padding: 9px 11px; border-radius: 9px; background: #ecfdf5; border: 1px solid #a7f3d0; font-size: 13px; color: #065f46; }
.ecf-acoes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 10px; margin-top: 14px; }
.ecf-acoes .cancel-action, .ecf-acoes .primary-action { width: 100%; min-height: 46px; justify-content: center; }
@media (max-width: 600px) { .ecf-escolhas { grid-template-columns: 1fr; } }
.pse-achado { margin: 8px 0 0; padding: 7px 10px; border-radius: 8px; font-size: 12px; line-height: 1.4; }
.pse-achado.is-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.pse-achado.is-novo { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.pse-achado.is-aviso { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* Compras NF-e: lista responsiva (a coluna de acoes nunca sai da tela) */
.pl-emissao-curta { display: none; }
@media (max-width: 1500px) {
    .purchase-table .contacts-head, .purchase-table .contacts-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 92px 104px minmax(0, 1.15fr) 56px; gap: 10px; padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 1250px) {
    /* Telas menores: a coluna Emissao sai e a data passa para baixo do numero da nota */
    .purchase-table .contacts-head, .purchase-table .contacts-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 100px minmax(0, 1.1fr) 52px; }
    .purchase-table .contacts-head > :nth-child(3), .purchase-table .contacts-row > :nth-child(3) { display: none; }
    .pl-emissao-curta { display: block; font-size: 12px; color: #64748b; }
}
@media (max-width: 1000px) {
    .purchase-table .contacts-head, .purchase-table .contacts-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 92px 52px; }
    .purchase-table .contacts-head > :nth-child(5), .purchase-table .contacts-row > :nth-child(5) { display: none; }
}
.contacts-table.purchase-table { min-width: 0; }
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table.purchase-table { min-width: 0; }

/* Listas em telas estreitas: o cartao da lista cabe na tela (antes crescia ate o tamanho do conteudo e o excedente era cortado,
   escondendo a coluna de acoes). Se as colunas precisarem de mais largura, as linhas rolam na horizontal e a coluna de acoes
   fica fixa na borda direita, sempre visivel. */
.contacts-card { grid-template-columns: minmax(0, 1fr); }
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table { min-width: 0; overflow: hidden; grid-template-columns: minmax(0, 1fr); }
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table > .contacts-head { min-width: 900px; will-change: transform; }
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table > .contacts-scroll { overflow-x: auto; }
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table > .contacts-scroll > .contacts-row { min-width: 900px; }
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table > .contacts-scroll > .contacts-row > :last-child { position: sticky; right: 0; z-index: 2; background: var(--panel, #fff); box-shadow: -10px 0 10px -10px rgba(15, 23, 42, .2); }
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table > .contacts-scroll > .contacts-row:hover > :last-child { background: color-mix(in srgb, var(--panel, #fff) 92%, #416a9d); }
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table.orders-table:not(.quotes-table) > .contacts-head,
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table.orders-table:not(.quotes-table) > .contacts-scroll > .contacts-row { min-width: 900px; }
/* Status em etiqueta: quebra so entre palavras ("Aguardando / Pagamento"), nunca no meio da palavra, e a coluna tem largura minima para isso */
.orders-table .contacts-row .type-pill { overflow-wrap: normal; word-break: normal; hyphens: none; line-height: 1.25; }
.orders-table:not(.quotes-table) .contacts-head,
.orders-table:not(.quotes-table) .contacts-row { grid-template-columns: minmax(145px, .95fr) minmax(150px, 1.35fr) minmax(104px, .82fr) minmax(165px, 1.2fr) minmax(120px, .9fr) .8fr minmax(150px, 150px); }
.orders-table.quotes-table .contacts-head,
.orders-table.quotes-table .contacts-row { grid-template-columns: minmax(145px, .95fr) minmax(180px, 1.7fr) minmax(104px, .9fr) .82fr minmax(150px, 150px); }
/* Pedidos, Vendas PDV e demais listas de documentos: colunas mais compactas em telas ate 1500px, sem sobrepor nem quebrar o total */
@media (max-width: 1500px) {
    .orders-table:not(.quotes-table) .contacts-head,
    .orders-table:not(.quotes-table) .contacts-row { grid-template-columns: minmax(120px, .9fr) minmax(120px, 1.2fr) 104px minmax(150px, 1.2fr) minmax(104px, .9fr) 88px 118px; gap: 10px; padding-left: 16px; padding-right: 16px; }
    .orders-table:not(.quotes-table) .contacts-row > strong { white-space: nowrap; }
}

/* Menu lateral mais estreito em telas menores (sobra mais largura para as listas) */
@media (min-width: 901px) and (max-width: 1440px) {
    .dashboard, .dashboard:not(.dashboard-home) { grid-template-columns: 232px minmax(0, 1fr); }
    .dashboard:not(.dashboard-home) .sidebar { padding-left: 14px; padding-right: 14px; }
}
@media (min-width: 901px) and (max-width: 1280px) {
    .dashboard, .dashboard:not(.dashboard-home) { grid-template-columns: 208px minmax(0, 1fr); }
    .dashboard:not(.dashboard-home) .sidebar { padding-left: 10px; padding-right: 10px; }
    .dashboard:not(.dashboard-home) .sidebar .nav-button, .dashboard:not(.dashboard-home) .sidebar .submenu a { font-size: 13px; }
}
@media (min-width: 901px) and (max-width: 1150px) {
    .dashboard, .dashboard:not(.dashboard-home) { grid-template-columns: 192px minmax(0, 1fr); }
}

/* Menu em telas estreitas (ate 900px): barra superior com botao de menu e a barra lateral vira uma gaveta */
.mobile-topbar, .sidebar-overlay, .sidebar-close { display: none; }
@media (max-width: 900px) {
    .mobile-topbar { position: sticky; top: 0; z-index: 900; display: flex; align-items: center; gap: 12px; height: 58px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--home-sidebar-bg, var(--panel, #fff)); }
    .mobile-topbar-toggle, .sidebar-close { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--home-nav-text, currentColor); cursor: pointer; }
    .mobile-topbar-toggle:focus-visible, .sidebar-close:focus-visible { outline: 2px solid var(--brand-strong, #38bdf8); outline-offset: 2px; }
    .mobile-topbar-logo { display: flex; align-items: center; min-width: 0; }
    .mobile-topbar .logo-sidebar { width: 138px; max-height: 36px; }
    .sidebar-overlay { display: block; position: fixed; inset: 0; z-index: 1000; background: rgba(2, 6, 23, .55); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility 0s linear .2s; }
    body.is-sidebar-open { overflow: hidden; }
    body.is-sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; transition-delay: 0s; }
    body .dashboard .sidebar { position: fixed; top: 0; bottom: 0; left: 0; z-index: 1001; width: min(320px, 86vw); max-width: none; height: 100dvh; min-height: 0; gap: 8px; padding: 14px 14px max(10px, env(safe-area-inset-bottom)); overflow: hidden; border: 0; border-right: 1px solid var(--line); box-shadow: 0 0 40px rgba(2, 6, 23, .35); transform: translateX(-104%); visibility: hidden; transition: transform .24s ease, visibility 0s linear .24s; }
    body.is-sidebar-open .dashboard .sidebar { transform: none; visibility: visible; transition-delay: 0s; }
    body .dashboard .sidebar .side-logo { justify-content: space-between; gap: 12px; margin: 0 0 8px; }
    body .dashboard .sidebar .side-nav { flex: 1 1 auto; flex-direction: column; align-items: stretch; gap: 4px; min-height: 0; padding: 0 0 8px; overflow: hidden auto; overscroll-behavior: contain; }
    body .dashboard .sidebar .menu-title { display: block !important; }
    body .dashboard .sidebar .menu-group { flex: 0 0 auto; }
    body .dashboard .sidebar .nav-button { display: grid; grid-template-columns: 20px 1fr 16px; width: 100%; min-height: 44px; padding: 0 10px; white-space: normal; }
    body .dashboard .sidebar .nav-button .chev { display: grid; }
    body .dashboard .sidebar .menu-group.is-open > .submenu { display: grid !important; max-height: none; margin: 4px 0 8px 25px; opacity: 1; pointer-events: auto; }
    body .dashboard .sidebar .submenu a, body .dashboard .sidebar .submenu button { min-height: 40px; }
    body .dashboard .sidebar .sidebar-bottom { display: grid; flex: 0 0 auto; width: calc(100% + 28px); margin: 6px -14px 0; }
}
@media (prefers-reduced-motion: reduce) {
    .sidebar-overlay, body .dashboard .sidebar { transition: none; }
}

/* Contas a Receber: faixa "Mostrando" com os filtros aplicados */
.cft-mostrando { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line-soft, #e2e8f0); border-radius: 12px; background: var(--panel, #fff); font-size: 13px; }
.cft-mostrando-rotulo { font-weight: 800; color: var(--text-strong, #0f172a); }
.cft-mostrando-item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px 4px 10px; border-radius: 999px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; }
.cft-mostrando-item small { font-size: 11px; font-weight: 700; color: #64748b; text-transform: uppercase; letter-spacing: .03em; }
.cft-mostrando-item b { font-weight: 800; }
.cft-mostrando-item a { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; color: #475569; text-decoration: none; font-size: 15px; line-height: 1; }
.cft-mostrando-item a:hover { background: #dbeafe; color: #b91c1c; }
.cft-mostrando-item:not(:has(a)) { padding-right: 10px; }
.cft-mostrando-item.is-situacao-aberto { background: #eff6ff; border-color: #bfdbfe; }
.cft-mostrando-item.is-situacao-vencido { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.cft-mostrando-item.is-situacao-parcial { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.cft-mostrando-item.is-situacao-pago { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.cft-mostrando-item.is-situacao-cancelado { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }
.cft-mostrando-total { margin-left: auto; color: #64748b; font-weight: 700; }
/* A coluna de acoes fixa da lista nao pode cobrir o menu aberto da linha de cima: a celula com menu aberto sobe na frente das demais */
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table > .contacts-scroll > .contacts-row > :last-child.is-open,
.dashboard:has(.contacts-card):not(.dashboard-home) .contacts-table > .contacts-scroll > .contacts-row > :last-child:has(.is-open, [open]) { z-index: 60; }
/* Menu de acoes das listas: fundo opaco (o texto das linhas de baixo nao pode aparecer por tras) */
.dashboard:has(.contacts-card):not(.dashboard-home) .row-actions-menu { background: var(--panel, #fff); }

/* Viagens: painel operacional para leitura rapida de carga, documentos e acao. */
.viagens-main .page-top {
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-soft, #e2e8f0);
}
.viagens-main .page-top h1 { margin-bottom: 4px; }
.viagens-main .page-top p { max-width: 360px; }
.viagens-title-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
/* Logo RC (caminhao) do Rota Certa como mascara, na cor do titulo: branco no tema escuro,
   escuro no claro (o desenho original e branco com fundo transparente) */
.viagens-logo-rc {
    display: block;
    flex: 0 0 auto;
    width: 66px;
    height: 21px;
    background-color: var(--text-strong);
    -webkit-mask: url("../img/rota-certa-icone.png") center / contain no-repeat;
    mask: url("../img/rota-certa-icone.png") center / contain no-repeat;
}
.viagens-title-brand > div { min-width: 0; }
.viagens-contexto {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 10px;
}
.transportadora-topo {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    min-width: 300px;
    margin: 0;
    padding: 7px 11px;
    border: 1px solid #000;
    border-left: 5px solid #fe7819;
    border-radius: 6px;
    background: #000;
    color: #fff;
    font-size: 11px;
    line-height: 1.25;
    flex: 1 1 360px;
}
.transportadora-topo > img {
    display: block;
    width: 58px;
    height: 48px;
    object-fit: contain;
}
.transportadora-topo > div { min-width: 0; }
.transportadora-topo span {
    display: block;
    margin-bottom: 2px;
    color: #fe7819;
    font-weight: 800;
    text-transform: uppercase;
}
.transportadora-topo strong {
    display: block;
    color: #fff;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.transportadora-topo small {
    display: block;
    margin-top: 3px;
    color: #d1d5db;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.saldo-semparar-card {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto auto;
    align-items: center;
    gap: 4px 13px;
    flex: 1 1 360px;
    min-width: 300px;
    padding: 8px 10px;
    border: 1px solid #ec1d66;
    border-left: 5px solid #ec1d66;
    border-radius: 6px;
    background: #f9f9f9;
}
.saldo-semparar-card-head {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}
.saldo-semparar-card-head img {
    display: block;
    width: auto;
    height: 18px;
    max-width: 76px;
    object-fit: contain;
}
.saldo-semparar-card-head span {
    color: #ec1d66;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}
.saldo-semparar-card-head a {
    color: #c81754;
    font-size: 11px;
    font-weight: 800;
    text-decoration: underline;
    white-space: nowrap;
}
.saldo-semparar-card > strong {
    justify-self: end;
    color: #172033;
    font-size: 20px;
    line-height: 1;
    white-space: nowrap;
}
.transportadora-pix-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    grid-column: auto;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #ec1d66;
    border-radius: 5px;
    background: #ec1d66;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}
.transportadora-pix-action:hover { background: #c81754; }
.saldo-semparar-modal {
    width: min(560px, calc(100vw - 32px));
    border: 0;
    background: #f9f9f9;
}
.saldo-semparar-modal-head {
    align-items: flex-start;
    padding-bottom: 14px;
    border-bottom: 2px solid #ec1d66;
}
.saldo-semparar-modal-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}
.saldo-semparar-modal-brand img {
    display: block;
    width: auto;
    height: 28px;
    max-width: 106px;
    object-fit: contain;
}
.saldo-semparar-modal-brand span {
    display: block;
    margin-bottom: 2px;
    color: #ec1d66;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}
.saldo-semparar-modal-head h2 { color: #172033; }
.saldo-semparar-modal-head p { margin: 3px 0 0; color: #697386; }
.saldo-semparar-modal-head > a { color: #ec1d66; }
.saldo-semparar-form {
    display: block;
    padding-top: 22px;
}
.saldo-semparar-form-content {
    display: grid;
    grid-template-columns: minmax(190px, .8fr) minmax(0, 1.2fr);
    align-items: end;
    gap: 22px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}
.saldo-semparar-form label {
    display: grid;
    gap: 7px;
    color: #172033;
    font-size: 13px;
    font-weight: 800;
}
.saldo-semparar-form input {
    height: 46px;
    box-sizing: border-box;
    border-color: #f1aac8;
    background: #fff;
}
.saldo-semparar-form input:focus { border-color: #ec1d66; box-shadow: 0 0 0 3px rgba(236, 29, 102, .13); }
.saldo-semparar-form .form-hint { margin: 0; color: #697386; font-size: 13px; font-weight: 600; line-height: 1.4; }
.saldo-semparar-modal .purchase-modal-actions {
    justify-content: flex-end;
    margin-top: 20px;
}
.saldo-semparar-modal .purchase-modal-actions .cancel-action,
.saldo-semparar-modal .purchase-modal-actions .primary-action {
    min-height: 42px;
    justify-content: center;
}
.saldo-semparar-modal .primary-action {
    border-color: #ec1d66;
    background: #ec1d66;
    color: #fff;
}
.saldo-semparar-modal .primary-action:hover { border-color: #c81754; background: #c81754; }
.saldo-semparar-modal .cancel-action,
.saldo-semparar-modal .secondary-action { border-color: #ec1d66; background: #fff; color: #c81754; }
.saldo-semparar-modal .cancel-action:hover,
.saldo-semparar-modal .secondary-action:hover { background: #fff0f5; }
.saldo-semparar-pix-result {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    align-items: center;
    gap: 20px;
    padding: 16px;
    border: 1px solid #f1aac8;
    border-radius: 8px;
    background: #fff;
}
.saldo-semparar-pix-result img {
    display: block;
    width: 176px;
    height: 176px;
    object-fit: contain;
    background: #fff;
}
.saldo-semparar-pix-result span {
    display: block;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
}
.saldo-semparar-pix-result strong {
    display: block;
    margin: 4px 0 9px;
    color: #ec1d66;
    font-size: 27px;
}
.saldo-semparar-pix-result p { margin: 0; color: #52667f; font-size: 13px; line-height: 1.45; }
.saldo-semparar-pix-status {
    display: block;
    margin-top: 12px;
    color: #c81754;
    font-size: 12px;
    font-weight: 800;
}
.saldo-semparar-copy {
    display: block;
    margin-top: 14px;
    color: var(--text-strong, #0f172a);
    font-size: 12px;
    font-weight: 800;
}
.saldo-semparar-copy textarea {
    display: block;
    width: 100%;
    min-height: 74px;
    margin-top: 6px;
    resize: vertical;
    font-size: 11px;
    line-height: 1.35;
    border-color: #f1aac8;
}
.saldo-semparar-extrato-modal { width: min(640px, calc(100vw - 32px)); }
.saldo-semparar-extrato-lista {
    display: grid;
    gap: 8px;
    max-height: min(52vh, 420px);
    margin-top: 18px;
    overflow: auto;
}
.saldo-semparar-extrato-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid #f1aac8;
    border-left: 4px solid #ec1d66;
    border-radius: 6px;
    background: #fff;
}
.saldo-semparar-extrato-item > div { display: grid; gap: 3px; min-width: 0; }
.saldo-semparar-extrato-item > div:last-child { justify-items: end; text-align: right; }
.saldo-semparar-extrato-item strong { color: #172033; font-size: 13px; }
.saldo-semparar-extrato-item > div:last-child strong { color: #ec1d66; font-size: 15px; }
.saldo-semparar-extrato-item span { color: #697386; font-size: 12px; }
.saldo-semparar-extrato-vazio { margin: 8px 0; color: #697386; font-size: 13px; text-align: center; }
@media (max-width: 640px) {
    .viagens-contexto { display: grid; }
    .transportadora-topo, .saldo-semparar-card { width: 100%; box-sizing: border-box; }
    .saldo-semparar-card { min-width: 0; }
    .saldo-semparar-card { grid-template-columns: minmax(0, 1fr) auto; }
    .saldo-semparar-card .transportadora-pix-action { grid-column: 1 / -1; }
    .saldo-semparar-form-content { grid-template-columns: 1fr; gap: 14px; }
    .saldo-semparar-pix-result { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .saldo-semparar-extrato-item { align-items: flex-start; flex-direction: column; gap: 8px; }
    .saldo-semparar-extrato-item > div:last-child { justify-items: start; text-align: left; }
}
.viagens-main .viagens-filters {
    flex: 1 1 620px;
    justify-content: flex-end;
    padding: 0;
}
.viagens-main .viagens-filters .primary-action { order: 3; }
.viagens-main .viagens-filters .search-input {
    flex: 1 1 280px;
    max-width: 460px;
    min-height: 44px;
}
.viagens-main .viagens-filters .order-origin-filter {
    min-height: 44px;
    min-width: 176px;
    background-color: var(--panel, #fff);
}
.viagens-overview {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 12px 0;
}
.viagens-kpi {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 12px;
    border: 1px solid var(--line-soft, #e2e8f0);
    border-radius: 8px;
    border-left: 4px solid #426aa1;
    background: var(--panel, #fff);
}
.viagens-kpi span {
    color: var(--muted, #64748b);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    white-space: nowrap;
}
.viagens-kpi strong { color: var(--text-strong, #0f172a); font-size: 19px; line-height: 1; }
.viagens-kpi.is-progress { border-left-color: #d99e0c; }
.viagens-kpi.is-complete { border-left-color: #159947; }
.viagens-kpi.is-documents { border-left-color: #7c3aed; }
.viagens-lista-card {
    border-radius: 8px;
    overflow: visible;
}
.viagens-table .contacts-head {
    min-height: 42px;
    padding-top: 11px;
    padding-bottom: 11px;
    background: var(--panel-soft, #f8fafc);
    border-bottom-color: var(--line-soft, #e2e8f0);
    color: var(--muted, #64748b);
    font-size: 11px;
}
.viagens-table .trip-row {
    min-height: 94px;
    padding-top: 14px;
    padding-bottom: 14px;
    border-left: 3px solid transparent;
    transition: background-color .16s ease, border-color .16s ease;
}
.viagens-table .trip-row:hover {
    border-left-color: #426aa1;
    background: #f8fbff;
}
.viagens-table .trip-row > div,
.viagens-table .trip-row > span,
.viagens-table .trip-row > strong { min-width: 0; }
.viagens-table .trip-identity strong {
    display: block;
    color: var(--text-strong, #0f172a);
    font-size: 14px;
}
.viagens-table .trip-identity small:first-of-type { color: #426aa1; font-weight: 800; }
.viagens-table .trip-identity small:last-of-type { margin-top: 4px; font-size: 11px; }
.viagens-table .trip-route strong { font-size: 13px; line-height: 1.35; }
.viagens-table .trip-route small:first-of-type {
    display: block;
    margin-top: 5px;
    color: var(--muted, #64748b);
}
.viagens-table .trip-route small:last-of-type { font-size: 11px; color: #64748b; }
.viagens-table .trip-team strong { font-size: 13px; }
.viagens-table .trip-team small { display: block; margin-top: 5px; color: #64748b; }
.viagens-table .trip-notes-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: start;
    min-width: 52px;
    min-height: 28px;
    padding: 0 8px;
    border: 1px solid #dbe3ee;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}
.viagens-table .trip-value { color: var(--text-strong, #0f172a); font-size: 13px; }
.viagens-table .trip-documents-status { align-self: center; }
.viagens-table .trip-documents-status > .status-pill { margin-bottom: 2px; }
.viagens-table .trip-doc-badges { gap: 5px; margin-top: 7px; }
.viagens-table .doc-badge { min-height: 20px; padding: 3px 7px; border-radius: 5px; }
.viagens-table .action-cell { align-self: center; }

@media (max-width: 1180px) {
    .viagens-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .viagens-main .viagens-filters { justify-content: flex-start; }
}
@media (max-width: 720px) {
    .viagens-main .page-top { padding-bottom: 14px; }
    .viagens-main .viagens-filters { display: grid; grid-template-columns: 1fr; width: 100%; }
    .viagens-main .viagens-filters .search-input,
    .viagens-main .viagens-filters .order-origin-filter,
    .viagens-main .viagens-filters .primary-action { width: 100%; max-width: none; }
    .viagens-main .viagens-filters .primary-action { order: initial; }
    .transportadora-topo { grid-template-columns: 54px minmax(0, 1fr); width: 100%; }
    .transportadora-topo > img { width: 54px; height: 46px; }
    .viagens-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
    .viagens-kpi { min-height: 44px; padding: 0 10px; }
    .viagens-kpi span { font-size: 9px; }
    .viagens-kpi strong { font-size: 18px; }
    .viagens-table .trip-row { min-height: 82px; }
}

@media (min-width: 769px) {
    body:has(.viagens-main) { overflow: hidden; }
    .dashboard:has(.viagens-main) {
        height: 100svh;
        min-height: 0;
        overflow: hidden;
    }
    .viagens-main {
        height: 100svh;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        box-sizing: border-box;
    }
    .viagens-main > .page-top,
    .viagens-main > .viagens-contexto,
    .viagens-main > .page-alert,
    .viagens-main > .viagens-overview { flex: 0 0 auto; }
    .viagens-main > .viagens-lista-card {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        margin-bottom: 0;
        overflow: hidden;
    }
    .viagens-main .viagens-table,
    .viagens-main .contacts-scroll { min-height: 0; }
    .viagens-main .contacts-scroll { max-height: none; }
}

/* Modal de impressao: cabecalho e comandos permanecem visiveis; so os documentos rolam. */
.imprimir-documentos-modal {
    max-height: min(92svh, 760px);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 18px;
    overflow: hidden;
}
.imprimir-documentos-form {
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 16px;
}
.imprimir-documentos-form .payments-list {
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}
.imprimir-documentos-scroll {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(100, 116, 139, .34) transparent;
}
.imprimir-documentos-scroll::-webkit-scrollbar { width: 7px; }
.imprimir-documentos-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, .34);
}
.imprimir-documentos-scroll .payments-list-row:first-child { border-top: 0; }
@media (max-width: 720px) {
    .imprimir-documentos-modal { max-height: calc(100svh - 20px); padding: 16px; }
}

/* CT-e: busca do XML da NF-e pela chave */
.cte-chave-busca{display:grid;gap:6px}
.cte-chave-busca-linha{display:flex;gap:10px;align-items:stretch}
.cte-chave-busca-linha input{flex:1;min-width:0}
.cte-chave-busca-linha button{white-space:nowrap}
.cte-chave-busca small{color:var(--muted,#667085)}

/* PEDIDOS: gerar notas fiscais em lote */
.pbn-check{width:16px;height:16px;margin:0 8px 0 0;flex:none;vertical-align:middle;accent-color:var(--primary,#2563eb);cursor:pointer}
.pbn-check:disabled{cursor:not-allowed;opacity:.35}
.contacts-head > span:first-child:has(.pbn-check){display:flex;align-items:center}
.order-reference-line:has(.pbn-check){display:flex;align-items:center;flex-wrap:nowrap}
.pbn-barra{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin:0 0 12px;padding:10px 14px;border:1px solid var(--line-soft);border-radius:12px;background:var(--panel)}
.pbn-barra[hidden]{display:none}
.pbn-barra > div{display:flex;gap:8px;flex-wrap:wrap}
.pbn-card{width:min(640px,94vw);max-height:92vh;overflow:auto}
.pbn-opcoes{display:grid;gap:8px}
.pbn-opcoes[hidden],.pbn-aviso[hidden]{display:none}
.pbn-opcao{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line-soft);border-radius:12px;cursor:pointer}
.pbn-opcao:has(input:checked){border-color:var(--primary,#2563eb);background:color-mix(in srgb,var(--primary,#2563eb) 8%,transparent)}
.pbn-opcao input{margin-top:3px}
.pbn-opcao span{display:grid;gap:2px}
.pbn-opcao small,.pbn-aviso,.pbn-lista small{color:var(--muted,#667085)}
.pbn-lista{list-style:none;margin:0;padding:0;display:grid;gap:6px;max-height:300px;overflow:auto}
.pbn-lista li{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;padding:9px 12px;border:1px solid var(--line-soft);border-radius:10px}
.pbn-lista li > div{display:grid;gap:2px;min-width:0}
.pbn-status{flex:none;font-size:.8rem;font-weight:600;padding:3px 10px;border-radius:999px;background:rgba(100,116,139,.15);white-space:nowrap}
.pbn-status.is-andamento{background:rgba(37,99,235,.15);color:#2563eb}
.pbn-status.is-ok{background:rgba(22,163,74,.15);color:#15803d}
.pbn-status.is-aviso{background:rgba(217,119,6,.15);color:#b45309}
.pbn-status.is-erro{background:rgba(220,38,38,.15);color:#b91c1c}
.pbn-detalhe{overflow-wrap:anywhere}
.contacts-table .pbn-check,.pbn-lista ~ .pbn-check{appearance:auto;-webkit-appearance:checkbox;width:16px !important;height:16px !important;min-width:16px;padding:0;border-radius:3px;background:none;box-shadow:none}
[data-pbn-iniciar][hidden]{display:none !important}
.pbn-opcao input[type="radio"]{appearance:auto;-webkit-appearance:radio;width:18px !important;height:18px !important;min-width:18px;flex:none;padding:0;margin:2px 0 0;box-shadow:none;background:none}
.pbn-email{display:grid;gap:8px;margin:0;padding:0;border:0}
.pbn-email[hidden],.pbn-check-linha[hidden]{display:none}
.pbn-check-linha{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line-soft);border-radius:12px;cursor:pointer}
.pbn-check-linha:has(input:checked){border-color:var(--primary,#2563eb);background:color-mix(in srgb,var(--primary,#2563eb) 8%,transparent)}
.pbn-check-linha input[type="checkbox"]{appearance:auto;-webkit-appearance:checkbox;width:18px !important;height:18px !important;min-width:18px;flex:none;padding:0;margin:2px 0 0;box-shadow:none;background:none}
.pbn-check-linha span{display:grid;gap:2px}
.pbn-check-linha small{color:var(--muted,#667085)}
.pbn-sub{margin-left:22px}
.pbn-lista .pbn-lancamentos{font-size:.78rem}
.pbn-lanc legend{font-weight:700;padding:0;margin-bottom:6px}
.pbn-lanc legend small{font-weight:400;color:var(--muted,#667085)}
.pbn-lanc[hidden]{display:none}
.pbn-categoria{display:grid;gap:4px;margin-left:22px;font-size:.9rem}
.pbn-categoria[hidden]{display:none}
.pbn-categoria select{width:100%}

/* PRODUTOS: reajustar precos */
.rjp-etapa{display:flex;align-items:center;gap:10px;margin-bottom:14px;font-weight:600}
.rjp-etapa b{display:inline-grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--primary,#2563eb);color:#fff;font-size:.85rem}
.rjp-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:end}
.rjp-grid label{display:grid;gap:6px;font-size:.9rem}
.rjp-checks{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:8px 22px}
.rjp-check{display:flex !important;grid-template-columns:none;align-items:center;gap:8px !important}
.rjp-check input{width:16px !important;height:16px !important;appearance:auto;-webkit-appearance:checkbox;padding:0;box-shadow:none}
.rjp-acoes{grid-column:1/-1;display:flex;justify-content:flex-end}
.rjp-filtros[hidden],.rjp-resultado[hidden],.page-alert[hidden]{display:none}
.rjp-barra{display:flex;flex-wrap:wrap;gap:12px;align-items:end;padding:12px;border:1px solid var(--line-soft);border-radius:12px;margin-bottom:12px;background:color-mix(in srgb,var(--primary,#2563eb) 5%,transparent)}
.rjp-barra label{display:grid;gap:6px;font-size:.85rem}
.rjp-perc{display:flex;align-items:center;gap:6px}
.rjp-perc input{width:110px}
.rjp-contagem{margin-left:auto;font-weight:600;align-self:center}
.rjp-tabela-wrap{max-height:62vh;overflow:auto;border:1px solid var(--line-soft);border-radius:12px}
.rjp-tabela{width:100%;border-collapse:collapse;font-size:.92rem}
.rjp-tabela th{position:sticky;top:0;background:var(--panel);text-align:left;padding:10px 12px;border-bottom:1px solid var(--line-soft);font-size:.78rem;text-transform:uppercase;letter-spacing:.03em;z-index:1}
.rjp-tabela td{padding:8px 12px;border-bottom:1px solid var(--line-soft);vertical-align:middle}
.rjp-tabela .num{text-align:right;white-space:nowrap}
.rjp-tabela td strong{display:block}
.rjp-tabela td small{display:block;color:var(--muted,#667085)}
.rjp-tabela .is-zero{color:#b91c1c}
.rjp-c-check{width:42px}
.rjp-c-check input{width:16px !important;height:16px !important;appearance:auto;-webkit-appearance:checkbox;padding:0;box-shadow:none}
.rjp-novo{width:120px;text-align:right}
.rjp-var{display:inline-block;min-width:64px;font-weight:600}
.rjp-var.is-up{color:#15803d}
.rjp-var.is-down{color:#b91c1c}
.rjp-vazio{padding:24px;text-align:center;color:var(--muted,#667085)}
.rjp-rodape{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;margin-top:14px}
.rjp-rodape > div{display:flex;gap:10px}
@media (max-width:760px){.rjp-grid{grid-template-columns:1fr}.rjp-contagem{margin-left:0;width:100%}}
/* reajustar precos: a tabela ocupa o espaco que sobra e o rodape (Salvar) fica sempre visivel */
.dash-main.rjp-page{display:flex;flex-direction:column;overflow-y:auto}
.rjp-page > *{flex:none}
.rjp-page > .rjp-resultado:not([hidden]){flex:1 1 auto;min-height:440px;display:flex;flex-direction:column}
.rjp-resultado .rjp-tabela-wrap{flex:1 1 auto;min-height:150px;max-height:none}
.rjp-resultado .rjp-rodape{flex:none}
.rjp-page .page-alert{width:min(440px,92vw)}
.rjp-aviso{margin:0 0 12px;padding:11px 14px;border-radius:10px;font-size:.92rem;line-height:1.4;border:1px solid transparent}
.rjp-aviso[hidden]{display:none}
.rjp-aviso.is-ok{background:rgba(22,163,74,.12);border-color:rgba(22,163,74,.35);color:#15803d}
.rjp-aviso.is-erro{background:rgba(220,38,38,.1);border-color:rgba(220,38,38,.35);color:#b91c1c}

/* PRODUTOS: classificar categorias (sugestor) */
.ccg-barra{align-items:center}
.ccg-resumo{font-weight:700;margin-right:auto}
.ccg-cel{min-width:280px}
.ccg-cel select,.ccg-cel .ccg-nova{width:100%}
.ccg-cel .ccg-nova{margin-top:6px}
.ccg-motivo{display:block;margin-top:4px;line-height:1.35}
.ccg-conf{display:inline-block;font-size:.72rem;font-weight:700;padding:1px 8px;border-radius:999px;background:rgba(100,116,139,.15);margin-right:4px}
.ccg-conf.is-alta{background:rgba(22,163,74,.15);color:#15803d}
.ccg-conf.is-media{background:rgba(37,99,235,.13);color:#1d4ed8}
.ccg-card .rjp-tabela td{vertical-align:top}
.ccg-sug{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:6px;font-size:.85rem;color:var(--muted,#667085)}
.ccg-sug button{border:1px solid var(--line-soft);background:var(--panel);border-radius:999px;padding:3px 12px;cursor:pointer;font-weight:600}
.ccg-sug button:hover{border-color:var(--primary,#2563eb)}
.vsl-badge{display:inline-block;font-style:normal;font-size:.7rem;font-weight:700;padding:1px 8px;border-radius:999px;background:rgba(217,119,6,.16);color:#b45309;vertical-align:middle;margin-left:6px}
.vsl-linha{margin-top:8px;display:flex !important;align-items:flex-start;gap:8px !important;font-size:.85rem}
.vsl-linha small{color:var(--muted,#667085)}
.vsl-check{margin-top:4px;align-items:flex-start !important}
.vsl-check small{color:var(--muted,#667085)}

/* CONTAS A PAGAR: baixa com desconto no boleto / juros */
.pgd-ajuda{display:block;margin-top:4px;color:var(--muted,#667085);font-weight:400}
.pgd-conta{display:flex;flex-direction:column;justify-content:center;gap:2px;padding:8px 12px;border-radius:12px;background:color-mix(in srgb,var(--primary,#2563eb) 7%,transparent)}
.pgd-conta span{font-size:.8rem;color:var(--muted,#667085)}
.pgd-dif{display:grid;gap:8px;padding:12px;border:1px solid var(--line-soft);border-radius:12px}
.pgd-dif[hidden],.pgd-opcao[hidden]{display:none}
.pgd-dif-titulo{margin:0;font-weight:700}
.pgd-opcao{display:flex;gap:10px;align-items:flex-start;padding:9px 12px;border:1px solid var(--line-soft);border-radius:10px;cursor:pointer}
.pgd-opcao:has(input:checked){border-color:var(--primary,#2563eb);background:color-mix(in srgb,var(--primary,#2563eb) 8%,transparent)}
.pgd-opcao input{appearance:auto;-webkit-appearance:radio;width:18px !important;height:18px !important;min-width:18px;padding:0;margin:2px 0 0;box-shadow:none}
.pgd-opcao span{display:grid;gap:2px}
.pgd-opcao small{color:var(--muted,#667085);font-weight:400}
.settle-grid .pgd-opcao{display:flex !important;flex-direction:row !important;align-items:flex-start;gap:10px !important;padding:8px 12px;font-weight:400}
.settle-grid .pgd-opcao > span{display:block}
.settle-grid .pgd-opcao b{display:block;font-weight:700}
.settle-grid .pgd-opcao small{display:block;margin-top:1px}
.settle-grid .pgd-conta{margin:0}
[data-payable-settle-modal] .settle-modal-card{max-height:94vh;overflow-y:auto}
.pgd-dif{gap:6px;padding:10px}
.settle-grid .pgd-opcao[hidden],.settle-grid .pgd-dif[hidden]{display:none !important}

/* CONTAS A RECEBER: estornar recebimento (janela Recebimentos) */
.payments-list-row .est-linha{grid-column:1 / -1;margin-top:6px;padding-top:6px;border-top:1px dashed var(--line-soft)}
.est-btn{border:0;background:none;color:#b45309;font-weight:700;cursor:pointer;padding:2px 0}
.est-btn:hover{text-decoration:underline}
.est-chip{display:inline-block;font-size:.75rem;font-weight:700;padding:2px 10px;border-radius:999px;background:rgba(100,116,139,.18);color:#475569}
.payments-list-row.is-estornado > span,.payments-list-row.is-estornado > strong{text-decoration:line-through;opacity:.55}
.est-confirma{display:grid;gap:8px;padding:10px 12px;border:1px solid rgba(217,119,6,.45);border-radius:10px;background:rgba(217,119,6,.07)}
.est-confirma p{margin:0;line-height:1.4}
.est-confirma label{display:grid;gap:4px;font-size:.85rem}
.est-botoes{display:flex;gap:8px;flex-wrap:wrap}
.est-confirmar{border:0;border-radius:10px;padding:8px 16px;font-weight:700;background:#b45309;color:#fff;cursor:pointer}
.est-confirmar:disabled{opacity:.6;cursor:wait}
.est-erro{color:#b91c1c;font-weight:600}
.est-erro[hidden],.est-aviso[hidden]{display:none}
.est-aviso{margin:10px 0 0;padding:10px 12px;border-radius:10px;background:rgba(22,163,74,.12);border:1px solid rgba(22,163,74,.35);color:#15803d;font-weight:600;line-height:1.4}

/* VERSAO DO SISTEMA (menu lateral + aviso de nova versao) */
.versao-strip{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 8px;padding:7px 10px;border:1px solid var(--line-soft);border-radius:12px;background:var(--panel);cursor:pointer;font-size:.74rem}
.versao-info{display:flex;align-items:center;gap:8px;min-width:0}
.versao-info > div{display:grid;min-width:0}
.versao-info strong{font-size:.74rem;line-height:1.2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.versao-info small{color:var(--muted,#667085);font-size:.7rem;line-height:1.25}
.versao-ponto{flex:none;width:8px;height:8px;border-radius:50%;background:#16a34a}
.versao-strip[data-estado="nova"] .versao-ponto{background:#f59e0b;animation:versaoPulso 1.6s ease-in-out infinite}
.versao-strip[data-estado="nova"]{border-color:rgba(245,158,11,.55);background:rgba(245,158,11,.08)}
.versao-strip[data-estado="checando"] .versao-ponto{background:#2563eb}
.versao-strip[data-estado="erro"] .versao-ponto{background:#dc2626}
.versao-botao{flex:none;border:0;border-radius:8px;padding:5px 10px;font-weight:700;font-size:.72rem;background:#f59e0b;color:#1f1300;cursor:pointer}
.versao-botao[hidden]{display:none}
.versao-botao:disabled{opacity:.6;cursor:wait}
@keyframes versaoPulso{0%,100%{box-shadow:0 0 0 0 rgba(245,158,11,.6)}50%{box-shadow:0 0 0 6px rgba(245,158,11,0)}}
.versao-aviso{position:fixed;right:18px;bottom:18px;z-index:200;display:flex;align-items:center;gap:14px;max-width:min(460px,92vw);padding:12px 14px;border-radius:14px;border:1px solid rgba(245,158,11,.6);background:var(--panel);box-shadow:0 14px 40px rgba(0,0,0,.25)}
.versao-aviso > div:first-child{display:grid;gap:2px}
.versao-aviso span{font-size:.82rem;color:var(--muted,#667085)}
.versao-aviso-acoes{display:flex;gap:8px;flex:none}
.versao-aviso-ok{border:0;border-radius:10px;padding:8px 12px;font-weight:700;background:#f59e0b;color:#1f1300;cursor:pointer}
.versao-aviso-depois{border:1px solid var(--line-soft);border-radius:10px;padding:8px 12px;background:transparent;color:inherit;cursor:pointer}
@media (max-width:640px){.versao-aviso{left:12px;right:12px;flex-direction:column;align-items:stretch}}
.versao-strip{margin:0 16px 8px}
.versao-aviso,.versao-aviso strong,.versao-aviso-depois{color:var(--text-strong,#071120)}
.versao-aviso span{color:var(--muted,#667085)}
.versao-aviso-ok{color:#1f1300}
.versao-strip[data-estado="nova"]{flex-direction:column;align-items:stretch}
.versao-strip[data-estado="nova"] .versao-botao{width:100%;padding:7px 10px}
.versao-strip strong{color:var(--text-strong,#071120)}
.est-nota{color:var(--muted,#667085);font-weight:400}
.est-atencao{margin:0;color:#92400e;font-weight:600}

/* PRODUTOS: formulario de cadastro em secoes */
.product-form .pf-nav{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px}
.pf-nav a{padding:6px 14px;border:1px solid var(--line-soft);border-radius:999px;font-size:.8rem;font-weight:700;color:var(--muted,#667085);text-decoration:none;background:var(--panel)}
.pf-nav a:hover{border-color:var(--primary,#2563eb);color:var(--text-strong,#071120)}
.pf-card{margin-bottom:16px;scroll-margin-top:92px}
.pf-card-head{display:flex;align-items:center;gap:12px;margin:0 0 16px;padding-bottom:12px;border-bottom:1px solid var(--line-soft)}
.pf-card-head h2{margin:0;font-size:1.05rem;color:var(--text-strong,#071120)}
.pf-card-head p{margin:2px 0 0;font-size:.82rem;color:var(--muted,#667085)}
.pf-num{flex:none;display:inline-grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--primary,#2563eb);color:#fff;font-weight:800;font-size:.9rem}
.pf-req{color:#dc2626;font-style:normal;font-weight:800}
.product-grid small{font-weight:500;color:var(--muted,#667085);line-height:1.35}
.product-grid .pf-check{display:flex;align-items:flex-start;gap:12px;padding:12px 14px;border:1px solid var(--line-soft);border-radius:12px;cursor:pointer;font-size:13px}
.product-grid .pf-check:has(input:checked){border-color:var(--primary,#2563eb);background:color-mix(in srgb,var(--primary,#2563eb) 7%,transparent)}
.product-grid .pf-check input[type="checkbox"]{appearance:auto;-webkit-appearance:checkbox;width:18px !important;height:18px !important;min-height:0;min-width:18px;padding:0;margin:2px 0 0;box-shadow:none;flex:none}
.product-grid .pf-check > span{display:grid;gap:3px}
.product-grid .pf-check b{font-weight:800}
.pf-ai-row{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:6px}
.pf-margem{display:grid;align-content:center;gap:3px;padding:12px 16px;border:1px dashed var(--line-soft);border-radius:12px;background:color-mix(in srgb,var(--primary,#2563eb) 5%,transparent)}
.pf-margem > span{font-size:.75rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#667085)}
.pf-margem strong{font-size:1.5rem;line-height:1.1;color:var(--text-strong,#071120)}
.pf-margem small{font-weight:500}
.pf-margem.is-ok{border-color:rgba(22,163,74,.5);background:rgba(22,163,74,.08)}
.pf-margem.is-ok strong{color:#15803d}
.pf-margem.is-baixa{border-color:rgba(217,119,6,.5);background:rgba(217,119,6,.08)}
.pf-margem.is-baixa strong{color:#b45309}
.pf-margem.is-neg{border-color:rgba(220,38,38,.5);background:rgba(220,38,38,.08)}
.pf-margem.is-neg strong{color:#b91c1c}
.pf-impostos{margin-top:16px;border:1px solid var(--line-soft);border-radius:12px;padding:0 14px}
.pf-impostos summary{cursor:pointer;padding:12px 0;list-style:none;display:flex;gap:10px;align-items:baseline;flex-wrap:wrap}
.pf-impostos summary::-webkit-details-marker{display:none}
.pf-impostos summary::before{content:'▸';font-size:.8rem;color:var(--muted,#667085)}
.pf-impostos[open] summary::before{content:'▾'}
.pf-impostos summary span{font-size:.8rem;color:var(--muted,#667085)}
.pf-impostos[open]{padding-bottom:14px}
.pf-impostos[open] summary{padding-bottom:14px}
@media (max-width:900px){.product-grid [class*="span-"]{grid-column:1 / -1}}
/* o formulario de produto rola por dentro (cabecalho fixo) e as secoes nao encolhem */
.product-form{display:flex;flex-direction:column;height:100%;min-height:0}
.product-form > *{flex:none}
.product-form > .pf-scroll{flex:1 1 auto;min-height:0;overflow-y:auto;padding:0 4px 24px 0}
.pf-card{overflow:visible !important;max-height:none;flex:none}
.pf-card .image-add-button input[type="file"]{display:none !important}
.pf-card .product-images-panel{width:100%}
.pf-ai-row .ai-action{width:auto !important;min-width:0;padding:0 16px;height:34px}

/* REAJUSTE DE PRECOS: historico com desfazer em cada reajuste */
.rjp-historico{margin-top:16px}
.rjp-historico[hidden]{display:none}
.rjp-hist-vazio{margin:0;padding:10px 2px;color:var(--muted,#667085)}
.rjp-hist-lista{display:grid;gap:10px}
.rjp-hist-item{border:1px solid var(--line-soft);border-radius:12px;background:var(--panel)}
.rjp-hist-item.is-desfeito{opacity:.7}
.rjp-hist-linha{display:grid;grid-template-columns:130px minmax(0,1fr) auto auto;gap:14px;align-items:center;padding:12px 14px}
.rjp-hist-quando{display:grid;gap:2px}
.rjp-hist-quando small,.rjp-hist-resumo small{color:var(--muted,#667085);font-size:.78rem}
.rjp-hist-resumo{display:grid;gap:2px;min-width:0}
.rjp-hist-acoes{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.rjp-chip{display:inline-block;font-size:.75rem;font-weight:700;padding:3px 10px;border-radius:999px;white-space:nowrap}
.rjp-chip.is-ok{background:rgba(22,163,74,.15);color:#15803d}
.rjp-chip.is-off{background:rgba(100,116,139,.18);color:#475569}
.rjp-chip.is-parcial{background:rgba(217,119,6,.16);color:#b45309}
.rjp-btn-desfazer{border:1px solid rgba(217,119,6,.55);background:rgba(217,119,6,.08);color:#92400e;border-radius:10px;padding:7px 14px;font-weight:700;cursor:pointer}
.rjp-btn-desfazer:hover{background:rgba(217,119,6,.16)}
.rjp-btn-desfazer:disabled{opacity:.6;cursor:wait}
.rjp-hist-detalhes{border-top:1px solid var(--line-soft);padding:6px 10px 10px;max-height:340px;overflow:auto}
.rjp-hist-detalhes[hidden]{display:none}
.rjp-hist-tabela th{position:static}
.rjp-hist-tabela tr.is-desfeito td{opacity:.55}
.rjp-mudou{display:inline-block;margin-left:6px;color:#b45309;font-weight:700}
@media (max-width:900px){.rjp-hist-linha{grid-template-columns:1fr;gap:8px}.rjp-hist-acoes{justify-content:flex-start}}
.simples-ibscbs-field[hidden]{display:none !important}

/* AJUSTES RTC (Reforma Tributaria) */
.rtc-card{margin-bottom:16px}
.rtc-dica{margin:-4px 0 12px;color:var(--muted,#667085);font-size:.88rem;line-height:1.4}
.rtc-resumo{display:flex;align-items:center;gap:12px;margin-bottom:14px;font-weight:600}
.rtc-barra{flex:1;max-width:320px;height:10px;border-radius:999px;background:rgba(100,116,139,.2);overflow:hidden}
.rtc-barra i{display:block;height:100%;background:#16a34a}
.rtc-grupo{margin-bottom:14px}
.rtc-grupo h3{margin:0 0 6px;font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted,#667085)}
.rtc-item{display:grid;grid-template-columns:120px minmax(0,1fr) minmax(160px,260px);gap:12px;align-items:center;padding:9px 12px;border:1px solid var(--line-soft);border-radius:10px;margin-bottom:6px}
.rtc-item.is-ok{opacity:.8}
.rtc-item-txt{display:grid;gap:2px;min-width:0}
.rtc-item-txt small{color:var(--muted,#667085)}
.rtc-prazo{color:#b45309 !important;font-weight:600}
.rtc-status{border:0;border-radius:999px;padding:5px 12px;font-weight:700;font-size:.78rem;cursor:pointer}
.rtc-status.is-pendente{background:rgba(100,116,139,.2);color:#475569}
.rtc-status.is-andamento{background:rgba(217,119,6,.18);color:#b45309}
.rtc-status.is-ok{background:rgba(22,163,74,.18);color:#15803d}
.rtc-nota{width:100%}
.rtc-aviso-regime{color:#b45309}
.rtc-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:12px;align-items:end}
.rtc-form label{display:grid;gap:5px;font-size:.85rem;font-weight:600}
.rtc-resultado{margin-top:12px;padding:12px 14px;border-radius:10px;border:1px solid var(--line-soft);display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.rtc-resultado[hidden]{display:none}
.rtc-resultado.is-ok{background:rgba(22,163,74,.1);border-color:rgba(22,163,74,.4);color:#15803d}
.rtc-resultado.is-erro{background:rgba(220,38,38,.08);border-color:rgba(220,38,38,.4);color:#b91c1c}
.rtc-resultado.is-andamento{background:rgba(37,99,235,.08);border-color:rgba(37,99,235,.4)}
.rtc-chip{display:inline-block;padding:2px 10px;border-radius:999px;font-size:.75rem;font-weight:700;background:rgba(100,116,139,.18)}
.rtc-chip.is-ok{background:rgba(22,163,74,.16);color:#15803d}
.rtc-chip.is-erro{background:rgba(220,38,38,.14);color:#b91c1c}
.rtc-chip.is-hib{background:rgba(37,99,235,.15);color:#1d4ed8}
.rtc-tabela small{display:block;color:var(--muted,#667085);font-weight:400}
.rtc-nt-busca{color:var(--muted,#667085);font-size:.85rem}
.rtc-nt-filtros{display:flex;gap:6px;flex-wrap:wrap;margin:12px 0}
.rtc-nt-filtros button{border:1px solid var(--line-soft);background:var(--panel);border-radius:999px;padding:6px 14px;font-weight:700;font-size:.82rem;cursor:pointer;color:inherit}
.rtc-nt-filtros button.is-on{background:var(--primary,#2563eb);border-color:var(--primary,#2563eb);color:#fff}
.rtc-nt{border:1px solid var(--line-soft);border-radius:10px;margin-bottom:6px;background:var(--panel)}
.rtc-nt>summary{display:grid;grid-template-columns:minmax(0,1fr) auto 150px;gap:12px;align-items:center;padding:10px 12px;cursor:pointer;list-style:none}
.rtc-nt>summary::-webkit-details-marker{display:none}
.rtc-nt>summary:focus-visible{outline:2px solid var(--primary,#2563eb);outline-offset:2px;border-radius:10px}
.rtc-nt-cab{display:grid;gap:2px;min-width:0}
.rtc-nt-cab small,.rtc-nt-datas small{color:var(--muted,#667085)}
.rtc-nt-datas{display:grid;gap:2px;text-align:right}
.rtc-nt-marcas{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.rtc-nt-imp,.rtc-nt-st{display:inline-block;padding:3px 10px;border-radius:999px;font-size:.74rem;font-weight:700;background:rgba(100,116,139,.18);color:#475569;white-space:nowrap}
.rtc-nt-imp.is-alto{background:rgba(220,38,38,.14);color:#b91c1c}
.rtc-nt-imp.is-medio{background:rgba(217,119,6,.18);color:#b45309}
.rtc-nt-st.is-pendente{background:rgba(220,38,38,.1);color:#b91c1c}
.rtc-nt-st.is-andamento{background:rgba(217,119,6,.18);color:#b45309}
.rtc-nt-st.is-feito,.rtc-nt-st.is-sem_acao{background:rgba(22,163,74,.16);color:#15803d}
.rtc-nt-st.is-nova{background:rgba(37,99,235,.15);color:#1d4ed8}
.rtc-nt-corpo{padding:4px 14px 14px;display:grid;gap:10px;border-top:1px solid var(--line-soft)}
.rtc-nt-prazos{display:flex;gap:18px;flex-wrap:wrap;padding-top:10px}
.rtc-nt-prazos span{display:grid;gap:1px}
.rtc-nt-prazos small{color:var(--muted,#667085)}
.rtc-nt-bloco h4{margin:0 0 3px;font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted,#667085)}
.rtc-nt-bloco p{margin:0;line-height:1.5}
.rtc-nt-bloco pre{margin:0;max-height:240px;overflow:auto;font-size:.76rem;white-space:pre-wrap;background:rgba(100,116,139,.1);padding:8px;border-radius:8px}
.rtc-nt-sem{margin:10px 0 0;color:#1d4ed8;font-weight:600}
.rtc-nt-rodape{display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.rtc-nt-rodape input{flex:1;min-width:180px}
.rtc-nt-pedido{display:grid;gap:8px;padding:10px 12px;border:1px dashed var(--line-soft);border-radius:10px}
.rtc-nt-pedido h4{margin:0;font-size:.78rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted,#667085)}
.rtc-nt-pedido textarea{width:100%;resize:vertical}
.rtc-nt-pedido .primary-action{justify-self:start}
.rtc-ped-lista{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.rtc-ped-lista li{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:center;padding:8px 10px;border-radius:8px;background:rgba(100,116,139,.1)}
.rtc-ped-lista small{color:var(--muted,#667085)}
.rtc-ped-st{display:inline-block;margin-right:6px;padding:2px 9px;border-radius:999px;font-size:.72rem;font-weight:700;background:rgba(37,99,235,.15);color:#1d4ed8}
.rtc-ped-lista li.is-concluido .rtc-ped-st{background:rgba(22,163,74,.16);color:#15803d}
.rtc-ped-lista li.is-cancelado{opacity:.6}
.rtc-ped-resp{margin:2px 0 0;flex-basis:100%}
.rtc-ped-lista .ghost-action{margin-left:auto}
@media (max-width:900px){.rtc-nt>summary{grid-template-columns:1fr}.rtc-nt-marcas{justify-content:flex-start}.rtc-nt-datas{text-align:left}}
.rtc-modal .rtc-modal-card{width:min(1100px,96vw);max-height:94vh;display:flex;flex-direction:column;gap:10px}
.rtc-abas{display:flex;gap:6px;flex-wrap:wrap}
.rtc-abas button{border:1px solid var(--line-soft);background:var(--panel);border-radius:999px;padding:6px 14px;font-weight:700;font-size:.82rem;cursor:pointer;color:inherit}
.rtc-abas button.is-on{background:var(--primary,#2563eb);border-color:var(--primary,#2563eb);color:#fff}
.rtc-abas button[hidden]{display:none}
.rtc-m-corpo{flex:1;min-height:360px;overflow:auto;border:1px solid var(--line-soft);border-radius:10px}
.rtc-pdf{width:100%;height:70vh;border:0}
.rtc-xml,.rtc-ibs pre{margin:0;padding:12px;font-size:.78rem;line-height:1.45;white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Menlo,Consolas,monospace}
.rtc-xml mark{background:rgba(250,204,21,.35);color:inherit;border-radius:3px}
.rtc-ibs{padding:6px 12px}
.rtc-m-rodape{display:flex;gap:8px;justify-content:flex-end}
.rtc-m-rodape a[hidden]{display:none}
@media (max-width:900px){.rtc-item{grid-template-columns:1fr}}
.pf-ibscbs{margin-top:16px;padding-top:14px;border-top:1px dashed var(--line-soft)}
.pf-subtitulo{font-weight:800;font-size:.85rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#667085)}
.pf-dica-ibs{margin:0;align-self:center;font-size:.82rem;color:var(--muted,#667085);line-height:1.4}
.rtc-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px;margin-bottom:12px}
.rtc-kpis > div{border:1px solid var(--line-soft);border-radius:10px;padding:10px 12px;display:grid;gap:3px}
.rtc-kpis small{color:var(--muted,#667085)}
.rtc-st-atualizada{color:#15803d}.rtc-st-erro{color:#b91c1c}.rtc-st-nunca{color:#b45309}
.rtc-acoes-linha{display:flex;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.rtc-tab-historico h3{margin:10px 0 6px;font-size:.8rem;text-transform:uppercase;letter-spacing:.05em;color:var(--muted,#667085)}
.rtc-hist-item{padding:7px 10px;border:1px solid var(--line-soft);border-radius:8px;margin-bottom:5px;font-size:.88rem}
.rtc-hist-item small{display:block;color:var(--muted,#667085);font-family:ui-monospace,Menlo,Consolas,monospace;word-break:break-all}
.rtc-ncm-filtro{margin-bottom:10px}
.rtc-check{display:flex !important;align-items:center;gap:8px;font-weight:600;font-size:.85rem}
.rtc-check input{width:16px !important;height:16px !important;appearance:auto;-webkit-appearance:checkbox;padding:0}
.rtc-def{display:grid;gap:6px;min-width:190px}
.rtc-def input[list]{width:100%}
.rtc-aplicar{display:flex;gap:12px;flex-wrap:wrap;align-items:center;margin-top:12px;padding:12px;border:1px dashed var(--line-soft);border-radius:10px}
.rtc-aplicar-res{font-weight:600;color:var(--muted,#667085)}
.pf-ibs-info{padding:10px 14px;border:1px solid var(--line-soft);border-radius:10px;font-size:.88rem;line-height:1.5;background:color-mix(in srgb,var(--primary,#2563eb) 5%,transparent)}
.pf-ibs-info[hidden]{display:none}
.pf-ibs-info small{display:block;color:var(--muted,#667085);font-weight:500}
.pf-ibs-ok{color:#15803d}.pf-ibs-erro{color:#b91c1c}.pf-ibs-aviso{color:#b45309}
.ccg-sug-btn{border:1px solid var(--line-soft);background:var(--panel);border-radius:999px;padding:2px 12px;font-weight:700;cursor:pointer;margin-left:6px}
.rtc-ncm-filtro{grid-template-columns:minmax(220px,1fr) minmax(260px,1fr) auto !important}

/* SELETOR DE cClassTrib */
.gcp-botao{margin-top:6px;border:1px solid var(--primary,#2563eb);background:color-mix(in srgb,var(--primary,#2563eb) 8%,transparent);color:var(--primary,#2563eb);border-radius:10px;padding:7px 12px;font-weight:700;font-size:.82rem;cursor:pointer;width:100%}
.gcp-botao:hover{background:color-mix(in srgb,var(--primary,#2563eb) 16%,transparent)}
.gcp-modal{z-index:220}
.gcp-card{width:min(860px,96vw);max-height:92vh;display:flex;flex-direction:column;gap:10px}
.gcp-busca{width:100%;min-height:44px}
.gcp-csts{display:flex;gap:6px;flex-wrap:wrap}
.gcp-csts button{border:1px solid var(--line-soft);background:var(--panel);color:inherit;border-radius:999px;padding:5px 12px;font-weight:700;font-size:.8rem;cursor:pointer}
.gcp-csts button.is-on{background:var(--primary,#2563eb);border-color:var(--primary,#2563eb);color:#fff}
.gcp-lista{flex:1;min-height:260px;overflow:auto;border:1px solid var(--line-soft);border-radius:10px;display:grid;align-content:start}
.gcp-item{display:grid;grid-template-columns:110px minmax(0,1fr);gap:12px;align-items:start;text-align:left;border:0;border-bottom:1px solid var(--line-soft);background:transparent;color:inherit;padding:10px 14px;cursor:pointer;width:100%}
.gcp-item:hover{background:color-mix(in srgb,var(--primary,#2563eb) 7%,transparent)}
.gcp-item.is-atual{background:rgba(22,163,74,.12)}
.gcp-item.is-destaque{box-shadow:inset 3px 0 0 #f59e0b}
.gcp-cod{display:grid;gap:2px}
.gcp-cod b{font-size:1rem}
.gcp-cod i{font-style:normal;font-size:.72rem;font-weight:700;color:var(--muted,#667085)}
.gcp-txt{display:grid;gap:2px;min-width:0}
.gcp-txt small{color:var(--muted,#667085);line-height:1.35}
.gcp-txt em{color:#b45309;font-style:normal;font-weight:700}
.gcp-vazio{padding:24px;text-align:center;color:var(--muted,#667085)}
.gcp-rodape{display:flex;justify-content:space-between;align-items:center;color:var(--muted,#667085);font-size:.85rem}
.rtc-s-resumo{margin-bottom:10px}
.rtc-cods{display:flex;flex-wrap:wrap;gap:6px}
.rtc-cod{display:inline-block;padding:3px 10px;border-radius:8px;background:rgba(37,99,235,.1);font-size:.78rem;line-height:1.4}
.rtc-cod.is-fora{background:rgba(220,38,38,.12);color:#b91c1c}
.rtc-dom{display:block;color:#15803d;font-weight:700}
.rtc-div{display:block;color:#b45309;font-weight:700}

/* ---- Configuracoes > Banco de Dados (espaco VPS / Drive) ---- */
.bd-page .bd-resumo{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;margin-bottom:16px}
.bd-card{display:flex;flex-direction:column;gap:10px;padding:18px;border-top:4px solid var(--line)}
.bd-card.is-ok{border-top-color:var(--success)}
.bd-card.is-atencao{border-top-color:var(--warning)}
.bd-card.is-critico{border-top-color:var(--danger)}
.bd-card header{display:flex;align-items:center;justify-content:space-between;gap:10px}
.bd-card h2{margin:0;font-size:1rem;color:var(--text-strong)}
.bd-card p{margin:0;font-size:.9rem;line-height:1.4;color:var(--muted-strong)}
.bd-card .bd-dica,.bd-page .bd-dica{color:var(--muted);font-size:.85rem}
.bd-grande{font-size:1.9rem;line-height:1.1;color:var(--text-strong)}
.bd-grande small{font-size:.9rem;font-weight:600;color:var(--muted)}
.bd-selo{padding:3px 11px;border-radius:999px;font-size:.75rem;font-weight:800;background:rgba(152,167,189,.18);color:var(--muted-strong);white-space:nowrap}
.bd-selo.is-ok{background:rgba(23,201,121,.16);color:var(--success)}
.bd-selo.is-atencao{background:rgba(255,210,77,.18);color:var(--warning)}
.bd-selo.is-critico{background:rgba(255,91,102,.16);color:var(--danger)}
.bd-barra{height:12px;border-radius:999px;background:var(--line-soft);overflow:hidden}
.bd-barra i{display:block;height:100%;border-radius:999px;background:var(--success)}
.bd-barra.is-atencao i{background:var(--warning)}
.bd-barra.is-critico i{background:var(--danger)}
.bd-secao{margin-bottom:16px;padding:18px}
.bd-secao h2{margin:0;font-size:1.05rem;color:var(--text-strong)}
.bd-secao-topo{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:14px}
.bd-secao-topo p{margin:4px 0 0;color:var(--muted);font-size:.88rem}
.bd-lista-espaco{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.bd-lista-espaco li{display:grid;grid-template-columns:minmax(200px,2.2fr) minmax(120px,3fr) 90px 100px;gap:12px;align-items:center;font-size:.9rem}
.bd-lista-espaco .bd-rotulo{color:var(--muted-strong)}
.bd-lista-espaco strong{text-align:right;color:var(--text-strong)}
.bd-lista-espaco small{color:var(--muted)}
.bd-trilho{height:10px;border-radius:999px;background:var(--line-soft);overflow:hidden}
.bd-trilho i{display:block;height:100%;border-radius:999px;background:var(--brand-strong)}
.bd-form{display:grid;gap:12px;margin-top:12px}
.bd-campos{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:12px;align-items:start}
.bd-form label{display:grid;gap:6px;font-size:.82rem;font-weight:700;color:var(--muted-strong)}
.bd-form label small{font-weight:500;color:var(--muted)}
.bd-form input:not([type=checkbox]),.bd-form select{width:100%;box-sizing:border-box}
.bd-detalhe summary{display:flex;align-items:center;justify-content:space-between;gap:12px;cursor:pointer;list-style:none}
.bd-detalhe summary::-webkit-details-marker{display:none}
.bd-detalhe summary span{font-size:.82rem;color:var(--muted)}
.bd-detalhe.is-perigo{border-color:rgba(255,91,102,.35)}
.bd-detalhe.is-perigo summary span{color:var(--danger)}
@media (max-width:1000px){.bd-page .bd-resumo{grid-template-columns:1fr}.bd-lista-espaco li{grid-template-columns:1fr 80px}.bd-lista-espaco .bd-trilho,.bd-lista-espaco small{display:none}.bd-secao-topo{flex-direction:column}}
.bd-form label.integration-enable{display:flex;align-items:center;gap:10px;font-size:.9rem;font-weight:600}
.bd-form label.integration-enable input{width:auto;margin:0}
/* A pagina e mais alta que a tela: rola dentro do painel (sem cortar o fim) */
.dash-main.bd-page{display:flex;flex-direction:column;overflow-y:auto}
.bd-page > *{flex:none}
.bd-page .page-alert{width:auto}

/* ---- Configuracoes > Mercado Pago ---- */
.mpc-page .dash-main, .dash-main.mpc-page{display:flex;flex-direction:column;overflow-y:auto}
.mpc-page > *{flex:none}
.mpc-passos{list-style:none;margin:0 0 16px;padding:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.mpc-passos li a{display:flex;align-items:center;gap:10px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--text);text-decoration:none;height:100%;box-sizing:border-box}
.mpc-passos li a:hover{border-color:var(--brand-strong)}
.mpc-passos b{flex:none;width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font-size:.85rem;background:var(--line-soft);color:var(--muted-strong)}
.mpc-passos li.is-ok b{background:rgba(23,201,121,.18);color:var(--success)}
.mpc-passos li.is-ok a{border-color:rgba(23,201,121,.45)}
.mpc-passos strong{display:block;font-size:.9rem;color:var(--text-strong)}
.mpc-passos small{display:block;color:var(--muted);font-size:.78rem;line-height:1.25;margin-top:2px}
.mpc-dica{margin:6px 0 10px;color:var(--muted);font-size:.85rem;line-height:1.4}
.mpc-nova-loja .mpc-loja-campos{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.mpc-nova-loja .span-two{grid-column:1 / -1}
.mpc-geo{display:grid;gap:8px}
.mpc-geo-resultado{padding:10px 12px;border-radius:10px;border:1px solid var(--line);background:var(--panel-soft);font-size:.86rem;line-height:1.4;color:var(--muted-strong)}
.mpc-geo-resultado small{display:block;margin-top:4px;color:var(--muted)}
.mpc-geo-resultado a{color:var(--brand-strong)}
.mpc-geo-resultado.is-ok{border-color:rgba(23,201,121,.5);background:rgba(23,201,121,.1)}
.mpc-geo-resultado.is-aviso{border-color:rgba(255,210,77,.6);background:rgba(255,210,77,.12)}
.mpc-geo-resultado.is-erro{border-color:rgba(255,91,102,.5);background:rgba(255,91,102,.1);color:var(--danger)}
.mpc-manual{border:1px dashed var(--line);border-radius:10px;padding:8px 12px}
.mpc-manual summary{cursor:pointer;font-size:.85rem;color:var(--muted-strong)}
.mpc-manual label{display:grid;gap:6px;margin-top:10px}
.mpc-manual small{color:var(--muted);font-weight:400}
.mpc-coords{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}
@media (max-width:1000px){.mpc-passos{grid-template-columns:repeat(2,minmax(0,1fr))}.mpc-nova-loja .mpc-loja-campos,.mpc-coords{grid-template-columns:1fr}}
.mpc-form .integration-check{display:flex;align-items:center;gap:10px;font-weight:600}
.mpc-form .integration-check input[type=checkbox]{width:18px;height:18px;flex:none;margin:0}
.mpc-pendente{display:flex;align-items:center;justify-content:space-between;gap:14px;margin:0 0 12px;padding:12px 14px;border:1px solid rgba(255,210,77,.7);border-radius:10px;background:rgba(255,210,77,.14);color:var(--text-strong);font-size:.9rem;line-height:1.4}
.mpc-pendente[hidden]{display:none}
.mpc-destaque{outline:3px solid var(--success);outline-offset:2px;border-radius:8px;transition:outline-color .3s}
@media (max-width:700px){.mpc-pendente{flex-direction:column;align-items:stretch}}

/* ---- Configuracoes > Naturezas de Operacao ---- */
.dash-main.nat-page{display:flex;flex-direction:column;overflow-y:auto}
.nat-page > *{flex:none}
.nat-page .form-card{padding:18px;margin-bottom:16px}
.nat-page h2{margin:0 0 4px;font-size:1.05rem;color:var(--text-strong)}
.nat-page header p{margin:0;color:var(--muted);font-size:.88rem}
.nat-info ul{margin:8px 0 0;padding-left:20px;display:grid;gap:6px;color:var(--muted-strong);font-size:.9rem;line-height:1.45}
.nat-padroes-form{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px;margin-top:14px;align-items:start}
.nat-padroes-form label{display:grid;gap:6px;font-size:.85rem;color:var(--muted-strong)}
.nat-padrao-titulo{font-weight:700;color:var(--text-strong)}
.nat-padroes-form small{color:var(--muted);font-weight:400}
.nat-padroes-form select{width:100%;box-sizing:border-box}
.nat-padroes-acao{grid-column:1 / -1;display:flex;justify-content:flex-end}
.nat-chips{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px;margin-top:12px}
.nat-chip{display:grid;gap:2px;text-align:left;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel-soft);color:var(--text);cursor:pointer;font:inherit}
.nat-chip:hover{border-color:var(--brand-strong)}
.nat-chip strong{font-size:.9rem;color:var(--text-strong)}
.nat-chip small{color:var(--muted);font-size:.78rem}
.nat-cabecalho,.nat-linha{display:grid;grid-template-columns:minmax(200px,2.2fr) minmax(180px,2fr) minmax(130px,1.2fr) 90px minmax(260px,auto);gap:14px;align-items:center}
.nat-cabecalho{padding:0 8px 8px;font-size:.72rem;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);border-bottom:1px solid var(--line-soft)}
.nat-linha{padding:14px 8px;border-bottom:1px solid var(--line-soft)}
.nat-linha:last-child{border-bottom:0}
.nat-linha.is-inativa{opacity:.62}
.nat-nome strong{display:block;color:var(--text-strong)}
.nat-etiquetas{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.nat-tag{display:inline-block;padding:2px 9px;border-radius:999px;font-size:.72rem;font-weight:700;background:rgba(152,167,189,.18);color:var(--muted-strong)}
.nat-tag.is-azul{background:rgba(52,165,255,.16);color:var(--brand-strong)}
.nat-tag.is-verde{background:rgba(23,201,121,.16);color:var(--success)}
.nat-tag.is-cinza{background:rgba(152,167,189,.28)}
.nat-cfop b,.nat-csosn b{display:block;font-size:1.05rem;color:var(--text-strong)}
.nat-cfop small,.nat-csosn small{display:block;color:var(--muted);font-size:.8rem;line-height:1.3}
.nat-acoes{display:flex;gap:8px;justify-content:flex-end;flex-wrap:wrap}
.nat-acoes form{margin:0}
.ghost-action.is-perigo{color:var(--danger)}
.nat-vazio{padding:24px 8px;color:var(--muted-strong)}
.nat-form{display:grid;gap:12px}
.nat-form label{display:grid;gap:6px;font-size:.85rem;font-weight:700;color:var(--muted-strong)}
.nat-form label small{font-weight:400;color:var(--muted)}
.nat-form input:not([type=checkbox]),.nat-form select{width:100%;box-sizing:border-box}
.nat-passo{display:flex;align-items:center;gap:10px;margin-top:6px;font-weight:700;color:var(--text-strong)}
.nat-passo b{width:24px;height:24px;border-radius:50%;display:grid;place-items:center;font-size:.78rem;background:var(--brand);color:#fff;flex:none}
.nat-passo em{font-weight:400;color:var(--muted);font-style:normal}
.nat-dica{margin:0;color:var(--muted);font-size:.88rem}
.nat-cfop-info{padding:9px 12px;border-radius:10px;border:1px solid var(--line);background:var(--panel-soft);font-size:.86rem;line-height:1.4;color:var(--muted-strong)}
.nat-cfop-info.is-ok{border-color:rgba(23,201,121,.5);background:rgba(23,201,121,.1)}
.nat-cfop-info.is-aviso{border-color:rgba(255,210,77,.7);background:rgba(255,210,77,.14);color:var(--text-strong)}
.nat-form label.nat-estoque-opcao{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:10px;font-weight:600}
.nat-estoque-opcao input{width:18px;height:18px;margin-top:2px;flex:none}
.nat-estoque-opcao span{display:grid;gap:2px}
.nat-exemplo{padding:12px;border-radius:10px;background:var(--panel-soft);border:1px dashed var(--line);font-size:.88rem;color:var(--muted-strong);display:grid;gap:4px}
.nat-modal-card{max-width:620px;width:calc(100vw - 32px);max-height:calc(100vh - 40px);overflow-y:auto}
@media (max-width:1100px){
  .nat-padroes-form{grid-template-columns:1fr}
  .nat-cabecalho{display:none}
  .nat-linha{grid-template-columns:1fr;gap:8px}
  .nat-acoes{justify-content:flex-start}
}
.nat-page .page-top{flex-wrap:wrap;gap:14px 24px;align-items:flex-start}
.nat-page .page-top > div:first-child{flex:1 1 420px;min-width:0}
.nat-page .page-top > div:first-child p{max-width:640px}
.nat-page .page-top .list-actions{flex:0 0 auto}
.nat-cabecalho,.nat-linha{grid-template-columns:minmax(190px,2fr) minmax(170px,1.8fr) minmax(120px,1fr) 90px 300px}
.nat-acoes{flex-wrap:nowrap}
.nat-padroes-form{align-items:stretch}
.nat-padroes-form label{grid-template-rows:auto 1fr auto;align-content:stretch}
.nat-page .page-top p{white-space:normal}
.nat-page .page-top h1{white-space:normal}
/* Cabecalho das telas novas: o subtitulo pode quebrar linha em vez de ficar por baixo dos botoes */
.bd-page .page-top,.mpc-page .page-top,.rjp-page .page-top{flex-wrap:wrap;gap:14px 24px}
.bd-page .page-top > div:first-child,.mpc-page .page-top > div:first-child,.rjp-page .page-top > div:first-child{flex:1 1 380px;min-width:0}
.bd-page .page-top p,.mpc-page .page-top p,.rjp-page .page-top p,.bd-page .page-top h1,.mpc-page .page-top h1,.rjp-page .page-top h1{white-space:normal}

/* Pedido: transportadora informada exige escolher quem paga o frete */
.frete-obrigatorio{margin:-4px 0 4px;padding:8px 12px;border-radius:10px;border:1px solid rgba(255,210,77,.7);background:rgba(255,210,77,.14);color:var(--text-strong);font-size:.88rem;line-height:1.4}
.frete-obrigatorio[hidden]{display:none}
.seg-control.precisa-escolher{outline:2px dashed rgba(217,119,6,.55);outline-offset:3px;border-radius:12px}
.seg-control.is-invalid{outline:2px solid var(--danger);outline-offset:3px;border-radius:12px}

/* Nota fiscal em edicao com alteracoes nao salvas: emitir fica bloqueado ate salvar */
[data-nfe-emitir].is-bloqueado{opacity:.5;cursor:not-allowed}
.nfe-salvar-antes{display:block;margin-top:4px;color:#b45309;font-size:.8rem;font-weight:700}
.nfe-salvar-antes[hidden]{display:none}

/* ---- Configuracoes > Assistencia remota ---- */
.dash-main.sr-page{display:flex;flex-direction:column;overflow-y:auto;gap:14px}
/* os quadros mantem a altura do conteudo (sem encolher na coluna de altura fixa) e a pagina rola inteira */
.dash-main.sr-page>*{flex:0 0 auto;min-height:auto}
.sr-page .sr-card{overflow:visible}
.sr-page .sr-tabela-wrap{overflow-x:auto;overflow-y:visible}
.sr-page .sr-grade{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.sr-card{display:flex;flex-direction:column;gap:10px;padding:18px}
.sr-card>header{display:flex;align-items:center;gap:10px}
.sr-card h2{margin:0;font-size:1.05rem}
.sr-num{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:50%;background:var(--primary,#3b6fb6);color:#fff;font-weight:800;font-size:.9rem}
.sr-ajuda{border-left:4px solid #1a9d5a}
.sr-ajuda .sr-botao{width:100%;max-width:420px;min-height:46px;align-self:stretch}
.sr-form.sr-form-linha{display:flex;flex-direction:row;gap:8px;align-items:center}
.sr-form.sr-form-linha button{flex:none;width:auto;padding:0 22px}
.sr-form-linha input{flex:1;min-width:0}
.sr-canal{display:inline-block;margin-right:4px;padding:1px 8px;border-radius:999px;background:#eef2f6;color:#475467;font-size:.72rem;font-weight:700}
.sr-chamar{padding:2px 10px!important;min-height:0!important;font-size:.78rem!important;text-decoration:none}
.sr-avancado>summary{cursor:pointer;font-weight:700;line-height:1.4}
.sr-avancado[open]>summary{margin-bottom:12px}
.sr-avancado>.sr-seguro{margin-bottom:12px}
.sr-seguro{line-height:1.5;padding:12px 16px;border:1px solid #bfe3cd;border-left:4px solid #1a9d5a;background:#f0faf4;border-radius:10px;color:#17402b}
.sr-botao{align-self:flex-start}
.sr-dica{margin:0;color:var(--muted,#667085);font-size:.85rem;line-height:1.45}
.sr-outros summary,.sr-manual summary{cursor:pointer;font-weight:700}
.sr-links{display:flex;flex-wrap:wrap;gap:8px;margin:10px 0}
.sr-form{display:grid;gap:10px}
.sr-form label{display:grid;gap:4px;font-weight:600}
.sr-msg{margin:0;min-height:18px;font-size:.9rem}
.sr-msg.is-ok{color:#0a7a3d}
.sr-msg.is-erro{color:#b42318}
.sr-lista-topo{display:flex;justify-content:space-between;align-items:center;gap:10px}
.sr-tabela-wrap{overflow-x:auto}
.sr-tabela{width:100%;border-collapse:collapse;font-size:.9rem}
.sr-tabela th,.sr-tabela td{text-align:left;padding:8px 10px;border-bottom:1px solid var(--line-soft,#e4e7ec);vertical-align:top}
.sr-tabela th{font-size:.78rem;text-transform:uppercase;letter-spacing:.03em;color:var(--muted,#667085)}
.sr-vazio{text-align:center!important;color:var(--muted,#667085);padding:18px!important}
.sr-copiar{border:1px solid var(--line-soft,#d0d5dd);background:var(--panel,#fff);color:inherit;border-radius:6px;padding:1px 8px;font-size:.75rem;cursor:pointer}
.sr-selo{display:inline-block;padding:2px 10px;border-radius:999px;font-size:.78rem;font-weight:700;background:#eef2f6;color:#475467;white-space:nowrap}
.sr-selo.is-aberto{background:#fff4d6;color:#8a5a00}
.sr-selo.is-em_atendimento{background:#dcebff;color:#1d4f9f}
.sr-selo.is-concluido{background:#d9f5e3;color:#0a7a3d}
.sr-acoes{display:flex;flex-wrap:wrap;gap:6px}
.sr-dados{display:grid;gap:8px;margin:10px 0}
.sr-dados div{display:grid;grid-template-columns:150px 1fr;gap:8px;align-items:center}
.sr-dados dt{font-weight:700}
.sr-dados dd{margin:0;word-break:break-all}
.sr-chave{font-size:.8rem}
@media (max-width:900px){.sr-page .sr-grade{grid-template-columns:1fr}.sr-dados div{grid-template-columns:1fr}}

/* Janela "Lancar contas" das compras: parcelas editaveis, aviso de vencimento e linha digitavel */
.lcc-parcelas .lcc-parcela{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr) minmax(0,1fr);gap:10px;align-items:end;padding:8px 0;border-top:1px solid var(--line-soft,#e4e7ec)}
.lcc-parcelas .lcc-parcela>span{font-weight:700;font-size:13px;align-self:center}
.lcc-parcelas .lcc-parcela label{display:grid;gap:3px;font-size:11px;font-weight:700;color:var(--muted,#64748b)}
.lcc-parcelas .lcc-parcela input{width:100%;min-height:38px}
.lcc-parcelas input.is-atencao{border-color:#d97706;box-shadow:0 0 0 2px rgba(217,119,6,.2)}
.lcc-aviso{margin:8px 0;padding:8px 12px;border-radius:10px;font-size:.85rem;line-height:1.4;background:#fff4d6;color:#7a4b00;border:1px solid #f1d28a}
.lcc-aviso.is-erro{background:#fde8e8;color:#9b1c1c;border-color:#f5b5b5}
.lcc-boleto input{width:100%;margin-top:4px}
.lcc-boleto [data-lcc-linha-info]{font-weight:600;min-height:16px}
.lcc-boleto [data-lcc-linha-info].is-ok{color:#0a7a3d}
.lcc-boleto [data-lcc-linha-info].is-erro{color:#b42318}
.lcc-boleto [data-lcc-linha-info].is-aviso{color:#8a5a00}
@media (max-width:560px){.lcc-parcelas .lcc-parcela{grid-template-columns:1fr 1fr}.lcc-parcelas .lcc-parcela>span{grid-column:1/-1}}

/* ---- Cobranca (CRM) ---- */
.dash-main.crm-page{display:flex;flex-direction:column;overflow:hidden;gap:12px}
.crm-page .page-top{flex-wrap:wrap;gap:12px 22px;margin-bottom:6px}
.crm-page .page-top>div:first-child{flex:1 1 320px;min-width:0}
.crm-page .page-top h1,.crm-page .page-top p{white-space:normal}
.crm-page .page-top .form-actions{flex:0 1 auto;flex-wrap:wrap}
.crm-page .sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.crm-kpis{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;flex:none}
.crm-kpi{display:flex;flex-direction:column;gap:0;min-width:0;padding:7px 12px 8px;border-radius:12px;background:var(--panel,#fff);border:1px solid var(--line-soft,#e4e7ec);border-left:4px solid var(--line,#cbd5e1)}
.crm-kpi small{font-size:.66rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;color:var(--muted,#667085);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-kpi strong{font-size:1.05rem;color:var(--text-strong,#101828);line-height:1.25}
.crm-kpi span{font-size:.72rem;line-height:1.3;color:var(--muted,#667085);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-kpi.is-principal{border-left-color:#3b6fb6}
.crm-kpi.is-atencao{border-left-color:#d97706}
.crm-kpi.is-ok{border-left-color:#16a34a}
.crm-filtros{display:flex;gap:10px;flex-wrap:wrap;flex:none}
.crm-filtros input,.crm-filtros select{min-height:40px}
.crm-busca{flex:1 1 260px}
.crm-busca input{width:100%}
.crm-aviso{flex:none;margin:0;padding:9px 14px;border-radius:10px;font-size:.88rem;background:#eef2f6;color:#344054}
.crm-aviso.is-ok{background:#e3f6ea;color:#14532d}
.crm-aviso.is-erro{background:#fde8e8;color:#9b1c1c}
.crm-quadro{flex:1;min-height:0;display:flex;gap:12px;overflow-x:auto;overflow-y:hidden;padding-bottom:6px}
.crm-coluna{flex:0 0 300px;display:flex;flex-direction:column;min-height:0;border-radius:14px;background:var(--panel-soft,#f2f4f7);border-top:4px solid var(--cor,#64748b);padding:10px 8px 8px}
.crm-coluna.is-alvo{outline:2px dashed var(--cor,#64748b);outline-offset:-4px;background:var(--panel,#fff)}
.crm-coluna>header{display:flex;justify-content:space-between;align-items:center;padding:0 6px}
.crm-coluna h3{margin:0;font-size:.92rem;color:var(--text-strong,#101828)}
.crm-contagem{min-width:24px;text-align:center;padding:1px 8px;border-radius:999px;background:var(--cor,#64748b);color:#fff;font-size:.75rem;font-weight:800}
.crm-total{margin:2px 6px 8px;font-size:.82rem;font-weight:700;color:var(--muted,#667085)}
.crm-cartoes{flex:1;min-height:0;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding:0 2px 4px}
.crm-cartao{display:flex;flex-direction:column;gap:7px;padding:10px 12px;border-radius:12px;background:var(--panel,#fff);border:1px solid var(--line-soft,#e4e7ec);cursor:pointer;box-shadow:0 1px 2px rgba(16,24,40,.05)}
.crm-cartao:hover,.crm-cartao:focus-visible{border-color:#3b6fb6;box-shadow:0 2px 8px rgba(59,111,182,.2);outline:none}
.crm-cartao.is-arrastando{opacity:.45}
.crm-cartao-topo{display:flex;justify-content:space-between;gap:8px;align-items:flex-start}
.crm-cartao-topo strong{font-size:.9rem;line-height:1.25;color:var(--text-strong,#101828);overflow-wrap:anywhere}
.crm-valor{flex:none;font-weight:800;font-size:.88rem;color:var(--text-strong,#101828)}
.crm-cartao-meta,.crm-cartao-rodape{display:flex;flex-wrap:wrap;gap:6px;align-items:center;font-size:.76rem;color:var(--muted,#667085)}
.crm-atraso{padding:1px 8px;border-radius:999px;background:#eef2f6;color:#475467;font-weight:700}
.crm-atraso.is-medio{background:#fff4d6;color:#8a5a00}
.crm-atraso.is-alto{background:#ffe4d0;color:#9a3a00}
.crm-atraso.is-grave{background:#fde8e8;color:#9b1c1c}
.crm-tag{display:inline-block;padding:1px 8px;border-radius:999px;background:#eef2f6;color:#475467;font-size:.72rem;font-weight:700;white-space:nowrap}
.crm-tag.is-atrasado,.crm-tag.is-quebrada{background:#fde8e8;color:#9b1c1c}
.crm-tag.is-hoje,.crm-tag.is-pendente{background:#fff4d6;color:#8a5a00}
.crm-tag.is-promessa{background:#e5f1ff;color:#1d4f9f}
.crm-tag.is-cumprida{background:#e3f6ea;color:#14532d}
.crm-avatar{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:50%;background:#3b6fb6;color:#fff;font-size:.65rem;font-weight:800}
.crm-sem-resp{font-style:italic}
.crm-vazio,.crm-carregando{margin:6px;font-size:.85rem;color:var(--muted,#667085);text-align:center}
.crm-fundo{position:fixed;inset:0;background:rgba(16,24,40,.45);z-index:60}
.crm-gaveta{position:fixed;top:0;right:0;bottom:0;width:min(540px,100vw);z-index:61;display:flex;flex-direction:column;background:var(--panel,#fff);box-shadow:-8px 0 30px rgba(16,24,40,.25)}
.crm-gaveta[hidden],.crm-fundo[hidden]{display:none}
.crm-gaveta-topo{display:flex;justify-content:space-between;gap:12px;padding:18px 20px 12px;border-bottom:1px solid var(--line-soft,#e4e7ec)}
.crm-gaveta-topo h2{margin:0;font-size:1.1rem;color:var(--text-strong,#101828)}
.crm-gaveta-topo p{margin:2px 0 0;font-size:.82rem;color:var(--muted,#667085)}
.crm-fechar{flex:none;width:36px;height:36px;border-radius:10px;border:1px solid var(--line-soft,#e4e7ec);background:transparent;font-size:1.4rem;line-height:1;cursor:pointer;color:inherit}
.crm-gaveta-corpo{flex:1;overflow-y:auto;padding:14px 20px 28px;display:flex;flex-direction:column;gap:12px}
.crm-gaveta-corpo>*{flex:0 0 auto}
.crm-g-resumo{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:10px}
.crm-g-resumo div{padding:10px 12px;border-radius:12px;background:var(--panel-soft,#f2f4f7)}
.crm-g-resumo small{display:block;font-size:.7rem;font-weight:700;text-transform:uppercase;color:var(--muted,#667085)}
.crm-g-resumo strong{font-size:1.1rem;color:var(--text-strong,#101828)}
.crm-g-contato{display:flex;flex-wrap:wrap;gap:12px;align-items:center;font-size:.88rem}
.crm-link{font-weight:700;color:#3b6fb6;text-decoration:none}
.crm-g-campos{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.crm-g-campos label,.crm-painel label{display:grid;gap:4px;font-size:.78rem;font-weight:700;color:var(--muted,#667085)}
.crm-g-campos select,.crm-painel input,.crm-painel select,.crm-painel textarea{width:100%;min-height:40px}
.crm-g-retorno{margin:0;padding:8px 12px;border-radius:10px;background:#eef2f6;font-size:.88rem}
.crm-g-retorno.is-atrasado{background:#fde8e8;color:#9b1c1c}
.crm-acoes{display:flex;flex-wrap:wrap;gap:8px}
.crm-perigo{color:#b42318!important}
.crm-perigo-btn{background:#b42318!important;border-color:#b42318!important}
.crm-painel{padding:14px;border-radius:12px;border:1px solid var(--line-soft,#e4e7ec);background:var(--panel-soft,#f8fafc)}
.crm-painel form{display:grid;gap:10px}
.crm-painel[hidden]{display:none}
.crm-botoes{display:flex;gap:8px;flex-wrap:wrap}
.crm-dica{margin:0;font-size:.8rem;color:var(--muted,#667085);line-height:1.4}
.crm-msg{margin:0;min-height:18px;font-size:.88rem}
.crm-msg.is-ok{color:#0a7a3d}
.crm-msg.is-erro{color:#b42318}
.crm-g-titulo{margin:6px 0 0;font-size:.9rem;color:var(--text-strong,#101828)}
.crm-promessas{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.crm-promessas li{display:flex;justify-content:space-between;gap:8px;align-items:center;padding:8px 12px;border-radius:10px;background:var(--panel-soft,#f2f4f7);font-size:.86rem}
.crm-tabela-wrap{overflow-x:auto}
.crm-tabela{width:100%;border-collapse:collapse;font-size:.84rem}
.crm-tabela th,.crm-tabela td{text-align:left;padding:7px 8px;border-bottom:1px solid var(--line-soft,#e4e7ec)}
.crm-tabela th{font-size:.7rem;text-transform:uppercase;color:var(--muted,#667085)}
.crm-tempo{list-style:none;margin:0;padding:0 0 0 10px;border-left:2px solid var(--line-soft,#e4e7ec);display:grid;gap:12px}
.crm-tempo li{position:relative;padding-left:10px}
.crm-tempo li::before{content:"";position:absolute;left:-17px;top:6px;width:10px;height:10px;border-radius:50%;background:var(--line,#cbd5e1)}
.crm-tempo li.is-whatsapp::before,.crm-tempo li.is-whatsapp_enviada::before{background:#16a34a}
.crm-tempo li.is-whatsapp_recebida::before{background:#0ea5e9}
.crm-tempo li.is-promessa::before{background:#f59e0b}
.crm-tempo li.is-pagamento::before{background:#16a34a}
.crm-tempo-topo{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.crm-tempo-topo small{color:var(--muted,#667085);font-size:.74rem}
.crm-tempo p{margin:4px 0 0;font-size:.86rem;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere}
.crm-tag.is-regua{background:#e5f1ff;color:#1d4f9f}
.crm-tag.is-regua.is-simulado{background:#fff4d6;color:#8a5a00}
.crm-g-regua{margin:0;padding:8px 12px;border-radius:10px;background:#e5f1ff;color:#1d4f9f;font-size:.84rem}
.crm-g-regua.is-simulado{background:#fff4d6;color:#8a5a00}
.crm-link{background:none;border:0;padding:0;cursor:pointer;font:inherit;font-weight:700}
.crm-perigo-txt{color:#b42318}
.crm-erro-txt{color:#b42318}
.crm-g-optout{margin:0;padding:8px 12px;border-radius:10px;background:#fde8e8;color:#7a1414;font-size:.84rem}
.crm-acordo{display:grid;gap:8px}
.crm-acordo>p{margin:0;font-size:.86rem}
.crm-acordo .ghost-action{justify-self:start}
.crm-regua-status{display:grid;gap:4px;padding:12px 14px;border-radius:12px;font-size:.84rem;background:var(--panel-soft,#f2f4f7);border-left:4px solid #98a2b3}
.crm-regua-status.is-simulando{background:#fff4d6;border-left-color:#d99a00}
.crm-regua-status.is-ligada{background:#e3f6ea;border-left-color:#1f9d55}
.crm-regua-form{display:grid;gap:14px}
.crm-regua-form fieldset{display:grid;gap:10px;margin:0;padding:12px 14px;border:1px solid var(--line-soft,#e4e7ec);border-radius:12px;min-width:0}
.crm-regua-form legend{padding:0 6px;font-weight:800;font-size:.86rem}
.crm-regua-form label{display:grid;gap:4px;font-size:.78rem;font-weight:700;color:var(--muted,#667085)}
.crm-regua-form input:not([type=checkbox]):not([type=radio]),.crm-regua-form select,.crm-regua-form textarea{width:100%;min-height:38px}
.crm-regua-form .crm-check{display:flex;align-items:flex-start;gap:8px;font-weight:600;font-size:.84rem;color:var(--text,#344054)}
.crm-regua-form .crm-check input{width:18px!important;height:18px!important;min-height:0!important;padding:0!important;margin:2px 0 0!important;border-radius:4px;flex:0 0 18px}
.crm-regua-form .crm-check input[type=radio]{border-radius:50%}
.crm-regua-form .crm-check span{flex:1;min-width:0}
.crm-regua-grade{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.crm-passo{display:grid;gap:8px;padding:10px;border-radius:10px;background:var(--panel-soft,#f2f4f7)}
.crm-passo+.crm-passo{margin-top:8px}
.crm-passo-topo{display:flex;flex-wrap:wrap;align-items:center;gap:10px;justify-content:space-between}
.crm-passo-topo label{display:flex;align-items:center;gap:6px}
.crm-passo-topo input{width:70px!important}
.crm-wa-qr{display:grid;gap:10px;justify-items:center;padding:14px;border:1px solid var(--line-soft,#e4e7ec);border-radius:12px}
.crm-wa-qr img{width:min(260px,100%);height:auto;background:#fff;border-radius:8px}
.crm-wa-qr ol{margin:0;padding-left:18px;font-size:.84rem;line-height:1.6;justify-self:start}
.crm-regua-form code{background:#eef2f6;padding:0 4px;border-radius:4px}
body.crm-gaveta-aberta{overflow:hidden}
@media (max-width:1100px){.crm-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}.dash-main.crm-page{overflow-y:auto}.crm-quadro{min-height:520px;flex:none}}
@media (max-width:560px){.crm-coluna{flex-basis:84vw}.crm-g-resumo{grid-template-columns:1fr 1fr}.crm-g-campos{grid-template-columns:1fr}}

/* ---- PDV: atalho "CPF/CNPJ na nota" (emissao automatica) ---- */
.pdv-doc-chip{display:inline-flex;align-items:center;gap:10px;max-width:100%;min-height:44px;padding:6px 14px;border-radius:999px;border:2px dashed rgba(255,255,255,.55);background:rgba(255,255,255,.10);color:#fff;font:inherit;cursor:pointer;text-align:left}
.pdv-doc-chip:hover,.pdv-doc-chip:focus-visible{background:rgba(255,255,255,.2);outline:none;border-color:#fff}
.pdv-doc-chip span{font-size:13px;font-weight:800;opacity:.85;white-space:nowrap}
.pdv-doc-chip strong{font-size:15px;font-weight:900;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pdv-doc-chip kbd{flex:0 0 auto;padding:1px 7px;border-radius:6px;background:rgba(255,255,255,.2);font:inherit;font-size:12px;font-weight:800}
.pdv-doc-chip.is-set{border-style:solid;border-color:#5ee19a;background:rgba(94,225,154,.18)}
.pdv-doc-chip{min-width:0}
.pdv-doc-chip strong{min-width:0;flex:1 1 auto}
/* No cartao de fechamento da tela da venda o espaco e fixo: atalho em uma linha so, com rotulo sobre o documento */
.pdv-close-total:has(.pdv-doc-chip){gap:14px;padding-right:0}
.pdv-close-total .pdv-doc-chip{flex:1 1 0;margin-right:0;display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:8px;row-gap:0;min-height:56px;padding:4px 14px;border-radius:14px}
.pdv-close-total .pdv-doc-chip span{grid-column:1;grid-row:1;font-size:11px;line-height:1.2}
.pdv-close-total .pdv-doc-chip strong{grid-column:1;grid-row:2;min-width:0;min-height:0;display:block;padding:0;border-radius:0;background:none;color:#fff;font-size:15px;line-height:1.25;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pdv-close-total .pdv-doc-chip kbd{grid-column:2;grid-row:1/3}
.pdv-close-total:has(.pdv-doc-chip) span:not(.pdv-doc-chip span){white-space:nowrap}
.pdv-payment-closeout .payments-modal-head:has(.pdv-doc-chip){grid-template-columns:44px 1fr auto;gap:10px}
.payments-modal-head button.pdv-doc-chip{width:auto;height:auto;min-height:44px;border-radius:999px;font-size:14px;line-height:1.2;margin-left:auto;color:var(--pdv-text,#001747);border-color:rgba(0,23,71,.4);background:rgba(0,23,71,.06)}
.payments-modal-head button.pdv-doc-chip.is-set{border-color:#1f9d55;background:rgba(31,157,85,.12)}
.payments-modal-head .pdv-doc-chip kbd{background:rgba(0,23,71,.12)}
@media (max-width:700px){.pdv-doc-chip span{display:none}.pdv-close-total{flex-wrap:wrap}}
.pdv-doc-aviso-card{text-align:center}
.pdv-doc-aviso-card h2{margin:6px 0 8px}
.pdv-doc-aviso-card p{margin:0 0 16px;line-height:1.5}
.pdv-doc-aviso-icone{width:56px;height:56px;margin:0 auto 6px;border-radius:50%;display:grid;place-items:center;background:#fff4d6;color:#8a5a00;font-size:34px;font-weight:900}
.pdv-doc-aviso-card .settle-actions{flex-wrap:wrap;justify-content:center}
.pdv-doc-aviso-card .cancel-action b{font-weight:inherit}

/* ---- Cobranca (CRM): abas e tarefas ---- */
.crm-vista{display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:0}
.crm-vista[hidden]{display:none}
.crm-abas{display:flex;gap:6px;border-bottom:1px solid var(--line-soft,#e4e7ec)}
.crm-abas button{display:inline-flex;align-items:center;gap:8px;padding:9px 16px;border:0;border-bottom:3px solid transparent;background:none;font:inherit;font-weight:700;color:var(--muted,#667085);cursor:pointer}
.crm-abas button.is-ativa{color:var(--text-strong,#101828);border-bottom-color:#3b6fb6}
.crm-aba-selo{min-width:20px;padding:0 6px;border-radius:999px;background:#d92d20;color:#fff;font-size:.72rem;line-height:20px;text-align:center}
.crm-tarefas-dica{align-self:center;margin:0}
.crm-tarefas-corpo{flex:1;min-height:0;overflow-y:auto;display:grid;gap:16px;align-content:start;padding-bottom:12px}
.crm-tarefas-grupo{display:grid;gap:8px}
.crm-tarefas-grupo h3{margin:0;font-size:.95rem;display:flex;align-items:center;gap:8px}
.crm-tarefas-grupo.is-atrasadas h3{color:#b42318}
.crm-tarefa{display:grid;gap:6px;padding:10px 14px;border:1px solid var(--line-soft,#e4e7ec);border-left:4px solid #98a2b3;border-radius:12px;background:var(--panel,#fff)}
.crm-tarefas-grupo.is-atrasadas .crm-tarefa{border-left-color:#d92d20}
.crm-tarefas-grupo.is-hoje .crm-tarefa{border-left-color:#d99a00}
.crm-tarefas-grupo.is-proximos .crm-tarefa{border-left-color:#3b6fb6}
.crm-tarefa-topo{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;justify-content:space-between}
.crm-tarefa-quem{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;min-width:0}
.crm-tarefa-acoes{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.crm-tarefa-acoes select{min-height:36px}
.crm-tarefa-texto{margin:0;font-size:.84rem;color:var(--muted,#667085)}
.crm-tarefa-form{display:grid;gap:10px;padding-top:6px;border-top:1px dashed var(--line-soft,#e4e7ec)}
.crm-tarefa-form label{display:grid;gap:4px;font-size:.78rem;font-weight:700;color:var(--muted,#667085)}
.crm-tarefa-form textarea,.crm-tarefa-form select,.crm-tarefa-form input{width:100%;min-height:38px}
.crm-tarefa-form-linha{display:grid;grid-template-columns:1fr 1fr;gap:10px}
@media (max-width:700px){.crm-tarefa-form-linha{grid-template-columns:1fr}}

/* ---- Cobranca (CRM): relatorios ---- */
.crm-relatorios .crm-rel-corpo{flex:1;min-height:0;overflow-y:auto;display:grid;gap:14px;align-content:start;padding-bottom:12px}
.crm-rel-filtros{align-items:center}
.crm-rel-datas{display:flex;align-items:center;gap:6px;font-size:.84rem;font-weight:700;color:var(--muted,#667085)}
.crm-rel-datas[hidden]{display:none}
.crm-rel-grade{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:14px}
.crm-rel-card{display:grid;gap:10px;align-content:start;padding:14px 16px;border:1px solid var(--line-soft,#e4e7ec);border-radius:14px;background:var(--panel,#fff)}
.crm-rel-card h3{margin:0;font-size:.95rem;display:flex;align-items:baseline;gap:8px}
.crm-rel-card h3 small{font-weight:600;color:var(--muted,#667085);font-size:.76rem}
.crm-kpi.is-verde{border-left-color:#1f9d55}.crm-kpi.is-azul{border-left-color:#3b6fb6}.crm-kpi.is-laranja{border-left-color:#d99a00}
.crm-barras{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.crm-barras li{display:grid;grid-template-columns:112px minmax(40px,1fr) 222px;gap:10px;align-items:center;font-size:.84rem}
.crm-barra-rot{color:var(--muted,#667085);font-weight:600;white-space:nowrap}
.crm-barra-trilho{height:12px;border-radius:4px;background:var(--panel-soft,#f2f4f7);overflow:hidden}
.crm-barra-trilho i{display:block;height:100%;border-radius:0 4px 4px 0;background:#3b6fb6}
.crm-barras b{font-weight:700;color:var(--text-strong,#101828);text-align:right;white-space:nowrap}
.crm-rel-dl{display:grid;gap:6px;margin:0}
.crm-rel-dl div{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border-bottom:1px solid var(--line-soft,#e4e7ec);font-size:.88rem}
.crm-rel-dl dt{color:var(--muted,#667085)}.crm-rel-dl dd{margin:0;font-weight:700;color:var(--text-strong,#101828);text-align:right}
.crm-rel-tabela td:not(:first-child),.crm-rel-tabela th:not(:first-child){text-align:right}
@media (max-width:700px){.crm-barra-rot{white-space:normal}.crm-barras li{grid-template-columns:96px minmax(40px,1fr)}.crm-barras b{grid-column:1/-1;text-align:left}}

/* ---- Sicredi: extrato de titulos com split ---- */
.sx-filtros{display:flex;flex-wrap:wrap;gap:12px;align-items:flex-end;margin-bottom:8px}
.sx-filtros label{display:grid;gap:4px;font-size:.78rem;font-weight:700;color:var(--muted,#667085)}
.sx-filtros input,.sx-filtros select{min-height:40px}
.sx-acoes{display:flex;flex-wrap:wrap;gap:8px;margin-left:auto}
.sx-msg{min-height:1.2em;margin:4px 0 8px;font-size:.84rem;color:var(--muted,#667085)}.sx-msg.is-ok{color:#14532d}.sx-msg.is-erro{color:#b42318}
.sx-geral h4,.sx-empresa h4,.sx-agenda h4{margin:0;font-size:.95rem}
.sx-kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;margin:10px 0}
.sx-kpi{display:grid;gap:2px;padding:12px 14px;border-radius:12px;border:1px solid var(--line-soft,#e4e7ec);border-left:4px solid #98a2b3;background:var(--panel,#fff)}
.sx-kpi small{font-size:.72rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#667085)}.sx-kpi strong{font-size:1.2rem}.sx-kpi span{font-size:.8rem;color:var(--muted,#667085)}
.sx-kpi.is-ok,.sx-chips .is-ok{border-left-color:#1f9d55}.sx-kpi.is-azul,.sx-chips .is-azul{border-left-color:#3b6fb6}.sx-kpi.is-amarelo,.sx-chips .is-amarelo{border-left-color:#d99a00}
.sx-agenda{margin:8px 0 18px}.sx-agenda-itens{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.sx-dia{display:grid;gap:1px;padding:8px 12px;border-radius:10px;background:var(--panel-soft,#f2f4f7);min-width:120px}.sx-dia span{font-weight:800}.sx-dia small{color:var(--muted,#667085);font-size:.72rem}
.sx-empresa{margin-top:18px;padding-top:14px;border-top:2px solid var(--line-soft,#e4e7ec)}
.sx-empresa header{display:flex;flex-wrap:wrap;gap:8px 16px;align-items:center;justify-content:space-between;margin-bottom:8px}
.sx-chips{display:flex;flex-wrap:wrap;gap:6px}.sx-chips span{padding:3px 10px;border-radius:999px;border-left:3px solid #98a2b3;background:var(--panel-soft,#f2f4f7);font-size:.78rem;font-weight:700}
.sx-tabela-wrap{overflow-x:auto}.sx-tabela{width:100%;border-collapse:collapse;font-size:.82rem}
.sx-tabela th{text-align:left;padding:8px;border-bottom:2px solid var(--line-soft,#e4e7ec);font-size:.7rem;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#667085);white-space:nowrap}
.sx-tabela td{padding:8px;border-bottom:1px solid var(--line-soft,#e4e7ec);vertical-align:top}
.sx-tabela td small{display:block;color:var(--muted,#667085);font-size:.72rem}.sx-num{text-align:right;white-space:nowrap}
.sx-selo{display:inline-block;padding:2px 9px;border-radius:999px;font-size:.72rem;font-weight:800;white-space:nowrap}
.sx-selo.is-ok{background:#e3f6ea;color:#14532d}.sx-selo.is-azul{background:#e5f1ff;color:#1d4f9f}.sx-selo.is-amarelo{background:#fff4d6;color:#8a5a00}.sx-selo.is-neutro{background:#eef2f6;color:#475467}
.sx-erro{color:#b42318!important}.sx-vazio{margin:12px 0;color:var(--muted,#667085);text-align:center}

/* ---- Viagens: NF-e que ja tem CT-e em outra carga ---- */
.cte-duplicado{display:grid;gap:8px;grid-column:span 3;padding:10px 12px;border-radius:10px;background:#fff4d6;border:1px solid #f1d08a;color:#6b4a00;font-size:.84rem}
.cte-duplicado p{margin:0}.cte-duplicado a{font-weight:700;color:#8a5a00}
.cte-duplicado-acoes{display:flex;flex-wrap:wrap;gap:10px;align-items:flex-start}
.cte-duplicado-novo{flex:1 1 320px}
.cte-duplicado-novo summary{cursor:pointer;font-weight:700;padding:8px 0}
.cte-duplicado-novo form{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:6px}
.cte-duplicado-aviso{font-size:.78rem;margin:2px 0 4px!important}
.cte-reaproveitado{display:block;margin-top:2px;font-size:.72rem;color:var(--muted,#667085)}

/* ---- CRM: negociacoes do cliente e modo "Renegociar" ---- */
.crm-modos{display:flex;gap:6px;margin-bottom:10px}
.crm-modos button{flex:1;padding:8px 10px;border-radius:10px;border:1.5px solid var(--line-soft,#e4e7ec);background:var(--panel,#fff);font:inherit;font-weight:700;font-size:.82rem;cursor:pointer;color:var(--muted,#667085)}
.crm-modos button.is-ativa{border-color:#3b6fb6;color:#1d4f9f;background:#e5f1ff}
.crm-formal-titulos{list-style:none;margin:8px 0;padding:0;display:grid;gap:6px;max-height:240px;overflow:auto}
.crm-formal-titulos li{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:8px 10px;border-radius:10px;background:var(--panel-soft,#f2f4f7);font-size:.84rem}
.crm-formal-titulos label{display:flex;gap:8px;align-items:center;font-weight:600;color:var(--text,#344054)}
.crm-formal-total{margin:4px 0 10px;font-size:.88rem}
.crm-negociacoes{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.crm-negociacoes li{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:10px 12px;border-radius:10px;background:var(--panel-soft,#f2f4f7)}
.crm-negociacoes small{display:block;margin-top:2px;color:var(--muted,#667085);font-size:.78rem}
.crm-tag.is-neg-rascunho{background:#fff4d6;color:#8a5a00}.crm-tag.is-neg-aberto{background:#e5f1ff;color:#1d4f9f}.crm-tag.is-neg-concluida{background:#e3f6ea;color:#14532d}.crm-tag.is-neg-cancelado,.crm-tag.is-neg-cancelada{background:#fde8e8;color:#9b1c1c}
.crm-formal-titulos input[type="checkbox"]{width:18px;height:18px;min-height:0;padding:0;margin:0;flex:0 0 auto;border:0;background:none;box-shadow:none}
.crm-formal-titulos label{flex:1;min-width:0}

/* Impressao do Fluxo de Caixa */
.fci-filtros { margin: 10px 0 12px; color: #475569; font-size: 12px; }
.fci-resumo { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.fci-resumo > div { padding: 8px 12px; border: 1px solid #cbd5e1; border-radius: 8px; }
.fci-resumo small { display: block; color: #64748b; font-size: 10px; font-weight: 700; text-transform: uppercase; }
.fci-resumo strong { font-size: 15px; }
.fci-categorias { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 14px; }
.fci-categorias h2 { margin: 0 0 6px; font-size: 13px; }
.print-table.fci-tabela-cat th, .print-table.fci-tabela-cat td { padding: 3px 6px; font-size: 10px; }
.print-table.fci-tabela-cat th:nth-child(n+2), .print-table.fci-tabela-cat td:nth-child(n+2) { text-align: right; white-space: nowrap; }
.fci-barra { display: inline-block; width: 46px; height: 5px; margin-right: 6px; overflow: hidden; border-radius: 999px; background: #e5e7eb; vertical-align: middle; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.fci-barra i { display: block; height: 100%; background: #16a34a; }
.fci-barra.is-saidas i { background: #ef4444; }
.print-table.fci-tabela th, .print-table.fci-tabela td { padding: 2px 5px; font-size: 9.5px; line-height: 1.2; }
.print-table.fci-tabela td small { display: block; color: #64748b; font-size: 8px; line-height: 1.15; }
.print-table.fci-tabela th:nth-child(4), .print-table.fci-tabela td:nth-child(4), .print-table.fci-tabela th:nth-child(5), .print-table.fci-tabela td:nth-child(5) { text-align: left; }
.print-table.fci-tabela th:nth-child(n+6), .print-table.fci-tabela td:nth-child(n+6) { text-align: right; white-space: nowrap; }
.print-table.fci-tabela td.fci-entrada { color: #15803d; }
.print-table.fci-tabela td.fci-saida { color: #b91c1c; }
@media print { .fci-resumo > div { break-inside: avoid; } .print-table.fci-tabela thead { display: table-header-group; } }
.fci-orientacao { display: inline-flex; overflow: hidden; border: 1px solid var(--line, #cbd5e1); border-radius: 10px; }
.fci-orientacao button { padding: 8px 14px; border: 0; background: transparent; color: inherit; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.fci-orientacao button + button { border-left: 1px solid var(--line, #cbd5e1); }
.fci-orientacao button.is-ativo { background: var(--brand, #3b608f); color: #fff; }
.fci-page:not(.is-paisagem) .fci-resumo > div { padding: 6px 8px; }
.fci-page:not(.is-paisagem) .fci-resumo strong { font-size: 13px; }
.fci-page:not(.is-paisagem) .fci-categorias { gap: 12px; }
.fci-page:not(.is-paisagem) .print-title strong { font-size: 15px; }
.fci-page:not(.is-paisagem) .print-title h1 { font-size: 22px; }
.fci-page:not(.is-paisagem) .print-brand strong { font-size: 16px; }
.fci-page:not(.is-paisagem) .print-brand { flex: 1 1 55%; }

/* ===== Central da Reforma Tributária (app/views/reforma-tributaria.php) ===== */
.crt-page { --crt-gap: 18px; }
.crt-page .page-top > div:first-child { flex: 1 1 auto; min-width: 0; }
.crt-page .page-top h1, .crt-page .page-top p { white-space: normal; }
.crt-page h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 17px; color: var(--text-strong); }
.crt-page h3 { margin: 16px 0 8px; font-size: 14px; color: var(--text-strong); }
.crt-panel {
    border: 1px solid var(--line-soft);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03), 0 18px 45px rgba(2, 6, 23, .16);
    padding: 20px;
    min-width: 0;
    animation: crt-entrar var(--motion-duration-slow) var(--motion-ease) both;
}
:root[data-theme="light"] .crt-panel { box-shadow: 0 12px 34px rgba(16, 24, 40, .05); }
@keyframes crt-entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.crt-muted, .crt-panel small { color: var(--muted); font-size: 12px; }
.crt-empty-text { margin: 0 0 12px; color: var(--muted-strong); font-size: 14px; line-height: 1.5; }
.crt-icon { display: inline-flex; flex: 0 0 auto; width: 36px; height: 36px; align-items: center; justify-content: center; border-radius: 12px; background: var(--panel-soft); color: var(--app-blue); }
.crt-icon svg { width: 20px; height: 20px; }

.crt-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--crt-gap); }
.crt-tabs a, .crt-tabs span { padding: 9px 14px; border: 1px solid var(--line-soft); border-radius: 10px; font-weight: 700; font-size: 14px; text-decoration: none; background: var(--panel); color: var(--text-strong); transition: border-color var(--motion-duration-fast) var(--motion-ease); }
.crt-tabs a:hover { border-color: var(--brand); }
.crt-tabs a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }
.crt-tabs .is-disabled { color: var(--muted); opacity: .6; cursor: not-allowed; }

.crt-top { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: var(--crt-gap); margin-bottom: var(--crt-gap); }
.crt-readiness { display: flex; align-items: center; align-self: start; gap: 24px; }
.crt-ring { position: relative; flex: 0 0 auto; width: 132px; height: 132px; display: grid; place-items: center; }
.crt-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.crt-ring circle { fill: none; stroke: var(--line); stroke-width: 10; }
.crt-ring.is-empty circle { stroke-dasharray: 4 8; }
.crt-ring strong { font-size: 30px; color: var(--muted); }
.crt-readiness-body { min-width: 0; }
.crt-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0 0 12px; }
.crt-facts div { min-width: 0; }
.crt-facts dt { color: var(--muted); font-size: 12px; margin-bottom: 2px; }
.crt-facts dd { margin: 0; color: var(--text-strong); font-weight: 700; font-size: 14px; overflow-wrap: anywhere; }
.crt-facts--list { grid-template-columns: 1fr; }
.crt-soon { display: inline-block; padding: 6px 12px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: 13px; font-weight: 700; }

.crt-checklist { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.crt-checklist li { display: flex; align-items: flex-start; gap: 10px; color: var(--text-strong); font-size: 14px; }
.crt-checklist small { display: block; margin-top: 1px; }
.crt-dot { flex: 0 0 auto; width: 10px; height: 10px; margin-top: 5px; border-radius: 50%; background: var(--warning); }
.crt-checklist li.is-ok .crt-dot { background: var(--success); }
.crt-link { display: inline-flex; }

.crt-indicators { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--crt-gap); margin-bottom: 26px; }
.crt-indicator { display: grid; align-content: start; gap: 8px; }
.crt-indicator > small { font-size: 13px; color: var(--muted-strong); font-weight: 700; }
.crt-badge { justify-self: start; padding: 3px 10px; border-radius: 999px; background: var(--panel-soft); color: var(--muted-strong); font-size: 12px; font-weight: 800; }

.crt-section { margin-bottom: 26px; }
.crt-tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--crt-gap); }
.crt-tool { display: flex; flex-direction: column; gap: 8px; transition: border-color var(--motion-duration) var(--motion-ease), transform var(--motion-duration) var(--motion-ease); }
.crt-tool:not(.is-soon):hover { border-color: var(--brand); transform: translateY(-2px); }
.crt-tool h3 { margin: 6px 0 0; font-size: 15px; }
.crt-tool p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; flex: 1; }
.crt-tool .crt-link { align-self: flex-start; margin-top: 6px; }
.crt-tool-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.crt-status { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--panel-soft); color: var(--warning); white-space: nowrap; }
.crt-status.is-on { color: var(--success); }
:root[data-theme="light"] .crt-status { color: #a16207; }
:root[data-theme="light"] .crt-status.is-on { color: #15803d; }
.crt-tool.is-soon .crt-icon { color: var(--muted); }
.crt-next { margin-bottom: 26px; }

@media (max-width: 1180px) {
    .crt-top { grid-template-columns: 1fr; }
    .crt-indicators { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .crt-page { --crt-gap: 12px; }
    .crt-panel { padding: 14px; border-radius: 16px; }
    .crt-readiness { flex-direction: column; align-items: flex-start; gap: 14px; }
    .crt-ring { width: 104px; height: 104px; }
    .crt-indicators { grid-template-columns: 1fr; }
    .crt-page .page-top h1 { font-size: 24px; }
    .crt-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-right: -14px; padding-right: 14px; }
    .crt-tabs::-webkit-scrollbar { display: none; }
    .crt-tabs a, .crt-tabs span { flex: 0 0 auto; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
    .crt-panel { animation: none; }
    .crt-tool, .crt-tabs a { transition: none; }
}

/* Central da Reforma Tributária - Diagnóstico (app/views/partials/reforma-tributaria/diagnostico.php) */
.crt-ring svg { transform: rotate(-90deg); }
.crt-ring .crt-ring-value { stroke: var(--brand-strong); stroke-linecap: round; transition: stroke-dasharray var(--motion-duration-slow) var(--motion-ease); }
.crt-ring.is-preliminary .crt-ring-value { stroke: var(--warning); }
.crt-ring:not(.is-empty) strong { color: var(--text-strong); }
.crt-ring strong small { font-size: 15px; margin-left: 1px; color: var(--muted); }
.crt-situacao { display: inline-block; padding: 2px 10px; border-radius: 999px; background: var(--panel-soft); font-size: 13px; }
.crt-situacao.is-boa { color: var(--success); }
.crt-situacao.is-adequacao { color: var(--app-blue); }
.crt-situacao.is-atencao, .crt-situacao.is-critica { color: var(--danger); }
.crt-situacao.is-sem_dados { color: var(--muted); }
.crt-indicator-value { font-size: 28px; line-height: 1; color: var(--text-strong); }
.crt-prio-line { display: flex; flex-wrap: wrap; gap: 6px; }
.crt-prio { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; background: var(--panel-soft); }
.crt-prio.is-critica { color: #fff; background: var(--danger); }
.crt-prio.is-alta { color: var(--app-red); }
.crt-prio.is-media { color: var(--warning); }
.crt-prio.is-baixa { color: var(--app-blue); }
:root[data-theme="light"] .crt-prio.is-media { color: #a16207; }
:root[data-theme="light"] .crt-prio.is-alta { color: #c2410c; }
.crt-more { color: var(--app-blue); font-size: 13px; font-weight: 700; text-decoration: none; }
.crt-more:hover { text-decoration: underline; }
.crt-actions-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.crt-actions-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); }
.crt-actions-list li:first-child { border-top: 0; }
.crt-actions-list strong { display: block; color: var(--text-strong); font-size: 14px; }
.crt-actions-list small { display: block; margin-top: 2px; }

.crt-run-form { margin: 0; }
.crt-run-form .primary-action { gap: 8px; }
.crt-run-form .primary-action[disabled] { opacity: .65; cursor: progress; }
.crt-spinner { display: none; width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff; border-radius: 50%; animation: crt-girar .8s linear infinite; }
.crt-run-form .is-loading .crt-spinner { display: inline-block; }
@keyframes crt-girar { to { transform: rotate(360deg); } }

.crt-diag > .crt-panel, .crt-diag > section { margin-bottom: var(--crt-gap); }
.crt-empty { display: flex; align-items: center; gap: 24px; }
.crt-diag-summary { display: flex; align-items: center; gap: 28px; }
.crt-diag-summary-body { min-width: 0; flex: 1; }
.crt-diag-summary h2 .crt-badge { margin-left: 6px; color: var(--warning); }
.crt-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 14px 0; }
.crt-kpis div { padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 12px; }
.crt-kpis small { display: block; margin-bottom: 4px; }
.crt-kpis strong { font-size: 22px; color: var(--text-strong); }
.crt-kpis strong.is-ok { color: var(--success); }
.crt-kpis strong.is-warn { color: var(--warning); }
:root[data-theme="light"] .crt-kpis strong.is-warn { color: #a16207; }
.crt-compare summary { cursor: pointer; color: var(--text-strong); font-size: 14px; line-height: 1.6; }
.crt-compare[open] summary { margin-bottom: 12px; }
.crt-delta { font-weight: 800; color: var(--muted); }
.crt-delta.is-up { color: var(--success); }
.crt-delta.is-down { color: var(--danger); }

.crt-categories { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--crt-gap); margin-bottom: var(--crt-gap); }
.crt-category { display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: inherit; transition: border-color var(--motion-duration-fast) var(--motion-ease), transform var(--motion-duration-fast) var(--motion-ease); }
.crt-category:hover { border-color: var(--brand); transform: translateY(-2px); }
.crt-category.is-active { border-color: var(--brand-strong); }
.crt-category-title { font-weight: 800; color: var(--text-strong); font-size: 14px; }
.crt-bar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--panel-soft); gap: 2px; }
.crt-bar span { min-width: 6px; }
.crt-bar .is-conforme { background: var(--success); }
.crt-bar .is-pendente { background: var(--warning); }
.crt-bar .is-nao_verificado { background: var(--muted); }
.crt-bar .is-nao_aplicavel { background: var(--line); }
.crt-category-counts { display: grid; gap: 2px; font-size: 13px; color: var(--muted-strong); }
.crt-category-counts b { color: var(--text-strong); }

.crt-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.crt-filters label { display: grid; gap: 4px; min-width: 170px; }
.crt-filters select { min-height: 40px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 0 10px; background: var(--input); color: var(--text-strong); font: inherit; }
.crt-status-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; background: var(--panel-soft); color: var(--muted-strong); }
.crt-status-badge.is-conforme { color: var(--success); }
.crt-status-badge.is-pendente { color: var(--warning); }
:root[data-theme="light"] .crt-status-badge.is-pendente { color: #a16207; }
:root[data-theme="light"] .crt-status-badge.is-conforme { color: #15803d; }
.crt-table tr.is-selected td { background: var(--panel-soft); }
.crt-table td a, .crt-diag .it-table td a { color: var(--app-blue); font-weight: 700; text-decoration: none; }

.crt-detail { border-color: var(--brand); scroll-margin-top: 16px; }
.crt-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.crt-detail-head h2 { margin-top: 10px; }
.crt-detail-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; }
.crt-detail p { margin: 0 0 6px; color: var(--muted-strong); font-size: 14px; line-height: 1.5; }
.crt-evidence { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.crt-evidence li { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line-soft); padding: 4px 0; }
.crt-evidence span { color: var(--muted); }
.crt-evidence b { color: var(--text-strong); text-align: right; overflow-wrap: anywhere; }
.crt-pager { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.crt-pager a { min-width: 34px; padding: 6px 10px; text-align: center; border: 1px solid var(--line-soft); border-radius: 8px; color: var(--text-strong); text-decoration: none; font-weight: 700; font-size: 13px; }
.crt-pager a.is-active { background: var(--brand); border-color: var(--brand); color: #fff; }

@media (max-width: 1180px) {
    .crt-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .crt-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .crt-detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .crt-categories { grid-template-columns: 1fr; }
    .crt-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crt-diag-summary, .crt-empty { flex-direction: column; align-items: flex-start; }
    .crt-filters label { flex: 1 1 100%; }
    .crt-actions-list li { grid-template-columns: 1fr; gap: 6px; }
    .crt-run-form, .crt-run-form .primary-action { width: 100%; justify-content: center; }
    .crt-page .page-top { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
    .crt-category, .crt-ring .crt-ring-value { transition: none; }
    .crt-spinner { animation: none; }
}

/* Central da Reforma Tributária - Auditoria (app/views/partials/reforma-tributaria/auditoria.php) */
.crt-aud-kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); margin: 0 0 var(--crt-gap); }
.crt-aud-kpis div { background: var(--panel); }
.crt-kpis strong.is-crit { color: var(--danger); }
.crt-kpis .crt-kpi-date { font-size: 15px; line-height: 1.3; }
.crt-icon--lg { width: 64px; height: 64px; border-radius: 18px; }
.crt-icon--lg svg { width: 32px; height: 32px; }
.crt-aud-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; background: var(--panel-soft); color: var(--muted-strong); }
.crt-aud-status.is-aberto { color: var(--warning); }
.crt-aud-status.is-em_analise, .crt-aud-status.is-aguardando_contador { color: var(--app-blue); }
.crt-aud-status.is-resolvido { color: var(--success); }
.crt-aud-status.is-desconsiderado { color: var(--muted); text-decoration: line-through; }
:root[data-theme="light"] .crt-aud-status.is-aberto { color: #a16207; }
:root[data-theme="light"] .crt-aud-status.is-resolvido { color: #15803d; }
.crt-filters input[type="date"] { min-height: 40px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 0 10px; background: var(--input); color: var(--text-strong); font: inherit; }
.crt-filters .crt-filter-date { min-width: 150px; }
.crt-status-form { display: grid; gap: 10px; }
.crt-status-form label { display: grid; gap: 4px; }
.crt-status-form select, .crt-status-form textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 10px; background: var(--input); color: var(--text-strong); font: inherit; }
.crt-status-form select { min-height: 40px; }
.crt-status-form .primary-action { justify-self: start; }
.crt-timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); display: grid; gap: 12px; }
.crt-timeline li { display: grid; gap: 2px; position: relative; font-size: 13px; color: var(--muted-strong); }
.crt-timeline li::before { content: ''; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-strong); }
.crt-timeline strong { color: var(--text-strong); }
.crt-actions-links { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.crt-pager .crt-muted { align-self: center; margin-left: 6px; }
@media (max-width: 1180px) {
    .crt-aud-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
    .crt-aud-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crt-actions-links { flex-direction: row; align-items: center; }
    .crt-status-form .primary-action { width: 100%; justify-content: center; }
}

/* Central da Reforma Tributária - Plano de Transição (app/views/partials/reforma-tributaria/transicao.php) */
.crt-tar-kpis { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.crt-kpi-progress strong { display: block; }
.crt-progress { display: block; height: 6px; margin-top: 8px; border-radius: 999px; background: var(--panel-soft); overflow: hidden; }
.crt-progress span { display: block; height: 100%; background: var(--success); transition: width var(--motion-duration-slow) var(--motion-ease); }
.crt-subtabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: var(--crt-gap); border-bottom: 1px solid var(--line-soft); }
.crt-subtabs a { padding: 8px 14px; color: var(--muted-strong); font-weight: 700; font-size: 14px; text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.crt-subtabs a:hover { color: var(--text-strong); }
.crt-subtabs a.is-active { color: var(--text-strong); border-bottom-color: var(--brand-strong); }
.crt-tar-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; background: var(--panel-soft); color: var(--muted-strong); }
.crt-tar-status.is-pendente { color: var(--warning); }
.crt-tar-status.is-em_andamento { color: var(--app-blue); }
.crt-tar-status.is-aguardando_contador, .crt-tar-status.is-aguardando_informacoes { color: var(--app-orange); }
.crt-tar-status.is-concluida { color: var(--success); }
.crt-tar-status.is-cancelada { color: var(--muted); text-decoration: line-through; }
:root[data-theme="light"] .crt-tar-status.is-pendente, :root[data-theme="light"] .crt-tar-status.is-aguardando_contador, :root[data-theme="light"] .crt-tar-status.is-aguardando_informacoes { color: #a16207; }
:root[data-theme="light"] .crt-tar-status.is-concluida { color: #15803d; }
.crt-atrasada { color: var(--danger); font-weight: 700; }
.crt-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.crt-inline input { min-height: 38px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 0 10px; background: var(--input); color: var(--text-strong); font: inherit; }
.crt-edit { margin: 16px 0; padding: 12px 0; border-top: 1px solid var(--line-soft); }
.crt-edit summary { cursor: pointer; font-weight: 800; color: var(--text-strong); }
.crt-edit form { margin-top: 12px; }
.crt-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.crt-form-grid label { display: grid; gap: 4px; min-width: 0; }
.crt-form-grid .crt-span-2 { grid-column: span 3; }
.crt-form-grid input, .crt-form-grid select, .crt-form-grid textarea, .crt-sugestoes input, .crt-sugestoes select { width: 100%; box-sizing: border-box; min-height: 40px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 6px 10px; background: var(--input); color: var(--text-strong); font: inherit; }
.crt-sugestoes tr.is-muted td { opacity: .65; }
.crt-sugestoes + .primary-action, .crt-panel form > .primary-action { margin-top: 12px; }
.crt-check { align-self: center; }

.crt-kanban { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: var(--crt-gap); overflow-x: auto; padding-bottom: 6px; }
.crt-kanban-col { display: flex; flex-direction: column; gap: 10px; min-height: 160px; padding: 12px; border: 1px dashed var(--line-soft); border-radius: 16px; background: var(--app-bg-soft); transition: border-color var(--motion-duration-fast) var(--motion-ease), background var(--motion-duration-fast) var(--motion-ease); }
.crt-kanban-col.is-over { border-color: var(--brand-strong); background: var(--panel-soft); }
.crt-kanban-col header { display: flex; justify-content: space-between; align-items: center; color: var(--text-strong); }
.crt-kanban-card { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); cursor: grab; transition: transform var(--motion-duration-fast) var(--motion-ease), box-shadow var(--motion-duration-fast) var(--motion-ease); }
.crt-kanban-card:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(2, 6, 23, .18); }
.crt-kanban-card.is-dragging { opacity: .5; }
.crt-kanban-card a { color: var(--text-strong); text-decoration: none; font-size: 14px; }
.crt-kanban-move select { width: 100%; min-height: 32px; border: 1px solid var(--line-soft); border-radius: 8px; background: var(--input); color: var(--muted-strong); font: inherit; font-size: 12px; }
.crt-kanban-vazio { margin: 0; color: var(--muted); font-size: 13px; text-align: center; padding: 18px 0; }

.crt-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.crt-cal-head h2 { margin: 0; }
.crt-cal-legenda { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.crt-cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.crt-cal-dow { padding: 6px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 800; }
.crt-cal-dia { min-height: 92px; padding: 6px; border: 1px solid var(--line-soft); border-radius: 10px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.crt-cal-dia.is-fora { opacity: .4; }
.crt-cal-dia.is-hoje { border-color: var(--brand-strong); }
.crt-cal-num { font-size: 12px; font-weight: 800; color: var(--muted-strong); }
.crt-cal-ev { display: block; padding: 2px 6px; border-radius: 6px; font-size: 11px; font-weight: 700; line-height: 1.35; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: var(--panel-soft); color: var(--text-strong); border-left: 3px solid var(--muted); }
.crt-cal-legenda .crt-cal-ev, .crt-cal-lista .crt-cal-ev { display: inline-block; white-space: normal; }
.crt-cal-ev.is-prazo_tarefa { border-left-color: var(--warning); }
.crt-cal-ev.is-inicio_tarefa { border-left-color: var(--app-blue); }
.crt-cal-ev.is-obrigacao { border-left-color: var(--app-orange); }
.crt-cal-ev.is-marco_legal { border-left-color: var(--brand-strong); }
.crt-cal-ev.is-nota_tecnica { border-left-color: var(--success); }
.crt-cal-ev.is-atrasada { border-left-color: var(--danger); color: var(--danger); }
.crt-cal-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.crt-marcos { display: grid; gap: 12px; }
.crt-marco { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 14px; }
.crt-marco.is-nao-aplicavel { opacity: .6; }
.crt-marco h3 { margin: 0 0 4px; }
.crt-marco p { margin: 0 0 8px; color: var(--muted-strong); font-size: 14px; }
.crt-marco-data { display: grid; align-content: start; gap: 2px; color: var(--text-strong); }
.crt-marco-data small { color: var(--muted); }
.crt-verif { font-weight: 800; }
.crt-verif.is-conferido { color: var(--success); }
.crt-verif.is-a_conferir { color: var(--warning); }
.crt-verif.is-aguardando_regulamentacao { color: var(--muted); }
:root[data-theme="light"] .crt-verif.is-a_conferir { color: #a16207; }
@media (max-width: 1180px) {
    .crt-tar-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .crt-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crt-form-grid .crt-span-2 { grid-column: span 2; }
}
@media (max-width: 720px) {
    .crt-tar-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crt-form-grid { grid-template-columns: 1fr; }
    .crt-form-grid .crt-span-2 { grid-column: auto; }
    .crt-kanban { grid-template-columns: repeat(4, 80vw); scroll-snap-type: x mandatory; }
    .crt-kanban-col { scroll-snap-align: start; }
    .crt-cal-dia { min-height: 54px; padding: 3px; }
    .crt-cal-ev { font-size: 0; padding: 0; height: 6px; border-left-width: 0; }
    .crt-marco { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .crt-kanban-card, .crt-kanban-col, .crt-progress span { transition: none; }
}
.crt-detail-grid > div { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 720px) {
    .crt-page .page-top .list-actions { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
    .crt-page .page-top .list-actions a { flex: 1 1 100%; justify-content: center; text-align: center; }
}

/* Central da Reforma Tributária - Simulador (app/views/partials/reforma-tributaria/simulador.php) */
.crt-prov { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 800; vertical-align: middle; background: var(--panel-soft); white-space: nowrap; }
.crt-prov.is-erp { color: var(--success); }
.crt-prov.is-usuario { color: var(--app-blue); }
.crt-prov.is-estimativa { color: var(--warning); }
.crt-prov.is-calculado { color: var(--app-orange); }
.crt-prov.is-vazio { color: var(--muted); }
:root[data-theme="light"] .crt-prov.is-erp { color: #15803d; }
:root[data-theme="light"] .crt-prov.is-estimativa { color: #a16207; }
:root[data-theme="light"] .crt-prov.is-calculado { color: #c2410c; }
.crt-prov-legenda { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.crt-prov-legenda .crt-prov { margin-left: 0; }
.crt-sim .crt-form-grid input[readonly], .crt-sim .crt-form-grid input[disabled] { opacity: .75; }
.crt-sim-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.crt-sim-head h2 { margin: 0 0 4px; }
.crt-sim-kpis .crt-prov { margin: 4px 0 0; }
.crt-indisponivel { color: var(--muted-strong); font-size: 13px; font-style: italic; }
.crt-sim-graficos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--crt-gap); }
.crt-grafico { min-width: 0; }
.crt-grafico h3 { margin: 0 0 8px; }
.crt-grafico--largo { grid-column: span 2; }
.crt-grafico-area { min-height: 200px; }
.crt-sim details { border-top: 1px solid var(--line-soft); padding: 10px 0; }
.crt-sim details summary { cursor: pointer; font-weight: 800; color: var(--text-strong); }
.crt-sim details[open] summary { margin-bottom: 10px; }
.crt-sim details ul:not(.crt-evidence) { margin: 0; padding-left: 18px; color: var(--muted-strong); font-size: 14px; line-height: 1.6; }
@media (max-width: 720px) {
    .crt-sim-graficos { grid-template-columns: 1fr; }
    .crt-grafico--largo { grid-column: auto; }
    .crt-sim-head { flex-direction: column; }
}
.crt-sim-kpis strong { font-size: 18px; overflow-wrap: anywhere; }

/* Central da Reforma Tributária — Precificação Tributária Inteligente (Etapa 07) */
@media (min-width: 1181px) { .crt-indicators { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.crt-prc-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.crt-prc h3 { margin: 16px 0 8px; font-size: 15px; color: var(--text-strong); }
.crt-prc .crt-filters input { min-height: 40px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 0 10px; background: var(--input); color: var(--text-strong); font: inherit; }
.crt-prc .crt-filters .crt-filter-num { min-width: 110px; }
.crt-prc .crt-filters .crt-filter-num input { width: 110px; }
.crt-prc .crt-filters select[disabled] { opacity: .6; }
.crt-prc-busca label { flex: 1 1 320px; }
.crt-prc-busca input { width: 100%; }
.crt-prc-resultados-busca { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.crt-prc-resultados-busca li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; }
.crt-prc-produto { margin: 6px 0 4px; font-size: 16px; }
.crt-prc-sit, .crt-prc-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; background: var(--panel-soft); color: var(--muted-strong); vertical-align: middle; }
.crt-prc-sit.is-reduzida { color: var(--danger); }
.crt-prc-sit.is-ampliada, .crt-prc-sit.is-mantida { color: var(--success); }
.crt-prc-sit.is-sem_custo, .crt-prc-sit.is-sem_preco, .crt-prc-sit.is-dados_fiscais { color: var(--warning); }
.crt-prc-status.is-aguardando { color: var(--app-orange); }
.crt-prc-status.is-aprovado, .crt-prc-status.is-aplicado { color: var(--success); }
.crt-prc-status.is-rejeitado { color: var(--danger); }
.crt-prc-oport { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--crt-gap); }
.crt-prc-oport-item { padding: 12px 14px; border: 1px solid var(--line-soft); border-left: 3px solid var(--app-blue); border-radius: 12px; min-width: 0; }
.crt-prc-oport-item.is-reduzida { border-left-color: var(--danger); }
.crt-prc-oport-item.is-sem_custo, .crt-prc-oport-item.is-dados_fiscais { border-left-color: var(--warning); }
.crt-prc-oport-item.is-revisao { border-left-color: var(--app-orange); }
.crt-prc-oport-item.is-preco { border-left-color: var(--success); }
.crt-prc-oport-item h3 { margin: 0 0 4px; font-size: 14px; }
.crt-prc-oport-item ul { margin: 6px 0; padding-left: 16px; font-size: 13px; line-height: 1.6; }
.crt-prc-oport-item li { overflow-wrap: anywhere; }
.crt-prc-oport-item li small { margin-left: 6px; }
.crt-prc-tabela td { vertical-align: top; }
.crt-prc-proposta { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; }
.crt-prc-proposta legend { padding: 0 6px; font-weight: 800; color: var(--text-strong); }
.crt-prc-decisao { display: grid; gap: 10px; margin-top: 14px; }
.crt-prc-decisao textarea { width: 100%; }
@media (max-width: 1180px) { .crt-prc-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
    .crt-prc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .crt-prc .crt-filters label, .crt-prc .crt-filters .crt-filter-num { min-width: 0; flex: 1 1 140px; }
    .crt-prc .crt-filters .crt-filter-num input { width: 100%; }
}
.crt-prc-tabela .crt-prc-sit { white-space: normal; }
.crt-prc-oport-item.is-custo_preco { border-left-color: var(--warning); }

/* Central da Reforma Tributária — Planejamento Financeiro Tributário (Etapa 08) */
@media (min-width: 1181px) { .crt-indicators { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.crt-pla-vazio { text-align: left; }
.crt-pla-vazio h2 { margin-top: 0; }
.crt-pla-acoes { margin-bottom: var(--crt-gap); }
.crt-pla-graficos .crt-grafico--largo { grid-column: 1 / -1; }
.crt-table tr.crt-pla-negativo td { color: var(--danger); }
.crt-pla-alertas { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--crt-gap); }
.crt-pla-alerta { padding: 12px 14px; border: 1px solid var(--line-soft); border-left: 3px solid var(--app-blue); border-radius: 12px; min-width: 0; overflow-wrap: anywhere; }
.crt-pla-alerta.is-critica, .crt-pla-alerta.is-alta { border-left-color: var(--danger); }
.crt-pla-alerta.is-media { border-left-color: var(--warning); }
.crt-pla-alerta h3 { margin: 8px 0 4px; font-size: 15px; color: var(--text-strong); }
.crt-pla-alerta p { margin: 0 0 8px; font-size: 14px; }
.crt-pla-alerta .crt-facts { margin-bottom: 8px; }
.crt-pla-tarefa { display: grid; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.crt-pla-tarefa input[type="text"], .crt-pla-tarefa input:not([type]), .crt-pla-tarefa input[type="date"] { width: 100%; }

/* Central da Reforma Tributária — Relatórios e Portal do Contador (Etapa 09) */
@media (min-width: 1181px) { .crt-indicators { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.crt-rel-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--crt-gap); }
.crt-rel-card { display: grid; gap: 8px; align-content: start; min-width: 0; }
.crt-rel-card h3 { margin: 0; font-size: 15px; color: var(--text-strong); }
.crt-rel-card p { margin: 0; font-size: 13px; color: var(--muted-strong); }
.crt-rel-card.is-destaque { border-color: var(--brand-strong); }
.crt-rel-card form { margin: 0; }
.crt-rel .crt-section h2 { font-size: 16px; margin: 0 0 10px; }
.crt-rel-html { overflow-x: auto; }
.crt-rel-html h2 { font-size: 15px; margin: 18px 0 8px; color: var(--text-strong); border-bottom: 1px solid var(--line-soft); padding-bottom: 4px; }
.crt-rel-html table { width: 100%; border-collapse: collapse; font-size: 13px; }
.crt-rel-html table td, .crt-rel-html table th { padding: 5px 6px; border-color: var(--line-soft); vertical-align: top; }
.crt-rel-html .crt-rel-kv td:first-child { color: var(--muted-strong); width: 35%; }
.crt-rel-html .crt-rel-barras td { border: 0; padding: 3px 4px; }
.crt-rel-html ul { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.6; }
.crt-rel-capa h2 { font-size: 20px; border: 0; }
.crt-inline-form { display: inline; margin: 0; }
.crt-link-button { border: 0; background: none; padding: 0; color: var(--app-blue); font: inherit; font-weight: 700; cursor: pointer; }
.crt-link-button:hover { text-decoration: underline; }
.crt-ctb-convite { margin: 12px 0 16px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; }
.crt-ctb-convite summary, .crt-rev-solicitar summary { cursor: pointer; font-weight: 800; color: var(--text-strong); }
.crt-ctb-form { display: grid; gap: 10px; margin-top: 10px; }
.crt-ctb-perms { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 14px; border: 1px solid var(--line-soft); border-radius: 10px; padding: 8px 12px; margin: 0; }
.crt-ctb-perms legend { font-weight: 800; padding: 0 6px; color: var(--text-strong); font-size: 13px; }
.crt-ctb-lista { display: grid; gap: var(--crt-gap); }
.crt-ctb-item { padding: 12px 14px; border: 1px solid var(--line-soft); border-left: 3px solid var(--muted); border-radius: 12px; min-width: 0; overflow-wrap: anywhere; }
.crt-ctb-item.is-ativo { border-left-color: var(--success); }
.crt-ctb-item.is-aceito { border-left-color: var(--app-orange); }
.crt-ctb-item.is-convidado { border-left-color: var(--app-blue); }
.crt-ctb-status, .crt-rev-status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; white-space: nowrap; background: var(--panel-soft); color: var(--muted-strong); }
.crt-ctb-status.is-ativo, .crt-rev-status.is-concluida { color: var(--success); }
.crt-ctb-status.is-aceito, .crt-rev-status.is-aguardando_informacoes { color: var(--app-orange); }
.crt-ctb-status.is-convidado, .crt-rev-status.is-em_analise { color: var(--app-blue); }
.crt-ctb-status.is-revogado, .crt-ctb-status.is-recusado { color: var(--danger); }
.crt-rev-status.is-aberta { color: var(--warning); }
.crt-ctb-revogar { margin-top: 8px; }
.crt-rev-solicitar { margin: 0 0 var(--crt-gap); padding: 10px 14px; border: 1px dashed var(--line); border-radius: 12px; }
.crt-rev-form { display: grid; gap: 8px; margin-top: 8px; }
.crt-rev-form textarea { width: 100%; }
.crt-portal-convite { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.crt-portal-convite form { margin: 0; }
.crt-portal-ativ { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
@media (max-width: 720px) {
    .crt-ctb-perms { grid-template-columns: 1fr; }
    .crt-portal-convite { flex-direction: column; align-items: flex-start; }
}

/* Central da Reforma Tributária — ajustes da validação final (Etapa 10) */
.crt-ctb-perms .crt-check { align-items: flex-start; margin: 4px 0 !important; line-height: 1.35; }
.crt-ctb-perms .crt-check input[type="checkbox"] { flex: 0 0 auto; padding: 0; border: 0; height: auto; margin-top: 2px; box-shadow: none; }
.crt-ctb-perms .crt-badge, .crt-rel .crt-badge { white-space: nowrap; flex: 0 0 auto; }
@media (max-width: 720px) {
    .crt-rel .crt-subtabs, .crt-prc .crt-subtabs, .crt-portal .crt-subtabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .crt-rel .crt-subtabs a, .crt-prc .crt-subtabs a, .crt-portal .crt-subtabs a { flex: 0 0 auto; white-space: nowrap; }
}

/* Menu lateral no desktop: a barra inteira rola (menu + rodapé), em vez de o menu rolar numa caixa pequena acima dos
   cartões do rodapé, que escondia os itens do fim dos grupos (ex.: Relatórios). Celular (até 900px) não muda. */
@media (min-width: 901px) {
    body .dashboard .sidebar { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(100, 116, 139, .34) transparent; }
    body .dashboard .sidebar::-webkit-scrollbar { width: 6px; }
    body .dashboard .sidebar::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(100, 116, 139, .34); }
    body .dashboard .sidebar > div:first-child { flex: 0 0 auto; min-height: auto; }
    body .dashboard .sidebar .side-nav { flex: 0 0 auto; min-height: auto; overflow: visible; }
    body .dashboard .sidebar .menu-group--settings.is-open > .submenu { max-height: none; overflow: visible; }
    body .dashboard .sidebar .sidebar-bottom { margin-top: auto; }
}
/* Submenu aberto: a animação limitava a 460px e cortava o fim dos grupos longos (Relatórios tem mais de 460px). */
body .dashboard .menu-group.is-open .submenu { max-height: 1600px; }

/* Sidebar nova em colunas: rail de modulos (que abre como menu) + painel contextual com as telas.
   So desktop (901px+) e so para quem usuarioUsaSidebarNova() libera; em telas estreitas a
   mesma <aside> segue como a gaveta com o menu classico.
   Uma coluna so de modulos: recolhida mostra os icones; aberta, os mesmos itens com os nomes.
   Estados na aside: is-recolhida (so os icones no fluxo), is-aberta (coluna aberta por cima
   do conteudo no modo recolhido) e has-painel (painel contextual aberto, sempre flutuante).
   Movimento: a coluna mantem o mesmo layout aberta ou recolhida e so e recortada (clip-path)
   na largura dos icones; rotulos, logo e rodape entram e saem por opacity; botao e painel
   por transform. Nada muda de display/largura durante a animacao, entao nao ha recalculo de
   layout nem salto. gsb-iniciando desliga as transicoes ate o primeiro quadro. */
.gsb-topo,
.gsb-modulos,
.gsb-painel,
.gsb-aviso-icone,
.gsb-aviso-titulo {
    display: none;
}

@media (min-width: 901px) {
    body main.dashboard:has(> aside.sidebar--nova) {
        grid-template-columns: auto minmax(0, 1fr);
    }

    /* Enquanto o conteudo desliza (troca fixado/recolhido), sem barra de rolagem horizontal */
    body main.dashboard.gsb-deslizando { overflow-x: clip; }

    body .dashboard aside.sidebar.sidebar--nova {
        --gsb-rail: 68px;
        --gsb-menu: 232px;
        --gsb-painel: 240px;
        --gsb-ease: cubic-bezier(0.22, 1, 0.36, 1);
        --gsb-t-sidebar: 320ms;
        --gsb-t-painel: 270ms;
        --gsb-t-hover: 160ms;
        --gsb-t-selecao: 210ms;
        --gsb-t-fade: 220ms;
        --gsb-t-saida: 130ms;
        --gsb-margem: 10px;
        --gsb-raio: 16px;
        display: flex;
        flex-direction: column;
        gap: 0;
        width: calc(var(--gsb-menu) + var(--gsb-margem) * 2);
        padding: var(--gsb-margem) 0 var(--gsb-margem) var(--gsb-margem);
        border-right: 0;
        --gsb-fundo: var(--app-bg);
        background: transparent;
        overflow: visible;
        z-index: 85;
    }

    /* Atras do cartao, a mesma cor do conteudo da tela: --app-bg (como o .dash-main e o
       .dashboard), --list-page-bg nas listas e no relatorio fiscal e --dpro-bg no Dashboard
       (dashboard-pro.css). O fundo fica num ::before com a largura do modo atual (nao na
       aside): ao fixar/recolher a largura da aside no layout so muda no fim da animacao, e o
       conteudo que desliza por baixo dela nao pode ficar escondido. */
    body .dashboard:has(.contacts-card):not(.dashboard-home) > aside.sidebar.sidebar--nova,
    body .dashboard:has(.fiscal-report-form) > aside.sidebar.sidebar--nova { --gsb-fundo: var(--list-page-bg); }
    body .dashboard.dpro-page > aside.sidebar.sidebar--nova { --gsb-fundo: var(--dpro-bg, var(--app-bg)); }

    body .dashboard aside.sidebar--nova::before {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: 0;
        z-index: -1;
        width: calc(var(--gsb-menu) + var(--gsb-margem) * 2);
        background: var(--gsb-fundo);
        pointer-events: none;
    }

    body .dashboard aside.sidebar--nova.is-recolhida::before { width: calc(var(--gsb-rail) + var(--gsb-margem) * 2); }

    /* Cartao flutuante: afastado da borda, do topo e da base, com cantos arredondados */
    body main.dashboard > aside.sidebar.sidebar--nova.is-recolhida { width: calc(var(--gsb-rail) + var(--gsb-margem) * 2); }

    /* Contorno do cartao recolhido (com a coluna aberta, a borda dela fica fora do recorte) */
    body .dashboard aside.sidebar--nova::after {
        content: "";
        position: absolute;
        top: var(--gsb-margem);
        bottom: var(--gsb-margem);
        left: var(--gsb-margem);
        width: var(--gsb-rail);
        border: 1px solid var(--line);
        border-radius: var(--gsb-raio);
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--gsb-t-saida) var(--gsb-ease);
    }

    body .dashboard aside.sidebar--nova.is-recolhida:not(.is-aberta)::after {
        opacity: 1;
        transition: opacity var(--gsb-t-fade) var(--gsb-ease) 120ms;
    }

    body .dashboard aside.sidebar--nova > div:first-child,
    body .dashboard aside.sidebar--nova .sidebar-bottom {
        width: var(--gsb-menu);
        margin: 0;
        border: 1px solid var(--line);
        box-shadow: 0 0 0 rgba(2, 6, 23, 0);
        transition:
            clip-path var(--gsb-t-sidebar) var(--gsb-ease),
            border-radius var(--gsb-t-painel) var(--gsb-ease),
            box-shadow var(--gsb-t-sidebar) var(--gsb-ease);
    }

    body .dashboard aside.sidebar--nova > div:first-child {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
        padding: 18px 12px 0;
        border-bottom: 0;
        border-radius: var(--gsb-raio) var(--gsb-raio) 0 0;
        background: var(--home-sidebar-bottom-bg);
        clip-path: inset(0 0 0 0 round var(--gsb-raio) var(--gsb-raio) 0 0);
    }

    body .dashboard aside.sidebar--nova .sidebar-bottom {
        flex: 0 0 auto;
        align-self: flex-start;
        border-top: 0;
        border-radius: 0 0 var(--gsb-raio) var(--gsb-raio);
        background: var(--home-sidebar-bottom-bg);
        clip-path: inset(-32px 0 0 0 round 0 0 var(--gsb-raio) var(--gsb-raio));
    }
    body .dashboard aside.sidebar--nova .side-logo,
    body .dashboard aside.sidebar--nova .side-nav { display: none; }

    body .dashboard aside.sidebar--nova .user-strip { padding: 8px 14px 8px 20px; }
    body .dashboard aside.sidebar--nova .user-strip-info span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    body .dashboard aside.sidebar--nova.is-recolhida:not(.is-aberta) > div:first-child {
        clip-path: inset(0 calc(var(--gsb-menu) - var(--gsb-rail)) 0 0 round var(--gsb-raio) var(--gsb-raio) 0 0);
    }

    body .dashboard aside.sidebar--nova.is-recolhida:not(.is-aberta) .sidebar-bottom {
        clip-path: inset(-32px calc(var(--gsb-menu) - var(--gsb-rail)) 0 0 round 0 0 var(--gsb-raio) var(--gsb-raio));
    }

    /* Coluna aberta temporariamente no modo recolhido: flutua sobre o conteudo (o recorte
       folga a direita so aqui, para a sombra; fixado, o recorte acompanha o conteudo 1:1) */
    body .dashboard aside.sidebar--nova.is-recolhida.is-aberta > div:first-child,
    body .dashboard aside.sidebar--nova.is-recolhida.is-aberta .sidebar-bottom {
        box-shadow: 18px 0 42px rgba(2, 6, 23, .28);
    }

    body .dashboard aside.sidebar--nova.is-recolhida.is-aberta > div:first-child {
        clip-path: inset(0 -80px 0 0 round var(--gsb-raio) var(--gsb-raio) 0 0);
    }

    body .dashboard aside.sidebar--nova.is-recolhida.is-aberta .sidebar-bottom {
        clip-path: inset(-32px -80px -80px 0 round 0 0 var(--gsb-raio) var(--gsb-raio));
    }

    /* Painel aberto: cartao e painel viram uma peca so (cantos retos onde se encontram) */
    body .dashboard aside.sidebar--nova.has-painel > div:first-child { border-radius: var(--gsb-raio) 0 0 0; }
    body .dashboard aside.sidebar--nova.has-painel .sidebar-bottom { border-radius: 0 0 0 var(--gsb-raio); }
    body .dashboard aside.sidebar--nova.has-painel:not(.is-recolhida) > div:first-child { clip-path: inset(0 0 0 0 round var(--gsb-raio) 0 0 0); }
    body .dashboard aside.sidebar--nova.has-painel:not(.is-recolhida) .sidebar-bottom { clip-path: inset(-32px 0 0 0 round 0 0 0 var(--gsb-raio)); }

    body .dashboard aside.sidebar--nova.is-recolhida.is-aberta.has-painel > div:first-child,
    body .dashboard aside.sidebar--nova.is-recolhida.is-aberta.has-painel .sidebar-bottom {
        box-shadow: 0 0 0 rgba(2, 6, 23, 0);
    }

    /* Topo: logo completo com a coluna aberta, so o simbolo com ela recolhida (troca em fade) */
    .sidebar--nova .gsb-topo {
        position: relative;
        display: block;
        height: 44px;
        margin: 0 4px 12px 6px;
    }

    .gsb-marca {
        position: relative;
        display: flex;
        align-items: center;
        width: max-content;
        height: 44px;
        border-radius: 10px;
    }

    .gsb-marca-logo {
        width: 160px;
        max-height: 40px;
        object-fit: contain;
        transition: opacity var(--gsb-t-fade) var(--gsb-ease) 70ms;
    }

    .gsb-marca-simbolo {
        position: absolute;
        top: 5px;
        left: 0;
        width: 34px;
        height: 34px;
        object-fit: contain;
        opacity: 0;
        transition: opacity var(--gsb-t-saida) var(--gsb-ease);
    }

    .gsb-logo-light,
    .gsb-simbolo-light { display: none; }
    :root[data-theme="light"] .gsb-logo-dark,
    :root[data-theme="light"] .gsb-simbolo-dark { display: none; }
    :root[data-theme="light"] .gsb-logo-light,
    :root[data-theme="light"] .gsb-simbolo-light { display: block; }

    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-marca-logo { opacity: 0; transition: opacity var(--gsb-t-saida) var(--gsb-ease); }
    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-marca-simbolo { opacity: 1; transition: opacity var(--gsb-t-fade) var(--gsb-ease) 90ms; }

    /* Botao fixar/recolher: no canto do topo com a coluna aberta; desliza para baixo do
       simbolo quando ela recolhe. A seta gira: esquerda = recolher, direita = fixar. */
    .gsb-fixar {
        position: absolute;
        top: 7px;
        right: 0;
        z-index: 2;
        display: grid;
        place-items: center;
        width: 30px;
        height: 30px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 9px;
        color: var(--home-nav-text);
        background: transparent;
        cursor: pointer;
        transition:
            transform var(--gsb-t-sidebar) var(--gsb-ease),
            background-color var(--gsb-t-hover) var(--gsb-ease),
            color var(--gsb-t-hover) var(--gsb-ease);
    }

    .gsb-fixar svg { transition: transform var(--gsb-t-sidebar) var(--gsb-ease); }
    .gsb-fixar[aria-pressed="true"] svg { transform: rotate(180deg); }
    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-fixar { transform: translate3d(calc(65px - var(--gsb-menu)), 45px, 0); }

    /* Lista de modulos (padding a esquerda para a barra do modulo atual nao ser cortada) */
    .sidebar--nova .gsb-modulos {
        display: grid;
        align-content: start;
        gap: 2px;
        flex: 1 1 auto;
        min-height: 0;
        margin-left: -12px;
        padding: 0 2px 12px 12px;
        overflow: hidden auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(100, 116, 139, .34) transparent;
        -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent);
        mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent);
    }

    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-modulos { scrollbar-width: none; }
    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-modulos::-webkit-scrollbar { display: none; }

    .gsb-titulo,
    .gsb-painel-secao-titulo {
        color: color-mix(in srgb, var(--muted) 78%, transparent);
        font-family: "Inter";
        font-size: 11px;
        font-weight: 600;
        letter-spacing: 1px;
        text-transform: uppercase;
    }

    /* Titulos nao recebem clique: recolhida, o "Menu Principal" invisivel fica no lugar do
       botao de expandir e roubava o clique dele */
    .gsb-titulo {
        position: relative;
        margin: 12px 10px 4px;
        white-space: nowrap;
        pointer-events: none;
        user-select: none;
        transition: color var(--gsb-t-fade) var(--gsb-ease) 70ms;
    }

    /* Com a coluna recolhida o titulo some e "Sistema" vira um traco separador */
    .gsb-titulo--sistema::after {
        content: "";
        position: absolute;
        top: 50%;
        left: -2px;
        width: 28px;
        height: 1px;
        background: var(--line);
        opacity: 0;
        transition: opacity var(--gsb-t-saida) var(--gsb-ease);
    }

    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-titulo { color: transparent; transition: color var(--gsb-t-saida) var(--gsb-ease); }
    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-titulo--sistema::after { opacity: 1; transition: opacity var(--gsb-t-fade) var(--gsb-ease) 90ms; }

    /* Item de modulo: mesmo layout aberto e recolhido; recolhido, o recorte deixa so o
       quadrado do icone (44px). Foco em anel interno para o recorte nao cortar o contorno. */
    .gsb-modulo {
        position: relative;
        display: grid;
        grid-template-columns: 22px minmax(0, 1fr) 14px;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 40px;
        padding: 0 10px 0 11px;
        border: 0;
        border-radius: 10px;
        color: var(--home-nav-text);
        background-color: transparent;
        font-family: "Inter";
        font-size: 14px;
        font-weight: 500;
        text-align: left;
        text-decoration: none;
        cursor: pointer;
        clip-path: inset(0 0 0 -14px round 0 10px 10px 0);
        transition:
            clip-path var(--gsb-t-sidebar) var(--gsb-ease),
            background-color var(--gsb-t-selecao) var(--gsb-ease),
            color var(--gsb-t-selecao) var(--gsb-ease),
            box-shadow var(--gsb-t-hover) var(--gsb-ease),
            transform 140ms var(--gsb-ease);
    }

    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-modulo { clip-path: inset(0 calc(100% - 44px) 0 -14px round 0 10px 10px 0); }

    a.gsb-modulo { grid-template-columns: 22px minmax(0, 1fr); }
    .gsb-modulo:active { transform: scale(.98); }
    .gsb-modulo .chev { display: grid; place-items: center; }

    .gsb-modulo-rotulo,
    .gsb-modulo .chev {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        transition: opacity var(--gsb-t-fade) var(--gsb-ease) 70ms;
    }

    .gsb-modulo .chev { opacity: .7; }
    /* Rotulo longo (ex.: Inteligência Tributária) quebra em duas linhas em vez de ficar cortado com reticências. */
    .gsb-modulo-rotulo { white-space: normal; line-height: 1.2; padding: 4px 0; }

    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-modulo-rotulo,
    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-modulo .chev {
        opacity: 0;
        transition: opacity var(--gsb-t-saida) var(--gsb-ease);
    }

    .gsb-modulo .figma-icon--sidebar { justify-self: center; }
    /* Rota Certa: o logo RC (caminhao) como mascara, na cor do item como os demais icones */
    .gsb-icone-rotacerta {
        display: block;
        justify-self: center;
        width: 30px;
        height: 12px;
        background-color: currentColor;
        -webkit-mask: url("../img/rota-certa-icone.png") center / contain no-repeat;
        mask: url("../img/rota-certa-icone.png") center / contain no-repeat;
        transition: background-color var(--gsb-t-selecao) var(--gsb-ease);
    }
    body .sidebar--nova .gsb-modulo .figma-icon--sidebar { color: inherit; transition: color var(--gsb-t-selecao) var(--gsb-ease); }

    /* Modulo da tela atual: barra na borda esquerda (tambem com a coluna recolhida) */
    .gsb-modulo.is-current::before {
        content: "";
        position: absolute;
        top: 10px;
        bottom: 10px;
        left: -12px;
        width: 3px;
        border-radius: 0 3px 3px 0;
        background: var(--brand-strong, #38bdf8);
    }

    .gsb-modulo:hover,
    .gsb-modulo:focus-visible,
    .gsb-modulo.is-selected,
    .gsb-fixar:hover,
    .gsb-fixar:focus-visible {
        color: var(--text-strong);
        background-color: color-mix(in srgb, var(--home-nav-active-bg) 22%, transparent);
    }

    .gsb-modulo:hover,
    .gsb-fixar:hover { transition-duration: var(--gsb-t-sidebar), var(--gsb-t-hover), var(--gsb-t-hover), var(--gsb-t-hover), 140ms; }

    .gsb-modulo.is-current {
        color: #fff;
        background-color: var(--home-nav-active-bg);
    }

    .gsb-modulo:focus-visible {
        outline: none;
        box-shadow: inset 0 0 0 2px var(--brand-strong, #38bdf8);
    }

    .gsb-fixar:focus-visible,
    .gsb-marca:focus-visible,
    .gsb-link:focus-visible {
        outline: 2px solid var(--brand-strong, #38bdf8);
        outline-offset: 2px;
    }

    /* Rodape recolhido: ficam o aviso de contas (so o icone com o total) e o avatar.
       Certificado e versao saem do layout para a coluna nao precisar rolar; ao abrir a
       coluna temporaria eles voltam em fade. Nome, empresa e botoes saem em fade. */
    .sidebar--nova.is-recolhida:not(.is-aberta) .cert-mini,
    .sidebar--nova.is-recolhida:not(.is-aberta) .versao-strip { display: none; }

    @keyframes gsb-surgir {
        from { opacity: 0; }
    }

    .sidebar--nova.is-recolhida.is-aberta .cert-mini,
    .sidebar--nova.is-recolhida.is-aberta .versao-strip,
    .sidebar--nova.is-recolhida.is-aberta .gsb-aviso-titulo,
    .sidebar--nova.is-recolhida.is-aberta .lembrete-fixo-pill { animation: gsb-surgir var(--gsb-t-fade) var(--gsb-ease) 70ms both; }

    /* Versao numa linha so */
    body .dashboard aside.sidebar--nova .versao-strip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

    .sidebar--nova .user-strip-info,
    .sidebar--nova .company-switch-trigger,
    .sidebar--nova .logout-icon {
        transition: opacity var(--gsb-t-fade) var(--gsb-ease) 70ms, visibility 0s;
    }

    .sidebar--nova.is-recolhida:not(.is-aberta) .user-strip-info,
    .sidebar--nova.is-recolhida:not(.is-aberta) .company-switch-trigger,
    .sidebar--nova.is-recolhida:not(.is-aberta) .logout-icon {
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--gsb-t-saida) var(--gsb-ease), visibility 0s linear var(--gsb-t-saida);
    }

    /* Recolhida, quem troca de empresa (Suporte) segue com o botao visivel: empilhado acima
       do avatar, os dois no eixo dos icones (centro em 34px) */
    body .dashboard aside.sidebar--nova.is-recolhida:not(.is-aberta) .user-strip.has-company-switch {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        height: auto;
        padding: 10px 0 10px 20px;
    }

    body .dashboard aside.sidebar--nova.is-recolhida:not(.is-aberta) .user-strip.has-company-switch .user-strip-info,
    body .dashboard aside.sidebar--nova.is-recolhida:not(.is-aberta) .user-strip.has-company-switch .logout-icon { display: none; }

    body .dashboard aside.sidebar--nova.is-recolhida:not(.is-aberta) .user-strip.has-company-switch .company-switch-trigger {
        order: -1;
        opacity: 1;
        visibility: visible;
    }

    /* Aviso de contas a pagar no padrao da sidebar: linha como a do Certificado, com icone,
       titulo e as pilulas embaixo; recolhido, so o icone com o total num selo */
    body .dashboard aside.sidebar--nova .lembrete-contas-pagar-fixo {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
        min-height: 44px;
        margin: 0 16px 8px;
        padding: 7px 10px 7px 45px;
        border: 1px solid var(--line);
        border-radius: 9px;
        color: var(--text-strong);
        background: rgba(255, 255, 255, .03);
        box-shadow: none;
        text-decoration: none;
        transition:
            border-color var(--gsb-t-hover) var(--gsb-ease),
            background-color var(--gsb-t-hover) var(--gsb-ease);
    }

    :root[data-theme="light"] body .dashboard aside.sidebar--nova .lembrete-contas-pagar-fixo {
        background: #fff;
        box-shadow: 0 12px 34px rgba(16, 24, 40, .06);
    }

    body .dashboard aside.sidebar--nova .lembrete-contas-pagar-fixo:hover,
    body .dashboard aside.sidebar--nova .lembrete-contas-pagar-fixo:focus-visible {
        border-color: color-mix(in srgb, var(--home-nav-active-bg, #3B608F) 52%, var(--line-soft, var(--line)));
        background: color-mix(in srgb, var(--home-inner-bg) 88%, var(--home-nav-active-bg, #3B608F) 12%);
    }

    .sidebar--nova .gsb-aviso-icone {
        position: absolute;
        top: 50%;
        left: 9px;
        display: grid;
        place-items: center;
        width: 27px;
        height: 27px;
        border-radius: 8px;
        color: #eab308;
        background: rgba(234, 179, 8, .14);
        transform: translateY(-50%);
    }

    .sidebar--nova .gsb-aviso-titulo {
        display: block;
        flex: 1 0 100%;
        font-size: 12px;
        font-weight: 700;
        line-height: 1.2;
    }

    body .dashboard aside.sidebar--nova .lembrete-fixo-pill {
        padding: 1px 7px;
        font-size: 10.5px;
        font-weight: 600;
        line-height: 1.5;
    }

    .gsb-aviso-total {
        position: absolute;
        top: -6px;
        right: -7px;
        display: none;
        place-items: center;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border: 2px solid var(--home-sidebar-bottom-bg);
        border-radius: 999px;
        color: #fff;
        background: var(--brand-strong, #34a5ff);
        font-size: 10px;
        font-weight: 700;
        line-height: 1;
    }

    .gsb-aviso-total.is-hoje { color: #1f1300; background: #eab308; }

    body .dashboard aside.sidebar--nova.is-recolhida:not(.is-aberta) .lembrete-contas-pagar-fixo {
        display: grid;
        place-items: center;
        width: 44px;
        min-height: 44px;
        margin: 0 0 8px 12px;
        padding: 0;
    }

    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-aviso-icone { position: static; transform: none; }
    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-aviso-total { display: grid; }
    .sidebar--nova.is-recolhida:not(.is-aberta) .gsb-aviso-titulo,
    .sidebar--nova.is-recolhida:not(.is-aberta) .lembrete-fixo-pill { display: none; }

    /* Painel contextual: encostado no cartao, flutua sobre a tela sem empurra-la (abaixo dos
       modais). Fica atras do cartao (z-index -1) e sai de tras dele deslizando e em fade; sai
       mais rapido. No modo recolhido parte mais da esquerda para acompanhar a coluna. */
    .sidebar--nova .gsb-painel {
        position: absolute;
        top: var(--gsb-margem);
        bottom: var(--gsb-margem);
        left: calc(var(--gsb-margem) + var(--gsb-menu));
        z-index: -1;
        display: block;
        width: var(--gsb-painel);
        min-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transform: translate3d(-12px, 0, 0);
        border: 1px solid var(--line);
        border-left: 0;
        border-radius: 0 var(--gsb-raio) var(--gsb-raio) 0;
        background: color-mix(in srgb, var(--home-nav-active-bg) 5%, var(--home-sidebar-bottom-bg));
        box-shadow: 18px 0 42px rgba(2, 6, 23, .28);
        transition:
            opacity 170ms var(--gsb-ease),
            transform 210ms var(--gsb-ease),
            visibility 0s linear 210ms;
    }

    .sidebar--nova.is-recolhida:not(.has-painel) .gsb-painel { transform: translate3d(-44px, 0, 0); }

    .sidebar--nova.has-painel .gsb-painel {
        opacity: 1;
        visibility: visible;
        transform: translate3d(0, 0, 0);
        transition:
            opacity 230ms var(--gsb-ease),
            transform var(--gsb-t-painel) var(--gsb-ease),
            visibility 0s;
    }

    .sidebar--nova.is-recolhida.has-painel .gsb-painel {
        transition:
            opacity 240ms var(--gsb-ease) 40ms,
            transform var(--gsb-t-sidebar) var(--gsb-ease),
            visibility 0s;
    }

    .gsb-painel-modulo {
        display: flex;
        flex-direction: column;
        width: var(--gsb-painel);
        height: 100%;
        min-height: 0;
    }

    .gsb-painel-modulo[hidden] { display: none; }

    /* Troca de modulo com o painel aberto: as telas do novo modulo sobem de leve */
    @keyframes gsb-painel-troca {
        from {
            opacity: 0;
            transform: translate3d(0, 6px, 0);
        }
    }

    .sidebar--nova.has-painel .gsb-painel-modulo:not([hidden]) { animation: gsb-painel-troca 240ms var(--gsb-ease) both; }

    .gsb-painel-titulo {
        margin: 0;
        padding: 30px 20px 14px;
        border-bottom: 1px solid var(--line);
        color: var(--text-strong);
        font-family: "Inter";
        font-size: 15px;
        font-weight: 600;
    }

    .gsb-painel-lista {
        display: grid;
        align-content: start;
        gap: 2px;
        flex: 1 1 auto;
        min-height: 0;
        padding: 12px 10px 18px;
        overflow: hidden auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: rgba(100, 116, 139, .34) transparent;
    }

    .gsb-link {
        position: relative;
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: 36px;
        padding: 6px 12px;
        border-radius: 9px;
        color: var(--muted);
        font-family: "Inter";
        font-size: 14px;
        font-weight: 500;
        line-height: 1.25;
        text-decoration: none;
        transition:
            background-color var(--gsb-t-hover) var(--gsb-ease),
            color var(--gsb-t-hover) var(--gsb-ease),
            transform 140ms var(--gsb-ease);
    }

    .gsb-link:active { transform: scale(.985); }
    .gsb-link small { margin-top: 2px; font-size: 11.5px; font-weight: 400; opacity: .75; }

    .gsb-link:hover,
    .gsb-link:focus-visible {
        color: var(--text-strong);
        background-color: color-mix(in srgb, var(--home-nav-active-bg) 18%, transparent);
    }

    .gsb-link.is-active {
        color: #fff;
        background-color: var(--home-nav-active-bg);
    }


    .gsb-painel-secao {
        display: grid;
        gap: 2px;
        margin-top: 8px;
        padding-top: 12px;
        border-top: 1px solid var(--line);
    }

    .gsb-painel-secao-titulo { padding: 0 12px 4px; }

    .gsb-painel-secao + .gsb-link { margin-top: 12px; }

    .gsb-painel-secao + .gsb-link::before {
        content: "";
        position: absolute;
        top: -7px;
        right: 0;
        left: 0;
        border-top: 1px solid var(--line);
    }

    .gsb-painel-vazio { margin: 6px 12px; color: var(--muted); font-size: 13px; }

    /* Sem o sublinhado global de a:hover nos links da sidebar nova */
    body .dashboard aside.sidebar--nova a:hover,
    body .dashboard aside.sidebar--nova a:focus-visible { text-decoration: none; }

    /* Fim do fixar/recolher: o layout novo do conteudo entra num fade curto da tela */
    :root.gsb-transicao::view-transition-old(root),
    :root.gsb-transicao::view-transition-new(root) {
        animation-duration: 200ms;
        animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
    }

    /* Primeiro quadro: estado restaurado sem animar */
    .sidebar--nova.gsb-iniciando,
    .sidebar--nova.gsb-iniciando *,
    .sidebar--nova.gsb-iniciando *::before,
    .sidebar--nova.gsb-iniciando *::after,
    .sidebar--nova.gsb-iniciando::after {
        transition: none !important;
        animation: none !important;
    }
}

@media (min-width: 901px) and (max-width: 1280px) {
    body .dashboard aside.sidebar.sidebar--nova {
        --gsb-menu: 216px;
        --gsb-painel: 216px;
    }
}

@media (min-width: 901px) and (prefers-reduced-motion: reduce) {
    .sidebar--nova,
    .sidebar--nova *,
    .sidebar--nova *::before,
    .sidebar--nova *::after,
    .sidebar--nova::after {
        transition-duration: 1ms !important;
        transition-delay: 0s !important;
        animation: none !important;
    }
}

/* ===== DANFE Simplificado Tipo 2 (NT 2026.003): cupom 80 mm, compacto para economizar papel ===== */
.pdv-receipt.receipt-t2 { width: 72mm; max-width: 72mm; gap: 0; padding: 1mm 0 1mm; font-family: "Helvetica Neue", Arial, sans-serif; font-size: 11px; line-height: 1.2; overflow-wrap: normal; }
.t2 { display: grid; gap: 4px; color: #000; }
.t2 span, .t2 strong, .t2 p { margin: 0; }
.t2-head { display: grid; grid-template-columns: 14mm 1fr; gap: 5px; align-items: center; }
.t2-head:not(:has(.t2-logo)) { grid-template-columns: 1fr; text-align: center; }
.t2-logo { width: 14mm !important; height: 14mm !important; max-width: 14mm !important; max-height: 14mm !important; object-fit: contain; }
.t2-emitente { display: grid; gap: 0; min-width: 0; font-size: 10px; line-height: 1.18; }
.t2-nome { font-size: 10.5px; letter-spacing: -.01em; font-weight: 800; line-height: 1.12; overflow-wrap: anywhere; }
.t2-cnpj { font-weight: 700; font-size: 11px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.t2-titulo { display: grid; gap: 0; text-align: center; padding: 3px 0; border-top: 2px solid #000; border-bottom: 1px solid #000; }
.t2-titulo strong { font-size: 12.5px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; }
.t2-titulo span { font-size: 9.5px; }
.t2-aviso { display: grid; text-align: center; padding: 2px; border: 1.5px dashed #000; font-size: 10px; font-weight: 800; line-height: 1.15; }
.t2-sec { display: grid; gap: 1px; padding-bottom: 3px; border-bottom: 1px dashed #000; }
.t2-sec h3 { margin: 0; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.t2-item { display: grid; gap: 0; padding: 2px 0; border-bottom: 1px dotted #777; }
.t2-item:last-child { border-bottom: 0; }
.t2-item-desc { font-size: 11.5px; font-weight: 700; overflow-wrap: anywhere; line-height: 1.15; }
.t2-cod { font-weight: 600; font-size: 10px; }
.t2-item-val { display: flex; justify-content: space-between; gap: 6px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.t2-row { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.t2-row span:last-child { text-align: right; white-space: nowrap; }
.t2-destaque { margin: 1px 0; padding: 2px 0; border-top: 1px solid #000; border-bottom: 1px solid #000; font-size: 14px; font-weight: 900; }
.t2-sub { margin-top: 1px; font-size: 9.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.t2-consulta { justify-items: center; text-align: center; gap: 0; }
.t2-label { font-size: 9.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.t2-url { font-size: 10.5px; font-weight: 800; }
.t2-chave { font-family: "Courier New", ui-monospace, monospace; font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; line-height: 1.2; }
.t2-qr-area { display: grid; grid-template-columns: 26mm minmax(0, 1fr); gap: 2mm; align-items: center; justify-items: stretch; text-align: left; }
.t2-qr-area .receipt-qr { width: 26mm !important; height: 26mm !important; display: grid; place-items: center; }
.t2-qr-area .receipt-qr img, .t2-qr-area .receipt-qr canvas { width: 26mm !important; height: 26mm !important; }
.t2-dados { display: grid; gap: 0; min-width: 0; font-size: 10px; line-height: 1.2; }
.t2-dados .t2-cnpj { font-size: 11.5px; }
.t2-dados .t2-txt { overflow-wrap: anywhere; }
.t2-kv { white-space: nowrap; font-variant-numeric: tabular-nums; }
.t2-kv strong { font-weight: 800; }
.t2-msg { font-size: 9.5px; line-height: 1.22; }
.t2-comprovante { display: grid; gap: 3px; padding-top: 2px; }
.t2-comprovante hr { display: none; }
.t2-comprovante .receipt-mp-card, .t2-comprovante .receipt-brand-card { min-height: 0 !important; margin-top: 0 !important; padding: 3px 4px !important; }
.t2-impresso { text-align: center; font-size: 9px; padding-top: 1px; }

/* ===== Modal do cupom: visual de papel sobre fundo suave, barra de status e acoes claras ===== */
.pdv-receipt-card {
    width: min(500px, calc(100vw - 20px));
    padding: 0;
    gap: 0;
    background: #f1f4f9;
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
}
.pdv-receipt-card .payments-modal-head {
    padding: 14px 16px;
    background: #fff;
    border-bottom: 1px solid #e3e8f0;
}
.pdv-receipt-card .payments-modal-head h2 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; color: #0f172a; }
.pdv-receipt-card .payments-modal-head p { margin-top: 2px; font-size: 12px; color: #64748b; font-weight: 600; }
.pdv-receipt-card .payments-modal-head button[data-close-pdv-receipt] {
    width: 34px; height: 34px; border-radius: 50%; border: 0; background: #eef1f6; color: #334155; font-size: 18px; line-height: 1; cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}
.pdv-receipt-card .payments-modal-head button[data-close-pdv-receipt]:hover { background: #e2e8f0; transform: scale(1.05); }
.pdv-cupom-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px 0; flex-wrap: wrap; }
.pdv-cupom-chip { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px; background: #e8edf5; color: #475569; font-size: 12px; font-weight: 700; }
.pdv-cupom-chip i { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.pdv-cupom-chip.is-fiscal { background: #e3f6ea; color: #15803d; }
.pdv-cupom-chip.is-fiscal i { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.pdv-cupom-copy { padding: 6px 12px; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: #334155; font-size: 12px; font-weight: 700; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.pdv-cupom-copy:hover { border-color: #3b5b8c; background: #f8fafc; }
.pdv-cupom-copy.is-copiado { border-color: #22c55e; background: #e3f6ea; color: #15803d; }
.pdv-receipt-card [data-pdv-receipt-print-area] {
    max-height: calc(100svh - 230px);
    margin: 12px auto;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .16), 0 1px 0 rgba(15, 23, 42, .06);
    border-radius: 6px;
}
.pdv-receipt-card .settle-actions {
    position: sticky; bottom: 0; padding: 12px 16px; background: #fff; border-top: 1px solid #e3e8f0; border-radius: 0 0 18px 18px;
    display: flex; flex-wrap: wrap; gap: 10px;
}
/* Botoes do rodape: texto sempre inteiro (sem cortar). Com 3 botoes o maior ocupa a linha de cima; com 2 ficam lado a lado. */
.pdv-receipt-card .settle-actions > * {
    flex: 1 1 auto; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 16px; line-height: 1.2; text-align: center; white-space: normal; text-decoration: none;
}
.pdv-receipt-card .settle-actions > :first-child:nth-last-child(3) { flex-basis: 100%; }
.pdv-receipt-card .settle-actions > [data-print-pdv-receipt], .pdv-receipt-card .settle-actions > [data-close-pdv-receipt] { white-space: nowrap; }
.pdv-receipt-card .primary-action, .pdv-receipt-card .cancel-action { min-height: 44px; border-radius: 12px; font-size: 14px; font-weight: 800; }
@media (max-width: 480px) { .pdv-receipt-card { border-radius: 14px; } }
@media print { .pdv-receipt-card [data-pdv-receipt-print-area] { box-shadow: none; max-height: none; margin: 0; } }

/* Impressao direta pelo navegador (80 mm): o modelo Tipo 2 mantem o tamanho da logo e do QR Code. */
@media print {
    .pdv-receipt.receipt-t2 { width: 72mm; max-width: 72mm; padding: 1mm 0 1mm !important; }
}

/* Na tela (modal) o papel tem 80 mm com 4 mm de margem de cada lado: o conteudo fica com os mesmos 72 mm da impressao,
   sem encostar nas bordas nem na barra de rolagem. A impressao nao muda. */
@media screen {
    .pdv-receipt.receipt-t2 { width: 80mm; max-width: 100%; padding: 3mm 4mm 3mm; }
}

/* Compras: abas Produtos/Servicos e aba "Servicos" (NFS-e recebidas) - compacto para sobrar altura para a lista */
.purchase-tabs { display: flex; gap: 6px; margin: 0 0 10px; flex-wrap: wrap; }
.purchase-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 16px; border: 1px solid var(--line, #dfe3ea); border-radius: 999px; background: #fff; color: inherit; text-decoration: none; font-weight: 600; font-size: 14px; }
.purchase-tab small { color: #6b7280; font-weight: 500; font-size: 12px; }
.purchase-tab-badge { background: #b45309; color: #fff; border-radius: 999px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.purchase-tab:hover { border-color: #9db4d6; }
.purchase-tab:focus-visible { outline: 3px solid #93b4e8; outline-offset: 2px; }
.purchase-tab.is-on { background: #3d5a8a; border-color: #3d5a8a; color: #fff; }
.purchase-tab.is-on small { color: #dbe5f5; }
.nfse-faixa { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 0 0 8px; font-size: 13px; color: #4b5563; }
.nfse-faixa-item.is-destaque { color: #b45309; }
.nfse-faixa-item.is-erro { color: #b91c1c; }
.nfse-situacoes { display: flex; gap: 6px; flex-wrap: wrap; }
.nfse-situacao { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line, #dfe3ea); background: #fff; color: inherit; text-decoration: none; font-size: 13px; }
.nfse-situacao.is-on { background: #3d5a8a; border-color: #3d5a8a; color: #fff; }
/* Mesmos pontos de quebra da tabela de NF-e (a coluna Emissao sai nas telas menores); so a coluna de acoes e' mais larga (botao Lancar contas). */
.purchase-table-nfse .contacts-head, .purchase-table-nfse .contacts-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 100px 110px minmax(0, 1fr) 190px; gap: 10px; align-items: center; }
@media (max-width: 1250px) {
    .purchase-table-nfse .contacts-head, .purchase-table-nfse .contacts-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) 100px minmax(0, 1fr) 190px; }
}
@media (max-width: 1000px) {
    .purchase-table-nfse .contacts-head, .purchase-table-nfse .contacts-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 92px 190px; }
}
.purchase-table-nfse .pl-status { flex-wrap: wrap; }
.purchase-table-nfse .contacts-row { padding-top: 8px; padding-bottom: 8px; }
.purchase-table-nfse .nfse-acoes { display: flex; gap: 8px; align-items: center; justify-content: flex-end; position: relative; }
.purchase-table-nfse .nfse-lancar { white-space: nowrap; padding: 7px 14px; min-height: 0; }
.nfse-vazio { padding: 36px 20px; text-align: center; color: #4b5563; }
.nfse-vazio strong { display: block; font-size: 16px; margin-bottom: 6px; color: #1f2937; }
/* Compras: menos espaco vertical entre titulo, abas e filtros (sobra mais altura para a lista) */
.purchase-dashboard .page-top.purchase-page-top { margin-bottom: 8px; }
.purchase-dashboard .cft-barra { margin-bottom: 8px; }
.purchase-dashboard .purchase-tabs { margin-bottom: 6px; }
.purchase-subbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; margin-bottom: 8px; }
.purchase-subbar .purchase-tabs, .purchase-subbar .nfse-faixa { margin: 0; }
/* Janela "Lancar contas a pagar": cabe em telas baixas (rola por dentro) e os botoes ficam sempre visiveis embaixo */
.lcc-card { max-height: calc(100vh - 44px); overflow-y: auto; overscroll-behavior: contain; }
.lcc-acoes { position: sticky; bottom: -18px; z-index: 2; margin-top: 12px; padding: 12px 0 18px; background: var(--panel, #fff); }
@media (max-height: 760px) { .lcc-card { gap: 10px; } .lcc-card .lcc-passo, .lcc-card .lcc-resumo { margin-bottom: 0; } }

/* Estoque do item no pedido: seta ao lado do item e gaveta de detalhes */
.line-actions .line-stock { color: var(--muted, #98a7bd); }
.line-actions .line-stock.is-ok { color: #16a34a; }
.line-actions .line-stock.is-ok:hover, .line-actions .line-stock.is-ok:focus-visible { color: #fff; background: #16a34a; }
.line-actions .line-stock.is-sem { color: var(--danger, #e5484d); }
.line-actions .line-stock.is-sem:hover, .line-actions .line-stock.is-sem:focus-visible { color: #fff; background: var(--danger, #e5484d); }
.eit-gaveta { position: fixed; inset: 0; z-index: 95; display: none; }
.eit-gaveta.is-open { display: block; }
.eit-gaveta-fundo { position: absolute; inset: 0; background: rgba(2, 8, 20, .5); }
.eit-gaveta-painel { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); overflow-y: auto; padding: 22px 24px 28px; background: var(--panel, #fff); color: var(--text, #1f2937); box-shadow: -18px 0 50px rgba(0, 0, 0, .28); outline: none; }
.eit-gaveta-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.eit-gaveta-topo h2 { margin: 0; font-size: 20px; }
.eit-fechar { border: 0; background: transparent; color: inherit; font: inherit; font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.eit-fechar:hover, .eit-fechar:focus-visible { background: var(--panel-soft, #f1f5f9); }
.eit-cabecalho { display: grid; gap: 2px; margin: 14px 0 6px; }
.eit-cabecalho strong { font-size: 18px; }
.eit-cabecalho span { font-size: 14px; color: var(--muted, #64748b); }
.eit-abas { display: flex; gap: 22px; margin: 14px 0 0; border-bottom: 1px solid var(--line, #e2e8f0); }
.eit-abas button { border: 0; background: transparent; color: var(--muted, #64748b); font: inherit; font-size: 15px; padding: 10px 2px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.eit-abas button.is-on { color: var(--text-strong, #0f172a); border-bottom-color: currentColor; font-weight: 600; }
.eit-painel { padding-top: 6px; }
.eit-lista { margin: 0; }
.eit-lista > div { display: flex; justify-content: space-between; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--line-soft, #eef2f6); font-size: 15px; }
.eit-lista dt { margin: 0; color: var(--muted-strong, #475569); }
.eit-lista dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.eit-lista .is-sem dd { color: var(--danger, #e5484d); }
.eit-aviso { margin: 14px 0; font-size: 14px; color: var(--muted, #64748b); }
.eit-aviso.is-sem { color: var(--danger, #e5484d); }
.eit-tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.eit-tabela th { text-align: left; font-weight: 500; color: var(--muted, #64748b); padding: 10px 6px; border-bottom: 1px solid var(--line, #e2e8f0); }
.eit-tabela td { padding: 12px 6px; border-bottom: 1px solid var(--line-soft, #eef2f6); font-variant-numeric: tabular-nums; }
.eit-tabela th:nth-child(n+4), .eit-tabela td:nth-child(n+4) { text-align: right; }
.eit-nota { margin: 14px 0 0; font-size: 13px; color: var(--muted, #64748b); }

/* Tabela de itens do pedido: coluna de acoes com espaco para as 3 acoes (estoque, editar, excluir) sem cortar */
.order-lines-table th:nth-child(2), .order-lines-table td:nth-child(2) { width: 12%; }
.order-lines-table th:nth-child(3), .order-lines-table td:nth-child(3) { width: 23%; }
.order-lines-table th:nth-child(9), .order-lines-table td:nth-child(9) { width: 13%; min-width: 104px; }
.order-lines-table .line-actions { gap: 4px; }
.order-lines-table .line-actions button { width: 28px; height: 28px; flex: 0 0 auto; }
.bd-vps-row{display:grid;grid-template-columns:minmax(200px,2.2fr) 1.1fr .8fr 1.3fr 1.3fr;gap:12px;align-items:center}
.bd-vps-row small{display:block;color:var(--muted);font-size:.78rem;font-weight:500;margin-top:2px}
.bd-vps-row i.bd-selo{font-style:normal}
.bd-vps-nota{margin:14px 0 0;color:var(--muted);font-size:.84rem;line-height:1.5}
@media (max-width:1000px){.bd-vps-row{grid-template-columns:1fr 1fr}.bd-vps-row.contacts-head{display:none}}
/* Pagamento "Parcial" na lista de pedidos: amarelo claro. */
.type-pill.order-payment-pill.is-status-parcial,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.order-payment-pill.is-status-parcial {
    border-color: #e5c23b;
    color: #8a6a05;
    background: rgba(250, 204, 21, .20);
}
/* Consignação acertada: verde (igual ao Pago/Entregue). */
.type-pill.is-status-acertada,
.dashboard:has(.contacts-card):not(.dashboard-home) .type-pill.is-status-acertada {
    border-color: #159947;
    color: #127a3a;
    background: rgba(21, 153, 71, .12);
}
/* Impressao da consignacao: descricao numa linha so (sem quebrar nem cortar) e numeros alinhados a direita. */
.print-table.consig-print-table .col-desc { white-space: nowrap; width: 100%; }
.print-table.consig-print-table.is-medindo .col-desc { width: auto; }
.print-table.consig-print-table th,
.print-table.consig-print-table td { white-space: nowrap; font-size: var(--consig-fs, 12px); padding-inline: var(--consig-px, 9px); }
@media print {
    .print-table.consig-print-table th,
    .print-table.consig-print-table td { font-size: var(--consig-fs-print, 12px); padding-inline: var(--consig-px-print, 9px); }
}
.print-table.consig-print-table .col-num { text-align: right; }

/* Mensalidades: régua de WhatsApp (modal) */
.mens-regua-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.mens-regua-pill { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; border: 1px solid transparent; }
.mens-regua-pill.is-ok { color: #127a3a; background: rgba(21, 153, 71, .12); border-color: #159947; }
.mens-regua-pill.is-off { color: #92650a; background: rgba(234, 179, 8, .16); border-color: #ca8a04; }
.mens-form .mens-regua-passo, .mens-form .mens-previa-box, .mens-form .form-actions { grid-column: 1 / -1; }
.mens-regua-passo { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line-soft, #dbe3ef); border-radius: 12px; }
.mens-regua-passo-topo { display: grid; grid-template-columns: 90px 1fr auto; gap: 12px; align-items: end; }
.mens-regua-passo-opcoes { display: grid; gap: 4px; }
.mens-regua-passo textarea { width: 100%; box-sizing: border-box; font: inherit; line-height: 1.45; resize: vertical; }
.mens-regua-tabela { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 14px; }
.mens-regua-tabela th, .mens-regua-tabela td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line-soft, #dbe3ef); }
.mens-regua-vazio { color: var(--muted, #64748b); font-size: 13px; margin: 4px 0 14px; }
@media (max-width: 700px) { .mens-regua-passo-topo { grid-template-columns: 1fr; } }

/* ---- Cobranca (CRM): manual passo a passo (modal) ---- */
.crm-man[hidden]{display:none}
.crm-man{position:fixed;inset:0;z-index:3000;display:grid;place-items:center;padding:16px}
.crm-man-fundo{position:absolute;inset:0;background:rgba(16,24,40,.55)}
.crm-man-janela{position:relative;display:grid;grid-template-rows:auto minmax(0,1fr) auto;width:min(1080px,100%);height:min(780px,100%);border-radius:20px;background:var(--panel,#fff);color:var(--text,#344054);box-shadow:0 24px 70px rgba(16,24,40,.35);overflow:hidden}
.crm-man-topo{display:flex;justify-content:space-between;gap:12px;padding:18px 22px 14px;border-bottom:1px solid var(--line-soft,#e4e7ec)}
.crm-man-topo h2{margin:0;font-size:1.25rem;color:var(--text-strong,#101828)}
.crm-man-topo p{margin:2px 0 0;font-size:.85rem;color:var(--muted,#667085)}
.crm-man-corpo{display:grid;grid-template-columns:250px minmax(0,1fr);min-height:0}
.crm-man-indice{overflow-y:auto;padding:14px 10px;border-right:1px solid var(--line-soft,#e4e7ec);background:var(--panel-soft,#f8fafc)}
.crm-man-indice ol{list-style:none;margin:0;padding:0;display:grid;gap:2px}
.crm-man-indice button{display:flex;align-items:center;gap:10px;width:100%;padding:8px 10px;border:0;border-radius:10px;background:transparent;color:inherit;font:inherit;font-size:.86rem;text-align:left;cursor:pointer}
.crm-man-indice button:hover{background:rgba(59,111,182,.08)}
.crm-man-indice button.is-atual{background:rgba(59,111,182,.14);color:var(--text-strong,#101828);font-weight:800}
.crm-man-num{flex:none;display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;border:2px solid var(--line,#cbd5e1);font-size:.72rem;font-weight:800}
.crm-man-indice button.is-feito .crm-man-num{background:#16a34a;border-color:#16a34a;color:#fff}
.crm-man-indice button.is-atual .crm-man-num{background:#3b6fb6;border-color:#3b6fb6;color:#fff}
.crm-man-palco{overflow-y:auto;padding:20px 26px 26px;scroll-behavior:smooth}
.crm-man-passo{display:grid;gap:14px;max-width:760px}
.crm-man-passo[hidden]{display:none}
.crm-man-contador{margin:0;font-size:.75rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#3b6fb6}
.crm-man-passo>h3{margin:0;font-size:1.5rem;line-height:1.2;color:var(--text-strong,#101828)}
.crm-man-resumo{margin:0;font-size:1rem;line-height:1.55}
.crm-man-tela{position:relative;padding:34px 18px 18px;border:1px solid var(--line-soft,#e4e7ec);border-radius:16px;background:var(--panel-soft,#f2f4f7);pointer-events:none;user-select:none}
.crm-man-tela::before{content:"";position:absolute;top:12px;left:16px;width:9px;height:9px;border-radius:50%;background:#f87171;box-shadow:15px 0 0 #fbbf24,30px 0 0 #4ade80}
.man-alvo{position:relative}
.crm-man-pin{position:absolute;top:-8px;left:-15px;z-index:2;display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#e5484d;color:#fff;font-style:normal;font-size:.76rem;font-weight:800;line-height:1;box-shadow:0 0 0 3px var(--panel,#fff),0 2px 6px rgba(16,24,40,.3)}
.crm-man-legenda{list-style:none;margin:0;padding:0;display:grid;gap:10px;counter-reset:ponto}
.crm-man-legenda li{display:flex;gap:12px;align-items:flex-start;font-size:.94rem;line-height:1.5}
.crm-man-legenda .crm-man-pin{position:static;flex:none;margin-top:1px;box-shadow:none}
.crm-man-legenda code,.crm-man-passo code{background:#eef2f6;padding:0 5px;border-radius:5px;font-size:.88em}
.crm-man-dica{margin:0;padding:12px 14px;border-radius:12px;background:#e5f1ff;color:#1d4f9f;font-size:.9rem;line-height:1.5}
.crm-man-faq{display:grid;gap:8px}
.crm-man-faq details{border:1px solid var(--line-soft,#e4e7ec);border-radius:12px;padding:10px 14px;background:var(--panel-soft,#f8fafc)}
.crm-man-faq summary{cursor:pointer;font-weight:700;color:var(--text-strong,#101828)}
.crm-man-faq p{margin:8px 0 0;font-size:.9rem;line-height:1.5}
.crm-man-rodape{display:grid;gap:12px;padding:0 22px 16px;border-top:1px solid var(--line-soft,#e4e7ec)}
.crm-man-progresso{height:4px;margin:0 -22px;background:var(--line-soft,#e4e7ec)}
.crm-man-progresso i{display:block;height:100%;width:0;background:#3b6fb6;transition:width .25s ease}
.crm-man-botoes{display:flex;justify-content:space-between;gap:10px}
.crm-man-botoes button[disabled]{opacity:.45;cursor:default}
.crm-man-botao.is-novo{position:relative;border-color:#3b6fb6;color:#3b6fb6}
.crm-man-botao.is-novo::after{content:"";position:absolute;top:-4px;right:-4px;width:10px;height:10px;border-radius:50%;background:#e5484d;box-shadow:0 0 0 3px var(--panel,#fff)}
body.crm-man-aberto{overflow:hidden}
/* Telas de exemplo: adaptam as pecas reais do CRM para caber no manual */
.crm-man-tela .crm-kpis{grid-template-columns:repeat(auto-fit,minmax(120px,1fr))}
.crm-man-tela .crm-quadro{overflow:visible;gap:10px}
.crm-man-tela .crm-coluna{flex:1 1 0;min-width:0}
.crm-man-tela .crm-cartoes{overflow:visible}
.crm-man-tela .crm-filtros{margin-bottom:8px}
.crm-man-tela .crm-filtros label{position:relative}
.crm-man-nota{margin:8px 0 0;font-size:.82rem;color:var(--muted,#667085)}
.crm-man-ficha{display:grid;gap:12px}
.crm-man-painel{background:var(--panel,#fff)}
.crm-man-duas{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.crm-man-lado{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:14px;align-items:start}
.crm-man-cartao{cursor:default}
.crm-man-abas{margin-bottom:10px}
.crm-man-aba{position:relative;padding:8px 14px;font-weight:700;font-size:.9rem;color:var(--muted,#667085)}
.crm-man-aba.is-ativa{color:#3b6fb6;border-bottom:3px solid #3b6fb6;margin-bottom:-1px}
.crm-man-lista li span:first-child{font-size:.88rem}
.crm-man-regua{display:grid;gap:12px}
.crm-man-regua .crm-regua-form fieldset{position:relative}
.crm-man-barras{display:grid;gap:8px;padding:14px;border-radius:12px;background:var(--panel,#fff);border:1px solid var(--line-soft,#e4e7ec)}
.crm-man-barras small{font-size:.72rem;font-weight:700;text-transform:uppercase;color:var(--muted,#667085)}
.crm-man-barra{display:grid;grid-template-columns:110px 1fr 80px;gap:10px;align-items:center;font-size:.84rem}
.crm-man-barra i{display:block;height:12px;border-radius:999px;background:linear-gradient(90deg,#3b6fb6,#6aa0e0)}
.crm-man-barra b{text-align:right}
.crm-man-rel{display:grid;gap:12px}
@media (max-width:860px){
  .crm-man{padding:0}
  .crm-man-janela{border-radius:0;height:100%}
  .crm-man-corpo{grid-template-columns:1fr}
  .crm-man-indice{display:none}
  .crm-man-palco{padding:16px 16px 22px}
  .crm-man-passo>h3{font-size:1.25rem}
  .crm-man-tela .crm-quadro{flex-direction:column}
  .crm-man-tela .crm-coluna{flex:none}
  .crm-man-lado,.crm-man-duas{grid-template-columns:1fr}
  .crm-man-barra{grid-template-columns:90px 1fr 70px}
}
@media (prefers-reduced-motion:reduce){.crm-man-progresso i,.crm-man-palco{transition:none;scroll-behavior:auto}}

/* Login e cadastro: um cartao so, dividido (arte da marca a esquerda, formulario a direita),
   sempre escuro mesmo com o sistema no tema claro. Cadastro e login sao dois paineis do mesmo
   cartao (data-auth-painel), trocados por [data-auth-ir]. */
:root:has(main.auth-page) { color-scheme: dark; }

:root body:has(> main.auth-page) {
    /* a regra antiga do login prende a altura e esconde a rolagem; o cadastro pode passar da tela */
    height: auto;
    overflow-y: auto;
    background:
        radial-gradient(1200px 700px at 18% 12%, rgba(52, 165, 255, .10), transparent 60%),
        radial-gradient(900px 600px at 85% 90%, rgba(65, 106, 157, .16), transparent 62%),
        #060d19;
}

.auth-page {
    --auth-fundo-cartao: #0a1424;
    --auth-campo: #0e1a2e;
    --auth-campo-borda: rgba(148, 170, 205, .18);
    --auth-campo-borda-hover: rgba(148, 170, 205, .32);
    --auth-texto: #eef3fb;
    --auth-texto-apoio: #9aa9c0;
    --auth-acento: #34a5ff;
    --auth-botao: #2f6fd6;
    --auth-botao-hover: #3a7ce4;
    --auth-ease: cubic-bezier(0.22, 1, 0.36, 1);
    /* tokens do sistema usados por elementos compartilhados (certificado, olho da senha) */
    --text-strong: #ffffff;
    --muted: #9aa9c0;
    --line: rgba(148, 170, 205, .16);
    --shadow: rgba(0, 0, 0, .38);
    gap: 18px;
    align-content: center;
    padding: 24px 16px;
    color: var(--auth-texto);
    font-family: "Inter", Arial, Helvetica, sans-serif;
}

.auth-page ::selection { color: #fff; background: rgba(52, 165, 255, .38); }

/* vence a regra antiga body:not(.is-dashboard) .page (altura presa e sem rolagem) */
body:not(.is-dashboard) .page.auth-page {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
    padding: 28px 16px;
}

.auth-cartao {
    width: min(1000px, 100%);
    /* altura do cadastro (o painel mais alto), sem passar da tela: trocar login/cadastro nao faz
       o cartao pular e a pagina nao precisa rolar */
    min-height: min(620px, calc(100dvh - 40px));
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(148, 170, 205, .12);
    border-radius: 26px;
    background: var(--auth-fundo-cartao);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .04),
        0 2px 6px rgba(0, 0, 0, .28),
        0 40px 90px -30px rgba(0, 0, 0, .7);
}

/* Arte da marca: degrade nas cores do sistema, com granulacao e um movimento bem lento */
.auth-arte {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    min-height: 100%;
    padding: 30px 32px 34px;
    overflow: hidden;
    isolation: isolate;
    border-radius: 18px;
    background: #071a3d;
}

.auth-arte::before {
    content: "";
    position: absolute;
    inset: -30%;
    z-index: -2;
    background:
        radial-gradient(38% 42% at 30% 38%, #1d4fd0 0%, rgba(29, 79, 208, 0) 70%),
        radial-gradient(34% 38% at 72% 26%, #34a5ff 0%, rgba(52, 165, 255, 0) 72%),
        radial-gradient(40% 40% at 64% 78%, #416a9d 0%, rgba(65, 106, 157, 0) 70%),
        radial-gradient(30% 30% at 22% 82%, #0b2b6e 0%, rgba(11, 43, 110, 0) 70%),
        linear-gradient(160deg, #0a2a63 0%, #071a3d 55%, #050f24 100%);
    filter: blur(28px) saturate(118%);
    animation: authArteDeriva 26s var(--auth-ease) infinite alternate;
}

.auth-arte::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .22;
    mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='g'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23g)'/></svg>");
    pointer-events: none;
}


@keyframes authArteDeriva {
    from { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); }
    to { transform: translate3d(3%, 3%, 0) rotate(8deg) scale(1.08); }
}

.auth-arte-logo {
    width: 168px;
    height: auto;
    display: block;
    /* a imagem tem 10,1% de margem transparente a esquerda: alinha o desenho com o texto */
    transform: translateX(-10.1%);
}

/* o titulo fica estreito (quebra em 3 linhas fortes); o texto de apoio tem largura propria e
   quebra equilibrada em 2 linhas */
.auth-arte-texto { max-width: 100%; }

.auth-arte-titulo {
    margin: 0;
    color: #fff;
    font-size: clamp(24px, 2.6vw, 31px);
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: -.02em;
    text-wrap: balance;
    max-width: 16em;
}

.auth-arte-apoio {
    max-width: 44ch;
    text-wrap: balance;
    margin: 12px 0 0;
    color: rgba(226, 238, 255, .78);
    font-size: 14px;
    line-height: 1.5;
}

/* Formulario */
.auth-conteudo {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    max-width: 392px;
    margin: 0 auto;
    padding: 40px 24px;
}

.auth-marca {
    width: 36px;
    height: 36px;
    margin-bottom: 18px;
    object-fit: contain;
}

.auth-form { display: block; }
.auth-form[hidden] { display: none; }
.auth-form:not([hidden]) { animation: authPainelEntra 320ms var(--auth-ease) both; }

@keyframes authPainelEntra {
    from { opacity: 0; transform: translate3d(0, 8px, 0); }
}

.auth-form h1 {
    margin: 0;
    color: #fff;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.auth-sub {
    margin: 8px 0 28px;
    color: var(--auth-texto-apoio);
    font-size: 14px;
    line-height: 1.5;
}

.auth-campo {
    display: grid;
    gap: 7px;
    margin-bottom: 18px;
}

.auth-campo-par {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.auth-page label {
    color: #dbe4f1;
    font-size: 13px;
    font-weight: 500;
}

.auth-page input:not([type="hidden"]) {
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--auth-campo-borda);
    border-radius: 11px;
    color: var(--auth-texto);
    caret-color: var(--auth-acento);
    background: var(--auth-campo);
    box-shadow: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    transition:
        border-color 160ms var(--auth-ease),
        box-shadow 160ms var(--auth-ease),
        background-color 160ms var(--auth-ease);
}

.auth-page input::placeholder { color: #7d8da6; font-weight: 400; }
.auth-page input:hover { border-color: var(--auth-campo-borda-hover); }

.auth-page input:focus {
    border-color: rgba(52, 165, 255, .7);
    background: #0f1e35;
    box-shadow: 0 0 0 4px rgba(52, 165, 255, .14);
}

/* Preenchimento automatico do navegador sem o fundo claro padrao */
.auth-page input:-webkit-autofill,
.auth-page input:-webkit-autofill:hover,
.auth-page input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--auth-texto);
    caret-color: var(--auth-acento);
    box-shadow: 0 0 0 1000px var(--auth-campo) inset;
    transition: background-color 9999s ease-out;
}

.auth-page .password-control input { padding-right: 46px; }

.auth-page .toggle-password {
    right: 7px;
    bottom: 7px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    color: #7f8fa8;
    transition: color 160ms var(--auth-ease), background-color 160ms var(--auth-ease);
}

.auth-page .toggle-password:hover { color: #fff; background: rgba(148, 170, 205, .12); }

.auth-page .toggle-password:focus-visible,
.auth-page a:focus-visible,
.auth-enviar:focus-visible {
    outline: 2px solid var(--auth-acento);
    outline-offset: 2px;
}

/* Linha de acoes: botao principal e, ao lado, o Certificado Digital como botao secundario */
.auth-acoes {
    display: flex;
    gap: 10px;
    margin: 8px 0 22px;
}

.auth-enviar {
    flex: 1 1 auto;
    width: 100%;
    height: 48px;
    margin: 0;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: var(--auth-botao);
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .14),
        0 10px 24px -10px rgba(47, 111, 214, .75);
    transition:
        background-color 160ms var(--auth-ease),
        transform 160ms var(--auth-ease),
        box-shadow 160ms var(--auth-ease);
}

.auth-enviar:hover { background: var(--auth-botao-hover); transform: translateY(-1px); }
.auth-enviar:active { transform: translateY(0) scale(.99); }

.auth-page a.auth-certificado,
.auth-page .auth-secundario {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 16px;
    border: 1px solid var(--auth-campo-borda);
    border-radius: 12px;
    color: #dbe4f1;
    background: var(--auth-campo);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition:
        border-color 160ms var(--auth-ease),
        background-color 160ms var(--auth-ease),
        color 160ms var(--auth-ease);
}

.auth-page a.auth-certificado:hover,
.auth-page .auth-secundario:hover {
    border-color: var(--auth-campo-borda-hover);
    color: #fff;
    background: #12213a;
    text-decoration: none;
}

.auth-page .auth-secundario { font-family: inherit; cursor: pointer; }
.auth-page .auth-secundario:focus-visible { outline: 2px solid var(--auth-acento); outline-offset: 2px; }
.auth-sub strong { color: #fff; font-weight: 600; word-break: break-all; }

.auth-certificado-icone { display: grid; place-items: center; color: var(--auth-acento); }
.auth-page .auth-certificado-icone svg { display: block; width: 18px; height: 20px; color: var(--auth-acento); }

.auth-links {
    display: grid;
    gap: 6px;
    color: var(--auth-texto-apoio);
    font-size: 13px;
    text-align: center;
}

.auth-links p { margin: 0; }

.auth-page a {
    color: var(--auth-acento);
    font-weight: 600;
    text-decoration: none;
    text-underline-offset: 3px;
}

.auth-page a:hover { text-decoration: underline; }

.auth-alerta {
    margin: -10px 0 20px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 128, 128, .28);
    border-radius: 10px;
    color: #ffd9d9;
    background: rgba(159, 36, 36, .22);
    font-size: 13px;
    font-weight: 500;
}

.auth-alerta.is-success {
    border-color: rgba(101, 255, 171, .26);
    color: #ccffe1;
    background: rgba(18, 136, 58, .2);
}

/* Popup "Redefinir senha": mesmo cartao escuro do login, por cima da tela escurecida. Entra com
   fade, leve subida e escala; sai mais rapido. */
.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(3, 8, 18, .62);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 180ms ease-out;
}

.auth-modal[hidden] { display: none; }
.auth-modal.is-aberto { opacity: 1; transition: opacity 260ms var(--auth-ease); }

.auth-modal-cartao {
    position: relative;
    width: min(420px, 100%);
    padding: 30px 30px 24px;
    border: 1px solid rgba(148, 170, 205, .14);
    border-radius: 22px;
    background: var(--auth-fundo-cartao);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, .04),
        0 2px 6px rgba(0, 0, 0, .3),
        0 40px 90px -30px rgba(0, 0, 0, .75);
    transform: translate3d(0, 8px, 0) scale(.97);
    transition: transform 180ms ease-out;
}

.auth-modal.is-aberto .auth-modal-cartao {
    transform: translate3d(0, 0, 0) scale(1);
    transition: transform 320ms var(--auth-ease);
}

.auth-modal-cartao h2 {
    margin: 0;
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.auth-modal-cartao .auth-marca { display: block; width: 32px; height: 32px; margin-bottom: 16px; }
.auth-modal-cartao .auth-sub { margin-bottom: 22px; }
.auth-modal-cartao .auth-acoes { margin-bottom: 0; }

.auth-modal-fechar {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 10px;
    color: #8b9bb4;
    background: transparent;
    cursor: pointer;
    transition: color 160ms var(--auth-ease), background-color 160ms var(--auth-ease);
}

.auth-modal-fechar:hover { color: #fff; background: rgba(148, 170, 205, .12); }
.auth-modal-fechar:focus-visible { outline: 2px solid var(--auth-acento); outline-offset: 2px; }
.auth-modal-fechar svg { width: 18px; height: 18px; }

/* Popup em etapas (e-mail -> codigo -> nova senha): indicador de progresso no topo */
.auth-etapas {
    display: flex;
    gap: 6px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.auth-etapas li {
    flex: 1 1 0;
    padding-top: 8px;
    border-top: 2px solid rgba(148, 170, 205, .18);
    color: #7d8da6;
    font-size: 12px;
    font-weight: 500;
    transition: border-color 220ms var(--auth-ease), color 220ms var(--auth-ease);
}

.auth-modal[data-etapa="email"] [data-passo="email"],
.auth-modal[data-etapa="codigo"] [data-passo="email"],
.auth-modal[data-etapa="codigo"] [data-passo="codigo"],
.auth-modal[data-etapa="senha"] li { border-top-color: var(--auth-acento); color: var(--auth-texto-apoio); }

.auth-modal[data-etapa="email"] [data-passo="email"],
.auth-modal[data-etapa="codigo"] [data-passo="codigo"],
.auth-modal[data-etapa="senha"] [data-passo="senha"] { color: #fff; }

.auth-modal-etapa[hidden] { display: none; }
.auth-modal-etapa:not([hidden]) { animation: authPainelEntra 320ms var(--auth-ease) both; }
.auth-modal-cartao .auth-alerta { margin: 0 0 16px; }

/* Codigo de 6 numeros: grande, espacado e centralizado */
.auth-page input.auth-codigo:not([type="hidden"]) {
    height: 56px;
    padding: 0 0 0 .45em;
    font-size: 26px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: .45em;
    text-align: center;
}

.auth-page input.auth-codigo::placeholder { color: #7d8da6; letter-spacing: .45em; }

.auth-link-botao {
    padding: 0;
    border: 0;
    color: var(--auth-acento);
    background: none;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-underline-offset: 3px;
}

.auth-link-botao:hover { text-decoration: underline; }
.auth-link-botao:focus-visible { outline: 2px solid var(--auth-acento); outline-offset: 2px; border-radius: 4px; }
.auth-modal-cartao .auth-links { margin-top: 16px; }
.auth-modal-cartao .auth-links a,
.auth-link-botao { white-space: nowrap; }

/* Telas baixas de notebook: formulario mais compacto para caber sem rolar */
@media (min-width: 861px) and (max-height: 720px) {
    body:not(.is-dashboard) .page.auth-page { padding-top: 20px; padding-bottom: 20px; }
    .auth-conteudo { padding: 20px 24px; }
    .auth-marca { width: 30px; height: 30px; margin-bottom: 12px; }
    .auth-form h1 { font-size: 25px; }
    .auth-sub { margin-bottom: 18px; }
    .auth-campo { margin-bottom: 13px; }
    .auth-page input:not([type="hidden"]) { height: 42px; }
    .auth-acoes { margin: 4px 0 16px; }
    .auth-enviar,
    .auth-page a.auth-certificado { height: 44px; }
}

/* Telas menores: a arte vira uma faixa curta com o logo, acima do formulario */
@media (max-width: 860px) {
    body:not(.is-dashboard) .page.auth-page { align-content: start; padding-top: 20px; }

    .auth-cartao {
        grid-template-columns: 1fr;
        min-height: 0;
        border-radius: 22px;
    }

    .auth-arte {
        min-height: 118px;
        padding: 22px 22px 20px;
        border-radius: 14px;
    }

    .auth-arte-texto { display: none; }
    .auth-arte { justify-content: center; }
    .auth-conteudo { padding: 24px 12px 20px; }
    .auth-marca { display: none; }
}

@media (max-width: 480px) {
    .auth-arte-logo { width: 140px; }
    .auth-acoes { flex-direction: column; gap: 8px; }
    body:not(.is-dashboard) .page.auth-page { padding-top: 14px; padding-bottom: 14px; }
    .auth-campo-par { grid-template-columns: 1fr; gap: 0; }
    .auth-form h1 { font-size: 24px; }
}

@media (max-width: 860px) and (max-height: 720px) {
    body:not(.is-dashboard) .page.auth-page { padding-top: 12px; padding-bottom: 12px; }
    .auth-arte { min-height: 72px; padding: 14px 18px; }
    .auth-conteudo { padding: 16px 10px 12px; }
    .auth-form h1 { font-size: 22px; }
    .auth-sub { margin: 4px 0 14px; }
    .auth-campo { gap: 5px; margin-bottom: 10px; }
    .auth-page input:not([type="hidden"]) { height: 40px; }
    .auth-acoes { margin: 4px 0 12px; }
    .auth-enviar,
    .auth-page a.auth-certificado { height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-arte::before,
    .auth-form:not([hidden]) { animation: none; }
    .auth-modal,
    .auth-modal-cartao { transition-duration: 1ms !important; }
}

/* Aviso de e-mail de nota fiscal que nao foi entregue ao cliente (documentos-fiscais-email.php, emailAvisoEntregaHtml) */
.aviso-email { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 60; width: min(620px, calc(100vw - 24px)); padding: 14px 16px; border: 1px solid var(--line); border-left: 4px solid var(--warning, #ffd24d); border-radius: 14px; background: var(--panel, #fff); color: var(--text, #0f172a); box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45); font-size: 13px; line-height: 1.45; }
.aviso-email[hidden] { display: none; }
.aviso-email > strong:first-child { display: block; margin-bottom: 6px; font-size: 14px; }
.aviso-email li strong { display: inline; font-weight: 700; word-break: break-all; }
.aviso-email ul { margin: 0 0 8px; padding-left: 18px; }
.aviso-email li { margin: 3px 0; }
.aviso-email p { margin: 0 0 10px; color: var(--muted, #64748b); }
.aviso-email-acoes { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.aviso-email-acoes a { font-weight: 600; text-decoration: none; }
.aviso-email-acoes button { min-height: 32px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.ef-table .ef-anterior { opacity: .78; background: rgba(128,138,155,.10); }
.ef-table .ef-anterior small { display: block; }

/* ===== Grade de produtos: variações por tamanho, cor... (partials/produto-grade-secao.php) ===== */
.pf-grade-attrs { display: grid; gap: 16px; }
.pf-grade-attrs:empty { display: none; }
.pf-grade-attr { display: grid; gap: 6px; }
.pf-grade-attr-nome { color: var(--text-strong); font-size: 14px; font-weight: 700; }
.pf-grade-attr > small { color: #8b97a9; font-size: 12px; }
.pf-grade-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 46px; padding: 6px 8px 6px 10px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--input); cursor: text; box-sizing: border-box; }
.pf-grade-chips:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 15%, transparent); }
.pf-grade-chip { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 12px; border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--brand) 10%, transparent); color: var(--text-strong); font-size: 14px; font-weight: 600; }
.pf-grade-chip button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #8b97a9; font-size: 16px; line-height: 1; cursor: pointer; }
.pf-grade-chip button:hover { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.pf-grade .pf-grade-chips .pf-grade-chip-input { flex: 1 1 120px; min-width: 100px; height: 30px; min-height: 0; padding: 0 4px; border: 0 !important; background: transparent !important; box-shadow: none !important; outline: 0; color: var(--text-strong); font: inherit; }
.pf-grade-trash { display: grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; margin-left: auto; padding: 0; border: 1px solid var(--line-soft); border-radius: 50%; background: var(--panel); color: var(--danger); font-size: 14px; cursor: pointer; }
.pf-grade-trash:hover { border-color: var(--danger); }
.pf-grade-add { display: inline-flex; align-items: center; gap: 6px; margin: 14px 0 0; padding: 4px 0; border: 0; background: none; color: var(--brand); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.pf-grade-add[hidden] { display: none; }
.pf-grade-add:hover span:last-child { text-decoration: underline; }
.pf-grade-novo { display: grid; gap: 10px; max-width: 460px; margin-top: 14px; padding: 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel-soft); }
.pf-grade-novo[hidden] { display: none; }
.pf-grade-novo h3 { margin: 0; font-size: 16px; color: var(--text-strong); }
.pf-grade-novo label { display: grid; gap: 6px; margin: 0; font-size: 13px; font-weight: 600; color: var(--text-strong); }
.pf-grade .pf-grade-novo input { height: 44px; min-height: 44px; box-sizing: border-box; padding: 0 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--input); color: var(--text-strong); font: inherit; }
.pf-grade-sugestoes { display: flex; flex-wrap: wrap; gap: 6px; }
.pf-grade-sugestoes:empty { display: none; }
.pf-grade-sugestoes button { height: 30px; padding: 0 12px; border: 1px dashed var(--line); border-radius: 999px; background: transparent; color: var(--text-strong); font: inherit; font-size: 13px; cursor: pointer; }
.pf-grade-sugestoes button:hover { border-color: var(--brand); color: var(--brand); }
.pf-grade-novo-acoes { display: flex; align-items: center; gap: 14px; }
.pf-grade-novo-acoes .primary-action { min-height: 38px; }
.pf-grade-cancelar { border: 0; background: none; padding: 0; color: var(--text-strong); font: inherit; font-weight: 600; cursor: pointer; }
.pf-grade-cancelar small { color: #8b97a9; font-size: 10px; }
.pf-grade-grid { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.pf-grade-grid[hidden] { display: none; }
.pf-grade-grid h3 { margin: 0 0 4px; font-size: 18px; color: var(--text-strong); }
.pf-grade-help { margin: 4px 0 12px; color: #8b97a9; font-size: 13px; line-height: 1.5; }
.pf-grade-link { border: 0; background: none; padding: 0; margin-left: 6px; color: var(--danger); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.pf-grade-table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 10px; }
.pf-grade-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--text-strong); table-layout: fixed; }
.pf-grade-table col.c-este { width: 56px; }
.pf-grade-table col.c-var { width: 22%; }
.pf-grade-table col.c-cod { width: 17%; }
.pf-grade-table col.c-ean { width: 19%; }
.pf-grade-table col.c-preco { width: 14%; }
.pf-grade-table col.c-est { width: 12%; }
.pf-grade-table col.c-acao { width: 70px; }
.pf-grade-table th { text-align: left; font-size: 12px; font-weight: 700; color: #8b97a9; padding: 10px 8px; border-bottom: 1px solid var(--line-soft); background: var(--panel-soft); }
.pf-grade-table td { padding: 8px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; overflow-wrap: anywhere; }
.pf-grade-table tbody tr:last-child td { border-bottom: 0; }
.pf-grade-table th.num, .pf-grade-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pf-grade-table td.c-este, .pf-grade-table td.c-acao { text-align: center; }
.pf-grade .pf-grade-table input:not([type="radio"]) { width: 100%; min-width: 0; box-sizing: border-box; height: 40px; min-height: 40px; border: 1px solid var(--line-soft); border-radius: 8px; padding: 0 10px; color: var(--text-strong); background: var(--input); font: inherit; }
.pf-grade .pf-grade-table td.num input { text-align: right; }
.pf-grade .pf-grade-table input[type="radio"] { width: 18px !important; height: 18px !important; min-height: 0 !important; margin: 0; padding: 0; accent-color: var(--brand); cursor: pointer; }
.pf-grade-table .c-acao a { color: var(--brand); font-weight: 700; font-size: 13px; }
.pf-grade-table .c-acao .pf-grade-trash { margin: 0 auto; }
.pf-grade-table td.pf-grade-do-cadastro small, .pf-grade-table td.num small { color: #8b97a9; font-size: 12px; }
.pf-grade-dot { color: var(--brand); font-size: 14px; }
.pf-grade-table tfoot td { font-weight: 700; border-top: 1px solid var(--line-soft); border-bottom: 0; }
.pf-grade-table tr.is-current td { background: color-mix(in srgb, var(--brand) 7%, transparent); }
.pf-grade-table tr.is-excluded td { opacity: .5; }
.pf-grade-table tr.is-excluded strong { text-decoration: line-through; }
.pf-grade-table tr.is-excluded td.c-acao { opacity: 1; }
.pf-grade-badge { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--panel-soft); color: var(--brand); font-size: 11px; font-weight: 800; vertical-align: 1px; }
.pf-grade-badge.is-new { color: var(--success); }
.pf-grade-badge.is-warn { color: var(--warning); }
@media (max-width: 720px) {
    .pf-grade-table { table-layout: auto; min-width: 680px; }
}

/* Produtos e Serviços: o topo quebra em duas linhas (muitos botões); a lista ocupa só o espaço
   que sobra na janela, sem a página inteira rolar. A rolagem fica só dentro da lista. */
.dashboard:has(.products-table):not(.dashboard-home) .dash-main {
    display: flex;
    flex-direction: column;
    height: 100svh;
    box-sizing: border-box;
    overflow: hidden;
}
.dashboard:has(.products-table):not(.dashboard-home) .dash-main > * { flex: 0 0 auto; }
.dashboard:has(.products-table):not(.dashboard-home) .dash-main > .contacts-card {
    flex: 1 1 auto;
    height: auto;
    min-height: 260px;
}
@media (max-width: 900px) {
    .dashboard:has(.products-table):not(.dashboard-home) .dash-main { height: auto; overflow: visible; }
    .dashboard:has(.products-table):not(.dashboard-home) .dash-main > .contacts-card { height: calc(100svh - 140px); }
}
/* Botões de ação em lote só aparecem com produtos marcados: o topo cabe numa linha. */
.list-actions [data-open-products-bulk-edit]:disabled,
.list-actions [data-open-products-unify]:disabled,
.list-actions [data-products-delete-selected]:disabled { display: none; }

/* Cadastro separado de Produtos e de Serviços: o que não vale para o tipo some (antes só ficava cinza). */
[data-product-form] .is-disabled-field,
.pf-nav a.is-disabled-field { display: none !important; }
.pf-converter-tipo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 0; color: #8b97a9; font-size: 13px; }
.pf-converter-tipo b { color: var(--text-strong); }
.pf-converter-tipo button { border: 0; background: none; padding: 0; color: var(--brand); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
/* Campos de mercadoria escondidos no cadastro de serviço (continuam enviados, para não apagar valores antigos). */
.product-form .pf-tipo-oculto,
.product-form.is-servico [data-service-hide] { display: none !important; }

/* Aviso de risco fiscal no Dashboard (limites de faturamento) */
.risco-fiscal-card {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    padding: 8px 14px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 13px;
}

.risco-fiscal-card svg {
    flex: none;
    width: 18px;
    height: 18px;
}

.risco-fiscal-card.is-warning {
    border-color: #ca8a04;
    color: #92650a;
    background: rgba(234, 179, 8, .12);
}

.risco-fiscal-card.is-danger {
    border-color: #dc2626;
    color: #b91c1c;
    background: rgba(220, 38, 38, .1);
}

.risco-fiscal-texto {
    flex: 1;
    min-width: 0;
}

.risco-fiscal-texto small {
    margin-left: 6px;
    font-size: 12px;
    opacity: .85;
}

.risco-fiscal-card a {
    flex: none;
    font-weight: 800;
    color: inherit;
    text-decoration: underline;
}

.risco-fiscal-texto small a {
    font-weight: 600;
    text-decoration: none;
}

.risco-fiscal-texto small a:hover {
    text-decoration: underline;
}

/* Regra dos 80%: tela explicada em linguagem simples */
.r80 { display: grid; gap: 16px; height: auto; min-height: 0; grid-template-rows: none; align-content: start; }
.r80 .it-help { margin: 2px 0 0; }
.r80-topo { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 12px; }
.r80-segunda { margin-top: 8px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.r80-selo { padding: 5px 14px; border-radius: 999px; font-weight: 800; font-size: 13px; border: 1px solid; white-space: nowrap; }
.r80-selo.is-success { color: var(--success); border-color: var(--success); }
.r80-selo.is-warning { color: #b7791f; border-color: var(--warning); }
.r80-selo.is-error { color: var(--danger); border-color: var(--danger); }
.r80-selo.is-info { color: var(--muted-strong); border-color: var(--line-soft); }
.r80-resposta { padding: 16px 20px; border-radius: 14px; border: 1px solid var(--line-soft); border-left-width: 6px; background: var(--panel); }
.r80-resposta.is-success { border-left-color: var(--success); }
.r80-resposta.is-warning { border-left-color: var(--warning); }
.r80-resposta.is-error { border-left-color: var(--danger); }
.r80-resposta.is-info { border-left-color: var(--brand); }
.r80-numero { font-size: 42px; font-weight: 800; line-height: 1.1; color: var(--text-strong); }
.r80-resposta p { margin: 6px 0 0; font-size: 15px; line-height: 1.5; color: var(--text-strong); }
.r80-resposta .r80-status { font-weight: 800; }
.r80-barra { position: relative; height: 16px; margin: 6px 0 26px; border-radius: 999px; background: rgba(128, 138, 155, .25); }
.r80-barra i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--success); }
.r80-barra i.is-warning { background: var(--warning); }
.r80-barra i.is-error { background: var(--danger); }
.r80-barra i.is-info { background: var(--brand); }
.r80-barra b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text-strong); opacity: .55; }
.r80-barra b.is-limite { opacity: 1; width: 3px; }
.r80-barra em { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 11px; font-weight: 700; white-space: nowrap; color: var(--muted-strong); }
.r80-cartoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.r80-cartoes > div { display: grid; gap: 2px; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--panel); }
.r80-cartoes small { font-size: 12px; font-weight: 700; color: var(--muted-strong); }
.r80-cartoes strong { font-size: 20px; color: var(--text-strong); }
.r80-cartoes span { font-size: 12px; color: var(--muted-strong); }
.r80-cartoes .is-bom { border-color: var(--success); }
.r80-cartoes .is-ruim { border-color: var(--danger); }
.r80-fazer { padding: 14px 18px; border: 1px dashed var(--line-soft); border-radius: 12px; }
.r80-fazer ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; line-height: 1.45; }
.r80-pill { display: inline-block; min-width: 64px; padding: 2px 10px; border-radius: 999px; text-align: center; font-weight: 800; font-size: 12px; background: rgba(128, 138, 155, .2); }
.r80-pill.is-success { background: rgba(23, 201, 121, .18); color: #0f8f57; }
.r80-pill.is-warning { background: rgba(255, 210, 77, .28); color: #92650a; }
.r80-pill.is-error { background: rgba(255, 91, 102, .2); color: #c0303b; }
.r80-detalhes summary { cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted-strong); }
.r80-detalhes[open] summary { margin-bottom: 8px; }

/* Inteligência Tributária: textos de apoio e painel em linguagem simples */
.it-ajuda { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: rgba(65, 106, 157, .12); color: var(--text-strong); font-size: 14px; line-height: 1.5; }
.it-ajuda span { flex: none; font-weight: 800; color: var(--brand-strong); }
.it-ajuda p { margin: 0; }
.it-resposta { margin: 0 0 14px; padding: 14px 18px; border: 1px solid var(--line-soft); border-left: 6px solid var(--brand); border-radius: 14px; background: var(--panel); color: var(--text-strong); font-size: 15px; line-height: 1.6; }
.itp-ind em { font-style: normal; font-size: 12px; font-weight: 800; color: var(--brand-strong); }
.itp-numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 10px; }
.itp-numeros > div { display: grid; gap: 2px; padding: 10px 13px; border-radius: 10px; background: rgba(128, 138, 155, .1); }
.itp-numeros small { font-size: 12px; font-weight: 700; color: #8b97a9; }
.itp-numeros strong { font-size: 16px; color: var(--text-strong); }
.itp-numeros span { font-size: 12px; color: #8b97a9; line-height: 1.4; }
.itp-emdia { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; font-size: 13px; color: var(--muted-strong); }
.itp-emdia span.is-ok { color: #0f8f57; }
.itp-emdia b { color: var(--text-strong); font-weight: 700; }

/* Usuários Online */
.uo-resumo { align-items: start; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 0 0 16px; }
.uo-card { display: grid; gap: 2px; align-content: start; padding: 14px 16px; border: 1px solid var(--line-soft); border-radius: 14px; background: var(--panel); }
.uo-card strong { font-size: 28px; line-height: 1.1; color: var(--text-strong); }
.uo-card span { font-size: 13px; color: var(--muted-strong); }
.uo-card.is-ativo { border-color: var(--warning); }
.uo-card .uo-botao { margin-top: 8px; }
.uo-botao { padding: 6px 12px; border: 1px solid var(--brand); border-radius: 8px; background: transparent; color: var(--brand-strong); font-size: 12px; font-weight: 800; cursor: pointer; }
.uo-botao:hover { background: rgba(65, 106, 157, .12); }
.uo-botao:disabled { opacity: .6; cursor: default; }
.uo-barra { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.uo-abas { display: flex; gap: 6px; }
.uo-abas button { padding: 8px 14px; border: 1px solid var(--line-soft); border-radius: 10px; background: transparent; color: var(--text-strong); font-weight: 700; cursor: pointer; }
.uo-abas button.is-ativa { background: var(--brand); border-color: var(--brand); color: #fff; }
.uo-filtros { display: flex; flex-wrap: wrap; gap: 8px; }
.uo-filtros input, .uo-filtros select { min-height: 38px; padding: 0 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--panel); color: var(--text-strong); font-size: 13px; }
.uo-filtros input { min-width: 240px; }
.uo-quadro { border: 1px solid var(--line-soft); border-radius: 16px; background: var(--panel); overflow-x: auto; }
.uo-nota { margin: 12px 16px 0; }
.uo-tabela { min-width: 980px; }
.uo-linha { display: grid; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--text-strong); }
.uo-tabela-online .uo-linha { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.3fr) minmax(0, 1.1fr) minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, .7fr) minmax(0, .8fr) minmax(0, 1.2fr) minmax(0, 1.4fr); }
.uo-tabela-ultimos .uo-linha { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.5fr) minmax(0, 1.2fr) minmax(0, .9fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1.2fr); }
.uo-linha:last-child { border-bottom: 0; }
.uo-cab { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-strong); }
.uo-linha small { display: block; margin-top: 2px; color: var(--muted-strong); font-size: 11px; }
.uo-usuario { display: flex; align-items: center; gap: 10px; min-width: 0; }
.uo-usuario > div { min-width: 0; }
.uo-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uo-empresa { overflow-wrap: anywhere; }
.uo-empresa .uo-selo { display: inline-block; margin: 4px 0 0; }
.uo-ip { font-variant-numeric: tabular-nums; }
.uo-acoes { display: grid; gap: 6px; justify-items: start; }
.uo-selo { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; font-style: normal; background: rgba(128, 138, 155, .2); }
.uo-selo.is-atual { background: rgba(23, 201, 121, .18); color: #0f8f57; }
.uo-selo.is-desatualizada { background: rgba(255, 210, 77, .3); color: #92650a; }
.uo-selo.is-antiga { background: rgba(255, 91, 102, .2); color: #c0303b; }
.uo-vazio { padding: 28px 16px; text-align: center; color: var(--muted-strong); }
.online-live-indicator.is-falha em { background: var(--danger); animation: none; }
.uo-loc { display: block; }

.uo-acoes .btn-link { padding: 5px 10px; border: 1px solid #f1a3a3; border-radius: 6px; background: none; color: #c53030; font-size: 12px; cursor: pointer; }
.uo-acoes .btn-link:hover { background: rgba(255, 91, 102, .12); }
.uo-acoes .btn-link:disabled { opacity: .5; cursor: not-allowed; }
.uo-loc { font-weight: 700; }

/* Modais de retorno/PIX/cancelamento do CIOT ficam acima da barra lateral (que tem z-index alto no tablet/celular). */
.ciot-json-modal { z-index: 1200; }

/* Confirmacao com tres botoes (ex.: Cancelar / Salvar e sair / Sair sem salvar) */
.system-confirm-modal.has-extra .system-confirm-card { width: min(520px, calc(100vw - 32px)); }
.system-confirm-modal.has-extra .system-confirm-card .settle-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* O atributo hidden perdia para o display dos botoes: o terceiro botao so aparece quando pedido. */
.system-confirm-card [data-system-confirm-extra][hidden] { display: none !important; }
