/* =========================================
   VISYS â app.css
   Identidade: azul Â· laranja Â· branco Â· mobile-first (padrÃ£o Nova Venda)
   ========================================= */

/* IBM Plex Sans â pesos usados na interface (400â700). latin-ext cobre acentos fora do Latin-1. */
@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-latin-ext-400-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-latin-ext-500-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-latin-ext-600-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-latin-ext-700-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('../fonts/ibm-plex-sans-latin-700-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* === RESET & BASE === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #EEF2F6;
    --color-surface: #F8FAFC;
    --color-border: #E0E6EE;
    --color-border-mid: #C5CED8;

    --color-primary: #163A5F;
    --color-primary-lt: #1F4F7A;
    --color-primary-soft: #E8EEF5;
    --color-accent: #E35A12;
    --color-accent-lt: #F06A24;
    --color-accent-soft: #FDF0E8;

    --color-text: #152232;
    --color-text-mid: #445468;
    --color-text-muted: #5E7084;

    --color-success: #1F6F3B;
    --color-success-bg: #D4EDDA;
    --color-error: #8B1A1A;
    --color-error-bg: #F8D7DA;
    --color-warning: #7A5200;
    --color-warning-bg: #FFF3CD;

    --sidebar-w: 248px;
    --header-h: 64px;
    --footer-h: 40px;

    --font-main: 'IBM Plex Sans', 'Segoe UI', Tahoma, sans-serif;
    --font-mono: 'Consolas', 'Courier New', monospace;

    --transition: 0.15s ease;
    --shadow-sm: 0 1px 2px rgba(22, 58, 95, 0.05);
    --shadow-md: 0 8px 24px rgba(22, 58, 95, 0.08);

    --radius-sm: 8px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --touch-min: 44px;
}

html,
body {
    height: 100%;
    overflow: hidden;
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    /* Prevent automatic text-size adjustments / zoom on mobile */
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    color: var(--color-primary-lt);
}

/* =========================================
   HEADER
   ========================================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-h);
    background: var(--color-primary);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
    z-index: 10060;
    border-bottom: 2px solid var(--color-accent);
    box-shadow: 0 1px 0 rgba(22, 58, 95, 0.2);
}

.header__brand {
    display: flex;
    align-items: center;
    width: auto;
    max-width: min(220px, 48vw);
    flex-shrink: 1;
    min-width: 0;
}

.header__brand-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    min-width: 0;
    line-height: 0;
}

.header__brand-link:hover {
    text-decoration: none;
    opacity: 0.92;
}

.header__logo-img {
    display: block;
    height: 48px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.15));
}

.header__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    min-width: 0;
}

.header__identity {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.25rem 0.35rem 0.25rem 0.25rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.header__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--color-accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.header__identity-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
    padding-right: 0.55rem;
}

.header__user-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header__user-meta {
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header__logout-form {
    display: inline-flex;
    margin: 0;
}

.header__logout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
    padding: 0.45rem 0.8rem;
    min-height: 36px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-md);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.header__logout-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.header__logout-text {
    display: inline;
    font-family: var(--font-main);
}

.header__logout:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.28);
    color: #FFF;
}

@media (max-width: 900px) {
    .header {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }

    .header__brand {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        max-width: min(160px, 46vw);
        justify-content: center;
    }

    .header__logo-img {
        height: 42px;
    }

    .header__identity-text {
        display: none;
    }

    .header__identity {
        background: transparent;
        padding: 0;
    }

    .header__avatar {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    .header__logout-text {
        display: none;
    }

    .header__logout {
        padding: 0;
        width: 36px;
        min-width: 36px;
        height: 36px;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .header__logout-text {
        display: none;
    }
}

/* =========================================
   LAYOUT PRINCIPAL (sidebar + main)
   ========================================= */
.layout {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    bottom: var(--footer-h);
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    overflow: hidden;
}

/* =========================================
   SIDEBAR
   ========================================= */
.sidebar {
    background: #E7EEF5;
    border-right: 1px solid #D8E2EC;
    height: 100%;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar a,
.sidebar a:hover,
.sidebar a:focus,
.sidebar a:active {
    text-decoration: none !important;
}

.sidebar__nav {
    display: flex;
    flex-direction: column;
    padding: 0.65rem 0 1rem;
}

.sidebar__group {
    display: flex;
    flex-direction: column;
    margin-bottom: 0.35rem;
}

.sidebar__group-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    padding: 0.75rem 1rem 0.25rem;
    text-transform: uppercase;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0.5rem;
    padding: 0.5rem 0.75rem;
    min-height: 40px;
    color: var(--color-text-mid);
    font-size: 13px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}

.sidebar__link:hover,
.sidebar__link:focus,
.sidebar__link:active {
    background: rgba(255, 255, 255, 0.45);
    color: var(--color-primary);
    text-decoration: none;
}

.sidebar__link--active {
    background: var(--color-surface);
    color: var(--color-primary);
    font-weight: 600;
    box-shadow: inset 3px 0 0 var(--color-accent);
}

.sidebar__icon {
    font-size: 8px;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.sidebar__link--active .sidebar__icon,
.sidebar__link:hover .sidebar__icon {
    color: var(--color-accent);
}

.sidebar__icon-svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke: currentColor;
    opacity: 0.7;
}

.sidebar__group-toggle .sidebar__icon-svg {
    margin-right: 0.5rem;
}

.sidebar__link .sidebar__icon-svg {
    margin-right: 0.5rem;
}

.sidebar__link--active .sidebar__icon-svg,
.sidebar__link:hover .sidebar__icon-svg {
    opacity: 1;
    stroke: var(--color-accent);
}

.sidebar__group-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar__group-toggle .sidebar__group-label {
    flex: 1;
}

.sidebar__link--action {
    color: var(--color-primary) !important;
    font-weight: 500;
}

.sidebar__link--action:hover {
    color: var(--color-accent) !important;
}

/* =========================================
   MAIN
   ========================================= */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: 100%;
    padding: 1.35rem 1.4rem;
    gap: 1rem;
    overflow-x: hidden;
    overflow-y: auto;
    background:
        radial-gradient(720px 240px at 100% 0%, rgba(227, 90, 18, 0.035), transparent 58%),
        var(--color-bg);
}

/* =========================================
   PAGE BAR (tÃ­tulo + aÃ§Ãµes)
   ========================================= */
.page-bar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.25rem;
}

.page-title {
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.breadcrumb {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 0.2rem;
}

.breadcrumb a {
    color: var(--color-text-muted);
}

.breadcrumb a:hover {
    color: var(--color-primary);
}

.page-bar__actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
/* Ensure page action buttons across the system follow the same sizing/alignment */
.page-bar__actions .btn,
.page-bar__actions form {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.page-bar__actions .btn {
    height: 34px;
    padding: 0.35rem 0.8rem;
    font-size: 0.9rem;
}
.page-bar__actions .btn--sm {
    height: 34px;
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
}
.page-bar__actions .btn--icon {
    padding: 0.25rem;
    width: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.page-bar__actions .btn img,
.page-bar__actions .icon,
.page-bar__actions .icon--sm {
    width: 18px;
    height: 18px;
    display: block;
}

/* =========================================
   ALERTAS
   ========================================= */
.alert {
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    font-size: 13px;
    border-left-width: 4px;
    border-radius: var(--radius-md);
}

.alert--success {
    background: var(--color-success-bg);
    border-color: var(--color-success);
    color: var(--color-success);
}

.alert--error {
    background: var(--color-error-bg);
    border-color: var(--color-error);
    color: var(--color-error);
}

.alert--warning {
    background: var(--color-warning-bg);
    border-color: var(--color-warning);
    color: var(--color-warning);
}

.alert__list {
    margin: 0;
    padding-left: 1.1rem;
}

.alert__list li + li {
    margin-top: 0.25rem;
}

/* =========================================
   CONTEÃDO DA PÃGINA
   ========================================= */
.page-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* =========================================
   CARDS
   ========================================= */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.05rem;
    border-bottom: 1px solid var(--color-border);
    background: #F3F6FA;
    gap: 0.5rem;
}

.card__title {
    font-size: 14px;
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-primary);
}

.card__body {
    padding: 1rem;
}

.card__footer {
    padding: 0.75rem 1.05rem;
    border-top: 1px solid var(--color-border);
    background: #F3F6FA;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Ficha das telas de ver: titulo e situacao juntos, campos em colunas curtas */
.ficha__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.55rem 0.75rem;
    padding: 0.85rem 1.05rem;
    border-bottom: 1px solid var(--color-border);
}

.ficha__body {
    padding: 1rem 1.05rem 1.1rem;
}

.ficha + .ficha {
    margin-top: 1rem;
}

.ficha__resumo {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr));
    gap: 0.75rem 1.25rem;
    margin: -1rem -1.05rem 1rem;
    padding: 0.9rem 1.05rem;
    background: #F3F6FA;
    border-bottom: 1px solid var(--color-border);
}

.ficha__resumo > div {
    min-width: 0;
}

.ficha__resumo span {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.ficha__resumo strong {
    display: block;
    margin-top: 0.15rem;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
}

.ficha__resumo > div:first-child strong {
    font-size: 1.35rem;
    color: var(--color-primary);
}

.ficha__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.95rem 1.5rem;
    margin: 0;
}

.ficha__item dt {
    margin: 0 0 0.15rem;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.ficha__item dd {
    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.ficha__item--largo {
    grid-column: 1 / -1;
}

.ficha__item--texto dd {
    white-space: pre-line;
    font-weight: 400;
    line-height: 1.45;
}

.ficha__item--mono dd {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 400;
    word-break: break-all;
}

.venda-doc__totais {
    display: flex;
    justify-content: flex-end;
    padding: 0.85rem 1.05rem 1rem;
    border-top: 1px solid var(--color-border);
    background: #F3F6FA;
}

.venda-doc__totais .totals-box__row {
    border-bottom: none;
    padding: 0.28rem 0;
}

.venda-doc__totais .totals-box__row--total {
    margin-top: 0.2rem;
    border-top: 2px solid var(--color-border);
    font-size: 15px;
}

.venda-doc__totais .totals-box__row--total span:last-child {
    color: var(--color-primary);
}

@media (max-width: 900px) {
    .ficha__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .venda-doc__totais {
        justify-content: stretch;
    }

    .venda-doc__totais .totals-box--sale {
        max-width: none;
    }
}

/* =========================================
   PAGINAÃÃO
   ========================================= */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.pagination__info {
    font-size: 12px;
    color: var(--color-text-muted);
}

.pagination__info strong {
    color: var(--color-text);
    font-weight: 600;
}

.pagination__links {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.pagination__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.65rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--color-text-mid);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-main);
    text-decoration: none;
    cursor: pointer;
}

.pagination__btn:hover {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    border-color: var(--color-primary);
    text-decoration: none;
}

.pagination__btn--active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
    cursor: default;
}

.pagination__btn--disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

/* =========================================
   STATS GRID
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-card--accent {
    border-top-color: var(--color-accent);
}

.stat-card--success {
    border-top-color: var(--color-success);
}

.stat-card--warning {
    border-top-color: var(--color-warning);
}

.stat-card__label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}

a.stat-card,
a.stat-card:hover,
a.stat-card:focus,
a.stat-card:active {
    text-decoration: none !important;
    color: inherit;
}

a.stat-card:hover {
    border-color: var(--color-border-mid);
    background: #F7F9FC;
}

.stat-card__value {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.stat-card__sub {
    font-size: 11px;
    color: var(--color-text-muted);
}

/* =========================================
   TOTALIZADORES DE RELATORIO (KPI)
   ========================================= */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.kpi-card {
    --kpi-tint: var(--color-primary);
    --kpi-tint-soft: var(--color-primary-soft);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
    padding: 0.95rem 1.1rem 1rem;
    background: var(--color-surface);
    border: 1px solid rgba(213, 220, 229, 0.75);
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(22, 58, 95, 0.04), 0 6px 18px rgba(22, 58, 95, 0.05);
}

.kpi-card--accent {
    --kpi-tint: var(--color-accent);
    --kpi-tint-soft: var(--color-accent-soft);
}

.kpi-card--success {
    --kpi-tint: var(--color-success);
    --kpi-tint-soft: var(--color-success-bg);
}

.kpi-card--warning {
    --kpi-tint: var(--color-warning);
    --kpi-tint-soft: var(--color-warning-bg);
}

.kpi-card--danger {
    --kpi-tint: var(--color-error);
    --kpi-tint-soft: var(--color-error-bg);
}

.kpi-card--neutral {
    --kpi-tint: var(--color-text-mid);
    --kpi-tint-soft: #EEF1F5;
}

.kpi-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 28px;
}

.kpi-card__label {
    font-size: 12.5px;
    font-weight: 500;
    color: var(--color-text-mid);
    line-height: 1.3;
}

.kpi-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--kpi-tint-soft);
    color: var(--kpi-tint);
}

.kpi-card__value {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.kpi-card--destaque .kpi-card__value {
    color: var(--kpi-tint);
}

.kpi-card__sub {
    font-size: 12px;
    color: var(--color-text-muted);
    font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.6rem;
    }

    .kpi-card {
        padding: 0.8rem 0.85rem 0.85rem;
        border-radius: 12px;
    }

    .kpi-card__value {
        font-size: 1.2rem;
    }
}

.subtotais__lista {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

.subtotais__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.45rem 1.25rem;
    align-items: center;
    padding: 0.8rem 1.05rem 0.7rem;
    border-bottom: 1px solid var(--color-border);
}

.subtotais__item:nth-child(odd) {
    border-right: 1px solid var(--color-border);
}

.subtotais__item:nth-last-child(-n + 2) {
    border-bottom: none;
}

.subtotais__nome {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--color-text);
    min-width: 0;
}

.subtotais__valores {
    display: grid;
    grid-template-columns: 7.6rem 7.6rem;
    gap: 0.85rem;
    text-align: right;
}

.subtotais__rotulo {
    display: block;
    margin-bottom: 0.1rem;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
}

.subtotais__cifra {
    font-size: 13.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--color-text);
    white-space: nowrap;
}

.subtotais__cifra--pago {
    color: var(--color-success);
}

.subtotais__barra {
    grid-column: 1 / -1;
    height: 4px;
    border-radius: 99px;
    background: var(--color-primary-soft);
    overflow: hidden;
}

.subtotais__barra > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--color-success);
}

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

    .subtotais__item,
    .subtotais__item:nth-child(odd) {
        border-right: none;
        border-bottom: 1px solid var(--color-border);
    }

    .subtotais__item:last-child {
        border-bottom: none;
    }
}

