:root {
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-sidebar: #0b1220;
    --text: #e2e8f0;
    --muted: #94a3b8;
    --accent: #c87533;
    --accent-light: #e8a04a;
    --border: #334155;
    --danger: #f87171;
    --success: #4ade80;
    --radius: 8px;
    --font: "Segoe UI", system-ui, sans-serif;
    /* Modal variants (contextual accent) */
    --modal-neutral-accent: #94a3b8;
    --modal-info-accent: #38bdf8;
    --modal-payment-accent: #2dd4bf;
    --modal-success-accent: #4ade80;
    --modal-fiscal-accent: #60a5fa;
    --modal-print-accent: #e8a04a;
    --modal-warning-accent: #fbbf24;
    --modal-danger-accent: #f87171;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

a { color: var(--accent-light); }

/* Login */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: radial-gradient(circle at top, #1e293b 0%, var(--bg) 60%);
}
.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.login-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 900px;
    width: 100%;
}
@media (max-width: 768px) {
    .login-wrap { grid-template-columns: 1fr; }
}
.login-brand { padding: 2rem 1rem; }
.login-logo {
    width: 96px;
    height: 96px;
    border-radius: 22px;
    display: block;
    object-fit: cover;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.login-brand h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent-light);
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-brand p {
    margin: 0;
    color: var(--accent-light);
    opacity: 0.92;
}
.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}
.login-card h2 {
    margin: 0 0 1.25rem;
    font-size: 1.1rem;
    color: var(--accent-light);
}
.demo-hint { margin-top: 1rem; font-size: 0.85rem; }
.brand-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--muted);
    line-height: 1.6;
    padding: 0.75rem 1.5rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
}
.brand-footer p { margin: 0.15rem 0; }
.brand-footer--login {
    border-top: 0;
    background: transparent;
    padding: 1rem 1.5rem 0;
}

/* Shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    flex-shrink: 0;
    transition: width 0.2s ease, opacity 0.2s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
.sidebar-brand__name {
    line-height: 1.2;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent-light);
    background: linear-gradient(135deg, var(--accent-light), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sidebar-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: block;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.sidebar-nav { padding: 0.75rem 0; }
.sidebar-link {
    display: block;
    padding: 0.65rem 1rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.95rem;
}
.sidebar-link:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.sidebar-link.is-active {
    color: var(--accent-light);
    border-left: 3px solid var(--accent);
    background: rgba(200,117,51,0.08);
}
.sidebar-link.is-disabled { opacity: 0.45; pointer-events: none; }

body.sidebar-collapsed .sidebar {
    width: 0;
    min-width: 0;
    overflow: hidden;
    border-right-width: 0;
    opacity: 0;
    pointer-events: none;
}
body.sidebar-collapsed .sidebar-brand,
body.sidebar-collapsed .sidebar-nav {
    visibility: hidden;
}

.main-wrap { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    flex: 1;
}
.topbar-user {
    margin-left: 0.35rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.topbar-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.topbar-toggle__icon {
    font-size: 1rem;
    line-height: 1;
}
body.fullscreen-mode .topbar {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}
@media (max-width: 640px) {
    .topbar-toggle__label { display: none; }
    .topbar { padding: 0.5rem 0.75rem; }
}
.main-content { padding: 1.5rem; flex: 1; }

/* Components */
.page-header h1 { margin: 0 0 0.25rem; }
.text-muted { color: var(--muted); }
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.card h2 { margin: 0 0 1rem; font-size: 1.1rem; }

/* Banner do prestador NFS-e (todas as telas do módulo) */
.card.nfse-prestador-banner {
    margin-bottom: 1rem;
    padding: 1rem 1.25rem 1.1rem;
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent-light);
    background: linear-gradient(135deg, #1a2744 0%, var(--bg-card) 55%, #172033 100%);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
    color: #e2e8f0;
}
.card.nfse-prestador-banner .nfse-prestador-banner__label {
    margin: 0 0 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-light);
}
.card.nfse-prestador-banner .nfse-prestador-banner__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.45;
    color: #f8fafc;
}
.card.nfse-prestador-banner .nfse-prestador-banner__meta {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.12rem 0.5rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: #cbd5e1;
    background: rgba(15, 23, 42, 0.55);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 4px;
    vertical-align: middle;
}
.card.nfse-prestador-banner .nfse-prestador-banner__meta + .nfse-prestador-banner__meta {
    margin-left: 0.35rem;
}
.card.nfse-prestador-banner .nfse-prestador-banner__hint {
    margin: 0.65rem 0 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--muted);
}
.card.nfse-prestador-banner .nfse-prestador-banner__hint strong {
    color: #e2e8f0;
    font-weight: 600;
}
.card.nfse-prestador-banner .nfse-prestador-banner__hint a {
    color: var(--accent-light);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.card.nfse-prestador-banner .nfse-prestador-banner__hint a:hover {
    color: #f5c882;
}
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}
.kpi-card--muted { opacity: 0.85; }
.kpi-label { display: block; color: var(--muted); font-size: 0.85rem; }
.kpi-value { display: block; font-size: 1.5rem; margin: 0.35rem 0; color: var(--accent-light); }
.kpi-meta { font-size: 0.8rem; color: var(--muted); }
.checklist { margin: 0; padding-left: 1.25rem; }
.checklist li { margin-bottom: 0.35rem; }

