:root {
    color-scheme: dark;
    --bg: #0f172a;
    --bg-soft: #162033;
    --panel: #111c2e;
    --panel-border: rgba(148, 163, 184, 0.16);
    --text: #e5ecf6;
    --text-soft: #94a3b8;
    --text-muted: #94a3b8;
    --sidebar-bg: rgba(15, 23, 42, 0.72);
    --surface-muted: rgba(15, 23, 42, 0.14);
    --surface-input: rgba(15, 23, 42, 0.18);
    --surface-accent: rgba(37, 99, 235, 0.08);
    --surface-accent-strong: rgba(37, 99, 235, 0.18);
    --accent-border: rgba(96, 165, 250, 0.22);
    --overlay: rgba(15, 23, 42, 0.7);
    --success-bg: rgba(22, 163, 74, 0.16);
    --success-border: rgba(22, 163, 74, 0.24);
    --success-text: #bbf7d0;
    --warning-bg: rgba(245, 158, 11, 0.16);
    --warning-border: rgba(245, 158, 11, 0.22);
    --warning-text: #fde68a;
    --danger-bg: rgba(239, 68, 68, 0.16);
    --danger-border: rgba(239, 68, 68, 0.24);
    --danger-text: #fecaca;
    --info-bg: rgba(37, 99, 235, 0.16);
    --info-border: rgba(37, 99, 235, 0.24);
    --info-text: #bfdbfe;
    --alert-success-bg: #123524;
    --alert-success-border: #1f7a46;
    --alert-success-text: #dcfce7;
    --alert-warning-bg: #4a3100;
    --alert-warning-border: #b45309;
    --alert-warning-text: #fde68a;
    --alert-danger-bg: #4c1d1d;
    --alert-danger-border: #b91c1c;
    --alert-danger-text: #fecaca;
    --alert-info-bg: #172554;
    --alert-info-border: #2563eb;
    --alert-info-text: #dbeafe;
    --brand-preview-bg: rgba(255, 255, 255, 0.9);
    --primary: #2563eb;
    --primary-strong: #1d4ed8;
    --secondary: #1f2937;
    --success: #16a34a;
    --warning: #f59e0b;
    --danger: #ef4444;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
    --radius: 18px;
    --font: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    --sidebar-width: 290px;
    --sidebar-collapsed-width: 86px;
    --touch-target: 44px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --app-blue: #0057d9;
    --app-blue-2: #0098ff;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #eef2ff;
    --bg-soft: #dbe7ff;
    --panel: #ffffff;
    --panel-border: rgba(37, 99, 235, 0.14);
    --text: #0f172a;
    --text-soft: #475569;
    --text-muted: #64748b;
    --sidebar-bg: rgba(255, 255, 255, 0.62);
    --surface-muted: rgba(37, 99, 235, 0.06);
    --surface-input: rgba(255, 255, 255, 0.92);
    --surface-accent: rgba(37, 99, 235, 0.06);
    --surface-accent-strong: rgba(37, 99, 235, 0.12);
    --accent-border: rgba(37, 99, 235, 0.18);
    --overlay: rgba(15, 23, 42, 0.42);
    --success-bg: rgba(22, 163, 74, 0.12);
    --success-border: rgba(22, 163, 74, 0.18);
    --success-text: #166534;
    --warning-bg: rgba(245, 158, 11, 0.14);
    --warning-border: rgba(245, 158, 11, 0.18);
    --warning-text: #92400e;
    --danger-bg: rgba(239, 68, 68, 0.12);
    --danger-border: rgba(239, 68, 68, 0.18);
    --danger-text: #b91c1c;
    --info-bg: rgba(37, 99, 235, 0.10);
    --info-border: rgba(37, 99, 235, 0.16);
    --info-text: #1d4ed8;
    --alert-success-bg: #dcfce7;
    --alert-success-border: #86efac;
    --alert-success-text: #166534;
    --alert-warning-bg: #fef3c7;
    --alert-warning-border: #f59e0b;
    --alert-warning-text: #92400e;
    --alert-danger-bg: #fee2e2;
    --alert-danger-border: #fca5a5;
    --alert-danger-text: #b91c1c;
    --alert-info-bg: #dbeafe;
    --alert-info-border: #93c5fd;
    --alert-info-text: #1d4ed8;
    --brand-preview-bg: #ffffff;
    --primary: #1d4ed8;
    --primary-strong: #1e40af;
    --secondary: #dbe4f3;
    --shadow: 0 18px 40px rgba(37, 99, 235, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
    color: var(--text);
    font-family: var(--font);
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

body.modal-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
    transition: grid-template-columns 0.22s ease;
}

.app-shell.sidebar-collapsed {
    grid-template-columns: var(--sidebar-collapsed-width) 1fr;
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
}

.login-layout {
    width: min(100%, 980px);
}

.login-card {
    display: grid;
    gap: 24px;
    padding: 32px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.sidebar {
    padding: 24px;
    background:
        radial-gradient(circle at 10% 0%, rgba(0, 152, 255, 0.28), transparent 28%),
        linear-gradient(180deg, #0057d9 0%, #00347d 48%, #062052 100%);
    border-right: 1px solid var(--panel-border);
    backdrop-filter: blur(12px);
    color: #fff;
    min-width: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    z-index: 30;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    min-height: 92px;
}

.brand strong,
.panel h2,
.topbar h1 {
    display: block;
    margin: 0;
}

.brand span,
.eyebrow,
.stat-card p,
.feature-list,
.settings-item p {
    color: var(--text-soft);
}

.sidebar .brand span,
.sidebar .nav-link,
.sidebar .sidebar-card span,
.sidebar .sidebar-card small {
    color: rgba(255, 255, 255, 0.78);
}

.brand-logo {
    width: 58px;
    height: 58px;
    object-fit: contain;
    border-radius: 16px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 24px 0;
}

.nav-link,
.topbar-link,
.theme-toggle,
.button {
    transition: all 0.2s ease;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--text-soft);
    min-height: var(--touch-target);
}

.nav-link:hover,
.nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #0b87ff, #0066ee);
    border-color: rgba(255, 255, 255, 0.24);
    box-shadow: 0 12px 24px rgba(0, 77, 180, 0.28);
}

.nav-icon {
    display: inline-grid;
    place-items: center;
    width: 26px;
    min-width: 26px;
    font-size: 1.18rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 20, 60, 0.35);
}

.app-shell.sidebar-collapsed .sidebar {
    padding-inline: 14px;
}

.app-shell.sidebar-collapsed .brand {
    justify-content: center;
    padding: 12px;
}

.app-shell.sidebar-collapsed .brand-logo {
    width: 46px;
    height: 46px;
}

.app-shell.sidebar-collapsed .brand-copy,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .sidebar-card {
    display: none;
}

.app-shell.sidebar-collapsed .nav-link {
    justify-content: center;
    padding: 14px 10px;
}

.sidebar-card,
.panel,
.stat-card,
.alert {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.sidebar-card {
    padding: 18px;
    display: grid;
    gap: 4px;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.16);
}

.main-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background:
        radial-gradient(circle at 88% 0%, rgba(0, 152, 255, 0.13), transparent 25%),
        linear-gradient(180deg, rgba(239, 246, 255, 0.12), transparent 260px);
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 0 32px;
    min-height: 72px;
    background: linear-gradient(90deg, #0048bb 0%, #006bff 58%, #0042a7 100%);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 61, 150, 0.18);
    position: sticky;
    top: 0;
    z-index: 25;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.topbar .eyebrow,
.topbar h1 {
    color: #fff;
}

.shell-toggle,
.mobile-back {
    width: var(--touch-target);
    height: var(--touch-target);
    display: inline-grid;
    place-items: center;
    border: 0;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
    font-size: 1.35rem;
}

.mobile-back {
    display: none;
    font-size: 2rem;
    line-height: 1;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.topbar-link,
.theme-toggle {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    cursor: pointer;
    min-height: var(--touch-target);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
}

.topbar-link:hover,
.theme-toggle:hover,
.button:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.button:disabled,
.button.is-loading {
    cursor: wait;
    opacity: 0.78;
    transform: none;
}

.button.is-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-circle {
    width: 16px;
    height: 16px;
    display: inline-block;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 999px;
    animation: nfse-spin 0.75s linear infinite;
}

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

.operation-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 14px;
    border: 1px solid var(--accent-border);
    border-radius: 14px;
    background: var(--info-bg);
    color: var(--info-text);
    box-shadow: var(--shadow);
}

.operation-status[hidden] {
    display: none;
}

.topbar-link.danger {
    color: var(--danger-text);
    border-color: var(--danger-border);
}

.content {
    padding: 24px 32px 32px;
}

.alert {
    margin: 24px 32px 0;
    padding: 14px 18px;
    color: var(--text);
    background: var(--panel);
}

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

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

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

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

.grid-summary,
.content-grid {
    display: grid;
    gap: 20px;
}

.grid-summary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 20px;
}

.content-grid {
    grid-template-columns: 1.3fr 0.9fr;
}

.content-grid.single {
    grid-template-columns: 1fr;
}

.stat-card,
.panel {
    padding: 22px;
}

.stat-card {
    display: flex;
    gap: 14px;
    align-items: center;
}

