: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;
}

.check-option {
    display: flex !important;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
    border: 1px solid var(--panel-border);
    border-radius: 16px;
    background: var(--surface-accent);
}

.nfse-form .check-option input[type="checkbox"] {
    width: 22px;
    min-width: 22px;
    height: 22px;
    min-height: 22px;
    margin: 0;
    padding: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.check-option span {
    color: var(--text);
    font-weight: 800;
    line-height: 1.3;
}

.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: 8.4px;
    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: 8px;
    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: 12px;
}

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

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

.danfse-model-meta {
    display: grid;
    gap: 1px;
    padding: 8px;
    font-size: 8.2px;
    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.8px;
    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: 8.4px;
    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 7.3px 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 8.6px "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);
}

.empresa-page {
    gap: 0;
}

.empresa-shell {
    padding: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 0%, rgba(0, 152, 255, 0.18), transparent 34%),
        linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(218, 235, 255, 0.94));
    border-color: rgba(0, 88, 214, 0.18);
}

.empresa-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
    padding: 8px 4px 2px;
    color: #002c8f;
}

.empresa-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.empresa-title-icon {
    display: inline-grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0875ff, #004bd6);
    color: #fff;
    font-size: 1.75rem;
    box-shadow: 0 12px 24px rgba(0, 78, 190, 0.22);
}

.empresa-page-header h1 {
    margin: 0;
    font-size: 1.62rem;
    line-height: 1.1;
}

.empresa-page-header p {
    margin: 4px 0 0;
    color: #0050b8;
    font-weight: 600;
}

.empresa-back-button {
    min-height: 44px;
    color: #003796;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(0, 91, 214, 0.22);
    box-shadow: 0 10px 20px rgba(0, 71, 180, 0.10);
    font-weight: 700;
}

.empresa-button-icon {
    display: inline-grid;
    place-items: center;
    width: 20px;
    min-width: 20px;
    line-height: 1;
    font-size: 1.05em;
}

.empresa-panel-summary {
    margin-bottom: 12px;
    padding: 0 2px;
}

.empresa-panel-summary .eyebrow,
.empresa-panel-summary h2 {
    display: none;
}

.empresa-page .tabs {
    gap: 4px;
    margin: 0;
    padding: 0 0 0 2px;
    border-bottom: 1px solid rgba(0, 82, 190, 0.22);
}

.empresa-page .tab-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border-color: rgba(0, 82, 190, 0.25);
    border-radius: 10px 10px 0 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(225, 238, 255, 0.92));
    color: #002b80;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.empresa-page .tab-button.active {
    color: #fff;
    background: linear-gradient(135deg, #0057df, #009cff);
    border-color: #0078ff;
    box-shadow: 0 10px 18px rgba(0, 105, 230, 0.18);
}

.empresa-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 18px;
    align-items: start;
    padding-top: 18px;
}

.empresa-main-card,
.empresa-card {
    border: 1px solid rgba(0, 94, 220, 0.20);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 18px 35px rgba(0, 85, 190, 0.11);
}

.empresa-main-card {
    overflow: hidden;
}

.empresa-tab-card,
.empresa-main-card .tab-panel {
    padding: 16px 18px 18px;
}

.empresa-section-title,
.empresa-card-title {
    margin: -16px -18px 16px;
    padding: 12px 18px;
    border-radius: 14px 14px 0 0;
    background: linear-gradient(135deg, #004ecf, #00a7ff);
    color: #fff;
    font-weight: 900;
}

.empresa-page .form-row {
    gap: 14px;
}

.empresa-page .nfse-form {
    gap: 14px;
}

.empresa-page .nfse-form label {
    gap: 5px;
}

.empresa-page .nfse-form label > span {
    color: #002c8f;
    font-size: 0.83rem;
    font-weight: 800;
}

.empresa-page .nfse-form input,
.empresa-page .nfse-form select,
.empresa-page .nfse-form textarea {
    min-height: 38px;
    padding: 8px 12px;
    border-color: rgba(0, 84, 200, 0.28);
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.86);
    color: #001f5f;
    font-weight: 600;
}

.empresa-page .inline-search {
    gap: 8px;
}

.empresa-page .inline-search .icon-button {
    min-width: 42px;
    min-height: 38px;
    padding: 8px;
    border-radius: 10px;
}

.empresa-side-panel {
    display: grid;
    gap: 18px;
}

.empresa-card {
    overflow: hidden;
    padding: 16px;
}

.empresa-card-title {
    margin: -16px -16px 14px;
    padding: 12px 16px;
}

.empresa-logo-preview-box {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 190px;
    padding: 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid rgba(0, 84, 200, 0.18);
}

.empresa-logo-preview-box .brand-preview {
    width: 100%;
    max-width: 230px;
    max-height: 150px;
    border: 0;
    padding: 0;
}

.empresa-logo-edit {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 9px;
    background: #e7f1ff;
    color: #0047bd;
    cursor: pointer;
    font-weight: 900;
}

.empresa-logo-hint {
    display: flex;
    gap: 10px;
    margin: 12px 0;
    padding: 12px;
    border-radius: 12px;
    background: #e8f3ff;
    color: #0040aa;
    font-size: 0.86rem;
    line-height: 1.35;
}

.empresa-logo-hint strong {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    border-radius: 50%;
    background: #0067f5;
    color: #fff;
}

.empresa-logo-button {
    width: 100%;
    min-height: 44px;
    border-radius: 12px;
    font-weight: 900;
}

.empresa-switch-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 46px;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: #002c8f;
    font-size: 0.91rem;
    font-weight: 800;
}

.empresa-page .empresa-switch-row input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 1px;
    min-width: 1px;
    height: 1px;
    min-height: 1px;
    padding: 0;
    margin: 0;
}

.empresa-switch-row i {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #9eb8df;
    box-shadow: inset 0 1px 3px rgba(0, 31, 95, 0.20);
    transition: background 0.2s ease;
}

.empresa-switch-row i::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 31, 95, 0.24);
    transition: transform 0.2s ease;
}

.empresa-switch-row input:checked + i {
    background: linear-gradient(135deg, #0067f5, #00a2ff);
}

.empresa-switch-row input:checked + i::after {
    transform: translateX(20px);
}

.empresa-page .form-actions {
    justify-content: flex-end;
    margin-top: -10px;
    padding: 0 10px 6px;
}

.empresa-page .form-actions .button {
    min-height: 46px;
    border-radius: 12px;
    font-weight: 900;
}

.emitir-page {
    gap: 0;
}

.emitir-shell {
    padding: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 0%, rgba(0, 120, 255, 0.16), transparent 36%),
        linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(220, 236, 255, 0.95));
    border-color: rgba(0, 88, 214, 0.18);
}

.emitir-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #00348f;
    font-weight: 900;
}

.emitir-breadcrumb a {
    color: #003fae;
}

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

.emitir-title-group {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    color: #00339b;
}

.emitir-title-icon {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 16px;
    color: #0064f5;
    font-size: 2.4rem;
    filter: drop-shadow(0 10px 16px rgba(0, 88, 220, 0.22));
}

.emitir-page-header h1 {
    margin: 0;
    font-size: 1.9rem;
    line-height: 1.05;
}

.emitir-page-header p {
    margin: 5px 0 0;
    color: #004eb8;
    font-weight: 700;
}

.emitir-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.emitir-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 142px;
    min-height: 52px;
    padding: 0 22px;
    border: 1px solid rgba(0, 82, 190, 0.24);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(226, 239, 255, 0.92));
    color: #002b80;
    box-shadow: 0 10px 20px rgba(0, 82, 190, 0.08);
    cursor: default;
    font-weight: 900;
}

.emitir-step.active {
    color: #fff;
    background: linear-gradient(135deg, #005ee8, #00a7ff);
    border-color: #0078ff;
    box-shadow: 0 12px 24px rgba(0, 100, 230, 0.20);
}

.emitir-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 18px;
    align-items: start;
}

.emitir-main {
    display: grid;
    gap: 16px;
}

.emitir-card,
.emitir-summary-card {
    overflow: hidden;
    border: 1px solid rgba(0, 94, 220, 0.20);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 18px 35px rgba(0, 85, 190, 0.10);
}

.emitir-card {
    padding: 16px;
}

.emitir-summary-card {
    padding: 14px;
}

.emitir-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: -16px -16px 16px;
    padding: 13px 16px;
    background: linear-gradient(135deg, #eaf4ff, #dfeeff);
    color: #002c8f;
    font-weight: 950;
    font-size: 1.02rem;
}

.emitir-summary-card .emitir-card-title {
    margin: -14px -14px 14px;
}

.emitir-tomador-type {
    display: grid;
    gap: 8px;
    margin-bottom: 12px;
}

.emitir-tomador-type > span,
.emitir-page .nfse-form label > span {
    color: #002c8f;
    font-weight: 850;
}

.emitir-type-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 170px));
    gap: 12px;
}

.emitir-type-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 42px;
    border: 1px solid rgba(0, 82, 190, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    color: #002b80;
    cursor: pointer;
    font-weight: 850;
}