.form-grid { display: flex; flex-direction: column; gap: 1rem; }
.form-row label { display: block; margin-bottom: 0.35rem; font-size: 0.9rem; color: var(--muted); }
.btn {
    display: inline-block;
    padding: 0.55rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    text-decoration: none;
    text-align: center;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #0f172a; font-weight: 600; }
.btn-secondary { background: var(--border); color: var(--text); }
.btn-danger { background: var(--danger, #dc2626); color: #fff; font-weight: 600; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1rem; }
.alert-danger { background: rgba(248,113,113,0.15); border: 1px solid var(--danger); color: #fecaca; }
.alert-success { background: rgba(74,222,128,0.12); border: 1px solid var(--success); color: #bbf7d0; }
.alert-warning { background: rgba(232,160,74,0.12); border: 1px solid var(--accent); color: #fde68a; }
.alert-info { background: rgba(56,189,248,0.12); border: 1px solid #38bdf8; color: #e0f2fe; }

.license-page-header { margin-bottom: 0.75rem; }
.license-alerts { display: flex; flex-direction: column; gap: 0.65rem; margin-bottom: 1rem; }
.license-alert {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid transparent;
}
.license-alert__title { display: block; font-size: 0.95rem; margin-bottom: 0.15rem; }
.license-alert__message { margin: 0; font-size: 0.88rem; opacity: 0.92; }
.license-alert__action { flex-shrink: 0; }
.license-alert--danger {
    background: rgba(248, 113, 113, 0.14);
    border-color: rgba(248, 113, 113, 0.55);
    color: #fecaca;
}
.license-alert--warning {
    background: rgba(251, 191, 36, 0.12);
    border-color: rgba(251, 191, 36, 0.45);
    color: #fde68a;
}
.license-alert--info {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
    color: #e0f2fe;
}
.license-alert--neutral {
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.35);
    color: #e2e8f0;
}
.license-alert--danger .license-alert__action { background: rgba(248, 113, 113, 0.25); color: #fff; border-color: transparent; }
.license-alert--warning .license-alert__action { background: rgba(251, 191, 36, 0.22); color: #0f172a; border-color: transparent; }
.license-alert--info .license-alert__action { background: rgba(56, 189, 248, 0.22); color: #0f172a; border-color: transparent; }

.license-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.license-kpi {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.license-kpi:hover { border-color: var(--accent); }
.license-kpi.is-active { box-shadow: 0 0 0 2px rgba(232, 160, 74, 0.35); }
.license-kpi__label { display: block; font-size: 0.82rem; color: var(--muted); }
.license-kpi__value { display: block; font-size: 1.55rem; font-weight: 700; margin: 0.25rem 0; }
.license-kpi__meta { font-size: 0.75rem; color: var(--muted); }
.license-kpi--ok { border-left: 4px solid #4ade80; }
.license-kpi--warning { border-left: 4px solid #fbbf24; }
.license-kpi--danger { border-left: 4px solid #f87171; }
.license-kpi--info { border-left: 4px solid #38bdf8; }
.license-kpi--neutral { border-left: 4px solid var(--muted); }

.license-legend { margin-bottom: 1rem; padding: 0.85rem 1rem; }
.license-legend__title { margin: 0 0 0.5rem; font-size: 0.95rem; }
.license-legend__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.85rem;
    color: var(--muted);
}
.license-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}
.license-badge--ok { background: rgba(74, 222, 128, 0.15); color: #bbf7d0; border-color: rgba(74, 222, 128, 0.35); }
.license-badge--notice { background: rgba(56, 189, 248, 0.15); color: #bae6fd; border-color: rgba(56, 189, 248, 0.35); }
.license-badge--warning { background: rgba(251, 191, 36, 0.15); color: #fde68a; border-color: rgba(251, 191, 36, 0.4); }
.license-badge--critical { background: rgba(251, 146, 60, 0.18); color: #fed7aa; border-color: rgba(251, 146, 60, 0.45); }
.license-badge--expired { background: rgba(248, 113, 113, 0.18); color: #fecaca; border-color: rgba(248, 113, 113, 0.45); }
.license-badge--inactive { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.3); }

.license-grid-2 { align-items: start; }
.license-help summary { cursor: pointer; list-style: none; }
.license-help summary::-webkit-details-marker { display: none; }
.license-help summary h2 { display: inline; margin: 0; }
.license-help .help-list { margin-top: 0.75rem; }

.license-table-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0;
}
.license-table-card__head h2 { margin: 0; }
.license-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.license-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 0.82rem;
    text-decoration: none;
    color: var(--muted);
}
.license-filter:hover { color: var(--text); border-color: var(--accent); }
.license-filter.is-active {
    background: rgba(232, 160, 74, 0.18);
    border-color: var(--accent);
    color: var(--accent-light);
}
.license-filter__count {
    min-width: 1.25rem;
    text-align: center;
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.2);
    font-size: 0.75rem;
}

.license-row--expired td:first-child { box-shadow: inset 4px 0 0 #f87171; }
.license-row--critical td:first-child { box-shadow: inset 4px 0 0 #fb923c; }
.license-row--warning td:first-child { box-shadow: inset 4px 0 0 #fbbf24; }
.license-row--notice td:first-child { box-shadow: inset 4px 0 0 #38bdf8; }

.license-actions__group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
}
.license-install-card { margin-top: 1rem; }
.license-revoked-details { padding: 0 1rem 1rem; }
.license-revoked-details summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
}
.license-table--muted { opacity: 0.85; }

.license-main-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.35rem;
}
.license-main-tab {
    padding: 0.55rem 1rem;
    border-radius: 8px 8px 0 0;
    text-decoration: none;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.92rem;
}
.license-main-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.03); }
.license-main-tab.is-active {
    color: var(--accent-light);
    background: rgba(232, 160, 74, 0.12);
    border: 1px solid var(--border);
    border-bottom-color: transparent;
    margin-bottom: -1px;
}

.license-billing-prestador { margin-bottom: 1rem; }
.license-billing-prestador__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}
.license-payment-methods {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.license-payment-methods__label { font-size: 0.85rem; color: var(--muted); }
.license-payment-chip {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    border: 1px solid var(--border);
}
.license-payment-chip.is-enabled {
    background: rgba(74, 222, 128, 0.12);
    color: #bbf7d0;
    border-color: rgba(74, 222, 128, 0.35);
}
.license-payment-chip.is-disabled {
    opacity: 0.55;
    color: var(--muted);
}
.license-billing-amount-input { max-width: 90px; }
.license-billing-day-input { max-width: 56px; }
.license-billing-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.license-billing-pay-method { font-size: 0.8rem; max-width: 9rem; }
.local-settings-nfse-panel { margin-bottom: 1rem; }
.local-settings-nfse-status {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin: 1rem 0;
}
.local-settings-nfse-status__item { display: flex; flex-direction: column; gap: 0.25rem; }
.local-settings-nfse-status__label { font-size: 0.8rem; color: var(--text-muted); }
.local-settings-nfse-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.license-billing-month-form input[type="month"] { font-size: 0.9rem; }

.page-header--row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.page-header__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.section-title { margin: 1.5rem 0 1rem; font-size: 1rem; color: var(--muted); border-top: 1px solid var(--border); padding-top: 1.25rem; }
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}
@media (max-width: 768px) {
    .form-grid-2, .grid-2 { grid-template-columns: 1fr; }
}
.form-row--full { grid-column: 1 / -1; }
.form-row--wide { grid-column: span 1; }
@media (min-width: 769px) {
    .form-row--wide { grid-column: span 1; }
}
.form-row input,
.form-row select,
.form-row textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
}
.form-row textarea { resize: vertical; min-height: 4rem; }
.field-error { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--danger); }
.password-field {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.password-field input { flex: 1; min-width: 0; }
.password-field .btn { flex-shrink: 0; align-self: center; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    color: var(--text);
}
.checkbox-label input { width: auto; }
.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}
.card--toolbar { padding: 1rem 1.25rem; }
.card--flush { padding: 0; overflow: hidden; }
.toolbar-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.toolbar-form input[type="search"] {
    flex: 1;
    min-width: 200px;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
}
.table-wrap { overflow-x: auto; }
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.data-table th,
.data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.data-table th {
    color: var(--muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(0,0,0,0.15);
}
.data-table tbody tr:hover { background: rgba(255,255,255,0.02); }
.table-actions { text-align: right; white-space: nowrap; }
.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-success { background: rgba(74,222,128,0.15); color: var(--success); }
.badge-danger { background: rgba(248,113,113,0.15); color: var(--danger); }
.badge-muted { background: rgba(148,163,184,0.15); color: var(--muted); }

/* PDV — layout tela cheia (sem rolagem da página) */
body.pdv-page {
    overflow: hidden;
    height: 100dvh;
    --pdv-topbar-h: 42px;
    --pdv-font-xs: 0.8125rem;
    --pdv-font-sm: 0.9375rem;
    --pdv-font-md: 1.0625rem;
    --pdv-font-lg: 1.25rem;
    --pdv-font-xl: 1.5rem;
    --pdv-font-2xl: 1.875rem;
    --pdv-font-3xl: 2.25rem;
    --pdv-money: 1.75rem;
    --pdv-money-hero: 2.125rem;
}
body.pdv-page .app-shell,
body.pdv-page .main-wrap {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}
body.pdv-page .topbar {
    padding: 0.3rem 0.65rem;
    flex-shrink: 0;
    min-height: var(--pdv-topbar-h);
}
body.pdv-page .topbar-user { font-size: 0.82rem; }
body.fullscreen-mode.pdv-page .topbar {
    padding: 0.2rem 0.45rem;
    min-height: 34px;
}
body.fullscreen-mode.pdv-page {
    --pdv-topbar-h: 34px;
}
body.pdv-page .brand-footer { display: none; }
body.pdv-page .main-content--pdv {
    padding: 0.25rem 0.4rem 0.3rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    height: auto;
}
body.pdv-page .main-content--pdv > .alert {
    flex-shrink: 0;
    margin-bottom: 0.25rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.8rem;
}

.pdv-shell {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.pdv-item-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.55rem;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(200,117,51,0.18), rgba(200,117,51,0.08));
    border: 1px solid rgba(232,160,74,0.35);
    font-size: var(--pdv-font-sm);
    flex: 1 1 auto;
    min-width: 0;
    max-width: min(380px, 42vw);
    margin: 0 0.35rem;
}
.pdv-item-banner__img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    object-fit: cover;
    flex-shrink: 0;
}
.pdv-item-banner__text {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 0;
    line-height: 1.15;
}
.pdv-item-banner__text span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: var(--pdv-font-xs);
}
.pdv-item-banner strong {
    color: var(--accent-light);
    font-size: var(--pdv-font-lg);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.pdv-result-item__img {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    object-fit: cover;
    grid-row: 1 / span 2;
    grid-column: 1;
}
.pdv-comanda-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-height: 240px;
    overflow-y: auto;
    margin-bottom: 0.75rem;
}
.pdv-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    flex-shrink: 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.25rem;
    min-height: 0;
}
.pdv-toolbar__left, .pdv-toolbar__right {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    min-width: 0;
    flex-shrink: 0;
}
.pdv-toolbar__title { font-size: var(--pdv-font-lg); font-weight: 800; color: var(--accent-light); }
.pdv-toolbar__badge {
    font-size: var(--pdv-font-xs);
    padding: 0.2rem 0.55rem;
    border-radius: 5px;
    background: rgba(200, 117, 51, 0.2);
    color: var(--accent-light);
    font-weight: 700;
}
.pdv-tab {
    display: none;
    padding: 0.35rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg);
    color: var(--muted);
    font-size: 0.78rem;
    cursor: pointer;
}
.pdv-tab.is-active {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(200,117,51,0.1);
}

.pdv-workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
    gap: 0.5rem;
    overflow: hidden;
    align-items: stretch;
}

.pdv-panel.card--flush { padding: 0.35rem 0.45rem; }
.pdv-panel, .pdv-main, .pdv-actions {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    margin-bottom: 0;
}
.pdv-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-bottom: 0.2rem;
}
.pdv-panel__head h2 { margin: 0; font-size: var(--pdv-font-md); font-weight: 700; }
.pdv-cart-count {
    font-size: var(--pdv-font-sm);
    color: var(--muted);
    font-weight: 500;
    margin-left: 0.35rem;
}

.pdv-code-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    margin-bottom: 0.2rem;
}
.pdv-code-row__label {
    font-size: var(--pdv-font-md);
    font-weight: 700;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.pdv-code-row__input {
    flex: 1;
    min-width: 0;
    padding: 0.55rem 0.65rem;
    font-size: var(--pdv-font-lg);
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
}

.pdv-results {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    max-height: clamp(0px, 14vh, 96px);
    min-height: 0;
    overflow-y: auto;
    margin-bottom: 0.2rem;
    flex-shrink: 1;
}
.pdv-results:empty {
    display: none;
    margin: 0;
    max-height: 0;
}
.pdv-results--dropdown {
    position: absolute;
    z-index: 20;
    left: 0; right: 0;
    max-height: 8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.25rem;
    margin-top: 0.15rem;
}
.pdv-result-item {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 0.5rem;
    align-items: center;
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    font-size: var(--pdv-font-sm);
}
.pdv-result-item:hover { border-color: var(--accent); }
.pdv-result-item strong {
    font-size: var(--pdv-font-md);
    grid-column: 2;
    grid-row: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdv-result-item span {
    font-size: var(--pdv-font-xs);
    color: var(--muted);
    grid-column: 2;
    grid-row: 2;
}

.pdv-cart-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
}
.pdv-cart-scroll.is-empty {
    flex: 0 1 auto;
    max-height: 5.5rem;
}
.pdv-cart-scroll.is-empty .pdv-cart-table { display: none; }
.pdv-cart-table tbody tr { cursor: pointer; }
.pdv-cart-table tbody tr.is-selected {
    background: rgba(59, 130, 246, 0.22);
    outline: 1px solid rgba(96, 165, 250, 0.5);
}
.pdv-cart-product {
    max-width: 100%;
    word-break: break-word;
    line-height: 1.25;
    font-size: var(--pdv-font-md);
    font-weight: 600;
}
.pdv-qty-cell {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    font-size: var(--pdv-font-md);
}
.pdv-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.pdv-qty-btn:hover { border-color: var(--accent); color: var(--accent-light); }
.pdv-qty-meta {
    flex: 1 1 100%;
    font-size: var(--pdv-font-xs);
    color: var(--muted);
}

.data-table--compact { font-size: var(--pdv-font-md); }
.data-table--compact th, .data-table--compact td { padding: 0.45rem 0.5rem; }
.data-table--compact th { font-size: var(--pdv-font-xs); text-transform: uppercase; letter-spacing: 0.04em; }
.data-table--compact td:last-child,
.data-table--compact th:last-child {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    font-size: var(--pdv-font-lg);
}
.pdv-cart-table td:last-child {
    color: var(--accent-light);
}

.pdv-totals {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    margin-top: 0.35rem;
}
.pdv-totals--summary {
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.55), rgba(15, 23, 42, 0.2));
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    margin-top: 0.35rem;
}
.pdv-totals__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 0.75rem;
    align-items: end;
}
.pdv-total-box {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}
.pdv-total-box--main {
    grid-column: 1 / -1;
    padding-top: 0.35rem;
    border-top: 1px solid var(--border);
}
.pdv-total-box__label {
    font-size: var(--pdv-font-sm);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}
