/* Milhã Automação Design System — light claymorphism, data-first and accessible. */
:root {
    color-scheme: light;
    --nx-white: #ffffff;
    --nx-canvas: #f8fafc;
    --nx-canvas-strong: #f1f5f9;
    --nx-surface: #ffffff;
    --nx-surface-muted: #f8fafc;
    --nx-surface-raised: #ffffff;
    --nx-primary: #4f46e5;
    --nx-primary-hover: #4338ca;
    --nx-primary-soft: #eef2ff;
    --nx-primary-soft-strong: #e0e7ff;
    --nx-secondary: #8b5cf6;
    --nx-secondary-soft: #f5f3ff;
    --nx-info: #2563eb;
    --nx-success: #15803d;
    --nx-success-soft: #ecfdf3;
    --nx-warning: #a16207;
    --nx-warning-soft: #fffbeb;
    --nx-danger: #b42318;
    --nx-danger-hover: #912018;
    --nx-danger-soft: #fff1f0;
    --nx-ink: #0f172a;
    --nx-text: #334155;
    --nx-muted: #64748b;
    --nx-subtle: #94a3b8;
    --nx-line: #e2e8f0;
    --nx-line-strong: #cbd5e1;
    --nx-focus: rgba(79, 70, 229, .22);

    --nx-radius-xs: 8px;
    --nx-radius-sm: 12px;
    --nx-radius-md: 16px;
    --nx-radius-lg: 20px;
    --nx-radius-xl: 24px;
    --nx-radius-pill: 999px;

    --nx-space-1: 4px;
    --nx-space-2: 8px;
    --nx-space-3: 12px;
    --nx-space-4: 16px;
    --nx-space-5: 20px;
    --nx-space-6: 24px;
    --nx-space-8: 32px;
    --nx-space-10: 40px;
    --nx-space-12: 48px;

    --nx-shadow-xs: 0 1px 3px rgba(15, 23, 42, .05);
    --nx-shadow-sm: 0 5px 16px rgba(15, 23, 42, .055);
    --nx-shadow-clay:
        0 12px 34px rgba(79, 70, 229, .07),
        0 3px 9px rgba(15, 23, 42, .045),
        inset 0 2px 4px rgba(255, 255, 255, .9);
    --nx-shadow-clay-hover:
        0 18px 42px rgba(79, 70, 229, .12),
        0 6px 16px rgba(15, 23, 42, .06),
        inset 0 2px 4px rgba(255, 255, 255, .95);
    --nx-shadow-floating: 0 22px 60px rgba(15, 23, 42, .18);

    --nx-font: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --nx-content: 1440px;
    --nx-sidebar: 272px;
    --nx-sidebar-collapsed: 88px;
    --nx-transition: .25s ease-in-out;
}

html {
    background: var(--nx-canvas);
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--nx-text);
    background: var(--nx-canvas);
    font-family: var(--nx-font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

::selection {
    color: var(--nx-white);
    background: var(--nx-primary);
}

*:focus-visible {
    outline: 3px solid var(--nx-focus);
    outline-offset: 2px;
}

a {
    color: var(--nx-primary);
    text-underline-offset: 3px;
}

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

.skip-link {
    position: fixed;
    top: var(--nx-space-3);
    left: var(--nx-space-3);
    z-index: 200;
    padding: 10px 14px;
    border-radius: var(--nx-radius-sm);
    color: var(--nx-white);
    background: var(--nx-ink);
    transform: translateY(-160%);
    transition: transform var(--nx-transition);
}

.skip-link:focus {
    transform: translateY(0);
}

.icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.container {
    width: min(var(--nx-content), calc(100% - 48px));
    margin-inline: auto;
}

.has-sidebar {
    --sidebar-width: var(--nx-sidebar);
    --sidebar-collapsed-width: var(--nx-sidebar-collapsed);
    padding-left: var(--sidebar-width);
    transition: padding-left var(--nx-transition);
}

.has-sidebar.sidebar-collapsed {
    padding-left: var(--sidebar-collapsed-width);
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    width: var(--sidebar-width);
    padding: var(--nx-space-4);
    border-right: 1px solid rgba(226, 232, 240, .85);
    color: var(--nx-text);
    background: rgba(255, 255, 255, .96);
    box-shadow: 10px 0 32px rgba(79, 70, 229, .055);
    backdrop-filter: blur(18px);
    transition: width var(--nx-transition), transform var(--nx-transition);
}

.sidebar-header {
    min-height: 56px;
    margin-bottom: var(--nx-space-5);
    padding: 0 2px;
}

.brand,
.sidebar .brand {
    min-width: 0;
    padding: 0;
    color: var(--nx-ink);
    font-weight: 750;
    letter-spacing: -.02em;
}

.brand-mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border: 1px solid rgba(255, 255, 255, .8);
    border-radius: 15px;
    color: var(--nx-white);
    background: var(--nx-primary);
    box-shadow:
        0 9px 20px rgba(79, 70, 229, .24),
        inset 0 2px 4px rgba(255, 255, 255, .24);
}

.brand-copy {
    display: grid;
    min-width: 0;
    line-height: 1.2;
}

.brand-copy strong {
    overflow: hidden;
    color: var(--nx-ink);
    text-overflow: ellipsis;
}

.brand-copy small {
    overflow: hidden;
    color: var(--nx-muted);
    font-size: .72rem;
    font-weight: 600;
    text-overflow: ellipsis;
}

.sidebar-toggle,
.mobile-menu-toggle {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
    border: 1px solid var(--nx-line);
    border-radius: 14px;
    color: var(--nx-muted);
    background: var(--nx-surface-muted);
    box-shadow: var(--nx-shadow-xs), inset 0 1px 2px rgba(255, 255, 255, .9);
    transition: color var(--nx-transition), border-color var(--nx-transition), background var(--nx-transition), transform var(--nx-transition);
}

.sidebar-toggle:hover,
.mobile-menu-toggle:hover {
    border-color: var(--nx-primary-soft-strong);
    color: var(--nx-primary);
    background: var(--nx-primary-soft);
}

.sidebar-toggle:active,
.mobile-menu-toggle:active {
    transform: scale(.96);
}

.sidebar-nav {
    gap: var(--nx-space-1);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--nx-line-strong) transparent;
}

.nav-group-label {
    margin: 18px 12px 7px;
    color: var(--nx-subtle);
    font-size: .66rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    transition: opacity .15s ease;
}

.sidebar-nav a,
.sidebar-nav .link-button {
    min-height: 48px;
    color: var(--nx-text);
}

.nav-link,
.sidebar-nav .link-button {
    position: relative;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 14px;
    font-size: .91rem;
    font-weight: 650;
    transition: color var(--nx-transition), background var(--nx-transition), border-color var(--nx-transition), transform var(--nx-transition), box-shadow var(--nx-transition);
}

.nav-link:hover,
.sidebar-nav .link-button:hover {
    border-color: var(--nx-line);
    color: var(--nx-primary);
    background: var(--nx-surface-muted);
    transform: translateX(2px);
}

.nav-link.active {
    border-color: rgba(79, 70, 229, .11);
    color: var(--nx-primary-hover);
    background: var(--nx-primary-soft);
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, .9), 0 5px 12px rgba(79, 70, 229, .08);
}

.nav-link.active::after {
    position: absolute;
    top: 13px;
    right: 8px;
    width: 5px;
    height: 20px;
    border-radius: var(--nx-radius-pill);
    background: var(--nx-primary);
    content: "";
}

.nav-icon {
    width: 24px;
    flex-basis: 24px;
    color: var(--nx-muted);
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    color: var(--nx-primary);
}

.nav-label {
    margin-left: 12px;
}

.sidebar-logout {
    margin-top: var(--nx-space-4);
    padding-top: var(--nx-space-4);
    border-top-color: var(--nx-line);
}

.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-header {
    justify-content: center;
}

.sidebar-collapsed .sidebar .brand {
    display: none;
}

.sidebar-collapsed .sidebar .nav-group-label {
    height: 1px;
    margin: 8px 0;
    overflow: hidden;
    opacity: 0;
}

.sidebar-collapsed .sidebar .nav-link.active {
    outline: none;
    box-shadow: 0 6px 14px rgba(79, 70, 229, .13);
}

.sidebar-collapsed .sidebar .nav-link.active::after {
    display: none;
}