@media (max-width: 480px) {
    .subtotais__item {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .subtotais__valores {
        grid-template-columns: 1fr 1fr;
        text-align: left;
    }
}

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

/* =========================================
   TABELAS
   ========================================= */
.table-wrap {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: auto;
}

.table th {
    background: #F1F5F9;
    color: var(--color-text-mid);
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    white-space: nowrap;
    vertical-align: middle;
}

.table td {
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
    vertical-align: middle;
}

/* Garante alinhamento igual entre header e cÃ©lulas (especÃ­fico o bastante para vencer .table th) */
.table th.text-right,
.table td.text-right {
    text-align: right;
}

.table th.text-center,
.table td.text-center {
    text-align: center;
}

.table th.col-num,
.table td.col-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.table th.col-actions,
.table td.col-actions {
    text-align: right;
    width: 1%;
    white-space: nowrap;
}

/* Acoes da listagem: editar | ver | excluir, sempre nas mesmas posicoes */
.acoes {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    vertical-align: middle;
}

.acoes__grade {
    display: inline-grid;
    grid-auto-flow: column;
    grid-auto-columns: 34px;
    gap: 0.35rem;
    align-items: center;
    justify-items: center;
}

.acoes__slot {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
}

.acoes__slot > form,
.acoes__extra > form,
.acoes__slot form.d-inline,
.acoes__extra form.d-inline {
    display: flex;
    margin: 0;
}

.acoes__extra {
    display: inline-flex;
    align-items: center;
}

.table tbody tr:nth-child(even) {
    background: #F6F8FB;
}

.table tbody tr:hover {
    background: #EEF3F7;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* =========================================
   FORMULÃRIOS
   =========================================

   USO:
   - .form-grid            â container do grid (padrÃ£o 1 coluna)
   - .form-grid--col-2/3/4 â define quantas colunas a linha tem
   - .form-group           â item do grid (ocupa 1 coluna por padrÃ£o)
   - .form-group--span-2/3 â faz o item ocupar N colunas
   - .form-group--full     â ocupa a linha inteira (sempre)

   EXEMPLO â 4 colunas, campos variados:
   <div class="form-grid form-grid--col-4">
       <div class="form-group form-group--span-2">RazÃ£o Social</div>
       <div class="form-group form-group--span-2">Nome Fantasia</div>
       <div class="form-group">CNPJ</div>
       <div class="form-group">Telefone</div>
       <div class="form-group form-group--span-2">E-mail</div>
       <div class="form-group form-group--full">ObservaÃ§Ãµes</div>
   </div>
   ========================================= */

.form-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 1rem;
}

.form-grid--col-2 {
    grid-template-columns: repeat(2, 1fr);
}

.form-grid--col-3 {
    grid-template-columns: repeat(3, 1fr);
}

.form-grid--col-4 {
    grid-template-columns: repeat(4, 1fr);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.form-group--span-2 {
    grid-column: span 2;
}

.form-group--span-3 {
    grid-column: span 3;
}

.form-group--full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: 0;
}

.form-label--required::after {
    content: ' *';
    color: var(--color-accent);
}

.form-control {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border);
    background: #FFFFFF;
    color: var(--color-text);
    font-family: var(--font-main);
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
    min-height: 40px;
    border-radius: var(--radius-md);
    -webkit-appearance: none;
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(22, 58, 95, 0.12);
}

.form-control.is-invalid {
    border-color: var(--color-error);
    background: #FFF8F8;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.16);
}

.form-control:disabled,
.form-control[readonly] {
    background: #F4F7FA;
    color: var(--color-text-mid);
    cursor: not-allowed;
}

select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238898AA'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    padding-right: 2rem;
}

.form-hint {
    font-size: 11px;
    color: var(--color-text-muted);
}

.form-error {
    font-size: 12px;
    line-height: 1.35;
    color: var(--color-error);
}

/* =========================================
   BOTÃES
   ========================================= */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    min-height: 40px;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    text-decoration: none;
    white-space: nowrap;
    border-radius: var(--radius-md);
    justify-content: center;
}

.btn--block {
    width: 100%;
    justify-content: center;
}

.btn--lg {
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    min-height: var(--touch-min);
}

.btn:focus-visible,
.sidebar__link:focus-visible,
.header__logout:focus-visible,
.header__menu:focus-visible,
.pagination__btn:focus-visible,
.form-check input:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.btn:disabled,
.btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--color-primary);
    color: #FFFFFF;
    border-color: var(--color-primary);
}

.btn--primary:hover {
    background: var(--color-primary-lt);
    border-color: var(--color-primary-lt);
    color: #FFF;
    text-decoration: none;
}

.btn--accent {
    background: var(--color-accent);
    color: #FFFFFF;
    border-color: var(--color-accent);
}

.btn--accent:hover {
    background: #B8420F;
    border-color: #B8420F;
    color: #FFF;
    text-decoration: none;
}

.btn--outline {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn--outline:hover {
    background: var(--color-primary);
    color: #FFF;
    text-decoration: none;
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-mid);
    border-color: var(--color-border);
}

.btn--ghost:hover {
    background: var(--color-bg);
    color: var(--color-text);
    text-decoration: none;
}

.btn--danger {
    background: var(--color-error);
    color: #FFF;
    border-color: var(--color-error);
}

.btn--danger:hover {
    background: #6B1313;
    border-color: #6B1313;
    color: #FFF;
    text-decoration: none;
}

.btn--sm {
    padding: 0.3rem 0.65rem;
    font-size: 12px;
}

.btn--icon {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    gap: 0;
}

.btn--icon.btn--sm {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
}

.btn--icon .icon,
.btn .icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    display: block;
}

.btn--icon.btn--sm .icon {
    width: 15px;
    height: 15px;
}

/* =========================================
   DROPDOWN EXPORTAR
   ========================================= */
.export-dropdown {
    position: relative;
    display: inline-flex;
    z-index: 30;
}

.export-dropdown.is-open {
    z-index: 90;
}

.export-dropdown__toggle {
    gap: 0.35rem;
}

.export-dropdown__caret {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform var(--transition);
}

.export-dropdown.is-open .export-dropdown__caret {
    transform: rotate(180deg);
}

.export-dropdown__menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: auto;
    min-width: 100%;
    width: max-content;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    z-index: 90;
    padding: 0.35rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.export-dropdown__menu[hidden] {
    display: none !important;
}

.export-dropdown__item {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0.55rem 0.85rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    text-decoration: none;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.export-dropdown__item:hover,
.export-dropdown__item:focus {
    background: var(--color-primary-soft);
    color: var(--color-primary);
    text-decoration: none;
}

@media (max-width: 640px) {
    .page-bar {
        overflow: visible;
        position: relative;
        z-index: 40;
    }

    .page-bar__actions,
    .page-actions {
        overflow: visible;
        position: relative;
        z-index: 40;
    }

    .export-dropdown {
        width: auto;
        max-width: 100%;
    }

    .export-dropdown__toggle {
        min-height: 40px;
    }

    .export-dropdown__menu {
        left: 0;
        right: auto;
        min-width: 160px;
        width: max(100%, 160px);
        max-width: calc(100vw - 2rem);
    }

    .export-dropdown__item {
        min-height: 44px;
        font-size: 14px;
        padding: 0.7rem 1rem;
    }
}

/* =========================================
   BADGES / STATUS
   ========================================= */
.badge {
    display: inline-block;
    padding: 0.18rem 0.55rem;
    font-size: 12px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    border-radius: 999px;
    line-height: 1.35;
}

.badge--success {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.badge--error {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.badge--warning {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.badge--info {
    background: #D0E4F5;
    color: #1A3B5D;
}

.badge--neutral {
    background: #E8ECF1;
    color: var(--color-text-mid);
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--footer-h);
    background: #E7EEF5;
    border-top: 1px solid #D8E2EC;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.1rem;
    font-size: 11px;
    color: var(--color-text-muted);
    z-index: 99;
}

.footer__brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 0;
}

.footer__brand:hover {
    text-decoration: none;
    opacity: 0.9;
}

.footer__logo-img {
    display: block;
    height: 26px;
    width: auto;
    object-fit: contain;
}

/* =========================================
   UTILITÃRIOS
   ========================================= */
.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--color-text-muted);
}

.text-bold {
    font-weight: 700;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

.gap-sm {
    gap: 0.5rem;
}

.gap-md {
    gap: 1rem;
}

.ml-auto {
    margin-left: auto;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

/* =========================================
   SIDEBAR COLAPSÃVEL
   ========================================= */

.sidebar__group-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    margin: 0.25rem 0.5rem;
    transition: background var(--transition);
}

.sidebar__group-toggle:hover {
    background: var(--color-primary-soft);
}

.sidebar__group-toggle:hover .sidebar__group-label {
    color: var(--color-primary);
}

.sidebar__group-toggle .sidebar__icon-svg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
    flex-shrink: 0;
}

.sidebar__group-toggle:hover .sidebar__icon-svg {
    opacity: 1;
    stroke: var(--color-primary);
}

.sidebar__group-toggle .sidebar__group-label {
    flex: 1;
    padding: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-mid);
    transition: color var(--transition);
}

.sidebar__icon {
    display: none;
}

.sidebar__group-arrow {
    font-size: 14px;
    opacity: 0.6;
    transition: transform 0.2s ease, opacity 0.2s ease;
    color: var(--color-text-muted);
    transition: transform 0.2s ease, color var(--transition);
    line-height: 1;
}

.sidebar__group-toggle:hover .sidebar__group-arrow {
    color: var(--color-primary);
}

/* Links dentro do grupo */
.sidebar__group-links {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.25s ease;
    margin: 0.15rem 0.75rem 0.35rem 1.85rem;
    padding: 0.15rem 0 0.15rem 0.65rem;
    border-left: 2px solid color-mix(in srgb, var(--color-primary, #1c2530) 45%, transparent);
}

.sidebar__group-links .sidebar__link {
    margin: 0;
    padding: 0.45rem 0.65rem;
    font-size: 0.875rem;
    border-radius: var(--radius-md);
    border-left: none;
}

.sidebar__group-links .sidebar__link--active {
    background: color-mix(in srgb, var(--color-primary, #1c2530) 12%, transparent);
}

.sidebar__group-links--collapsed {
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-left-color: transparent;
}

.sidebar__group-arrow--collapsed {
    transform: rotate(-90deg);
}

/* Sem animação no carregamento: o estado inicial do menu é aplicado direto, só os cliques animam. */
.sidebar--iniciando,
.sidebar--iniciando * {
    transition: none !important;
}

/* =========================================
   SIDEBAR â SUB-GRUPO (2Âº nÃ­vel)
   ========================================= */
.sidebar__subgroup {
    display: flex;
    flex-direction: column;
}

.sidebar__subgroup-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    cursor: pointer;
    user-select: none;
    color: var(--color-text-mid);
    font-size: 13px;
    border-left: 3px solid transparent;
    transition: background var(--transition), color var(--transition);
}

.sidebar__subgroup-toggle:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

.sidebar__subgroup-toggle--open {
    background: #EBF0F7;
    color: var(--color-primary);
    font-weight: 600;
    border-left-color: transparent;
}

.sidebar__subgroup-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar__subgroup-arrow {
    font-size: 8px;
    color: var(--color-text-muted);
    transition: transform 0.2s ease;
    line-height: 1;
}

.sidebar__subgroup-arrow--collapsed {
    transform: rotate(-90deg);
}

.sidebar__subgroup-links {
    overflow: hidden;
    max-height: 300px;
    background: #F7F9FC;
    transition: max-height 0.25s ease;
}

.sidebar__subgroup-links--collapsed {
    max-height: 0;
}

.sidebar__link--sub {
    padding-left: 2.25rem;
    font-size: 12px;
}

.sidebar__link--sub .sidebar__icon {
    font-size: 6px;
}

/* =========================================
   AUTOCOMPLETE
   ========================================= */
.autocomplete-wrap {
    position: relative;
}

.autocomplete-list {
    position: fixed;
    z-index: 10000;
    margin: 0;
    padding: 0;
    list-style: none;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 6px 18px rgba(28, 37, 48, 0.18);
}

.autocomplete-list__item {
    padding: 0.5rem 0.75rem;
    font-size: 13px;
    color: var(--color-text);
    cursor: pointer;
    border-bottom: 1px solid var(--color-border);
}

.autocomplete-list__item:last-child {
    border-bottom: none;
}

.autocomplete-list__item:hover {
    background: var(--color-bg);
    color: var(--color-primary);
}

.autocomplete-list__empty {
    padding: 0.5rem 0.75rem;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Dropdown para busca rÃ¡pida de venda/orÃ§amento */
.autocomplete-dropdown {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(28, 37, 48, 0.15);
}
.autocomplete-dropdown .autocomplete-item {
    padding: 0.65rem 0.85rem;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
    transition: background 0.1s;
}
.autocomplete-dropdown .autocomplete-item:last-child {
    border-bottom: none;
}
.autocomplete-dropdown .autocomplete-item:hover,
.autocomplete-dropdown .autocomplete-item.active {
    background: #f0f7ff;
}
.autocomplete-dropdown .autocomplete-empty {
    padding: 1rem;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Item do dropdown - layout limpo */
.ac-item-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}
.ac-item-nome {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-text);
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ac-item-preco {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-primary);
    white-space: nowrap;
}
.ac-item-meta {
    margin-top: 0.2rem;
}
.ac-item-codigo {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

@media (max-width: 600px) {
    .autocomplete-dropdown .autocomplete-item {
        padding: 0.75rem 0.75rem;
    }
    .ac-item-nome {
        font-size: 0.85rem;
    }
    .ac-item-preco {
        font-size: 0.8rem;
    }
}

/* Mobile: ensure autocomplete list is visible above fixed header/overlays and not clipped
   Keep positioning (top/left/width) controlled by autocomplete.js so the dropdown stays attached to the input. */
@media (max-width: 900px) {
    .autocomplete-list {
        max-height: calc(100vh - var(--header-h) - 120px);
        overflow-y: auto;
        z-index: 20000;
        box-shadow: 0 8px 22px rgba(0,0,0,0.18);
    }
}

.form-control.is-loading {
    background-image: linear-gradient(90deg, transparent, rgba(26, 59, 93, 0.08), transparent);
    background-size: 200% 100%;
}

/* =========================================
   MODAL INLINE
   ========================================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 37, 48, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 30000;
    padding: 1rem;
}

.modal-overlay[hidden] {
    display: none !important;
}

.modal-box {
    width: 100%;
    max-width: 420px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.modal-box__header,
.modal-box__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    background: #F3F6FA;
}

.modal-box__footer {
    border-bottom: none;
    border-top: 1px solid var(--color-border);
    justify-content: flex-end;
    gap: 0.5rem;
    background: #F3F6FA;
}

.modal-box__body {
    padding: 1rem;
}

.modal-box--ver {
    max-width: min(1040px, 96vw);
    max-height: min(92vh, 920px);
    display: flex;
    flex-direction: column;
}

.modal-ver__body {
    overflow: auto;
    flex: 1 1 auto;
    min-height: 0;
    padding: 1rem 1.05rem 1.2rem;
}

.ver-fragment__acoes {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.85rem;
}

.ver-fragment__acoes .page-actions {
    width: 100%;
    justify-content: flex-end;
}

#modal-confirm {
    z-index: 32000;
}

body.modal-ver-aberto {
    overflow: hidden;
}

@media (max-width: 768px) {
    #modal-ver {
        padding: 0;
        align-items: stretch;
    }

    #modal-ver .modal-box--ver {
        width: 100%;
        max-width: none;
        height: 100%;
        max-height: none;
        border: none;
        border-radius: 0;
    }

    #modal-ver .modal-box__header {
        position: sticky;
        top: 0;
        z-index: 2;
        gap: 0.75rem;
        background: var(--color-surface);
        padding: max(0.75rem, env(safe-area-inset-top)) 0.9rem 0.75rem;
    }

    #modal-ver .modal-box__header .card__title {
        flex: 1;
        min-width: 0;
        font-size: 1rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    #modal-ver [data-ver-fechar] {
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
    }

    .modal-ver__body {
        padding: 0.75rem 0.75rem max(1rem, env(safe-area-inset-bottom));
        -webkit-overflow-scrolling: touch;
    }

    .ver-fragment__acoes {
        margin-bottom: 0.65rem;
    }

    .ver-fragment__acoes .page-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .ver-fragment__acoes .page-actions > .btn,
    .ver-fragment__acoes .page-actions > a.btn,
    .ver-fragment__acoes .page-actions > form,
    .ver-fragment__acoes .page-actions > .d-inline,
    .ver-fragment__acoes .page-actions > .export-dropdown {
        width: 100%;
        min-width: 0;
    }

    .ver-fragment__acoes .page-actions .btn,
    .ver-fragment__acoes .page-actions .export-dropdown__toggle {
        width: 100%;
        min-height: 40px;
        height: auto;
        justify-content: center;
    }

    #modal-ver .ficha__grid {
        grid-template-columns: 1fr;
    }

    #modal-ver .ficha__resumo {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem 0.75rem;
    }

    #modal-ver .ficha__resumo strong {
        font-size: 1rem;
    }

    #modal-ver .ficha__resumo > div:first-child strong {
        font-size: 1.15rem;
    }

    #modal-ver .table--cards tbody {
        padding: 0.65rem;
    }

    #modal-ver .table-wrap {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .ver-fragment__acoes .page-actions {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   EXTRAS
   ========================================= */
.btn--success {
    background: var(--color-success);
    color: #FFF;
    border-color: var(--color-success);
}

.btn--success:hover {
    background: #175a30;
    border-color: #175a30;
    color: #FFF;
    text-decoration: none;
}

.btn--warning {
    background: #B45309;
    color: #FFF;
    border-color: #B45309;
}

.btn--warning:hover {
    background: #92400E;
    border-color: #92400E;
    color: #FFF;
    text-decoration: none;
}

.card--link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.card--link:hover {
    text-decoration: none;
    color: inherit;
    border-color: var(--color-primary-lt);
    box-shadow: var(--shadow-md);
}

.text--danger {
    color: var(--color-error);
    font-weight: 600;
}

/* =========================================
   SEÃÃES DE FORMULÃRIO (itens / totais)
   ========================================= */
.section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.section-toolbar__title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-mid);
}

.totals-box {
    width: 280px;
    max-width: 100%;
}

.totals-box__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--color-border);
}

