/* ============================================================================
 * Mizu UI 3.0
 * Adaptacao do PMD Design System para um produto financeiro monocromatico.
 * O tema claro e a experiencia principal; o dark permanece como alternativa.
 * ============================================================================ */

:root {
    --mizu-pulso-50: #fff0f4;
    --mizu-pulso-100: #ffd6e1;
    --mizu-pulso-200: #ffadc4;
    --mizu-pulso-300: #ff7b9f;
    --mizu-pulso-400: #ff3d70;
    --mizu-pulso-500: #ff0048;
    --mizu-pulso-600: #d70042;
    --mizu-pulso-700: #b4003d;
    --mizu-pulso-800: #8f0034;
    --mizu-pulso-900: #68002a;
    --mizu-respiro: #fffcfd;
    --mizu-solo: #0e0e0e;
    --mizu-sombra: #30302e;
    --mizu-calmo: #92978e;
    --mizu-cloud-50: #faf8f9;
    --mizu-cloud-100: #f5f2f3;
    --mizu-cloud-200: #ebe7e9;
    --mizu-cloud-300: #ded9dc;
    --mizu-ink-muted: #656a63;

    --font-sans: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --font-display: var(--font-sans);
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --shadow-xs: 0 1px 2px rgba(14, 14, 14, .04);
    --shadow-sm: 0 1px 2px rgba(14, 14, 14, .04), 0 8px 24px rgba(14, 14, 14, .04);
    --shadow-md: 0 12px 40px rgba(14, 14, 14, .09);
    --shadow-lg: 0 20px 56px rgba(14, 14, 14, .12);
    --transition: 120ms cubic-bezier(.2, .8, .2, 1);
    --transition-slow: 200ms cubic-bezier(.2, .8, .2, 1);
}

[data-theme="light"] {
    --bg: var(--mizu-cloud-100);
    --bg-card: var(--mizu-respiro);
    --bg-subtle: var(--mizu-cloud-50);
    --bg-muted: var(--mizu-cloud-200);
    --border: var(--mizu-cloud-200);
    --border-strong: var(--mizu-cloud-300);
    --divider: var(--mizu-cloud-200);

    --text: #484b50;
    --text-soft: var(--mizu-ink-muted);
    --text-muted: #7d827a;
    --text-strong: #35383e;
    --text-on-primary: #ffffff;

    --primary: var(--mizu-pulso-500);
    --primary-hover: var(--mizu-pulso-400);
    --primary-soft: var(--mizu-pulso-100);
    --primary-fg: var(--mizu-pulso-700);
    --ring: rgba(255, 0, 72, .20);

    --ocean-50: var(--mizu-pulso-50);
    --ocean-100: var(--mizu-pulso-100);
    --ocean-200: var(--mizu-pulso-200);
    --ocean-300: var(--mizu-pulso-300);
    --ocean-400: var(--mizu-pulso-400);
    --ocean-500: var(--mizu-pulso-500);
    --ocean-600: var(--mizu-pulso-500);
    --ocean-700: var(--mizu-pulso-600);
    --ocean-800: var(--mizu-pulso-700);
    --ocean-900: var(--mizu-pulso-900);

    --c-primary-bg: var(--mizu-pulso-100);
    --c-primary-fg: var(--mizu-pulso-700);
    --tint-info: rgba(14, 14, 14, .035);
    color-scheme: light;
}

[data-theme="dark"] {
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --bg: #0e0e0e;
    --bg-card: #181817;
    --bg-subtle: #222220;
    --bg-muted: #2a2a28;
    --border: #343432;
    --border-strong: #464643;
    --divider: #30302e;
    --text: #f1eff0;
    --text-soft: #aaafa7;
    --text-muted: #8b9088;
    --text-strong: #fffcfd;
    --primary: var(--mizu-pulso-500);
    --primary-hover: var(--mizu-pulso-400);
    --primary-soft: rgba(255, 0, 72, .16);
    --primary-fg: var(--mizu-pulso-300);
    --ring: rgba(255, 0, 72, .28);
    --ocean-500: var(--mizu-pulso-500);
    --ocean-600: var(--mizu-pulso-500);
    --ocean-700: var(--mizu-pulso-400);
    --c-primary-bg: rgba(255, 0, 72, .16);
    --c-primary-fg: var(--mizu-pulso-300);
}

html,
body,
button,
input,
select,
textarea {
    font-family: var(--font-sans);
}

@media (min-width: 769px) {
    html {
        scrollbar-gutter: stable;
    }
}

body {
    letter-spacing: 0;
    line-height: 1.4;
}

[data-theme="light"] body {
    background: var(--bg);
}

h1, h2, h3, h4, h5, h6,
.text-display,
.kpi .value,
.brand-name,
.profile-name {
    letter-spacing: 0 !important;
}

/* Layout ------------------------------------------------------------------- */
.app-shell {
    grid-template-columns: 264px minmax(0, 1fr);
}

.sidebar {
    padding: 20px 14px 16px;
    gap: 8px;
}

[data-theme="light"] .sidebar {
    background: rgba(255, 252, 253, .94);
    border-right-color: var(--mizu-cloud-200);
    backdrop-filter: blur(18px);
}

.main {
    max-width: 1480px;
    padding: 40px 48px 64px;
}

.sidebar .brand {
    min-height: 64px;
    padding: 2px 8px 18px;
    margin-bottom: 10px;
}

.sidebar .brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 14px;
    box-shadow: none;
}

[data-theme="light"] .sidebar .brand-logo {
    background: var(--mizu-pulso-500);
    color: var(--mizu-respiro);
}

.sidebar .brand-name {
    font-size: 18px;
}

.sidebar .brand-tagline {
    letter-spacing: .08em;
}

.sidebar-nav {
    gap: 4px;
}

.nav-item,
.profile-link,
.logout-btn {
    min-height: 44px;
    border-radius: var(--radius-pill);
    font-size: 14px;
}