.app-topbar {
    min-height: 76px;
    padding: 12px 28px;
    border-bottom: 1px solid rgba(226, 232, 240, .78);
    background: rgba(248, 250, 252, .88);
    box-shadow: 0 5px 18px rgba(15, 23, 42, .025);
    backdrop-filter: blur(16px);
}

.tenant-identity {
    align-items: center;
    gap: 12px;
}

.tenant-name {
    color: var(--nx-ink);
    font-size: .95rem;
    font-weight: 750;
}

.tenant-plan {
    padding: 5px 10px;
    border: 1px solid var(--nx-primary-soft-strong);
    border-radius: var(--nx-radius-pill);
    color: var(--nx-primary-hover);
    background: var(--nx-primary-soft);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--nx-space-3);
}

.topbar-icon-button {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid var(--nx-line);
    border-radius: 14px;
    color: var(--nx-muted);
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow-xs);
}

.profile-dropdown {
    position: relative;
}

.profile-dropdown summary {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 8px 5px 6px;
    border: 1px solid transparent;
    border-radius: 16px;
    cursor: pointer;
    list-style: none;
    transition: background var(--nx-transition), border-color var(--nx-transition), box-shadow var(--nx-transition);
}

.profile-dropdown summary::-webkit-details-marker {
    display: none;
}

.profile-dropdown summary:hover,
.profile-dropdown[open] summary {
    border-color: var(--nx-line);
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow-sm);
}

.profile-summary-copy {
    display: grid;
    min-width: 0;
    line-height: 1.25;
}

.profile-summary-copy strong {
    overflow: hidden;
    max-width: 180px;
    color: var(--nx-ink);
    font-size: .86rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-summary-copy small {
    overflow: hidden;
    max-width: 180px;
    color: var(--nx-muted);
    font-size: .72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-avatar,
.mobile-profile-link {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 2px solid var(--nx-white);
    color: var(--nx-white);
    background: var(--nx-primary);
    box-shadow: 0 6px 14px rgba(79, 70, 229, .24);
}

.profile-chevron {
    width: 16px;
    height: 16px;
    color: var(--nx-subtle);
    transition: transform var(--nx-transition);
}

.profile-dropdown[open] .profile-chevron {
    transform: rotate(180deg);
}

.profile-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    width: 230px;
    padding: 8px;
    border: 1px solid var(--nx-line);
    border-radius: 18px;
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow-floating), inset 0 2px 3px rgba(255, 255, 255, .9);
}

.profile-popover a,
.profile-popover button {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    color: var(--nx-text);
    background: transparent;
    font: inherit;
    font-size: .88rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.profile-popover a:hover,
.profile-popover button:hover {
    color: var(--nx-primary);
    background: var(--nx-primary-soft);
}

.profile-popover form {
    margin: 4px 0 0;
    padding-top: 4px;
    border-top: 1px solid var(--nx-line);
}

.app-main {
    padding-top: 36px;
    padding-bottom: 80px;
    animation: nx-page-in .28s ease both;
}

@keyframes nx-page-in {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

h1,
h2,
h3 {
    color: var(--nx-ink);
    font-weight: 700;
    letter-spacing: -.025em;
}

h1 {
    margin: 0 0 8px;
    font-size: clamp(1.75rem, 3vw, 2.45rem);
    line-height: 1.12;
}

h2 {
    font-size: clamp(1.2rem, 2vw, 1.55rem);
}

h3 {
    font-size: 1.05rem;
}

p {
    text-wrap: pretty;
}

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

.eyebrow,
.page-eyebrow,
.plans-kicker {
    color: var(--nx-primary);
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .11em;
}

.page-header {
    min-height: 72px;
    align-items: flex-end;
    margin-bottom: 28px;
}

.page-header h1 {
    margin-bottom: 7px;
}

.page-header p {
    max-width: 720px;
    margin: 0;
}

.section-title {
    margin: 34px 0 16px;
}

.section-title h2 {
    margin: 0;
}

.card,
.welcome-banner,
.budget-summary,
.finance-kpi,
.finance-panel {
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: var(--nx-radius-lg);
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow-clay);
}

.card {
    padding: clamp(20px, 2.2vw, 30px);
    margin-bottom: 24px;
}

.card>h1:first-child,
.card>h2:first-child {
    margin-top: 0;
}

.card-interactive,
.metric,
.finance-kpi {
    transition: transform var(--nx-transition), border-color var(--nx-transition), box-shadow var(--nx-transition);
}

.card-interactive:hover,
.metric:hover,
.finance-kpi:hover {
    border-color: rgba(79, 70, 229, .18);
    box-shadow: var(--nx-shadow-clay-hover);
    transform: translateY(-4px);
}

.metrics {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.metric {
    position: relative;
    grid-column: span 3;
    min-height: 142px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: var(--nx-radius-lg);
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow-clay);
}

.metrics.metrics-3 .metric {
    grid-column: span 4;
}

.metric::after {
    position: absolute;
    right: -22px;
    bottom: -28px;
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: var(--nx-primary-soft);
    opacity: .62;
    content: "";
}

.metric:nth-child(4n + 2)::after {
    background: var(--nx-secondary-soft);
}

.metric:nth-child(4n + 3)::after {
    background: #eff6ff;
}

.metric:nth-child(4n + 4)::after {
    background: var(--nx-success-soft);
}

.metric strong {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    color: var(--nx-ink);
    font-size: clamp(1.65rem, 2.2vw, 2.15rem);
    line-height: 1.08;
    letter-spacing: -.04em;
}

.metric span {
    position: relative;
    z-index: 1;
    color: var(--nx-muted);
    font-size: .88rem;
}

.metric-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.metric-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--nx-primary-soft-strong);
    border-radius: 14px;
    color: var(--nx-primary);
    background: var(--nx-primary-soft);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, .9), 0 6px 14px rgba(79, 70, 229, .1);
}

.metric-icon .icon {
    width: 21px;
    height: 21px;
}

.button {
    min-height: 46px;
    gap: 9px;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--nx-white);
    background: var(--nx-primary);
    box-shadow: 0 8px 18px rgba(79, 70, 229, .2), inset 0 1px 2px rgba(255, 255, 255, .24);
    font-size: .91rem;
    font-weight: 750;
    transition: color var(--nx-transition), background var(--nx-transition), border-color var(--nx-transition), box-shadow var(--nx-transition), transform var(--nx-transition);
}

.button:hover {
    color: var(--nx-white);
    background: var(--nx-primary-hover);
    box-shadow: 0 12px 25px rgba(79, 70, 229, .25), inset 0 1px 2px rgba(255, 255, 255, .2);
    transform: translateY(-2px);
}

.button:active {
    transform: scale(.98);
}

.button.small {
    min-height: 40px;
    padding: 8px 13px;
    border-radius: 12px;
    font-size: .82rem;
}

.button.ghost {
    border-color: var(--nx-line-strong);
    color: var(--nx-text);
    background: var(--nx-white);
    box-shadow: var(--nx-shadow-xs), inset 0 1px 2px rgba(255, 255, 255, .9);
}

.button.ghost:hover {
    border-color: var(--nx-primary-soft-strong);
    color: var(--nx-primary-hover);
    background: var(--nx-primary-soft);
    box-shadow: 0 8px 16px rgba(79, 70, 229, .09);
}

.button.danger,
.button.confirmation-danger {
    background: var(--nx-danger);
    box-shadow: 0 8px 18px rgba(180, 35, 24, .18);
}

.button.danger:hover,
.button.confirmation-danger:hover {
    background: var(--nx-danger-hover);
}

.button:disabled,
.button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: .58;
    transform: none;
}

.danger-link {
    min-height: 44px;
    padding: 6px 8px;
    border-radius: 10px;
    color: var(--nx-danger);
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
}

.danger-link:hover {
    color: var(--nx-danger-hover);
    background: var(--nx-danger-soft);
}

.form-card {
    max-width: 820px;
}

.narrow {
    max-width: 500px;
}

.field {
    margin-bottom: 20px;
}

.field label,
.checkout-field label,
.partial-payment-form>label {
    margin-bottom: 7px;
    color: var(--nx-text);
    font-size: .83rem;
    font-weight: 750;
}

.field input,
.field select,
.field textarea,
.checkout-field input,
.search-bar input[type="search"],
.stock-form input[type="number"],
.partial-payment-controls input {
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid var(--nx-line-strong);
    border-radius: 13px;
    color: var(--nx-ink);
    background: var(--nx-surface-muted);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, .025), 0 1px 2px rgba(255, 255, 255, .9);
    transition: border-color var(--nx-transition), background var(--nx-transition), box-shadow var(--nx-transition);
}