.totals-box__row--total {
    border-bottom: none;
    padding-top: 0.5rem;
    font-weight: 700;
}

.totals-box--sale {
    width: 100%;
    max-width: 340px;
    background: #F7F9FC;
    border: 1px solid var(--color-border);
    padding: 0.85rem 1rem;
}

.totals-box__input {
    width: 110px;
    padding: 0.25rem 0.45rem;
    font-size: 12px;
}

.totals-box--sale .totals-box__row--total {
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 2px solid var(--color-border);
    font-size: 15px;
    color: var(--color-primary);
}

.totals-box--sale .totals-box__row--total #label-total {
    font-size: 1.05rem;
}

/* =========================================
   ITENS VENDA / ORÃAMENTO
   ========================================= */
.itens-panel {
    margin-top: 1.5rem;
}

.itens-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.itens-empty {
    border: 1px dashed var(--color-border-mid);
    background: #F7F9FC;
    color: var(--color-text-muted);
    text-align: center;
    padding: 1.25rem 1rem;
    font-size: 13px;
}

.itens-empty[hidden] {
    display: none !important;
}

.item-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-lg);
    padding: 0.9rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.item-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.item-card__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    background: #EBF0F7;
    padding: 0.2rem 0.55rem;
}

.item-card__produto .form-control {
    font-size: 14px;
    padding: 0.55rem 0.7rem;
}

.item-card__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.item-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--color-border);
    background: #F7F9FC;
    margin: 0 -1rem -0.9rem;
    padding: 0.7rem 1rem;
}

.item-card__footer-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
}

.item-card__footer .span-total-item {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-primary);
}

@media (min-width: 900px) {
    .item-card {
        display: grid;
        grid-template-columns: minmax(220px, 1.8fr) minmax(280px, 1.4fr) auto;
        grid-template-areas:
            "top top top"
            "produto grid footer";
        gap: 0.75rem 1rem;
        align-items: end;
        border-left-width: 3px;
    }

    .item-card__top {
        grid-area: top;
        padding-bottom: 0.15rem;
        border-bottom: 1px solid var(--color-border);
        margin-bottom: 0.15rem;
    }

    .item-card__produto {
        grid-area: produto;
        margin: 0;
    }

    .item-card__grid {
        grid-area: grid;
    }

    .item-card__footer {
        grid-area: footer;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        margin: 0;
        padding: 0.55rem 0.75rem;
        min-width: 130px;
        border-top: none;
        border-left: 1px solid var(--color-border);
    }
}

.totals-wrap {
    margin-top: 1rem;
    display: flex;
    justify-content: flex-end;
}

.form-group:has(.filter-actions) {
    justify-content: flex-end;
}

.filter-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    width: 100%;
    flex-wrap: wrap;
}

/* Filtros de listagem: uma faixa sÃ³, campos na mesma linha e botÃµes no fim */
.card__body:has(> form.form-grid) {
    padding: 0.7rem 0.85rem;
}

.card__body > form.form-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.65rem 0.75rem;
}

.card__body > form.form-grid > .form-group,
.card__body > form.form-grid > .form-group--span-2,
.card__body > form.form-grid > .form-group--span-3 {
    flex: 1 1 11rem;
    width: auto;
    min-width: 0;
    max-width: 100%;
    grid-column: auto;
}

.card__body > form.form-grid > .form-group--span-2 {
    flex: 2 1 16rem;
}

.card__body > form.form-grid > .form-group:has(.filter-actions) {
    flex: 0 0 auto;
    margin-left: auto;
    justify-content: flex-end;
}

.card__body > form.form-grid .filter-actions {
    width: auto;
    flex-wrap: nowrap;
    min-height: 38px;
}

.card__body > form.form-grid .filter-actions .btn {
    min-height: 38px;
}

/* =========================================
   HOME â MÃDULOS
   ========================================= */
.modules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.5rem;
}

.module-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 0.8rem 0.9rem;
    display: grid;
    text-decoration: none !important;
    grid-template-columns: 36px 1fr;
    column-gap: 0.75rem;
    row-gap: 0.1rem;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
    min-height: 68px;
}

.module-card:hover {
    background: #F7F9FC;
    border-color: var(--color-border-mid);
    text-decoration: none;
}

.module-card--accent {
    border-left-color: var(--color-accent);
}

.module-card--green {
    border-left-color: var(--color-success);
}

.module-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    grid-row: 1 / span 2;
    background: var(--color-primary-soft);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
}

.module-card--accent .module-icon {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.module-card--accent .module-icon {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.module-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.25;
}

.module-desc {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.35;
}

.home-lead {
    color: var(--color-text-mid);
    font-size: 14px;
    line-height: 1.4;
}

.home-lead strong {
    color: var(--color-text);
    font-weight: 700;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* =========================================
   HOME â BOAS-VINDAS
   ========================================= */
.home-hero {
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-bottom: 3px solid var(--color-accent);
    color: #FFF;
    padding: 1.35rem 1.35rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.home-hero__eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 0.35rem;
}

.home-hero__title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.35rem;
}

.home-hero__title span {
    color: var(--color-accent-lt);
}

.home-hero__text {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    max-width: 42rem;
    line-height: 1.45;
}

.home-hero__chip {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFF;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.4rem 0.7rem;
    align-self: center;
}

.home-section-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-text);
    margin: 0.35rem 0 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.home-section-label::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 99px;
    background: var(--color-accent);
    flex-shrink: 0;
}

.main-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.75rem;
}

.main-action-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 76px;
    padding: 0.9rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none !important;
}

.main-action-card:hover {
    border-color: var(--color-border-mid);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.main-action-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    flex-shrink: 0;
}

.main-action-card__icon svg {
    width: 20px;
    height: 20px;
}

.main-action-card--green .main-action-card__icon {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.main-action-card--orange .main-action-card__icon {
    background: var(--color-accent-soft);
    color: var(--color-accent);
}

.main-action-card--blue .main-action-card__icon,
.main-action-card--primary .main-action-card__icon {
    background: var(--color-primary-soft);
    color: var(--color-primary);
}

.main-action-card__content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.main-action-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

.main-action-card__desc {
    font-size: 12px;
    color: var(--color-text-muted);
    line-height: 1.35;
}

/* =========================================
   MENU MOBILE / OVERLAY
   ========================================= */
.header__menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #FFF;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.header__menu:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header__menu:active {
    transform: scale(0.95);
}

.header__menu-icon {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 18px;
    height: 14px;
    position: relative;
}