.pdv-total-box__value {
    font-size: var(--pdv-font-xl);
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.1;
    min-width: 0;
    max-width: 100%;
}
.pdv-total-box__value--hero {
    font-size: var(--pdv-font-2xl);
    color: var(--accent-light);
}
.pdv-total-box--discount {
    align-items: flex-end;
}
.pdv-totals--inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: nowrap;
    font-size: var(--pdv-font-md);
}
.pdv-total-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
}
.pdv-total-chip strong {
    font-size: var(--pdv-font-xl);
    font-weight: 800;
}
.pdv-total-chip--disc {
    margin-left: auto;
    color: var(--muted);
    font-size: var(--pdv-font-sm);
}
.pdv-total-chip--main {
    font-size: var(--pdv-font-md);
    font-weight: 600;
}
.pdv-total-chip--main strong {
    font-size: var(--pdv-font-2xl);
    color: var(--accent-light);
}
.pdv-total-input, .pdv-qty-input, .pdv-disc-line {
    padding: 0.35rem 0.5rem;
    font-size: var(--pdv-font-lg);
    font-weight: 700;
    border: 1px solid var(--border);
    border-radius: 5px;
    background: var(--bg-card);
    color: var(--text);
    width: 88px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.pdv-qty-input { width: 52px; text-align: center; }
.pdv-disc-line { width: 72px; }

.pdv-action-pad {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.2rem;
    flex-shrink: 0;
}
.pdv-pad-section {
    flex-shrink: 0;
    margin-bottom: 0.25rem;
}
.pdv-pad-section__label {
    display: block;
    font-size: var(--pdv-font-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.25rem;
    line-height: 1;
}
.pdv-pad-section--checkout {
    margin-bottom: 0.15rem;
}
.pdv-action-pad--checkout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.pdv-pad-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    min-height: 48px;
    padding: 0.45rem 0.5rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: var(--pdv-font-xs);
    font-weight: 700;
    cursor: pointer;
    color: var(--text);
    background: var(--bg);
    text-align: center;
    line-height: 1.15;
}
.pdv-pad-btn__sym {
    font-size: 1.5rem;
    line-height: 1;
}
.pdv-pad-btn__text {
    font-size: var(--pdv-font-xs);
    line-height: 1.2;
    max-width: 100%;
    padding-top: 0.55rem;
    white-space: normal;
    word-break: break-word;
    hyphens: auto;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pdv-pad-btn__key {
    position: absolute;
    top: 4px;
    right: 4px;
    display: inline-block;
    padding: 0.08rem 0.38rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.82);
    font-size: 0.68rem;
    font-weight: 800;
    font-family: inherit;
    line-height: 1.2;
    color: #f8fafc;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
    z-index: 1;
}
.pdv-inline-key {
    display: inline-block;
    padding: 0.08rem 0.36rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    background: rgba(15, 23, 42, 0.75);
    font-size: 0.7rem;
    font-weight: 800;
    font-family: inherit;
    line-height: 1.2;
    color: #f8fafc;
    vertical-align: middle;
}
.pdv-pad-btn--qty .pdv-pad-btn__key { display: none; }
.pdv-pad-btn--qty {
    background: rgba(14, 165, 233, 0.22);
    border-color: #0ea5e9;
    color: #bae6fd;
}
.pdv-pad-btn--fn {
    background: rgba(249, 115, 22, 0.24);
    border-color: #f97316;
    color: #fed7aa;
}
.pdv-pad-btn--client {
    background: rgba(34, 197, 94, 0.22);
    border-color: #22c55e;
    color: #bbf7d0;
}
.pdv-pad-btn--warn {
    background: rgba(234, 179, 8, 0.24);
    border-color: #eab308;
    color: #fef9c3;
}
.pdv-pad-btn--info {
    background: rgba(100, 116, 139, 0.28);
    border-color: #64748b;
    color: #e2e8f0;
}
.pdv-pad-btn--sale {
    grid-column: 1 / -1;
    min-height: 52px;
    background: rgba(220, 38, 38, 0.45);
    border-color: #ef4444;
    color: #fecaca;
    font-size: var(--pdv-font-sm);
}
.pdv-pad-btn--sale.is-ready {
    background: rgba(34, 197, 94, 0.42);
    border-color: #22c55e;
    color: #dcfce7;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.2), 0 4px 18px rgba(34, 197, 94, 0.18);
}
.pdv-pad-btn--quote {
    background: rgba(71, 85, 105, 0.55);
    border-color: #64748b;
    color: #f1f5f9;
}
.pdv-pad-btn__key--wide {
    font-size: 0.5rem;
    padding-left: 0.22rem;
    padding-right: 0.22rem;
    letter-spacing: -0.02em;
}
.pdv-pad-btn:hover {
    filter: brightness(1.08);
    border-color: rgba(255, 255, 255, 0.25);
}
.pdv-pad-btn:active { transform: scale(0.98); }

.pdv-categories {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.2rem;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 0.25rem;
    flex-shrink: 0;
    scrollbar-width: thin;
    min-height: 0;
}
.pdv-categories:empty { display: none; margin: 0; }
.pdv-cat-btn {
    padding: 0.2rem 0.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    color: var(--text);
    font-size: 0.65rem;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.pdv-cat-btn.is-active, .pdv-cat-btn:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(200,117,51,0.12);
}

.pdv-actions {
    justify-content: flex-start;
    overflow-y: auto;
    scrollbar-width: thin;
}
#pdv-app.pdv-pay-focus .pdv-actions {
    overflow: hidden;
    justify-content: flex-end;
}
#pdv-app.pdv-pay-focus .pdv-actions .pdv-pad-section,
#pdv-app.pdv-pay-focus .pdv-actions .pdv-categories {
    display: none !important;
}
#pdv-app.pdv-pay-focus .pdv-pay-panel .pdv-checkout-grid--opts {
    display: none;
}
#pdv-app.pdv-pay-focus .pdv-pay-panel {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    border-top: none;
    padding-top: 0;
}
#pdv-app.pdv-pay-focus .pdv-pay-panel__title::after {
    content: ' · ESC expande';
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--muted);
    font-size: 0.72em;
}
#pdv-app.pdv-cash-mode .pdv-pay-panel__title::after {
    content: ' · dinheiro (F4)';
}
#pdv-app.pdv-cash-mode:not(.pdv-multi-pay) .pdv-checkout-grid--pay .pdv-field:not(.pdv-cash-block) {
    display: none;
}
#pdv-app.pdv-cash-mode:not(.pdv-multi-pay) .pdv-quick-pay #pdv-pay-pix-total {
    display: none;
}
.pdv-multi-pay-toggle {
    display: none;
    align-items: center;
    gap: 0.45rem;
    margin: 0;
    padding: 0.4rem 0.5rem;
    border: 1px dashed var(--border);
    border-radius: 6px;
    font-size: var(--pdv-font-sm);
    color: var(--muted);
    cursor: pointer;
    flex-shrink: 0;
}
#pdv-app.pdv-cash-mode .pdv-multi-pay-toggle {
    display: flex;
}
.pdv-multi-pay-toggle input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
}
.pdv-multi-pay-toggle span {
    font-weight: 600;
    line-height: 1.25;
}
.pdv-cash-checkout {
    display: none;
    flex-shrink: 0;
}
#pdv-app.pdv-cash-mode .pdv-cash-checkout {
    display: block;
}
.pdv-cash-checkout__btn {
    width: 100%;
    min-height: 54px;
}
.pdv-field.is-pay-locked {
    opacity: 0.45;
    pointer-events: none;
}
.pdv-field.is-pay-locked input,
.pdv-field.is-pay-locked button {
    cursor: not-allowed;
}
@media (max-height: 760px) {
    #pdv-app.pdv-pay-focus .pdv-main {
        display: none;
    }
    #pdv-app.pdv-pay-focus .pdv-workspace {
        grid-template-columns: 1fr;
    }
}
.pdv-pay-panel {
    flex: 0 0 auto;
    overflow: hidden;
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}
.pdv-pay-panel__title {
    margin: 0;
    font-size: var(--pdv-font-xs);
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-light);
}