.field input:hover,
.field select:hover,
.field textarea:hover,
.checkout-field input:hover {
    border-color: #a5b4fc;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.checkout-field input:focus,
.search-bar input[type="search"]:focus,
.stock-form input[type="number"]:focus,
.partial-payment-controls input:focus {
    border-color: var(--nx-primary);
    outline: 0;
    background: var(--nx-white);
    box-shadow: 0 0 0 4px var(--nx-focus), inset 0 1px 2px rgba(15, 23, 42, .02);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--nx-subtle);
}

.field input[readonly],
.field input:disabled,
.field select:disabled,
.field textarea:disabled {
    color: var(--nx-muted);
    background: var(--nx-canvas-strong);
    cursor: not-allowed;
}

.field:focus-within label,
.checkout-field:focus-within label {
    color: var(--nx-primary-hover);
}

.field textarea {
    min-height: 126px;
}

.field input[type="file"] {
    padding: 9px;
    border: 1px dashed var(--nx-line-strong);
    background: var(--nx-canvas);
}

.field input[type="file"]::file-selector-button {
    min-height: 36px;
    margin-right: 12px;
    padding: 7px 12px;
    border: 0;
    border-radius: 10px;
    color: var(--nx-primary-hover);
    background: var(--nx-primary-soft);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.password-control {
    position: relative;
    display: block;
}

.password-control input {
    padding-right: 82px;
}

.password-toggle {
    position: absolute;
    top: 2px;
    right: 6px;
    min-width: 68px;
    min-height: 44px;
    border: 0;
    border-radius: 9px;
    color: var(--nx-primary-hover);
    background: var(--nx-primary-soft);
    font: inherit;
    font-size: .74rem;
    font-weight: 750;
    cursor: pointer;
}

.password-toggle:hover {
    background: var(--nx-primary-soft-strong);
}

.file-selection-status {
    display: block;
    margin-top: 7px;
    color: var(--nx-muted);
    font-size: .78rem;
}

.hint,
.field-hint {
    color: var(--nx-muted);
    font-size: .79rem;
}

.error {
    color: var(--nx-danger);
    font-size: .8rem;
    font-weight: 650;
}

.alert {
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius-sm);
    color: var(--nx-text);
    background: var(--nx-white);
    box-shadow: var(--nx-shadow-xs), inset 0 2px 3px rgba(255, 255, 255, .82);
}

.alert-success {
    border-color: #bbf7d0;
    color: #166534;
    background: var(--nx-success-soft);
}

.alert-error {
    border-color: #fecaca;
    color: #991b1b;
    background: var(--nx-danger-soft);
}

.alert-warning {
    border-color: #fde68a;
    color: #854d0e;
    background: var(--nx-warning-soft);
}

.alert-info {
    border-color: #bfdbfe;
    color: #1d4ed8;
    background: #eff6ff;
}

.checkbox-field,
.checkbox-option {
    min-height: 44px;
}

.checkbox-field input,
.checkbox-option input {
    accent-color: var(--nx-primary);
}

.checkbox-group {
    border-color: var(--nx-line);
    border-radius: var(--nx-radius-md);
    background: var(--nx-surface-muted);
}

.form-grid {
    gap: 0 20px;
}

.filter-grid {
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius-md);
    background: var(--nx-surface-muted);
}

.filter-grid .field {
    margin-bottom: 0;
}

.filter-actions {
    min-height: 48px;
}

.table-wrap {
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius-md);
    background: var(--nx-surface);
    scrollbar-width: thin;
    scrollbar-color: var(--nx-line-strong) transparent;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--nx-line);
}

th {
    color: var(--nx-muted);
    background: var(--nx-surface-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .055em;
    text-transform: uppercase;
}

thead th:first-child {
    border-top-left-radius: 15px;
}

thead th:last-child {
    border-top-right-radius: 15px;
}

tbody tr {
    transition: background var(--nx-transition), box-shadow var(--nx-transition);
}

tbody tr:hover {
    background: #fafaff;
    box-shadow: inset 3px 0 var(--nx-primary-soft-strong);
}

tbody tr:last-child td {
    border-bottom: 0;
}

.row-actions {
    gap: 8px;
}

.pagination {
    gap: 8px;
}

.pagination-link {
    min-width: 42px;
    min-height: 42px;
    border-color: var(--nx-line);
    border-radius: 12px;
    color: var(--nx-text);
    background: var(--nx-white);
    box-shadow: var(--nx-shadow-xs);
}

a.pagination-link:hover {
    border-color: var(--nx-primary-soft-strong);
    color: var(--nx-primary);
    background: var(--nx-primary-soft);
}

.pagination-link.active {
    border-color: var(--nx-primary);
    color: var(--nx-white);
    background: var(--nx-primary);
}

.status,
.status-pill {
    padding: 6px 10px;
    border: 1px solid transparent;
    border-radius: var(--nx-radius-pill);
    font-size: .72rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.status-active,
.status-paid,
.status-approved,
.status-completed,
.status-pago,
.status-sent {
    border-color: #bbf7d0;
    color: #166534;
    background: #f0fdf4;
}

.status-pending,
.status-processing,
.status-partial_paid,
.status-past-due,
.status-pendente {
    border-color: #fde68a;
    color: #854d0e;
    background: #fffbeb;
}

.status-overdue,
.status-vencido,
.status-cancelled,
.status-canceled,
.status-cancelado,
.status-baixado,
.status-dead,
.status-reversed {
    border-color: #fecaca;
    color: #991b1b;
    background: #fff1f2;
}

.status-negotiating {
    border-color: #ddd6fe;
    color: #5b21b6;
    background: #f5f3ff;
}

.status-closed,
.status-emitido,
.status-scheduled {
    border-color: #bfdbfe;
    color: #1d4ed8;
    background: #eff6ff;
}

.status-counts {
    gap: 12px;
}

.status-counts div {
    min-height: 58px;
    padding: 12px 14px;
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius-sm);
    background: var(--nx-surface-muted);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, .9);
}

.details-grid {
    gap: 12px;
}

.details-grid>div {
    padding: 15px 16px;
    border: 1px solid var(--nx-line);
    border-radius: 14px;
    background: var(--nx-surface-muted);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, .9);
}

.details-grid dt {
    color: var(--nx-muted);
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.details-grid dd {
    color: var(--nx-ink);
    font-weight: 650;
}

.audit-list {
    padding-left: 24px;
}

.audit-list li {
    padding: 0 0 18px 8px;
}

.welcome-banner,
.dashboard-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    overflow: hidden;
    padding: clamp(24px, 4vw, 40px);
    border-color: rgba(79, 70, 229, .13);
    background: var(--nx-white);
}

.dashboard-hero::after,
.welcome-banner::after {
    position: absolute;
    top: -52px;
    right: -30px;
    width: 180px;
    height: 180px;
    border: 32px solid var(--nx-primary-soft);
    border-radius: 50%;
    opacity: .8;
    content: "";
}

.dashboard-hero-content {
    position: relative;
    z-index: 1;
    max-width: 760px;
}

.dashboard-hero .eyebrow {
    margin-bottom: 8px;
}

.dashboard-hero h1 {
    max-width: 700px;
}

.dashboard-hero p {
    max-width: 650px;
    margin: 8px 0 0;
    color: var(--nx-muted);
}

.dashboard-hero-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 10px;
    align-items: center;
}

.dashboard-section {
    margin-top: 36px;
}

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

.dashboard-section-header h2 {
    margin: 0;
}

.dashboard-section-header p {
    margin: 5px 0 0;
    color: var(--nx-muted);
}

.empty-state {
    min-height: 180px;
    justify-content: center;
    border-color: var(--nx-line-strong);
    border-radius: var(--nx-radius-md);
    color: var(--nx-muted);
    background: var(--nx-surface-muted);
}

.empty-state-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 8px;
    border-radius: 16px;
    color: var(--nx-primary);
    background: var(--nx-primary-soft);
}

.agenda-row,
.week-day,
.month-calendar {
    border-color: var(--nx-line);
    border-radius: var(--nx-radius-md);
}

.agenda-row {
    min-height: 76px;
    border-radius: 14px;
}

.agenda-row:hover {
    border-color: var(--nx-primary-soft-strong);
    box-shadow: var(--nx-shadow-sm);
    transform: translateY(-2px);
}