.header__menu-icon::before,
.header__menu-icon::after,
.header__menu-icon span {
    content: '';
    display: block;
    width: 18px;
    height: 2px;
    background: #FFF;
    border-radius: 1px;
    position: absolute;
    left: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.header__menu-icon::before {
    top: 0;
}

.header__menu-icon span {
    top: 50%;
    transform: translateY(-50%);
}

.header__menu-icon::after {
    bottom: 0;
}

/* AnimaÃ§Ã£o quando sidebar estÃ¡ aberta */
.sidebar-open .header__menu-icon::before {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.sidebar-open .header__menu-icon::after {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

.sidebar-open .header__menu-icon span {
    opacity: 0;
}

.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(28, 37, 48, 0.45);
    z-index: 10040;
    pointer-events: auto;
}

.sidebar-overlay[hidden] {
    display: none !important;
    pointer-events: none;
}

/* =========================================
   RESPONSIVIDADE
   ========================================= */
@media (max-width: 1100px) {
    .form-grid--col-4 {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid--col-4 .form-group--span-3 {
        grid-column: span 2;
    }
}

@media (max-width: 900px) {
    html,
    body {
        overflow: auto;
        height: auto;
        min-height: 100%;
    }

    .header__menu {
        display: inline-flex;
        width: 40px;
        height: 40px;
    }

    .sidebar__link,
    .sidebar__subgroup-toggle {
        min-height: 44px;
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
    }

    .header__brand {
        width: auto;
        max-width: min(160px, 46vw);
        min-width: 0;
    }

    .header__logo-img {
        height: 42px;
    }

    .layout {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        bottom: auto;
        grid-template-columns: 1fr;
        height: auto;
        min-height: calc(100vh - var(--header-h) - var(--footer-h));
        margin-top: var(--header-h);
        overflow: visible;
        padding-bottom: var(--footer-h);
    }

    .sidebar {
        position: fixed;
        top: var(--header-h);
        left: 0;
        bottom: 0;
        width: min(var(--sidebar-w), 86vw);
        height: auto;
        max-height: calc(100dvh - var(--header-h));
        z-index: 10050;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: none;
        background: #F7F9FC;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        pointer-events: auto;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.22);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .layout {
        pointer-events: none;
    }

    body.sidebar-open .sidebar,
    body.sidebar-open .sidebar-overlay,
    body.sidebar-open .header {
        pointer-events: auto;
    }

    .main {
        padding: 1rem;
        width: 100%;
        overflow: visible;
        min-height: 0;
    }

    .form-grid--col-2,
    .form-grid--col-3,
    .form-grid--col-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .form-grid--col-3 .form-group--span-2,
    .form-grid--col-3 .form-group--span-3 {
        grid-column: span 2;
    }

    .card__header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .card__footer {
        flex-wrap: wrap;
    }

    .page-bar {
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .page-bar__title {
        min-width: 0;
        flex: 1 1 auto;
    }

    .page-bar__actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .page-bar__actions .btn {
        flex: 0 1 auto;
    }

    .filter-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }

    .filter-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 40px;
    }

    .table:not(.table--cards) {
        min-width: 640px;
    }

    .home-hero {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .form-grid > .form-group,
    .filter-actions,
    .card,
    .card__body {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .header {
        padding: 0 0.65rem;
        gap: 0.4rem;
    }

    .header__logo-img {
        height: 40px;
    }

    .main {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .page-title {
        font-size: 1.15rem;
    }

    .page-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .page-bar__actions {
        justify-content: flex-start;
    }

    .page-bar__actions .btn,
    .page-bar__actions form {
        flex: 1 1 auto;
    }

    .page-bar__actions .btn {
        justify-content: center;
    }
}

/* central action row for pages (center volta/pdf/edit) â global, not only mobile */
.page-actions-center {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin: 0.75rem 0;
    flex-wrap: wrap;
}

.page-actions-center .btn {
    min-width: 110px;
}

@media (max-width: 640px) {
    /* Mobile: aÃ§Ãµes ficam empilhÃ¡veis mas nÃ£o forÃ§am largura total â mantemos botÃµes compactos e com wrap */
    .page-bar__actions {
        display: flex;
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        flex-wrap: wrap;
    }

    .page-bar__actions > * {
        width: auto;
    }

    .page-bar__actions .btn,
    .page-bar__actions form {
        width: auto;
        display: inline-flex;
        flex: 0 0 auto;
    }

    /* ForÃ§ar destaque das aÃ§Ãµes primÃ¡rias para o topo */
    .page-bar__actions .btn--primary,
    .page-bar__actions .btn--success {
        order: -1;
    }
    .page-bar__actions .btn--danger {
        order: 1;
    }

    /* Compact button styling (mobile-first) */
    .btn {
        padding: 0.4rem 0.7rem;
        font-size: 13px;
        gap: 0.35rem;
        min-height: 40px;
    }

    .btn--sm {
        padding: 0.35rem 0.6rem;
        font-size: 13px;
        min-height: 40px;
    }

    /* Reduce spacing between buttons in action bars */
    .page-bar__actions {
        gap: 0.4rem;
    }

    .card__footer {
        gap: 0.4rem;
    }

    /* Icon spacing (if buttons include icons as first child) */
    .btn > .icon,
    .btn > svg {
        width: 14px;
        height: 14px;
        margin-right: 0.35rem;
        display: inline-block;
        vertical-align: middle;
    }

    /* Make primary/confirm buttons more compact but visually strong */
    .btn--primary,
    .btn--success {
        padding-left: 0.6rem;
        padding-right: 0.6rem;
        font-weight: 700;
    }

    .form-grid--col-2,
    .form-grid--col-3,
    .form-grid--col-4 {
        grid-template-columns: minmax(0, 1fr);
    }

    .form-group--span-2,
    .form-group--span-3 {
        grid-column: span 1;
    }

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

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

    .quick-actions .btn {
        flex: 1 1 calc(50% - 0.5rem);
    }

    .table th,
    .table td {
        padding: 0.5rem 0.55rem;
    }

    .card__body {
        padding: 0.85rem;
    }

    /* Footer de cadastro: CTA grande e fixo no mobile (nÃ£o afeta paginaÃ§Ã£o) */
    .card form > .card__footer,
    .card__footer:has(> .btn--primary),
    .card__footer:has(> .btn--success) {
        justify-content: stretch;
        flex-direction: column-reverse;
        gap: 0.5rem;
        position: sticky;
        bottom: 0;
        z-index: 20;
        padding: 0.85rem 1rem;
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -4px 12px rgba(22, 58, 95, 0.06);
    }

    .card form > .card__footer .btn,
    .card__footer:has(> .btn--primary) .btn,
    .card__footer:has(> .btn--success) .btn {
        flex: 1 1 auto;
        width: 100%;
        justify-content: center;
        min-height: var(--touch-min);
    }

    .card form > .card__footer .btn--primary,
    .card form > .card__footer .btn--success,
    .card__footer:has(> .btn--primary) .btn--primary,
    .card__footer:has(> .btn--success) .btn--success {
        order: -1;
        font-size: 1rem;
        font-weight: 700;
        padding: 0.85rem 1rem;
    }

    .totals-wrap {
        justify-content: stretch;
    }

    .totals-box,
    .totals-box--sale {
        width: 100%;
        max-width: none;
    }

    .totals-box__input {
        width: 120px;
    }

    .item-card {
        padding: 0.85rem;
        gap: 0.85rem;
        box-shadow: 0 1px 2px rgba(28, 37, 48, 0.04);
    }

    .item-card__produto .form-control {
        font-size: 15px;
        min-height: 42px;
    }

    .item-card__grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .item-card__grid .form-group:last-child {
        grid-column: 1 / -1;
    }

    .item-card__grid .form-control {
        min-height: 40px;
        font-size: 14px;
    }

    .item-card__footer {
        margin: 0 -0.85rem -0.85rem;
        padding: 0.8rem 0.85rem;
    }

    .item-card__footer .span-total-item {
        font-size: 1.15rem;
    }

    .item-card__top .btn-remove-item {
        color: var(--color-error);
        border-color: transparent;
        padding-inline: 0.45rem;
    }

    .section-toolbar {
        align-items: stretch;
        margin-bottom: 0.85rem;
    }

    .section-toolbar .btn {
        width: 100%;
        justify-content: center;
        min-height: 40px;
    }

    .filter-actions {
        justify-content: stretch;
    }

    .filter-actions .btn {
        flex: 1 1 auto;
        justify-content: center;
    }

    .modal-box {
        max-width: 100%;
    }

    .footer {
        padding: 0 0.75rem;
        justify-content: center;
        text-align: center;
    }
}

/* Esconder footer em telas mobile para nÃ£o sobrepor conteÃºdo */
@media (max-width: 900px) {
    .footer {
        display: none;
    }
    /* Ajustar layout quando o footer estiver oculto */
    .layout {
        height: auto;
        min-height: calc(100vh - var(--header-h));
        padding-bottom: 0;
    }
    /* Quando a sidebar usa bottom: var(--footer-h) em mobile, resetar para 0 */
    .sidebar {
        bottom: 0;
    }
}

@media (max-width: 420px) {

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

    .stat-card__value {
        font-size: 1.35rem;
    }
}

/* =========================================
   LISTAGENS EM CARDS (mobile)
   ========================================= */
@media (max-width: 768px) {
    .table-wrap:has(.table--cards) {
        overflow: visible;
    }

    .table--cards {
        min-width: 0 !important;
        border-collapse: separate;
        border-spacing: 0;
    }

    .table--cards thead {
        display: none;
    }

    .table--cards tbody {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .table--cards tbody tr {
        display: block;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-left: 3px solid var(--color-primary);
        border-radius: var(--radius-md);
        padding: 0.85rem 1rem;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
        box-shadow: var(--shadow-sm);
    }

    .table--cards tbody tr:hover {
        background: var(--color-surface);
    }

    .table--cards tbody tr:last-child td {
        border-bottom: none;
    }

    .table--cards tbody tr:nth-child(even) {
        background: var(--color-surface);
    }

    .table--cards tbody td:first-child:not([colspan]) {
        font-weight: 700;
        color: var(--color-text);
        font-size: 15px;
    }

    .table--cards td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        padding: 0.4rem 0;
        border: none;
        text-align: right;
        width: 100%;
        min-width: 0;
        overflow-wrap: break-word;
    }

    .table--cards td::before {
        content: attr(data-label);
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--color-text-muted);
        text-align: left;
        flex: 0 0 34%;
        max-width: 42%;
        overflow-wrap: normal;
    }

    .table.table--cards td.list-card__actions,
    .table.table--cards td.col-actions,
    .table.table--cards td.text-right,
    .table.table--cards tbody td:last-child:not([colspan]) {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: stretch;
        gap: 0.4rem;
        width: 100% !important;
        max-width: 100%;
        min-width: 0;
        white-space: normal !important;
        padding-top: 0.7rem;
        margin-top: 0.4rem;
        border-top: 1px solid var(--color-border);
        text-align: right;
        box-sizing: border-box;
    }

    .table.table--cards td.list-card__actions > .btn,
    .table.table--cards td.list-card__actions > form,
    .table.table--cards td.col-actions > .btn,
    .table.table--cards td.col-actions > form,
    .table.table--cards tbody td:last-child:not([colspan]) > .btn,
    .table.table--cards tbody td:last-child:not([colspan]) > form {
        flex: 0 0 auto;
        min-width: 0;
        max-width: 100%;
        margin: 0;
    }

    .table.table--cards td form.d-inline,
    .table.table--cards td form {
        display: inline-flex;
    }

    .table.table--cards td.list-card__actions .btn,
    .table.table--cards td.col-actions .btn,
    .table.table--cards tbody td:last-child:not([colspan]) .btn {
        width: auto;
        max-width: none;
        margin-top: 0;
        justify-content: center;
        white-space: nowrap;
    }

    .table.table--cards td.list-card__actions .btn--icon,
    .table.table--cards td.col-actions .btn--icon,
    .table.table--cards tbody td:last-child:not([colspan]) .btn--icon {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
        flex: 0 0 40px;
    }

    .table.table--cards td.col-actions,
    .table.table--cards td.list-card__actions,
    .table.table--cards tbody td:last-child:not([colspan]) {
        justify-content: flex-start;
    }

    .table.table--cards td.col-actions > .acoes {
        margin-left: auto;
    }

    .table--cards .acoes__grade {
        grid-auto-columns: 40px;
    }

    .table--cards .acoes__slot {
        width: 40px;
        height: 40px;
    }

    .table--cards td.list-card__actions::before,
    .table--cards td.col-actions::before,
    .table--cards td.text-right::before,
    .table--cards td:last-child:not([colspan])::before {
        display: none;
    }

    .table--cards td.col-num {
        text-align: right;
    }

    .table--cards td[colspan] {
        justify-content: center;
        text-align: center;
        padding: 1.5rem 0.5rem;
    }

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

    #modal-ver .table--cards tbody {
        padding: 0.65rem;
    }

    #modal-ver .table--cards tbody tr {
        padding: 0.75rem 0.85rem;
    }

    #modal-ver .table--cards tbody td:first-child:not([colspan]) {
        display: block;
        text-align: left;
        padding-bottom: 0.55rem;
        margin-bottom: 0.15rem;
        border-bottom: 1px solid var(--color-border);
    }

    #modal-ver .table--cards tbody td:first-child:not([colspan])::before {
        display: none;
    }

    #modal-ver .table--cards tbody td[data-label]:not(:first-child) {
        display: flex;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: baseline;
        gap: 0.75rem;
        width: auto;
        max-width: none;
        margin: 0;
        padding: 0.35rem 0;
        border-top: none;
        text-align: right;
    }

    #modal-ver .table--cards tbody td[data-label]:not(:first-child)::before {
        display: block;
        content: attr(data-label);
        flex: 0 0 auto;
        max-width: none;
    }
}

/* Evita o zoom automÃ¡tico do navegador ao focar campos no modo responsivo.
   iOS/Android ampliam a pÃ¡gina quando a fonte do campo Ã© menor que 16px. */
@media (max-width: 900px) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="file"]),
    textarea,
    select,
    .form-control,
    .item-card .form-control,
    .item-card__produto .form-control,
    .item-card__grid .form-control {
        font-size: 16px !important;
        min-height: 44px;
    }
}

/* Numeric keypad custom (mobile) */
.numeric-keypad {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    border-top: 1px solid var(--color-border);
    z-index: 50000;
    display: none;
    box-shadow: 0 -6px 18px rgba(0,0,0,0.08);
    padding: 0.5rem;
}
.numeric-keypad--visible {
    display: block;
}
.numeric-keypad .nk-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}
.numeric-keypad .nk-display {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--color-border);
    background: #f8f9fb;
    font-size: 1.05rem;
    text-align: right;
    border-radius: 4px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}
.numeric-keypad .nk-ok {
    padding: 0.5rem 0.8rem;
    background: var(--color-primary);
    color: #fff;
    border: none;
    font-weight: 700;
    cursor: pointer;
}
.numeric-keypad .nk-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.35rem;
}
.numeric-keypad .nk-btn {
    padding: 0.9rem 0;
    font-size: 1.25rem;
    border: 1px solid var(--color-border);
    background: #fff;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    user-select: none;
}
.numeric-keypad .nk-btn:active {
    background: #f0f4f8;
}
.numeric-keypad .nk-comma {
    font-size: 1.2rem;
}
.numeric-keypad .nk-back {
    font-size: 1.1rem;
}
/* Page actions (buttons on the top of show pages) */
.page-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
}

.page-actions > form,
.page-actions > .d-inline,
.page-actions > .export-dropdown {
    display: inline-flex;
    margin: 0;
    flex: 0 0 auto;
}

.page-actions .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 34px;
    padding: 0.35rem 0.8rem;
    font-size: 0.9rem;
}

.page-actions .btn--sm {
    height: 34px;
    padding: 0.25rem 0.6rem;
    font-size: 0.85rem;
}