.emitir-type-button.active {
    color: #fff;
    background: linear-gradient(135deg, #0065f4, #00a2ff);
    box-shadow: 0 10px 20px rgba(0, 105, 230, 0.18);
}

.emitir-page .form-row {
    gap: 14px;
}

.emitir-page .nfse-form {
    gap: 14px;
}

.emitir-page .nfse-form input,
.emitir-page .nfse-form select,
.emitir-page .nfse-form textarea {
    min-height: 40px;
    padding: 9px 12px;
    border-color: rgba(0, 84, 200, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.88);
    color: #001f5f;
    font-weight: 650;
}

.emitir-page .required-mark {
    color: #ef233c;
    font-weight: 950;
}

.emitir-input-icon {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: stretch;
}

.emitir-input-icon i {
    display: grid;
    place-items: center;
    min-height: 40px;
    border: 1px solid rgba(0, 84, 200, 0.28);
    border-right: 0;
    border-radius: 10px 0 0 10px;
    background: rgba(231, 242, 255, 0.95);
    color: #004fc7;
    font-style: normal;
    font-weight: 950;
}

.emitir-input-icon input {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
}

.emitir-page .field-help {
    color: #315ea8;
}

.emitir-input-action {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 54px;
    gap: 0;
}

.emitir-input-action input {
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.emitir-input-action .icon-button {
    min-width: 54px;
    min-height: 40px;
    border-radius: 0 10px 10px 0;
}

.emitir-summary-total {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0069f5, #00a5ff);
    color: #fff;
    box-shadow: 0 14px 26px rgba(0, 100, 230, 0.24);
}

.emitir-summary-total > span {
    font-size: 2.6rem;
    line-height: 1;
}

.emitir-summary-total small {
    display: block;
    font-weight: 850;
    opacity: 0.92;
}

.emitir-summary-total strong {
    display: block;
    margin-top: 6px;
    font-size: 1.9rem;
    line-height: 1;
}

.emitir-summary-list {
    display: grid;
    margin-top: 14px;
}

.emitir-summary-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-height: 34px;
    border-bottom: 1px solid rgba(0, 82, 190, 0.13);
    color: #001f5f;
    font-weight: 750;
}

.emitir-summary-list strong {
    color: #001a55;
}

.emitir-actions-bar {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    padding: 10px;
    border: 1px solid rgba(0, 94, 220, 0.18);
    border-radius: 16px;
    background: rgba(241, 248, 255, 0.92);
    box-shadow: 0 14px 28px rgba(0, 72, 180, 0.10);
}

.emitir-actions-bar .button {
    min-height: 46px;
    border-radius: 12px;
    font-weight: 900;
}

.lista-page-shell {
    gap: 0;
}

.lista-notas-panel {
    padding: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 0%, rgba(0, 120, 255, 0.14), transparent 38%),
        linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(222, 237, 255, 0.96));
    border-color: rgba(0, 88, 214, 0.18);
}

.lista-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: #00348f;
    font-weight: 900;
}

.lista-breadcrumb a {
    display: inline-flex;
    align-items: center;
    color: #003fae;
}

.lista-svg-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.lista-svg-icon-lg {
    width: 30px;
    height: 30px;
    stroke-width: 2.1;
}

.lista-svg-icon-sm {
    width: 14px;
    height: 14px;
    stroke-width: 2.8;
}

.lista-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.lista-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: #00339b;
}

.lista-title-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #0064f5;
    font-size: 2rem;
    filter: drop-shadow(0 10px 16px rgba(0, 88, 220, 0.22));
}

.lista-page-header h1 {
    margin: 0;
    font-size: 1.58rem;
    line-height: 1.05;
}

.lista-page-header p {
    margin: 4px 0 0;
    color: #004eb8;
    font-weight: 750;
}

.lista-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.lista-header-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 11px;
    font-weight: 900;
}

.lista-filter-card {
    display: grid;
    grid-template-columns: 1.05fr 1.45fr 1fr 1fr 1fr 140px;
    gap: 14px;
    align-items: end;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid rgba(0, 94, 220, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.80);
    box-shadow: 0 14px 28px rgba(0, 72, 180, 0.09);
}

.lista-filter-card label {
    display: grid;
    gap: 6px;
}

.lista-filter-card span {
    color: #002c8f;
    font-weight: 900;
    font-size: 0.86rem;
}

.lista-filter-card input,
.lista-filter-card select {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid rgba(0, 84, 200, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.92);
    color: #001f5f;
    font-weight: 700;
}

.lista-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 950;
}

.lista-table-wrapper {
    border: 1px solid rgba(0, 94, 220, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 30px rgba(0, 72, 180, 0.08);
}

.lista-notas-table {
    color: #001f5f;
}

.lista-notas-table th {
    background: linear-gradient(180deg, #e8f2ff, #d9e9ff);
    color: #00247d;
    font-weight: 950;
}

.lista-notas-table td {
    font-weight: 750;
}

.lista-notas-table td:first-child {
    color: #002d98;
    font-weight: 950;
}

.ambiente-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.ambiente-pill.producao {
    color: #006137;
    background: #c9f7dc;
    border: 1px solid rgba(0, 130, 73, 0.18);
}

.ambiente-pill.homologacao {
    color: #9b4f00;
    background: #ffe1bd;
    border: 1px solid rgba(214, 111, 0, 0.22);
}

.ambiente-pill.indefinido {
    color: #596579;
    background: #edf2f7;
    border: 1px solid rgba(89, 101, 121, 0.18);
}

.lista-notas-table .table-actions-inline {
    justify-content: center;
    gap: 7px;
}

.lista-notas-table .table-action.icon-only {
    min-width: 34px;
    width: auto;
    height: 28px;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 10px;
    color: #0059da;
    background: #e8f2ff;
    border-color: rgba(0, 90, 220, 0.12);
    font-weight: 1000;
    letter-spacing: 0.01em;
    text-transform: none;
}

.lista-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 4px 0;
    color: #002c8f;
    font-size: 0.84rem;
}

.lista-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
}

.lista-pagination .icon-only {
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
}

.lista-mobile-header-actions,
.lista-mobile-search,
.lista-mobile-fab,
.nota-card-doc-icon,
.nota-card-ambiente,
.nota-action-svg {
    display: none;
}

.table-action .nota-action-svg {
    display: block;
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.25;
}

.notification-chip {
    position: relative;
    border: 0;
    cursor: pointer;
}

.notification-chip .notification-svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
}

@media (max-width: 1100px) {
    .empresa-workspace {
        grid-template-columns: 1fr;
    }

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

    .emitir-workspace {
        grid-template-columns: 1fr;
    }

    .lista-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .lista-header-actions {
        justify-content: flex-start;
    }

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

    .lista-search-button {
        grid-column: span 2;
    }
}

@media (max-width: 767px) {
    .empresa-shell {
        padding: 12px;
        border-radius: 18px;
    }

    .empresa-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .empresa-title-icon {
        width: 46px;
        height: 46px;
    }

    .empresa-page-header h1 {
        font-size: 1.35rem;
    }

    .empresa-back-button {
        width: 100%;
    }

    .empresa-page .tabs {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        border-bottom: 0;
    }

    .empresa-page .tab-button {
        min-height: 46px;
        padding: 0 10px;
        border-radius: 12px;
        font-size: 0.84rem;
    }

    .empresa-workspace {
        padding-top: 12px;
    }

    .empresa-tab-card,
    .empresa-main-card .tab-panel {
        padding: 14px;
    }

    .empresa-section-title,
    .empresa-card-title {
        margin: -14px -14px 14px;
        padding: 12px 14px;
    }

    .empresa-page .form-row,
    .empresa-page .form-row-3 {
        flex-direction: column;
    }

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

    .empresa-logo-preview-box {
        min-height: 160px;
    }

    .empresa-page .form-actions {
        position: sticky;
        bottom: calc(78px + var(--safe-bottom));
        z-index: 15;
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 12px;
        margin: 0 -6px;
        border: 1px solid rgba(0, 94, 220, 0.18);
        border-radius: 16px;
        background: rgba(238, 247, 255, 0.94);
        box-shadow: 0 -10px 24px rgba(0, 72, 180, 0.12);
    }

    .emitir-shell {
        padding: 12px;
        border-radius: 18px;
    }

    .emitir-breadcrumb {
        flex-wrap: wrap;
        font-size: 0.9rem;
    }

    .emitir-page-header {
        flex-direction: column;
    }

    .emitir-title-icon {
        width: 46px;
        height: 46px;
        font-size: 2rem;
    }

    .emitir-page-header h1 {
        font-size: 1.45rem;
    }

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

    .emitir-step {
        min-width: 0;
        padding: 0 10px;
        font-size: 0.84rem;
    }

    .emitir-card,
    .emitir-summary-card {
        padding: 14px;
    }

    .emitir-card-title,
    .emitir-summary-card .emitir-card-title {
        margin: -14px -14px 14px;
        padding: 12px 14px;
    }

    .emitir-page .form-row,
    .emitir-page .form-row-3 {
        flex-direction: column;
    }

    .emitir-type-buttons {
        grid-template-columns: 1fr;
    }

    .emitir-summary-total {
        padding: 16px;
    }

    .emitir-summary-total strong {
        font-size: 1.55rem;
    }

    .emitir-actions-bar {
        position: sticky;
        bottom: calc(78px + var(--safe-bottom));
        z-index: 15;
        grid-template-columns: 1fr;
        padding: 12px;
        background: rgba(238, 247, 255, 0.96);
        box-shadow: 0 -10px 24px rgba(0, 72, 180, 0.12);
    }

    .emitir-actions-bar > span {
        display: none;
    }
}

.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;
}