.pdv-money-summary {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}
.pdv-money-card {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.7rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.45);
    min-width: 0;
}
.pdv-money-card--total {
    border-color: rgba(232, 160, 74, 0.45);
    background: linear-gradient(180deg, rgba(200, 117, 51, 0.18), rgba(15, 23, 42, 0.35));
}
.pdv-money-card--change.is-ok {
    border-color: rgba(74, 222, 128, 0.55);
    background: rgba(74, 222, 128, 0.08);
}
.pdv-money-card--change.is-warn {
    border-color: rgba(248, 113, 113, 0.55);
    background: rgba(248, 113, 113, 0.08);
}
.pdv-money-card--balance.is-ok {
    border-color: rgba(74, 222, 128, 0.45);
}
.pdv-money-card--balance.is-warn {
    border-color: rgba(251, 191, 36, 0.55);
    background: rgba(251, 191, 36, 0.08);
}
.pdv-money-card.is-muted {
    opacity: 0.88;
}
.pdv-money-card__label {
    font-size: var(--pdv-font-sm);
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    line-height: 1.1;
}
.pdv-money-card__value {
    font-size: var(--pdv-money);
    font-weight: 900;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    line-height: 1.05;
    white-space: nowrap;
    min-width: 0;
    max-width: 100%;
}
.pdv-money-card--total .pdv-money-card__value {
    font-size: var(--pdv-money-hero);
    color: var(--accent-light);
}
.pdv-fit-text {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
}
.pdv-money-card .pdv-fit-text {
    flex: 1 1 auto;
}
body.pdv-values-hidden .pdv-fit-text.is-value-hidden {
    letter-spacing: 0.06em;
    color: var(--muted);
}
.pdv-money-card--change.is-ok .pdv-money-card__value { color: var(--success); }
.pdv-money-card--change.is-warn .pdv-money-card__value { color: var(--danger); }
.pdv-money-card--balance.is-ok .pdv-money-card__value { color: var(--success); }
.pdv-money-card--balance.is-warn .pdv-money-card__value { color: #fbbf24; }

.pdv-cart-line-total {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
    max-width: 7.5rem;
}
.pdv-checkout-grid {
    display: grid;
    gap: 0.35rem 0.45rem;
}
.pdv-checkout-grid--opts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.pdv-checkout-grid--pay {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}
.pdv-field {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    position: relative;
    min-width: 0;
}
.pdv-field--span2 { grid-column: span 2; }
.pdv-field--span3 { grid-column: span 3; }
.pdv-field--client { grid-column: 1 / -1; }
.pdv-field label {
    font-size: var(--pdv-font-xs);
    color: var(--muted);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.pdv-field input,
.pdv-field select {
    padding: 0.45rem 0.55rem;
    font-size: var(--pdv-font-md);
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    min-width: 0;
    font-variant-numeric: tabular-nums;
}
.pdv-field-hint {
    display: block;
    font-size: var(--pdv-font-xs);
    color: var(--muted);
    min-height: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdv-cash-block {
    padding: 0.55rem;
    border: 2px solid rgba(232, 160, 74, 0.55);
    border-radius: 8px;
    background: rgba(200, 117, 51, 0.1);
}
.pdv-cash-received {
    width: 100%;
    padding: 0.65rem 0.75rem;
    font-size: var(--pdv-font-2xl);
    font-weight: 800;
    text-align: right;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--bg);
    color: var(--accent-light);
    font-variant-numeric: tabular-nums;
}
.pdv-change-display {
    display: none;
}
.pdv-quick-pay {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}
.pdv-quick-pay .btn-sm {
    padding: 0.4rem 0.65rem;
    font-size: var(--pdv-font-sm);
    font-weight: 700;
}
.pdv-balance {
    display: none;
}
.pdv-message {
    margin: 0;
    font-size: var(--pdv-font-sm);
    flex-shrink: 0;
    line-height: 1.3;
}
.empty-state--sm { padding: 0.65rem; font-size: var(--pdv-font-sm); }

.pdv-statusbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    margin-top: 0.4rem;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(180deg, #1e293b, #172033);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
}
.pdv-statusbar__meta {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.85rem 1.25rem;
    font-size: var(--pdv-font-sm);
    color: var(--muted);
    min-width: 0;
    overflow: hidden;
}
.pdv-statusbar__meta span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdv-statusbar__meta strong {
    color: var(--text);
    font-size: var(--pdv-font-md);
    font-weight: 800;
}
.pdv-statusbar__operator {
    color: var(--accent-light) !important;
    font-weight: 600;
}
.pdv-statusbar__total-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    flex-shrink: 0;
    line-height: 1;
    min-width: 0;
    max-width: min(42vw, 320px);
}
.pdv-statusbar__total-label {
    font-size: var(--pdv-font-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.pdv-statusbar__total {
    font-size: var(--pdv-font-3xl);
    color: var(--accent-light);
    font-weight: 900;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 24px rgba(232, 160, 74, 0.25);
    min-width: 0;
    max-width: 100%;
}

.pdv-modal,
.app-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.app-modal { z-index: 200; }
.pdv-modal[hidden],
.app-modal[hidden] { display: none !important; }
.pdv-modal__backdrop,
.app-modal__backdrop {
    position: absolute;
    inset: 0;
    background: transparent;
    border: none;
    margin: 0;
    padding: 0;
}
.pdv-modal__box,
.pdv-modal__panel,
.app-modal__box {
    position: relative;
    z-index: 1;
}
.pdv-modal__box,
.app-modal__box {
    width: min(480px, 100%);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.modal-box--neutral { --modal-accent: var(--modal-neutral-accent); --modal-accent-bg: rgba(148, 163, 184, 0.12); --modal-accent-border: rgba(148, 163, 184, 0.38); }
.modal-box--info { --modal-accent: var(--modal-info-accent); --modal-accent-bg: rgba(56, 189, 248, 0.12); --modal-accent-border: rgba(56, 189, 248, 0.38); }
.modal-box--payment { --modal-accent: var(--modal-payment-accent); --modal-accent-bg: rgba(45, 212, 191, 0.12); --modal-accent-border: rgba(45, 212, 191, 0.4); }
.modal-box--success { --modal-accent: var(--modal-success-accent); --modal-accent-bg: rgba(74, 222, 128, 0.12); --modal-accent-border: rgba(74, 222, 128, 0.4); }
.modal-box--fiscal { --modal-accent: var(--modal-fiscal-accent); --modal-accent-bg: rgba(96, 165, 250, 0.12); --modal-accent-border: rgba(96, 165, 250, 0.4); }
.modal-box--print { --modal-accent: var(--modal-print-accent); --modal-accent-bg: rgba(232, 160, 74, 0.14); --modal-accent-border: rgba(232, 160, 74, 0.42); }
.modal-box--warning { --modal-accent: var(--modal-warning-accent); --modal-accent-bg: rgba(251, 191, 36, 0.12); --modal-accent-border: rgba(251, 191, 36, 0.42); }
.modal-box--danger { --modal-accent: var(--modal-danger-accent); --modal-accent-bg: rgba(248, 113, 113, 0.12); --modal-accent-border: rgba(248, 113, 113, 0.42); }
.pdv-modal__box[class*="modal-box--"],
.pdv-modal__panel[class*="modal-box--"],
.app-modal__box[class*="modal-box--"] {
    border-color: var(--modal-accent-border);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.38), inset 0 3px 0 var(--modal-accent);
}
.pdv-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: -0.15rem -0.15rem 0.75rem;
    padding: 0.55rem 0.65rem;
    border-radius: calc(var(--radius) - 2px);
    background: var(--modal-accent-bg, transparent);
    border-bottom: 1px solid var(--modal-accent-border, var(--border));
}
.pdv-modal__head h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--modal-accent, var(--text));
}
.pdv-shortcuts {
    margin: 0 0 0.75rem;
    padding-left: 1.1rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.pdv-shortcuts li { margin-bottom: 0.35rem; }
.pdv-shortcuts kbd {
    display: inline-block;
    padding: 0.1rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    font-size: 0.78rem;
    color: var(--text);
}
.pdv-modal__actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.modal-box--info .btn-primary {
    background: rgba(56, 189, 248, 0.28);
    border-color: #38bdf8;
    color: #e0f2fe;
}
.modal-box--info .btn-primary:hover { background: rgba(56, 189, 248, 0.38); }
.modal-box--neutral .btn-primary {
    background: rgba(148, 163, 184, 0.22);
    border-color: #94a3b8;
    color: #f1f5f9;
}
.modal-box--neutral .btn-primary:hover { background: rgba(148, 163, 184, 0.32); }

@media (max-width: 1100px) {
    .pdv-workspace { grid-template-columns: minmax(0, 1fr) minmax(300px, 36%); }
    .pdv-checkout-grid--pay { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .pdv-checkout-grid--pay .pdv-cash-block { grid-column: span 3; }
    .pdv-money-card__value { font-size: var(--pdv-font-md); }
    .pdv-money-card--total .pdv-money-card__value { font-size: var(--pdv-font-lg); }
}

@media (max-height: 720px) {
    body.pdv-page {
        --pdv-font-2xl: 1.625rem;
        --pdv-font-3xl: 1.875rem;
        --pdv-money-hero: 1.75rem;
    }
    .pdv-pad-btn { min-height: 42px; }
    .pdv-statusbar__total { font-size: var(--pdv-font-2xl); }
    .pdv-results { max-height: 84px; }
}

@media (max-width: 820px) {
    body.pdv-page { overflow: auto; }
    body.pdv-page .main-content--pdv {
        height: auto;
        min-height: calc(100dvh - 49px);
        overflow: visible;
    }
    .pdv-shell { overflow: visible; min-height: 0; }
    .pdv-tab { display: inline-block; }
    .pdv-workspace {
        grid-template-columns: 1fr;
        overflow: visible;
        flex: 0 1 auto;
    }
    .pdv-main, .pdv-actions { display: none; }
    .pdv-main { min-height: 0; }
    .pdv-actions { min-height: 280px; }
    #pdv-app[data-mobile-tab="search"] .pdv-main { display: flex; flex: 0 1 auto; }
    #pdv-app[data-mobile-tab="cart"] .pdv-main { display: flex; min-height: min(55vh, 420px); }
    #pdv-app[data-mobile-tab="pay"] .pdv-actions { display: flex; }
    #pdv-app[data-mobile-tab="search"] .pdv-panel__head--cart,
    #pdv-app[data-mobile-tab="search"] .pdv-cart-scroll,
    #pdv-app[data-mobile-tab="search"] .pdv-totals { display: none; }
    #pdv-app[data-mobile-tab="cart"] .pdv-code-row,
    #pdv-app[data-mobile-tab="cart"] .pdv-results { display: none; }
    .pdv-results { max-height: 140px; }
    .pdv-col-disc, .data-table--compact th.pdv-col-disc { display: none; }
    .pdv-code-row__input, .pdv-field input, .pdv-cash-received { font-size: 16px; }
    .pdv-money-summary { grid-template-columns: 1fr; }
    .pdv-money-card { flex-direction: row; align-items: center; justify-content: space-between; gap: 0.5rem; }
    .pdv-money-card__value { font-size: var(--pdv-font-xl); }
    .pdv-money-card .pdv-fit-text { text-align: right; }
}

@media (max-width: 520px) {
    .pdv-totals--inline { flex-wrap: wrap; }
    .pdv-checkout-grid--opts,
    .pdv-checkout-grid--pay { grid-template-columns: 1fr 1fr; }
    .pdv-field--span3,
    .pdv-field--client,
    .pdv-checkout-grid--pay .pdv-cash-block { grid-column: span 2; }
    .pdv-field--span2 { grid-column: span 2; }
    .pdv-statusbar { flex-direction: column; align-items: stretch; }
    .pdv-statusbar__total-wrap { align-items: flex-start; }
    .pdv-statusbar__total { font-size: var(--pdv-font-2xl); }
    .pdv-action-pad:not(.pdv-action-pad--checkout) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pdv-action-pad--checkout .pdv-pad-btn--sale { grid-column: 1 / -1; }
}

.toolbar-tabs { display: flex; gap: 0.35rem; margin-bottom: 0.75rem; }
.section-title--sm { font-size: 0.95rem; margin-top: 0.5rem; }

/* Cupom NFC-e (DANFC-e térmico ~80mm) */
.receipt-print { max-width: 80mm; margin: 0 auto; }
.nfce-cupom {
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    line-height: 1.35;
    color: #000;
    background: #fff;
    padding: 4mm 3mm;
}
.purchase-product-picker { position: relative; min-width: 220px; }
.purchase-product-picker__search {
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font: inherit;
}
.purchase-product-picker__results {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 2px);
    max-height: 220px;
    overflow: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.purchase-product-picker__option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.65rem;
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}
.purchase-product-picker__option:hover,
.purchase-product-picker__option:focus {
    background: var(--surface-muted, #f1f5f9);
}
.purchase-product-picker__option--muted { color: var(--muted); font-style: italic; }

.nfce-cupom__logo {
    text-align: center;
    margin-bottom: 3mm;
    display: flex;
    align-items: center;
    justify-content: center;
}
.nfce-cupom__logo-img {
    display: block;
    max-width: 70mm;
    max-height: 18mm;
    width: auto;
    height: auto;
    margin: 0 auto;
    object-fit: contain;
    border: none;
    background: transparent;
}
.nfce-cupom__logo-placeholder {
    display: none !important;
}
.nfce-cupom__emitente { text-align: center; margin-bottom: 3mm; }
.nfce-cupom__emitente-name { font-weight: 700; text-transform: uppercase; }
.nfce-cupom__homolog {
    text-align: center;
    font-weight: 700;
    border: 1px solid #000;
    padding: 2mm;
    margin: 2mm 0;
    font-size: 10px;
}
.nfce-cupom__title {
    text-align: center;
    font-weight: 700;
    margin: 3mm 0;
    font-size: 10px;
    text-transform: uppercase;
}
.nfce-cupom__title-sub { font-weight: 400; font-size: 9px; margin-top: 1mm; }
.nfce-cupom__items {
    width: 100%;
    border-collapse: collapse;
    margin: 2mm 0;
    font-size: 9px;
}
.nfce-cupom__items th {
    border-bottom: 1px solid #000;
    padding: 1mm 0;
    text-align: left;
    font-weight: 700;
}
.nfce-cupom__items td {
    padding: 1mm 0;
    vertical-align: top;
    border-bottom: 1px dotted #ccc;
}
.nfce-cupom__items .col-desc { width: 42%; word-break: break-word; }
.nfce-cupom__items .col-qty { width: 12%; text-align: right; }
.nfce-cupom__items .col-unit { width: 10%; text-align: center; }
.nfce-cupom__items .col-price,
.nfce-cupom__items .col-total { width: 18%; text-align: right; }
.nfce-cupom__summary { margin: 2mm 0; font-size: 10px; }
.nfce-cupom__summary-row {
    display: flex;
    justify-content: space-between;
    gap: 2mm;
    padding: 0.5mm 0;
}
.nfce-cupom__summary-row--strong { font-weight: 700; }
.nfce-cupom__payments { margin: 3mm 0; font-size: 10px; }
.nfce-cupom__payments-head,
.nfce-cupom__payments-row {
    display: flex;
    justify-content: space-between;
    gap: 2mm;
}
.nfce-cupom__payments-head { font-weight: 700; border-bottom: 1px solid #000; padding-bottom: 1mm; }
.nfce-cupom__payments-row { padding: 0.5mm 0; }
.nfce-cupom__tributos {
    font-size: 9px;
    text-align: center;
    margin: 3mm 0;
    border-top: 1px dashed #000;
    border-bottom: 1px dashed #000;
    padding: 2mm 0;
}
.nfce-cupom__tributos-pct { display: block; font-size: 8px; margin-top: 1mm; }
.nfce-cupom__rtc {
    margin: 3mm 0;
    padding: 2mm 0;
    border-bottom: 1px dashed #000;
    font-size: 9px;
}
.nfce-cupom__rtc-title {
    text-align: center;
    font-weight: 700;
    margin-bottom: 1mm;
    text-transform: uppercase;
}
.nfce-cupom__fiscal { text-align: center; margin: 3mm 0; font-size: 10px; }
.nfce-cupom__chave { text-align: center; margin: 3mm 0; font-size: 9px; }
.nfce-cupom__chave-value {
    font-weight: 700;
    word-break: break-word;
    letter-spacing: 0.02em;
    margin-top: 1mm;
}
.nfce-cupom__qr { text-align: center; margin: 3mm 0; }

.totp-qr-wrap {
    display: inline-block;
    padding: 1rem;
    margin: 0.75rem 0 1rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.totp-qrcode img,
.totp-qrcode canvas {
    display: block;
    width: 200px;
    height: 200px;
}
.totp-secret {
    font-size: 0.95rem;
    letter-spacing: 0.08em;
    word-break: break-all;
}

.role-permissions-card { margin-bottom: 1.25rem; }
.role-permissions-role-select {
    margin-bottom: 1.25rem;
    gap: 0.75rem;
    align-items: center;
}
.role-permissions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.role-permissions-group h2 {
    font-size: 1rem;
    margin: 0 0 0.75rem;
}
.role-permissions-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.5rem;
}
.role-permission-item {
    display: flex;
    gap: 0.6rem;
    align-items: flex-start;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
}
.role-permission-item input { margin-top: 0.2rem; }
.role-permission-item strong { display: block; }
.role-permission-item small { display: block; margin-top: 0.15rem; }
.role-permissions-actions { gap: 0.5rem; }

.local-settings-info { margin-bottom: 1rem; font-size: 0.92rem; }
.local-settings-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}
.local-settings-tabs .tab-link {
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    background: var(--surface);
}
.local-settings-tabs .tab-link.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}
.local-settings-form h2 { margin-top: 0; }
.local-settings-checks { margin: 1rem 0; }
.local-settings-enable { display: block; margin: 1rem 0; font-weight: 600; }
.license-status-row { margin: 0.75rem 0 1rem; display: flex; gap: 0.5rem; align-items: center; }
.field-hint { font-size: 0.85rem; margin: 0.35rem 0 0; }
.badge-warning { background: #b45309; color: #fff; }

/* Multiempresas / licenças */
.company-switcher { display: flex; align-items: center; gap: 0.35rem; margin-left: 0.75rem; }
.company-switcher__form { margin: 0; }
.company-switcher__label { display: flex; flex-direction: column; gap: 0.15rem; margin: 0; }
.company-switcher__title { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.company-switcher__select {
    min-width: 220px;
    max-width: 320px;
    padding: 0.35rem 0.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-size: 0.85rem;
}
.company-switcher--readonly { flex-direction: column; align-items: flex-start; margin-left: 0.75rem; }
.company-switcher__name { font-size: 0.85rem; font-weight: 600; }
.license-modules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.35rem 1rem; margin-top: 0.75rem; }
.license-key { display: inline-block; font-size: 1.1rem; letter-spacing: 0.05em; margin: 0.35rem 0; }
.license-generated code { user-select: all; }
.license-renew-form { display: inline-flex; gap: 0.35rem; align-items: center; margin-left: 0.35rem; }
.license-renew-form input[type="date"] { max-width: 150px; }
.row-highlight { background: rgba(59, 130, 246, 0.08); }
.help-list { margin: 0.5rem 0 0; padding-left: 1.2rem; }
.help-list li { margin-bottom: 0.35rem; }
.inline-form { display: inline; }
.text-small { font-size: 0.85rem; }
.license-block-card { max-width: 560px; }

.pdv-pix-modal__panel {
    max-width: 420px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
}
.pdv-pix-modal__head { text-align: left; margin-bottom: 0.25rem; }
.pdv-pix-modal__head kbd,
.pdv-pix-modal__actions kbd {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.1rem 0.35rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--bg);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    vertical-align: middle;
}
.pdv-pix-modal__actions { justify-content: center; }
.modal-box--payment .pdv-pix-modal__amount { color: var(--modal-accent); }
.modal-box--payment .pdv-pix-modal__spinner { border-top-color: var(--modal-accent); }
.modal-box--payment #pdv-pix-confirm-paid {
    background: rgba(45, 212, 191, 0.28);
    border-color: var(--modal-payment-accent);
    color: #ccfbf1;
}
.modal-box--payment #pdv-pix-confirm-paid:hover {
    background: rgba(45, 212, 191, 0.38);
}
.pdv-pix-modal__amount { font-size: 1.25rem; font-weight: 700; margin: 0.5rem 0 1rem; }
.pdv-pix-modal__loading { padding: 1.5rem 0; color: var(--muted); }
.pdv-pix-modal__spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 0.75rem;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: pdv-pix-spin 0.8s linear infinite;
}
@keyframes pdv-pix-spin { to { transform: rotate(360deg); } }
.pdv-pix-modal__content { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.pdv-pix-modal__qr-wrap { display: flex; justify-content: center; margin-bottom: 0.25rem; }
.pdv-pix-modal__brcode {
    width: 100%;
    font-size: 0.75rem;
    margin-bottom: 0.75rem;
    resize: vertical;
}

.pdv-pix-input-row {
    display: flex;
    gap: 0.35rem;
    align-items: stretch;
}
.pdv-pix-input-row input { flex: 1; min-width: 0; }

.app-confirm-modal__box {
    width: min(420px, 100%);
    text-align: center;
    padding: 1.25rem 1.35rem 1.1rem;
}
.app-confirm-modal__icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 0.85rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    background: var(--modal-accent-bg, rgba(148, 163, 184, 0.12));
    border: 1px solid var(--modal-accent-border, var(--border));
    color: var(--modal-accent, var(--text));
}
.app-confirm-modal__icon--success::before { content: "✓"; }
.app-confirm-modal__icon--print::before { content: "⎙"; }
.app-confirm-modal__icon--fiscal::before { content: "NF"; font-size: 0.95rem; letter-spacing: -0.04em; }
.app-confirm-modal__icon--info::before { content: "i"; font-family: Georgia, serif; font-style: italic; }
.app-confirm-modal__icon--payment::before { content: "PIX"; font-size: 0.72rem; letter-spacing: 0.04em; }
.app-confirm-modal__icon--warning::before { content: "!"; }
.app-confirm-modal__icon--danger::before { content: "×"; font-size: 1.75rem; line-height: 0.9; }
.app-confirm-modal__title {
    margin: 0 0 0.5rem;
    font-size: 1.1rem;
    color: var(--modal-accent, var(--text));
}
.app-confirm-modal__message {
    margin: 0 0 1.1rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.45;
}
.app-confirm-modal__actions {
    display: flex;
    justify-content: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}