.page-actions .btn--icon {
    padding: 0.25rem;
    width: 34px;
    min-width: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.ver-fragment__acoes [aria-label="Voltar"] {
    display: none !important;
}

.ver-fragment__acoes:not(:has(a:not([aria-label="Voltar"]), button)) {
    display: none;
}

.ver-fragment__acoes .page-actions .btn--icon {
    width: auto;
    min-width: 34px;
    padding: 0.25rem 0.7rem;
    gap: 0.35rem;
}

.ver-fragment__acoes .page-actions .btn--icon::after {
    content: attr(aria-label);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

@media (max-width: 768px) {
    .ver-fragment__acoes .page-actions > form,
    .ver-fragment__acoes .page-actions > .export-dropdown {
        display: block;
    }

    .ver-fragment__acoes .page-actions .btn,
    .ver-fragment__acoes .page-actions .btn--icon,
    .ver-fragment__acoes .page-actions a.btn,
    .ver-fragment__acoes .page-actions .export-dropdown__toggle {
        width: 100%;
        min-width: 0;
        height: auto;
        min-height: 42px;
        justify-content: center;
        box-sizing: border-box;
    }
}

.page-actions .btn .icon,
.page-actions .btn img {
    width: 16px;
    height: 16px;
    display: block;
    margin: 0;
}

.page-actions .btn:not(.btn--icon) .icon {
    margin-right: 0.35rem;
}

.page-actions .icon--sm {
    width: 18px;
    height: 18px;
}
/* Centered action column: apply only on small screens (mobile) â keep desktop inline */
/* Responsive: stack title + actions on small screens to avoid overlap */
@media (max-width: 600px) {
    .page-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .page-bar__actions {
        width: 100%;
        margin-top: 0;
        gap: 0.4rem;
    }
    .page-actions {
        width: 100%;
        flex-wrap: wrap;
        gap: 0.35rem;
    }
    .page-actions > form,
    .page-actions > .export-dropdown,
    .page-actions > a {
        flex: 0 0 auto;
        width: auto;
    }
    .page-actions .btn {
        flex: 0 0 auto;
        height: 36px;
        padding: 0.35rem 0.6rem;
        white-space: nowrap;
    }
    .page-actions .btn--icon {
        width: 36px;
        min-width: 36px;
        padding: 0.25rem;
    }
    /* Centered action column: stack one button per line on mobile when using the helper class */
    .page-actions.page-actions-center {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
        width: 100%;
    }
    .page-actions.page-actions-center > * {
        width: 100%;
    }
    .page-actions.page-actions-center form {
        width: 100%;
    }
    .page-actions.page-actions-center .btn {
        width: 100%;
        display: inline-flex;
        justify-content: center;
    }
}

/* Utility */
.d-inline {
    display: inline;
}

/* =========================================
   CARREGAMENTO ENTRE TELAS
   ========================================= */
.page-loading {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(243, 245, 248, 0.72);
    visibility: hidden;
    pointer-events: none;
}

html.is-loading .page-loading {
    visibility: visible;
    pointer-events: auto;
}

.page-loading__box {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.75rem 1.1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    box-shadow: 0 8px 24px rgba(21, 34, 50, 0.12);
    color: var(--color-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.page-loading__spin {
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-primary-soft);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: page-loading-spin 0.7s linear infinite;
}

@keyframes page-loading-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .page-loading__spin {
        animation-duration: 1.6s;
    }
}

/* =========================================
   TOAST
   ========================================= */
.toast-stack {
    position: fixed;
    top: calc(var(--header-h) + 12px);
    right: 16px;
    left: auto;
    width: min(420px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0;
    z-index: 45000;
    pointer-events: none;
}

.auth-body .toast-stack {
    top: 16px;
}

.toast {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    bottom: auto;
    right: auto;
    left: auto;
    max-width: none;
    margin: 0;
    padding: 0.85rem 0.85rem 0.85rem 1rem;
    border-radius: 12px;
    border-left: 4px solid rgba(255, 255, 255, 0.55);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    pointer-events: auto;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
    animation: toast-in 0.25s ease;
}
.toast__texto { flex: 1; min-width: 0; }
.toast__linha { display: block; }
.toast__linha + .toast__linha { margin-top: 0.35rem; }
.toast__fechar {
    flex: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.85;
}
.toast__fechar:hover { opacity: 1; }
.toast--success { background: #166534; color: #fff; }
.toast--error   { background: #991b1b; color: #fff; }
.toast--warning { background: #92400e; color: #fff; }
@keyframes toast-in {
    from { opacity: 0; transform: translateY(-0.35rem); }
    to   { opacity: 1; transform: none; }
}

/* =========================================
   LANÃAMENTO â hierarquia, acesso e foco
   ========================================= */
::selection {
    background: #F3D2C0;
    color: var(--color-text);
}

a.stat-card:hover,
.module-card:hover {
    box-shadow: var(--shadow-md);
}

.home-bar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem 1.1rem;
}

.home-bar__hello {
    font-size: 1.05rem;
    color: var(--color-text);
    line-height: 1.3;
}

.home-bar__hello strong {
    font-weight: 700;
}

.home-bar__meta {
    margin-top: 0.15rem;
    font-size: 13px;
    color: var(--color-text-mid);
}

html:has(body.auth-body),
body.auth-body {
    height: auto;
    min-height: 100%;
    overflow: auto;
}

.auth-page {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: stretch;
    background: var(--color-bg);
    overflow-x: clip;
}

.auth-aside {
    position: relative;
    width: min(520px, 46vw);
    min-width: 0;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    padding: 2.4rem 2.75rem 1.6rem;
    color: #fff;
    background:
        radial-gradient(900px 420px at -8% -10%, rgba(227, 90, 18, 0.28), transparent 58%),
        linear-gradient(168deg, #1C4E7C 0%, #163A5F 46%, #10283F 100%);
    border-right: 3px solid var(--color-accent);
    overflow: hidden;
}

.auth-aside::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 52px 52px;
    -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 72%);
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.7), transparent 72%);
    pointer-events: none;
}

.auth-aside__topo,
.auth-aside__body,
.auth-aside__rodape {
    position: relative;
    z-index: 1;
}

.auth-brand {
    display: inline-flex;
    line-height: 0;
}

.auth-brand:hover {
    text-decoration: none;
}

.auth-brand img {
    display: block;
    height: 68px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
}

.auth-aside__linha {
    margin-top: 0.85rem;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.62);
}

.auth-aside__body {
    max-width: 22rem;
    margin-top: auto;
    margin-bottom: auto;
}

.auth-kicker {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #F3B08A;
}

.auth-pitch {
    margin-top: 0.75rem;
    font-size: 1.85rem;
    font-weight: 600;
    line-height: 1.22;
    letter-spacing: -0.025em;
    color: #fff;
}

.auth-lead {
    margin-top: 0.9rem;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
}

.auth-points {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.7rem 0 0;
    padding: 0;
    list-style: none;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.auth-points__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 9px;
    color: #F6C7A8;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-points__mark svg {
    width: 16px;
    height: 16px;
}

.auth-aside__rodape {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.48);
}

.auth-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem 2rem;
    background:
        radial-gradient(820px 380px at 100% 0%, rgba(22, 58, 95, 0.06), transparent 62%),
        var(--color-bg);
}

.auth-card {
    width: 100%;
    max-width: 440px;
    min-width: 0;
    background: var(--color-surface);
    border: 1px solid #E2E8EF;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 18px 48px rgba(22, 58, 95, 0.08);
    overflow: hidden;
}

.auth-card::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-primary) 62%, var(--color-accent) 100%);
}

.auth-card__corpo {
    padding: 1.85rem 1.9rem 1.55rem;
}

.auth-card__corpo,
.auth-card form,
.auth-card .form-group,
.auth-card .form-input-wrap {
    min-width: 0;
    max-width: 100%;
}

.auth-card .form-control {
    font-size: 16px;
    min-width: 0;
    max-width: 100%;
    min-height: 46px;
    border-radius: 10px;
    background: #fff;
    border-color: #C5CED8;
}

.auth-card .form-control:focus {
    background: #fff;
}

.auth-card .form-input-icon {
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
}

.auth-campo__topo {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
}

.auth-card .form-group + .form-group {
    margin-top: 0.9rem;
}

.auth-card .alert {
    margin-bottom: 1rem;
}

.auth-title {
    margin-bottom: 0.35rem;
    font-size: 1.65rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    color: var(--color-primary);
    line-height: 1.15;
}

.auth-sub {
    margin: 0 0 1.45rem;
    font-size: 14px;
    color: var(--color-text-mid);
    line-height: 1.45;
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.25rem;
}

.auth-row label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 13px;
    color: var(--color-text-mid);
    cursor: pointer;
}

.auth-row input {
    width: 16px;
    height: 16px;
    accent-color: var(--color-primary);
}

.auth-row a {
    flex: 0 0 auto;
    margin-left: auto;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
}

.auth-row a:hover {
    color: var(--color-primary-lt);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-submit {
    width: 100%;
    min-height: 46px;
    border-radius: 10px;
    font-size: 15px;
    letter-spacing: 0.01em;
    scroll-margin-bottom: 1.5rem;
}

.auth-note {
    margin-top: 1.2rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
}

.auth-submit.is-loading::before {
    content: '';
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-giro 0.7s linear infinite;
}

@keyframes auth-giro {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .auth-submit.is-loading::before {
        animation-duration: 1.6s;
    }
}

.auth-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 1.15rem;
}

.form-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input-icon {
    position: absolute;
    left: 0.7rem;
    color: var(--color-text-muted);
    pointer-events: none;
}

.form-input-padded {
    padding-left: 2.15rem !important;
}

.form-input-wrap > .form-control {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
}

.form-input-com-acao {
    padding-right: 2.4rem !important;
}

.form-group > .form-error {
    display: block;
    margin-top: 0.35rem;
}

.auth-erro,
.auth-aviso,
.auth-ok {
    margin: 0 0 1rem;
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.45;
}

.auth-erro {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.auth-aviso {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.auth-ok {
    background: var(--color-success-bg);
    color: var(--color-success);
}

.auth-erro[hidden] {
    display: none;
}

.auth-ver-senha {
    padding: 0;
    border: 0;
    background: none;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-primary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-ver-senha:hover {
    color: var(--color-primary-lt);
}

.auth-ver-senha:focus-visible,
.auth-card a:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

@media (max-width: 900px) {
    .header__user-meta {
        display: none;
    }

    .auth-page {
        flex-direction: column;
    }

    .auth-aside {
        width: 100%;
        min-height: 0;
        gap: 0;
        padding: 1.15rem 1.25rem 1rem;
        border-right: 0;
        border-bottom: 3px solid var(--color-accent);
    }

    .auth-aside__body,
    .auth-aside__rodape {
        display: none;
    }

    .auth-aside__linha {
        margin-top: 0.45rem;
        letter-spacing: 0.1em;
    }

    .auth-brand img {
        height: 48px;
    }

    .auth-main {
        align-items: flex-start;
        padding: 1.25rem 1rem 2.5rem;
    }
}

@media (max-width: 480px) {
    .auth-main {
        padding: 1rem 1rem calc(1.5rem + env(safe-area-inset-bottom));
    }

    .auth-card__corpo {
        padding: 1.45rem 1.2rem 1.25rem;
    }

    .auth-card .form-control,
    .auth-submit {
        min-height: 48px;
    }

    .auth-ver-senha {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }

    .auth-row {
        align-items: flex-start;
        row-gap: 0.15rem;
    }

    .auth-row label {
        flex: 1 1 100%;
        min-height: 44px;
    }

    .auth-row a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

@media (max-height: 760px) and (min-width: 901px) {
    .auth-aside {
        padding-top: 1.5rem;
        padding-bottom: 1.15rem;
        gap: 1.25rem;
    }

    .auth-pitch {
        font-size: 1.45rem;
    }

    .auth-lead {
        margin-top: 0.6rem;
    }

    .auth-points {
        margin-top: 1.1rem;
        gap: 0.55rem;
    }

    .auth-brand img {
        height: 56px;
    }
}

@media (max-width: 640px) {
    .header__identity-text {
        display: none;
    }

    .home-bar {
        padding: 0.8rem;
    }
}

@media (max-width: 900px) {
    .card__body > form.form-grid .filter-actions .btn {
        min-height: 44px;
    }
}

@media (max-width: 640px) {
    .card__body > form.form-grid > .form-group,
    .card__body > form.form-grid > .form-group--span-2,
    .card__body > form.form-grid > .form-group--span-3,
    .card__body > form.form-grid > .form-group:has(.filter-actions) {
        flex: 1 1 100%;
        margin-left: 0;
    }

    .card__body > form.form-grid .filter-actions,
    .card__body > form.form-grid .filter-actions .btn {
        width: 100%;
    }
}

/* =========================================
   POS / OPERACIONAL (Nova Venda ï¿½ Orï¿½amento)
   ========================================= */
.venda-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}
.venda-topbar__label {
    opacity: 0.8;
    font-size: 0.85rem;
}
.venda-topbar__cliente {
    font-size: 0.95rem;
}
#display-cliente {
    font-weight: 600;
    margin-left: 0.25rem;
}
.venda-topbar__total {
    text-align: right;
}
.venda-topbar__total-label {
    display: block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.8;
}
.venda-topbar__total-valor {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.venda-busca-rapida {
    margin-bottom: 1rem;
}
.venda-busca-rapida__input-wrap {
    position: relative;
}
.venda-busca-rapida__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    color: var(--color-text-muted);
    pointer-events: none;
}
.venda-busca-rapida__input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    font-size: 1.1rem;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.venda-busca-rapida__input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.venda-busca-rapida__hints {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
}
.venda-busca-rapida__hints kbd {
    display: inline-block;
    padding: 0.15rem 0.4rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
}

.venda-itens-container {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
    min-height: 200px;
}
.venda-itens-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}
.venda-itens-header__title {
    font-weight: 600;
    font-size: 1rem;
}
.venda-itens-header__count {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.venda-itens-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.venda-item {
    display: grid;
    grid-template-columns: 1fr auto auto auto;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    border-radius: var(--radius-md);
}
.venda-item__info {
    min-width: 0;
}
.venda-item__nome {
    font-weight: 500;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.venda-item__codigo {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.venda-item__qtd {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.venda-item__qtd-input {
    width: 70px;
    text-align: center;
    font-weight: 600;
    padding: 0.4rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: white;
}
.venda-item__preco {
    text-align: right;
    min-width: 90px;
}
.venda-item__preco-unit {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}
.venda-item__preco-total {
    font-weight: 600;
    color: var(--color-primary);
}
.venda-item__actions {
    display: flex;
    gap: 0.25rem;
}
.venda-item__btn {
    padding: 0.4rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--color-text-muted);
    transition: all 0.15s;
}
.venda-item__btn:hover {
    background: var(--color-border);
    color: var(--color-text);
}
.venda-item__btn--remove:hover {
    background: #fee2e2;
    color: var(--color-error);
}
.venda-item__btn svg {
    width: 18px;
    height: 18px;
}

.venda-itens-empty,
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-muted);
}
.table td.empty-state,
.table--cards td.empty-state {
    padding: 2rem 1rem !important;
    font-size: 0.95rem;
}
.venda-itens-empty svg,
.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.venda-itens-empty p,
.empty-state p {
    font-weight: 500;
    margin-bottom: 0.25rem;
}
.venda-itens-empty span,
.empty-state span {
    font-size: 0.9rem;
}

.venda-resumo {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.venda-resumo__section {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}
.venda-resumo__section:last-child {
    border-bottom: none;
}
.venda-resumo__section h4 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
}
.venda-resumo__field {
    margin-bottom: 0.75rem;
}
.venda-resumo__field:last-child {
    margin-bottom: 0;
}
.venda-resumo__field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}
.venda-resumo__field .form-control {
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
}
.venda-resumo__section--totais {
    background: #f8fafc;
}
.venda-resumo__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    font-size: 0.95rem;
}
.venda-resumo__row--input {
    gap: 1rem;
}
.venda-resumo__row--input label {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}
.input-prefix-wrap {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.input-prefix-wrap .form-control {
    width: 100px;
}
.input-prefix {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}
.venda-resumo__row--total {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid var(--color-border);
    font-size: 1.25rem;
    font-weight: 700;
}
.venda-resumo__row--total span:last-child {
    color: var(--color-primary);
}
.venda-resumo__actions {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.modal-box--compact {
    max-width: 400px;
}
.modal-qtd-produto {
    text-align: center;
    padding: 1rem;
    background: #f8fafc;
    border-radius: var(--radius-md);
}
.modal-qtd-produto__nome {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}
.modal-qtd-produto__preco {
    color: var(--color-primary);
    font-weight: 500;
}
.modal-qtd-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-primary);
    color: white;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
}
.modal-qtd-total strong {
    font-size: 1.3rem;
}
.input-qtd-modal {
    text-align: center !important;
}

/* Totais sticky em telas financeiras / cadastros com valor */
.sticky-total-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius-lg);
    margin-bottom: 1rem;
    position: sticky;
    top: 0;
    z-index: 40;
}
.sticky-total-bar__label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.85;
}
.sticky-total-bar__value {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Seï¿½ï¿½es de formulï¿½rio mais legï¿½veis no mobile */
.form-section {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}
.form-section:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.form-section__title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
    margin-bottom: 0.85rem;
}

@media (min-width: 900px) {
    #form-venda,
    #form-orcamento {
        display: grid;
        grid-template-columns: 1fr 320px;
        grid-template-rows: auto auto 1fr;
        gap: 1rem;
        align-items: start;
    }
    #form-venda .venda-topbar,
    #form-orcamento .venda-topbar {
        grid-column: 1 / -1;
    }
    #form-venda .venda-busca-rapida,
    #form-orcamento .venda-busca-rapida {
        grid-column: 1;
        margin-bottom: 0;
    }
    #form-venda .venda-itens-container,
    #form-orcamento .venda-itens-container {
        grid-column: 1;
        grid-row: 3;
        margin-bottom: 0;
    }
    #form-venda .venda-resumo,
    #form-orcamento .venda-resumo {
        grid-column: 2;
        grid-row: 2 / 4;
        position: sticky;
        top: 80px;
    }
}