.agenda-row time,
.week-appointment time {
    color: var(--nx-primary);
}

.week-day {
    background: var(--nx-surface-muted);
}

.week-day-heading,
.calendar-weekday {
    background: var(--nx-canvas-strong);
}

.week-day.is-selected {
    border-color: #a5b4fc;
    box-shadow: 0 0 0 3px var(--nx-focus);
}

.week-day.is-selected .week-day-heading {
    color: var(--nx-primary-hover);
    background: var(--nx-primary-soft);
}

.week-appointment {
    border-left-color: var(--nx-primary);
    border-radius: 10px;
    box-shadow: var(--nx-shadow-xs);
}

.calendar-day.selected {
    background: var(--nx-primary-soft);
    box-shadow: inset 0 0 0 2px var(--nx-primary);
}

.calendar-day.selected>span {
    background: var(--nx-primary);
}

.finance-kpi,
.finance-panel {
    border-radius: var(--nx-radius-lg);
}

.finance-kpi {
    padding: 22px;
}

.finance-kpi-icon {
    border-radius: 12px;
    color: var(--nx-primary);
    background: var(--nx-primary-soft);
}

.finance-kpi-pending {
    border-top-color: var(--nx-primary);
}

.finance-panel {
    padding: 26px;
}

.month-navigation a {
    border-color: var(--nx-line);
    border-radius: 12px;
    color: var(--nx-primary);
    box-shadow: var(--nx-shadow-xs);
}

.bar-chart-bar {
    border-radius: 10px 10px 3px 3px;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, .26);
}

.bar-chart-bar-installation {
    background: var(--nx-primary);
}

.bar-chart-bar-cleaning {
    background: var(--nx-secondary);
}

.toast-stack {
    position: fixed;
    top: 92px;
    right: 24px;
    z-index: 120;
    width: min(390px, calc(100vw - 32px));
    display: grid;
    gap: 12px;
    pointer-events: none;
}

.toast {
    position: relative;
    min-height: 74px;
    display: grid;
    grid-template-columns: 36px 1fr 32px;
    gap: 12px;
    align-items: center;
    padding: 14px 12px 16px 14px;
    overflow: hidden;
    border: 1px solid var(--nx-line);
    border-radius: 17px;
    color: var(--nx-text);
    background: rgba(255, 255, 255, .97);
    box-shadow: var(--nx-shadow-floating), inset 0 2px 4px rgba(255, 255, 255, .9);
    pointer-events: auto;
    animation: nx-toast-in .35s cubic-bezier(.2, .85, .3, 1) both;
}

.toast.is-leaving {
    animation: nx-toast-out .25s ease both;
}

.toast-icon {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--nx-info);
    background: #eff6ff;
}

.toast-icon .icon {
    width: 19px;
    height: 19px;
}

.toast-success .toast-icon {
    color: var(--nx-success);
    background: var(--nx-success-soft);
}

.toast-warning .toast-icon {
    color: var(--nx-warning);
    background: var(--nx-warning-soft);
}

.toast-error .toast-icon {
    color: var(--nx-danger);
    background: var(--nx-danger-soft);
}

.toast-message {
    margin: 0;
    font-size: .86rem;
    font-weight: 650;
}

.toast-close {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    color: var(--nx-muted);
    background: transparent;
    cursor: pointer;
}

.toast-close:hover {
    color: var(--nx-ink);
    background: var(--nx-canvas-strong);
}

.toast-close .icon {
    width: 17px;
    height: 17px;
}

.toast-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--nx-info);
    transform-origin: left;
    animation: nx-toast-progress 5s linear forwards;
}

.toast-success .toast-progress {
    background: var(--nx-success);
}

.toast-warning .toast-progress {
    background: var(--nx-warning);
}

.toast-error .toast-progress {
    background: var(--nx-danger);
}

.toast:hover .toast-progress {
    animation-play-state: paused;
}

@keyframes nx-toast-in {
    from {
        opacity: 0;
        transform: translateX(28px) scale(.98);
    }
}

@keyframes nx-toast-out {
    to {
        opacity: 0;
        transform: translateX(20px) scale(.98);
    }
}

@keyframes nx-toast-progress {
    to {
        transform: scaleX(0);
    }
}

.confirmation-dialog {
    border: 1px solid rgba(255, 255, 255, .78);
    border-radius: var(--nx-radius-xl);
    color: var(--nx-text);
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow-floating), inset 0 2px 4px rgba(255, 255, 255, .92);
}

.confirmation-dialog::backdrop {
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(7px);
}

.confirmation-dialog-content {
    padding: 30px;
}

.confirmation-dialog p {
    color: var(--nx-muted);
}

.page-skeleton {
    position: fixed;
    inset: 76px 0 0 var(--nx-sidebar);
    z-index: 100;
    display: grid;
    align-content: start;
    gap: 16px;
    padding: 38px max(24px, calc((100vw - var(--nx-sidebar) - var(--nx-content)) / 2));
    background: rgba(248, 250, 252, .94);
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

.page-skeleton.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.skeleton-line,
.skeleton-card {
    overflow: hidden;
    border: 1px solid var(--nx-line);
    border-radius: var(--nx-radius-md);
    background: var(--nx-canvas-strong);
}

.skeleton-line::after,
.skeleton-card::after {
    width: 45%;
    height: 100%;
    display: block;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent);
    content: "";
    animation: nx-shimmer 1.25s infinite;
}

.skeleton-line {
    width: min(430px, 70%);
    height: 36px;
}

.skeleton-line.short {
    width: min(270px, 45%);
    height: 20px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 10px;
}

.skeleton-card {
    height: 150px;
}

@keyframes nx-shimmer {
    from {
        transform: translateX(-120%);
    }

    to {
        transform: translateX(260%);
    }
}

.sidebar-collapsed .page-skeleton {
    left: var(--nx-sidebar-collapsed);
}

.guest-layout .page-skeleton,
.subscription-shell .page-skeleton {
    top: 80px;
    left: 0;
}

.guest-layout {
    background: var(--nx-canvas);
}

.guest-header {
    padding: 18px 0;
    border-bottom: 1px solid var(--nx-line);
    color: var(--nx-ink);
    background: rgba(255, 255, 255, .88);
    backdrop-filter: blur(14px);
}

.guest-header .brand {
    color: var(--nx-ink);
}

.guest-layout main {
    padding-top: 36px;
}

.auth-shell {
    min-height: calc(100vh - 150px);
    display: grid;
    grid-template-columns: minmax(300px, .9fr) minmax(420px, 1.1fr);
    align-items: stretch;
    gap: 28px;
}

.auth-aside {
    position: relative;
    min-height: 580px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: clamp(28px, 5vw, 56px);
    overflow: hidden;
    border-radius: var(--nx-radius-xl);
    color: var(--nx-white);
    background: var(--nx-primary);
    box-shadow: var(--nx-shadow-clay);
}

.auth-aside::before,
.auth-aside::after {
    position: absolute;
    border: 34px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    content: "";
}

.auth-aside::before {
    top: -90px;
    right: -70px;
    width: 240px;
    height: 240px;
}

.auth-aside::after {
    top: 80px;
    left: -90px;
    width: 170px;
    height: 170px;
}

.auth-aside-content {
    position: relative;
    z-index: 1;
}

.auth-aside h1 {
    color: var(--nx-white);
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.auth-aside p {
    max-width: 520px;
    color: rgba(255, 255, 255, .78);
}

.eyebrow-light {
    color: rgba(255, 255, 255, .74);
}

.auth-benefits {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 28px 0 0;
    list-style: none;
}

.auth-benefits li {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 650;
}

.auth-benefits .icon {
    width: 18px;
    height: 18px;
}

.auth-card {
    align-self: center;
    width: min(100%, 560px);
    margin: 0 auto;
    padding: clamp(26px, 4vw, 44px);
}

.auth-card-header {
    margin-bottom: 28px;
}

.auth-card-header p {
    margin: 8px 0 0;
}

.auth-card h1,
.auth-card h2 {
    margin-bottom: 0;
}

.auth-card-standalone {
    margin: clamp(24px, 7vh, 72px) auto;
    text-align: left;
}

.auth-feature-icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 17px;
    color: var(--nx-primary);
    background: var(--nx-primary-soft);
    box-shadow: inset 0 2px 3px rgba(255, 255, 255, .9);
}

.auth-feature-icon .icon {
    width: 24px;
    height: 24px;
}

.field-label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.field-label-row a {
    font-size: .82rem;
    font-weight: 750;
}