.app-confirm-modal__actions .btn { min-width: 8.5rem; }
.app-modal.app-modal--success #app-confirm-primary {
    background: rgba(34, 197, 94, 0.35);
    border-color: #22c55e;
    color: #dcfce7;
}
.app-modal.app-modal--fiscal #app-confirm-primary {
    background: rgba(59, 130, 246, 0.35);
    border-color: #3b82f6;
    color: #dbeafe;
}
.app-modal.app-modal--print #app-confirm-primary {
    background: rgba(200, 117, 51, 0.42);
    border-color: var(--accent);
    color: #ffedd5;
}
.app-modal.app-modal--payment #app-confirm-primary {
    background: rgba(45, 212, 191, 0.28);
    border-color: var(--modal-payment-accent);
    color: #ccfbf1;
}
.app-modal.app-modal--warning #app-confirm-primary {
    background: rgba(251, 191, 36, 0.28);
    border-color: #f59e0b;
    color: #fef3c7;
}
.app-modal.app-modal--danger #app-confirm-primary {
    background: rgba(220, 38, 38, 0.38);
    border-color: #ef4444;
    color: #fee2e2;
}
.pdv-pix-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.35rem;
    border-radius: 4px;
    background: var(--primary);
    color: #fff;
    vertical-align: middle;
}
#pdv-app[data-pix-enabled="1"] .pdv-field--pix label,
#pdv-app[data-pix-enabled="1"] #pay-pix { cursor: pointer; }
.nfce-cupom__protocol { text-align: center; font-size: 9px; margin-bottom: 2mm; }
.nfce-cupom__footer {
    text-align: center;
    font-size: 9px;
    margin-top: 4mm;
    padding-top: 2mm;
    border-top: 1px dashed #000;
}