.nav-item {
    padding: 10px 14px;
}

.nav-item:hover,
.profile-link:hover {
    background: var(--bg-muted);
}

[data-theme="light"] .nav-item.active,
[data-theme="light"] .nav-item.active:hover {
    color: var(--mizu-respiro);
    background: var(--mizu-solo);
    box-shadow: none;
}

.sidebar-profile {
    margin-top: 16px;
    padding-top: 16px;
}

/* Page heading -------------------------------------------------------------- */
.topbar {
    align-items: center;
    margin-bottom: 28px;
    gap: 20px;
}

.topbar .greeting {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .08em;
}

.topbar h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.1;
}

.topbar .subtitle {
    max-width: 640px;
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.4;
}

.topbar h1 .highlight {
    color: var(--mizu-pulso-500);
}

.topbar-actions {
    gap: 8px;
}

/* Surfaces ------------------------------------------------------------------ */
.card,
.kpi,
.table-wrap,
.filter-bar,
.empty,
.cofrinho-card,
.admin-shortcut,
.admin-stat-strip,
.admin-users-list,
.admin-danger-zone {
    border-color: var(--border);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.card,
.kpi,
.cofrinho-card {
    padding: 24px;
}

[data-theme="light"] .card,
[data-theme="light"] .kpi,
[data-theme="light"] .table-wrap,
[data-theme="light"] .filter-bar,
[data-theme="light"] .empty,
[data-theme="light"] .cofrinho-card,
[data-theme="light"] .admin-shortcut,
[data-theme="light"] .admin-stat-strip,
[data-theme="light"] .admin-users-list,
[data-theme="light"] .admin-danger-zone {
    background: var(--mizu-respiro);
}

.card:hover,
.kpi:hover,
.cofrinho-card:hover {
    border-color: var(--border-strong);
    box-shadow: none;
    transform: none;
}

.card-title {
    margin-bottom: 22px;
}

.card-title h3 {
    font-size: 17px;
    font-weight: 700;
}

.dashboard-grid,
.grid {
    gap: 16px;
}

.dashboard-grid {
    margin-bottom: 28px;
}

.kpi .label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .08em;
}

.kpi .value {
    margin-top: 14px;
    font-size: 32px;
    font-weight: 700;
}

.kpi .hint {
    margin-top: 14px;
    line-height: 1.3;
}

[data-theme="light"] .kpi.positive {
    background: linear-gradient(150deg, var(--c-success-bg), var(--mizu-respiro) 58%);
}

[data-theme="light"] .kpi.negative {
    background: linear-gradient(150deg, var(--c-danger-bg), var(--mizu-respiro) 58%);
}

[data-theme="light"] .kpi.pending {
    background: linear-gradient(150deg, var(--c-warning-bg), var(--mizu-respiro) 58%);
}

/* Buttons ------------------------------------------------------------------- */
.btn {
    min-height: 48px;
    height: 48px;
    padding: 0 20px;
    gap: 10px;
    border-radius: var(--radius-pill);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0;
    transition: transform var(--transition), box-shadow var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.btn::before {
    display: none;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0) scale(.985);
}

[data-theme="light"] .btn-primary {
    color: #ffffff;
    background: var(--mizu-pulso-500);
    border-color: var(--mizu-pulso-500);
    box-shadow: none;
}

[data-theme="light"] .btn-primary:hover {
    color: #ffffff;
    background: var(--mizu-pulso-400);
    border-color: var(--mizu-pulso-400);
    box-shadow: 0 10px 28px rgba(255, 0, 72, .20);
}

[data-theme="light"] .btn-secondary {
    color: var(--mizu-respiro);
    background: var(--mizu-solo);
    border-color: var(--mizu-solo);
}

[data-theme="light"] .btn-secondary:hover {
    color: var(--mizu-respiro);
    background: var(--mizu-sombra);
    border-color: var(--mizu-sombra);
}

.btn-ghost {
    color: var(--text);
    background: var(--bg-card);
    border-color: var(--border);
}

.btn-ghost:hover,
.btn-secondary:hover {
    border-color: var(--border-strong);
}

.btn-sm {
    min-height: 36px;
    height: 36px;
    padding: 0 14px;
    font-size: 13px;
}

.btn:disabled,
.btn[disabled] {
    opacity: .42;
    cursor: not-allowed;
    transform: none;
}

/* Forms --------------------------------------------------------------------- */
.label,
.form-group > label,
.filter-bar label {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    gap: 16px;
}

.input,
.select,
.textarea {
    min-height: 48px;
    border-radius: var(--radius);
    padding: 0 14px;
    border-color: var(--border-strong);
    background-color: var(--bg-card);
    font-size: 15px;
    line-height: 1.2;
    box-shadow: none;
}

.textarea {
    min-height: 120px;
    padding-top: 14px;
    padding-bottom: 14px;
    line-height: 1.4;
}

.input:hover,
.select:hover,
.textarea:hover {
    border-color: var(--text-muted);
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--text-strong);
    box-shadow: 0 0 0 3px var(--ring);
}

.input-hint,
.input-error {
    margin-top: 7px;
    line-height: 1.4;
}

.radio-pills,
.chart-toggle,
.filter-chips,
.dash-tabs {
    padding: 4px;
    border-radius: var(--radius-pill);
    background: var(--bg-muted);
    border: 0;
}

.radio-pills label,
.chart-toggle-btn,
.filter-chip {
    min-height: 36px;
    border-radius: var(--radius-pill);
}

[data-theme="light"] .radio-pills input:checked + label,
[data-theme="light"] .filter-chip.active {
    color: var(--mizu-pulso-700);
    background: var(--mizu-pulso-100);
}

[data-theme="light"] .chart-toggle-btn.is-active {
    color: var(--mizu-respiro);
    background: var(--mizu-solo);
}

.select,
.select:hover,
.select:focus {
    padding-right: 42px;
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23656A63' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
}