.stat-card.highlight {
    background: linear-gradient(135deg, var(--surface-accent-strong), var(--panel));
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--surface-accent-strong);
    font-size: 22px;
}

.native-chart {
    display: grid;
    gap: 14px;
}

.chart-row {
    display: grid;
    gap: 8px;
}

.chart-row-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.9rem;
}

.chart-row-label span {
    color: var(--text-muted);
    text-align: right;
}

.chart-bar-track {
    height: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--surface-accent);
    border: 1px solid var(--panel-border);
}

.chart-bar {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary), var(--primary-strong));
}

.chart-bar.status-cancelada {
    background: linear-gradient(90deg, #ef4444, #991b1b);
}

.chart-bar.status-pendente,
.chart-bar.status-rascunho {
    background: linear-gradient(90deg, #f59e0b, #b45309);
}

.native-chart-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    min-height: 210px;
}

.day-bar-item {
    display: grid;
    gap: 6px;
    justify-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.day-bar-item strong {
    color: var(--text);
}

.day-bar-track {
    display: flex;
    align-items: end;
    width: 100%;
    height: 140px;
    max-width: 54px;
    padding: 3px;
    border-radius: 16px;
    background: var(--surface-accent);
    border: 1px solid var(--panel-border);
}

.day-bar {
    display: block;
    width: 100%;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--primary), var(--primary-strong));
}

.panel-header,
.form-row,
.form-actions,
.table-toolbar {
    display: flex;
    gap: 16px;
}

.panel-header,
.table-toolbar {
    justify-content: space-between;
    align-items: center;
}

.nfse-form {
    display: grid;
    gap: 18px;
}

.nfse-form label {
    display: grid;
    gap: 8px;
    width: 100%;
}

.field-help {
    color: var(--text-soft);
    font-size: 0.85rem;
}

.nfse-form input,
.nfse-form select,
.nfse-form textarea,
.table-toolbar input,
.table-toolbar select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: var(--surface-input);
    color: var(--text);
    outline: none;
}

.nfse-form select,
.table-toolbar select {
    color-scheme: light;
}

.nfse-form select option,
.nfse-form select optgroup,
.table-toolbar select option,
.table-toolbar select optgroup {
    background: #ffffff;
    color: #0f172a;
}

.nfse-form input::placeholder,
.nfse-form textarea::placeholder,
.table-toolbar input::placeholder {
    color: var(--text-soft);
}

.nfse-form input:focus,
.nfse-form select:focus,
.nfse-form textarea:focus,
.table-toolbar input:focus,
.table-toolbar select:focus {
    border-color: rgba(96, 165, 250, 0.55);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border: 0;
    border-radius: 14px;
    cursor: pointer;
}

.button.primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-strong));
    color: #fff;
}

.button.secondary {
    background: var(--secondary);
    color: var(--text);
}

.button.tertiary {
    background: transparent;
    color: var(--text-soft);
    border: 1px solid var(--panel-border);
}

.button.danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border: 1px solid var(--danger-border);
}

.button.icon-button {
    min-width: 48px;
    padding: 12px;
}

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

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: var(--surface-accent);
}

.nfse-form .checkbox-row input[type="checkbox"],
.checkbox-row input[type="checkbox"] {
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
    margin: 0;
    padding: 0;
    border-radius: 6px;
    accent-color: var(--primary);
    flex: 0 0 22px;
    cursor: pointer;
}

.checkbox-row span {
    line-height: 1.35;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    background: var(--surface-muted);
    color: var(--text-soft);
}

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

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

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

.feature-list,
.settings-list {
    margin: 0;
    padding-left: 18px;
}

.feature-list li,
.settings-item + .settings-item {
    margin-top: 12px;
}

.table-count,
.table-hint {
    color: var(--text-soft);
}

.context-row {
    cursor: context-menu;
}

.context-row:hover {
    background: var(--surface-accent);
}

.context-menu {
    position: absolute;
    z-index: 40;
    min-width: 220px;
    padding: 8px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.context-menu[hidden],
.modal-backdrop[hidden] {
    display: none;
}

.context-menu-item {
    width: 100%;
    padding: 12px 14px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.context-menu-item:hover {
    background: var(--surface-accent-strong);
}

.context-menu-item.danger {
    color: var(--danger-text);
}

.context-menu-item.danger:hover {
    background: var(--danger-bg);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: grid;
    place-items: center;
    padding: 24px;
    background: var(--overlay);
    backdrop-filter: blur(6px);
}

.modal-card {
    width: min(100%, 720px);
    max-height: 90vh;
    overflow: auto;
    padding: 24px;
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.modal-card-lg {
    width: min(100%, 980px);
}

.modal-card-sm {
    width: min(100%, 560px);
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.modal-body {
    display: grid;
    gap: 18px;
}

.modal-message {
    margin: 0;
    color: var(--text);
}

.modal-close {
    flex-shrink: 0;
}

.modal-toolbar {
    margin: 18px 0 0;
}

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

.danfse-card {
    display: grid;
    gap: 18px;
    width: 100%;
}

.danfse-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: var(--surface-accent);
}

.danfse-header h2 {
    margin: 0;
}

.detail-item,
.permissions-card {
    padding: 18px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: var(--surface-accent);
}

.detail-item span {
    display: block;
    margin-bottom: 8px;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.detail-item strong {
    display: block;
}

.detail-item .status-pill {
    margin-top: 8px;
}

.table-actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.table-action {
    min-height: 30px;
    padding: 6px 10px;
    font-size: 0.78rem;
}

.table-action.icon-only {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.danfse-official-wrapper {
    margin-top: 18px;
    overflow: auto;
    padding: 12px;
    border-radius: 18px;
    background: #f8fafc;
}

.danfse-official {
    width: min(100%, 794px);
    margin: 0 auto;
    border: 1px solid #333;
    background: #fff;
    color: #111;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 8.8px;
    line-height: 1.14;
}

.danfse-official-header,
.danfse-section,
.danfse-key-row {
    border-bottom: 1px solid #333;
}

.danfse-official-header {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    gap: 6px;
    align-items: center;
    padding: 6px;
}

.danfse-logo-box,
.danfse-title,
.danfse-meta {
    display: grid;
    gap: 2px;
}

.danfse-logo-box strong {
    color: #159447;
    font-size: 22px;
    line-height: 1;
}

.danfse-title {
    text-align: center;
    font-size: 10px;
}

.danfse-title strong {
    font-size: 13px;
}

.danfse-meta {
    text-align: right;
    font-size: 8px;
}

.danfse-homolog-banner {
    padding: 5px 6px;
    border-bottom: 1px solid #333;
    background: #b91c1c;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-align: center;
}

.danfse-section {
    padding: 4px 6px;
}

.danfse-section h3 {
    margin: 0 0 3px;
    color: #111;
    font-size: 8.6px;
    text-transform: uppercase;
}

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

.danfse-official-field,
.danfse-official-line {
    min-height: 22px;
    padding: 3px 4px;
    border-top: 1px solid #ccc;
}

.danfse-official-field span,
.danfse-official-line span {
    display: block;
    color: #333;
    font-size: 7px;
    font-weight: 700;
}

.danfse-official-field strong,
.danfse-official-line strong {
    display: block;
    margin-top: 2px;
    color: #111;
    font-family: "Microsoft Sans Serif", Arial, sans-serif;
    font-size: 8.5px;
    font-weight: 400;
    white-space: pre-wrap;
    word-break: break-word;
}

.danfse-official-field.value-field strong {
    text-align: right;
    font-weight: 700;
}

.danfse-official-field.span-3 {
    grid-column: span 3;
}

.danfse-key-row {
    display: grid;
    grid-template-columns: 1fr 132px;
    gap: 6px;
    align-items: center;
    padding: 4px;
}

.danfse-key-row > strong {
    font-size: 9px;
    letter-spacing: .7px;
    word-break: break-all;
}

.danfse-verify-box {
    min-height: 120px;
    display: grid;
    place-items: center;
    padding: 4px;
    border: 1px solid #333;
    text-align: center;
}

.danfse-verify-box img {
    width: 92px;
    height: 92px;
    display: block;
}

.danfse-verify-box span,
.danfse-verify-box small {
    display: block;
    font-size: 7px;
    word-break: break-word;
}

.danfse-v2 {
    width: min(100%, 794px);
    min-height: 1120px;
    overflow: hidden;
    border: 1px solid #000;
    color: #000;
    font-size: 7.8px;
    line-height: 1.05;
}

.danfse-model-header {
    display: grid;
    grid-template-columns: 1fr 1.35fr 1fr;
    align-items: center;
    min-height: 58px;
    border-bottom: 1px solid #000;
}

.danfse-model-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px;
}

.danfse-model-logo strong {
    color: #159447;
    font-size: 26px;
    line-height: 1;
    letter-spacing: -1px;
}

.danfse-model-logo span {
    color: #555;
    font-size: 7.5px;
    line-height: 1.05;
}

.danfse-model-title {
    display: grid;
    place-items: center;
    gap: 1px;
    text-align: center;
    font-weight: 700;
}

.danfse-model-title strong {
    font-size: 11px;
}

.danfse-model-title span {
    font-size: 9.4px;
}

.danfse-model-title b {
    color: #f00;
    font-size: 9.4px;
}

.danfse-model-meta {
    display: grid;
    gap: 1px;
    padding: 8px;
    font-size: 7.7px;
    line-height: 1.05;
}

.danfse-access-block {
    display: grid;
    grid-template-columns: 1fr 124px;
    border-bottom: 1px solid #000;
}

.danfse-model-qr {
    display: grid;
    place-items: center;
    align-content: start;
    gap: 4px;
    padding: 6px;
    border-left: 1px solid #000;
    text-align: center;
}

.danfse-model-qr img {
    width: 82px;
    height: 82px;
    display: block;
    image-rendering: pixelated;
}

.danfse-model-qr span {
    font-size: 6.2px;
    font-weight: 700;
    line-height: 1.03;
}

.danfse-v2 .danfse-section {
    padding: 0;
    border-bottom: 1px solid #000;
}

.danfse-v2 .danfse-section h3 {
    margin: 0;
    padding: 2px 5px;
    border-bottom: 1px solid #000;
    background: #eee;
    color: #000;
    font-size: 7.8px;
    font-weight: 800;
    line-height: 1;
    text-align: left;
}

.danfse-model-grid {
    display: grid;
    gap: 0;
}

.danfse-model-grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.danfse-model-grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.danfse-v2 .danfse-official-field,
.danfse-v2 .danfse-official-line {
    min-height: 30px;
    padding: 3px 5px;
    border-top: 0;
    border-right: 1px solid #d0d0d0;
    border-bottom: 1px solid #d0d0d0;
}

.danfse-v2 .danfse-official-line {
    min-height: auto;
    border-right: 0;
}

.danfse-v2 .danfse-official-field span,
.danfse-v2 .danfse-official-line span {
    color: #000;
    font: 800 6.8px Arial, Helvetica, sans-serif;
    line-height: 1.03;
}

.danfse-v2 .danfse-official-field strong,
.danfse-v2 .danfse-official-line strong {
    margin-top: 2px;
    color: #000;
    font: 400 7.9px "Microsoft Sans Serif", Arial, sans-serif;
    line-height: 1.04;
}

.danfse-v2 .danfse-official-line strong {
    max-height: 88px;
    overflow: hidden;
}

.danfse-v2 .value-field strong {
    text-align: right;
    font-weight: 700;
}

.danfse-model-footer {
    display: grid;
    grid-template-columns: 1fr 1fr 2fr;
    min-height: 38px;
    border-top: 1px solid #000;
    margin-top: 8px;
}

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

.permission-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--panel-border);
    border-radius: 14px;
    background: var(--surface-muted);
}

.permission-item input {
    width: auto;
}

.login-brand {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 22px;
    align-items: center;
}

.login-logo {
    width: 112px;
    height: 112px;
    object-fit: contain;
    border-radius: 24px;
    background: var(--surface-accent-strong);
    padding: 14px;
}

.login-copy,
.login-feature p {
    margin: 0;
    color: var(--text-soft);
}

.login-alert {
    margin: 0;
}

.assistente-banco-modal {
    width: min(100%, 920px);
}

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

.login-feature {
    padding: 18px;
    border-radius: 18px;
    border: 1px solid var(--panel-border);
    background: var(--surface-accent);
}

.form-row-3 label {
    flex: 1 1 0;
}

.table-wrapper {
    overflow-x: auto;
}

.table tr.is-inativo {
    opacity: 0.72;
}

.table tr.is-cancelada {
    opacity: 0.84;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 14px;
    border-bottom: 1px solid var(--panel-border);
    text-align: left;
}

.empty-state {
    color: var(--text-soft);
    text-align: center;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 11px;
    border-radius: 999px;
    font-size: 0.82rem;
    border: 1px solid transparent;
}

.status-pill.ativo,
.status-pill.emitida,
.status-pill.success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}

.status-pill.inativo,
.status-pill.cancelada,
.status-pill.danger {
    background: var(--danger-bg);
    color: var(--danger-text);
    border-color: var(--danger-border);
}

.status-pill.warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}