/* Cupom legado (orçamento) */
.receipt-header { text-align: center; margin-bottom: 1rem; }
.receipt-table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; }
.receipt-table th, .receipt-table td { padding: 0.35rem 0; border-bottom: 1px dashed var(--border); text-align: left; }
.receipt-totals, .receipt-payments { margin-top: 0.75rem; }
.receipt-footer { text-align: center; font-size: 0.8rem; color: var(--muted); margin-top: 1rem; }

@media print {
    @page { size: 80mm auto; margin: 2mm; }
    .sidebar, .topbar, .no-print, .page-header, .alert, .brand-footer { display: none !important; }
    .main-content { padding: 0; }
    .card, .nfce-cupom { border: none; box-shadow: none; }
    body { background: #fff; }
}
.empty-state { padding: 2rem 1.25rem; color: var(--muted); margin: 0; }
.text-danger { color: var(--danger); }
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
.chart-bars {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    min-height: 160px;
    padding: 0.5rem 0 0;
}
.chart-bar-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    height: 140px;
    justify-content: flex-end;
}
.chart-bar {
    width: 100%;
    max-width: 48px;
    background: linear-gradient(180deg, var(--accent-light), var(--accent));
    border-radius: 4px 4px 0 0;
    min-height: 4px;
}
.chart-bar-label { font-size: 0.75rem; color: var(--muted); }
.kpi-card a { color: var(--accent-light); text-decoration: none; }
.kpi-card a:hover { text-decoration: underline; }