.select:focus {
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23FF0048' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

.filter-bar {
    min-height: 76px;
    padding: 12px 16px;
    gap: 12px;
    margin-bottom: 28px;
}

.filter-bar .select,
.filter-bar .input {
    min-height: 44px;
    height: 44px;
}

.period-pin {
    min-height: 40px;
    border-radius: var(--radius-pill);
}

/* Data display -------------------------------------------------------------- */
.table-wrap {
    overflow: hidden;
}

.table {
    font-size: 14px;
}

.table th {
    padding: 14px 18px;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    background: var(--bg-subtle);
}

.table td {
    min-height: 56px;
    padding: 16px 18px;
}

.table tbody tr:hover {
    background: var(--bg-subtle);
}

.badge,
.chip,
.filter-chip,
.kpi-trend,
.cofrinho-tag,
.admin-badge-pill,
.admin-tag-badge {
    border-radius: var(--radius-pill);
    letter-spacing: 0;
}

.badge,
.chip,
.filter-chip,
.cofrinho-tag {
    min-height: 34px;
    padding: 0 12px;
    display: inline-flex;
    align-items: center;
}

.cat-chip,
.pagination-btn,
.profile-logout-row .logout-btn-inline,
.install-banner .install-actions button {
    min-height: 36px;
    border-radius: var(--radius-pill);
    letter-spacing: 0;
}

.cat-chip {
    padding: 0 14px;
}

.cat-edit-panel,
.insight-item,
.recurrence-block,
.recurrence-preview,
.bc-modal-preview,
.donation-pix-key-block,
.integration-field input[type="text"],
.integration-field textarea,
.integration-field select {
    border-radius: var(--radius);
}

.insight-value,
.insight-label,
.insight-top-label,
.cat-section-title,
.donation-title,
.integration-meta h3,
.integration-label {
    letter-spacing: 0;
}

.notif-page-item,
.integration-card,
.bc-history-item,
.attention-group,
.kpi-card,
.donation-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    box-shadow: none;
}

.notif-page-item:hover,
.integration-card:hover,
.bc-history-item:hover {
    border-color: var(--border-strong);
    box-shadow: none;
}

[data-theme="light"] .donation-card {
    background: linear-gradient(145deg, rgba(14, 14, 14, .035), var(--mizu-respiro) 58%);
}

.integration-field input[type="text"],
.integration-field select {
    min-height: 48px;
    padding: 0 14px;
    background: var(--bg-card);
    border-color: var(--border-strong);
}

.integration-field textarea {
    min-height: 120px;
    padding: 14px;
    background: var(--bg-card);
    border-color: var(--border-strong);
}

.theme-option {
    min-height: 104px;
    border-radius: var(--radius);
}

[data-theme="light"] .theme-option[aria-checked="true"] {
    color: var(--mizu-pulso-700);
    background: var(--mizu-pulso-100);
    border-color: var(--mizu-pulso-300);
    box-shadow: none;
}

.theme-swatch-light {
    background: linear-gradient(135deg, var(--mizu-respiro) 50%, var(--mizu-cloud-200) 50%);
}

.theme-swatch-dark {
    background: linear-gradient(135deg, var(--mizu-solo) 50%, var(--mizu-sombra) 50%);
}

.theme-swatch-auto {
    background: linear-gradient(135deg, var(--mizu-solo) 50%, var(--mizu-respiro) 50%);
}

.install-banner .install-actions button::before,
.profile-logout-row .logout-btn-inline::before {
    display: none;
}

[data-theme="light"] .install-banner .install-yes {
    color: var(--mizu-respiro);
    background: var(--mizu-pulso-500);
}

.progress-track,
.cofrinho-progress-bar {
    height: 8px;
    background: var(--bg-muted);
}

/* Floating and feedback ----------------------------------------------------- */
.theme-toggle,
.notif-bell {
    width: 44px;
    height: 44px;
    border-color: var(--border);
    background: var(--bg-card);
    box-shadow: none;
}

.theme-toggle:hover,
.notif-bell:hover {
    color: var(--text-strong);
    background: var(--bg-muted);
    border-color: var(--border-strong);
}