.auth-divider {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--nx-line);
}

.auth-actions .icon {
    width: 16px;
    height: 16px;
    vertical-align: -3px;
}

.signup-card {
    max-width: 980px;
    margin-inline: auto;
}

.signup-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
    color: var(--nx-muted);
    font-size: .78rem;
    font-weight: 750;
}

.signup-progress span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.signup-progress span::before {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--nx-primary);
    background: var(--nx-primary-soft);
    content: attr(data-step);
}

.signup-progress span+span::after {
    width: 28px;
    height: 1px;
    margin-right: 2px;
    background: var(--nx-line-strong);
    content: "";
    order: -1;
}

.mobile-header,
.bottom-nav,
.sidebar-backdrop {
    display: none;
}

/* Checkout and subscription surfaces share the same visual language. */
.subscription-shell {
    color: var(--nx-text);
    background: var(--nx-canvas);
    font-family: var(--nx-font);
}

.subscription-topbar {
    min-height: 80px;
}

.subscription-brand {
    color: var(--nx-ink);
}

.subscription-brand>span {
    border-radius: 14px;
    background: var(--nx-primary);
    box-shadow: 0 8px 18px rgba(79, 70, 229, .22), inset 0 2px 3px rgba(255, 255, 255, .24);
}

.subscription-plan-card,
.checkout-form-panel,
.checkout-summary {
    border-color: var(--nx-line);
    border-radius: var(--nx-radius-xl);
    background: var(--nx-white);
    box-shadow: var(--nx-shadow-clay);
}

.subscription-plan-card {
    transition: transform var(--nx-transition), box-shadow var(--nx-transition), border-color var(--nx-transition);
}

.subscription-plan-card:hover {
    border-color: var(--nx-primary-soft-strong);
    box-shadow: var(--nx-shadow-clay-hover);
    transform: translateY(-4px);
}

.subscription-plan-card.is-featured {
    transform: none;
    color: var(--nx-text);
    border: 2px solid var(--nx-primary);
    background: var(--nx-white);
    box-shadow: 0 18px 46px rgba(79, 70, 229, .16), inset 0 2px 4px rgba(255, 255, 255, .9);
}

.subscription-plan-card.is-featured h2,
.subscription-plan-card.is-featured .subscription-price strong,
.subscription-plan-card.is-featured .benefits-title {
    color: var(--nx-ink);
}

.popular-label {
    color: var(--nx-white);
    background: var(--nx-primary);
}

.plan-icon {
    border-radius: 15px;
    background: var(--nx-primary-soft);
}

.subscription-price strong {
    color: var(--nx-ink);
}

.is-featured .subscription-price small {
    color: var(--nx-muted);
}

.plan-benefits li span,
.is-featured .plan-benefits li span {
    color: var(--nx-white);
    background: var(--nx-primary);
}

.choose-plan-button,
.is-featured .choose-plan-button,
.checkout-submit {
    border-radius: 14px;
    color: var(--nx-white);
    background: var(--nx-primary);
    box-shadow: 0 10px 22px rgba(79, 70, 229, .22);
    transition: transform var(--nx-transition), background var(--nx-transition), box-shadow var(--nx-transition);
}

.choose-plan-button:hover,
.checkout-submit:hover {
    color: var(--nx-white);
    background: var(--nx-primary-hover);
    transform: translateY(-2px);
}

.payment-option {
    border-color: var(--nx-line-strong);
    border-radius: 15px;
    background: var(--nx-surface-muted);
}

.payment-option:has(input:checked) {
    border-color: var(--nx-primary);
    background: var(--nx-primary-soft);
    box-shadow: 0 0 0 3px var(--nx-focus);
}

.postal-spinner {
    top: 13px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 7px;
    background: var(--nx-primary-soft);
    animation: nx-skeleton-pulse .85s ease-in-out infinite alternate;
}

@keyframes nx-skeleton-pulse {
    to {
        background: var(--nx-primary-soft-strong);
        transform: scale(.88);
    }
}

/* Prepared tokens for a future dark theme; no toggle is exposed yet. */
[data-theme="dark"] {
    color-scheme: dark;
    --nx-canvas: #0b1120;
    --nx-canvas-strong: #111827;
    --nx-surface: #111827;
    --nx-surface-muted: #172033;
    --nx-surface-raised: #182238;
    --nx-ink: #f8fafc;
    --nx-text: #dbe3ef;
    --nx-muted: #9aa9bd;
    --nx-subtle: #718096;
    --nx-line: #25334a;
    --nx-line-strong: #35455e;
    --nx-primary-soft: #25245e;
    --nx-primary-soft-strong: #353184;
    --nx-shadow-clay:
        0 12px 34px rgba(0, 0, 0, .26),
        0 3px 9px rgba(0, 0, 0, .2),
        inset 0 1px 2px rgba(255, 255, 255, .035);
    --nx-shadow-clay-hover:
        0 18px 42px rgba(0, 0, 0, .34),
        0 6px 16px rgba(0, 0, 0, .22),
        inset 0 1px 2px rgba(255, 255, 255, .05);
}

@media (max-width: 1180px) {
    .metric {
        grid-column: span 6;
    }

    .metrics.metrics-3 .metric {
        grid-column: span 6;
    }

    .profile-summary-copy {
        display: none;
    }
}