.report-hub {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.report-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s, transform 0.15s;
}
.report-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.report-card h2 {
    margin: 0;
    font-size: 1.05rem;
    color: var(--accent-light);
}
.report-card p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.4;
}
.report-card__icon { font-size: 1.75rem; line-height: 1; }
.report-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1rem;
}
.form-row--inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}
.form-row--inline label { margin: 0; white-space: nowrap; }
.form-fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    margin: 0;
}
.form-fieldset legend {
    padding: 0 0.35rem;
    font-size: 0.85rem;
    color: var(--muted);
}
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.35rem 0;
    font-size: 0.9rem;
}
.table-scroll { overflow-x: auto; }
.mono-sm { font-family: ui-monospace, monospace; font-size: 0.72rem; word-break: break-all; }
.field-hint { display: block; font-size: 0.78rem; color: var(--muted); margin-top: 0.25rem; }
.sintegra-info__list { margin: 0 0 0.75rem; padding-left: 1.25rem; }
.sintegra-info__list a { color: var(--accent-light); }
.validation-list { margin: 0.35rem 0 0.75rem; padding-left: 1.25rem; font-size: 0.88rem; }
.validation-list--error { color: var(--danger); }
.card--ok { border-color: var(--success); }
.card--warn { border-color: var(--warning, #eab308); }

/* —— Error page —— */
.error-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-6, 1.5rem);
  background: var(--bg-app, #f1f5f9);
}

.error-card {
  background: var(--surface, #fff);
  padding: var(--space-8, 2rem);
  border-radius: var(--radius-lg, 12px);
  box-shadow: var(--shadow, 0 4px 24px rgba(15, 23, 42, 0.08));
  max-width: 420px;
  text-align: center;
  border: 1px solid var(--border, #e2e8f0);
}

.error-code {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent, #2563eb);
  margin: 0;
}

.error-page .site-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted, #64748b);
}

/* —— Distribuição DF-e —— */
.dfe-banner { margin-bottom: 1rem; }
.dfe-banner__grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem 1.5rem;
  align-items: start;
}
.dfe-banner__title { margin: 0 0 0.35rem; font-size: 1.05rem; }
.dfe-banner__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem 1rem;
  margin: 0;
}
.dfe-banner__stats dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 0;
}
.dfe-banner__stats dd { margin: 0.15rem 0 0; font-weight: 700; }
.dfe-banner__message { margin: 0.75rem 0 0; font-size: 0.9rem; }
.dfe-banner__auto {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.detail-list {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.45rem 0.75rem;
  margin: 0 0 1rem;
}
.detail-list dt { color: var(--muted); font-weight: 600; }
.detail-list dd { margin: 0; }
.xml-preview {
  width: 100%;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 0.65rem;
  resize: vertical;
}
@media (max-width: 900px) {
  .dfe-banner__grid { grid-template-columns: 1fr; }
  .dfe-banner__stats { grid-template-columns: 1fr; }
}
.dfe-manifest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.dfe-manifest-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  background: rgba(15, 23, 42, 0.25);
}
.dfe-manifest-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}
.dfe-manifest-card p {
  margin: 0 0 0.65rem;
  font-size: 0.85rem;
}
@media (max-width: 720px) {
  .dfe-manifest-grid { grid-template-columns: 1fr; }
}
.dfe-filters { margin-bottom: 1rem; padding: 1rem 1.25rem; }
.dfe-filters__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 0.75rem 1rem;
  align-items: end;
}
.dfe-filters__actions { margin: 0; }
.dfe-flow__steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
}
.dfe-flow__steps li {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: rgba(15, 23, 42, 0.2);
}
.dfe-flow__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
.card__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.card__header-row h2 { margin: 0; }
@media (max-width: 900px) {
  .dfe-filters__grid { grid-template-columns: 1fr; }
  .dfe-flow__steps { grid-template-columns: 1fr; }
}