.flash {
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.series-modal-card,
.bc-modal-card,
.notif-panel {
    border-radius: var(--radius-xl);
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}

.empty {
    padding: 56px 28px;
    color: var(--text-soft);
}

.empty h3 {
    font-size: 18px;
    font-weight: 700;
}

/* Auth ---------------------------------------------------------------------- */
[data-theme="light"] body.auth {
    background: var(--mizu-cloud-100);
}

.auth-wrap {
    max-width: 460px;
}

.auth-card {
    padding: 36px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .auth-card {
    background: var(--mizu-respiro);
}

.auth-brand {
    margin-bottom: 28px;
}

.auth-brand .logo {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    box-shadow: none;
}

[data-theme="light"] .auth-brand .logo {
    color: var(--mizu-respiro);
    background: var(--mizu-pulso-500);
}

.auth-brand .title {
    font-size: 24px;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
}

.auth-card > p {
    margin: 10px auto 26px;
    font-size: 14px;
    line-height: 1.4;
}

/* Admin --------------------------------------------------------------------- */
:root {
    --admin-accent: var(--mizu-pulso-500);
    --admin-accent-bg: var(--mizu-pulso-100);
}

[data-theme="dark"] {
    --admin-accent: var(--mizu-respiro);
    --admin-accent-bg: #30302e;
}

.admin-strip {
    min-height: 48px;
    margin-bottom: 28px;
    padding: 12px 16px;
    border-radius: var(--radius);
}

.admin-shortcut {
    min-height: 152px;
    padding: 22px;
}

.admin-shortcut:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.admin-stat-cell {
    padding: 22px;
}

.admin-user-row,
.admin-tx-row,
.admin-attempt-row,
.admin-recent-user {
    min-height: 64px;
    padding: 14px 18px;
}

/* Mobile -------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .main {
        padding: 32px 28px 56px;
    }
}

/* Preloader global: abertura e navegação entre páginas. */
.app-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    background: rgba(247, 246, 251, .88);
    -webkit-backdrop-filter: blur(12px) saturate(110%);
    backdrop-filter: blur(12px) saturate(110%);
    transition: opacity 180ms ease, visibility 180ms ease;
}

[data-theme="dark"] .app-loader {
    background: rgba(21, 20, 26, .90);
}

.app-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.three-body {
    --uib-size: 42px;
    --uib-speed: .8s;
    --uib-color: var(--primary, #7143f5);
    position: relative;
    display: inline-block;
    width: var(--uib-size);
    height: var(--uib-size);
    animation: mizu-loader-spin calc(var(--uib-speed) * 2.5) infinite linear;
}

.three-body__dot {
    position: absolute;
    width: 30%;
    height: 100%;
}

.three-body__dot::after {
    content: "";
    position: absolute;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    border-radius: 50%;
    background: var(--uib-color);
    box-shadow: 0 6px 16px rgba(113, 67, 245, .18);
}

.three-body__dot:nth-child(1) {
    bottom: 5%;
    left: 0;
    transform: rotate(60deg);
    transform-origin: 50% 85%;
}

.three-body__dot:nth-child(1)::after {
    bottom: 0;
    left: 0;
    animation: mizu-loader-wobble-up var(--uib-speed) infinite ease-in-out;
    animation-delay: calc(var(--uib-speed) * -.3);
}

.three-body__dot:nth-child(2) {
    right: 0;
    bottom: 5%;
    transform: rotate(-60deg);
    transform-origin: 50% 85%;
}

.three-body__dot:nth-child(2)::after {
    bottom: 0;
    left: 0;
    animation: mizu-loader-wobble-up var(--uib-speed) infinite calc(var(--uib-speed) * -.15) ease-in-out;
}

.three-body__dot:nth-child(3) {
    bottom: -5%;
    left: 0;
    transform: translateX(116.666%);
}

.three-body__dot:nth-child(3)::after {
    top: 0;
    left: 0;
    animation: mizu-loader-wobble-down var(--uib-speed) infinite ease-in-out;
}

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

@keyframes mizu-loader-wobble-up {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(-66%) scale(.65);
        opacity: .8;
    }
}

@keyframes mizu-loader-wobble-down {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    50% {
        transform: translateY(66%) scale(.65);
        opacity: .8;
    }
}

@media (prefers-reduced-motion: reduce) {
    .three-body,
    .three-body__dot::after {
        animation: none !important;
    }
}

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

    .main {
        padding: 24px 16px calc(92px + env(safe-area-inset-bottom));
    }

    .topbar {
        align-items: flex-start;
        margin-bottom: 24px;
    }

    .topbar h1 {
        font-size: 32px;
    }

    .topbar-actions {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
    }

    .topbar-actions > .btn-primary {
        order: -2;
        flex: 1 0 100%;
        width: 100%;
    }

    .topbar-actions > .btn:not(.btn-primary) {
        flex: 1 1 auto;
        min-width: 0;
    }

    .topbar-actions > .theme-toggle,
    .topbar-actions > .notif-wrap {
        flex: 0 0 44px;
    }

    .filter-bar {
        min-height: auto;
        padding: 12px;
        border-radius: var(--radius-lg);
    }

    .card,
    .kpi,
    .cofrinho-card {
        padding: 20px;
    }

    .bottom-nav {
        left: 10px;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        padding: 6px;
        border: 1px solid var(--border);
        border-radius: 22px;
        background: rgba(255, 252, 253, .94);
        box-shadow: var(--shadow-md);
        backdrop-filter: blur(18px);
    }

    [data-theme="dark"] .bottom-nav {
        background: rgba(24, 24, 23, .94);
    }

    .bottom-nav-item {
        min-height: 52px;
        border-radius: 16px;
    }

    [data-theme="light"] .bottom-nav-item.active {
        color: var(--mizu-pulso-700);
        background: var(--mizu-pulso-100);
    }

    .auth-card {
        padding: 28px 22px;
    }
}