.status-pill.pendente {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}

.inline-search {
    display: flex;
    gap: 10px;
    align-items: end;
}

.inline-search label {
    flex: 1 1 auto;
}

.tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.tab-button {
    padding: 10px 14px;
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
}

.tab-button.active {
    color: var(--text);
    background: var(--surface-accent-strong);
    border-color: var(--accent-border);
}

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

.preview-card {
    display: grid;
    gap: 12px;
    justify-items: start;
}

.environment-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 14px;
}

.environment-card {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: var(--surface-accent);
    cursor: pointer;
}

.environment-card input[type="radio"] {
    margin: 0;
}

.environment-card strong {
    font-size: 1rem;
}

.environment-card span {
    color: var(--text-soft);
}

.environment-stack {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.brand-preview {
    width: min(100%, 220px);
    max-height: 120px;
    object-fit: contain;
    border-radius: 14px;
    border: 1px dashed var(--panel-border);
    padding: 10px;
    background: var(--brand-preview-bg);
}

.app-toast-container {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 60;
    display: grid;
    gap: 12px;
    width: min(100vw - 40px, 360px);
}

.app-toast {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--panel-border);
    background: var(--panel);
    box-shadow: var(--shadow);
    display: grid;
    gap: 6px;
    transform: translateY(0);
    opacity: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.app-toast strong {
    display: block;
}

.app-toast span {
    color: inherit;
    font-size: 0.86rem;
    opacity: 0.9;
}

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

.app-toast.danger {
    border-color: var(--alert-danger-border);
    background: var(--alert-danger-bg);
    color: var(--alert-danger-text);
}

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

.app-toast.info {
    border-color: var(--alert-info-border);
    background: var(--alert-info-bg);
    color: var(--alert-info-text);
}

.app-toast.hide {
    opacity: 0;
    transform: translateY(-6px);
}

.app-dialog-body {
    color: var(--text);
}

.app-dialog-body p {
    margin-top: 0;
    color: var(--text-soft);
}

.app-dialog-body ul {
    margin: 0;
    padding-left: 18px;
}

.app-dialog-body .text-danger {
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid var(--alert-danger-border);
    border-radius: 14px;
    background: var(--alert-danger-bg);
    color: var(--alert-danger-text);
}

.log-list {
    display: grid;
    gap: 12px;
}

.log-item {
    padding: 16px;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: var(--surface-accent);
    display: grid;
    gap: 8px;
}

.log-item-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.log-meta {
    color: var(--text-soft);
    font-size: 0.88rem;
}

.diagnostico-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 16px;
    margin-top: 18px;
}

.diagnostico-card {
    padding: 18px;
    border: 1px solid var(--panel-border);
    border-radius: 18px;
    background: var(--surface-accent);
}

.diagnostico-card > strong {
    display: block;
    margin-bottom: 14px;
}

.diagnostico-recomendacoes {
    color: var(--text);
}

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

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

@media (max-width: 1120px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--panel-border);
    }

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

@media (max-width: 720px) {
    body {
        padding-bottom: 72px;
    }

    .app-shell {
        display: block;
    }

    .topbar,
    .content,
    .alert {
        padding-left: 18px;
        padding-right: 18px;
    }

    .sidebar {
        position: sticky;
        top: 0;
        z-index: 40;
        padding: 12px;
        border-right: 0;
        border-bottom: 1px solid var(--panel-border);
        max-height: 42vh;
        overflow: auto;
    }

    .brand {
        padding: 10px;
    }

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

    .nav-link {
        min-height: 44px;
        padding: 10px;
        justify-content: center;
        text-align: center;
    }

    .sidebar-card {
        display: none;
    }

    .topbar {
        align-items: stretch;
        gap: 14px;
        flex-direction: column;
    }

    .topbar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .grid-summary,
    .content-grid,
    .form-row,
    .panel-header,
    .table-toolbar,
    .form-actions {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .chart-row-label {
        align-items: flex-start;
        flex-direction: column;
    }

    .chart-row-label span {
        text-align: left;
    }

    .native-chart-days {
        grid-template-columns: repeat(7, minmax(38px, 1fr));
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 6px;
    }

    .day-bar-track {
        height: 110px;
        max-width: 42px;
    }

    .button,
    .topbar-link,
    .theme-toggle {
        min-height: 44px;
    }

    .table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 16px;
    }

    .table {
        min-width: 760px;
    }

    .table-actions-inline {
        flex-wrap: nowrap;
    }

    .table-action.icon-only {
        width: 38px;
        min-width: 38px;
        height: 38px;
    }

    .modal-backdrop {
        align-items: flex-start;
        padding: 10px;
        overflow: auto;
    }

    .modal-card,
    .modal-card-lg,
    .modal-card-sm {
        width: 100%;
        max-width: none;
        max-height: none;
        border-radius: 20px;
    }

    .modal-body {
        max-height: none;
    }

    .app-toast-container {
        top: auto;
        right: 10px;
        bottom: 10px;
        left: 10px;
        width: auto;
    }

    .context-menu {
        left: 10px !important;
        right: 10px;
        width: auto;
        max-width: none;
    }

    .login-brand,
    .login-footer,
    .details-grid,
    .permission-grid,
    .diagnostico-grid,
    .environment-card-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Experiencia multiplataforma NFS-e Simples
   Desktop = software Windows | Mobile = aplicativo nativo
   ============================================================ */

.mobile-bottom-nav,
.mobile-scrim {
    display: none;
}

.desktop-search,
.desktop-page-heading,
.desktop-statusbar {
    display: none;
}

.mobile-login-title,
.mobile-dashboard-hero,
.mobile-dashboard-widgets {
    display: none;
}

.desktop-login-showcase,
.desktop-login-form-header,
.desktop-login-options,
.desktop-login-divider,
.desktop-certificate-button {
    display: none;
}

.mobile-logout-link {
    display: none;
}

input,
select,
textarea,
button,
.button,
.nav-link,
.mobile-nav-item {
    touch-action: manipulation;
}

.panel,
.stat-card,
.table-wrapper,
.modal-card,
.login-card {
    max-width: 100%;
}

@media (min-width: 1440px) {
    .content {
        padding: 28px 36px 36px;
    }

    .grid-summary {
        grid-template-columns: repeat(4, minmax(220px, 1fr));
    }

    .content-grid {
        grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.8fr);
    }
}