@media (max-width: 760px) {
    .container {
        width: min(100% - 28px, var(--nx-content));
    }

    .has-sidebar,
    .has-sidebar.sidebar-collapsed {
        padding: 64px 0 82px;
    }

    .app-main {
        padding-top: 24px;
        padding-bottom: 34px;
    }

    .app-topbar {
        display: none;
    }

    .mobile-header {
        position: fixed;
        inset: 0 0 auto;
        z-index: 30;
        height: 64px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 14px;
        border-bottom: 1px solid rgba(226, 232, 240, .86);
        color: var(--nx-text);
        background: rgba(255, 255, 255, .94);
        box-shadow: 0 5px 18px rgba(15, 23, 42, .055);
        backdrop-filter: blur(16px);
    }

    .mobile-brand {
        color: var(--nx-ink);
    }

    .mobile-brand .brand-mark {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        border-radius: 12px;
    }

    .mobile-profile-link {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .mobile-menu-toggle {
        color: var(--nx-muted);
        background: var(--nx-surface-muted);
    }

    .bottom-nav {
        position: fixed;
        right: 10px;
        bottom: 10px;
        left: 10px;
        z-index: 42;
        min-height: 66px;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(54px, 1fr));
        gap: 2px;
        padding: 7px;
        border: 1px solid rgba(226, 232, 240, .9);
        border-radius: 22px;
        background: rgba(255, 255, 255, .96);
        box-shadow: 0 18px 44px rgba(15, 23, 42, .18), inset 0 2px 3px rgba(255, 255, 255, .9);
        backdrop-filter: blur(18px);
    }

    .bottom-nav a,
    .bottom-nav button {
        min-width: 0;
        min-height: 52px;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 4px 2px;
        border: 0;
        border-radius: 15px;
        color: var(--nx-muted);
        background: transparent;
        font: inherit;
        font-size: .62rem;
        font-weight: 750;
        text-decoration: none;
        cursor: pointer;
    }

    .bottom-nav a.active,
    .bottom-nav a:hover,
    .bottom-nav button:hover {
        color: var(--nx-primary);
        background: var(--nx-primary-soft);
    }

    .bottom-nav .icon {
        width: 21px;
        height: 21px;
    }

    .sidebar {
        z-index: 60;
        width: min(88vw, 320px);
        padding: 16px;
        transform: translateX(-105%);
        box-shadow: 16px 0 48px rgba(15, 23, 42, .22);
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 55;
        width: 100%;
        height: 100%;
        border: 0;
        background: rgba(15, 23, 42, .48);
        opacity: 0;
        pointer-events: none;
        backdrop-filter: blur(5px);
        transition: opacity var(--nx-transition);
    }

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

    .sidebar-open .sidebar-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .page-header,
    .dashboard-section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header .button {
        width: 100%;
    }

    .dashboard-hero {
        align-items: stretch;
        flex-direction: column;
        padding: 24px;
    }

    .dashboard-hero::after {
        width: 120px;
        height: 120px;
        border-width: 24px;
    }

    .dashboard-hero-actions {
        width: 100%;
        align-items: stretch;
        flex-direction: column;
        margin-top: 20px;
    }

    .dashboard-hero-actions .button {
        width: 100%;
    }

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

    .metric {
        grid-column: auto;
        min-height: 128px;
    }

    .metrics.metrics-3 .metric {
        grid-column: auto;
    }

    .form-grid.two-columns,
    .plan-grid,
    .skeleton-grid {
        grid-template-columns: 1fr;
    }

    .filter-grid {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .filter-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .filter-actions .button {
        width: 100%;
    }

    .toast-stack {
        top: 74px;
        right: 14px;
    }

    .page-skeleton {
        inset: 64px 0 76px;
        padding: 28px 16px;
    }

    .confirmation-dialog-content {
        padding: 24px;
    }

    .auth-shell {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .auth-aside {
        min-height: 0;
        padding: 28px;
    }

    .auth-aside h1 {
        font-size: clamp(1.8rem, 9vw, 2.35rem);
    }

    .auth-aside .auth-benefits {
        display: none;
    }

    .auth-card {
        padding: 24px;
    }
}

@media (max-width: 640px) {
    .responsive-table tr {
        border-color: var(--nx-line);
        border-radius: var(--nx-radius-md);
        box-shadow: var(--nx-shadow-sm), inset 0 2px 3px rgba(255, 255, 255, .88);
    }

    .responsive-table td[data-label]::before {
        color: var(--nx-muted);
        font-size: .72rem;
        font-weight: 800;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .row-actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .row-actions .button,
    .row-actions form,
    .row-actions form button {
        width: 100%;
    }

    .finance-kpi-grid,
    .finance-progress-legend,
    .finance-alert-grid {
        grid-template-columns: 1fr;
    }

    .subscription-main,
    .subscription-topbar {
        width: min(100% - 28px, 1180px);
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Milhã composition utilities and product-specific refinements. */
.cluster {
    display: flex;
    align-items: center;
    gap: var(--nx-space-2);
}

.stack {
    display: flex;
    flex-direction: column;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 28;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-inline: clamp(28px, 3vw, 44px);
}

.tenant-plan {
    min-width: 94px;
    text-align: center;
}

.guest-header-content {
    justify-content: space-between;
}

.secure-access,
.auth-security-note {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--nx-muted);
    font-size: .78rem;
    font-weight: 700;
}

.secure-access .icon,
.auth-security-note .icon {
    width: 16px;
    height: 16px;
    color: var(--nx-success);
}

.auth-security-note {
    margin: 22px 0 0;
}

.sidebar .brand-mark {
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: -.02em;
}

.sidebar .nav-link.cluster,
.sidebar .link-button.cluster {
    gap: 0;
}

.sidebar .nav-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    display: grid;
    place-items: center;
    margin-inline: 0;
}

.sidebar .nav-icon .icon {
    display: block;
    margin: auto;
}

.sidebar-toggle .icon {
    transition: transform var(--nx-transition);
}

.sidebar-collapsed .sidebar-toggle .icon {
    transform: rotate(180deg);
}

.sidebar-collapsed .sidebar .nav-link,
.sidebar-collapsed .sidebar-nav .link-button {
    padding-inline: 0;
}

.sidebar-collapsed .sidebar .nav-icon {
    margin-inline: auto;
}

.mobile-brand {
    margin-right: auto;
    text-decoration: none;
}

.mobile-brand strong {
    font-size: .95rem;
}

.mobile-profile-link {
    justify-content: center;
    border-radius: 50%;
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
}

.profile-avatar {
    border-radius: 14px;
}

.profile-popover-heading {
    display: grid;
    padding: 10px 12px 12px;
    border-bottom: 1px solid var(--nx-line);
}

.profile-popover-heading strong {
    color: var(--nx-ink);
    font-size: .86rem;
}

.profile-popover-heading small {
    color: var(--nx-muted);
    font-size: .72rem;
}

.dashboard-hero {
    min-height: 228px;
    align-items: center;
    margin-bottom: 36px;
    padding: clamp(36px, 3.4vw, 52px);
    border: 1px solid rgba(79, 70, 229, .13);
    border-radius: var(--nx-radius-xl);
    box-shadow: var(--nx-shadow-clay);
}

.dashboard-hero-content {
    flex: 1 1 780px;
    min-width: 0;
    max-width: 980px;
}

.dashboard-hero h1 {
    max-width: 940px;
    margin-top: 0;
    font-size: clamp(1.9rem, 2.6vw, 2.55rem);
}

.dashboard-hero p {
    max-width: 760px;
    margin-top: 12px;
}

.dashboard-hero-actions {
    flex: 0 0 auto;
    align-self: flex-end;
    padding-bottom: 2px;
}

.dashboard-section-header:first-of-type {
    margin-top: 0;
}

.metric-top>span:first-child {
    color: var(--nx-text);
    font-weight: 700;
}

.metric>span:last-child {
    margin-top: 6px;
    font-size: .78rem;
}

.finance-kpi-pending {
    border-top-color: rgba(226, 232, 240, .92);
}

.search-bar {
    align-items: stretch;
}

.search-select-wrap {
    position: relative;
    flex: 0 0 190px;
    display: block;
}

.search-select-wrap::after {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--nx-muted);
    border-bottom: 2px solid var(--nx-muted);
    content: "";
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}

.search-select {
    width: 100%;
    min-height: 48px;
    padding: 11px 42px 11px 14px;
    border: 1px solid var(--nx-line-strong);
    border-radius: 13px;
    color: var(--nx-ink);
    background: var(--nx-surface-muted);
    box-shadow: inset 0 2px 4px rgba(15, 23, 42, .025), 0 1px 2px rgba(255, 255, 255, .9);
    font: inherit;
    appearance: none;
    cursor: pointer;
    transition: border-color var(--nx-transition), background var(--nx-transition), box-shadow var(--nx-transition);
}

.search-select:hover {
    border-color: #a5b4fc;
}

.search-select:focus {
    border-color: var(--nx-primary);
    outline: 0;
    background: var(--nx-white);
    box-shadow: 0 0 0 4px var(--nx-focus);
}

.search-select-wrap:focus-within::after {
    border-color: var(--nx-primary);
}

.user-form-card {
    max-width: 920px;
}

.account-options-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 10px 0 12px;
}

.account-options-grid .checkbox-field {
    min-height: 48px;
    align-items: center;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--nx-line);
    border-radius: 13px;
    background: var(--nx-surface-muted);
}

.permission-section-title {
    margin: 30px 0 8px;
}

.permission-group {
    padding: 12px 14px 14px;
    margin: 10px 0 16px;
}

.permission-group legend {
    color: var(--nx-ink);
    font-size: .86rem;
    font-weight: 750;
}

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

.permission-group .checkbox-option {
    min-height: 40px;
    gap: 9px;
    padding: 6px 8px;
    border-radius: 10px;
    line-height: 1.35;
    transition: color var(--nx-transition), background var(--nx-transition);
}

.permission-group .checkbox-option:hover {
    color: var(--nx-primary-hover);
    background: var(--nx-primary-soft);
}

.permission-group .checkbox-option input,
.account-options-grid .checkbox-field input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.auth-card {
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: var(--nx-radius-xl);
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow-clay);
}

.auth-aside .eyebrow {
    color: rgba(255, 255, 255, .76);
}

.auth-shell .auth-card {
    margin-bottom: 0;
}

.modal-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 16px;
    color: var(--nx-danger);
    background: var(--nx-danger-soft);
}

.modal-icon .icon {
    width: 23px;
    height: 23px;
}