/* Sidebar desktop: compacta em repouso e expansível por aproximação. */
@media (min-width: 1025px) and (hover: hover) and (pointer: fine) {
    .app-shell {
        grid-template-columns: 84px minmax(0, 1fr);
        transition: grid-template-columns 320ms cubic-bezier(.22, 1, .36, 1);
    }

    .app-shell.sidebar-expanded {
        grid-template-columns: 264px minmax(0, 1fr);
    }

    .sidebar {
        overflow-x: hidden;
        padding-right: 12px;
        padding-left: 12px;
        scrollbar-width: none;
        will-change: width;
    }

    .sidebar::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    .sidebar .brand {
        justify-content: center;
        gap: 0;
        padding-right: 0;
        padding-left: 0;
    }

    .sidebar .brand-logo,
    .sidebar .nav-item .icon,
    .sidebar .avatar,
    .sidebar .logout-btn > svg {
        flex: 0 0 auto;
    }

    .sidebar .brand > :not(.brand-logo),
    .sidebar .nav-label,
    .sidebar .profile-info,
    .sidebar .profile-arrow,
    .sidebar .logout-label,
    .sidebar .admin-badge-pill {
        max-width: 0;
        opacity: 0;
        overflow: hidden;
        white-space: nowrap;
        transform: translateX(-6px);
        pointer-events: none;
        transition:
            max-width 220ms cubic-bezier(.22, 1, .36, 1),
            opacity 110ms ease,
            transform 180ms ease;
    }

    .sidebar .nav-item {
        width: 100%;
        justify-content: center;
        gap: 0;
        padding-right: 0;
        padding-left: 0;
        transition:
            gap 260ms cubic-bezier(.22, 1, .36, 1),
            padding 260ms cubic-bezier(.22, 1, .36, 1),
            background 180ms ease,
            color 180ms ease;
    }

    .sidebar-profile {
        align-items: center;
    }

    .sidebar .profile-link,
    .sidebar .logout-form,
    .sidebar .logout-btn {
        width: 100%;
    }

    .sidebar .profile-link,
    .sidebar .logout-btn {
        justify-content: center;
        gap: 0;
        padding-right: 0;
        padding-left: 0;
        transition:
            gap 260ms cubic-bezier(.22, 1, .36, 1),
            padding 260ms cubic-bezier(.22, 1, .36, 1),
            background 180ms ease,
            color 180ms ease;
    }

    .app-shell.sidebar-expanded .sidebar .brand {
        justify-content: flex-start;
        gap: 10px;
        padding-right: 8px;
        padding-left: 8px;
    }

    .app-shell.sidebar-expanded .sidebar .brand > :not(.brand-logo) {
        max-width: 180px;
    }

    .app-shell.sidebar-expanded .sidebar .nav-label {
        max-width: 180px;
    }

    .app-shell.sidebar-expanded .sidebar .profile-info {
        max-width: 150px;
    }

    .app-shell.sidebar-expanded .sidebar .profile-arrow,
    .app-shell.sidebar-expanded .sidebar .logout-label {
        max-width: 70px;
    }

    .app-shell.sidebar-expanded .sidebar .admin-badge-pill {
        max-width: 64px;
    }

    .app-shell.sidebar-expanded .sidebar .brand > :not(.brand-logo),
    .app-shell.sidebar-expanded .sidebar .nav-label,
    .app-shell.sidebar-expanded .sidebar .profile-info,
    .app-shell.sidebar-expanded .sidebar .profile-arrow,
    .app-shell.sidebar-expanded .sidebar .logout-label,
    .app-shell.sidebar-expanded .sidebar .admin-badge-pill {
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
        transition-delay: 55ms;
    }

    .app-shell.sidebar-expanded .sidebar .nav-item {
        justify-content: flex-start;
        gap: 11px;
        padding-right: 14px;
        padding-left: 14px;
    }

    .app-shell.sidebar-expanded .sidebar-profile {
        align-items: stretch;
    }

    .app-shell.sidebar-expanded .sidebar .profile-link {
        justify-content: flex-start;
        gap: 10px;
        padding-right: 14px;
        padding-left: 14px;
    }

    .app-shell.sidebar-expanded .sidebar .logout-btn {
        gap: 8px;
        padding-right: 14px;
        padding-left: 14px;
    }

    .main {
        min-width: 0;
    }
}

/* Layout fluido: toda página autenticada ocupa a largura útil da tela. */
.app-shell {
    width: 100%;
}

.main {
    width: 100%;
    max-width: none;
    min-width: 0;
    justify-self: stretch;
}

@media (min-width: 1025px) {
    .main {
        padding-right: clamp(28px, 3vw, 64px);
        padding-left: clamp(28px, 3vw, 64px);
    }
}

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

    .main {
        grid-column: 1 / -1;
    }
}

/* Hierarquia de ações em Lançamentos: utilidades neutras, criação em destaque. */
[data-theme="light"] .topbar-actions .btn-utility {
    color: #56525d;
    background: #e9e7ed;
    border-color: transparent;
    box-shadow: none;
}

[data-theme="light"] .topbar-actions .btn-utility:hover {
    color: #494550;
    background: #dedbe4;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(45, 41, 51, .08);
}

[data-theme="dark"] .topbar-actions .btn-utility {
    color: #d2ced7;
    background: #302e36;
    border-color: transparent;
    box-shadow: none;
}

[data-theme="dark"] .topbar-actions .btn-utility:hover {
    color: #ffffff;
    background: #3b3843;
    border-color: transparent;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .16);
}

[data-theme="light"] #bulkSelectToggle.btn-utility.is-active,
[data-theme="dark"] #bulkSelectToggle.btn-utility.is-active {
    color: #ffffff;
    background: var(--primary);
    border-color: transparent;
    box-shadow: 0 10px 26px rgba(113, 67, 245, .14);
}

/* ============================================================================
 * Premium lavender direction
 * Referencias: SaaS leve, violeta como acao e zero bordas estruturais.
 * ============================================================================ */
:root {
    --mizu-pulso-50: #f5f2ff;
    --mizu-pulso-100: #ebe5ff;
    --mizu-pulso-200: #d9ceff;
    --mizu-pulso-300: #bca8ff;
    --mizu-pulso-400: #9474ff;
    --mizu-pulso-500: #7143f5;
    --mizu-pulso-600: #6133df;
    --mizu-pulso-700: #5129bd;
    --mizu-pulso-800: #43249a;
    --mizu-pulso-900: #382079;
}

[data-theme="light"] {
    --bg: #f7f6fb;
    --bg-card: #ffffff;
    --bg-subtle: #faf9fd;
    --bg-muted: #f0eef6;
    --border: transparent;
    --border-strong: transparent;
    --divider: transparent;
    --text: #4b4752;
    --text-soft: #76717f;
    --text-muted: #9a95a2;
    --text-strong: #37333e;
    --primary: var(--mizu-pulso-500);
    --primary-hover: var(--mizu-pulso-400);
    --primary-soft: var(--mizu-pulso-100);
    --primary-fg: var(--mizu-pulso-700);
    --c-primary-bg: var(--mizu-pulso-100);
    --c-primary-fg: var(--mizu-pulso-700);
    --ring: rgba(113, 67, 245, .20);
}

[data-theme="dark"] {
    --bg: #15141a;
    --bg-card: #201e27;
    --bg-subtle: #282631;
    --bg-muted: #302d3a;
    --border: transparent;
    --border-strong: transparent;
    --divider: transparent;
    --text: #e8e5ed;
    --text-soft: #aaa4b2;
    --text-muted: #817b89;
    --text-strong: #fbfaff;
    --primary: #8f70ff;
    --primary-hover: #a188ff;
    --primary-soft: rgba(143, 112, 255, .16);
    --primary-fg: #c9baff;
    --c-primary-bg: rgba(143, 112, 255, .16);
    --c-primary-fg: #c9baff;
    --ring: rgba(143, 112, 255, .26);
}