.nfe-emitir-fixed {
    display: none;
}

.nfe-wizard {
    width: 100%;
    max-width: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.nfe-status {
    position: relative;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
}

.nfe-status__chip {
    font-weight: 700;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.nfe-status__chip--prod {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.nfe-status__texto {
    font-size: 0.8rem;
    color: var(--color-text-muted, #64748b);
}

.nfe-pendencias-fab {
    position: relative;
    margin-left: auto;
    z-index: 40;
}

.nfe-pendencias-fab__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: none;
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    color: #fff;
    background: var(--color-primary);
    box-shadow: 0 6px 16px rgba(28, 37, 48, 0.16);
}

.nfe-pendencias-fab__btn.is-ok {
    background: var(--color-success);
}

.nfe-pendencias-fab__btn.is-erro {
    background: var(--color-error);
}

.nfe-pendencias-fab__count {
    min-width: 1.35rem;
    height: 1.35rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: #fff;
    color: var(--color-error);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.nfe-pendencias-fab__count[hidden] {
    display: none !important;
}

.nfe-pendencias-pop {
    position: absolute;
    top: calc(100% + 0.4rem);
    right: 0;
    width: min(380px, calc(100vw - 2rem));
    max-height: min(62vh, 440px);
    overflow: auto;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(28, 37, 48, 0.18);
    padding: 0.85rem 1rem 1rem;
}

.nfe-pendencias-pop[hidden] {
    display: none !important;
}

.nfe-pendencias-pop__titulo {
    font-weight: 700;
    font-size: 0.95rem;
}

.nfe-pendencias-pop__grupo {
    margin: 0.75rem 0 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-muted, #64748b);
}

.nfe-pendencias-pop__lista {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nfe-pendencias-pop__lista li {
    font-size: 0.84rem;
    line-height: 1.35;
    padding: 0.4rem 0.55rem;
    border-radius: 6px;
    margin-bottom: 0.3rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    align-items: flex-start;
}

.nfe-pendencias-pop__lista li.is-erro {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.nfe-pendencias-pop__lista li.is-aviso {
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.nfe-pendencias-pop__lista button {
    border: none;
    background: transparent;
    color: inherit;
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    white-space: nowrap;
    padding: 0;
}

.nfe-pendencias-pop__link {
    display: inline-block;
    margin-top: 0.25rem;
    font-size: 0.82rem;
    font-weight: 600;
}

.nfe-pendencias-pop__ok {
    margin: 0.55rem 0 0;
    font-size: 0.875rem;
    color: var(--color-success);
}

.nfe-pendencias-pop__nota {
    margin: 0.75rem 0 0;
    font-size: 0.75rem;
    color: var(--color-text-muted, #64748b);
}

#modal-item-aviso[hidden] {
    display: none !important;
}

.nfe-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.5rem;
    margin-bottom: 0;
}

.nfe-step,
.nfe-steps__item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md, 8px);
    background: var(--color-surface);
    color: var(--color-text-muted, #64748b);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.nfe-step:disabled,
.nfe-steps__item:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.nfe-step__num,
.nfe-steps__num {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--color-border);
    color: var(--color-text, #1c2530);
    flex-shrink: 0;
}

.nfe-step__label,
.nfe-steps__label {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
}

.nfe-steps__label--curto {
    display: none;
}

.nfe-step.is-active,
.nfe-steps__item.is-active {
    border-color: var(--color-primary, #1c2530);
    background: color-mix(in srgb, var(--color-primary, #1c2530) 8%, var(--color-surface));
    color: var(--color-text, #1c2530);
}

.nfe-step.is-active .nfe-step__num,
.nfe-steps__item.is-active .nfe-steps__num {
    background: var(--color-primary, #1c2530);
    color: #fff;
}

.nfe-step.is-done,
.nfe-steps__item.is-done {
    border-color: color-mix(in srgb, var(--color-success, #16a34a) 45%, var(--color-border));
    color: var(--color-text, #1c2530);
}

.nfe-step.is-done .nfe-step__num,
.nfe-steps__item.is-done .nfe-steps__num {
    background: var(--color-success, #16a34a);
    color: #fff;
}

.nfe-steps__item.has-pendencia {
    border-color: color-mix(in srgb, var(--color-error) 45%, var(--color-border));
}

.nfe-steps__item.has-pendencia .nfe-steps__num {
    background: var(--color-error);
    color: #fff;
}

#form-nfe {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    min-width: 0;
    gap: 0;
}

.nfe-step-panel {
    display: none;
    width: 100%;
    min-width: 0;
}

.nfe-step-panel.is-active {
    display: block;
}

.nfe-step-panel[hidden] {
    display: none !important;
}

.nfe-step-panel .card {
    margin-bottom: 0;
    width: 100%;
}

.nfe-step-panel .card__body {
    padding: 1.15rem 1.35rem 1.35rem;
}

.nfe-meta-row {
    display: grid;
    grid-template-columns: minmax(90px, 120px) minmax(140px, 200px) minmax(180px, 280px);
    gap: 0.85rem;
    margin-bottom: 1.15rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid var(--color-border);
}

#form-nfe .form-grid--col-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#form-nfe .form-grid--col-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.nfe-wizard-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-top: 1rem;
    padding: 0.9rem 0 0;
    border-top: 1px solid var(--color-border);
    box-sizing: border-box;
}

.nfe-wizard-actions__left,
.nfe-wizard-actions__right {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    min-width: 0;
}

.nfe-wizard-actions__right {
    margin-left: auto;
    justify-content: flex-end;
}

.nfe-wizard-actions .btn,
.nfe-wizard-actions a.btn {
    flex: 0 0 auto;
    box-sizing: border-box;
    height: 40px;
    min-height: 40px;
    line-height: 1;
    padding-top: 0;
    padding-bottom: 0;
    white-space: nowrap;
}

.nfe-wizard-actions .btn[hidden],
.nfe-wizard-actions a[hidden] {
    display: none !important;
}

.modal-box--wide {
    max-width: min(920px, 96vw);
    width: 100%;
}

.nfe-modal-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.nfe-modal-tabs__btn {
    border: none;
    background: transparent;
    padding: 0.65rem 0.9rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-muted, #64748b);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}

.nfe-modal-tabs__btn.is-active {
    color: var(--color-primary, #2563eb);
    border-bottom-color: var(--color-primary, #2563eb);
}

.nfe-modal-pane {
    display: none;
}

.nfe-modal-pane.is-active {
    display: block;
}

.nfe-modal-pane[hidden] {
    display: none !important;
}

.nfe-item-fiscal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.nfe-item-fiscal-chip {
    font-size: 0.72rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: var(--color-bg, #f1f5f9);
    color: var(--color-text-muted, #64748b);
    border: 1px solid var(--color-border);
}

.nfe-item-fiscal-chip.is-falta {
    background: var(--color-warning-bg);
    color: var(--color-warning);
    border-color: #E8C770;
    font-weight: 600;
}

/* Modal de item da NF-e: busca → produto escolhido → valores → fiscal recolhível */
.nfe-kbd {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0 0.3rem;
    font: 600 0.65rem/1.4 ui-monospace, monospace;
    border: 1px solid currentColor;
    border-radius: var(--radius-sm);
    opacity: 0.7;
}

.nfe-item-busca {
    position: relative;
    margin-bottom: 1rem;
}

.nfe-item-busca[hidden] {
    display: none;
}

.nfe-item-busca__input {
    font-size: 1rem;
    padding: 0.75rem 0.9rem;
}

.nfe-item-busca__dica {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.72rem;
}

.nfe-item-resultados {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% - 1.2rem);
    z-index: 30;
    max-height: 320px;
}

.nfe-item-resultados[hidden] {
    display: none;
}

.nfe-ac-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.nfe-ac-estoque {
    font-size: 0.72rem;
    color: var(--color-success);
}

.nfe-ac-estoque.is-zero {
    color: var(--color-error);
}

.nfe-ac-falta {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.nfe-prod-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-lg);
    background: var(--color-primary-soft);
}

.nfe-prod-card[hidden] {
    display: none;
}

.nfe-prod-card__info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.nfe-prod-card__info strong {
    font-size: 1rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nfe-prod-card__info span {
    font-size: 0.78rem;
}

.nfe-item-valores {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(140px, auto);
    gap: 0.75rem;
    align-items: end;
}

.nfe-item-valores__grande {
    font-size: 1.15rem;
}

.nfe-item-valores__total {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    background: var(--color-bg);
}

.nfe-item-valores__total span {
    font-size: 0.72rem;
    color: var(--color-text-muted);
}

.nfe-item-valores__total strong {
    font-size: 1.2rem;
    color: var(--color-primary);
}

.nfe-item-fiscal {
    margin-top: 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.nfe-item-fiscal > summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    list-style: none;
}

.nfe-item-fiscal > summary::-webkit-details-marker {
    display: none;
}

.nfe-item-fiscal > summary::before {
    content: '▸';
    color: var(--color-text-muted);
    transition: transform 0.15s;
}

.nfe-item-fiscal[open] > summary::before {
    transform: rotate(90deg);
}

.nfe-item-fiscal__titulo {
    font-weight: 600;
    font-size: 0.875rem;
}

.nfe-item-fiscal > summary .nfe-item-fiscal-chips {
    margin-top: 0;
}

.nfe-item-fiscal__corpo {
    padding: 0 0.9rem 0.9rem;
    border-top: 1px solid var(--color-border);
    padding-top: 0.9rem;
}

.nfe-pendencias .alert {
    margin-bottom: 1rem;
}

.nfe-pendencias li .btn {
    margin-left: 0.35rem;
    padding: 0 0.5rem;
    min-height: 0;
}

.nfe-itens-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.nfe-itens-foot {
    justify-content: space-between;
}

@media (max-width: 768px) {
    .nfe-status {
        align-items: stretch;
    }

    .nfe-status__texto {
        flex: 1 1 100%;
        line-height: 1.4;
    }

    .nfe-pendencias-fab {
        margin-left: 0;
        flex: 1 1 100%;
    }

    .nfe-pendencias-fab__btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
    }

    .nfe-pendencias-pop {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
        max-height: min(50vh, 360px);
    }

    .nfe-steps {
        gap: 0.35rem;
    }

    .nfe-steps__item {
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 0.2rem;
        padding: 0.4rem 0.15rem;
        min-height: 58px;
        text-align: center;
    }

    .nfe-steps__label--longo {
        display: none;
    }

    .nfe-steps__label--curto {
        display: block;
        font-size: 0.68rem;
    }

    .nfe-kbd,
    .nfe-item-busca__dica {
        display: none;
    }

    .nfe-meta-row,
    #form-nfe .form-grid--col-2,
    #form-nfe .form-grid--col-3,
    .nfe-item-modal .form-grid--col-2,
    .nfe-item-modal .form-grid--col-3,
    .nfe-item-modal .form-grid--col-4 {
        grid-template-columns: 1fr;
    }

    #form-nfe .form-control,
    #modal-item .form-control,
    #modal-novo-cliente-nfe .form-control {
        font-size: 16px;
    }

    .nfe-step-panel .card__body {
        padding: 0.9rem 0.85rem 1rem;
    }

    .nfe-itens-head .btn,
    #btn-novo-cliente {
        width: 100%;
        min-height: 44px;
        justify-content: center;
    }

    .nfe-itens-foot {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }

    #tabela-itens td.col-actions .btn {
        flex: 1 1 0;
        min-height: 44px;
    }

    .nfe-wizard-actions {
        position: sticky;
        bottom: 0;
        z-index: 25;
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        margin-top: 0.75rem;
        padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
        background: var(--color-bg);
    }

    .nfe-wizard-actions__left,
    .nfe-wizard-actions__right {
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
    }

    .nfe-wizard-actions__right {
        order: -1;
    }

    .nfe-wizard-actions .btn,
    .nfe-wizard-actions a.btn {
        width: 100%;
        height: auto;
        min-height: 48px;
        white-space: normal;
    }

    #btn-avancar,
    #btn-emitir {
        order: 1;
    }

    #btn-rascunho {
        order: 2;
    }

    .nfe-wizard-actions a.btn {
        order: 3;
    }

    #modal-item.modal-overlay,
    #modal-novo-cliente-nfe.modal-overlay {
        padding: 0;
        align-items: stretch;
    }

    #modal-item .nfe-item-modal,
    #modal-novo-cliente-nfe .modal-box {
        max-width: none;
        width: 100%;
        height: 100%;
        max-height: 100dvh;
        border-radius: 0;
        border: 0;
        display: flex;
        flex-direction: column;
    }

    #modal-novo-cliente-nfe .modal-box > form {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        min-height: 0;
    }

    #modal-novo-cliente-nfe .modal-box__footer .btn--primary {
        order: -1;
    }

    #modal-item .modal-box__body,
    #modal-novo-cliente-nfe .modal-box__body {
        flex: 1 1 auto;
        min-height: 0;
        overflow: auto;
    }

    #modal-item .modal-box__header .btn,
    #modal-novo-cliente-nfe .modal-box__header .btn {
        min-width: 44px;
        min-height: 44px;
    }

    #modal-item .modal-box__footer,
    #modal-novo-cliente-nfe .modal-box__footer {
        flex-direction: column;
        align-items: stretch;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }

    #modal-item .modal-box__footer .btn,
    #modal-novo-cliente-nfe .modal-box__footer .btn {
        width: 100%;
        min-height: 48px;
    }

    #btn-salvar-item {
        order: -1;
    }

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

    .nfe-item-valores__total {
        grid-column: span 2;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .nfe-item-resultados {
        position: static;
        top: auto;
        max-height: 220px;
        margin-top: 0.35rem;
    }

    .nfe-prod-card {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .nfe-prod-card__info strong {
        white-space: normal;
    }

    .nfe-prod-card .btn {
        width: 100%;
        min-height: 44px;
    }
}

@media (max-width: 899px) {
    #form-nfe {
        padding-bottom: 4.5rem;
    }

    .nfe-emitir-fixed {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 200;
        gap: 0.75rem;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
        background: var(--color-surface);
        border-top: 1px solid var(--color-border);
        box-shadow: 0 -6px 20px rgba(28, 37, 48, 0.12);
    }

    .nfe-wizard {
        width: 100%;
        min-width: 0;
    }

    .nfe-steps {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.35rem;
    }

    .nfe-status__texto {
        flex: 1 1 100%;
    }

    .nfe-pendencias-fab {
        margin-left: 0;
    }

    .nfe-pendencias-pop {
        right: 0;
        left: auto;
        width: min(380px, calc(100vw - 1.5rem));
    }

    .nfe-steps__item {
        padding: 0.45rem 0.4rem;
        min-width: 0;
        gap: 0.35rem;
    }

    .nfe-steps__num {
        width: 1.35rem;
        height: 1.35rem;
        font-size: 0.72rem;
    }

    .nfe-steps__label {
        font-size: 0.68rem;
        line-height: 1.15;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .nfe-meta-row {
        grid-template-columns: 1fr 1fr;
    }

    .nfe-meta-row .form-group:last-child {
        grid-column: 1 / -1;
    }

    #form-nfe .form-grid--col-2,
    #form-nfe .form-grid--col-3 {
        grid-template-columns: 1fr;
    }

    #form-nfe .form-group--span-2 {
        grid-column: auto;
    }

    .nfe-step-panel .card__body {
        padding: 0.85rem;
    }

    .nfe-wizard-actions {
        position: sticky;
        bottom: 0;
        z-index: 30;
        margin-top: 1rem;
        padding: 0.75rem 0 calc(0.75rem + env(safe-area-inset-bottom));
        background: var(--color-bg, #f4f6f8);
        border-top: 1px solid var(--color-border);
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nfe-wizard-actions__left,
    .nfe-wizard-actions__right {
        gap: 0.5rem;
    }

    .nfe-wizard-actions__right {
        margin-left: auto;
        min-width: 0;
    }

    .nfe-wizard-actions .btn,
    .nfe-wizard-actions a.btn {
        height: 44px;
        min-height: 44px;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        flex: 0 1 auto;
    }

    .modal-box--wide {
        max-width: 100%;
        max-height: min(92vh, 100dvh);
        overflow: auto;
        margin: 0.5rem;
        border-radius: 12px;
    }

    .nfe-modal-tabs {
        gap: 0;
    }

    .nfe-modal-tabs__btn {
        flex: 1 1 0;
        text-align: center;
        padding: 0.7rem 0.4rem;
        font-size: 0.8rem;
    }

    .nfe-emitir-fixed__total {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .nfe-emitir-fixed__total span {
        font-size: 11px;
        color: var(--color-text-muted);
        text-transform: uppercase;
        letter-spacing: 0.04em;
    }

    .nfe-emitir-fixed__total strong {
        font-size: 1.15rem;
        color: var(--color-primary);
    }

    .nfe-emitir-fixed .btn {
        flex: 0 0 auto;
        min-height: 44px;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }

    #form-nfe .venda-resumo__actions #btn-emitir {
        display: none;
    }

    .venda-topbar__total-valor {
        font-size: 1.4rem;
    }
    .venda-busca-rapida__hints {
        display: none;
    }
    .venda-item {
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 0.5rem;
        position: relative;
        padding-right: 2.5rem;
    }
    .venda-item__qtd {
        grid-column: 1;
        grid-row: 2;
    }
    .venda-item__preco {
        grid-row: 1 / 3;
        grid-column: 2;
    }
    .venda-item__actions {
        position: absolute;
        right: 0.5rem;
        top: 0.5rem;
    }

    .page-bar__actions .btn--primary {
        flex: 1 1 100%;
        min-height: var(--touch-min);
        font-size: 0.95rem;
    }
}

/* Lista vazia mais amigï¿½vel */
.table--cards td[colspan] {
    font-size: 0.95rem;
}

/* ========== PDV — Ponto de Venda ========== */
:root {
    --pdv-min-width: 1024px;
}

.pdv-tela-pequena {
    display: none;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    min-height: 0;
}

.pdv-tela-pequena[hidden] {
    display: none !important;
}

.pdv-tela-pequena__card {
    width: min(100%, 440px);
    text-align: center;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    padding: 2rem 1.5rem 1.75rem;
    box-shadow: 0 16px 40px rgba(22, 58, 95, 0.1);
}

.pdv-tela-pequena__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    color: var(--color-primary, #1c2530);
}

.pdv-tela-pequena__titulo {
    margin: 0 0 0.65rem;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

.pdv-tela-pequena__texto {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--color-text-mid);
}

.pdv-tela-pequena__meta {
    margin: 0 0 1.25rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.pdv-tela-pequena__acoes {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    width: 100%;
}

.pdv-tela-pequena__btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 0.85rem 1.1rem;
    box-shadow: 0 6px 16px rgba(22, 58, 95, 0.12);
}

.pdv-tela-pequena__btn svg {
    flex-shrink: 0;
}

.pdv-tela-pequena__btn--sec {
    box-shadow: none;
    background: #F2F4F7;
    border: 1px solid rgba(213, 220, 229, 0.95);
    color: var(--color-text-mid, #475569);
}

.pdv-tela-pequena__btn--sec:hover {
    background: #E8ECF1;
    color: var(--color-text, #1c2530);
    border-color: rgba(22, 58, 95, 0.18);
}

/* Trava o scroll da página só em monitores com largura mínima */
@media (min-width: 1024px) {
    html.pdv-page,
    html.pdv-page body {
        overflow: hidden !important;
        height: 100%;
    }

    html.pdv-page .main,
    body.pdv-page .main {
        overflow: hidden !important;
    }

    html.pdv-page .page-content,
    body.pdv-page .page-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }
}

html.pdv-page .page-bar,
body.pdv-page .page-bar {
    flex-shrink: 0;
    margin-bottom: 0;
    padding-bottom: 0.65rem;
}

.pdv-shell {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

.pdv-shell--sucesso .pdv-wrap {
    display: none !important;
    visibility: hidden;
    pointer-events: none;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pdv-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    grid-template-rows: minmax(0, 1fr);
    gap: 1.25rem;
    height: 100%;
    max-height: 100%;
    position: relative;
    align-items: stretch;
    overflow: hidden;
}

.pdv-wrap[hidden] {
    display: none !important;
}

.pdv-esquerda {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow-y: auto;
    padding-right: 0.15rem;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

.pdv-direita {
    min-height: 0;
}

.pdv-painel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(213, 220, 229, 0.9);
    border-radius: 18px;
    padding: 1.1rem 1.15rem 1.15rem;
    box-shadow: 0 10px 30px rgba(22, 58, 95, 0.06);
    position: sticky;
    top: 0;
    max-height: 100%;
    overflow-y: auto;
}

.pdv-busca__input-wrap {
    position: relative;
}

.pdv-busca__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--color-text-muted);
    pointer-events: none;
}

.pdv-input-busca {
    width: 100%;
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.01em;
    padding: 0.95rem 1rem 0.95rem 2.85rem;
    border: 1px solid transparent;
    border-radius: 16px;
    background: #F2F4F7;
    box-shadow: inset 0 0 0 1px rgba(22, 58, 95, 0.04);
    transition: background 0.15s ease, box-shadow 0.15s ease;
}

.pdv-input-busca:focus {
    background: #fff;
    border-color: transparent;
    box-shadow: 0 0 0 4px rgba(22, 58, 95, 0.14), 0 8px 24px rgba(22, 58, 95, 0.08);
    outline: none;
}

.pdv-input-soft {
    border-radius: 12px;
    background: #F2F4F7;
    border: 1px solid transparent;
}

.pdv-input-soft:focus {
    background: #fff;
    box-shadow: 0 0 0 3px rgba(22, 58, 95, 0.12);
}

.pdv-atalhos {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.75rem;
    margin-top: 0.55rem;
}

.pdv-atalho {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 12px;
    color: var(--color-text-muted);
}

.pdv-kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    padding: 0.12rem 0.4rem;
    border-radius: 6px;
    border: 1px solid rgba(22, 58, 95, 0.14);
    background: linear-gradient(180deg, #fff 0%, #F3F5F8 100%);
    box-shadow: 0 1px 0 rgba(22, 58, 95, 0.08);
    font-family: var(--font-main);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-text-mid);
}

.pdv-kbd--on-dark {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
    color: #fff;
    box-shadow: none;
}

.pdv-busca__hint {
    margin: 0.4rem 0 0;
    font-size: 12px;
    color: var(--color-text-muted);
}

.pdv-sugestoes {
    position: absolute;
    z-index: 500;
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(22, 58, 95, 0.14);
    max-height: 300px;
    overflow-y: auto;
    width: 100%;
    top: calc(100% + 6px);
    left: 0;
    padding: 0.35rem;
}

.pdv-sugestao-item {
    padding: 0.75rem 0.85rem;
    cursor: pointer;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.pdv-sugestao-item:hover,
.pdv-sugestao-item:active {
    background: var(--color-primary-soft);
}

.pdv-sugestao-item--empty {
    cursor: default;
    color: var(--color-text-muted);
    justify-content: center;
}

.pdv-sugestao-item__meta {
    text-align: right;
    flex-shrink: 0;
}

.pdv-stock {
    display: inline-block;
    margin-top: 0.15rem;
    font-size: 11px;
    color: var(--color-text-muted);
}

.pdv-itens-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.15rem 0.15rem 0;
}

.pdv-itens-header__titulo {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.pdv-itens-header__count {
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    border-radius: 999px;
    background: var(--color-primary-soft);
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pdv-itens {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding-bottom: 0.5rem;
}

.pdv-empty {
    text-align: center;
    padding: 2.5rem 1.25rem;
    border-radius: 18px;
    background: linear-gradient(180deg, #F7F9FB 0%, #EEF2F6 100%);
    border: 1px dashed rgba(22, 58, 95, 0.12);
}

.pdv-empty__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    border-radius: 14px;
    background: #fff;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 14px rgba(22, 58, 95, 0.08);
}

.pdv-empty__titulo {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--color-text);
}

.pdv-empty__texto {
    margin: 0.35rem 0 0;
    font-size: 13px;
    color: var(--color-text-muted);
}

.pdv-item-card {
    background: #fff;
    border: 1px solid rgba(213, 220, 229, 0.95);
    border-radius: 14px;
    padding: 0.85rem 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pdv-item-card--novo {
    animation: pdv-item-in 0.35s ease;
    background: #F4F8FC;
    box-shadow: 0 0 0 2px rgba(22, 58, 95, 0.08);
}

@keyframes pdv-item-in {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.pdv-item-info {
    flex: 1;
    min-width: 0;
}

.pdv-item-nome {
    font-weight: 700;
    font-size: 14px;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text);
}

.pdv-item-codigo,
.pdv-item-meta {
    font-size: 12px;
    color: var(--color-text-muted);
}

.pdv-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.4rem;
    margin-top: 0.15rem;
}

.pdv-qtd-controles {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
    background: #F2F4F7;
    border-radius: 999px;
    padding: 0.15rem;
}

.pdv-btn-qtd {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary);
    box-shadow: 0 1px 2px rgba(22, 58, 95, 0.08);
    transition: background 0.12s ease, color 0.12s ease, transform 0.12s ease;
}

.pdv-btn-qtd:hover {
    background: var(--color-primary-soft);
}

.pdv-btn-qtd:active {
    background: var(--color-primary);
    color: #fff;
    transform: scale(0.96);
}

.pdv-qtd-valor {
    min-width: 34px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    padding: 0.2rem 0.25rem;
    color: var(--color-text);
}

.pdv-qtd-input {
    width: 52px;
    text-align: center;
    font-size: 15px;
    font-weight: 700;
    padding: 0.25rem;
    border-radius: 8px;
}

.pdv-item-total {
    font-weight: 800;
    font-size: 15px;
    letter-spacing: -0.02em;
    color: var(--color-primary);
    flex-shrink: 0;
    min-width: 76px;
    text-align: right;
}

.pdv-btn-remover {
    color: var(--color-text-muted);
    border: none;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0.2rem 0.35rem;
    border-radius: 8px;
    flex-shrink: 0;
    transition: background 0.12s ease, color 0.12s ease;
}

.pdv-btn-remover:hover {
    background: var(--color-error-bg);
    color: var(--color-error);
}

.pdv-label-opcional {
    font-weight: 500;
    color: var(--color-text-muted);
    text-transform: lowercase;
}

.pdv-totais__linha {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    font-size: 13px;
    color: var(--color-text-mid);
}

.pdv-ajustes {
    margin: 0.55rem 0;
    border-radius: 12px;
    background: #F7F9FB;
    border: 1px solid rgba(213, 220, 229, 0.8);
}

.pdv-ajustes__summary {
    list-style: none;
    cursor: pointer;
    padding: 0.7rem 0.85rem;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-mid);
    user-select: none;
}

.pdv-ajustes__summary::-webkit-details-marker {
    display: none;
}

.pdv-ajustes__summary::after {
    content: '›';
    float: right;
    transform: rotate(90deg);
    color: var(--color-text-muted);
}

.pdv-ajustes[open] .pdv-ajustes__summary::after {
    transform: rotate(-90deg);
}

.pdv-ajustes__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    padding: 0 0.85rem 0.85rem;
}

.pdv-ajustes__body .form-group {
    margin: 0;
}

.pdv-painel-extra {
    margin: 0;
}

.pdv-painel-extra__body {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 0 0.85rem 0.85rem;
}

.pdv-ajustes-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.pdv-ajustes-grid .form-group {
    margin: 0;
}

.pdv-totais--resumo {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pdv-totais--resumo .pdv-totais__total {
    margin-top: 0;
    padding-top: 0.55rem;
}

.pdv-totais__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    margin-top: 0.35rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(213, 220, 229, 0.9);
}

.pdv-totais__total-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pdv-total-grande {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-primary);
    text-align: right;
    line-height: 1;
}