@media (max-width: 900px) {
    .account-options-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .mobile-header {
        justify-content: space-between;
    }

    .bottom-nav {
        bottom: max(10px, env(safe-area-inset-bottom));
    }

    .guest-header .secure-access {
        display: none;
    }

    .auth-shell {
        gap: 16px;
    }

    .dashboard-hero {
        min-height: 0;
        gap: 24px;
        padding: 28px 24px;
    }

    .dashboard-hero-content {
        flex: 0 1 auto;
    }

    .dashboard-hero-actions {
        align-self: stretch;
        margin-top: 0;
        padding-bottom: 0;
    }

    .search-select-wrap {
        width: 100%;
        flex-basis: auto;
    }

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

/* Brand, account and theme additions */
.sidebar-header {
    flex-wrap: nowrap;
}

.sidebar-header .brand {
    min-width: 0;
    flex: 1 1 auto;
    gap: 10px;
    overflow: hidden;
    text-decoration: none;
}

.brand-logo {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 2px solid var(--nx-surface);
    border-radius: 50%;
    background: var(--nx-surface-muted);
    box-shadow: 0 7px 18px rgba(15, 23, 42, .16);
    object-fit: cover;
}

.sidebar .brand-copy {
    min-width: 0;
    margin-left: 0;
}

.sidebar .brand-copy strong {
    display: grid;
    overflow: visible;
    font-size: .87rem;
    line-height: 1.05;
    text-overflow: clip;
    white-space: normal;
}

.sidebar .brand-copy small {
    margin-top: 4px;
    white-space: nowrap;
}

.sidebar-header .sidebar-toggle {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
}

.mobile-brand .brand-logo {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
}

.guest-header .brand-logo {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
}

.theme-toggle {
    cursor: pointer;
}

.theme-icon-light {
    display: none;
}

.theme-icon-dark {
    display: block;
}

html[data-theme="dark"] .theme-icon-light {
    display: block;
}

html[data-theme="dark"] .theme-icon-dark {
    display: none;
}

.mobile-theme-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: none;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 13px;
    color: white;
    background: rgba(255, 255, 255, .09);
}

.profile-avatar,
.mobile-profile-link,
.profile-photo {
    overflow: hidden;
}

.profile-avatar img,
.mobile-profile-link img,
.profile-photo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.profile-layout {
    display: grid;
    grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.profile-identity-card {
    position: sticky;
    top: 104px;
    text-align: center;
}

.profile-photo-large {
    width: 116px;
    height: 116px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border: 4px solid var(--nx-surface);
    border-radius: 32px;
    color: var(--nx-white);
    background: linear-gradient(145deg, var(--nx-primary), var(--nx-secondary));
    box-shadow: 0 16px 36px rgba(79, 70, 229, .22);
    font-size: 2rem;
    font-weight: 850;
}

.profile-identity-copy h2 {
    margin: 0;
    overflow-wrap: anywhere;
}

.profile-identity-copy p {
    margin: 4px 0 12px;
    color: var(--nx-muted);
}

.profile-photo-form {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--nx-line);
    text-align: left;
}

.profile-photo-form .button {
    width: 100%;
}

.profile-content {
    min-width: 0;
}

.profile-section-card {
    padding: clamp(22px, 2.5vw, 32px);
}

.profile-section-heading {
    margin-bottom: 22px;
}

.profile-section-heading h2 {
    margin: 3px 0 0;
}

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

.profile-readonly-row,
.current-email-row {
    display: grid;
    gap: 3px;
    margin: 0 0 22px;
    padding: 14px 16px;
    border: 1px solid var(--nx-line);
    border-radius: 13px;
    background: var(--nx-surface-muted);
}

.profile-readonly-row span,
.current-email-row span {
    color: var(--nx-muted);
    font-size: .75rem;
    font-weight: 700;
}

.profile-readonly-row strong,
.current-email-row strong {
    color: var(--nx-ink);
    overflow-wrap: anywhere;
}

.profile-security-copy {
    max-width: 720px;
    margin: -8px 0 22px;
}

.email-confirm-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, .75fr);
    gap: 24px;
    align-items: end;
    margin-top: 26px;
    padding: 20px;
    border: 1px solid var(--nx-primary-soft-strong);
    border-radius: var(--nx-radius-md);
    background: var(--nx-primary-soft);
}

.email-confirm-panel>div {
    display: grid;
    gap: 5px;
    align-self: center;
}

.email-confirm-panel>div strong {
    color: var(--nx-ink);
    overflow-wrap: anywhere;
}

.email-confirm-panel>div small {
    color: var(--nx-muted);
}

.email-confirm-panel form {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.email-confirm-panel .field {
    min-width: 0;
    flex: 1;
    margin: 0;
}

.email-confirm-panel input {
    letter-spacing: .22em;
    font-weight: 800;
    text-align: center;
}

.email-confirm-panel .button {
    white-space: nowrap;
}

/* Appointment state must be readable without relying on the label alone. */
.agenda-row {
    border-left-width: 4px;
}

.status-border-scheduled {
    border-left-color: #2563eb;
}

.status-border-completed {
    border-left-color: #16a34a;
}

.status-border-cancelled {
    border-left-color: #dc2626;
    opacity: 1;
}

/* Dark palette keeps the current visual hierarchy and spacing intact. */
html[data-theme="dark"] {
    color-scheme: dark;
    --nx-canvas: #0b1120;
    --nx-canvas-strong: #111a2d;
    --nx-surface: #121c30;
    --nx-surface-muted: #172238;
    --nx-surface-raised: #1b2942;
    --nx-primary: #818cf8;
    --nx-primary-hover: #a5b4fc;
    --nx-primary-soft: #20264d;
    --nx-primary-soft-strong: #303867;
    --nx-secondary: #a78bfa;
    --nx-secondary-soft: #2b2249;
    --nx-info: #60a5fa;
    --nx-success: #4ade80;
    --nx-success-soft: #113524;
    --nx-warning: #fbbf24;
    --nx-warning-soft: #3a2e10;
    --nx-danger: #f87171;
    --nx-danger-hover: #fca5a5;
    --nx-danger-soft: #3b1d25;
    --nx-ink: #f8fafc;
    --nx-text: #e2e8f0;
    --nx-muted: #b8c4d6;
    --nx-subtle: #93a4bc;
    --nx-line: #2a3952;
    --nx-line-strong: #3a4b66;
    --nx-focus: rgba(129, 140, 248, .3);
    --nx-shadow-xs: 0 1px 3px rgba(0, 0, 0, .22);
    --nx-shadow-sm: 0 7px 20px rgba(0, 0, 0, .24);
    --nx-shadow-clay: 0 14px 34px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .025);
    --nx-shadow-clay-hover: 0 18px 42px rgba(0, 0, 0, .3), inset 0 1px rgba(255, 255, 255, .035);
    --nx-shadow-floating: 0 24px 65px rgba(0, 0, 0, .48);
}

html[data-theme="dark"] .sidebar,
html[data-theme="dark"] .app-topbar,
html[data-theme="dark"] .guest-header {
    border-color: var(--nx-line);
    background: rgba(15, 23, 42, .97);
}

html[data-theme="dark"] .mobile-header {
    background: #0f172a;
}

html[data-theme="dark"] .bottom-nav {
    border-color: var(--nx-line);
    background: rgba(18, 28, 48, .96);
}

html[data-theme="dark"] .brand-logo {
    border-color: #334155;
}

html[data-theme="dark"] .topbar-icon-button,
html[data-theme="dark"] .button.ghost,
html[data-theme="dark"] .pagination-link {
    color: var(--nx-text);
    background: var(--nx-surface);
    box-shadow: var(--nx-shadow-xs);
}

html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .field select:focus,
html[data-theme="dark"] .field textarea:focus,
html[data-theme="dark"] .search-select:focus {
    background: var(--nx-surface-raised);
}

html[data-theme="dark"] tbody tr:hover,
html[data-theme="dark"] .finance-schedule-row:hover {
    background: #17213a;
}

html[data-theme="dark"] .week-appointment,
html[data-theme="dark"] .agenda-row,
html[data-theme="dark"] .calendar-day,
html[data-theme="dark"] .receivable-installment-card,
html[data-theme="dark"] .responsive-table tr {
    border-color: var(--nx-line);
    background: var(--nx-surface);
}

html[data-theme="dark"] .week-appointment small,
html[data-theme="dark"] .agenda-row small,
html[data-theme="dark"] .calendar-weekday,
html[data-theme="dark"] .receivable-installment-kicker,
html[data-theme="dark"] .receivable-installment-main span,
html[data-theme="dark"] .receivable-installment-data dt {
    color: var(--nx-muted);
}

html[data-theme="dark"] .calendar-day.outside,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .finance-alert,
html[data-theme="dark"] .history-entry,
html[data-theme="dark"] .commission-equivalent,
html[data-theme="dark"] .file-drop {
    border-color: var(--nx-line);
    color: var(--nx-text);
    background: var(--nx-surface-muted);
}

html[data-theme="dark"] .receivable-installment-header,
html[data-theme="dark"] .receivable-installments-table th:last-child {
    background: var(--nx-canvas-strong);
}

html[data-theme="dark"] .receivable-installment-data,
html[data-theme="dark"] .receivable-installment-data>div,
html[data-theme="dark"] .finance-alert-grid,
html[data-theme="dark"] .finance-compact-list li,
html[data-theme="dark"] .finance-schedule-list,
html[data-theme="dark"] .finance-schedule-row {
    border-color: var(--nx-line);
}