[data-theme="light"] body,
[data-theme="dark"] body {
    background: var(--bg);
}

/* Remove qualquer moldura estrutural; estado vem de superficie e elevacao. */
.sidebar,
.sidebar .brand,
.sidebar-profile,
.card,
.kpi,
.table-wrap,
.filter-bar,
.empty,
.cofrinho-card,
.cofrinho-archived-notice,
.admin-strip,
.admin-shortcut,
.admin-stat-strip,
.admin-users-list,
.admin-danger-zone,
.notif-page-item,
.notif-panel,
.integration-card,
.bc-history-item,
.attention-group,
.kpi-card,
.donation-card,
.auth-card,
.series-modal-card,
.bc-modal-card,
.install-banner,
.theme-option,
.input,
.select,
.textarea,
.btn,
.theme-toggle,
.notif-bell,
.period-pin,
.chart-toggle,
.radio-pills,
.filter-chips,
.cat-chip,
.cat-edit-panel,
.insight-item,
.recurrence-block,
.recurrence-preview,
.integration-field input[type="text"],
.integration-field textarea,
.integration-field select {
    border: 0 !important;
}

button,
input,
select,
textarea,
hr,
.badge,
.filter-chip,
.pagination-btn,
.status-pill,
.color-swatch,
.theme-swatch,
.help-fab,
.menu-toggle,
.sidebar-close,
.donation-dismiss,
.cofrinho-tl-del,
.cat-list-edit,
.cat-list-remove,
.bulk-bar,
.recurrence-switch,
.integration-toggle-slider,
.profile-link,
.logout-btn,
.profile-logout-row .logout-btn-inline {
    border: 0 !important;
}

[data-theme="light"] .sidebar {
    background: rgba(255, 255, 255, .88);
    box-shadow: 12px 0 36px rgba(45, 37, 68, .025);
}

[data-theme="dark"] .sidebar {
    background: #1b1921;
    box-shadow: 12px 0 36px rgba(0, 0, 0, .12);
}

[data-theme="light"] .sidebar .brand-logo,
[data-theme="light"] .auth-brand .logo,
[data-theme="light"] .install-banner .install-icon {
    color: #ffffff;
    background: var(--mizu-pulso-500);
}

[data-theme="dark"] .sidebar .brand-logo,
[data-theme="dark"] .auth-brand .logo,
[data-theme="dark"] .install-banner .install-icon {
    color: #ffffff;
    background: #8f70ff;
    box-shadow: none;
}

[data-theme="light"] .nav-item.active,
[data-theme="light"] .nav-item.active:hover,
[data-theme="dark"] .nav-item.active,
[data-theme="dark"] .nav-item.active:hover {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 10px 28px rgba(113, 67, 245, .16);
}