.pdv-pagamento {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.pdv-pagamento__topo {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.pdv-pagamento__topo .form-label {
    margin: 0;
}

.pdv-pagamento__atalho {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.pdv-pagamento__vazio {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-mid);
}

.pdv-formas-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.pdv-forma-btn__nome {
    line-height: 1.2;
}

.pdv-forma-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.12rem;
    padding: 0.65rem 0.55rem;
    min-height: 52px;
    border: 1px solid rgba(213, 220, 229, 0.95);
    background: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    width: 100%;
    color: var(--color-text-mid);
    transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.pdv-forma-btn__tipo {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.pdv-forma-btn:hover {
    background: #F7F9FB;
}

.pdv-forma-btn--ativa {
    border-color: var(--color-primary);
    background: var(--color-primary-soft);
    color: var(--color-primary);
    box-shadow: inset 0 0 0 1px rgba(22, 58, 95, 0.08);
}

.pdv-forma-btn--ativa .pdv-forma-btn__tipo {
    color: var(--color-primary);
}

.pdv-forma-btn--prazo.pdv-forma-btn--ativa {
    border-color: #c2410c;
    background: #fff7ed;
    color: #9a3412;
    box-shadow: inset 0 0 0 1px rgba(194, 65, 12, 0.12);
}

.pdv-forma-btn--prazo.pdv-forma-btn--ativa .pdv-forma-btn__tipo {
    color: #c2410c;
}

.pdv-btn-finalizar {
    width: 100%;
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    background: linear-gradient(180deg, var(--color-primary-lt) 0%, var(--color-primary) 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(22, 58, 95, 0.22);
    transition: transform 0.12s ease, filter 0.12s ease;
}

.pdv-btn-finalizar:hover {
    filter: brightness(1.05);
}

.pdv-btn-finalizar:active {
    transform: scale(0.985);
}

.pdv-btn-finalizar:disabled {
    opacity: 0.65;
    cursor: wait;
}

.pdv-btn-finalizar__textos {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.pdv-btn-finalizar__label {
    font-size: 0.95rem;
    font-weight: 700;
}

.pdv-btn-finalizar__forma {
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    opacity: 0.85;
}

.pdv-btn-finalizar__valor {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-left: auto;
}

.pdv-btn-finalizar__kbd {
    margin-left: 0.15rem;
}

/* PDV: resumo lateral e tela de pagamento (F4) */
.pdv-resumo-forma {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 13px;
}

.pdv-resumo-forma strong {
    color: var(--color-primary);
    text-align: right;
}

.pdv-link-atalhos {
    align-self: center;
    border: none;
    background: none;
    padding: 0.25rem;
    font-size: 12px;
    color: var(--color-text-muted);
    cursor: pointer;
}

.pdv-link-atalhos:hover {
    color: var(--color-primary);
}

.pdv-pag-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(21, 34, 50, 0.55);
    backdrop-filter: blur(3px);
}

.pdv-pag-overlay[hidden] {
    display: none !important;
}

.pdv-pag {
    display: flex;
    flex-direction: column;
    width: min(960px, 100%);
    max-height: calc(100vh - 2.5rem);
    overflow: auto;
    background: var(--color-surface);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(21, 34, 50, 0.35);
}

.pdv-pag--ajuda {
    width: min(620px, 100%);
}

.pdv-pag__header,
.pdv-pag__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
}

.pdv-pag__header {
    border-bottom: 1px solid var(--color-border);
}

.pdv-pag__footer {
    border-top: 1px solid var(--color-border);
}

.pdv-pag__titulo {
    margin: 0;
    font-size: 1.15rem;
}

.pdv-pag__corpo {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.25rem;
}

.pdv-pag__formas,
.pdv-pag__valores {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.pdv-formas-lista {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.pdv-formas-lista .pdv-forma-btn {
    position: relative;
    min-height: 64px;
    font-size: 14px;
}

.pdv-forma-btn__tecla {
    position: absolute;
    top: 6px;
    left: 6px;
}

.pdv-pag__valores .pdv-total-grande {
    font-size: 2.4rem;
}

.pdv-pag__recebido {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: end;
    padding: 0.85rem;
    border-radius: 12px;
    background: var(--color-bg);
}

.pdv-pag__recebido[hidden] {
    display: none;
}

.pdv-pag__recebido .form-group {
    margin: 0;
}

.pdv-input-recebido {
    font-size: 1.35rem;
    font-weight: 700;
}

.pdv-pag__troco {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.pdv-pag__troco span {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
}

.pdv-pag__troco strong {
    font-size: 1.6rem;
    color: var(--color-success);
}

.pdv-pag__troco strong.pdv-pag__troco--falta {
    font-size: 1.05rem;
    color: var(--color-error);
}

.pdv-pag__cliente {
    margin: 0;
    font-size: 13px;
    color: var(--color-text-mid);
}

.pdv-pag__aviso {
    margin: 0;
    padding: 0.6rem 0.75rem;
    border-radius: 10px;
    font-size: 13px;
    background: var(--color-warning-bg);
    color: var(--color-warning);
}

.pdv-pag__aviso[hidden] {
    display: none;
}

.pdv-pag__confirmar {
    width: auto;
    min-width: 320px;
}

.pdv-ajuda-lista {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.55rem 1rem;
    margin: 0;
    padding: 1.25rem;
    font-size: 14px;
}

.pdv-ajuda-lista dt {
    white-space: nowrap;
}

.pdv-ajuda-lista dd {
    margin: 0;
    color: var(--color-text-mid);
}

.pdv-sucesso__troco {
    margin: 0.25rem 0 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-success);
}

.pdv-sucesso__troco[hidden] {
    display: none;
}

.pdv-sucesso__nfce {
    margin: 0.75rem 0 0;
    max-width: 28rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.pdv-sucesso__nfce--erro {
    color: var(--color-danger, #b42318);
}

.pdv-sucesso__nfce[hidden],
#pdv-link-nfce[hidden] {
    display: none;
}

@media (max-width: 1100px) {
    .pdv-pag__corpo {
        grid-template-columns: minmax(0, 1fr);
    }

    .pdv-pag__confirmar {
        min-width: 0;
        flex: 1;
    }
}

.pdv-sucesso {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 40;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
    overscroll-behavior: none;
    background:
        radial-gradient(circle at 50% 30%, rgba(31, 111, 59, 0.08) 0%, transparent 55%),
        rgba(247, 249, 251, 0.96);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    text-align: center;
}

.pdv-sucesso[hidden] {
    display: none !important;
}

.pdv-shell--sucesso .pdv-sucesso {
    display: flex;
    animation: pdv-sucesso-fade 0.3s ease both;
}

html.pdv-page body.pdv-sucesso-ativo,
body.pdv-page.pdv-sucesso-ativo {
    overflow: hidden !important;
}

html.pdv-page body.pdv-sucesso-ativo .main,
body.pdv-page.pdv-sucesso-ativo .main {
    overflow: hidden !important;
}

.pdv-sucesso__card {
    width: min(100%, 420px);
    max-height: calc(100% - 0.5rem);
    overflow: auto;
    padding: 2.25rem 1.75rem 1.85rem;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(213, 220, 229, 0.9);
    box-shadow: 0 24px 60px rgba(22, 58, 95, 0.12);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    animation: pdv-sucesso-card 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pdv-sucesso__ring {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--color-success-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    animation: pdv-sucesso-pop 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pdv-sucesso__icone {
    width: 56px;
    height: 56px;
}

.pdv-sucesso__circle {
    stroke: var(--color-success);
    stroke-width: 2.2;
    stroke-dasharray: 160;
    stroke-dashoffset: 160;
    animation: pdv-sucesso-circle 0.55s ease forwards 0.1s;
}

.pdv-sucesso__check {
    stroke: var(--color-success);
    stroke-width: 3.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: pdv-sucesso-check 0.4s ease forwards 0.45s;
}

.pdv-sucesso__badge {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-success);
    opacity: 0;
    animation: pdv-sucesso-up 0.35s ease forwards 0.55s;
}

.pdv-sucesso__titulo {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    opacity: 0;
    animation: pdv-sucesso-up 0.4s ease forwards 0.62s;
}

.pdv-sucesso__valor {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-primary);
    margin: 0.15rem 0 0;
    opacity: 0;
    animation: pdv-sucesso-up 0.4s ease forwards 0.7s;
}

.pdv-sucesso__numero {
    margin: 0;
    color: var(--color-text-muted);
    font-size: 14px;
    opacity: 0;
    animation: pdv-sucesso-up 0.4s ease forwards 0.78s;
}

.pdv-sucesso__acoes {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
    opacity: 0;
    animation: pdv-sucesso-up 0.4s ease forwards 0.88s;
}

.pdv-sucesso__btn {
    min-height: 48px;
    min-width: 140px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

@keyframes pdv-sucesso-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pdv-sucesso-card {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pdv-sucesso-pop {
    0% { transform: scale(0.7); opacity: 0; }
    70% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes pdv-sucesso-circle {
    to { stroke-dashoffset: 0; }
}

@keyframes pdv-sucesso-check {
    to { stroke-dashoffset: 0; }
}

@keyframes pdv-sucesso-up {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pdv-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--footer-h) + 14px);
    transform: translateX(-50%) translateY(10px);
    background: rgba(21, 34, 50, 0.94);
    color: #fff;
    padding: 0.75rem 1.2rem;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    z-index: 10050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: min(90vw, 360px);
    text-align: center;
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.pdv-toast--visivel {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pdv-sugestao-item--ativa {
    background: var(--color-primary-soft);
    box-shadow: inset 3px 0 0 var(--color-accent);
}

@media (max-width: 899px) {
    /* Layout estático (como as outras telas) para o menu lateral
       competir no stacking root e não ficar atrás do overlay. */
    html.pdv-page .layout,
    body.pdv-page .layout {
        position: static;
        margin-top: var(--header-h);
        height: calc(100dvh - var(--header-h));
        max-height: calc(100dvh - var(--header-h));
        min-height: 0;
        overflow: hidden;
        padding-bottom: 0;
        display: flex;
        flex-direction: column;
    }

    html.pdv-page .main,
    body.pdv-page .main {
        overflow: hidden !important;
        flex: 1 1 auto;
        height: auto;
        max-height: 100%;
        min-height: 0;
        padding-bottom: 0.5rem;
        display: flex;
        flex-direction: column;
    }

    html.pdv-page .page-content,
    body.pdv-page .page-content {
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
    }

    .pdv-shell {
        height: 100%;
        min-height: 0;
        max-height: 100%;
        display: flex;
        flex-direction: column;
    }

    .pdv-wrap {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
        padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        gap: 0.75rem;
    }

    .pdv-shell--sucesso .pdv-wrap {
        padding-bottom: 0 !important;
    }

    .pdv-sucesso {
        position: absolute;
        inset: 0;
        z-index: 350;
        overflow: hidden;
    }

    .pdv-esquerda {
        order: 1;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-right: 0;
    }

    .pdv-direita {
        order: 2;
        flex: 0 0 auto;
        max-height: none;
    }

    .pdv-painel {
        position: static;
        max-height: none;
        padding: 0.85rem 0.9rem calc(5.75rem + env(safe-area-inset-bottom, 0px));
        border-radius: 14px;
        gap: 0.75rem;
    }

    .pdv-itens {
        min-height: 8rem;
    }

    .pdv-btn-finalizar-fixed {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 0.75rem 0.9rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
        background: rgba(255, 255, 255, 0.96);
        border-top: 1px solid rgba(213, 220, 229, 0.95);
        box-shadow: 0 -8px 24px rgba(22, 58, 95, 0.08);
        backdrop-filter: blur(12px);
        z-index: 300;
    }

    body.sidebar-open .pdv-btn-finalizar-fixed {
        z-index: 1;
        pointer-events: none;
    }

    .pdv-painel-extra {
        margin-top: 0.15rem;
    }

    .pdv-totais--resumo .pdv-total-grande {
        font-size: 1.45rem;
    }

    .pdv-input-busca {
        font-size: 16px;
        min-height: 54px;
        border-radius: 14px;
    }

    .pdv-btn-qtd {
        width: 40px;
        height: 40px;
    }

    .pdv-item-card {
        flex-wrap: wrap;
        padding: 0.9rem;
        gap: 0.65rem;
    }

    .pdv-item-info {
        flex: 1 1 calc(100% - 2.5rem);
        order: 1;
    }

    .pdv-btn-remover {
        order: 2;
        margin-left: auto;
    }

    .pdv-qtd-controles {
        order: 3;
    }

    .pdv-item-total {
        order: 4;
        margin-left: auto;
        font-size: 1.05rem;
    }

    .pdv-forma-btn {
        min-height: 52px;
        font-size: 13px;
    }

    .pdv-total-grande {
        font-size: 1.75rem;
    }

    .pdv-sucesso__valor {
        font-size: 1.7rem;
    }

    .pdv-atalho--desktop {
        display: none;
    }

    .pdv-toast {
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }

    .pdv-busca__hint {
        display: none;
    }
}

@media (min-width: 900px) {
    .pdv-direita {
        position: sticky;
        top: 0;
        align-self: start;
    }

    .pdv-painel-extra > .pdv-ajustes__summary {
        pointer-events: none;
    }

    .pdv-painel-extra > .pdv-ajustes__summary::after {
        display: none;
    }
}

@media (max-width: 479px) {
    .pdv-ajustes__body,
    .pdv-ajustes-grid {
        grid-template-columns: 1fr;
    }

    .pdv-btn-finalizar__kbd {
        display: none;
    }
}

/* PDV bloqueado em telas menores que monitor de computador */
@media (max-width: 1023px) {
    html.pdv-page .pdv-wrap,
    body.pdv-page .pdv-wrap,
    .pdv-wrap {
        display: none !important;
    }

    html.pdv-page .pdv-toast,
    body.pdv-page .pdv-toast,
    .pdv-toast {
        display: none !important;
    }

    .pdv-btn-finalizar-fixed {
        display: none !important;
    }

    .pdv-tela-pequena,
    .pdv-tela-pequena[hidden] {
        display: flex !important;
    }

    html.pdv-page,
    html.pdv-page body,
    body.pdv-page {
        overflow: auto !important;
        height: auto !important;
        min-height: 100%;
    }

    html.pdv-page .layout,
    body.pdv-page .layout {
        position: static !important;
        height: auto !important;
        max-height: none !important;
        min-height: calc(100dvh - var(--header-h));
        overflow: visible !important;
        margin-top: var(--header-h);
        padding-bottom: 0;
        display: block !important;
    }

    html.pdv-page .main,
    body.pdv-page .main {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
        display: block !important;
    }

    html.pdv-page .page-content,
    body.pdv-page .page-content {
        overflow: visible !important;
        height: auto !important;
        display: block !important;
    }

    .pdv-shell {
        display: flex !important;
        flex-direction: column;
        height: auto !important;
        max-height: none !important;
        min-height: calc(100dvh - var(--header-h) - 5.5rem);
        overflow: visible !important;
    }
}

/* Atalho de teclado: some da tela ate receber foco */
.skip-link {
    position: absolute;
    left: 0.75rem;
    top: -3.5rem;
    z-index: 3000;
    padding: 0.55rem 0.8rem;
    background: #fff;
    color: var(--color-primary);
    border-radius: var(--radius-md);
    font-weight: 600;
    box-shadow: var(--shadow-md);
}

.skip-link:focus {
    top: 0.55rem;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: 40px;
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    cursor: pointer;
}

.form-check input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--color-primary);
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .form-grid--col-2,
    .form-grid--col-3,
    .form-grid--col-4 {
        grid-template-columns: 1fr;
    }

    .form-group--span-2,
    .form-group--span-3,
    .form-group--full {
        grid-column: auto;
    }

    .kpi-card__value {
        font-size: 1.35rem;
    }
}