/* High-contrast dark surfaces and text for dashboard and financial modules. */
html[data-theme="dark"] .dashboard-hero {
    border-color: var(--nx-line-strong);
    color: var(--nx-text);
    background: linear-gradient(135deg, var(--nx-surface-raised), var(--nx-surface));
}

html[data-theme="dark"] .dashboard-hero::after {
    border-color: var(--nx-primary-soft-strong);
    opacity: .72;
}

html[data-theme="dark"] .dashboard-hero h1 {
    color: var(--nx-ink);
}

html[data-theme="dark"] .dashboard-hero .eyebrow,
html[data-theme="dark"] .page-eyebrow {
    color: #a5b4fc;
}

html[data-theme="dark"] .dashboard-hero p {
    color: var(--nx-muted);
}

html[data-theme="dark"] .alert {
    box-shadow: var(--nx-shadow-xs), inset 0 1px rgba(255, 255, 255, .04);
}

html[data-theme="dark"] .alert-success {
    border-color: #237a4b;
    color: #bbf7d0;
    background: #123824;
}

html[data-theme="dark"] .alert-error {
    border-color: #9f4b58;
    color: #fecdd3;
    background: #3b1e26;
}

html[data-theme="dark"] .alert-warning {
    border-color: #8a6d1f;
    color: #fde68a;
    background: #3b3013;
}

html[data-theme="dark"] .alert-info {
    border-color: #315f9e;
    color: #bfdbfe;
    background: #152f50;
}

html[data-theme="dark"] .receivable-installment-header strong,
html[data-theme="dark"] .receivable-installment-value strong,
html[data-theme="dark"] .receivable-sequence-card strong {
    color: #c7d2fe;
}

html[data-theme="dark"] .receivable-installment-main strong,
html[data-theme="dark"] .receivable-installment-data dd {
    color: var(--nx-ink);
}

html[data-theme="dark"] .finance-dashboard-header p,
html[data-theme="dark"] .payable-page-header p,
html[data-theme="dark"] .finance-kpi-heading,
html[data-theme="dark"] .finance-kpi p,
html[data-theme="dark"] .finance-progress-legend div,
html[data-theme="dark"] .finance-alert>span,
html[data-theme="dark"] .finance-alert small,
html[data-theme="dark"] .finance-compact-list small,
html[data-theme="dark"] .finance-empty-compact,
html[data-theme="dark"] .finance-empty-schedule,
html[data-theme="dark"] .finance-supplier small,
html[data-theme="dark"] .finance-notification-state {
    color: var(--nx-muted);
}

html[data-theme="dark"] .finance-kpi strong,
html[data-theme="dark"] .finance-panel-title h3,
html[data-theme="dark"] .finance-progress-legend strong,
html[data-theme="dark"] .finance-compact-list a,
html[data-theme="dark"] .finance-schedule-row,
html[data-theme="dark"] .finance-supplier strong,
html[data-theme="dark"] .finance-schedule-value {
    color: var(--nx-ink);
}

html[data-theme="dark"] .finance-text-link {
    color: #a5b4fc;
}

html[data-theme="dark"] .month-navigation a {
    border-color: var(--nx-line-strong);
    color: #c7d2fe;
    background: var(--nx-surface-raised);
    box-shadow: var(--nx-shadow-xs);
}

html[data-theme="dark"] .month-navigation a:hover {
    border-color: var(--nx-primary);
    color: var(--nx-ink);
    background: var(--nx-primary-soft-strong);
}

html[data-theme="dark"] .finance-schedule-row time {
    color: #1e3a8a;
    background: #dbeafe;
    box-shadow: inset 0 0 0 1px rgba(30, 58, 138, .14);
}

html[data-theme="dark"] .finance-panel-title>strong,
html[data-theme="dark"] .finance-notification-state.is-sent {
    color: #86efac;
}

html[data-theme="dark"] .finance-alert-ok {
    background: #123824;
}

html[data-theme="dark"] .finance-alert-ok>span,
html[data-theme="dark"] .finance-alert-ok strong {
    color: #86efac;
}

html[data-theme="dark"] .finance-alert-danger {
    background: #3b1e26;
}

html[data-theme="dark"] .finance-alert-danger>span,
html[data-theme="dark"] .finance-alert-danger strong {
    color: #fda4af;
}

html[data-theme="dark"] .finance-alert-upcoming {
    background: #152f50;
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
    color: var(--nx-subtle);
    opacity: 1;
}

html[data-theme="dark"] .toast {
    border-color: var(--nx-line-strong);
    color: var(--nx-text);
    background: var(--nx-surface-raised);
    box-shadow: var(--nx-shadow-floating), inset 0 1px rgba(255, 255, 255, .05);
}

html[data-theme="dark"] .toast-icon {
    color: #bfdbfe;
    background: #152f50;
}

html[data-theme="dark"] .toast-close {
    color: var(--nx-muted);
}

html[data-theme="dark"] .toast-close:hover {
    color: var(--nx-ink);
    background: var(--nx-canvas-strong);
}

html[data-theme="dark"] .toast-success {
    border-color: #237a4b;
    color: #bbf7d0;
    background: #123824;
}

html[data-theme="dark"] .toast-warning {
    border-color: #8a6d1f;
    color: #fde68a;
    background: #3b3013;
}

html[data-theme="dark"] .toast-error {
    border-color: #9f4b58;
    color: #fecdd3;
    background: #3b1e26;
}

html[data-theme="dark"] .toast-info {
    border-color: #315f9e;
    color: #bfdbfe;
    background: #152f50;
}

html[data-theme="dark"] .toast-success .toast-icon {
    color: #bbf7d0;
    background: #123824;
}

html[data-theme="dark"] .toast-warning .toast-icon {
    color: #fde68a;
    background: #3b3013;
}

html[data-theme="dark"] .toast-error .toast-icon {
    color: #fecdd3;
    background: #3b1e26;
}

html[data-theme="dark"] .toast-info .toast-icon {
    color: #bfdbfe;
    background: #152f50;
}

html[data-theme="dark"] .receivable-groups-table th:last-child,
html[data-theme="dark"] .receivable-installments-table th:last-child {
    background: var(--nx-canvas-strong);
}

html[data-theme="dark"] .receivable-groups-table td:last-child,
html[data-theme="dark"] .receivable-installments-table td:last-child {
    background: var(--nx-surface);
    box-shadow: -8px 0 12px rgba(0, 0, 0, .24);
}

html[data-theme="dark"] .status-active,
html[data-theme="dark"] .status-paid,
html[data-theme="dark"] .status-approved,
html[data-theme="dark"] .status-completed,
html[data-theme="dark"] .status-pago,
html[data-theme="dark"] .status-sent {
    border-color: #237a4b;
    color: #86efac;
    background: #123824;
}

html[data-theme="dark"] .status-pending,
html[data-theme="dark"] .status-processing,
html[data-theme="dark"] .status-partial_paid,
html[data-theme="dark"] .status-past-due,
html[data-theme="dark"] .status-pendente {
    border-color: #80661e;
    color: #fde68a;
    background: #3b3013;
}

html[data-theme="dark"] .status-overdue,
html[data-theme="dark"] .status-vencido,
html[data-theme="dark"] .status-cancelled,
html[data-theme="dark"] .status-canceled,
html[data-theme="dark"] .status-cancelado,
html[data-theme="dark"] .status-baixado,
html[data-theme="dark"] .status-dead,
html[data-theme="dark"] .status-reversed {
    border-color: #8c3943;
    color: #fda4af;
    background: #3b1e26;
}

html[data-theme="dark"] .status-closed,
html[data-theme="dark"] .status-emitido,
html[data-theme="dark"] .status-scheduled {
    border-color: #315f9e;
    color: #93c5fd;
    background: #152f50;
}

@media (max-width: 900px) {
    .profile-layout {
        grid-template-columns: 1fr;
    }

    .profile-identity-card {
        position: static;
    }

    .email-confirm-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .mobile-theme-toggle {
        display: grid;
    }

    .mobile-brand {
        max-width: calc(100% - 100px);
    }

    .profile-form-grid {
        grid-template-columns: 1fr;
    }

    .email-confirm-panel form {
        align-items: stretch;
        flex-direction: column;
    }

    .email-confirm-panel .button {
        width: 100%;
    }
}

@media (max-width: 420px) {
    .mobile-brand strong {
        max-width: 92px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}