.sidebar-logout-link {
    margin-top: 8px;
    color: #fee2e2;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(185, 28, 28, 0.12);
}

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;
        z-index: 90;
        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;
    }

    .modal-card .panel-header {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }

    .modal-card .modal-close {
        width: auto;
        min-width: 42px;
        min-height: 42px;
        padding: 0 14px;
        border-radius: 14px;
        white-space: nowrap;
    }

    .page-lista #exportarXmlModal .modal-card {
        max-height: calc(100dvh - 18px);
        padding-bottom: calc(24px + var(--safe-bottom));
    }

    .page-lista #exportarXmlModal .nfse-form .form-actions {
        margin-top: 14px;
        padding-bottom: 0;
    }

    @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;
        position: relative;
        border: 0;
        color: #fff;
        background: transparent;
    }

    .page-dashboard .mobile-back::before {
        content: none;
    }

    .page-dashboard .mobile-back .notification-svg {
        width: 24px;
        height: 24px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2.4;
    }

    .notification-badge,
    .notification-chip small {
        position: absolute;
        top: 3px;
        right: 3px;
        min-width: 18px;
        height: 18px;
        display: grid;
        place-items: center;
        border: 2px solid #fff;
        border-radius: 50%;
        color: #fff;
        background: #ef233c;
        font-size: 0.64rem;
        font-weight: 950;
        line-height: 1;
    }

    .notification-badge[hidden],
    .notification-chip small[hidden] {
        display: none;
    }

    .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 .sidebar-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 .sidebar-logout-link .nav-icon {
        color: #fff;
        font-size: 1.35rem;
    }

    .mobile-dashboard-hero {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        margin: 2px 0 12px;
        padding: 10px 10px 8px;
        border-radius: 20px;
        background: rgba(255, 255, 255, 0.74);
        box-shadow: 0 10px 26px rgba(0, 58, 150, 0.08);
    }

    .mobile-dashboard-greeting {
        display: flex;
        align-items: center;
        min-width: 0;
        gap: 10px;
    }

    .mobile-dashboard-avatar {
        display: grid;
        place-items: center;
        width: 48px;
        height: 48px;
        flex: 0 0 auto;
        border-radius: 16px;
        color: #0062df;
        background: linear-gradient(180deg, #eaf3ff, #d7e9ff);
        box-shadow: inset 0 0 0 1px rgba(0, 87, 217, 0.08);
    }

    .mobile-dashboard-avatar svg,
    .mobile-dashboard-date-card svg,
    .stat-icon svg {
        width: 25px;
        height: 25px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2.25;
    }

    .mobile-dashboard-hero h2 {
        margin: 0 0 2px;
        overflow: hidden;
        color: #071947;
        font-size: 1.03rem;
        line-height: 1.12;
        font-weight: 950;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

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

    .mobile-dashboard-date-card {
        display: flex;
        align-items: center;
        gap: 8px;
        min-height: 48px;
        padding: 8px 10px;
        border: 1px solid rgba(0, 87, 217, 0.10);
        border-radius: 18px;
        color: #071f67;
        background: #eef5ff;
    }

    .mobile-dashboard-date-card svg {
        width: 20px;
        height: 20px;
        color: #0057d9;
    }

    .mobile-dashboard-date-card strong,
    .mobile-dashboard-date-card small {
        display: block;
        white-space: nowrap;
    }

    .mobile-dashboard-date-card strong {
        font-size: 0.82rem;
        font-weight: 950;
    }

    .mobile-dashboard-date-card small {
        color: #3e5e99;
        font-size: 0.62rem;
        font-weight: 800;
    }

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

    .stat-card {
        min-height: 102px;
        padding: 12px;
        align-items: center;
        gap: 10px;
        border-radius: 14px;
        box-shadow: 0 10px 18px rgba(0, 71, 160, 0.08);
    }

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

    .stat-icon {
        width: 50px;
        height: 50px;
        border-radius: 18px;
        color: #fff;
        background: linear-gradient(135deg, #eaf3ff, #d6e8ff);
        color: #0062df;
    }

    .grid-summary .stat-card:nth-child(2) .stat-icon {
        color: #059669;
        background: linear-gradient(135deg, #dffbed, #c9f7dc);
    }

    .grid-summary .stat-card:nth-child(3) .stat-icon {
        color: #7c3aed;
        background: linear-gradient(135deg, #f1e8ff, #e8ddff);
    }

    .grid-summary .stat-card:nth-child(4) .stat-icon {
        color: #f97316;
        background: linear-gradient(135deg, #fff0dc, #ffe4bd);
    }

    .dashboard-stat-total {
        background: linear-gradient(135deg, #f8fbff, #edf5ff);
    }

    .dashboard-stat-faturamento {
        background: linear-gradient(135deg, #f4fff9, #e7fbf1);
    }

    .dashboard-stat-clientes {
        background: linear-gradient(135deg, #fbf8ff, #f1eaff);
    }

    .dashboard-stat-ticket {
        background: linear-gradient(135deg, #fffaf5, #fff1df);
    }

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

    .stat-card p {
        margin-top: 1px;
        color: #061f58;
        font-size: 1.22rem;
        line-height: 1.05;
        font-weight: 950;
    }

    .dashboard-stat-trend {
        display: block;
        margin-top: 4px;
        color: #32609c;
        font-size: 0.64rem;
        font-weight: 800;
    }

    .dashboard-stat-trend.up {
        color: #0f9f55;
    }

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

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

    .mobile-days-panel {
        padding: 14px;
        border-radius: 16px;
        box-shadow: 0 10px 22px rgba(0, 55, 130, 0.08);
    }

    .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-chart-range {
        padding: 7px 10px;
        border: 1px solid rgba(0, 87, 217, 0.12);
        border-radius: 12px;
        color: #072868;
        background: #f1f6ff;
        font-size: 0.76rem;
        font-weight: 850;
    }

    .mobile-line-chart {
        min-height: 170px;
        padding-top: 4px;
    }

    .mobile-evolution-svg {
        width: 100%;
        height: 160px;
        display: block;
    }

    .mobile-chart-grid,
    .mobile-chart-grid-strong {
        stroke: rgba(0, 87, 217, 0.13);
        stroke-width: 1;
    }

    .mobile-chart-area {
        fill: rgba(0, 102, 238, 0.10);
    }

    .mobile-chart-line {
        fill: none;
        stroke: #0066ee;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 4;
    }

    .mobile-chart-dot {
        fill: #0066ee;
        stroke: #fff;
        stroke-width: 3;
    }

    .mobile-chart-tooltip {
        fill: #fff;
        paint-order: stroke;
        stroke: #0066ee;
        stroke-linejoin: round;
        stroke-width: 10px;
        font-size: 12px;
        font-weight: 900;
    }

    .mobile-chart-labels {
        display: flex;
        justify-content: space-between;
        margin-top: -8px;
        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;
    }

    .mobile-latest-panel {
        padding: 14px;
        border-radius: 16px;
    }

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

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

    .mobile-latest-panel .panel-header a {
        color: #0066ee;
        font-size: 0.78rem;
        font-weight: 900;
    }

    .mobile-latest-list {
        display: grid;
    }

    .mobile-latest-note {
        display: grid;
        grid-template-columns: 24px auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        min-height: 36px;
        padding: 7px 0;
        border-top: 1px solid rgba(0, 87, 217, 0.10);
        color: #061f58;
        text-decoration: none;
    }

    .mobile-latest-icon {
        display: grid;
        place-items: center;
        width: 22px;
        height: 22px;
        border-radius: 6px;
        color: #fff;
        background: #0066ee;
    }

    .mobile-latest-icon svg {
        width: 15px;
        height: 15px;
        fill: none;
        stroke: currentColor;
        stroke-linecap: round;
        stroke-linejoin: round;
        stroke-width: 2.4;
    }

    .mobile-latest-note strong {
        font-size: 0.78rem;
        font-weight: 950;
        white-space: nowrap;
    }

    .mobile-latest-note > span:not(.mobile-latest-icon) {
        overflow: hidden;
        font-size: 0.75rem;
        font-weight: 800;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-latest-note .status-pill {
        min-height: 22px;
        padding: 4px 8px;
        border: 1px solid transparent;
        border-radius: 999px;
        font-size: 0.62rem;
        font-style: normal;
        font-weight: 900;
    }

    .mobile-latest-note .status-pill.status-emitida,
    .mobile-latest-note .status-pill.status-autorizada {
        color: #04783d;
        background: #d9fbe7;
        border-color: rgba(4, 120, 61, 0.14);
    }

    .mobile-latest-note .status-pill.status-pendente,
    .mobile-latest-note .status-pill.status-rascunho {
        color: #a04f00;
        background: #fff0cf;
        border-color: rgba(245, 158, 11, 0.22);
    }

    .mobile-latest-note .status-pill.status-cancelada {
        color: #b91c1c;
        background: #ffe4e6;
        border-color: rgba(220, 38, 38, 0.18);
    }

    .dashboard-notifications-list {
        display: grid;
        gap: 10px;
    }

    .dashboard-notification-item {
        padding: 12px 14px;
        border: 1px solid rgba(0, 87, 217, 0.10);
        border-radius: 16px;
        background: #f7fbff;
    }

    .dashboard-notification-item.warning {
        background: #fff7ed;
        border-color: rgba(245, 158, 11, 0.20);
    }

    .dashboard-notification-item.danger {
        background: #fff1f2;
        border-color: rgba(239, 68, 68, 0.20);
    }

    .dashboard-notification-item strong {
        display: block;
        color: #061f58;
        font-size: 0.92rem;
        font-weight: 950;
    }

    .dashboard-notification-item p {
        margin: 4px 0 0;
        color: #536683;
        font-size: 0.82rem;
        font-weight: 750;
    }

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

    .page-lista .lista-notas-panel {
        padding: 12px;
        border-radius: 18px;
    }

    .page-lista .lista-breadcrumb {
        flex-wrap: wrap;
        font-size: 0.9rem;
    }

    .page-lista .lista-page-header {
        gap: 12px;
    }

    .page-lista .lista-title-icon {
        width: 42px;
        height: 42px;
        font-size: 1.75rem;
    }

    .page-lista .lista-page-header h1 {
        font-size: 1.35rem;
    }

    .page-lista .lista-header-actions,
    .page-lista .lista-filter-card {
        grid-template-columns: 1fr;
        width: 100%;
    }

    .page-lista .lista-header-actions .button,
    .page-lista .lista-search-button {
        width: 100%;
    }

    .page-lista .lista-search-button {
        grid-column: auto;
    }

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

    .page-lista .table tr::after {
        content: none;
    }

    .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: data;
        color: #6b7896;
        font-size: 0.84rem;
    }

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

    .page-lista .table td:nth-child(4) {
        display: none;
    }

    .page-lista .table td:nth-child(5) {
        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(6) {
        grid-area: status;
        position: static;
        justify-self: end;
        align-self: start;
        text-align: right;
        white-space: nowrap;
    }

    .page-lista .table td:nth-child(7) {
        margin-top: 8px;
        grid-column: 1 / -1;
    }

    .page-lista .table-actions-inline {
        justify-content: flex-start;
    }

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

    .page-lista .lista-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-lista .content {
        padding: 8px 10px calc(96px + var(--safe-bottom));
        background:
            radial-gradient(circle at top left, rgba(0, 116, 255, 0.16), transparent 34%),
            linear-gradient(180deg, #eef6ff 0%, #f8fbff 58%, #eef6ff 100%);
    }

    .page-lista .lista-page-shell {
        display: block;
    }

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

    .page-lista .lista-breadcrumb,
    .page-lista .lista-header-actions,
    .page-lista .lista-table-footer,
    .page-lista .lista-filter-card {
        display: none;
    }

    .page-lista .lista-filter-card.is-open {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 10px 0 12px;
        padding: 12px;
        border: 1px solid rgba(0, 87, 217, 0.12);
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 12px 28px rgba(0, 63, 160, 0.10);
    }

    .page-lista .lista-page-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        margin: 0 0 10px;
        padding: 0;
    }

    .page-lista .lista-title-group {
        gap: 10px;
    }

    .page-lista .lista-title-icon {
        width: 42px;
        height: 42px;
        border-radius: 12px;
        background: linear-gradient(180deg, #0b78ff, #0057d9);
        box-shadow: 0 8px 18px rgba(0, 87, 217, 0.22);
    }

    .page-lista .lista-title-icon .lista-svg-icon {
        width: 25px;
        height: 25px;
        color: #fff;
    }

    .page-lista .lista-page-header h1 {
        color: #06245d;
        font-size: 1.16rem;
        font-weight: 950;
        letter-spacing: -0.02em;
    }

    .page-lista .lista-page-header p {
        margin-top: 1px;
        color: #4c6698;
        font-size: 0.75rem;
        font-weight: 750;
    }

    .page-lista .lista-mobile-header-actions {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .page-lista .lista-mobile-icon-button {
        display: inline-grid;
        place-items: center;
        width: 44px;
        height: 44px;
        border: 1px solid rgba(0, 87, 217, 0.16);
        border-radius: 16px;
        color: #0057d9;
        background: rgba(255, 255, 255, 0.92);
        box-shadow: 0 8px 20px rgba(0, 55, 130, 0.10);
    }

    .page-lista .lista-mobile-icon-button.active {
        color: #fff;
        background: linear-gradient(180deg, #0b78ff, #0057d9);
    }

    .page-lista .lista-mobile-icon-button .lista-svg-icon {
        width: 23px;
        height: 23px;
        stroke-width: 2.4;
    }

    .page-lista .lista-mobile-search {
        position: relative;
        display: block;
        margin: 0 0 12px;
    }

    .page-lista .lista-mobile-search .lista-svg-icon {
        position: absolute;
        top: 50%;
        left: 15px;
        width: 22px;
        height: 22px;
        color: #0057d9;
        transform: translateY(-50%);
        pointer-events: none;
    }

    .page-lista .lista-mobile-search input {
        width: 100%;
        min-height: 44px;
        padding: 0 16px 0 48px;
        border: 1px solid rgba(0, 87, 217, 0.16);
        border-radius: 22px;
        color: #06245d;
        background: rgba(255, 255, 255, 0.90);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.90), 0 8px 20px rgba(0, 55, 130, 0.06);
        font-size: 0.86rem;
        font-weight: 700;
    }

    .page-lista .lista-mobile-search input::placeholder {
        color: #6e82b0;
        font-weight: 650;
    }

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

    .page-lista .lista-notas-table {
        border-spacing: 0 10px;
    }

    .page-lista .table tr {
        grid-template-columns: 48px minmax(0, 1fr) auto 18px;
        grid-template-areas:
            "icone numero status seta"
            "icone data status seta"
            "icone tomador acoes seta"
            "icone valor acoes seta";
        column-gap: 9px;
        row-gap: 0;
        min-height: 0;
        padding: 10px 9px 10px 10px;
        border: 1px solid rgba(0, 87, 217, 0.10);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.98);
        box-shadow: 0 7px 16px rgba(0, 55, 130, 0.10);
    }

    .page-lista .table tr::after {
        content: "›";
        grid-area: seta;
        align-self: center;
        justify-self: center;
        color: #0057d9;
        font-size: 1.55rem;
        font-weight: 950;
        line-height: 1;
    }

    .page-lista .table td {
        display: block;
        width: auto;
        min-width: 0;
        padding: 0;
        border: 0;
        line-height: 1.15;
        text-align: left;
    }

    .page-lista .table td:nth-child(1) {
        display: contents;
    }

    .page-lista .table td:nth-child(1)::before {
        content: none;
    }

    .page-lista .nota-card-doc-icon {
        grid-area: icone;
        display: grid;
        place-items: center;
        width: 38px;
        height: 38px;
        align-self: center;
        border-radius: 12px;
        color: #fff;
        background: linear-gradient(180deg, #137cff, #0062df);
        box-shadow: 0 7px 16px rgba(0, 87, 217, 0.20);
    }

    .page-lista .nota-card-doc-icon .lista-svg-icon {
        width: 22px;
        height: 22px;
        stroke-width: 2.35;
    }

    .page-lista .nota-card-numero {
        grid-area: numero;
        color: #0042b8;
        font-size: 1rem;
        font-weight: 950;
        letter-spacing: -0.02em;
    }

    .page-lista .table td:nth-child(2) {
        grid-area: data;
        margin-top: 1px;
        color: #415d99;
        font-size: 0.72rem;
        font-weight: 750;
    }

    .page-lista .table td:nth-child(3) {
        grid-area: tomador;
        margin-top: 6px;
        overflow: hidden;
        color: #061f58;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.74rem;
        font-weight: 950;
        text-transform: uppercase;
    }

    .page-lista .table td:nth-child(4) {
        display: none;
    }

    .page-lista .table td:nth-child(5) {
        grid-area: valor;
        justify-self: start;
        align-self: end;
        margin-top: 3px;
        color: #06245d;
        font-size: 0.73rem;
        font-weight: 850;
        white-space: nowrap;
    }

    .page-lista .table td:nth-child(6),
    .page-lista .table td:nth-child(6) .ambiente-pill,
    .page-lista .nota-card-ambiente {
        display: none;
    }

    .page-lista .nota-card-ambiente {
        align-items: center;
        gap: 3px;
        color: #0057d9;
        font-size: 0.68rem;
        font-weight: 850;
    }

    .page-lista .nota-card-ambiente::before {
        content: "";
        width: 9px;
        height: 9px;
        border-radius: 50%;
        background: currentColor;
        box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.85);
    }

    .page-lista .nota-card-ambiente.producao {
        color: #06834a;
    }

    .page-lista .nota-card-ambiente.indefinido {
        color: #64748b;
    }

    .page-lista .table td:nth-child(7) {
        grid-area: status;
        align-self: start;
        justify-self: end;
        margin: 0;
        text-align: right;
    }

    .page-lista .table td:nth-child(8) {
        grid-area: acoes;
        align-self: end;
        justify-self: end;
        margin: 0;
    }

    .page-lista .status-pill {
        min-height: 25px;
        padding: 5px 9px;
        border-radius: 999px;
        font-size: 0.68rem;
        font-weight: 900;
    }

    .page-lista .table-actions-inline {
        display: flex;
        justify-content: flex-end;
        flex-wrap: nowrap;
        gap: 5px;
    }

    .page-lista .table-action.icon-only {
        width: 31px;
        min-width: 31px;
        height: 31px;
        min-height: 31px;
        padding: 0;
        border-radius: 12px;
        color: #0057d9;
        background: #eef6ff;
        border-color: rgba(0, 87, 217, 0.10);
        font-size: 0;
        font-weight: 950;
        box-shadow: 0 5px 12px rgba(0, 55, 130, 0.08);
    }

    .page-lista .table-action .nota-action-svg {
        width: 16px;
        height: 16px;
        display: block;
    }

    .page-lista .table-action.icon-only[data-nota-acao="visualizar"] {
        color: #0057d9;
        background: linear-gradient(180deg, #eef6ff, #dbeeff);
        border-color: rgba(0, 87, 217, 0.16);
    }

    .page-lista .table-action.icon-only[data-nota-acao="imprimir"] {
        color: #6d28d9;
        background: linear-gradient(180deg, #f3edff, #e9ddff);
        border-color: rgba(109, 40, 217, 0.16);
    }

    .page-lista .table-action.icon-only[data-nota-acao="xml"] {
        color: #0284c7;
        background: linear-gradient(180deg, #e9f8ff, #d6efff);
        border-color: rgba(2, 132, 199, 0.16);
    }

    .page-lista .table-action.icon-only[data-nota-acao="editar"] {
        color: #0f766e;
        background: linear-gradient(180deg, #e7fbf7, #d1f5ec);
        border-color: rgba(15, 118, 110, 0.16);
    }

    .page-lista .table-action.icon-only[data-nota-acao="excluir"] {
        color: #dc2626;
        background: linear-gradient(180deg, #fff1f2, #ffe4e6);
        border-color: rgba(220, 38, 38, 0.16);
    }

    .page-lista .table-action.icon-only[data-nota-acao="mais"] {
        color: #2563eb;
        background: linear-gradient(180deg, #eff6ff, #dbeafe);
        border-color: rgba(37, 99, 235, 0.14);
    }

    .page-lista .table-action.icon-only:active {
        transform: scale(0.96);
    }

    .page-lista .lista-mobile-fab {
        position: fixed;
        right: 18px;
        bottom: calc(78px + var(--safe-bottom));
        z-index: 35;
        display: grid;
        place-items: center;
        width: 56px;
        height: 56px;
        border-radius: 50%;
        color: #fff;
        background: linear-gradient(180deg, #0b78ff, #004ed1);
        box-shadow: 0 14px 28px rgba(0, 73, 190, 0.30);
        font-size: 2rem;
        font-weight: 700;
        line-height: 1;
        text-decoration: none;
    }

    .page-lista .empty-state {
        display: block;
        padding: 18px;
        border-radius: 16px;
        background: #fff;
        text-align: center;
    }
}

@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;
    }
}

.page-servicos .content,
.page-usuarios .content {
    color: #001f5f;
}

.tela-servicos-page,
.usuarios-page {
    gap: 0;
}

.tela-servicos-panel,
.usuarios-panel {
    padding: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 0%, rgba(0, 120, 255, 0.14), transparent 38%),
        linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(222, 237, 255, 0.96));
    border-color: rgba(0, 88, 214, 0.18);
}

.tela-servicos-breadcrumb,
.usuarios-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: #00348f;
    font-weight: 900;
}

.tela-servicos-breadcrumb a,
.usuarios-breadcrumb a {
    display: inline-flex;
    align-items: center;
    color: #003fae;
}

.tela-servicos-header,
.usuarios-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.tela-servicos-title,
.usuarios-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: #00339b;
}

.tela-servicos-title-icon,
.usuarios-title-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    color: #0064f5;
    filter: drop-shadow(0 10px 16px rgba(0, 88, 220, 0.22));
}

.tela-servicos-header h1,
.usuarios-page-header h1 {
    margin: 0;
    font-size: 1.58rem;
    line-height: 1.05;
}

.tela-servicos-header p,
.usuarios-page-header p {
    margin: 5px 0 0;
    color: #004eb8;
    font-weight: 750;
}

.tela-servicos-actions,
.usuarios-page-header .button {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.tela-servicos-actions .button,
.usuarios-novo-btn {
    min-height: 42px;
    border-radius: 11px;
    font-weight: 950;
}

.tela-servicos-filtros {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr 160px;
    gap: 14px;
    align-items: end;
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid rgba(0, 94, 220, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 14px 28px rgba(0, 72, 180, 0.09);
}

.tela-servicos-filtros label,
.usuarios-form label {
    display: grid;
    gap: 6px;
}

.tela-servicos-filtros span,
.usuarios-form label > span {
    color: #002c8f;
    font-weight: 900;
    font-size: 0.86rem;
}

.tela-servicos-filtros input,
.tela-servicos-filtros select,
.usuarios-form input,
.usuarios-form select {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid rgba(0, 84, 200, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    color: #001f5f;
    font-weight: 700;
}

.tela-servicos-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 950;
}

.tela-servicos-table-wrapper,
.usuarios-table-wrapper {
    border: 1px solid rgba(0, 94, 220, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 30px rgba(0, 72, 180, 0.08);
}

.tela-servicos-table,
.usuarios-table {
    color: #001f5f;
}

.tela-servicos-table th,
.usuarios-table th {
    background: linear-gradient(180deg, #e8f2ff, #d9e9ff);
    color: #00247d;
    font-weight: 950;
}

.tela-servicos-table td,
.usuarios-table td {
    font-weight: 750;
}

.tela-servicos-table td:first-child {
    color: #002d98;
    font-weight: 950;
}

.servico-row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 34px;
    border-radius: 10px;
    font-weight: 950;
}

.usuarios-workspace {
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(520px, 1.05fr);
    gap: 14px;
    align-items: start;
}

.usuarios-card {
    overflow: hidden;
    border: 1px solid rgba(0, 94, 220, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 34px rgba(0, 72, 180, 0.10);
}

.usuarios-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    color: #fff;
    background: linear-gradient(135deg, #004ebf, #0078ff 68%, #00b7ff);
}

.usuarios-card-header h2 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
}

.usuarios-form {
    padding: 14px;
}

.usuarios-form .form-row {
    gap: 12px;
}

.usuarios-input-icon,
.usuarios-search-field {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 11px;
    border: 1px solid rgba(0, 84, 200, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    color: #003fae;
}

.usuarios-input-icon input,
.usuarios-input-icon select,
.usuarios-search-field input {
    width: 100%;
    min-height: 38px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #001f5f;
}

.usuarios-page .required-mark {
    color: #e11d48;
}

.usuarios-status-field {
    max-width: 220px;
}

.usuarios-permissions-card {
    margin-top: 12px;
    padding: 12px;
    border-radius: 13px;
    background: linear-gradient(180deg, rgba(235, 244, 255, 0.95), rgba(255, 255, 255, 0.94));
    border: 1px solid rgba(0, 94, 220, 0.12);
}

.usuarios-permissions-title {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
    color: #00339b;
}

.usuarios-permissions-title h3 {
    margin: 0;
    font-size: 1rem;
}

.usuarios-permissions-title p {
    margin: 4px 0 0;
    color: #004eb8;
    font-size: 0.82rem;
    font-weight: 700;
}

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

.usuarios-permission-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid rgba(0, 94, 220, 0.12);
    border-radius: 10px;
    background: #fff;
    color: #002c8f;
    font-weight: 900;
}

.usuarios-permission-item input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.usuarios-permission-item i {
    position: relative;
    width: 42px;
    height: 24px;
    border-radius: 999px;
    background: #c8d6ef;
    box-shadow: inset 0 0 0 1px rgba(0, 66, 170, 0.12);
}

.usuarios-permission-item i::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 30, 90, 0.25);
    transition: transform 0.18s ease;
}

.usuarios-permission-item input:checked + i {
    background: linear-gradient(135deg, #0057d9, #0098ff);
}

.usuarios-permission-item input:checked + i::after {
    transform: translateX(18px);
}

.usuarios-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.usuarios-form-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 950;
}

.usuarios-list-filters {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 180px 128px;
    gap: 10px;
    padding: 14px;
    align-items: center;
}

.usuarios-list-filters select,
.usuarios-list-filters .button {
    min-height: 40px;
    border-radius: 10px;
    font-weight: 900;
}

.usuarios-list-filters .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.usuarios-table-wrapper {
    margin: 0 14px;
}

.usuarios-name-cell,
.usuarios-actions-inline {
    display: flex;
    align-items: center;
    gap: 9px;
}

.usuarios-avatar {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #0057d9, #00a3ff);
    font-size: 0.75rem;
    font-weight: 950;
}

.usuarios-profile-pill {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 10px;
    border-radius: 999px;
    background: #dfe9ff;
    color: #00339b;
    font-weight: 950;
}

.usuarios-profile-pill.perfil-administrador {
    background: #dbe8ff;
}

.usuarios-profile-pill.perfil-operador {
    background: #eadcff;
}

.usuarios-profile-pill.perfil-suporte {
    background: #d7f8e4;
}

.usuarios-profile-pill.perfil-financeiro {
    background: #ffedc2;
}

.usuarios-profile-pill.perfil-comercial {
    background: #dbe8ff;
}

.usuarios-actions-inline {
    justify-content: center;
}

.usuarios-actions-inline .icon-only {
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 0;
    border-radius: 999px;
    color: #0059da;
    background: #e8f2ff;
    border-color: rgba(0, 90, 220, 0.12);
    font-weight: 1000;
}

.usuarios-actions-inline .danger-soft {
    color: #d51445;
    background: #ffe8ef;
    border-color: rgba(225, 29, 72, 0.12);
}

.usuarios-table-footer {
    padding: 10px 14px 14px;
}

@media (max-width: 1180px) {
    .usuarios-workspace {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 767px) {
    .tela-servicos-panel,
    .usuarios-panel {
        padding: 12px;
        border-radius: 18px;
    }

    .tela-servicos-header,
    .usuarios-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .tela-servicos-actions,
    .usuarios-novo-btn {
        width: 100%;
    }

    .tela-servicos-title-icon,
    .usuarios-title-icon {
        width: 48px;
        height: 48px;
    }

    .tela-servicos-filtros,
    .usuarios-list-filters,
    .usuarios-form .form-row,
    .usuarios-permission-grid {
        grid-template-columns: 1fr;
    }

    .tela-servicos-search,
    .usuarios-list-filters .button,
    .usuarios-form-actions .button {
        width: 100%;
    }

    .usuarios-card-header {
        border-radius: 0;
    }

    .usuarios-table-wrapper {
        margin: 0 10px;
    }

    .usuarios-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

.page-configuracoes .content {
    color: #001f5f;
}

.configuracoes-page {
    gap: 0;
}

.configuracoes-panel {
    padding: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 0%, rgba(0, 120, 255, 0.14), transparent 38%),
        linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(222, 237, 255, 0.96));
    border-color: rgba(0, 88, 214, 0.18);
}

.configuracoes-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: #00348f;
    font-weight: 900;
}

.configuracoes-breadcrumb a {
    display: inline-flex;
    align-items: center;
    color: #003fae;
}

.configuracoes-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.configuracoes-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: #00339b;
}

.configuracoes-title-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    color: #0064f5;
    filter: drop-shadow(0 10px 16px rgba(0, 88, 220, 0.22));
}

.configuracoes-page-header h1 {
    margin: 0;
    font-size: 1.58rem;
    line-height: 1.05;
}

.configuracoes-page-header p {
    margin: 5px 0 0;
    color: #004eb8;
    font-weight: 750;
}

.configuracoes-reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 11px;
    font-weight: 950;
}

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

.configuracoes-card {
    overflow: hidden;
    border: 1px solid rgba(0, 94, 220, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 16px 34px rgba(0, 72, 180, 0.10);
}

.configuracoes-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 12px 14px;
    color: #fff;
    background: linear-gradient(135deg, #004ebf, #0078ff 68%, #00b7ff);
}

.configuracoes-card-header h2 {
    margin: 0;
    font-size: 1rem;
    color: #fff;
}

.configuracoes-card-header .configuracoes-card-action,
.configuracoes-connection-pill {
    margin-left: auto;
}

.configuracoes-card-action {
    min-height: 30px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
}

.configuracoes-connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 12px;
    border-radius: 999px;
    color: #fff;
    background: #f59e0b;
    font-size: 0.78rem;
    font-weight: 950;
}

.configuracoes-connection-pill::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.configuracoes-connection-pill.is-connected {
    background: #16a34a;
}

.configuracoes-form {
    padding: 14px;
}

.configuracoes-form .form-row,
.configuracoes-bridge-row {
    gap: 12px;
}

.configuracoes-form label,
.configuracoes-system-grid label {
    display: grid;
    gap: 6px;
}

.configuracoes-form label > span,
.configuracoes-system-grid label > span {
    color: #002c8f;
    font-weight: 900;
    font-size: 0.86rem;
}

.configuracoes-form input,
.configuracoes-form select,
.configuracoes-system-grid select,
.configuracoes-bridge-row input {
    min-height: 40px;
    width: 100%;
    padding: 9px 12px;
    border: 1px solid rgba(0, 84, 200, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    color: #001f5f;
    font-weight: 700;
}

.configuracoes-password-field {
    display: flex;
    align-items: center;
    border: 1px solid rgba(0, 84, 200, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
}

.configuracoes-password-field input {
    border: 0;
    background: transparent;
}

.configuracoes-password-field button {
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 38px;
    border: 0;
    background: transparent;
    color: #0057d9;
    cursor: pointer;
}

.configuracoes-db-actions,
.configuracoes-system-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.configuracoes-db-actions .button,
.configuracoes-system-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    border-radius: 10px;
    font-weight: 950;
}

.configuracoes-status-ok {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px;
    padding: 14px;
    border: 1px solid rgba(22, 163, 74, 0.22);
    border-radius: 12px;
    background: rgba(220, 252, 231, 0.9);
    color: #063d20;
}

.configuracoes-status-ok.compact {
    margin-bottom: 8px;
}

.configuracoes-status-ok > span {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: #16a34a;
    flex: 0 0 auto;
}

.configuracoes-status-ok strong {
    display: block;
    color: #06245d;
    font-size: 1rem;
}

.configuracoes-status-ok p {
    margin: 3px 0 0;
    color: #063d20;
    font-weight: 700;
}

.configuracoes-status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    margin: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 94, 220, 0.12);
    border-radius: 12px;
    background: rgba(0, 94, 220, 0.12);
}

.configuracoes-status-grid div {
    min-height: 54px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.9);
}

.configuracoes-status-grid span {
    display: block;
    color: #0045a8;
    font-size: 0.78rem;
    font-weight: 850;
}

.configuracoes-status-grid strong {
    display: block;
    margin-top: 4px;
    color: #061f58;
    font-size: 0.88rem;
}

.configuracoes-check-list {
    display: grid;
    gap: 8px;
    margin: 10px 14px 16px;
    padding: 0;
    list-style: none;
}

.configuracoes-check-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #061f58;
    font-weight: 850;
}

.configuracoes-check-list li > span {
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: inset 0 0 0 4px #16a34a;
}

.configuracoes-check-list li.warning > span {
    background: #f59e0b;
    box-shadow: inset 0 0 0 4px #f59e0b;
}

.configuracoes-check-list li.danger > span {
    background: #ef4444;
    box-shadow: inset 0 0 0 4px #ef4444;
}

.configuracoes-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 14px 0;
}

.configuracoes-tabs button {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 14px;
    border: 1px solid rgba(0, 94, 220, 0.14);
    border-radius: 10px 10px 0 0;
    background: #eef5ff;
    color: #00339b;
    font-weight: 950;
    cursor: pointer;
}

.configuracoes-tabs button.active {
    color: #fff;
    background: linear-gradient(135deg, #0057d9, #0098ff);
}

.configuracoes-tab-panel {
    display: none;
    padding: 14px;
}

.configuracoes-tab-panel.active {
    display: block;
}

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

.configuracoes-checkboxes {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.configuracoes-checkboxes label {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #061f58;
    font-weight: 850;
}

.configuracoes-checkboxes input {
    width: 16px;
    height: 16px;
    accent-color: #0057d9;
}

.configuracoes-help {
    margin: 10px 0 0;
    color: #004eb8;
    font-weight: 750;
}

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

@media (max-width: 767px) {
    .configuracoes-panel {
        padding: 12px;
        border-radius: 18px;
    }

    .configuracoes-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .configuracoes-reset-btn,
    .configuracoes-db-actions .button,
    .configuracoes-system-actions .button {
        width: 100%;
    }

    .configuracoes-title-icon {
        width: 48px;
        height: 48px;
    }

    .configuracoes-card-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .configuracoes-card-header .configuracoes-card-action,
    .configuracoes-connection-pill {
        margin-left: 0;
    }

    .configuracoes-form .form-row,
    .configuracoes-status-grid,
    .configuracoes-system-grid,
    .configuracoes-bridge-row {
        grid-template-columns: 1fr;
    }
}

.page-clientes .content {
    color: #001f5f;
}

.clientes-page {
    gap: 0;
}

.clientes-panel {
    padding: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 0%, rgba(0, 120, 255, 0.14), transparent 38%),
        linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(222, 237, 255, 0.96));
    border-color: rgba(0, 88, 214, 0.18);
}

.clientes-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: #00348f;
    font-weight: 900;
}

.clientes-breadcrumb a {
    display: inline-flex;
    align-items: center;
    color: #003fae;
}

.clientes-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.clientes-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: #00339b;
}

.clientes-title-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #0064f5;
    filter: drop-shadow(0 10px 16px rgba(0, 88, 220, 0.22));
}

.clientes-page-header h1 {
    margin: 0;
    font-size: 1.58rem;
    line-height: 1.05;
}

.clientes-page-header p {
    margin: 4px 0 0;
    color: #004eb8;
    font-weight: 750;
}

.clientes-header-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.clientes-header-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 11px;
    font-weight: 950;
}