.topbar h1 .highlight {
    color: var(--primary);
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-secondary,
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .btn-secondary {
    color: #ffffff;
    background: var(--primary);
    box-shadow: 0 10px 26px rgba(113, 67, 245, .14);
}

[data-theme="light"] .btn-primary:hover,
[data-theme="light"] .btn-secondary:hover,
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .btn-secondary:hover {
    color: #ffffff;
    background: var(--primary-hover);
    box-shadow: 0 14px 30px rgba(113, 67, 245, .18);
}

[data-theme="light"] .btn-ghost,
[data-theme="light"] .theme-toggle,
[data-theme="light"] .notif-bell {
    color: var(--text);
    background: rgba(255, 255, 255, .88);
    box-shadow: 0 8px 24px rgba(45, 37, 68, .045);
}

[data-theme="dark"] .btn-ghost,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .notif-bell {
    color: var(--text);
    background: #282631;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .10);
}

[data-theme="light"] .filter-bar,
[data-theme="light"] .card,
[data-theme="light"] .kpi,
[data-theme="light"] .table-wrap,
[data-theme="light"] .empty,
[data-theme="light"] .cofrinho-card,
[data-theme="light"] .admin-shortcut,
[data-theme="light"] .admin-stat-strip,
[data-theme="light"] .admin-users-list,
[data-theme="light"] .integration-card,
[data-theme="light"] .notif-page-item {
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(45, 37, 68, .035);
}

[data-theme="dark"] .filter-bar,
[data-theme="dark"] .card,
[data-theme="dark"] .kpi,
[data-theme="dark"] .table-wrap,
[data-theme="dark"] .empty,
[data-theme="dark"] .cofrinho-card,
[data-theme="dark"] .admin-shortcut,
[data-theme="dark"] .admin-stat-strip,
[data-theme="dark"] .admin-users-list,
[data-theme="dark"] .integration-card,
[data-theme="dark"] .notif-page-item {
    background: var(--bg-card);
    box-shadow: 0 14px 36px rgba(0, 0, 0, .10);
}

[data-theme="light"] .card:hover,
[data-theme="light"] .kpi:hover,
[data-theme="light"] .cofrinho-card:hover,
[data-theme="light"] .admin-shortcut:hover {
    box-shadow: 0 16px 40px rgba(45, 37, 68, .065);
}

[data-theme="dark"] .card:hover,
[data-theme="dark"] .kpi:hover,
[data-theme="dark"] .cofrinho-card:hover,
[data-theme="dark"] .admin-shortcut:hover {
    box-shadow: 0 18px 42px rgba(0, 0, 0, .16);
}

[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .textarea,
[data-theme="light"] .integration-field input[type="text"],
[data-theme="light"] .integration-field textarea,
[data-theme="light"] .integration-field select {
    background-color: #f3f1f7;
    box-shadow: none;
}

[data-theme="dark"] .input,
[data-theme="dark"] .select,
[data-theme="dark"] .textarea,
[data-theme="dark"] .integration-field input[type="text"],
[data-theme="dark"] .integration-field textarea,
[data-theme="dark"] .integration-field select {
    background-color: #2a2733;
    box-shadow: none;
}

.input:focus,
.select:focus,
.textarea:focus,
.integration-field input[type="text"]:focus,
.integration-field textarea:focus,
.integration-field select:focus {
    background-color: var(--bg-card);
    box-shadow: 0 0 0 4px var(--ring) !important;
}

.input.error,
.select.error,
.textarea.error,
.input.is-error {
    box-shadow: 0 0 0 4px var(--c-danger-bg) !important;
}

.select:focus {
    background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%237143F5' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}

[data-theme="light"] .period-pin,
[data-theme="light"] .radio-pills,
[data-theme="light"] .chart-toggle,
[data-theme="light"] .filter-chips {
    background: #f0eef6;
    box-shadow: none;
}

[data-theme="dark"] .period-pin,
[data-theme="dark"] .radio-pills,
[data-theme="dark"] .chart-toggle,
[data-theme="dark"] .filter-chips {
    background: #2e2b37;
    box-shadow: none;
}

[data-theme="light"] .chart-toggle-btn.is-active,
[data-theme="light"] .radio-pills input:checked + label,
[data-theme="light"] .filter-chip.active,
[data-theme="dark"] .chart-toggle-btn.is-active,
[data-theme="dark"] .radio-pills input:checked + label,
[data-theme="dark"] .filter-chip.active {
    color: #ffffff;
    background: var(--primary);
}

.progress-fill,
.cofrinho-progress-bar > span {
    background: var(--primary);
}

.table th,
.table td,
.admin-user-row,
.admin-tx-row,
.admin-attempt-row,
.admin-recent-user,
.cofrinho-card-foot,
.cofrinho-calc li,
.cat-edit-panel,
.pagination,
.profile-logout-row {
    border: 0 !important;
}

[data-theme="light"] .table tbody tr:hover {
    background: #f7f5fb;
}

[data-theme="dark"] .table tbody tr:hover {
    background: #292631;
}

.admin-strip {
    color: var(--primary-fg);
    background: var(--primary-soft);
    box-shadow: none;
}

:root {
    --admin-accent: var(--mizu-pulso-500);
    --admin-accent-bg: var(--mizu-pulso-100);
}

[data-theme="dark"] {
    --admin-accent: #8f70ff;
    --admin-accent-bg: rgba(143, 112, 255, .16);
}

[data-theme="light"] .bottom-nav {
    border: 0;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 14px 42px rgba(45, 37, 68, .12);
}

[data-theme="dark"] .bottom-nav {
    border: 0;
    background: rgba(32, 30, 39, .95);
    box-shadow: 0 14px 42px rgba(0, 0, 0, .20);
}

[data-theme="light"] .bottom-nav-item.active,
[data-theme="dark"] .bottom-nav-item.active {
    color: #ffffff;
    background: var(--primary);
}

@media (max-width: 520px) {
    .topbar-actions .btn {
        min-height: 44px;
        height: 44px;
        padding: 0 16px;
        font-size: 14px;
    }

    .kpi .value {
        font-size: 28px;
    }

    .card-title h3 {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0ms !important;
        transition-duration: 0ms !important;
    }
}

/* ============================================================================
 * Light airiness pass
 * Menos caixas, mais hierarquia por espaco, superficie e tipografia.
 * ============================================================================ */
@media (prefers-color-scheme: light), (prefers-color-scheme: dark) {
    .main {
        padding: 48px 56px 80px;
    }

    [data-theme="light"] .sidebar {
        border-right: 0;
        box-shadow: 10px 0 32px rgba(14, 14, 14, .025);
    }

    [data-theme="light"] .sidebar .brand,
    [data-theme="light"] .sidebar-profile {
        border-color: rgba(14, 14, 14, .055);
    }

    .topbar {
        margin-bottom: 36px;
    }

    .filter-bar {
        min-height: 80px;
        margin-bottom: 36px;
        padding: 16px 18px;
    }

    [data-theme="light"] .filter-bar {
        border-color: transparent;
        background: rgba(255, 252, 253, .78);
        box-shadow: 0 8px 28px rgba(14, 14, 14, .025);
    }

    .dashboard-grid,
    .grid,
    .admin-shortcut-grid,
    .cofrinho-grid {
        gap: 24px;
    }

    .dashboard-grid {
        margin-bottom: 36px;
    }

    [data-theme="light"] .card,
    [data-theme="light"] .kpi,
    [data-theme="light"] .table-wrap,
    [data-theme="light"] .empty,
    [data-theme="light"] .cofrinho-card,
    [data-theme="light"] .admin-shortcut,
    [data-theme="light"] .admin-stat-strip,
    [data-theme="light"] .admin-users-list,
    [data-theme="light"] .admin-danger-zone,
    [data-theme="light"] .notif-page-item,
    [data-theme="light"] .integration-card,
    [data-theme="light"] .bc-history-item,
    [data-theme="light"] .attention-group,
    [data-theme="light"] .kpi-card,
    [data-theme="light"] .donation-card,
    [data-theme="light"] .cofrinho-archived-notice {
        border-color: transparent;
        box-shadow: 0 1px 2px rgba(14, 14, 14, .025), 0 10px 30px rgba(14, 14, 14, .025);
    }

    .card,
    .kpi,
    .cofrinho-card {
        padding: 28px;
    }

    [data-theme="light"] .card:hover,
    [data-theme="light"] .kpi:hover,
    [data-theme="light"] .cofrinho-card:hover,
    [data-theme="light"] .admin-shortcut:hover,
    [data-theme="light"] .notif-page-item:hover,
    [data-theme="light"] .integration-card:hover {
        border-color: transparent;
        box-shadow: 0 2px 4px rgba(14, 14, 14, .03), 0 14px 38px rgba(14, 14, 14, .045);
    }

    [data-theme="light"] .input,
    [data-theme="light"] .select,
    [data-theme="light"] .textarea,
    [data-theme="light"] .integration-field input[type="text"],
    [data-theme="light"] .integration-field textarea,
    [data-theme="light"] .integration-field select {
        border-color: transparent;
        background-color: var(--mizu-cloud-50);
        box-shadow: none;
    }

    [data-theme="light"] .input:hover,
    [data-theme="light"] .select:hover,
    [data-theme="light"] .textarea:hover {
        border-color: transparent;
        background-color: var(--mizu-cloud-100);
    }

    [data-theme="light"] .input:focus,
    [data-theme="light"] .select:focus,
    [data-theme="light"] .textarea:focus,
    [data-theme="light"] .integration-field input[type="text"]:focus,
    [data-theme="light"] .integration-field textarea:focus,
    [data-theme="light"] .integration-field select:focus {
        border-color: transparent;
        background-color: var(--mizu-respiro);
        box-shadow: 0 0 0 3px var(--ring);
    }

    [data-theme="light"] .btn-ghost,
    [data-theme="light"] .theme-toggle,
    [data-theme="light"] .notif-bell {
        border-color: transparent;
        background: var(--mizu-respiro);
        box-shadow: 0 1px 2px rgba(14, 14, 14, .035), 0 8px 20px rgba(14, 14, 14, .025);
    }

    [data-theme="light"] .btn-ghost:hover,
    [data-theme="light"] .theme-toggle:hover,
    [data-theme="light"] .notif-bell:hover {
        border-color: transparent;
        background: var(--mizu-cloud-50);
    }

    [data-theme="light"] .period-pin {
        border-color: transparent;
        background: var(--mizu-pulso-50);
        box-shadow: none;
    }

    [data-theme="light"] .table th {
        background: transparent;
        border-bottom-color: rgba(14, 14, 14, .055);
    }

    [data-theme="light"] .table td,
    [data-theme="light"] .admin-user-row,
    [data-theme="light"] .admin-tx-row,
    [data-theme="light"] .admin-attempt-row,
    [data-theme="light"] .admin-recent-user {
        border-color: rgba(14, 14, 14, .045);
    }

    [data-theme="light"] .chart-toggle,
    [data-theme="light"] .radio-pills,
    [data-theme="light"] .filter-chips {
        background: rgba(235, 231, 233, .72);
    }
}

/* ============================================================================
 * Final zero-border pass
 * Deve permanecer no fim do arquivo para neutralizar qualquer regra legada.
 * A hierarquia visual vem de superficie, espaco e elevacao suave.
 * ============================================================================ */
.app-shell :where(
    div,
    section,
    article,
    aside,
    header,
    footer,
    nav,
    main,
    form,
    fieldset,
    table,
    thead,
    tbody,
    tr,
    th,
    td,
    button,
    a,
    img,
    hr,
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select,
    textarea
),
.auth :where(
    div,
    section,
    article,
    form,
    fieldset,
    button,
    a,
    img,
    hr,
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select,
    textarea
),
.modal :where(
    div,
    section,
    article,
    form,
    fieldset,
    button,
    a,
    img,
    hr,
    input:not([type="checkbox"]):not([type="radio"]):not([type="color"]),
    select,
    textarea
) {
    border: 0 !important;
    outline: 0;
}

.period-pin,
.period-pin-active,
.period-pin-action,
.period-pin-form,
.filter-bar,
.input,
.select,
.textarea,
.chart-toggle,
.radio-pills,
.filter-chips,
.cat-edit-panel,
.table th,
.table td,
.admin-user-row,
.admin-tx-row,
.admin-attempt-row,
.admin-recent-user,
.sidebar .brand,
.sidebar-profile,
.profile-logout-row,
.cofrinho-card-foot,
.cofrinho-calc li,
.pagination {
    border: 0 !important;
    outline: 0;
}

[data-theme="light"] .period-pin,
[data-theme="dark"] .period-pin,
[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .textarea,
[data-theme="dark"] .input,
[data-theme="dark"] .select,
[data-theme="dark"] .textarea {
    box-shadow: none !important;
}

.input:focus,
.select:focus,
.textarea:focus,
.integration-field input[type="text"]:focus,
.integration-field textarea:focus,
.integration-field select:focus,
button:focus-visible,
a:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 4px var(--ring) !important;
}

.input.error,
.select.error,
.textarea.error,
.input.is-error {
    box-shadow: 0 0 0 4px var(--c-danger-bg) !important;
}

@media (max-width: 1024px) {
    .main {
        padding: 36px 28px 64px;
    }
}

@media (max-width: 768px) {
    body.filter-sheet-open {
        width: 100%;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    .main .filter-bar.is-mounted {
        display: block;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        height: auto;
        max-height: min(86vh, 760px);
        max-height: min(86dvh, 760px);
        margin: 0;
        padding: 10px 18px 0;
        overflow-x: hidden;
        overflow-y: auto !important;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
        animation: none !important;
        scrollbar-gutter: auto;
    }

    .main .filter-bar.is-mounted .filter-bar-actions {
        box-sizing: border-box;
        position: sticky;
        bottom: 0;
        z-index: 2;
        width: calc(100% + 36px);
        max-width: none;
        flex: 0 0 auto;
        margin: 18px -18px 0;
        padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
    }

    .main {
        padding: 28px 16px calc(96px + env(safe-area-inset-bottom));
    }

    .topbar {
        margin-bottom: 28px;
    }

    .filter-bar {
        min-height: auto;
        margin-bottom: 28px;
        padding: 14px;
    }

    .dashboard-grid,
    .grid,
    .cofrinho-grid {
        gap: 18px;
    }

    .card,
    .kpi,
    .cofrinho-card {
        padding: 22px;
    }
}