@media (min-width: 1920px) {
    .content {
        max-width: 1800px;
        width: 100%;
        margin: 0 auto;
    }
}

@media (min-width: 2200px) {
    .content {
        max-width: 2140px;
    }

    .content-grid {
        grid-template-columns: 1.45fr 0.75fr;
    }
}

@media (min-width: 768px) and (max-width: 1120px) {
    .app-shell {
        grid-template-columns: var(--sidebar-collapsed-width) 1fr;
    }

    .sidebar {
        height: 100vh;
        border-right: 1px solid rgba(255, 255, 255, 0.14);
        border-bottom: 0;
        padding: 16px 12px;
    }

    .brand {
        justify-content: center;
        padding: 12px;
    }

    .brand-copy,
    .nav-label,
    .sidebar-card {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 14px 10px;
    }

    .topbar {
        padding-inline: 20px;
    }

    .content,
    .alert {
        padding-inline: 20px;
    }

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

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

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

@media (max-width: 767px) {
    :root {
        --radius: 20px;
    }

    html {
        min-width: 320px;
    }

    body {
        min-width: 320px;
        padding-bottom: calc(86px + var(--safe-bottom));
        background:
            radial-gradient(circle at 50% -10%, rgba(0, 152, 255, 0.28), transparent 34%),
            linear-gradient(180deg, #f6fbff 0%, #edf5ff 52%, #eaf3ff 100%);
        color: #071947;
    }

    :root[data-theme="dark"] body {
        background:
            radial-gradient(circle at 50% -10%, rgba(0, 152, 255, 0.30), transparent 34%),
            linear-gradient(180deg, #eaf4ff 0%, #f7fbff 100%);
        color: #071947;
    }

    .app-shell {
        display: block;
        min-height: 100vh;
    }

    .mobile-scrim {
        position: fixed;
        inset: 0;
        z-index: 60;
        display: block;
        background: rgba(2, 18, 54, 0.42);
        backdrop-filter: blur(2px);
    }

    .mobile-scrim[hidden] {
        display: none;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        z-index: 70;
        width: min(86vw, 330px);
        height: 100dvh;
        max-height: none;
        padding: max(18px, env(safe-area-inset-top, 0px)) 16px calc(18px + var(--safe-bottom));
        border: 0;
        border-radius: 0 28px 28px 0;
        transform: translateX(-104%);
        transition: transform 0.24s ease;
        box-shadow: 18px 0 40px rgba(0, 38, 97, 0.28);
    }

    body.mobile-menu-open .sidebar {
        transform: translateX(0);
    }

    .brand {
        min-height: auto;
        padding: 14px;
    }

    .brand-logo {
        width: 52px;
        height: 52px;
    }

    .brand-copy {
        display: block;
    }

    .sidebar-nav {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 18px 0;
    }

    .nav-link {
        justify-content: flex-start;
        min-height: 50px;
        padding: 13px 14px;
        border-radius: 16px;
        font-size: 1rem;
    }

    .nav-label {
        display: inline;
    }

    .sidebar-card {
        display: grid;
    }

    .main-panel {
        min-height: 100vh;
        background: transparent;
    }

    .topbar {
        min-height: 64px;
        padding: calc(8px + env(safe-area-inset-top, 0px)) 14px 8px;
        border-radius: 0 0 24px 24px;
        background: linear-gradient(135deg, #0057d9, #007bff);
        box-shadow: 0 10px 22px rgba(0, 90, 210, 0.22);
        align-items: center;
        flex-direction: row;
        position: sticky;
        top: 0;
    }

    .topbar-left {
        width: 100%;
        gap: 10px;
    }

    .mobile-back {
        display: inline-grid;
        background: transparent;
    }

    .shell-toggle {
        background: transparent;
    }

    .topbar .eyebrow {
        display: none;
    }

    .topbar h1 {
        font-size: 1.05rem;
        line-height: 1.15;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar-actions {
        display: none;
    }

    .content {
        padding: 16px 14px 18px;
    }

    .alert {
        margin: 12px 14px 0;
        padding: 12px 14px;
        border-radius: 16px;
    }

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

    .stat-card,
    .panel {
        padding: 16px;
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.92);
        color: #071947;
        border-color: rgba(0, 87, 217, 0.10);
        box-shadow: 0 12px 28px rgba(0, 87, 217, 0.11);
    }

    .stat-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        min-height: 118px;
    }

    .stat-card strong {
        font-size: 0.92rem;
    }

    .stat-card p {
        color: #45577a;
        font-size: 0.86rem;
    }

    .stat-icon {
        width: 42px;
        height: 42px;
        color: #0066ee;
        background: #e8f2ff;
    }

    .content-grid,
    .content-grid.single,
    .form-row,
    .details-grid,
    .permission-grid,
    .diagnostico-grid,
    .environment-card-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .panel-header,
    .table-toolbar,
    .form-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .panel-header h2 {
        font-size: 1.08rem;
    }

    .eyebrow {
        color: #0066ee;
        font-weight: 800;
    }

    .nfse-form {
        gap: 14px;
    }

    .nfse-form label {
        gap: 7px;
    }

    .nfse-form input,
    .nfse-form select,
    .nfse-form textarea {
        min-height: 48px;
        width: 100%;
        border-radius: 15px;
        background: #f8fbff;
        color: #071947;
        border-color: rgba(0, 87, 217, 0.18);
        font-size: 16px;
    }

    .nfse-form textarea {
        min-height: 116px;
    }

    .button,
    .topbar-link,
    .theme-toggle {
        min-height: 48px;
        justify-content: center;
        border-radius: 16px;
    }

    .button.primary,
    .button.danger {
        box-shadow: 0 12px 22px rgba(0, 102, 238, 0.18);
    }

    .native-chart-days {
        grid-template-columns: repeat(7, minmax(34px, 1fr));
        min-height: 158px;
        gap: 6px;
        overflow: visible;
    }

    .day-bar-track {
        height: 92px;
        max-width: 38px;
    }

    .chart-row-label {
        align-items: flex-start;
        flex-direction: column;
    }

    .chart-row-label span {
        text-align: left;
        color: #45577a;
    }

    .table-wrapper {
        overflow: visible;
        border: 0;
        background: transparent;
        box-shadow: none;
    }

    .table {
        min-width: 0;
        width: 100%;
        border-collapse: separate;
        border-spacing: 0 12px;
    }

    .table thead {
        display: none;
    }

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

    .table tr {
        padding: 14px;
        border: 1px solid rgba(0, 87, 217, 0.10);
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 10px 24px rgba(0, 87, 217, 0.10);
    }

    .table td {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 14px;
        padding: 7px 0;
        border: 0;
        color: #071947;
        text-align: right;
        word-break: break-word;
    }

    .table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        color: #667798;
        font-size: 0.82rem;
        font-weight: 700;
        text-align: left;
    }

    .table td:has(.table-actions-inline) {
        display: block;
    }

    .table td:has(.table-actions-inline)::before {
        display: block;
        margin-bottom: 8px;
    }

    .table-actions-inline {
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 8px;
    }

    .table-action.icon-only {
        width: 44px;
        min-width: 44px;
        height: 44px;
        border-radius: 14px;
    }

    .status-pill,
    .badge {
        min-height: 28px;
        align-items: center;
    }

    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
        background: rgba(4, 18, 43, 0.48);
    }

    .modal-card,
    .modal-card-lg,
    .modal-card-sm {
        width: 100%;
        max-width: none;
        max-height: min(88dvh, 720px);
        overflow: auto;
        border-radius: 26px 26px 0 0;
        border-bottom: 0;
        background: #fff;
        color: #071947;
        padding: 18px 16px calc(18px + var(--safe-bottom));
        animation: nfse-bottom-sheet 0.22s ease;
    }

    @keyframes nfse-bottom-sheet {
        from {
            transform: translateY(20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

    .modal-body {
        max-height: none;
    }

    .context-menu {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        bottom: calc(12px + var(--safe-bottom)) !important;
        top: auto !important;
        width: auto;
        max-width: none;
        border-radius: 22px;
        padding: 10px;
    }

    .context-menu-item {
        min-height: 48px;
        border-radius: 14px;
    }

    .app-toast-container {
        top: auto;
        right: 12px;
        bottom: calc(88px + var(--safe-bottom));
        left: 12px;
        width: auto;
    }

    .app-toast {
        border-radius: 18px;
        padding: 14px 16px;
    }

    .mobile-bottom-nav {
        position: fixed;
        right: 10px;
        bottom: max(10px, var(--safe-bottom));
        left: 10px;
        z-index: 50;
        display: grid;
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px;
        min-height: 76px;
        padding: 10px 10px calc(10px + var(--safe-bottom));
        border: 1px solid rgba(0, 87, 217, 0.12);
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.94);
        box-shadow: 0 14px 34px rgba(0, 55, 130, 0.22);
        backdrop-filter: blur(16px);
    }

    .mobile-nav-item {
        position: relative;
        min-height: 58px;
        display: grid;
        place-items: center;
        gap: 2px;
        border-radius: 16px;
        color: #62708f;
        font-size: 1.52rem;
        font-weight: 900;
    }

    .mobile-nav-item strong {
        font-size: 0.76rem;
        line-height: 1;
        font-weight: 900;
    }

    .mobile-nav-item.active {
        color: #0066ee;
        background: #eaf3ff;
    }

    .mobile-nav-primary {
        transform: translateY(-22px);
        width: 68px;
        height: 68px;
        justify-self: center;
        border-radius: 50%;
        color: #fff;
        background: linear-gradient(135deg, #00a6ff, #0057d9);
        box-shadow: 0 14px 25px rgba(0, 87, 217, 0.35);
        font-size: 1.85rem;
    }

    .mobile-nav-primary strong {
        display: none;
    }

    .login-shell {
        min-height: 100dvh;
        padding: max(22px, env(safe-area-inset-top, 0px)) 18px calc(22px + var(--safe-bottom));
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(235, 246, 255, 0.92)),
            radial-gradient(circle at 50% 100%, rgba(0, 152, 255, 0.24), transparent 38%);
    }

    .login-card {
        width: 100%;
        padding: 24px 18px;
        border-radius: 30px;
        background: rgba(255, 255, 255, 0.92);
        color: #071947;
    }

    .login-brand {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .login-logo {
        width: 112px;
        height: 112px;
    }

    .login-footer {
        display: none;
    }

    .danfse-official-wrapper {
        margin-inline: -10px;
        border-radius: 16px;
        overflow: auto;
    }

    .danfse-official,
    .danfse-v2 {
        min-width: 760px;
    }
}

@media (max-width: 767px) {
    .desktop-page-heading,
    .desktop-search,
    .desktop-statusbar {
        display: none !important;
    }

    .page-login {
        padding-bottom: 0;
        background:
            linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(246, 251, 255, 0.96) 58%, rgba(219, 240, 255, 0.98) 100%),
            radial-gradient(circle at 18% 0%, rgba(0, 145, 255, 0.18), transparent 36%);
    }

    .page-login .login-shell {
        padding: 34px 24px 18px;
        align-items: stretch;
        background:
            linear-gradient(180deg, transparent 0 72%, rgba(0, 126, 255, 0.13) 72%),
            radial-gradient(circle at 50% 95%, rgba(0, 126, 255, 0.22), transparent 28%);
    }

    .page-login .login-card {
        min-height: calc(100dvh - 52px);
        align-content: center;
        gap: 22px;
        padding: 24px 0 18px;
        border: 0;
        box-shadow: none;
        background: transparent;
    }

    .page-login .login-brand {
        gap: 14px;
    }

    .page-login .login-logo {
        width: 138px;
        height: 138px;
        border-radius: 30px;
    }

    .page-login .login-brand .eyebrow {
        display: none;
    }

    .page-login .login-brand h1 {
        margin: 0;
        color: #003b92;
        font-size: clamp(2rem, 8vw, 2.55rem);
        line-height: 1;
        letter-spacing: -1.3px;
    }

    .page-login .login-brand h1::first-letter {
        color: #003b92;
    }

    .page-login .login-brand span {
        display: block;
        margin-top: 7px;
        color: #1f3764;
        font-weight: 700;
    }

    .mobile-login-title {
        display: block;
        margin: 8px 0 4px;
        color: #061f58;
        text-align: center;
        font-size: 1rem;
    }

    .page-login .nfse-form {
        gap: 14px;
        margin-top: 8px;
    }

    .page-login .nfse-form label span {
        display: none;
    }

    .page-login .nfse-form input {
        min-height: 50px;
        padding-inline: 16px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.78);
        border-color: rgba(0, 74, 180, 0.16);
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
    }

    .page-login .button.primary {
        min-height: 54px;
        justify-content: space-between;
        padding-inline: 22px;
        border-radius: 14px;
        background: linear-gradient(135deg, #009cff, #0057d9);
        font-size: 1rem;
        font-weight: 800;
    }

    .mobile-button-arrow {
        font-size: 1.35rem;
    }

    .page-login .login-card::after {
        content: "Desenvolvido por\aNFS-e Simples";
        white-space: pre;
        margin-top: 14px;
        color: #003b92;
        text-align: center;
        font-size: 0.82rem;
        font-weight: 800;
    }

    .topbar {
        border-radius: 0 0 18px 18px;
        background: linear-gradient(180deg, #005edb, #0050c5);
    }

    .topbar-left {
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        align-items: center;
    }

    .mobile-back {
        grid-column: 3;
        grid-row: 1;
        font-size: 1.55rem;
    }

    .shell-toggle {
        grid-column: 1;
        grid-row: 1;
    }

    .mobile-title {
        grid-column: 2;
        grid-row: 1;
        text-align: center;
    }

    .page-dashboard .mobile-title h1 {
        font-size: 0;
    }

    .page-dashboard .mobile-title h1::before {
        content: "NFS-e Simples";
        display: block;
        color: #fff;
        font-size: 1rem;
        font-weight: 900;
    }

    .page-dashboard .mobile-title h1::after {
        content: "● Online";
        display: block;
        margin-top: 1px;
        color: #b7ffcf;
        font-size: 0.68rem;
        font-weight: 800;
    }

    .page-dashboard .mobile-back {
        font-size: 0;
    }

    .page-dashboard .mobile-back::before {
        content: "🔔";
        font-size: 1.15rem;
    }

    .page-lista .mobile-back {
        grid-column: 1;
    }

    .page-lista .shell-toggle {
        display: none;
    }

    .page-lista .mobile-title {
        grid-column: 2;
    }

    .sidebar {
        width: min(82vw, 310px);
        background:
            radial-gradient(circle at 90% 0%, rgba(49, 158, 255, 0.25), transparent 33%),
            linear-gradient(180deg, #005ad3 0%, #003f9c 46%, #06225c 100%);
    }

    .sidebar .brand {
        justify-content: flex-start;
        margin-bottom: 18px;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .sidebar .brand strong {
        color: #fff;
        font-size: 1.15rem;
    }

    .sidebar .brand span {
        color: rgba(255, 255, 255, 0.82);
        font-size: 0.72rem;
    }

    .sidebar .nav-link {
        color: #fff;
        border-radius: 14px;
    }

    .sidebar .nav-link.active {
        background: linear-gradient(135deg, #0d8dff, #0067f0);
    }

    .sidebar .mobile-logout-link {
        display: flex;
        margin-top: 12px;
        min-height: 50px;
        color: #fff;
        background: rgba(255, 70, 70, 0.20);
        border: 1px solid rgba(255, 255, 255, 0.18);
    }

    .sidebar .mobile-logout-link .nav-icon {
        color: #fff;
        font-size: 1.35rem;
    }

    .mobile-dashboard-hero {
        display: block;
        margin: 2px 0 12px;
    }

    .mobile-dashboard-hero h2 {
        margin: 0 0 4px;
        color: #071947;
        font-size: 1.22rem;
    }

    .mobile-dashboard-hero p {
        margin: 0;
        color: #5b6b8c;
        font-size: 0.9rem;
    }

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

    .stat-card {
        min-height: 126px;
        padding: 14px;
        border-radius: 14px;
        box-shadow: 0 10px 18px rgba(0, 71, 160, 0.09);
    }

    .stat-card::after {
        content: none;
    }

    .stat-icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
        color: #fff;
        background: linear-gradient(135deg, #00adff, #0057d9);
    }

    .grid-summary .stat-card:nth-child(2) .stat-icon {
        background: linear-gradient(135deg, #18c978, #07893f);
    }

    .grid-summary .stat-card:nth-child(3) .stat-icon {
        background: linear-gradient(135deg, #24a3ff, #0057d9);
    }

    .grid-summary .stat-card:nth-child(4) .stat-icon {
        background: linear-gradient(135deg, #36d477, #159447);
    }

    .stat-card strong {
        color: #061f58;
        font-size: 1.02rem;
    }

    .stat-card p {
        color: #061f58;
        font-size: 0.83rem;
    }

    .page-dashboard .content-grid {
        display: none;
    }

    .mobile-dashboard-widgets {
        display: grid;
        gap: 12px;
    }

    .mobile-days-panel {
        padding: 14px;
    }

    .mobile-days-panel .panel-header {
        flex-direction: row;
        align-items: center;
        margin-bottom: 8px;
    }

    .mobile-days-panel h2 {
        color: #061f58;
        font-size: 0.98rem;
    }

    .mobile-days-panel .panel-header a {
        color: #0066ee;
        font-size: 0.82rem;
        font-weight: 800;
    }

    .mobile-days-panel .native-chart-days {
        min-height: 112px;
        align-items: end;
        padding-top: 8px;
    }

    .mobile-days-panel .day-bar-track {
        height: 74px;
        max-width: 34px;
        background: #e7f1ff;
        border: 0;
    }

    .mobile-days-panel .day-bar {
        background: linear-gradient(180deg, #1aa7ff, #0057d9);
    }

    .mobile-days-panel .day-bar-item {
        color: #061f58;
        font-size: 0.72rem;
        font-weight: 800;
    }

    .page-dashboard .dashboard-movement-grid {
        margin-top: 12px;
    }

    .page-dashboard .movement-panel {
        display: none;
    }

    .quick-actions-panel {
        padding: 14px;
    }

    .quick-actions-panel .panel-header {
        margin-bottom: 10px;
    }

    .quick-actions-panel .eyebrow {
        color: #061f58;
        font-size: 0.95rem;
    }

    .quick-actions-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }

    .quick-action-card {
        min-height: 76px;
        padding: 8px 6px;
        border-radius: 14px;
        background: #f1f6ff;
    }

    .quick-action-card span {
        font-size: 1.42rem;
    }

    .quick-action-card strong {
        font-size: 0.7rem;
    }

    .page-lista .content {
        padding-top: 12px;
    }

    .page-lista .panel {
        padding: 0;
        background: transparent;
        border: 0;
        box-shadow: none;
    }

    .page-lista .panel-header {
        display: none;
    }

    .page-lista .table-toolbar {
        gap: 9px;
        margin-bottom: 12px;
    }

    .page-lista #notaFiltroBusca {
        min-height: 46px;
        border-radius: 15px;
        background: #edf4ff;
        border-color: rgba(0, 87, 217, 0.10);
    }

    .page-lista #notaFiltroStatus {
        min-height: 38px;
        border-radius: 12px;
        background: #005edb;
        color: #fff;
        font-weight: 800;
    }

    .page-lista #notaFiltroInicio,
    .page-lista #notaFiltroFim {
        display: none;
    }

    .page-lista .table tr {
        position: relative;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "numero status"
            "tomador status"
            "data valor";
        column-gap: 14px;
        row-gap: 4px;
        min-height: 100px;
        padding: 16px 46px 16px 14px;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 9px 20px rgba(0, 55, 130, 0.08);
    }

    .page-lista .table tr::after {
        content: "›";
        position: absolute;
        top: 50%;
        right: 16px;
        transform: translateY(-50%);
        color: #0066ee;
        font-size: 1.7rem;
        font-weight: 800;
    }

    .page-lista .table td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 2px 0;
        text-align: left;
    }

    .page-lista .table td::before {
        display: none;
    }

    .page-lista .table td:nth-child(1) {
        grid-area: numero;
        color: #061f58;
        font-size: 0.98rem;
        font-weight: 900;
    }

    .page-lista .table td:nth-child(1)::before {
        content: "Nº ";
        display: inline;
        color: inherit;
        font-size: inherit;
        font-weight: inherit;
    }

    .page-lista .table td:nth-child(2) {
        grid-area: tomador;
        overflow: hidden;
        color: #293b62;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 700;
    }

    .page-lista .table td:nth-child(4) {
        grid-area: valor;
        position: static;
        justify-self: end;
        align-self: end;
        color: #061f58;
        text-align: right;
        white-space: nowrap;
        font-weight: 900;
    }

    .page-lista .table td:nth-child(5) {
        grid-area: data;
        color: #6b7896;
        font-size: 0.84rem;
    }

    .page-lista .table td:nth-child(6) {
        grid-area: status;
        position: static;
        justify-self: end;
        align-self: start;
        text-align: right;
        white-space: nowrap;
    }

    .page-lista .table td:nth-child(3),
    .page-lista .table td:nth-child(7),
    .page-lista .table td:nth-child(8) {
        display: none;
    }

    .page-lista .table-hint {
        display: none;
    }
}

@media (max-width: 374px) {
    .content {
        padding-inline: 10px;
    }

    .grid-summary {
        gap: 8px;
    }

    .stat-card,
    .panel {
        padding: 13px;
    }

    .mobile-bottom-nav {
        right: 6px;
        left: 6px;
    }
}

@media (min-width: 768px) {
    .page-login {
        min-height: 100vh;
        background:
            linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(220, 239, 255, 0.78)),
            radial-gradient(circle at 88% 12%, rgba(0, 152, 255, 0.22), transparent 28%),
            linear-gradient(145deg, #edf7ff 0%, #d8ecff 52%, #bfe0ff 100%);
        color: #061f58;
    }

    .page-login::before {
        content: "▣  NFS-e Simples - Login";
        position: fixed;
        top: 0;
        right: 0;
        left: 0;
        z-index: 20;
        height: 34px;
        display: flex;
        align-items: center;
        padding: 0 14px;
        color: #061f58;
        font-size: 0.95rem;
        font-weight: 800;
        background: rgba(224, 241, 255, 0.62);
        backdrop-filter: blur(10px);
    }

    .page-login::after {
        content: "─  □  ×";
        position: fixed;
        top: 0;
        right: 16px;
        z-index: 21;
        height: 34px;
        display: flex;
        align-items: center;
        color: #071947;
        font-size: 1.25rem;
        letter-spacing: 18px;
        pointer-events: none;
    }

    .page-login .login-shell {
        position: relative;
        min-height: 100vh;
        padding: 58px clamp(42px, 7vw, 120px) 54px;
        place-items: center;
        overflow: hidden;
        background:
            radial-gradient(ellipse at 20% 72%, rgba(0, 87, 217, 0.10), transparent 34%),
            linear-gradient(168deg, transparent 0 72%, rgba(0, 91, 220, 0.95) 72% 100%);
    }

    .page-login .login-shell::before {
        content: "";
        position: absolute;
        right: -6vw;
        bottom: -9vw;
        left: -6vw;
        height: 34vh;
        min-height: 210px;
        background:
            radial-gradient(ellipse at 75% 20%, rgba(0, 152, 255, 0.32), transparent 35%),
            linear-gradient(9deg, #0048bd 0%, #007fff 48%, rgba(255, 255, 255, 0.50) 49%, rgba(255, 255, 255, 0.0) 62%);
        opacity: 0.96;
        pointer-events: none;
    }

    .page-login .login-layout {
        position: relative;
        z-index: 1;
        width: min(100%, 1440px);
    }

    .page-login .login-card {
        display: grid;
        grid-template-columns: minmax(460px, 1fr) minmax(420px, 560px);
        align-items: center;
        gap: clamp(42px, 7vw, 110px);
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .desktop-login-showcase {
        display: grid;
        justify-items: center;
        text-align: center;
        color: #063071;
    }

    .desktop-login-logo {
        width: clamp(190px, 18vw, 270px);
        height: clamp(190px, 18vw, 270px);
        object-fit: contain;
        filter: drop-shadow(0 14px 24px rgba(0, 87, 217, 0.16));
    }

    .desktop-login-showcase h1 {
        margin: 8px 0 8px;
        color: #00419f;
        font-size: clamp(3.4rem, 5.2vw, 5.6rem);
        line-height: 0.95;
        letter-spacing: -3px;
    }

    .desktop-login-showcase h1::first-letter {
        color: #003077;
    }

    .desktop-login-showcase p {
        margin: 0 0 38px;
        color: #1e3a70;
        font-size: clamp(1.4rem, 2vw, 2rem);
        font-weight: 700;
    }

    .desktop-login-showcase > strong {
        display: block;
        margin-bottom: 34px;
        color: #003077;
        font-size: clamp(1.8rem, 2.8vw, 3rem);
        line-height: 1.1;
        font-weight: 900;
    }

    .desktop-login-benefits {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
        width: min(100%, 560px);
    }

    .desktop-login-benefits span {
        position: relative;
        display: grid;
        justify-items: center;
        gap: 7px;
        color: #032866;
        font-size: 1.04rem;
        font-weight: 800;
        line-height: 1.12;
    }

    .desktop-login-benefits span + span::before {
        content: "";
        position: absolute;
        top: 8px;
        bottom: 3px;
        left: -12px;
        width: 1px;
        background: rgba(0, 48, 119, 0.36);
    }

    .desktop-login-benefits b {
        color: #006ff0;
        font-size: 2.25rem;
        line-height: 1;
    }

    .desktop-login-form-card {
        display: grid;
        overflow: hidden;
        border-radius: 24px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 28px 70px rgba(0, 43, 112, 0.24);
        border: 1px solid rgba(0, 87, 217, 0.10);
    }

    .desktop-login-form-header {
        position: relative;
        min-height: 150px;
        display: flex;
        align-items: center;
        gap: 30px;
        padding: 34px 52px 46px;
        color: #fff;
        background:
            radial-gradient(circle at 88% 92%, rgba(0, 172, 255, 0.32), transparent 42%),
            linear-gradient(135deg, #003399, #007dff);
    }

    .desktop-login-form-header::after {
        content: "";
        position: absolute;
        right: -8%;
        bottom: -38px;
        left: -8%;
        height: 72px;
        border-radius: 50% 50% 0 0;
        background: #fff;
    }

    .desktop-login-form-header span {
        position: relative;
        z-index: 1;
        font-size: 4rem;
        line-height: 1;
    }

    .desktop-login-form-header div {
        position: relative;
        z-index: 1;
    }

    .desktop-login-form-header h2 {
        margin: 0;
        color: #fff;
        font-size: clamp(2rem, 2.8vw, 2.7rem);
        line-height: 1;
    }

    .desktop-login-form-header p {
        margin: 9px 0 0;
        color: rgba(255, 255, 255, 0.84);
        font-size: 1.35rem;
        font-weight: 700;
    }

    .page-login .login-brand,
    .page-login .login-footer {
        display: none;
    }

    .page-login .login-alert {
        margin: 24px 48px 0;
    }

    .page-login .nfse-form {
        display: grid;
        gap: 20px;
        padding: 44px 48px 24px;
    }

    .page-login .mobile-login-title {
        display: none;
    }

    .page-login .nfse-form label > span {
        display: none;
    }

    .page-login .nfse-form input[type="text"],
    .page-login .nfse-form input[type="password"] {
        min-height: 58px;
        padding: 0 22px;
        border: 1px solid rgba(36, 74, 128, 0.22);
        border-radius: 15px;
        background: #fff;
        color: #061f58;
        font-size: 1.16rem;
        box-shadow: inset 0 0 0 1px rgba(0, 87, 217, 0.02);
    }

    .desktop-login-options {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        color: #061f58;
        font-weight: 800;
    }

    .desktop-remember {
        display: inline-flex !important;
        width: auto !important;
        align-items: center;
        gap: 10px !important;
    }

    .desktop-remember input[type="checkbox"] {
        width: 24px;
        height: 24px;
        accent-color: #0078ff;
    }

    .desktop-login-options a {
        color: #0066d9;
        text-decoration: underline;
    }

    .page-login .form-actions {
        display: block;
    }

    .page-login .button.primary {
        width: 100%;
        min-height: 60px;
        gap: 14px;
        border-radius: 15px;
        background: linear-gradient(135deg, #0064f0, #00a7ff);
        font-size: 1.18rem;
        font-weight: 900;
        box-shadow: 0 16px 28px rgba(0, 87, 217, 0.24);
    }

    .page-login .mobile-button-arrow {
        font-size: 1.55rem;
        order: -1;
    }

    .desktop-login-divider {
        display: grid;
        grid-template-columns: 1fr auto 1fr;
        align-items: center;
        gap: 14px;
        color: #71809d;
        font-weight: 800;
    }

    .desktop-login-divider::before,
    .desktop-login-divider::after {
        content: "";
        height: 1px;
        background: rgba(36, 74, 128, 0.18);
    }

    .desktop-certificate-button {
        display: inline-flex;
        width: 100%;
        min-height: 56px;
        border: 1px solid #0078ff;
        background: #fff;
        color: #0057c8;
        font-size: 1.06rem;
        font-weight: 900;
    }

    .desktop-login-form-card::after {
        content: "ℹ  NFS-e Simples v1.0.0\aDesenvolvido por Painel de Controle";
        white-space: pre;
        display: block;
        padding: 8px 24px 22px;
        color: #23406f;
        text-align: center;
        font-size: 0.86rem;
        font-weight: 700;
        line-height: 1.5;
    }

    :root[data-theme="light"] body,
    body {
        background: #eaf3ff;
    }

    .app-shell {
        padding-bottom: 34px;
    }

    .sidebar {
        padding: 0 18px 18px;
        background:
            radial-gradient(circle at 95% 90%, rgba(48, 149, 255, 0.26), transparent 34%),
            linear-gradient(180deg, #005ed8 0%, #004298 48%, #032866 100%);
        border-right: 0;
        box-shadow: 8px 0 24px rgba(0, 58, 145, 0.16);
    }

    .brand {
        min-height: 150px;
        margin: 0 -18px 22px;
        padding: 22px 18px 24px;
        justify-content: center;
        border: 0;
        border-radius: 0 0 24px 0;
        background: linear-gradient(135deg, #f8fbff 0%, #eaf4ff 100%);
        box-shadow: 0 10px 24px rgba(0, 61, 150, 0.16);
        color: #06245d;
    }

    .brand-logo {
        width: 82px;
        height: 82px;
    }

    .brand strong {
        color: #01429e;
        font-size: 1.18rem;
    }

    .sidebar .brand span {
        color: #326096;
        font-size: 0.78rem;
    }

    .sidebar-nav {
        gap: 8px;
        margin: 0 0 24px;
    }

    .nav-link {
        min-height: 52px;
        border-radius: 14px;
        color: rgba(255, 255, 255, 0.90);
        font-size: 1rem;
    }

    .nav-icon {
        font-size: 1.34rem;
    }

    .nav-link.active,
    .nav-link:hover {
        background: linear-gradient(135deg, #0b8dff, #0066e8);
        box-shadow: 0 10px 22px rgba(0, 36, 118, 0.24);
    }

    .sidebar-footer-card {
        margin-top: 42px;
        padding: 18px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.10);
        color: #fff;
    }

    .main-panel {
        background: #edf5ff;
    }

    .topbar {
        min-height: 72px;
        padding: 0 28px;
        border-radius: 0;
        background:
            linear-gradient(116deg, transparent 0 4%, rgba(255, 255, 255, 0.08) 4% 9%, transparent 9%),
            linear-gradient(90deg, #004ebf 0%, #0078ff 58%, #0046ad 100%);
        box-shadow: 0 8px 22px rgba(0, 74, 180, 0.18);
    }

    .topbar-left {
        flex: 1;
    }

    .shell-toggle {
        background: transparent;
        font-size: 1.7rem;
    }

    .desktop-search {
        width: min(520px, 44vw);
        height: 46px;
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 0 10px 0 18px;
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.17);
        border: 1px solid rgba(255, 255, 255, 0.14);
    }

    .desktop-search input {
        width: 100%;
        border: 0;
        outline: 0;
        background: transparent;
        color: #fff;
        font-size: 0.98rem;
    }

    .desktop-search input::placeholder {
        color: rgba(255, 255, 255, 0.74);
    }

    .desktop-search button {
        width: 36px;
        height: 36px;
        border: 0;
        border-radius: 12px;
        background: transparent;
        color: #fff;
        cursor: pointer;
        font-size: 1.55rem;
    }

    .mobile-title {
        display: none;
    }

    .topbar-actions {
        flex-wrap: nowrap;
    }

    .theme-toggle,
    .topbar-link {
        display: none;
    }

    .notification-chip {
        position: relative;
        width: 48px;
        height: 48px;
        display: inline-grid;
        place-items: center;
        border-radius: 16px;
        background: rgba(0, 38, 117, 0.18);
        font-size: 1.25rem;
    }

    .notification-chip small {
        position: absolute;
        top: 5px;
        right: 7px;
        min-width: 18px;
        height: 18px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: #ef233c;
        color: #fff;
        font-size: 0.68rem;
        font-weight: 800;
    }

    .desktop-user-card {
        display: inline-flex;
        align-items: center;
        gap: 10px;
        padding: 8px 12px;
        min-width: 190px;
        border-radius: 18px;
        background: rgba(0, 38, 117, 0.20);
        color: #fff;
    }

    .desktop-user-card strong,
    .desktop-user-card small {
        display: block;
    }

    .desktop-user-card small {
        color: rgba(255, 255, 255, 0.84);
        font-size: 0.78rem;
    }

    .desktop-user-card small i {
        display: inline-block;
        width: 9px;
        height: 9px;
        margin-right: 5px;
        border-radius: 50%;
        background: #15d66f;
    }

    .user-avatar {
        width: 42px;
        height: 42px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: #e8f2ff;
        color: #9cb6dd;
        font-size: 1.5rem;
    }

    .content {
        padding: 24px 28px 34px;
    }

    .desktop-page-heading {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 18px;
        margin-bottom: 22px;
    }

    .desktop-page-heading > div:first-child {
        position: relative;
        padding-left: 22px;
    }

    .desktop-page-heading > div:first-child::before {
        content: "";
        position: absolute;
        top: 8px;
        bottom: 5px;
        left: 0;
        width: 8px;
        border-radius: 999px;
        background: #0078ff;
    }

    .desktop-page-heading h1 {
        margin: 0;
        color: #042567;
        font-size: 2rem;
        line-height: 1.05;
    }

    .desktop-page-heading .eyebrow {
        margin: 0 0 4px;
        color: #042567;
        font-size: 0.94rem;
        font-weight: 800;
        text-transform: none;
    }

    .desktop-date-card {
        min-width: 220px;
        display: grid;
        grid-template-columns: 34px 1fr;
        align-items: center;
        column-gap: 10px;
        padding: 14px 18px;
        border-radius: 18px;
        background: #e7f0ff;
        border: 1px solid rgba(0, 87, 217, 0.10);
        box-shadow: 0 8px 18px rgba(0, 87, 217, 0.08);
        color: #042567;
    }

    .desktop-date-card span {
        grid-row: span 2;
        color: #006eea;
        font-size: 1.45rem;
    }

    .desktop-date-card strong,
    .desktop-date-card small {
        display: block;
    }

    .desktop-date-card small {
        color: #365a94;
        font-weight: 700;
    }

    .grid-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
        margin-bottom: 18px;
    }

    .stat-card,
    .panel {
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(5, 80, 180, 0.12);
        box-shadow: 0 8px 20px rgba(0, 59, 140, 0.10);
        color: #061f58;
    }

    .stat-card {
        min-height: 108px;
        padding: 16px 18px;
    }

    .stat-card::after {
        content: "›";
        margin-left: auto;
        width: 40px;
        height: 40px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: #edf4ff;
        color: #0073ef;
        font-size: 2rem;
        line-height: 1;
    }

    .stat-card strong {
        color: #061f58;
        font-size: 1.02rem;
    }

    .stat-card p {
        margin: 5px 0 0;
        color: #46618e;
        font-weight: 700;
    }

    .stat-icon {
        width: 58px;
        height: 58px;
        border-radius: 18px;
        color: #fff;
        background: linear-gradient(135deg, #00aeff, #005ce8);
        box-shadow: 0 10px 18px rgba(0, 99, 235, 0.24);
        font-size: 1.5rem;
    }

    .grid-summary .stat-card:nth-child(2) .stat-icon {
        background: linear-gradient(135deg, #2ed25d, #0ba840);
    }

    .grid-summary .stat-card:nth-child(3) .stat-icon {
        background: linear-gradient(135deg, #8c38ff, #4f17d6);
    }

    .grid-summary .stat-card:nth-child(4) .stat-icon {
        background: linear-gradient(135deg, #ffb11f, #ff8500);
    }

    .content-grid {
        grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr);
        gap: 18px;
    }

    .content-grid.single {
        grid-template-columns: 1fr;
        margin-top: 18px;
    }

    .panel {
        padding: 20px;
    }

    .panel-header {
        margin-bottom: 14px;
    }

    .panel-header h2 {
        color: #061f58;
        font-size: 1.55rem;
    }

    .panel .eyebrow {
        color: #061f58;
        font-size: 0.95rem;
        text-transform: none;
    }

    .nfse-form input,
    .nfse-form select,
    .nfse-form textarea {
        min-height: 42px;
        border-color: rgba(0, 57, 136, 0.18);
        background: #f8fbff;
        color: #061f58;
    }

    .button.primary {
        border: 0;
        background: linear-gradient(135deg, #07a9ff, #005ee8);
        box-shadow: 0 10px 18px rgba(0, 102, 238, 0.20);
    }

    .donut-chart-card {
        min-height: 230px;
        display: grid;
        grid-template-columns: minmax(180px, 240px) 1fr;
        align-items: center;
        gap: 28px;
        padding: 10px 6px 4px;
    }

    .donut-ring {
        --donut-percent: 0%;
        width: 220px;
        height: 220px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background:
            radial-gradient(circle at center, #fff 0 43%, transparent 44%),
            conic-gradient(#006dff var(--donut-percent), #ff9f0a 0);
    }

    .donut-ring > div {
        width: 118px;
        height: 118px;
        display: grid;
        place-items: center;
        align-content: center;
        border-radius: 50%;
        background: #fff;
        color: #061f58;
        box-shadow: inset 0 0 0 1px rgba(0, 87, 217, 0.04);
    }

    .donut-ring strong {
        font-size: 2.2rem;
        line-height: 1;
    }

    .donut-ring span {
        font-weight: 800;
    }

    .donut-legend {
        display: grid;
        gap: 14px;
    }

    .donut-legend-row {
        display: grid;
        grid-template-columns: 14px 1fr auto auto;
        align-items: center;
        gap: 12px;
        color: #061f58;
    }

    .legend-dot {
        width: 13px;
        height: 13px;
        border-radius: 50%;
        background: #ff9f0a;
    }

    .legend-dot.status-emitida,
    .legend-dot.status-autorizada {
        background: #006dff;
    }

    .legend-dot.status-cancelada {
        background: #ef4444;
    }

    .legend-dot.status-pendente,
    .legend-dot.status-rascunho {
        background: #ff9f0a;
    }

    .native-chart-days {
        min-height: 120px;
        padding: 0 6px;
    }

    .day-bar-track {
        height: 86px;
        background: #edf4ff;
    }

    .table-wrapper {
        border-radius: 14px;
        border-color: rgba(0, 57, 136, 0.12);
        background: #fff;
    }

    .table th {
        background: #eaf2ff;
        color: #061f58;
    }

    .table td {
        color: #061f58;
    }

    .dashboard-movement-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 310px;
        gap: 18px;
        margin-top: 18px;
    }

    .movement-panel,
    .quick-actions-panel {
        padding: 14px 16px;
    }

    .movement-panel .panel-header,
    .quick-actions-panel .panel-header {
        margin-bottom: 8px;
    }

    .movement-panel .panel-header h2 {
        font-size: 1.03rem;
    }

    .movement-panel .eyebrow,
    .quick-actions-panel .eyebrow {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        margin: 0;
        color: #061f58;
        font-size: 0.95rem;
        font-weight: 900;
    }

    .movement-panel .eyebrow::before {
        content: "⟳";
        color: #0078ff;
        font-size: 1.12rem;
    }

    .quick-actions-panel .eyebrow::before {
        content: "↗";
        color: #0078ff;
        font-size: 1.12rem;
    }

    .movement-see-all {
        min-height: 36px;
        padding: 8px 13px;
        border-radius: 14px;
        background: #eef5ff;
        border-color: rgba(0, 102, 238, 0.15);
        color: #0066ee;
        font-weight: 800;
    }

    .dashboard-movement-table {
        border-radius: 10px;
        overflow: hidden;
        box-shadow: none;
    }

    .dashboard-movement-table .table {
        font-size: 0.86rem;
    }

    .dashboard-movement-table .table th {
        padding: 8px 12px;
        background: #eaf2ff;
        color: #061f58;
        font-weight: 900;
    }

    .dashboard-movement-table .table td {
        padding: 7px 12px;
        border-top: 1px solid rgba(0, 87, 217, 0.11);
        font-weight: 700;
    }

    .dashboard-movement-table .table td:nth-child(4),
    .dashboard-movement-table .table td:nth-child(5),
    .dashboard-movement-table .table td:nth-child(6) {
        text-align: center;
    }

    .dashboard-actions-inline {
        justify-content: center;
        gap: 6px;
    }

    .dashboard-actions-inline .table-action.icon-only {
        width: 28px;
        min-width: 28px;
        height: 24px;
        min-height: 24px;
        border-radius: 999px;
        padding: 0;
        background: #eaf3ff;
        border-color: rgba(0, 102, 238, 0.12);
        color: #0066ee;
        font-size: 0.72rem;
    }

    .quick-actions-panel {
        align-self: stretch;
    }

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

    .quick-action-card {
        min-height: 82px;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 7px;
        padding: 12px 10px;
        border: 1px solid rgba(0, 87, 217, 0.15);
        border-radius: 14px;
        background: linear-gradient(180deg, #ffffff, #f4f8ff);
        color: #061f58;
        text-align: center;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
        transition: transform .18s ease, box-shadow .18s ease;
    }

    .quick-action-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 10px 20px rgba(0, 87, 217, 0.12);
    }

    .quick-action-card span {
        color: #0078ff;
        font-size: 1.8rem;
        line-height: 1;
    }

    .quick-action-card strong {
        color: #061f58;
        font-size: 0.86rem;
        line-height: 1.15;
    }

    .desktop-statusbar {
        position: fixed;
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 45;
        height: 34px;
        display: flex;
        align-items: center;
        gap: 26px;
        padding: 0 18px;
        border-top: 1px solid rgba(0, 65, 155, 0.14);
        background: #dfeeff;
        color: #06245d;
        font-size: 0.82rem;
        box-shadow: 0 -4px 16px rgba(0, 65, 155, 0.08);
    }

    .desktop-statusbar span {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding-right: 18px;
        border-right: 1px solid rgba(0, 65, 155, 0.22);
    }

    .desktop-statusbar time {
        margin-left: auto;
        font-weight: 700;
    }

    .status-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: #15c86a;
    }
}

@media (min-width: 768px) and (max-width: 1380px) {
    :root {
        --sidebar-width: 260px;
    }

    .content {
        padding: 20px 22px 34px;
    }

    .grid-summary {
        gap: 12px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-icon {
        width: 52px;
        height: 52px;
    }

    .panel {
        padding: 18px;
    }

    .donut-ring {
        width: 190px;
        height: 190px;
    }
}

@media (min-width: 768px) and (max-width: 1120px) {
    .grid-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .desktop-search {
        width: min(420px, 48vw);
    }
}

@media (max-width: 767px) {
    .dashboard-movement-grid {
        display: grid;
        gap: 14px;
    }

    .movement-see-all {
        width: 100%;
    }

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

    .quick-action-card {
        min-height: 86px;
        display: grid;
        place-items: center;
        align-content: center;
        gap: 7px;
        padding: 12px;
        border: 1px solid rgba(0, 87, 217, 0.14);
        border-radius: 18px;
        background: #f8fbff;
        color: #061f58;
        text-align: center;
    }

    .quick-action-card span {
        color: #0078ff;
        font-size: 1.65rem;
    }

    .quick-action-card strong {
        font-size: 0.86rem;
        line-height: 1.16;
    }
}