.clientes-filter-card {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr 0.8fr 140px;
    gap: 14px;
    align-items: end;
    margin-bottom: 8px;
    padding: 12px;
    border: 1px solid rgba(0, 94, 220, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 14px 28px rgba(0, 72, 180, 0.09);
}

.clientes-filter-card label {
    display: grid;
    gap: 6px;
}

.clientes-filter-card span {
    color: #002c8f;
    font-weight: 900;
    font-size: 0.86rem;
}

.clientes-filter-card input,
.clientes-filter-card select {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid rgba(0, 84, 200, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    color: #001f5f;
    font-weight: 700;
}

.clientes-search-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 950;
}

.clientes-table-wrapper {
    border: 1px solid rgba(0, 94, 220, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 14px 30px rgba(0, 72, 180, 0.08);
}

.clientes-table {
    color: #001f5f;
}

.clientes-table th {
    background: linear-gradient(180deg, #e8f2ff, #d9e9ff);
    color: #00247d;
    font-weight: 950;
}

.clientes-table td {
    font-weight: 750;
}

.clientes-table td:first-child,
.clientes-table td:nth-child(2) {
    color: #002d98;
    font-weight: 950;
}

.clientes-actions-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.clientes-actions-inline .icon-only {
    width: 32px;
    height: 28px;
    min-height: 28px;
    padding: 0;
    border-radius: 10px;
    color: #0059da;
    background: #e8f2ff;
    border-color: rgba(0, 90, 220, 0.12);
    font-weight: 1000;
}

.clientes-actions-inline .danger-soft {
    color: #d51445;
    background: #ffe8ef;
    border-color: rgba(225, 29, 72, 0.12);
}

.clientes-table-footer {
    padding: 10px 4px 0;
}

@media (max-width: 1100px) {
    .clientes-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .clientes-header-actions {
        justify-content: flex-start;
    }

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

@media (max-width: 767px) {
    .clientes-panel {
        padding: 12px;
        border-radius: 18px;
    }

    .clientes-title-icon {
        width: 48px;
        height: 48px;
    }

    .clientes-header-actions,
    .clientes-header-actions .button,
    .clientes-search-button {
        width: 100%;
    }

    .clientes-filter-card {
        grid-template-columns: 1fr;
    }

    .clientes-table-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

.page-sobre .content,
.page-ajuda .content {
    color: #001f5f;
}

.sobre-page,
.ajuda-page {
    justify-items: center;
}

.sobre-panel,
.ajuda-panel {
    width: min(100%, 720px);
    padding: 0;
    overflow: hidden;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.ajuda-panel {
    width: min(100%, 760px);
}

.sobre-card,
.ajuda-card {
    overflow: hidden;
    border: 1px solid rgba(0, 94, 220, 0.22);
    border-radius: 12px;
    background:
        radial-gradient(circle at 18% 0%, rgba(0, 120, 255, 0.12), transparent 40%),
        linear-gradient(180deg, #f8fbff, #eef6ff);
    box-shadow: 0 20px 46px rgba(0, 72, 180, 0.18);
}

.sobre-card-header,
.ajuda-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 62px;
    padding: 0 22px;
    color: #fff;
    background: linear-gradient(135deg, #003fae, #006fff 68%, #00b7ff);
}

.sobre-card-header h1,
.ajuda-card-header h1 {
    margin: 0;
    color: #fff;
    font-size: 1.28rem;
}

.sobre-header-icon,
.ajuda-header-icon {
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: #0057d9;
    background: #fff;
}

.sobre-hero {
    display: grid;
    grid-template-columns: 1.25fr 0.9fr;
    gap: 28px;
    padding: 36px 34px 28px;
    border-bottom: 1px solid rgba(0, 75, 180, 0.16);
}

.sobre-brand-block {
    display: grid;
    justify-items: center;
    align-content: center;
    text-align: center;
}

.sobre-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    filter: drop-shadow(0 12px 18px rgba(0, 95, 220, 0.18));
}

.sobre-brand-block strong {
    margin-top: 10px;
    color: #00339b;
    font-size: 2rem;
    line-height: 1;
    font-weight: 1000;
}

.sobre-brand-block span {
    margin-top: 8px;
    color: #004eb8;
    font-size: 1rem;
    font-weight: 850;
}

.sobre-version-block {
    display: grid;
    align-content: center;
    gap: 8px;
    padding-left: 40px;
    border-left: 1px solid rgba(0, 75, 180, 0.20);
}

.sobre-version-block span,
.sobre-version-block small {
    color: #00339b;
    font-weight: 850;
}

.sobre-version-block strong {
    color: #001f5f;
    font-size: 1.9rem;
    line-height: 1;
    font-weight: 1000;
}

.sobre-version-block b {
    color: #001f5f;
    font-size: 1rem;
    font-weight: 1000;
}

.sobre-description {
    padding: 22px 34px 18px;
    border-bottom: 1px solid rgba(0, 75, 180, 0.16);
}

.sobre-description p {
    margin: 0 0 18px;
    color: #002c8f;
    font-size: 1rem;
    line-height: 1.55;
    font-weight: 750;
}

.sobre-description ul {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sobre-description li,
.sobre-contact-list div {
    display: grid;
    grid-template-columns: 24px minmax(110px, 0.45fr) 1fr;
    align-items: center;
    gap: 12px;
    color: #002c8f;
    font-weight: 850;
}

.sobre-description li {
    grid-template-columns: 24px 1fr;
}

.sobre-description li .lista-svg-icon {
    display: inline-grid;
    place-items: center;
    padding: 3px;
    border-radius: 50%;
    color: #fff;
    background: #0072ff;
}

.sobre-contact-list {
    display: grid;
    gap: 14px;
    padding: 22px 34px;
    border-bottom: 1px solid rgba(0, 75, 180, 0.16);
}

.sobre-contact-list .lista-svg-icon {
    color: #0072ff;
}

.sobre-contact-list span {
    color: #00339b;
    font-weight: 850;
}

.sobre-contact-list strong {
    color: #006fff;
    font-weight: 1000;
}

.sobre-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 18px;
}

.sobre-footer span {
    display: inline-flex;
    justify-content: center;
    flex: 1;
    min-height: 50px;
    align-items: center;
    padding: 0 18px;
    border-radius: 12px;
    background: #e5f1ff;
    color: #002c8f;
    font-size: 0.82rem;
    font-weight: 900;
}

.sobre-footer .button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 50px;
    border-radius: 12px;
    font-weight: 950;
}

.ajuda-hero {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 18px;
    align-items: center;
    margin: 20px;
    padding: 24px;
    border: 1px solid rgba(0, 94, 220, 0.16);
    border-radius: 12px;
    background: linear-gradient(135deg, #e8f4ff, #f8fbff);
}

.ajuda-hero-icon {
    display: grid;
    place-items: center;
    color: #0a7dff;
}

.ajuda-hero-icon .lista-svg-icon {
    width: 96px;
    height: 96px;
    stroke-width: 1.7;
}

.ajuda-hero-content h2 {
    margin: 0;
    color: #00339b;
    font-size: 1.35rem;
}

.ajuda-hero-content p {
    margin: 6px 0 18px;
    color: #002c8f;
    font-weight: 750;
}

.ajuda-search {
    display: grid;
    grid-template-columns: 1fr 56px;
    max-width: 520px;
    border: 1px solid rgba(0, 94, 220, 0.22);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 22px rgba(0, 72, 180, 0.12);
}

.ajuda-search input {
    min-height: 46px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px 0 0 8px;
    color: #001f5f;
    font-weight: 750;
}

.ajuda-search button {
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 0 8px 8px 0;
    color: #fff;
    background: linear-gradient(135deg, #0057d9, #0078ff);
    cursor: pointer;
}

.ajuda-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    padding: 0 20px 20px;
}

.ajuda-option-card {
    display: grid;
    grid-template-columns: 52px 1fr 18px;
    align-items: center;
    gap: 14px;
    min-height: 112px;
    padding: 18px;
    border: 1px solid rgba(0, 94, 220, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    color: #002c8f;
    text-decoration: none;
    box-shadow: 0 12px 26px rgba(0, 72, 180, 0.08);
}

.ajuda-option-card > span {
    display: inline-grid;
    place-items: center;
    color: #0072ff;
}

.ajuda-option-card > span .lista-svg-icon {
    width: 42px;
    height: 42px;
    stroke-width: 2;
}

.ajuda-option-card strong {
    display: block;
    color: #00339b;
    font-weight: 1000;
}

.ajuda-option-card p {
    margin: 6px 0 0;
    color: #002c8f;
    font-size: 0.9rem;
    line-height: 1.35;
    font-weight: 700;
}

.ajuda-option-card i {
    color: #006fff;
    font-size: 1.9rem;
    font-style: normal;
    font-weight: 500;
}

.ajuda-tip {
    display: flex;
    gap: 14px;
    align-items: center;
    margin: 0 20px 20px;
    padding: 16px 18px;
    border: 1px solid rgba(0, 94, 220, 0.16);
    border-radius: 12px;
    background: #dff0ff;
    color: #002c8f;
}

.ajuda-tip .lista-svg-icon {
    width: 34px;
    height: 34px;
    color: #0072ff;
    flex: 0 0 auto;
}

.ajuda-tip strong {
    display: block;
    color: #00339b;
    font-weight: 1000;
}

.ajuda-tip span {
    color: #002c8f;
    font-weight: 750;
}

@media (max-width: 767px) {
    .sobre-panel,
    .ajuda-panel {
        width: 100%;
    }

    .sobre-card,
    .ajuda-card {
        border-radius: 18px;
    }

    .sobre-hero,
    .ajuda-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .sobre-version-block {
        padding-left: 0;
        padding-top: 22px;
        border-left: 0;
        border-top: 1px solid rgba(0, 75, 180, 0.20);
    }

    .sobre-description,
    .sobre-contact-list {
        padding-right: 20px;
        padding-left: 20px;
    }

    .sobre-contact-list div {
        grid-template-columns: 24px 1fr;
    }

    .sobre-contact-list strong {
        grid-column: 2;
    }

    .sobre-footer {
        flex-direction: column;
    }

    .sobre-footer span,
    .sobre-footer .button {
        width: 100%;
    }

    .ajuda-options-grid {
        grid-template-columns: 1fr;
    }
}

.page-relatorios .content {
    color: #001f5f;
}

.relatorios-page {
    gap: 0;
}

.relatorios-panel {
    padding: 16px;
    overflow: hidden;
    background:
        radial-gradient(circle at 18% 0%, rgba(0, 120, 255, 0.14), transparent 38%),
        linear-gradient(180deg, rgba(239, 247, 255, 0.98), rgba(222, 237, 255, 0.96));
    border-color: rgba(0, 88, 214, 0.18);
}

.relatorios-breadcrumb {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    color: #00348f;
    font-weight: 900;
}

.relatorios-breadcrumb a {
    display: inline-flex;
    align-items: center;
    color: #003fae;
}

.relatorios-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.relatorios-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    color: #00339b;
}

.relatorios-title-icon {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: #0064f5;
    filter: drop-shadow(0 10px 16px rgba(0, 88, 220, 0.22));
}

.relatorios-page-header h1 {
    margin: 0;
    font-size: 1.58rem;
    line-height: 1.05;
}

.relatorios-page-header p {
    margin: 4px 0 0;
    color: #004eb8;
    font-weight: 750;
}

.relatorios-period-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(0, 94, 220, 0.16);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    color: #00339b;
    box-shadow: 0 12px 26px rgba(0, 72, 180, 0.10);
}

.relatorios-filter-card {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 170px;
    gap: 14px;
    align-items: end;
    margin-bottom: 14px;
    padding: 14px;
    border: 1px solid rgba(0, 94, 220, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 14px 28px rgba(0, 72, 180, 0.09);
}

.relatorios-filter-card label {
    display: grid;
    gap: 6px;
}

.relatorios-filter-card span {
    color: #002c8f;
    font-weight: 900;
    font-size: 0.86rem;
}

.relatorios-filter-card select {
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid rgba(0, 84, 200, 0.28);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.94);
    color: #001f5f;
    font-weight: 800;
}

.relatorios-generate-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border-radius: 10px;
    font-weight: 950;
}

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

.relatorios-summary-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 98px;
    padding: 16px;
    border: 1px solid rgba(0, 94, 220, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 30px rgba(0, 72, 180, 0.09);
}

.relatorios-summary-card > span {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
}

.relatorios-summary-card > span.is-blue {
    color: #006fff;
    background: #e3f0ff;
}

.relatorios-summary-card > span.is-green {
    color: #16a34a;
    background: #dcfce7;
}

.relatorios-summary-card > span.is-purple {
    color: #7c3aed;
    background: #ede9fe;
}

.relatorios-summary-card > span.is-orange {
    color: #f97316;
    background: #ffedd5;
}

.relatorios-summary-card small {
    display: block;
    color: #00339b;
    font-weight: 900;
}

.relatorios-summary-card strong {
    display: block;
    margin-top: 4px;
    color: #001f5f;
    font-size: 1.22rem;
    font-weight: 1000;
}

.relatorios-summary-card em {
    display: block;
    margin-top: 5px;
    color: #008448;
    font-size: 0.76rem;
    font-style: normal;
    font-weight: 850;
}

.relatorios-charts-grid,
.relatorios-bottom-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 14px;
    margin-bottom: 14px;
}

.relatorios-bottom-grid {
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    margin-bottom: 0;
}

.relatorios-card {
    overflow: hidden;
    border: 1px solid rgba(0, 94, 220, 0.14);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 30px rgba(0, 72, 180, 0.09);
}

.relatorios-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px 8px;
}

.relatorios-card-title h2 {
    margin: 0;
    color: #00339b;
    font-size: 1rem;
}

.relatorios-card-title span {
    color: #006fff;
    font-size: 0.72rem;
    font-weight: 850;
}

.relatorios-line-chart,
.relatorios-bar-chart {
    min-height: 230px;
    padding: 8px 16px 16px;
}

.relatorios-line-chart svg {
    width: 100%;
    height: 210px;
}

.relatorios-line-chart circle {
    fill: #006fff;
    stroke: #fff;
    stroke-width: 3;
}

.relatorios-line-chart text {
    fill: #00339b;
    font-size: 12px;
    font-weight: 800;
}

.relatorios-grid-line,
.relatorios-axis-line {
    fill: none;
    stroke: rgba(0, 94, 220, 0.12);
    stroke-width: 1;
}

.relatorios-line-stroke {
    fill: none;
    stroke: #006fff;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.relatorios-line-fill {
    fill: none;
    stroke: rgba(0, 111, 255, 0.18);
    stroke-width: 12;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.relatorios-chart-legend {
    display: block;
    color: #00339b;
    text-align: center;
    font-size: 0.82rem;
}

.relatorios-bars {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: end;
    gap: 24px;
    min-height: 190px;
    padding: 18px 26px 0;
    border-bottom: 1px solid rgba(0, 94, 220, 0.14);
}

.relatorios-bars div {
    display: grid;
    justify-items: center;
    gap: 8px;
}

.relatorios-bars span {
    display: block;
    width: 52px;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #0098ff, #006fff);
    box-shadow: 0 10px 18px rgba(0, 111, 255, 0.20);
}

.relatorios-bars strong {
    color: #00339b;
    font-size: 0.78rem;
}

.relatorios-table-wrapper {
    margin: 0 12px 14px;
    border: 1px solid rgba(0, 94, 220, 0.14);
    border-radius: 10px;
}

.relatorios-table {
    color: #001f5f;
}

.relatorios-table th {
    background: linear-gradient(180deg, #e8f2ff, #d9e9ff);
    color: #00247d;
    font-weight: 950;
}

.relatorios-table td {
    font-weight: 750;
}

.relatorios-see-all {
    min-height: 30px;
    border-radius: 999px;
    font-weight: 900;
}

.relatorios-export-card {
    padding-bottom: 14px;
}

.relatorios-export-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 8px 14px 16px;
}

.relatorios-export-grid button {
    display: grid;
    place-items: center;
    gap: 4px;
    min-height: 108px;
    border: 1px solid rgba(0, 94, 220, 0.14);
    border-radius: 12px;
    background: #f7fbff;
    color: #00339b;
    cursor: pointer;
}

.relatorios-export-grid span {
    display: grid;
    place-items: center;
    width: 42px;
    height: 48px;
    border-radius: 8px;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 1000;
}

.relatorios-export-grid .pdf {
    background: #ef4444;
}

.relatorios-export-grid .excel {
    background: #16a34a;
}

.relatorios-export-grid .csv {
    background: #2563eb;
}

.relatorios-export-grid strong {
    font-weight: 950;
}

.relatorios-export-grid small {
    color: #004eb8;
    font-weight: 750;
}

.relatorios-export-hint {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 14px;
    padding: 12px;
    border-radius: 10px;
    background: #dff0ff;
    color: #00339b;
    font-size: 0.82rem;
    font-weight: 800;
}

@media (max-width: 1180px) {
    .relatorios-summary-grid,
    .relatorios-filter-card {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .relatorios-charts-grid,
    .relatorios-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .relatorios-panel {
        padding: 12px;
        border-radius: 18px;
    }

    .relatorios-page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .relatorios-filter-card,
    .relatorios-summary-grid,
    .relatorios-export-grid {
        grid-template-columns: 1fr;
    }

    .relatorios-generate-button,
    .relatorios-period-chip {
        width: 100%;
    }

    .relatorios-bars {
        gap: 12px;
        padding-right: 10px;
        padding-left: 10px;
    }
}

.sidebar .sidebar-nav {
    gap: 7px;
}

.sidebar .nav-link {
    min-height: 42px;
    padding: 10px 14px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.96);
    font-weight: 750;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #1496ff, #006dff);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 12px 24px rgba(0, 63, 180, 0.32);
}

.sidebar .nav-icon {
    width: 26px;
    min-width: 26px;
    height: 26px;
    font-size: 0;
    text-shadow: none;
}

.nav-svg-icon {
    display: block;
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sidebar .nav-link.active .nav-svg-icon,
.sidebar .nav-link:hover .nav-svg-icon {
    filter: drop-shadow(0 2px 4px rgba(0, 28, 92, 0.24));
}

@media (max-width: 767px) {
    body {
        padding-bottom: calc(108px + var(--safe-bottom));
        overflow-x: hidden;
    }

    .content {
        padding-bottom: calc(120px + var(--safe-bottom));
    }

    .mobile-bottom-nav {
        right: max(8px, env(safe-area-inset-right, 0px));
        bottom: max(8px, var(--safe-bottom));
        left: max(8px, env(safe-area-inset-left, 0px));
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 2px;
        min-height: 74px;
        padding: 8px 8px calc(8px + var(--safe-bottom));
        border-radius: 22px;
    }

    .mobile-nav-item {
        min-width: 0;
        min-height: 56px;
        width: auto;
        height: auto;
        display: grid;
        grid-template-rows: 24px auto;
        place-items: center;
        gap: 3px;
        padding: 7px 2px 6px;
        border-radius: 15px;
        color: #5b6785;
        font-size: inherit;
        text-decoration: none;
        transform: none;
    }

    .mobile-nav-item span {
        display: grid;
        place-items: center;
        width: 26px;
        height: 26px;
        min-width: 26px;
        overflow: hidden;
        line-height: 1;
        font-size: 0;
    }

    .mobile-nav-item .nav-svg-icon {
        width: 22px;
        height: 22px;
        stroke-width: 2.8;
    }

    .mobile-nav-item strong {
        display: block;
        width: 100%;
        max-width: 64px;
        overflow: hidden;
        color: currentColor;
        font-size: 0.68rem;
        line-height: 1.05;
        font-weight: 900;
        letter-spacing: -0.02em;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

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

    .mobile-nav-primary {
        align-self: start;
        width: 64px;
        height: 64px;
        min-height: 64px;
        padding: 0;
        border-radius: 50%;
        transform: translateY(-22px);
        color: #fff;
        background: linear-gradient(135deg, #00a6ff, #0057d9);
        box-shadow: 0 14px 25px rgba(0, 87, 217, 0.35);
    }

    .mobile-nav-primary span {
        position: relative;
        display: grid;
        place-items: center;
        width: 64px;
        height: 64px;
    }

    .mobile-nav-primary .nav-svg-icon {
        display: none;
    }

    .mobile-nav-primary span::before {
        content: "+";
        display: block;
        color: #fff;
        font-size: 2.4rem;
        font-weight: 500;
        line-height: 1;
        transform: translateY(-2px);
    }

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

    .page-dashboard .mobile-dashboard-widgets {
        margin-bottom: 26px;
    }
}

@media (max-width: 374px) {
    .mobile-bottom-nav {
        right: 6px;
        left: 6px;
        gap: 1px;
        padding-right: 6px;
        padding-left: 6px;
    }

    .mobile-nav-item strong {
        max-width: 56px;
        font-size: 0.62rem;
    }

    .mobile-nav-primary {
        width: 58px;
        height: 58px;
        min-height: 58px;
    }

    .mobile-nav-primary span {
        width: 58px;
        height: 58px;
    }
}
