:root {
    color-scheme: light;
    --bg: #f4f6f5;
    --panel: #ffffff;
    --surface-subtle: #f8faf9;
    --text: #1d2d26;
    --muted: #596960;
    --line: #dce4df;
    --brand: #18734d;
    --brand-hover: #115b3b;
    --brand-soft: #eaf4ee;
    --green: #18734d;
    --red: #b93838;
    --danger-soft: #fbefed;
    --warning: #875b14;
    --warning-soft: #fcf5e7;
    --blue: #2563eb;
    --info: #356b91;
    --dark: #1d2d26;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --text-xs: .8125rem;
    --text-sm: .875rem;
    --text-base: .9375rem;
    --text-lg: 1.125rem;
    --text-title: 1.75rem;
    --radius: 6px;
    --radius-panel: 8px;
    --shadow-popover: 0 8px 30px rgba(25, 48, 36, .13);
    --shadow-modal: 0 20px 70px rgba(25, 48, 36, .2);
    --control-height: 40px;
    --layer-header: 20;
    --layer-menu: 25;
    --layer-backdrop: 50;
    --layer-modal: 60;
    --layer-popup: 70;
}

::selection { color: var(--text); background: #cce7d7; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.page:focus { outline: none; }
.topbar :focus-visible { outline-color: #fff; outline-offset: -3px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px; color: #fff; background: var(--brand); border-radius: var(--radius); }
.ui-icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.admin-menu-user { padding: 12px 10px; border-bottom: 1px solid var(--line); font-weight: 600; overflow-wrap: anywhere; }
button:disabled, .button[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
button[aria-busy="true"] { cursor: wait; }
button:not([class]):hover, .button:not(.secondary):not(.danger):hover { background: #1d4ed8; }
.button.danger:hover, button.danger:hover { background: #9d2929; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:user-invalid, textarea:user-invalid, select:user-invalid, [aria-invalid="true"] { border-color: var(--red); }
.field-error { display: block; color: var(--red); font-size: var(--text-xs); font-weight: 400; }

.metrics .metric-currency { display: inline; margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 600; }
.metrics article > span { font-weight: 500; }
.dashboard-grid { align-items: start; }
.dashboard-side-stack .panel + .panel { margin-top: 0; }
.panel-head > * { min-width: 0; }
.api-example-list, .api-example, .api-payload-grid > div, .api-endpoint-group { min-width: 0; }
.api-example pre { max-width: 100%; }
.api-docs-page .users-count { white-space: normal; overflow-wrap: anywhere; }
.grid.two.dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.dashboard-transactions { table-layout: fixed; }
.dashboard-transactions td { padding: 10px 0; }
.dashboard-transactions .recent-date-col { width: 80px; }
.dashboard-transactions .recent-value-col { width: 136px; }
.dashboard-transactions td:first-child { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dashboard-transactions td:nth-child(2) { padding-inline: 10px; overflow-wrap: anywhere; }
.dashboard-transactions .recent-description { display: block; color: var(--text); font-weight: 500; line-height: 1.4; }
.dashboard-transactions td:last-child { font-weight: 600; font-size: 13px; }
.dashboard-transactions small { margin-top: 4px; font-size: 12px; overflow-wrap: anywhere; }
.dashboard-transactions tr:last-child td { border-bottom: 0; }
.account-main strong, .transaction-info strong { font-size: var(--text-sm); font-weight: 600; overflow-wrap: anywhere; }
.table-scroll { max-width: 100%; min-width: 0; overscroll-behavior-x: contain; }
.table-scroll:focus-visible { outline-offset: 2px; }
tbody tr:hover { background: var(--surface-subtle); }
.login-intro h1 { margin-bottom: 8px; font-size: 28px; }
.login-intro p { margin: 0; color: var(--muted); font-size: var(--text-sm); }
.login-brand { margin: 0 0 8px; }
.login-brand img { filter: brightness(0) saturate(100%) invert(32%) sepia(34%) saturate(1000%) hue-rotate(104deg) brightness(91%) contrast(92%); }
.login-card button { min-height: 48px; }
.form > button, .form > .actions { margin-top: 6px; }
.form-grid > *, .grid > *, .dashboard-side-stack > * { min-width: 0; }
.transaction-item > b { font-size: var(--text-sm); font-weight: 650; font-variant-numeric: tabular-nums; }
.chart-tooltip { max-width: min(300px, calc(100vw - 32px)); }
.ui-tooltip { position: fixed; z-index: calc(var(--layer-popup) + 1); max-width: min(300px, calc(100vw - 24px)); padding: 8px 12px; border-radius: var(--radius); color: #fff; background: var(--text); box-shadow: var(--shadow-popover); font-size: 13px; line-height: 1.4; pointer-events: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-ui);
    font-size: var(--text-base);
    line-height: 1.5;
    font-variant-numeric: tabular-nums;
    -webkit-font-smoothing: antialiased;
}

body.modal-open {
    overflow: hidden;
}

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

.topbar {
    position: sticky;
    top: 0;
    z-index: var(--layer-header);
    color: #fff;
    background: var(--brand);
    box-shadow: 0 1px 4px rgba(25, 48, 36, .1);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: min(1200px, calc(100% - 32px));
    min-height: 68px;
    margin: 0 auto;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-right: 8px;
    white-space: nowrap;
}

.brand img {
    display: block;
    width: 136px;
    height: 34px;
}

.main-nav-shell { display: flex; align-items: center; gap: 4px; flex: 1; min-width: 0; }
.nav-scroll { flex: 0 0 36px; width: 36px; min-height: 44px; padding: 6px; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.3); }
.nav-scroll:hover { background: rgba(255,255,255,.16); }

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,.4) transparent;
}

.main-nav::-webkit-scrollbar {
    display: none;
}

.main-nav a,
.ghost {
    min-height: var(--control-height);
    padding: 9px 10px;
    border: 0;
    border-radius: var(--radius);
    color: #fff;
    background: transparent;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--text-sm);
    font-weight: 600;
}

.nav-icon {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .92;
}

.main-nav a:hover,
.main-nav a.active,
.ghost:hover {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.context-form select {
    width: 170px;
    max-width: 100%;
    border: 0;
    border-radius: 6px;
    padding: 9px 38px 9px 12px;
    color: var(--text);
    background:
        linear-gradient(45deg, transparent 50%, var(--brand) 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
        linear-gradient(135deg, var(--brand) 50%, transparent 50%) calc(100% - 13px) 50% / 6px 6px no-repeat,
        #fff;
    box-shadow: 0 1px 0 rgba(15, 23, 42, .12);
    font-weight: 650;
}

.context-form .pretty-select {
    width: 170px;
}

.context-form .pretty-select-button {
    border: 0;
    color: var(--text);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .12);
}

.context-form .pretty-select.open .pretty-select-button,
.context-form .pretty-select-button:hover {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .16), 0 1px 0 rgba(15, 23, 42, .12);
}

.context-form select:hover {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .16), 0 1px 0 rgba(15, 23, 42, .12);
}

.context-form select:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .28);
}

.context-inline-form label {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.context-inline-form small {
    margin-top: 5px;
    max-width: 320px;
    font-size: 12px;
    line-height: 1.35;
}

.context-inline-form select {
    min-width: 180px;
    padding: 8px 38px 8px 10px;
    font-weight: 700;
}

.context-inline-form .pretty-select {
    min-width: 180px;
}

.accounts-page-head {
    align-items: flex-start;
    margin-bottom: 16px;
}

.accounts-page-actions {
    align-items: end;
    flex: 0 0 auto;
    gap: var(--space-3);
}

.accounts-panel-head {
    align-items: end;
}

.accounts-panel-tools {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: var(--space-3);
    min-width: 0;
}

.account-filters {
    display: flex;
    align-items: end;
    gap: 10px;
    margin: 0;
}

.account-filters label {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
}

.account-filters select,
.account-filters .pretty-select,
.account-filters .pretty-select-button {
    min-width: 150px;
    min-height: 38px;
}

.accounts-page-actions > .button {
    min-height: 42px;
}

.accounts-count {
    padding-bottom: 10px;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.user-area {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    white-space: nowrap;
    font-size: var(--text-xs);
}

.user-area span {
    max-width: 135px;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
}

.menu-wrap {
    position: relative;
}

.hamburger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: var(--radius);
    padding: 9px 12px;
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.hamburger-lines {
    display: grid;
    gap: 3px;
}

.hamburger-lines i {
    display: block;
    width: 15px;
    height: 2px;
    border-radius: 99px;
    background: currentColor;
}

.hamburger b {
    font-size: 13px;
}

.admin-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: var(--layer-menu);
    display: none;
    width: 260px;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
    border-radius: var(--radius-panel);
    padding: 8px;
    color: var(--text);
    background: var(--panel);
    box-shadow: var(--shadow-popover);
}

.admin-menu.open {
    display: grid;
    gap: 4px;
}

.admin-menu-title {
    padding: 16px 10px 6px;
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 500;
}

.admin-menu a {
    border-radius: 6px;
    padding: 10px;
}

.admin-menu a:hover,
.admin-menu a.active {
    background: var(--brand-soft);
    color: var(--brand);
}

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

.table-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    min-width: 150px;
}

.table-actions form {
    margin: 0;
}

.table-scroll {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
}

.accounts-table {
    min-width: 920px;
    table-layout: fixed;
}

.accounts-table .accounts-col-name {
    width: 34%;
}

.accounts-table .accounts-col-entity {
    width: 20%;
}

.accounts-table .accounts-col-status {
    width: 12%;
}

.accounts-table .accounts-col-balance {
    width: 20%;
}

.accounts-table .accounts-col-actions {
    width: 14%;
}

.accounts-table th:last-child,
.accounts-table td:last-child {
    width: auto;
}

.accounts-table th,
.accounts-table td {
    vertical-align: middle;
}

.table-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
    border: 0;
    padding: 0;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
    text-transform: none;
    cursor: pointer;
}

.table-sort-button.center {
    justify-content: center;
    text-align: center;
}

.table-sort-button.right {
    justify-content: flex-end;
    text-align: right;
}

.table-sort-button span {
    color: #94a3b8;
    font-size: 10px;
}

.table-sort-button.active {
    color: var(--brand);
}

.table-sort-button.active span {
    color: var(--brand);
}

.accounts-table th.center,
.accounts-table td.center {
    text-align: center;
}

.accounts-table th.right,
.accounts-table td.right {
    text-align: right;
}

.accounts-table .accounts-balance-cell {
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;
}

.accounts-table .accounts-balance-cell strong {
    display: block;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.2;
}

.accounts-table .accounts-balance-cell small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
}

.accounts-table .table-actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: 0;
}

.accounts-table .table-actions .button,
.accounts-table .table-actions button {
    white-space: nowrap;
}

.accounts-table .account-cell {
    min-width: 0;
}

.accounts-table .account-cell > span {
    min-width: 0;
}

.accounts-table .account-cell small,
.accounts-entity-cell {
    overflow-wrap: anywhere;
}

.accounts-total-row td {
    border-top: 2px solid var(--line);
    border-bottom: 0;
    color: var(--text);
    background: var(--surface-subtle);
    font-weight: 650;
    vertical-align: middle;
}

.accounts-total-row small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
}

.accounts-total-values {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    justify-content: flex-end;
}

.accounts-total-values span {
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
}

.users-page {
    display: grid;
    gap: var(--space-4);
}

.users-page-head,
.users-page-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
}

.users-page-head h1 {
    margin: 0 0 4px;
    font-size: 26px;
    line-height: 1.1;
}

.users-page-head p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
}

.users-page-actions {
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.users-page-actions .button {
    min-height: 42px;
    white-space: nowrap;
}

.users-security-action {
    gap: var(--space-2);
}

.users-security-action .status-pill {
    font-size: 11px;
    line-height: 1;
    padding: 4px 7px;
}

.logs-page,
.attachments-page {
    display: grid;
    gap: var(--space-4);
}

.logs-page-head,
.attachments-page-head {
    margin-bottom: 0;
}

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

.admin-summary-grid article {
    min-height: 78px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    background: #fff;
    box-shadow: var(--shadow);
}

.admin-summary-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.admin-summary-grid strong {
    color: var(--text);
    font-size: 22px;
    line-height: 1.1;
}

.admin-filter-toolbar {
    display: grid;
    grid-template-columns: minmax(180px, 1.3fr) minmax(150px, .9fr) minmax(130px, .75fr) minmax(130px, .75fr) auto auto;
    gap: var(--space-2);
    align-items: end;
    margin-bottom: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: var(--surface-subtle);
}

.logs-filter-toolbar {
    grid-template-columns: minmax(160px, 1fr) minmax(120px, .8fr) minmax(120px, .8fr) minmax(76px, .5fr) minmax(120px, .75fr) minmax(120px, .75fr) auto auto;
}

.admin-filter-toolbar .date-field-label {
    min-width: 0;
}

.admin-filter-toolbar .button,
.admin-filter-toolbar button {
    min-height: 42px;
    white-space: nowrap;
}

.admin-table {
    min-width: 980px;
    table-layout: fixed;
}

.admin-table th,
.admin-table td {
    vertical-align: middle;
}

.admin-table td strong {
    display: block;
    line-height: 1.2;
}

.admin-table td small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.attachments-table th:nth-child(1),
.attachments-table td:nth-child(1) {
    width: 28%;
}

.attachments-table th:nth-child(2),
.attachments-table td:nth-child(2) {
    width: 10%;
}

.attachments-table th:nth-child(3),
.attachments-table td:nth-child(3) {
    width: 18%;
}

.attachments-table th:nth-child(4),
.attachments-table td:nth-child(4),
.attachments-table th:nth-child(5),
.attachments-table td:nth-child(5) {
    width: 14%;
}

.attachments-table th:nth-child(6),
.attachments-table td:nth-child(6) {
    width: 16%;
}

.logs-table th:nth-child(1),
.logs-table td:nth-child(1) {
    width: 15%;
}

.logs-table th:nth-child(2),
.logs-table td:nth-child(2) {
    width: 16%;
}

.logs-table th:nth-child(3),
.logs-table td:nth-child(3) {
    width: 12%;
}

.logs-table th:nth-child(4),
.logs-table td:nth-child(4) {
    width: 13%;
}

.logs-table th:nth-child(5),
.logs-table td:nth-child(5) {
    width: 24%;
}

.logs-table th:nth-child(6),
.logs-table td:nth-child(6) {
    width: 20%;
}

.logs-date,
.numeric {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.admin-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    padding: 3px 8px;
    color: var(--brand);
    background: var(--brand-soft);
    font-size: 12px;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
}

.admin-badge.web {
    border-color: #dcfce7;
    color: var(--green);
    background: var(--brand-soft);
}

.admin-badge.api {
    border-color: #fed7aa;
    color: var(--warning);
    background: #fff7ed;
}

.admin-badge.action {
    border-color: var(--line);
    color: var(--text);
    background: var(--surface-subtle);
}

.metadata-code {
    display: block;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 7px 8px;
    overflow: hidden;
    color: var(--text);
    background: var(--surface-subtle);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.metadata-empty {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 650;
}

.admin-empty-state {
    margin-top: 12px;
}

.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: 12px;
}

.admin-pagination > span {
    margin-right: auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.admin-pagination > div {
    display: flex;
    align-items: center;
    gap: 4px;
}

.admin-pagination > div a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 8px;
    color: var(--text);
    background: #fff;
    font-size: 13px;
    font-weight: 650;
}

.admin-pagination > div a.active {
    border-color: var(--line);
    color: var(--brand);
    background: var(--brand-soft);
}

.admin-pagination .is-disabled {
    opacity: .45;
    pointer-events: none;
}

.users-modal-form {
    gap: 14px;
}

.users-modal-form input,
.users-modal-form select,
.users-modal-form .pretty-select,
.users-modal-form .pretty-select-button,
.users-table input,
.users-table select,
.users-table .pretty-select,
.users-table .pretty-select-button {
    width: 100%;
    min-height: 38px;
}

.role-help {
    display: grid;
    gap: var(--space-2);
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 11px 12px;
    color: var(--muted);
    background: #f8fbff;
    font-size: 12px;
    line-height: 1.35;
}

.role-help strong {
    color: #1e40af;
}

.users-security-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: 13px;
    font-weight: 650;
}

.api-docs-page {
    display: grid;
    gap: var(--space-4);
}

.api-docs-panel {
    display: grid;
    gap: 14px;
}

.api-docs-grid,
.api-payload-grid,
.api-gaps {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}

.api-docs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.api-docs-card,
.api-gaps article,
.api-example,
.api-endpoint-group {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.api-docs-card {
    padding: 14px;
}

.api-docs-card span {
    display: block;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    text-transform: none;
}

.api-docs-card strong {
    display: block;
    color: var(--text);
    font-size: 15px;
    line-height: 1.35;
    word-break: break-word;
}

.api-docs-card p,
.api-gaps p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
}

.api-endpoint-list {
    display: grid;
    gap: var(--space-3);
}

.api-endpoint-group {
    overflow: hidden;
}

.api-endpoint-group h3,
.api-example h3,
.api-payload-grid h3 {
    margin: 0;
    color: var(--text);
    font-size: 15px;
}

.api-endpoint-group h3 {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: var(--surface-subtle);
}

.api-endpoint-row {
    display: grid;
    grid-template-columns: 92px minmax(210px, .8fr) minmax(0, 1.2fr);
    align-items: center;
    gap: var(--space-3);
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
}

.api-endpoint-row:last-child {
    border-bottom: 0;
}

.api-method {
    display: inline-flex;
    justify-content: center;
    border-radius: 999px;
    padding: 4px 9px;
    color: #1e40af;
    background: #dbeafe;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
}

.api-method-post {
    color: var(--green);
    background: #dcfce7;
}

.api-method-put {
    color: var(--warning);
    background: #fef3c7;
}

.api-endpoint-row code,
.api-payload-grid code,
.api-gaps code {
    border-radius: 6px;
    padding: 2px 5px;
    color: #1e293b;
    background: var(--surface-subtle);
    font-size: 12px;
}

.api-endpoint-row p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.api-payload-grid > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: #fff;
}

.api-payload-grid ul {
    margin: 10px 0 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.45;
}

.api-example-list {
    display: grid;
    gap: var(--space-3);
}

.api-example {
    padding: 14px;
}

.api-example pre {
    overflow-x: auto;
    margin: 10px 0 0;
    border-radius: 8px;
    padding: 13px;
    color: var(--line);
    background: var(--text);
    font-size: 12px;
    line-height: 1.5;
}

.api-example code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.api-gaps article {
    padding: 14px;
}

.api-gaps strong {
    display: block;
    color: var(--text);
    font-size: 14px;
}

.patrimony-unlock-page {
    display: grid;
    justify-items: center;
}

.patrimony-unlock-card {
    width: min(520px, 100%);
}

.patrimony-unlock-card .form {
    gap: 14px;
}

.users-panel .panel-head {
    align-items: center;
}

.users-count {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.users-table,
.users-token-table {
    min-width: 980px;
    table-layout: fixed;
}

.users-table th,
.users-table td,
.users-token-table th,
.users-token-table td {
    vertical-align: middle;
}

.users-table th:nth-child(1),
.users-table td:nth-child(1) {
    width: 20%;
}

.users-table th:nth-child(2),
.users-table td:nth-child(2) {
    width: 24%;
}

.users-table th:nth-child(3),
.users-table td:nth-child(3) {
    width: 14%;
}

.users-table th:nth-child(4),
.users-table td:nth-child(4) {
    width: 14%;
}

.users-table th:nth-child(5),
.users-table td:nth-child(5) {
    width: 16%;
}

.users-table th:nth-child(6),
.users-table td:nth-child(6) {
    width: 12%;
}

.users-date {
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

.users-table .table-actions,
.users-token-table .table-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
    min-width: 0;
}

.users-token-table th:nth-child(1),
.users-token-table td:nth-child(1) {
    width: 34%;
}

.users-token-table th:nth-child(2),
.users-token-table td:nth-child(2) {
    width: 22%;
}

.users-token-table th:nth-child(3),
.users-token-table td:nth-child(3),
.users-token-table th:nth-child(4),
.users-token-table td:nth-child(4) {
    width: 16%;
}

.users-token-table th:nth-child(5),
.users-token-table td:nth-child(5) {
    width: 12%;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.status-pill.active {
    border-color: var(--line);
    color: var(--green);
    background: var(--brand-soft);
}

.status-pill.archived {
    border-color: var(--line);
    color: var(--muted);
    background: var(--surface-subtle);
}

.page {
    width: min(1200px, calc(100% - 32px));
    margin: 20px auto 40px;
    min-width: 0;
}

.dashboard-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.dashboard-head h1 {
    margin: 0;
    font-size: var(--text-title);
    line-height: 1.2;
    letter-spacing: -.025em;
    font-weight: 650;
}

.dashboard-head p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: var(--text-sm);
    font-weight: 400;
}

.dashboard-actions {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: var(--space-3);
    min-width: 0;
}

.dashboard-context-form {
    width: 230px;
    max-width: 100%;
}

.dashboard-context-form label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: var(--text-xs);
    font-weight: 500;
}

.dashboard-context-form .pretty-select-button {
    min-height: 46px;
    background: #fff;
}

.privacy-controls {
    display: flex;
    gap: var(--space-2);
}

.privacy-toggle {
    display: inline-flex;
    min-height: var(--control-height);
    align-items: center;
    gap: var(--space-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    color: var(--muted);
    background: var(--panel);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
}

.privacy-icon-toggle {
    justify-content: center;
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
}

.panel-head-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.privacy-toggle:hover {
    border-color: var(--line);
    background: var(--brand-soft);
    color: var(--brand);
}

.privacy-toggle.is-active {
    border-color: var(--line);
    color: var(--brand);
    background: var(--brand-soft);
}

.privacy-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.privacy-toggle .eye-slash {
    opacity: 0;
}

.privacy-toggle.is-active .eye-slash {
    opacity: 1;
}

.privacy-total-value,
.privacy-value,
.privacy-account-value,
.privacy-card-value {
    transition: filter .16s ease, color .16s ease, opacity .16s ease;
}

:is(html, body).privacy-hide-values .metrics .privacy-total-value,
:is(html, body).privacy-hide-values .dashboard-transactions .privacy-value {
    color: transparent !important;
    text-shadow: none;
    filter: none;
    user-select: none;
}

:is(html, body).privacy-hide-values .metrics .privacy-total-value * {
    color: transparent !important;
}

:is(html, body).privacy-hide-accounts #accounts-list .privacy-account-value {
    color: transparent !important;
    text-shadow: none;
    filter: none;
    user-select: none;
}

:is(html, body).privacy-hide-accounts #accounts-list .privacy-account-value * {
    color: transparent !important;
}

:is(html, body).privacy-hide-cards .dashboard-cards-panel .privacy-card-value {
    color: transparent !important;
    text-shadow: none;
    filter: none;
    user-select: none;
}

:is(html, body).privacy-hide-cards .dashboard-cards-panel .privacy-card-value * {
    color: transparent !important;
}

/* Masks keep amounts out of visual and assistive reading while preserving layout. */
:is(html, body).privacy-hide-values .metrics .privacy-total-value,
:is(html, body).privacy-hide-values .dashboard-transactions .privacy-value,
:is(html, body).privacy-hide-accounts #accounts-list .privacy-account-value,
:is(html, body).privacy-hide-cards .dashboard-cards-panel .privacy-card-value { position: relative; }
:is(html, body).privacy-hide-values .metrics .privacy-total-value::after,
:is(html, body).privacy-hide-values .dashboard-transactions .privacy-value::after,
:is(html, body).privacy-hide-accounts #accounts-list .privacy-account-value::after,
:is(html, body).privacy-hide-cards .dashboard-cards-panel .privacy-card-value::after { content: '••••'; position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-start; color: var(--muted); background: var(--panel); font-size: 20px; letter-spacing: 3px; }
:is(html, body).privacy-hide-values .dashboard-transactions .privacy-value::after,
:is(html, body).privacy-hide-accounts #accounts-list .privacy-account-value::after { justify-content: flex-end; }
.filter-field { min-width: 0; }
.filter-field > span { color: var(--muted); font-size: var(--text-xs); }
.filters { align-items: end; }
.grid.two:has(> .form) { grid-template-columns: minmax(280px, .8fr) minmax(0, 1.5fr); align-items: start; }
.table-scroll table:not([class]) { min-width: 560px; }
.filter-field :is(input, select, .pretty-select) { width: 100%; }
.date-picker-popover { z-index: var(--layer-popup); }

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

.metrics article,
.panel,
.login-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--panel);
}

.metrics article {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 0;
    padding: 12px 14px;
    text-align: center;
}

.metrics span,
small,
.muted {
    display: block;
    color: var(--muted);
    font-size: 13px;
}

.metrics strong {
    display: block;
    margin-top: 4px;
    font-size: 24px;
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -.02em;
    overflow-wrap: anywhere;
}

.metrics .metric-money-stack {
    font-size: 23px;
    line-height: 1.25;
}

.metrics .metric-money-stack span {
    display: block;
    font-size: inherit;
    font-weight: inherit;
}

.metrics .metric-money-stack.income span {
    color: var(--green);
}

.metrics .metric-money-stack.expense span {
    color: var(--red);
}

.metrics .metric-money-stack span + span {
    margin-top: 1px;
}

.metric-usd strong {
    margin-top: 4px;
    font-size: 24px;
}

.metric-estimate {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    line-height: 1.3;
}

.metric-estimate-rate {
    max-width: 100%;
    flex-wrap: wrap;
    white-space: normal;
}

.metric-estimate-rate span,
.metric-estimate-rate b {
    display: inline-flex;
    align-items: center;
}

.metric-estimate-rate b {
    color: var(--brand);
    font-weight: 650;
}

.metric-info {
    position: relative;
    justify-content: center;
    width: 17px;
    height: 17px;
    border-radius: 999px;
    color: var(--brand);
    background: #dbeafe;
    font-family: ui-serif, Georgia, serif;
    font-size: 12px;
    font-style: italic;
    font-weight: 650;
    line-height: 1;
    cursor: help;
}



.quick-panel {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
}

.quick-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.quick-panel h2 {
    margin: 0;
    font-size: 16px;
}

.quick-panel-head span {
    color: var(--muted);
    font-size: 12px;
}

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

.quick-action {
    display: flex;
    justify-items: center;
    align-content: center;
    gap: 6px;
    min-height: 40px;
    border: 1px solid currentColor;
    border-radius: var(--radius);
    padding: 8px 6px;
    color: var(--text);
    background: var(--surface-subtle);
    font: inherit;
    text-align: center;
    transition: border-color .15s ease, background .15s ease;
    justify-content: center;
    align-items: center;
}

.quick-action:hover {
    border-color: currentColor;
    background: var(--brand-soft);
}

.quick-action.quick-expense:hover { background: var(--danger-soft); }
.quick-action.quick-transfer:hover { background: #edf1ef; }
.quick-action.quick-crypto:hover { background: var(--warning-soft); }

.quick-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    border-radius: 0;
    background: transparent;
}

.quick-action strong {
    color: var(--text);
    font-size: 12px;
    font-weight: 600;
}

.quick-expense {
    color: var(--red);
}

.quick-income {
    color: var(--green);
}

.quick-transfer {
    color: var(--muted);
}

.quick-import {
    color: var(--brand);
}

.quick-expense-bg {
    background: var(--red);
}

.quick-income-bg {
    background: var(--green);
}

.quick-transfer-bg {
    background: var(--muted);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: var(--layer-backdrop);
    background: rgba(21, 36, 28, .42);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: var(--layer-modal);
    display: grid;
    place-items: center;
    padding: var(--space-5);
    overflow-y: auto;
    overscroll-behavior: contain;
}

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

.modal-card {
    width: min(720px, 100%);
    min-width: 0;
    max-height: calc(100dvh - 48px);
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: var(--radius-panel);
    padding: 20px;
    background: var(--panel);
    box-shadow: var(--shadow-modal);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: 10px;
}

.modal-head h2 {
    margin: 0;
    font-size: 22px;
}

.modal-close {
    width: 40px;
    height: 40px;
    min-height: 40px;
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    color: var(--muted);
    background: var(--surface-subtle);
}

.modal-close:hover {
    color: var(--text);
    background: #f3f4f6;
}

.form-grid {
    display: grid;
    gap: var(--space-3);
}

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

.modal-submit {
    justify-self: stretch;
    min-width: 0;
    margin-top: 8px;
}

.grid {
    display: grid;
    gap: var(--space-4);
}

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

.transactions-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    align-items: start;
}

.transactions-page-head {
    margin-bottom: 0;
}

.transactions-page-actions {
    align-items: flex-end;
}

.transaction-form {
    gap: 14px;
}

.transaction-form h2 {
    margin-bottom: 0;
}

.transaction-form-grid {
    display: grid;
    grid-template-columns: minmax(130px, .7fr) minmax(220px, 1.4fr) minmax(180px, 1fr);
    gap: var(--space-3);
    align-items: end;
}

.transaction-form-grid .wide {
    grid-column: span 2;
}

.transaction-form-grid textarea {
    min-height: 42px;
}

.transaction-form-grid button {
    min-height: 42px;
}

.transactions-layout .transaction-shortcuts { margin: 0 0 12px; }
.transactions-layout .transaction-shortcuts .quick-panel-head { margin-bottom: 8px; }
.transactions-layout .transaction-shortcuts h2 { margin: 0; font-size: 16px; }
.transactions-layout .quick-action { min-height: var(--control-height); }
.transactions-layout .quick-crypto { color: var(--warning); }
.transactions-layout .quick-icon .nav-icon { width: 20px; height: 20px; }

.panel {
    min-width: 0;
    padding: var(--space-4);
    overflow: visible;
}

.panel + .panel,
.grid + .panel {
    margin-top: 16px;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

h1,
h2 {
    margin: 0 0 16px;
    line-height: 1.3;
    letter-spacing: -.02em;
    overflow-wrap: anywhere;
}

h2 {
    font-size: 18px;
}

.panel-head h2 {
    margin-bottom: 0;
}

.form {
    display: grid;
    gap: 12px;
    align-content: start;
    min-width: 0;
}

label {
    display: grid;
    gap: 7px;
    min-width: 0;
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 500;
}

input,
select,
textarea {
    width: 100%;
    min-width: 0;
    min-height: var(--control-height);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 10px;
    color: var(--text);
    background: var(--panel);
    font: inherit;
    font-weight: 400;
    caret-color: var(--brand);
}

select {
    appearance: none;
    min-height: var(--control-height);
    padding-right: 38px;
    background:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
        linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 13px) 50% / 6px 6px no-repeat,
        #fff;
    cursor: pointer;
    font-weight: 400;
}

select:hover {
    border-color: var(--line);
}

select:focus,
input:focus,
textarea:focus {
    border-color: #86efac;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .14);
    outline: none;
}

.attachment-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.attachment-label {
    color: var(--muted);
    font-weight: 600;
}

.attachment-dropzone {
    position: relative;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: 10px;
    color: var(--text);
    background: #fff;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.attachment-dropzone:hover,
.attachment-dropzone:focus-visible,
.attachment-dropzone.drag-over {
    border-color: #86efac;
    background: #f8fffb;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
    outline: none;
}

.attachment-dropzone.has-file {
    border-style: solid;
    border-color: var(--line);
    background: #f7fef9;
}

.attachment-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.attachment-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: var(--brand);
    background: var(--brand-soft);
}

.attachment-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.attachment-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.attachment-copy strong,
.attachment-copy small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.attachment-copy strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
}

.attachment-copy small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.attachment-clear {
    min-height: 32px;
    border: 1px solid #edc6c1;
    border-radius: 7px;
    padding: 7px 10px;
    color: var(--red);
    background: #fff5f5;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.attachment-clear:hover,
.attachment-clear:focus-visible {
    border-color: #fca5a5;
    background: #fee2e2;
    outline: none;
}

.date-field-label {
    min-width: 0;
}

.date-field-label.no-label {
    display: block;
}

.date-field {
    position: relative;
    display: block;
    min-width: 0;
}

.date-field-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: var(--control-height);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 10px;
    color: var(--text);
    background: #fff;
    box-shadow: none;
    font: inherit;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.date-field-button:hover {
    border-color: var(--line);
}

.date-field.open .date-field-button,
.date-field-button:focus-visible {
    border-color: #86efac;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .14);
    outline: none;
}

.date-field-button span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.date-field-button svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    margin-left: 10px;
    fill: none;
    stroke: var(--muted);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.date-picker-popover {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 900;
    width: 294px;
    max-width: calc(100vw - 28px);
    border: 1px solid #dce3ec;
    border-radius: 8px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .16);
}

.date-picker-head {
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: 10px;
}

.date-picker-head strong {
    color: var(--text);
    font-size: 14px;
    font-weight: 650;
    text-align: center;
    text-transform: capitalize;
}

.date-picker-head button,
.date-picker-actions button,
.date-picker-days button,
.month-picker-grid button {
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    background: #fff;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.date-picker-head button {
    height: 34px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
}

.date-picker-head button:hover,
.date-picker-actions button:hover,
.date-picker-days button:hover,
.month-picker-grid button:hover {
    border-color: var(--line);
    color: var(--brand);
    background: var(--brand-soft);
}

.date-picker-weekdays,
.date-picker-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 5px;
}

.date-picker-weekdays {
    margin-bottom: 6px;
}

.date-picker-weekdays span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    text-align: center;
}

.date-picker-days button {
    height: 33px;
    padding: 0;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.date-picker-days .today,
.month-picker-grid .today {
    border-color: var(--line);
    color: var(--green);
    background: var(--brand-soft);
}

.date-picker-days .selected,
.month-picker-grid .selected {
    border-color: var(--brand);
    color: #fff;
    background: var(--brand);
}

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

.month-picker-grid button {
    min-height: 38px;
    padding: 8px;
    text-transform: capitalize;
}

.date-picker-actions {
    display: flex;
    justify-content: space-between;
    gap: var(--space-2);
    margin-top: 12px;
}

.date-picker-actions button {
    flex: 1;
    min-height: 34px;
    padding: 7px 10px;
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: 12px;
}

.pretty-select {
    position: relative;
    width: 100%;
}

.pretty-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.pretty-select-button {
    position: relative;
    display: block;
    width: 100%;
    min-height: var(--control-height);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 8px 38px 8px 10px;
    color: var(--text);
    background: var(--panel);
    box-shadow: none;
    font: inherit;
    font-weight: 400;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pretty-select-button::after {
    content: "";
    position: absolute;
    right: 14px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: translateY(-65%) rotate(45deg);
}

.pretty-select.open .pretty-select-button {
    border-color: #86efac;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .14);
}

.pretty-select.open .pretty-select-button::after {
    transform: translateY(-35%) rotate(225deg);
}

.pretty-select-list {
    position: fixed;
    z-index: var(--layer-popup);
    display: none;
    max-height: 280px;
    overflow: auto;
    border-radius: var(--radius);
    padding: 6px;
    background: var(--panel);
    box-shadow: var(--shadow-popover);
}

.pretty-select-list[style*="display: grid"] {
    display: grid;
    gap: 3px;
}

.pretty-select-option {
    display: flex;
    width: 100%;
    justify-content: flex-start;
    border-radius: 6px;
    padding: 9px 10px;
    color: var(--text);
    background: transparent;
    font-weight: 650;
    text-align: left;
    line-height: 1.2;
    overflow-wrap: anywhere;
    white-space: normal;
}

.pretty-select-option:hover,
.pretty-select-option.selected {
    color: var(--brand);
    background: var(--brand-soft);
}

textarea {
    min-height: 84px;
    resize: vertical;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    min-height: var(--control-height);
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 10px 16px;
    color: #fff;
    background: var(--blue);
    font: inherit;
    font-size: var(--text-sm);
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.accounts-table th .table-sort-button {
    justify-content: flex-start;
    width: 100%;
    border: 0;
    border-radius: 0;
    padding: 0;
    color: var(--muted);
    background: transparent;
    box-shadow: none;
    font-size: 12px;
    font-weight: 650;
    text-align: left;
    text-transform: none;
}

.accounts-table th .table-sort-button.center {
    justify-content: center;
    text-align: center;
}

.accounts-table th .table-sort-button.right {
    justify-content: flex-end;
    text-align: right;
}

.accounts-table th .table-sort-button.active {
    color: var(--brand);
}

.small {
    min-height: 36px;
    padding: 7px 11px;
    font-size: var(--text-xs);
}

.danger {
    background: var(--red);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--text-sm);
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 8px;
    text-align: left;
    vertical-align: middle;
    overflow-wrap: anywhere;
}

th {
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: none;
}

.right {
    text-align: right;
    white-space: nowrap;
}

.income {
    color: var(--green);
}

.expense {
    color: var(--red);
}

.account-search-bar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; margin: 10px 0; }
.account-search-bar label { display: grid; gap: 4px; flex: 1; min-width: 180px; font-size: 12px; color: var(--muted); }
.account-search-bar input { width: 100%; }
.account-search-bar > span { font-size: 12px; }
.order-status { margin: 6px 0; color: var(--muted); font-size: 12px; }
.order-status:empty { display: none; }
.order-status[role="alert"] { color: var(--red); }
.account-group-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 4px 0; border: 0; color: var(--text); background: transparent; text-align: left; font: inherit; }
.account-group-toggle:hover { color: var(--brand); background: transparent; }
.account-group-toggle .ui-icon { width: 16px; height: 16px; transition: transform .15s ease; }
.account-group-toggle[aria-expanded="true"] .ui-icon { transform: rotate(90deg); }
.account-group-meta { display: flex; flex-wrap: wrap; justify-content: end; gap: 4px 8px; align-items: center; color: var(--muted); font-size: 12px; }
.quote-note { display: block; margin: 6px 0 0; color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.quote-note.is-stale { color: var(--warning); }
.pretty-select-options { display: grid; gap: 3px; }
.pretty-select-search { position: sticky; top: 0; z-index: 1; width: 100%; margin-bottom: 4px; background: var(--panel); }
.pretty-select-empty { margin: 8px; color: var(--muted); font-size: 13px; }

.account-list {
    display: grid;
    gap: 0;
}

.account-controls {
    margin-bottom: 12px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-subtle);
}

.account-controls .account-search-bar { margin: 10px 0 0; }
.account-controls .account-search-bar label { font-size: 12px; font-weight: 600; }
.account-controls .account-search-bar > span { padding-bottom: 10px; }

.account-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
    margin: 0;
    padding: 0;
}

.account-toolbar label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    min-width: 0;
}

.account-toolbar label span {
    white-space: nowrap;
}

.account-toolbar-context {
    margin: 0;
}

.account-toolbar-context label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    min-width: 0;
}

.account-toolbar select {
    min-width: 0;
    width: 100%;
    border-color: var(--line);
    padding: 8px 34px 8px 10px;
    font-weight: 700;
}

.account-toolbar .pretty-select {
    min-width: 0;
    width: 100%;
}

.account-toolbar .pretty-select-button {
    min-height: 38px;
    padding: 8px 34px 8px 10px;
}

.account-toolbar .button {
    margin-left: auto;
    align-self: end;
    min-height: 38px;
    padding-inline: 12px;
}

.button.secondary {
    border: 1px solid var(--line);
    color: var(--text);
    background: #fff;
}

.button.secondary:hover {
    background: var(--surface-subtle);
}

.button.secondary:disabled {
    cursor: wait;
    opacity: .7;
}












.account-group {
    display: grid;
    gap: var(--space-2);
}

.account-group + .account-group {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.account-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 2px;
}

.account-group-head strong {
    font-size: 14px;
}

.account-subtotal {
    color: var(--muted);
    font-size: 13px;
    white-space: nowrap;
}

.account-group-list,
.account-sort-scope {
    display: grid;
    gap: var(--space-2);
}

.account-row {
    display: flex;
    align-items: center;
    gap: 4px;
    border: 0;
    border-radius: 0;
    padding: 6px 0;
    background: var(--panel);
    transition: background .15s ease, border-color .15s ease;
    border-bottom: 1px solid var(--line);
}

/* O próximo grupo já tem divisor; não duplicar a linha após a última conta visível. */
.account-group .account-row:not(:has(~ .account-row:not([hidden]))) {
    border-bottom: 0;
}

.account-row:hover {
    background: var(--surface-subtle);
    border-color: #b9c9bf;
}

.account-row > div {
    min-width: 0;
}

.drag-handle {
    flex: 0 0 auto;
    width: 28px;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 6px;
    padding: 0;
    color: #94a3b8;
    background: transparent;
    font-size: 16px;
    font-weight: 650;
    line-height: 1;
    cursor: grab;
}

.drag-handle:hover {
    border-color: var(--line);
    color: var(--text);
    background: var(--surface-subtle);
}

.drag-handle:active {
    cursor: grabbing;
}

.account-row-link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-width: 0;
    flex: 1;
    border-radius: var(--radius);
    padding: 4px 0;
}

.account-row-link:hover strong {
    color: var(--blue);
}

.account-main {
    min-width: 0;
}

.account-row strong {
    display: block;
}

.account-row.dragging {
    opacity: .45;
}

.account-row b {
    margin-left: auto;
    color: var(--text);
    font-size: var(--text-sm);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.account-balance {
    display: grid;
    justify-items: end;
    gap: 3px;
}

.account-balance small {
    color: var(--muted);
    font-weight: 700;
}

.account-balance .brl-estimate {
    color: var(--brand);
}

.account-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 3px;
}

.account-tag {
    display: inline-flex;
    align-items: center;
    min-height: 21px;
    border: 0;
    border-radius: 4px;
    padding: 1px 5px;
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
}

.account-tag.entity-pf {
    border-color: var(--line);
    color: var(--green);
    background: var(--brand-soft);
}

.account-tag.entity-pj {
    border-color: var(--line);
    color: var(--brand);
    background: var(--brand-soft);
}

.account-tag.entity-crypto {
    border-color: #fde68a;
    color: var(--warning);
    background: var(--warning-soft);
}

.account-tag.bank {
    color: var(--muted);
    background: #fff;
}

.account-tag.asset {
    border-color: #fde68a;
    color: #92400e;
    background: #fff7ed;
}

.account-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bank-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
}

.bank-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    object-fit: cover;
}

.bank-avatar:not(.asset-avatar) { border-radius: var(--radius); }
.bank-avatar:not(.asset-avatar) img { border-radius: 0; object-fit: contain; }

.bank-avatar-fallback {
    color: #fff;
    background: var(--dark);
    font-size: 13px;
    font-weight: 650;
}

.asset-avatar {
    border: 0;
}

.asset-avatar-fallback {
    color: #fff;
    background: #f59e0b;
}

.crypto-fields {
    display: grid;
    gap: var(--space-3);
}

.crypto-fields[hidden],
[data-bank-fields][hidden] {
    display: none !important;
}

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

.flash {
    margin-bottom: 16px;
    border-radius: 7px;
    padding: 12px 14px;
    background: var(--brand-soft);
    color: #166534;
}

.flash.error {
    background: var(--danger-soft);
    color: var(--red);
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 8px;
    border-radius: 999px;
}

.filters {
    display: flex;
    gap: var(--space-2);
    align-items: center;
}

.filters input {
    width: 145px;
}

.filters .date-field-label {
    width: 145px;
}

.transactions-panel { min-height: 0; }
.transactions-layout > .panel { margin-top: 0; }

.transactions-chart-panel {
    position: relative;
}

.transactions-chart-head {
    align-items: flex-start;
}

.transactions-chart-head h2 {
    margin-bottom: 2px;
}

.transactions-chart-summary {
    display: grid;
    justify-items: end;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
}

.transactions-chart-summary b {
    color: var(--text);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
}

.transactions-chart-panel canvas {
    display: block;
    width: 100%;
    max-width: 100%;
}

.transactions-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.transactions-layout .transactions-meta :is(.muted, .scope-note) { margin: 0; font-size: inherit; line-height: inherit; }
.transactions-layout .transactions-page-head { margin-bottom: 0; }

.transaction-filters { display: block; margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: var(--surface-subtle); }
.transaction-filter-main { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 4.7fr) auto; gap: 8px; align-items: end; }
.transaction-filters :is(input, .date-field-label, .pretty-select, .pretty-select-button, .filter-field, .filter-details) { min-width: 0; width: 100%; }
.transaction-filters :is(.filter-field, .date-field-label) { display: grid; gap: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.transaction-filters :is(.filter-field, .date-field-label) > span:first-child { font: inherit; color: inherit; }
.transaction-filter-main :is(input, .pretty-select-button, .date-field-button, .filter-submit) { height: var(--control-height); min-height: var(--control-height); padding: 8px 10px; font-size: 14px; }
.transaction-filter-fields { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .7fr) minmax(0, 1fr) repeat(2, minmax(0, .85fr)); gap: 8px; align-items: end; }
.transaction-filter-main .filter-details { display: block; }
.transaction-filter-main .filter-details > summary { display: none; }
.transaction-filter-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.transaction-filter-footer .period-shortcuts { display: flex; flex-wrap: wrap; gap: 6px; }
.transaction-filter-footer .period-shortcuts button { min-height: var(--control-height); padding: 8px 10px; }
.transaction-filter-footer .filter-chips { margin: 0; }

.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.filter-chips span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 9px;
    color: #166534;
    background: var(--brand-soft);
    font-size: 12px;
    font-weight: 650;
}

.transaction-list { min-width: 0; }
.transactions-table-scroll { min-width: 0; }
.transactions-table { width: 100%; table-layout: fixed; }
.transactions-table .transactions-col-date { width: 90px; }
.transactions-table .transactions-col-account { width: 200px; }
.transactions-table .transactions-col-value { width: 160px; }
.transactions-table .transactions-col-actions { width: 156px; }
.transactions-table :is(th, td) { padding: 8px; vertical-align: middle; }
.transactions-table th { font-size: 12px; }
.transactions-table .transaction-item { background: var(--panel); }
.transactions-table .transaction-item:hover { background: var(--surface-subtle); }
.transactions-table tbody tr:last-child td { border-bottom: 0; }
.transactions-table :is(.transaction-info, .transaction-account, .transaction-actions-cell) { color: var(--text); }
.transactions-table .transaction-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.transactions-table :is(.transaction-info strong, .transaction-account > span) { display: block; font-size: 14px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.transaction-title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.transactions-table .transaction-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 20px; }
.transaction-category { flex: 0 1 auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; color: var(--muted); background: var(--surface-subtle); font-size: 11px; line-height: 16px; }
.transaction-meta { display: flex; align-items: center; gap: 8px; min-height: 18px; font-size: 12px; line-height: 18px; }
.transaction-meta .transaction-attachment-chip { padding: 0 6px; font-size: 11px; line-height: 16px; }
.transactions-table .transaction-bank-text { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; line-height: 18px; }
.transaction-bank-trigger { min-height: 0; border: 0; padding: 0; color: var(--muted); background: transparent; font-size: 12px; font-weight: 400; line-height: 18px; text-decoration: underline; text-underline-offset: 3px; }
.transaction-bank-trigger:hover { color: var(--brand); background: transparent; }
.transaction-bank-popover { position: fixed; width: min(480px, calc(100vw - 24px)); max-height: min(60vh, 420px); box-sizing: border-box; overflow: auto; padding: 12px; border: 0; border-radius: var(--radius-panel); background: var(--panel); color: var(--text); box-shadow: var(--shadow-popover); }
.transaction-bank-popover-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.transaction-bank-popover h3 { margin: 0; font-size: 14px; }
.transaction-bank-popover p { margin: 8px 0 0; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-wrap; }
.transactions-table .transaction-reconciled { color: var(--brand); }
.transaction-protected { padding-block: 8px; border-block: 1px solid var(--line); font-size: 13px; }
.transaction-protected p { margin: 4px 0 8px; color: var(--muted); }
.transaction-protected dl { display: grid; gap: 4px; margin: 0; }
.transaction-protected dl > div { display: flex; flex-wrap: wrap; gap: 4px 8px; }
.transaction-protected dt { color: var(--muted); }
.transaction-protected dd { margin: 0; overflow-wrap: anywhere; }
.edit-form .transaction-bank-original { min-height: 84px; background: var(--surface-subtle); }
.transactions-table .transaction-account > span { font-size: 13px; }
.transactions-table small { margin-top: 2px; font-size: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.transactions-table .transaction-value b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.transactions-table .transaction-actions { justify-content: end; }

.transaction-attachment-chip {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 1px 7px;
    color: var(--brand);
    background: var(--brand-soft);
    font-size: 11px;
    font-weight: 650;
}

.transaction-actions .danger { color: var(--red); background: transparent; border-color: var(--line); }
.transaction-actions .danger:hover { color: var(--red); background: var(--danger-soft); border-color: var(--red); }
.scope-note { margin: 6px 0 0; color: var(--muted); font-size: var(--text-xs); line-height: 1.5; }
.scope-note span { display: inline; }
.scope-note span::before { content: " · "; }
.dashboard-head .scope-note { margin-top: 4px; font-size: 12px; }
.dashboard-cards-panel p { margin: 8px 0 0; font-size: 13px; }
.quick-action strong { font-size: 12px; }
.metrics .quote-note { margin-top: 3px; font-size: 10px; line-height: 1.3; }
.empty-state > p { margin: 0 0 12px; font-weight: 400; }
.empty-state .button { margin-top: 4px; }
.filter-chips a { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-subtle); padding: 6px 10px; color: var(--text); font-size: var(--text-xs); }
.filter-chips a:hover { border-color: var(--brand); }
.filter-chips .ui-icon { width: 14px; height: 14px; }

.transaction-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.transaction-actions form {
    margin: 0;
}

.transaction-attachments {
    margin-top: 18px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.transaction-attachments h3 {
    margin: 0 0 10px;
    font-size: 16px;
}

.attachment-list {
    display: grid;
    gap: var(--space-2);
}

.attachment-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: #fff;
}

.attachment-row strong,
.attachment-row small {
    display: block;
}

.empty-state {
    border: 1px dashed var(--line);
    border-radius: 8px;
    padding: var(--space-5);
    color: var(--muted);
    text-align: center;
    font-weight: 650;
}

.crypto-page {
    display: grid;
    gap: var(--space-4);
}

.crypto-page-head {
    margin-bottom: 0;
}

.crypto-page-actions {
    align-items: flex-end;
}

.crypto-panel-head {
    align-items: end;
}

.crypto-panel-head > div {
    min-width: 0;
}

.crypto-panel-head h2 {
    margin-bottom: 2px;
}

.crypto-history-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
}

.crypto-operation-form .panel-head {
    margin-bottom: 8px;
}

.crypto-positions,
.crypto-operation-list {
    display: grid;
    gap: var(--space-2);
}

.crypto-position {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) minmax(170px, auto);
    align-items: center;
    gap: var(--space-3);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #fff;
}

.crypto-position:hover,
.crypto-position.is-selected {
    border-color: var(--line);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.crypto-position.is-selected {
    border-color: #93c5fd;
    background: var(--brand-soft);
}

.crypto-position-main strong,
.crypto-position-main small,
.crypto-position-value,
.crypto-position-value span,
.crypto-position-value small {
    display: block;
}

.crypto-position-main strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
}

.crypto-position-main small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
}

.crypto-position-value {
    color: var(--blue);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    line-height: 1.25;
    text-align: right;
}

.crypto-position-value small {
    color: var(--brand);
    font-size: 12px;
    font-weight: 650;
}

.crypto-operation-item {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr) minmax(150px, auto) minmax(120px, auto) auto;
    align-items: center;
    gap: var(--space-3);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
    background: #fff;
}

.crypto-operation-actions {
    margin: 0;
    text-align: right;
}

.crypto-operation-main strong,
.crypto-operation-main span,
.crypto-operation-main small,
.crypto-operation-values,
.crypto-operation-values small {
    display: block;
}

.crypto-operation-main strong {
    color: var(--text);
    line-height: 1.2;
}

.crypto-operation-main span,
.crypto-operation-main small {
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.crypto-operation-quantity {
    color: var(--blue);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    text-align: right;
    white-space: nowrap;
}

.crypto-operation-type {
    display: inline-flex;
    justify-content: center;
    border: 1px solid #fde68a;
    border-radius: 999px;
    padding: 5px 9px;
    color: #92400e !important;
    background: var(--warning-soft);
    font-size: 12px !important;
    font-weight: 900 !important;
    text-transform: none;
}

.crypto-operation-item.buy .crypto-operation-type {
    border-color: var(--line);
    color: var(--green) !important;
    background: var(--brand-soft);
}

.crypto-operation-item.sell .crypto-operation-type {
    border-color: #edc6c1;
    color: var(--red) !important;
    background: var(--danger-soft);
}

.crypto-operation-item.transfer .crypto-operation-type {
    border-color: var(--line);
    color: var(--brand) !important;
    background: var(--brand-soft);
}

.crypto-operation-values {
    min-height: 1px;
    color: var(--text);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    text-align: right;
}

.crypto-operation-values small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.crypto-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--space-2);
    margin-top: 12px;
}

.crypto-pagination > div {
    display: flex;
    align-items: center;
    gap: 4px;
}

.crypto-pagination > div a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 8px;
    color: var(--text);
    background: #fff;
    font-size: 13px;
    font-weight: 650;
}

.crypto-pagination > div a.active {
    border-color: var(--line);
    color: var(--brand);
    background: var(--brand-soft);
}

.crypto-pagination .is-disabled {
    opacity: .45;
    pointer-events: none;
}

.patrimony-page {
    display: grid;
    gap: var(--space-4);
}

.patrimony-page-head,
.patrimony-page-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
}

.patrimony-page-head h1 {
    margin: 0 0 4px;
    font-size: 26px;
    line-height: 1.1;
}

.patrimony-page-head .button {
    min-width: 112px;
}

.patrimony-page-actions {
    justify-content: flex-end;
}

.patrimony-status-form label {
    justify-content: flex-end;
}

.patrimony-status-form small {
    max-width: 270px;
    text-align: right;
}

.patrimony-metrics {
    margin-bottom: 0;
}

.patrimony-metrics article {
    min-height: 116px;
    padding: 16px 18px;
    min-width: 0;
}

.patrimony-metrics strong {
    overflow-wrap: anywhere;
    font-size: clamp(23px, 1.8vw, 28px);
    line-height: 1.08;
    word-break: normal;
}

.patrimony-metrics article small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-weight: 700;
}

.patrimony-grid {
    align-items: start;
}

.patrimony-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .8fr);
    gap: var(--space-4);
    align-items: stretch;
}

.patrimony-dashboard-grid > .panel {
    margin-top: 0;
}

.patrimony-dashboard-grid .wide {
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: var(--space-3);
    grid-row: span 2;
}

.patrimony-chart-panel canvas {
    display: block;
    width: 100%;
    max-width: 100%;
}

.chart-tooltip {
    position: absolute;
    z-index: 20;
    display: grid;
    gap: 6px;
    min-width: 190px;
    max-width: 260px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 16px 35px rgba(15, 23, 42, .16);
    font-size: 12px;
    line-height: 1.3;
    pointer-events: none;
}

.chart-tooltip[hidden] {
    display: none;
}

.chart-tooltip strong {
    color: var(--text);
    font-size: 13px;
}

.chart-tooltip span {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    color: var(--muted);
    white-space: nowrap;
}

.chart-tooltip i {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 2px;
}

.chart-tooltip b {
    color: var(--text);
}

.patrimony-location-bars {
    display: grid;
    gap: 10px;
}

.location-bar {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    overflow: hidden;
    width: 100%;
    border: 0;
    border-radius: 7px;
    padding: 9px 10px;
    background: var(--surface-subtle);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: box-shadow .15s ease, transform .15s ease;
}

.location-bar:hover,
.location-bar:focus-visible {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .14);
    transform: translateY(-1px);
    outline: none;
}

.location-bar span,
.location-bar b {
    position: relative;
    z-index: 1;
}

.location-bar span {
    overflow: hidden;
    color: var(--text);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.location-bar b {
    color: #166534;
    font-size: 13px;
    white-space: nowrap;
}

.location-bar i {
    position: absolute;
    inset: 0 auto 0 0;
    border-radius: inherit;
    background: #dcfce7;
}

.patrimony-list-panel.filter-jump {
    animation: patrimony-filter-jump 1.1s ease;
}

.patrimony-list-panel.real-estate {
    scroll-margin-top: 86px;
}

@keyframes patrimony-filter-jump {
    0%,
    100% {
        box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    }
    35% {
        box-shadow: 0 0 0 4px rgba(22, 163, 74, .16), 0 16px 35px rgba(15, 23, 42, .1);
    }
}

.patrimony-summary {
    align-self: end;
    border-top: 1px solid var(--line);
    padding-top: 14px;
}

.patrimony-archive-notice {
    border: 1px solid var(--line);
    border-radius: 8px;
    margin-bottom: 14px;
    padding: 12px 14px;
    color: #1e40af;
    background: var(--brand-soft);
    font-weight: 650;
}

.patrimony-archive-notice.warning {
    border-color: #fde68a;
    color: #92400e;
    background: var(--warning-soft);
}

.patrimony-archive-notice.danger {
    border-color: #edc6c1;
    color: var(--red);
    background: var(--danger-soft);
}

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

.patrimony-breakdown > div {
    display: grid;
    gap: var(--space-3);
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 11px 12px;
    background: var(--surface-subtle);
}

.patrimony-breakdown span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.patrimony-breakdown strong {
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patrimony-table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }

.patrimony-list {
    display: grid;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: visible;
}

.patrimony-list-head,
.patrimony-item,
.patrimony-list-total {
    display: grid;
    grid-template-columns: minmax(128px, 1.05fr) minmax(92px, .68fr) repeat(6, minmax(112px, .72fr)) minmax(86px, auto);
    gap: var(--space-2);
    align-items: center;
}

.patrimony-list-panel.movable .patrimony-list-head,
.patrimony-list-panel.movable .patrimony-item,
.patrimony-list-panel.movable .patrimony-list-total {
    grid-template-columns: minmax(170px, 1.35fr) minmax(120px, .85fr) repeat(3, minmax(110px, .82fr)) minmax(92px, auto);
}

.patrimony-list-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 10px;
}

.patrimony-list-title {
    display: flex;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
}

.patrimony-list-title h2 {
    margin: 0;
}

.patrimony-list-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1 1 auto;
    gap: var(--space-3);
    min-width: 0;
}

.patrimony-search {
    flex: 0 1 340px;
    position: relative;
    margin: 0;
}

.patrimony-search > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.patrimony-search input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 38px 8px 10px;
    color: var(--text);
    background: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.patrimony-search input:focus {
    border-color: #86efac;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}

.patrimony-search button {
    position: absolute;
    top: 50%;
    right: 7px;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 7px;
    padding: 0;
    transform: translateY(-50%);
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: 18px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
}

.patrimony-search button:hover {
    color: var(--text);
    background: var(--line);
}

.patrimony-search-count {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.patrimony-location-filter {
    display: flex;
    align-items: center;
    flex: 0 0 190px;
    gap: var(--space-2);
    margin: 0;
}

.patrimony-location-filter span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.patrimony-location-filter select {
    width: 100%;
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 10px;
    color: var(--text);
    background: #fff;
    font-size: 13px;
    font-weight: 650;
}

.patrimony-search-empty {
    margin: 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0 0 8px 8px;
}

.patrimony-list-head {
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    background: var(--surface-subtle);
}

.patrimony-list-head button,
.patrimony-list-head span {
    min-width: 0;
    border: 0;
    padding: 0;
    color: var(--muted);
    background: transparent;
    font: inherit;
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .03em;
    text-align: left;
    text-transform: none;
}

.patrimony-list-head button:nth-child(n+3),
.patrimony-list-head span:last-child {
    text-align: right;
}

.patrimony-list-head button,
.patrimony-list-head span,
.patrimony-list-head button:nth-child(n+3),
.patrimony-list-head span:last-child {
    text-align: center;
}

.patrimony-list-head button:first-child {
    text-align: left;
}

.patrimony-list-head button {
    cursor: pointer;
}

.patrimony-list-head button::after {
    content: "↕";
    margin-left: 3px;
    color: #94a3b8;
    font-size: 9px;
}

.patrimony-list-head button.active {
    color: var(--brand);
}

.patrimony-list-head button.active.asc::after {
    content: "↑";
    color: var(--brand);
}

.patrimony-list-head button.active.desc::after {
    content: "↓";
    color: var(--brand);
}

.patrimony-item {
    position: relative;
    border-bottom: 1px solid var(--line);
    padding: 10px;
    background: #fff;
}

.patrimony-item:last-child {
    border-bottom: 0;
    border-radius: 0 0 8px 8px;
}

.patrimony-item:first-child {
    border-radius: 8px 8px 0 0;
}

.patrimony-item-main {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.patrimony-item-main strong {
    color: var(--text);
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.25;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.patrimony-item-meta,
.patrimony-item-money,
.patrimony-item-updated {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.patrimony-item-meta span,
.patrimony-item-meta small,
.patrimony-item-money span,
.patrimony-item-updated span {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.patrimony-item-meta > span {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.patrimony-item-meta small {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.patrimony-item-meta .status-pill {
    flex: 0 0 auto;
}

.patrimony-status-tag {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 2px 7px;
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

.patrimony-status-tag.active {
    border-color: var(--line);
    color: var(--green);
    background: var(--brand-soft);
}

.patrimony-status-tag.passive {
    border-color: #edc6c1;
    color: var(--red);
    background: var(--danger-soft);
}

.patrimony-status-tag.transition {
    border-color: #fde68a;
    color: #92400e;
    background: var(--warning-soft);
}

.patrimony-status-tag.none {
    border-color: var(--line);
    color: var(--muted);
    background: var(--surface-subtle);
}

.patrimony-item-money,
.patrimony-item-updated {
    text-align: center;
}

.patrimony-item-money span,
.patrimony-item-updated span {
    display: none;
}

.patrimony-item-money b,
.patrimony-item-updated b {
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    text-overflow: clip;
    white-space: nowrap;
}

.patrimony-result.positive b {
    color: var(--green);
}

.patrimony-result.negative b {
    color: var(--red);
}

.patrimony-result.neutral b {
    color: var(--muted);
}

.patrimony-item .table-actions {
    flex-wrap: nowrap;
    justify-content: center;
    min-width: 72px;
    position: relative;
    z-index: 5;
}

.patrimony-list-total {
    border-top: 1px solid var(--line);
    padding: 10px;
    background: var(--surface-subtle);
}

.patrimony-total-label strong {
    color: var(--text);
    font-size: 13px;
}

.patrimony-list-total .patrimony-item-money b {
    overflow: visible;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.15;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

.icon-action {
    position: relative;
    width: 30px;
    height: 30px;
    border: 1px solid transparent;
    border-radius: 7px;
    padding: 0;
    font-size: 17px;
    line-height: 1;
}

.icon-action.edit,
.icon-action.restore,
.icon-action.info,
.icon-action.blue {
    color: var(--brand);
    border-color: var(--line);
    background: var(--brand-soft);
}

.icon-action.info {
    font-family: ui-serif, Georgia, serif;
    font-style: italic;
    font-weight: 650;
}

.icon-action.archive,
.icon-action.red {
    color: var(--red);
    border-color: #edc6c1;
    background: var(--danger-soft);
}

.dashboard-side-stack,
.cards-page {
    display: grid;
    gap: var(--space-4);
}

.dashboard-grid {
    align-items: start;
}

.dashboard-grid .dashboard-side-stack {
    align-content: start;
    align-self: start;
}

.cards-page-head {
    margin-bottom: 0;
}

.cards-page-actions {
    align-items: flex-end;
    gap: 10px;
}

.dashboard-cards-panel {
    align-self: start;
}

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

.card-summary-strip > span {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 9px 10px;
    background: var(--surface-subtle);
}

.card-summary-strip strong { display: block; margin-top: 3px; font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.card-summary-strip strong > span { display: block; color: inherit; font-size: inherit; line-height: inherit; overflow-wrap: normal; }
.dashboard-card-list > p { margin: 4px 0 0; }

.card-summary-strip small,
.dashboard-card-list small {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.dashboard-card-list {
    display: grid;
    gap: var(--space-2);
    margin-top: 8px;
}

.dashboard-card-list .dashboard-card-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 10px;
    background: #fff;
    gap: var(--space-3);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.dashboard-card-list .dashboard-card-item:hover {
    border-color: var(--line);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .06);
}

.dashboard-card-list b {
    color: var(--text);
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    white-space: nowrap;
}

.cards-metrics {
    margin-bottom: 0;
}

.cards-metrics article {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 88px;
    padding: 16px 18px;
}

.cards-metrics strong {
    font-size: 25px;
    line-height: 1.1;
    white-space: normal;
}

.cards-chart-panel {
    position: relative;
}

.cards-chart-panel canvas {
    display: block;
    width: 100%;
    max-width: 100%;
}

.cards-chart-legend {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

.cards-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.cards-chart-legend i {
    width: 10px;
    height: 10px;
    border-radius: 3px;
}

.cards-chart-legend i.total {
    background: var(--brand);
}

.cards-chart-legend i.open {
    background: #f59e0b;
}

.cards-panel-head {
    align-items: end;
}

.cards-panel-head h2 {
    margin-bottom: 2px;
}

.cards-panel-tools {
    display: flex;
    align-items: end;
    justify-content: flex-end;
    gap: var(--space-3);
    min-width: 0;
}

.cards-invoice-tools {
    align-items: center;
}

.cards-month-title {
    display: block;
    color: var(--muted);
    font-size: 13px;
    font-weight: 650;
}

.cards-month-nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cards-month-nav .button {
    min-height: 34px;
    padding: 7px 10px;
}

.card-status-filter {
    margin: 0;
}

.card-status-filter label {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
}

.card-status-filter select,
.card-status-filter .pretty-select,
.card-status-filter .pretty-select-button {
    min-width: 150px;
    min-height: 38px;
}

.cards-count {
    padding-bottom: 10px;
    font-size: 13px;
    font-weight: 650;
    white-space: nowrap;
}

/* Registered cards and invoices share owner groups and table-wide columns. */
.cards-registered-panel { background: var(--panel); }
.card-grid-list { display: block; min-width: 0; }
.cards-registered-table, .cards-invoice-table { width: 100%; min-width: 0; table-layout: fixed; }
.cards-registered-table .card-col-money { width: 180px; }
.cards-registered-table .card-col-dates { width: 116px; }
.cards-registered-table .card-col-actions { width: 96px; }
.cards-invoice-table .invoice-col-month { width: 100px; }
.cards-invoice-table .invoice-col-date { width: 108px; }
.cards-invoice-table .invoice-col-status { width: 100px; }
.cards-invoice-table .invoice-col-money { width: 170px; }
.cards-invoice-table .invoice-col-actions { width: 144px; }
.cards-registered-table :is(th, td), .cards-invoice-table :is(th, td) { padding: 8px; vertical-align: middle; }
.cards-registered-table thead th, .cards-invoice-table thead th { color: var(--muted); font-weight: 500; }
.cards-registered-table thead th { background: transparent; }
.cards-registered-table .credit-card-item { display: table-row; border: 0; background: transparent; }
.credit-card-item.is-archived .credit-card-main { opacity: .72; }
.cards-registered-table .credit-card-main { min-width: 0; padding-left: 40px; }
.card-identity { display: flex; align-items: center; gap: 8px; min-width: 0; }
.card-identity .bank-avatar { display: inline-flex; width: 28px; height: 28px; border: 0; border-radius: 6px; }
.card-identity .bank-avatar:not(.bank-avatar-fallback) { background: transparent; }
.card-identity-text { display: block; min-width: 0; }
.card-identity-text strong { display: block; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.4; overflow-wrap: anywhere; }
.card-identity-text small, .cards-invoice-table .card-identity-text small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.credit-card-dates { color: var(--muted); font-size: 12px; line-height: 1.4; }
.credit-card-dates span { display: block; }
.card-money-cell { color: var(--text); text-align: right; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.credit-card-open.is-zero { color: var(--muted); font-weight: 400; }
.credit-card-actions { justify-content: flex-end; flex-wrap: nowrap; min-width: 0; }
.card-entity-row th { padding: 10px 12px; background: var(--brand-soft); text-align: left; }
.card-entity-heading, .card-group-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.card-entity-heading > div, .card-group-heading > div { min-width: 0; }
.card-entity-heading strong { display: block; color: var(--brand); font-size: 16px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.card-entity-heading small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.card-entity-heading > span, .card-group-heading > span { flex: 0 0 auto; color: var(--muted); font-size: 12px; font-weight: 400; }
.card-group-row th { padding: 10px 8px 4px 24px; text-align: left; background: var(--panel); border-top: 1px solid var(--line); border-bottom: 0; }
.card-entity-row + .card-group-row th { border-top: 0; }
.card-group-heading > div { display: flex; align-items: baseline; gap: 6px; }
.card-group-heading > div > span { color: var(--muted); font-size: 12px; font-weight: 400; }
.card-group-heading strong { color: var(--text); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.card-entity-group > tr:last-child td, .card-entity-group tr:has(+ .card-group-row) td { border-bottom: 0; }
.cards-invoice-table .card-entity-heading small { font-weight: 400; }
.cards-invoice-table .invoice-card-name { font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.cards-invoice-table .invoice-month, .cards-invoice-table .invoice-due-date { color: var(--muted); font-size: 12px; }
.cards-invoice-table .invoice-month small { overflow-wrap: anywhere; }
.cards-invoice-table .table-actions { min-width: 0; }

.cards-table small {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.invoice-status {
    display: inline-flex;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 650;
}

.invoice-status.open {
    color: var(--brand);
    background: #dbeafe;
}

.invoice-status.paid {
    color: var(--green);
    background: #dcfce7;
}

.invoice-status.overdue {
    color: var(--red);
    background: #fee2e2;
}

.card-filters {
    display: grid;
    align-items: end;
    grid-template-columns: minmax(170px, 1.2fr) minmax(170px, 1fr) minmax(150px, .9fr) minmax(145px, .8fr) auto;
    gap: var(--space-2);
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: var(--surface-subtle);
}

.card-filters input,
.card-filters select,
.card-filters .date-field-label,
.card-filters .pretty-select,
.card-filters .pretty-select-button,
.card-filters button {
    min-width: 0;
}

.cards-table {
    min-width: 0;
}

.cards-table th,
.cards-table td {
    vertical-align: middle;
}

.cards-table th.right,
.cards-table td.right {
    text-align: right;
}

.cards-table .table-actions {
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.cards-money-cell {
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cards-empty-state {
    margin: 2px 0;
    padding: 18px;
}

.card-modal-form {
    max-width: 760px;
}

.span-full {
    grid-column: 1 / -1;
}

.icon-action:hover {
    transform: translateY(-1px);
}



.patrimony-edit-form {
    width: min(780px, calc(100vw - 28px));
    display: grid;
    gap: var(--space-4);
    padding: 26px;
}

.patrimony-create-modal-form {
    width: min(860px, calc(100vw - 28px));
}

.patrimony-edit-form .modal-head {
    margin-bottom: 0;
    border-bottom: 1px solid var(--line);
    padding-bottom: 14px;
}

.patrimony-edit-form .modal-head h2 {
    font-size: 22px;
}

.patrimony-form-section {
    display: grid;
    gap: var(--space-3);
    border: 1px solid #e8edf4;
    border-radius: 8px;
    padding: 14px;
    background: #fbfcfe;
}

.patrimony-form-section-title {
    color: var(--text);
    font-size: 12px;
    font-weight: 650;
    letter-spacing: .04em;
    text-transform: none;
}

.patrimony-edit-form label {
    gap: 7px;
    font-size: 13px;
    font-weight: 650;
}

.patrimony-edit-form input,
.patrimony-edit-form textarea,
.patrimony-edit-form .pretty-select-button {
    border-color: #dce3ec;
    border-radius: 7px;
    background: #fff;
}

.patrimony-edit-form textarea {
    min-height: 84px;
    resize: vertical;
}

.money-field {
    display: flex;
    align-items: center;
    overflow: hidden;
    border: 1px solid #dce3ec;
    border-radius: 7px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.money-field span {
    display: inline-flex;
    align-items: center;
    align-self: stretch;
    border-right: 1px solid #e8edf4;
    padding: 0 11px;
    color: var(--muted);
    background: var(--surface-subtle);
    font-size: 13px;
    font-weight: 650;
}

.money-field input {
    border: 0;
    border-radius: 0;
    box-shadow: none;
    font-weight: 650;
}

.money-field:focus-within {
    border-color: #86efac;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .14);
}

.money-field input:focus {
    box-shadow: none;
}

.money-field input[readonly] {
    color: var(--muted);
    background: var(--surface-subtle);
    cursor: default;
}

.patrimony-hidden-fields {
    display: none;
}

.patrimony-edit-form .modal-submit {
    justify-self: end;
    min-width: 180px;
    border-radius: 7px;
    padding: 12px 18px;
    font-weight: 650;
}

.login-body {
    display: grid;
    min-height: 100dvh;
    place-items: center;
    padding: 24px 0;
    background: var(--bg);
}

.login-card {
    display: grid;
    gap: 22px;
    width: min(440px, calc(100% - 32px));
    padding: 36px;
}

@media (min-width: 901px) {
    .patrimony-table-scroll > .patrimony-list-head, .patrimony-table-scroll > .patrimony-list { min-width: 1090px; }
}

@media (max-width: 1100px) {
    .topbar-inner { flex-wrap: wrap; padding-block: 12px; }
    .brand { flex: 1; }
    .main-nav-shell { order: 3; flex-basis: 100%; }
    .user-area span { display: none; }
}

@media (max-width: 900px) {
    .patrimony-list-panel.movable .patrimony-item, .patrimony-list-panel.movable .patrimony-list-total { grid-template-columns: 1fr; }
    .patrimony-list-panel.movable .patrimony-list-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.two:has(> .form) { grid-template-columns: 1fr; }
    .page { width: calc(100% - 32px); margin-top: 24px; }
    .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metrics article { padding: 12px 14px; min-height: 0; }

    .grid.two.dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-head { gap: var(--space-4); }
    .dashboard-head > div:first-child { width: auto; flex: 1; }
    .dashboard-head .dashboard-actions { flex-direction: row; width: auto; }
    .dashboard-context-form { flex: 1; width: auto; }
    .dashboard-actions .privacy-controls { align-self: end; }
    .dashboard-context-form label { display: grid; }

    .topbar-inner {
        flex-wrap: wrap;
        width: calc(100% - 32px);
        padding: 12px 0;
        gap: 10px;
    }

    .brand {
        flex: 1;
    }

    .brand img {
        width: 132px;
        height: auto;
    }

    .main-nav-shell {
        order: 3;
        width: 100%;
        flex: 0 0 100%;
    }

    .main-nav a {
        flex: 0 0 auto;
    }

    .admin-menu {
        position: fixed;
        top: 80px;
        right: 14px;
        left: 14px;
    }

    .hamburger b {
        display: none;
    }

    .user-area span {
        display: none;
    }

    .grid.two,
    .transactions-layout,
    .patrimony-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-head {
        align-items: flex-start;
        flex-direction: row;
    }

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

    .dashboard-context-form {
        width: 100%;
    }

    .privacy-controls {
        display: flex;
    }

    .privacy-toggle {
        justify-content: center;
    }

    .patrimony-page-head {
        align-items: stretch;
        flex-direction: column;
    }

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

    .account-filters {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .accounts-panel-head,
    .accounts-panel-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .account-filters select,
    .account-filters .pretty-select,
    .account-filters .pretty-select-button {
        width: 100%;
    }

    .accounts-count {
        padding-bottom: 0;
    }

    .patrimony-page-head .button {
        width: 100%;
    }

    .patrimony-status-form label {
        justify-content: flex-start;
    }

    .patrimony-status-form small {
        max-width: none;
        text-align: left;
    }

    .patrimony-metrics strong {
        white-space: normal;
    }

    .patrimony-dashboard-grid .wide {
        grid-row: auto;
    }

    .card-summary-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .card-summary-strip small { font-size: 11px; }
    .card-summary-strip strong { font-size: 13px; overflow-wrap: anywhere; }
    .dashboard-grid .panel-head { flex-direction: row; align-items: center; }
    .dashboard-grid .panel-head-actions { width: auto; }
    .account-group-head { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px; }
    .account-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
    .accounts-table thead tr { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 0; }
    .accounts-table thead th { flex: 1; }
    .accounts-table thead .table-sort-button { justify-content: flex-start; }


    .cards-page-actions,
    .cards-panel-head,
    .cards-panel-tools,
    .cards-chart-legend,
    .cards-month-nav {
        align-items: stretch;
        flex-direction: column;
    }

    .cards-page-actions .button,
    .cards-month-nav .button,
    .card-status-filter select,
    .card-status-filter .pretty-select,
    .card-status-filter .pretty-select-button {
        width: 100%;
    }

    .cards-count {
        padding-bottom: 0;
    }

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

    .dashboard-card-list .dashboard-card-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 2px;
    }

    .panel-head,
    .filters,
    .account-group-head {
        align-items: stretch;
        flex-direction: column;
    }

    .panel-head-actions {
        width: 100%;
    }

    .panel-head-actions .button {
        flex: 1;
        justify-content: center;
    }

    .account-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }

    .account-toolbar select {
        width: 100%;
    }

    .users-page-head,
    .users-page-actions,
    .logs-page-head,
    .attachments-page-head,
    .users-panel .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .users-page-actions,
    .users-page-actions .button {
        width: 100%;
    }

    .api-docs-grid,
    .api-payload-grid,
    .api-gaps {
        grid-template-columns: 1fr;
    }

    .api-endpoint-row {
        grid-template-columns: 1fr;
        align-items: flex-start;
    }

    .users-table,
    .users-token-table {
        min-width: 860px;
    }

    .admin-summary-grid,
    .admin-filter-toolbar,
    .logs-filter-toolbar {
        grid-template-columns: 1fr;
    }

    .admin-filter-toolbar .button,
    .admin-filter-toolbar button {
        width: 100%;
        justify-content: center;
    }

    .admin-table {
        min-width: 860px;
    }

    .admin-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .admin-pagination > span {
        margin-right: 0;
        text-align: center;
    }

    .admin-pagination > div {
        justify-content: center;
        order: -1;
    }

    .account-toolbar .button {
        margin-left: 0;
    }

    .context-inline-form,
    .context-inline-form label,
    .context-inline-form select {
        width: 100%;
    }

    .account-subtotal {
        white-space: normal;
    }

    .accounts-page .table-scroll .accounts-table { min-width: 0; table-layout: auto; }
    .accounts-table, .accounts-table thead, .accounts-table tbody, .accounts-table tfoot { display: block; width: 100%; }
    .accounts-table colgroup { display: none; }
    .accounts-table tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, .8fr); gap: 8px 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
    .accounts-table th, .accounts-table td { display: block; min-width: 0; width: auto; border: 0; padding: 0; }
    .accounts-table tbody td:first-child, .accounts-table thead th:first-child { grid-column: 1; grid-row: 1; }
    .accounts-table tbody .accounts-balance-cell, .accounts-table thead th:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; white-space: normal; overflow-wrap: anywhere; }
    .accounts-table .accounts-balance-cell small { text-align: right; }
    .accounts-table tbody td:nth-child(2), .accounts-table thead th:nth-child(2) { grid-column: 1; grid-row: 2; text-align: left; font-size: 12px; }
    .accounts-table tbody td:nth-child(3), .accounts-table thead th:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; }
    .accounts-table thead th:last-child { display: none; }
    .accounts-table tbody td:last-child { grid-column: 1 / -1; grid-row: 3; }
    .accounts-table .account-cell { gap: 8px; }
    .accounts-table .account-cell .bank-avatar { width: 30px; height: 30px; }
    .accounts-table .account-cell > span { font-size: 13px; overflow-wrap: anywhere; }
    .accounts-table .table-actions { justify-content: flex-start; }
    .accounts-table .table-sort-button.center { justify-content: flex-end; }
    .accounts-table tfoot tr { display: flex; flex-wrap: wrap; }
    .accounts-table tfoot td { flex: 1 1 100%; text-align: left; }
    .accounts-table .accounts-total-values { justify-content: flex-start; }
    .transactions-layout { --control-height: 44px; }
    .transaction-filter-main { grid-template-columns: minmax(0, 1fr) auto; }
    .transaction-filter-main > .filter-field { grid-column: 1 / -1; }
    .transaction-filter-main .filter-details > summary { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; color: var(--text); background: var(--panel); font-size: 14px; }
    .transaction-filter-main .filter-details > summary::after { content: '+'; margin-left: auto; }
    .transaction-filter-main .filter-details[open] > summary::after { content: '−'; }
    .transaction-filter-main .filter-details[open] { grid-column: 1 / -1; }
    .transaction-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 8px; }
    .transaction-filter-fields > .filter-field:first-child { grid-column: 1 / -1; }
    .transaction-filter-main .filter-submit { grid-column: 2; }
    .transaction-filter-main .filter-details[open] + .filter-submit { grid-column: 1 / -1; }
    .transaction-filter-footer .period-shortcuts { display: none; }
    .transaction-filters:has(.filter-details[open]) .period-shortcuts { display: flex; }
    .transaction-filters:has(.filter-details:not([open])) .transaction-filter-footer:not(:has(.filter-chips)) { display: none; }
    .transaction-filter-footer .filter-chips a { min-height: 44px; }

    .filters input {
        width: 100%;
    }

    .filters .date-field-label {
        width: 100%;
    }


    .transactions-chart-head {
        align-items: stretch;
    }

    .transactions-chart-summary {
        justify-items: start;
    }


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

    .transaction-form-grid .wide {
        grid-column: 1 / -1;
    }


    .transactions-layout .transactions-table { display: block; min-width: 0; }
    .transactions-table colgroup { display: none; }
    .transactions-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .transactions-table tbody { display: block; }
    .transactions-table .transaction-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
    .transactions-table .transaction-item:last-child { border-bottom: 0; }
    .transactions-table .transaction-item td { min-width: 0; padding: 0; border: 0; }
    .transactions-table .transaction-date { grid-column: 1; grid-row: 1; }
    .transactions-table .transaction-date small { display: inline; margin-left: 6px; }
    .transactions-table .transaction-value { grid-column: 2; grid-row: 1; }
    .transactions-table .transaction-info { grid-column: 1 / -1; grid-row: 2; }
    .transactions-table .transaction-title { white-space: normal; overflow: visible; }
    .transaction-title-line { align-items: start; flex-wrap: wrap; gap: 4px 8px; }
    .transaction-category { max-width: 100%; }
    .transaction-meta { flex-wrap: wrap; }
    .transaction-bank-trigger { min-height: 44px; }
    .transactions-table .transaction-account { grid-column: 1; grid-row: 3; }
    .transactions-table .transaction-actions-cell { grid-column: 2; grid-row: 3; }
    .transactions-table .transaction-actions :is(.button, button) { min-height: 44px; }
    .transactions-meta-divider { display: none; }

    .table-scroll table { min-width: 620px; }

    .modal {
        padding: 14px;
    }

    .modal-card {
        padding: 20px;
    }

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

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

    .crypto-operation-item {
        grid-template-columns: 1fr;
    }

    .crypto-panel-head,
    .crypto-history-tools {
        align-items: stretch;
        flex-direction: column;
    }

    .crypto-history-tools .button {
        width: 100%;
    }

    .crypto-operation-quantity,
    .crypto-operation-values {
        text-align: left;
    }

    .crypto-operation-actions {
        text-align: left;
    }

    .crypto-pagination {
        align-items: stretch;
        flex-direction: column;
    }

    .crypto-pagination > div {
        justify-content: center;
        order: -1;
    }

    .patrimony-item {
        grid-template-columns: 1fr;
    }

    .patrimony-breakdown {
        grid-template-columns: 1fr;
    }

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

    .patrimony-list-top {
        align-items: stretch;
        flex-direction: column;
    }

    .patrimony-list-title {
        justify-content: space-between;
    }

    .patrimony-list-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

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

    .patrimony-location-filter {
        flex-basis: auto;
        width: 100%;
    }

    .patrimony-search-count {
        align-self: flex-start;
    }

    .patrimony-list-head span {
        display: none;
    }

    .patrimony-item,
    .patrimony-list-total {
        gap: 10px;
        grid-template-columns: 1fr;
        border-bottom: 8px solid var(--surface-subtle);
    }

    .patrimony-list-total > div:empty {
        display: none;
    }

    .patrimony-item-money,
    .patrimony-item-updated {
        display: flex;
        justify-content: space-between;
        gap: var(--space-3);
        text-align: left;
    }

    .patrimony-item-money span,
    .patrimony-item-updated span {
        display: block;
    }

    .patrimony-item .table-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 520px) {
    :root { --control-height: 44px; }
    .topbar { position: relative; }
    .topbar-inner { width: calc(100% - 32px); gap: var(--space-2); }
    .main-nav { display: flex; gap: 4px; justify-content: flex-start; padding-bottom: 4px; }
    .main-nav a { flex-direction: row; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 10px; font-size: 13px; }
    .main-nav .nav-icon { width: 18px; height: 18px; }
    .page { width: calc(100% - 24px); margin: 16px auto 32px; }
    .panel { padding: 12px; }
    .dashboard-head h1 { font-size: 26px; }
    .metrics { gap: 8px; }
    .metrics article { padding: 10px 12px; min-height: 0; }
    .metrics strong, .metric-usd strong, .metrics .metric-money-stack { font-size: 18px; }
    .metrics > article > span { font-size: 12px; }
    .metric-estimate { font-size: 11px; }
    .quick-action { padding: 10px 8px; gap: 6px; }
    .quick-actions .quick-action { min-height: 44px; }
    .account-row .bank-avatar { width: 36px; height: 36px; }
    .dashboard-transactions .recent-date-col { width: 64px; }
    .dashboard-transactions .recent-value-col { width: 104px; }
    .dashboard-transactions td:first-child { font-size: 11px; }
    .dashboard-transactions td:nth-child(2) { padding-inline: 8px; }
    .dashboard-transactions td:last-child { font-size: 12px; white-space: normal; overflow-wrap: normal; }
    .card-summary-strip > span { padding: 8px; }
    .dashboard-transactions { font-size: 13px; }
    .modal { padding: 8px; align-items: center; }
    .modal-card { max-height: calc(100dvh - 16px); padding: 16px 12px; }
    .icon-action, .small, .privacy-icon-toggle, .drag-handle { min-width: 44px; min-height: 44px; }
    .account-toolbar .pretty-select-button, .account-toolbar .button, .date-field-label { min-height: var(--control-height); }
    .panel-head-actions .button { flex: initial; }
    .account-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .account-toolbar > button { grid-column: 1 / -1; }
    .table-scroll { margin-inline: 0; }

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

    .quick-action {
        min-height: 44px;
    }

    .quick-icon { width: 20px; height: 20px; }

    .quick-action strong { font-size: 12px; }

    .quick-panel-head {
        align-items: start;
        flex-direction: column;
        gap: 2px;
    }

    .account-toolbar { align-items: end; grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .account-toolbar-context label,
    .account-toolbar label {
        gap: 6px;
    }

    .account-toolbar-context,
    .account-toolbar .pretty-select,
    .account-toolbar .button {
        width: 100%;
    }

    .account-row { align-items: center; flex-wrap: nowrap; }

    .account-row-link { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 6px 10px; align-items: center; }

    .account-row b { grid-column: 2; width: auto; margin: 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }

    .account-balance {
        justify-items: start;
    }

    .modal-head h2 {
        font-size: 20px;
    }


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

    .transaction-actions {
        flex-wrap: wrap;
    }

    .crypto-position {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .crypto-position b {
        grid-column: 2;
        text-align: left;
    }
}

@media (min-width: 901px) and (max-width: 1279px) {
    .transaction-filter-main { grid-template-columns: minmax(0, 1fr) auto; }
    .transaction-filter-main > .filter-field { grid-column: 1 / -1; }
    .transaction-filter-main .filter-details { grid-column: 1; }
    .transaction-filter-main .filter-submit { grid-column: 2; }
}


/* Shared operating layout: home and transactions are the visual reference. */
.module-page { display: grid; gap: 12px; }
.module-page > .panel, .module-page > .metrics { margin: 0; }
.page .dashboard-head { gap: 12px; align-items: center; }
.page .dashboard-head > div { min-width: 0; }
.page .dashboard-head h1 { margin: 0; font-size: 28px; line-height: 1.2; }
.page .dashboard-head :is(p, .scope-note) { margin: 4px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; font-weight: 400; }
.module-page > .dashboard-head { margin: 0; }
.setup-layout, .edit-layout { gap: 12px; }
.setup-layout > .panel, .edit-layout > .panel { margin: 0; }

.categories-toolbar { grid-template-columns: minmax(180px, 1.5fr) minmax(150px, 1fr) minmax(140px, 1fr) auto auto; }
.categories-help { margin: 8px 0 12px; font-size: 12px; }
.categories-page .categories-table { width: 100%; min-width: 0; table-layout: fixed; }
.categories-table th:nth-child(2) { width: 100px; }
.categories-table th:nth-child(3) { width: 110px; }
.categories-table th:last-child { width: 210px; }
.categories-table :is(th, td) { padding: 8px; }
.categories-table td:first-child { overflow-wrap: anywhere; }
.categories-table td strong { font-weight: 600; }
.categories-table .table-actions { justify-content: flex-end; }
.categories-page .panel { min-width: 0; }
@media (max-width: 900px) {
    .categories-toolbar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto auto; }
    .categories-toolbar label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .categories-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .categories-table thead { display: none; }
    .categories-table tbody { display: block; }
    .categories-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name type" "usage actions"; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
    .categories-table tr:last-child { border-bottom: 0; }
    .categories-table td { min-width: 0; padding: 0; border: 0; align-self: center; }
    .categories-table td:first-child { grid-area: name; }
    .categories-table td:nth-child(2) { grid-area: type; text-align: right; }
    .categories-table td:nth-child(3) { grid-area: usage; }
    .categories-table td:last-child { grid-area: actions; }
}
.compact-form > h2 { margin: 0 0 4px; }
.compact-form > button[type=submit] { justify-self: end; min-width: 120px; margin-top: 4px; }
.table-scroll .entities-table { min-width: 700px; table-layout: fixed; }
.entities-table th:nth-child(1) { width: 130px; }
.entities-table th:nth-child(3) { width: 150px; }
.entities-table th:nth-child(4) { width: 110px; }
.entities-table th:nth-child(5) { width: 80px; }
.entities-table :is(input, select, .pretty-select) { min-width: 0; width: 100%; }
.entities-table :is(input:not([type=hidden]), .pretty-select-button, button[type=submit]) { height: var(--control-height); min-height: var(--control-height); }
.transfers-table { table-layout: fixed; }
.transfers-table th:first-child { width: 100px; }
.transfers-table th:last-child { width: 150px; }
.transfers-table td:nth-child(2) { overflow-wrap: anywhere; }
.transfers-table td:last-child { white-space: nowrap; }
.table-scroll .users-table { min-width: 1100px; }
.users-table :is(th, td):nth-child(1) { width: 20%; }
.users-table :is(th, td):nth-child(2) { width: auto; }
.users-table :is(th, td):nth-child(3) { width: 108px; }
.users-table :is(th, td):nth-child(4) { width: 72px; }
.users-table :is(th, td):nth-child(5) { width: 132px; }
.users-table :is(th, td):nth-child(6) { width: 132px; }
.users-table :is(th, td):nth-child(7) { width: 184px; }
.users-table :is(input, select, .pretty-select, .pretty-select-button) { min-width: 0; }
.users-table :is(input:not([type=hidden]), .pretty-select-button, .table-actions button) { height: var(--control-height); min-height: var(--control-height); }
.api-docs-panel { gap: 10px; }
.api-docs-panel > .panel-head { margin: 0; }
.api-docs-card, .api-payload-grid > div, .api-example { padding: 12px; }
.api-docs-card span { margin-bottom: 4px; }
.api-docs-card p, .api-gaps p, .api-payload-grid ul, .api-endpoint-row p { font-weight: 400; }
.page-actions { display: flex; flex-wrap: wrap; align-items: end; justify-content: end; gap: 8px; }
.page-actions > .button, .page-actions .pretty-select-button { min-height: var(--control-height); }
.page-actions label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
.page-actions :is(select, .pretty-select) { min-width: 150px; }
.page-actions .pretty-select-button { height: var(--control-height); padding-block: 8px; }
.section-heading { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.section-heading h2 { margin: 0; }
.section-heading .muted { font-size: 12px; }

.data-toolbar { display: grid; align-items: end; gap: 8px; min-width: 0; margin: 0 0 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-subtle); }
.data-toolbar label { display: grid; gap: 4px; margin: 0; min-width: 0; color: var(--muted); font-size: 12px; font-weight: 500; }
.data-toolbar :is(input, select, .pretty-select, .pretty-select-button, .date-field-label) { min-width: 0; width: 100%; }
.data-toolbar :is(input:not([type=hidden]), select, .pretty-select-button, .date-field-button, button[type=submit], a.button) { height: var(--control-height); min-height: var(--control-height); font-size: 14px; font-weight: 400; padding-block: 8px; }
.data-toolbar button[type=submit], .data-toolbar a.button { font-weight: 600; }
.accounts-toolbar { grid-template-columns: minmax(180px, 1fr) auto; }
.accounts-toolbar .account-filters { display: grid; grid-template-columns: repeat(2, minmax(150px, 1fr)); gap: 8px; }
.accounts-toolbar [data-account-table-count] { grid-column: 1 / -1; font-size: 12px; }
.accounts-toolbar [data-account-table-count]:empty { display: none; }
.accounts-count, .cards-count { padding: 0; font-size: 12px; font-weight: 400; }
.accounts-table .accounts-balance-cell, .accounts-table .accounts-balance-cell small { text-align: right; }
.accounts-table .bank-avatar { width: 36px; height: 36px; }
.accounts-table .account-cell { gap: 8px; }
.accounts-table .account-cell > span { font-size: 14px; }
.accounts-table .accounts-balance-cell { font-weight: 600; }
.accounts-table .accounts-balance-cell small { font-weight: 400; }
.page table th { font-size: 12px; }
.page :is(.table-actions, .crypto-operation-actions) .danger, .page table .danger { border-color: var(--line); color: var(--red); background: transparent; }
.page :is(.table-actions, .crypto-operation-actions) .danger:hover, .page table .danger:hover { border-color: var(--red); background: var(--danger-soft); }
.empty-state { padding: 12px 8px; border: 0; background: transparent; }

.cards-panel-head { align-items: center; }
.cards-panel-tools, .cards-month-nav { gap: 8px; align-items: center; }

/* Crypto quantities remain exact; only their presentation changes. */
.crypto-positions { gap: 0; }
.crypto-positions-panel > .quote-note { margin: 0 0 8px; }
.crypto-position { grid-template-columns: 36px minmax(0, 1fr) minmax(170px, auto); gap: 10px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 0; }
.crypto-position:last-child { border-bottom: 0; }
.crypto-position .bank-avatar { width: 36px; height: 36px; }
.crypto-position:hover, .crypto-position.is-selected { box-shadow: none; background: var(--surface-subtle); }
.crypto-position.is-selected { background: var(--brand-soft); }
.crypto-position-main strong { font-size: 14px; font-weight: 600; }
.crypto-position-main small { margin-top: 2px; font-size: 12px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.crypto-position-main .quote-note { font-size: 11px; }
.crypto-position-value { color: var(--text); font-weight: 600; }
.crypto-operation-list { display: block; }
.crypto-operations-table { width: 100%; table-layout: fixed; }
.crypto-operations-table .crypto-col-date { width: 90px; }
.crypto-operations-table .crypto-col-account { width: 180px; }
.crypto-operations-table .crypto-col-quantity { width: 190px; }
.crypto-operations-table .crypto-col-value { width: 160px; }
.crypto-operations-table .crypto-col-actions { width: 96px; }
.crypto-operation-actions button { white-space: nowrap; }
.crypto-operations-table .crypto-operation-item { display: table-row; border: 0; border-radius: 0; padding: 0; background: transparent; }
.crypto-operations-table td { display: table-cell; padding: 8px; vertical-align: middle; }
.crypto-operations-table tr:last-child td { border-bottom: 0; }
.crypto-operations-table .crypto-operation-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.crypto-operations-table .crypto-operation-main strong { display: block; font-size: 14px; font-weight: 500; line-height: 1.4; overflow-wrap: anywhere; }
.crypto-operations-table .crypto-operation-type { display: inline-flex; margin-top: 3px; padding: 2px 7px; font-size: 11px !important; font-weight: 600 !important; }
.crypto-operations-table :is(.crypto-operation-quantity, .crypto-operation-values) { color: var(--text); font-size: 14px; font-weight: 600; }
.crypto-operations-table .crypto-operation-account { font-size: 13px; overflow-wrap: anywhere; }
.crypto-operations-table small { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }

/* Patrimony keeps its dedicated columns and sorting/filtering contracts. */
.patrimony-metrics article { min-height: 0; padding: 12px 14px; }
.patrimony-metrics strong { font-size: 24px; line-height: 1.2; }
.patrimony-metrics article small { margin-top: 4px; font-size: 12px; font-weight: 400; }
.patrimony-breakdown > div { gap: 4px; padding: 8px 10px; border-radius: var(--radius); }
.patrimony-breakdown span { font-size: 12px; font-weight: 400; }
.patrimony-breakdown strong { overflow: visible; text-overflow: clip; white-space: normal; overflow-wrap: anywhere; }
.patrimony-summary { padding-top: 10px; }
.patrimony-dashboard-grid { gap: 12px; }
.patrimony-dashboard-grid .wide { align-content: start; align-self: start; }
.patrimony-dashboard-grid .wide .patrimony-summary { align-self: start; }
.patrimony-summary > p { margin: 8px 0 0; font-size: 12px; }
.patrimony-list-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) 220px auto; flex: none; }
.patrimony-list-toolbar:not(:has(.patrimony-location-filter)) { grid-template-columns: minmax(180px, 1fr) auto; }
.patrimony-list-toolbar .patrimony-search { min-width: 0; flex: none; }
.patrimony-list-toolbar .patrimony-search input { font-weight: 400; padding-right: 40px; border-radius: var(--radius); }
.patrimony-search button { top: auto; bottom: 4px; right: 4px; transform: none; min-height: 32px; width: 32px; height: 32px; }
.patrimony-list-toolbar .patrimony-location-filter { display: grid; gap: 4px; flex: none; }
.patrimony-search-count { align-self: end; padding-bottom: 10px; font-weight: 400; }
.patrimony-list-top { margin-bottom: 10px; }
.patrimony-list { border: 0; border-radius: 0; }
.patrimony-list-head { border-radius: 0; font-size: 12px; }
.patrimony-item { padding-block: 8px; }
.patrimony-item-main strong { display: block; overflow: visible; -webkit-line-clamp: unset; font-size: 13px; font-weight: 500; line-height: 1.4; }
.patrimony-item-meta > span, .patrimony-item-meta small { justify-content: start; }
.patrimony-item-meta :is(span, small) { white-space: normal; font-weight: 400; text-overflow: clip; }
.patrimony-item-money, .patrimony-item-updated { text-align: right; }
.patrimony-item-money b, .patrimony-item-updated b { overflow: visible; font-weight: 600; }
.patrimony-list-head button { text-align: right; }
.patrimony-list-head button:nth-child(-n+2) { text-align: left; }
.admin-summary-grid article { min-height: 0; padding: 12px; text-align: center; }
.admin-summary-grid span { margin-bottom: 4px; font-weight: 400; }
.admin-summary-grid strong { font-size: 24px; }

@media (max-width: 1100px) and (min-width: 901px) {
    .logs-filter-toolbar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .admin-filter-toolbar:not(.logs-filter-toolbar) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    :root { --control-height: 44px; }
    .attachments-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .attachments-summary article:last-child { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; text-align: left; }
    .attachments-summary article:last-child span { margin: 0; }
    .attachments-summary article:last-child strong { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; text-align: right; }
    .page .dashboard-head h1 { font-size: 26px; }
    .module-page .dashboard-head { flex-direction: row; flex-wrap: wrap; }
    .module-page .page-actions { flex-direction: row; flex-wrap: wrap; width: auto; align-items: end; }
    .module-page .page-actions > .button { width: auto; }
    .module-page .page-actions .pretty-select { min-width: 0; }
    .data-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .accounts-toolbar > label, .accounts-toolbar .account-filters { grid-column: 1 / -1; }
    .accounts-toolbar .account-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .accounts-table .accounts-balance-cell small { text-align: right; }
    .page :is(.table-actions, .credit-card-actions) :is(button, .button), .page table :is(button.small, .button.small), .crypto-pagination :is(.button, a), .page .icon-action { min-height: 44px; }
    .page .icon-action { width: 44px; }
    .cards-registered-table, .cards-invoice-table { display: block; }
    .cards-registered-table colgroup, .cards-invoice-table colgroup { display: none; }
    .cards-registered-table thead, .cards-invoice-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .cards-registered-table tbody, .cards-invoice-table tbody { display: block; }
    .card-group-row, .card-entity-row { display: block; }
    .card-group-row th { display: block; padding: 10px 8px 4px; }
    .card-entity-row th { display: block; }
    .card-group-heading, .card-entity-heading { align-items: start; }
    .card-group-heading > div { flex-wrap: wrap; gap: 2px 6px; }
    .cards-registered-table .credit-card-item, .cards-invoice-table .card-invoice-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 10px 8px; border-bottom: 1px solid var(--line); }
    .cards-registered-table .credit-card-item:last-child, .cards-invoice-table .card-invoice-item:last-child { border-bottom: 0; }
    .cards-registered-table td, .cards-invoice-table td { display: block; min-width: 0; padding: 0; border: 0; }
    .cards-registered-table .credit-card-main { grid-column: 1 / -1; padding-left: 0; }
    .cards-registered-table .card-money-cell { text-align: left; }
    .cards-registered-table .card-money-cell::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
    .cards-registered-table .credit-card-open { text-align: right; }
    .credit-card-dates { align-self: center; }
    .credit-card-actions { justify-content: flex-end; }
    .cards-invoice-table .invoice-card-name { grid-column: 1 / -1; grid-row: 1; }
    .cards-invoice-table .invoice-month { grid-column: 1; grid-row: 2; }
    .cards-invoice-table .cards-money-cell { grid-column: 2; grid-row: 2; }
    .cards-invoice-table :is(.invoice-month, .invoice-due-date, .cards-money-cell)::before { content: attr(data-label); display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
    .cards-invoice-table .invoice-due-date { grid-column: 1; grid-row: 3; }
    .cards-invoice-table .invoice-state { grid-column: 2; grid-row: 3; align-self: center; text-align: right; }
    .cards-invoice-table .invoice-actions { grid-column: 1 / -1; grid-row: 4; }
    .cards-page .cards-panel-head, .cards-page .cards-panel-tools, .cards-page .cards-month-nav { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .cards-page .cards-month-nav { width: auto; }
    .cards-page .cards-month-nav .button { width: auto; }
    .card-filters > .filter-field:first-child, .card-filters > button[type=submit] { grid-column: 1 / -1; }
    .crypto-position { grid-template-columns: 36px minmax(0, 1fr); }
    .crypto-position-value { grid-column: 2; text-align: left; }
    .crypto-page .crypto-operations-table { display: block; min-width: 0; }
    .crypto-operations-table colgroup { display: none; }
    .crypto-operations-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    .crypto-operations-table tbody { display: block; }
    .crypto-operations-table .crypto-operation-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
    .crypto-operations-table td { min-width: 0; padding: 0; border: 0; }
    .crypto-operations-table .crypto-operation-date { grid-column: 1; grid-row: 1; }
    .crypto-operations-table .crypto-operation-quantity { grid-column: 2; grid-row: 1; }
    .crypto-operations-table .crypto-operation-main { grid-column: 1 / -1; grid-row: 2; }
    .crypto-operations-table .crypto-operation-account { grid-column: 1; grid-row: 3; }
    .crypto-operations-table .crypto-operation-values { grid-column: 2; grid-row: 3; }
    .crypto-operations-table td:last-child { grid-column: 1 / -1; grid-row: 4; justify-self: end; }
    .crypto-operation-actions button { min-height: 44px; }
    .patrimony-metrics strong { font-size: 20px; }
    .patrimony-list-toolbar, .patrimony-list-toolbar:not(:has(.patrimony-location-filter)) { grid-template-columns: minmax(0, 1fr); }
    .patrimony-search-count { padding: 0; }
    .patrimony-list-toolbar .patrimony-search { width: 100%; }
    .patrimony-list-toolbar .patrimony-search input { padding-right: 48px; }
    .patrimony-search button { width: 44px; height: 44px; bottom: 0; right: 0; }
    .patrimony-item-money, .patrimony-item-updated { text-align: left; }
    .patrimony-list-head button { text-align: left; }
    .patrimony-list-head { display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 8px; padding: 6px; }
    .patrimony-list-head button { flex: 0 0 auto; min-height: 44px; white-space: nowrap; padding: 8px; font-size: 12px; }
    .patrimony-page .page-actions .patrimony-status-form { width: auto; }
    .patrimony-item-main strong { font-size: 14px; }
    .patrimony-item, .patrimony-list-total { gap: 6px; border-bottom: 1px solid var(--line); }
    .patrimony-item:last-child { border-bottom: 0; }
    .data-toolbar :is(.date-field-label, .pretty-select) { width: 100%; }
}
@media (max-width: 600px) {
    .module-page .dashboard-head > div:first-child { flex-basis: 100%; }
    .module-page .page-actions { width: 100%; justify-content: start; }
}

/* Compact registration and editing, preserving each form's native contracts. */
.modal { padding: 16px; }
.modal-card { width: min(720px, 100%); max-height: calc(100dvh - 32px); padding: 16px; }
.modal-card.form, .edit-form, .compact-form { gap: 8px; }
.modal-card:is(.card-modal-form, .crypto-operation-form, .patrimony-edit-form) { width: min(760px, 100%); }
.modal-card.users-modal-form { width: min(600px, 100%); }
.modal-card .modal-head { position: sticky; top: -16px; z-index: 2; margin: -16px -16px 0; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.modal-card .modal-head h2 { font-size: 20px; line-height: 1.3; }
.modal-card .modal-head .muted { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; font-weight: 400; }
.modal-card label, .edit-form label, .compact-form label { gap: 4px; font-size: 12px; line-height: 1.5; font-weight: 500; color: var(--muted); }
.modal-card :is(.form-grid, .crypto-fields), .edit-form :is(.form-grid, .crypto-fields), .compact-form :is(.form-grid, .crypto-fields) { gap: 8px; align-items: start; }
.modal-card :is(.pretty-select, .date-field), .edit-form :is(.pretty-select, .date-field), .compact-form :is(.pretty-select, .date-field) { min-width: 0; width: 100%; max-width: 100%; }
.modal-card .form-grid.two, .edit-form .form-grid.two, .compact-form .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.modal-card .form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.modal-card :is(input:not([type=hidden]):not([type=file]), select, textarea, .pretty-select-button, .date-field-button), .edit-form :is(input:not([type=hidden]):not([type=file]), select, textarea, .pretty-select-button, .date-field-button), .compact-form :is(input:not([type=hidden]):not([type=file]), select, textarea, .pretty-select-button, .date-field-button) { min-height: var(--control-height); padding-block: 8px; font-size: 14px; line-height: 1.4; font-weight: 400; border-radius: var(--radius); }
.modal-card :is(.pretty-select-button, .date-field-button), .edit-form :is(.pretty-select-button, .date-field-button), .compact-form :is(.pretty-select-button, .date-field-button) { height: var(--control-height); }
.modal-card .money-field, .edit-form .money-field, .compact-form .money-field { min-height: var(--control-height); border-color: var(--line); border-radius: var(--radius); }
.modal-card .money-field input:not([type=hidden]):not([type=file]), .edit-form .money-field input:not([type=hidden]):not([type=file]), .compact-form .money-field input:not([type=hidden]):not([type=file]) { min-height: calc(var(--control-height) - 2px); height: calc(var(--control-height) - 2px); border-radius: 0; }
.modal-card .money-field > span, .edit-form .money-field > span, .compact-form .money-field > span { padding-inline: 10px; font-weight: 500; }
.modal-card textarea, .edit-form textarea, .compact-form textarea { height: 64px; min-height: 64px; resize: vertical; }
.modal-card .attachment-field, .edit-form .attachment-field, .compact-form .attachment-field { gap: 4px; }
.modal-card .attachment-label, .edit-form .attachment-label, .compact-form .attachment-label { font-size: 12px; font-weight: 500; }
.modal-card .attachment-dropzone, .edit-form .attachment-dropzone, .compact-form .attachment-dropzone { grid-template-columns: 30px minmax(0, 1fr) auto; min-height: 52px; gap: 8px; padding: 8px; border-radius: var(--radius); }
.modal-card .attachment-icon, .edit-form .attachment-icon, .compact-form .attachment-icon { width: 30px; height: 30px; border-radius: var(--radius); }
.modal-card .attachment-copy small, .edit-form .attachment-copy small, .compact-form .attachment-copy small { white-space: normal; font-weight: 400; }
.modal-card .attachment-copy strong, .edit-form .attachment-copy strong, .compact-form .attachment-copy strong { font-size: 13px; font-weight: 500; }
.modal-card p.muted, .modal-card label > small { margin: 0; font-size: 12px; line-height: 1.4; font-weight: 400; }
.modal-card .patrimony-form-section { gap: 8px; padding: 8px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
.modal-card .modal-head + .patrimony-form-section { border-top: 0; padding-top: 0; }
.modal-card .patrimony-form-section-title { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0; }
.modal-card :is(.role-help, .users-security-summary) { gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-subtle); font-weight: 400; }
.modal-card .modal-actions { position: sticky; bottom: -16px; z-index: 2; display: flex; align-items: center; justify-content: end; gap: 8px; margin: 4px -16px -16px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.modal-card .modal-actions > button { min-height: var(--control-height); width: auto; margin: 0; padding: 8px 14px; border-radius: var(--radius); font-size: 14px; font-weight: 600; }
.modal-card .modal-actions .modal-submit { min-width: 130px; }
.edit-form [data-bank-fields] > label:last-child { grid-column: 1 / -1; }
.edit-layout { align-items: start; }
.edit-form > button[type=submit] { justify-self: end; min-width: 150px; margin-top: 4px; }
.user-crypto-access { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--control-height); margin: 0; cursor: pointer; }
.user-crypto-access-create { justify-content: flex-start; }
.users-table .user-crypto-access input[type=checkbox], .modal-card .user-crypto-access input[type=checkbox] { width: 18px; min-width: 18px; height: 18px; min-height: 18px; margin: 0; padding: 0; accent-color: var(--brand); cursor: pointer; }
.user-crypto-access input[type=checkbox]:disabled { cursor: default; }
:is(.modal-card, .edit-form, .compact-form) :is(input, select, textarea):user-invalid, :is(.modal-card, .edit-form, .compact-form) [aria-invalid=true] { border-color: var(--red); }
:is(.modal-card, .edit-form, .compact-form) .money-field:has(input:user-invalid, input[aria-invalid=true]), :is(.modal-card, .edit-form, .compact-form) .pretty-select:has(select:user-invalid, select[aria-invalid=true]) .pretty-select-button { border-color: var(--red); }
@media (max-width: 600px) {
    .modal { padding: 8px; }
    .modal-card { max-height: calc(100dvh - 16px); padding: 12px; }
    .modal-card .modal-head { top: -12px; margin: -12px -12px 0; padding: 8px 12px; }
    .modal-card .modal-close { width: 44px; height: 44px; min-height: 44px; }
    .modal-card .modal-actions { bottom: -12px; margin: 4px -12px -12px; padding: 8px 12px; }
    .modal-card .modal-actions > button { flex: 1; min-width: 0; }
    .modal-card .form-grid.two, .modal-card .form-grid.three, .edit-form .form-grid.two, .compact-form .form-grid.two { grid-template-columns: minmax(0, 1fr); }
    .modal-card .attachment-clear, .edit-form .attachment-clear { min-height: 44px; }
    .edit-form > button[type=submit], .compact-form > button[type=submit] { width: 100%; }
}

/* Cards: monthly checklist and a separate, compact registry. */
.cards-tabs { display:flex; gap:24px; border-bottom:1px solid var(--line); }
.cards-tabs a { padding:10px 0; color:var(--muted); font-weight:600; text-decoration:none; border-bottom:2px solid transparent; }
.cards-tabs a[aria-current] { color:var(--brand); border-bottom-color:var(--brand); }
.cards-month-heading { display:flex; justify-content:space-between; align-items:center; gap:12px; }
.cards-month-heading h2 { margin:0 0 2px; font-size:20px; }
.cards-month-heading .muted { font-size:12px; }
.cards-metrics strong small { font-size:16px; font-weight:400; color:var(--muted); }
.cards-page .checklist-filters { grid-template-columns:minmax(140px,1.3fr) minmax(150px,1.2fr) minmax(140px,1fr) auto auto; gap:10px; }
.checklist-filters label { min-width:0; }
.checklist-filters .checklist-pending { display:flex; flex-direction:row; align-items:center; gap:8px; min-height:40px; white-space:nowrap; }
.checklist-pending input { width:18px; height:18px; margin:0; accent-color:var(--brand); }
.cards-list-scope { font-size:12px; margin:10px 0 8px; }
.cards-page .checklist-table { min-width:0; }
.checklist-table .invoice-col-date { width:104px; }
.checklist-table .invoice-col-money { width:142px; }
.checklist-table .invoice-col-status { width:110px; }
.checklist-table .invoice-col-files { width:140px; }
.checklist-table .invoice-col-actions { width:165px; }
.checklist-table .cards-money-cell { font-size:14px; white-space:nowrap; }
.checklist-table .invoice-files a { display:block; max-width:100%; font-size:12px; overflow-wrap:anywhere; line-height:1.5; }
.checklist-table .invoice-due-date small { font-size:11px; font-weight:400; }
.checklist-table .table-actions { flex-wrap:wrap; gap:4px; }
.checklist-table .invoice-actions .button { white-space:nowrap; }
.card-zero-action { border:0; background:none; color:var(--muted); font-size:12px; padding:6px; cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.card-zero-action:hover { color:var(--brand); }
.invoice-status.complete,.invoice-status.zero { color:var(--brand); background:var(--brand-soft); }
.invoice-status.missing,.invoice-status.attachment { color:var(--warning); background:var(--warning-soft); }
.cards-chart-panel summary { font-size:14px; font-weight:600; cursor:pointer; padding:4px 0; }
.cards-chart-panel[open] summary { margin-bottom:12px; }
.cards-catalog-filter { display:flex; align-items:end; justify-content:space-between; gap:12px; margin-bottom:16px; }
.cards-catalog-filter label { max-width:220px; }
.card-catalog-entity + .card-catalog-entity { margin-top:24px; }
.card-catalog-entity > .card-entity-heading { padding:10px 12px; background:var(--brand-soft); }
.card-catalog-holder { margin-top:14px; }
.card-catalog-holder > .card-group-heading { padding:0 0 8px; }
.card-catalog-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.card-catalog-item { min-width:0; padding:14px; border:1px solid var(--line); border-radius:8px; display:flex; flex-direction:column; gap:10px; background:var(--panel); }
.card-catalog-item.is-archived { background:var(--surface-subtle); }
.card-catalog-bank { margin:0; color:var(--muted); font-size:12px; overflow-wrap:anywhere; }
.card-catalog-facts { margin:0; display:grid; grid-template-columns:1fr 1fr; gap:8px 12px; }
.card-catalog-facts > div:first-child { grid-column:1/-1; }
.card-catalog-facts dt,.card-pdf-secret small { display:block; font-size:12px; color:var(--muted); }
.card-catalog-facts dd { margin:2px 0 0; font-size:13px; font-variant-numeric:tabular-nums; }
.card-catalog-facts > div:first-child dd { font-size:18px; font-weight:600; overflow-wrap:anywhere; }
.card-pdf-secret { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:4px; font-size:13px; border-top:1px solid var(--line); padding-top:8px; }
.card-pdf-secret > span:first-child { min-width:0; flex:1; }
.card-pdf-secret output { display:block; overflow-wrap:anywhere; white-space:pre-wrap; user-select:text; }
.card-pdf-secret output[hidden] { display:none; }
.secret-error { flex-basis:100%; color:var(--red); font-size:12px; }
.card-catalog-actions { display:flex; justify-content:space-between; gap:6px; margin-top:auto; }
.card-catalog-actions .button { display:inline-flex; align-items:center; gap:6px; }
.card-catalog-actions svg { width:14px; height:14px; }
.card-password-fields { border:0; border-top:1px solid var(--line); padding:10px 0 0; margin:0; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.card-password-fields legend { font-weight:600; font-size:13px; padding:0 6px 0 0; }
.card-password-fields label[hidden] { display:none; }
.invoice-form-hint,.invoice-existing-files small { font-size:12px; margin:0; }
.invoice-existing-files { display:grid; gap:4px; font-size:12px; overflow-wrap:anywhere; }
@media(max-width:1000px) {
    .card-catalog-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .cards-page .checklist-filters { grid-template-columns:1fr 1fr 1fr; }
    .checklist-table .invoice-col-files { width:110px; }
    .checklist-table .invoice-col-actions { width:130px; }
}
@media(max-width:760px) {
    .cards-page .checklist-table,.checklist-table tbody { display:block; width:100%; }
    .checklist-table colgroup,.checklist-table thead { display:none; }
    .cards-page .checklist-table .card-invoice-item { display:grid; grid-template-columns:1fr 1fr; padding:12px 0; gap:8px 12px; border-bottom:1px solid var(--line); }
    .cards-page .checklist-table .card-invoice-item td { display:block; padding:0; border:0; min-width:0; text-align:left; }
    .checklist-table .invoice-card-name { grid-column:1/-1; }
    .checklist-table .card-invoice-item td[data-label]::before { content:attr(data-label); display:block; font-size:11px; font-weight:400; color:var(--muted); margin-bottom:3px; }
    .checklist-table .invoice-files { grid-column:1/-1; }
    .checklist-table .invoice-actions { grid-column:1/-1; }
    .checklist-table .table-actions { justify-content:flex-start; }
    .checklist-table .card-entity-row,.checklist-table .card-group-row { display:block; }
    .checklist-table :is(.card-entity-row,.card-group-row) th { display:block; padding:10px 8px; }
    .checklist-table .card-group-heading > div { display:block; }
    .cards-month-heading { align-items:start; }
    .cards-month-heading .cards-month-nav { flex-direction:column; gap:4px; }
}
@media(max-width:600px) {
    .card-catalog-grid { grid-template-columns:minmax(0,1fr); }
    .cards-page .checklist-filters { grid-template-columns:1fr 1fr; }
    .checklist-filters > label:first-of-type { grid-column:1/-1; }
    .cards-tabs { gap:18px; font-size:13px; }
    .card-password-fields { grid-template-columns:1fr; }
    .card-catalog-item { padding:12px; }
}
.cards-metrics strong small { display:inline; }
.checklist-filters .checklist-pending input[type="checkbox"] { flex:0 0 18px; width:18px; height:18px; min-width:18px; min-height:18px; padding:0; }
.card-pdf-secret .icon-action { color:var(--brand); background:var(--brand-soft); border:1px solid var(--line); }
@media(max-width:760px) {
    .cards-page .checklist-table .card-invoice-item { grid-template-areas:"card card" "due amount" "state state" "files files" "actions actions"; }
    .cards-page .checklist-table td { grid-row:auto; grid-column:auto; }
    .cards-page .checklist-table .invoice-card-name { grid-area:card; }
    .cards-page .checklist-table .invoice-due-date { grid-area:due; }
    .cards-page .checklist-table .cards-money-cell { grid-area:amount; }
    .cards-page .checklist-table .invoice-state { grid-area:state; }
    .cards-page .checklist-table .invoice-files { grid-area:files; }
    .cards-page .checklist-table .invoice-actions { grid-area:actions; }
}

/* Compact cards workspace: keep the information, remove tall stacked blocks. */
.cards-page.module-page { gap:8px; }
.cards-page .cards-page-head { gap:8px; }
.cards-page .cards-page-head h1 { font-size:24px; }
.cards-page .cards-page-head .context-note { font-size:12px; margin-top:2px; }
.cards-page .cards-tabs { gap:20px; }
.cards-page .cards-tabs a { padding:6px 0; font-size:13px; }
.cards-page .panel { padding:10px; }
.cards-page .cards-month-heading { gap:8px; }
.cards-page .cards-month-heading > div:first-child { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.cards-page .cards-month-heading h2 { font-size:17px; margin:0; }
.cards-page .cards-month-heading .muted { font-size:11px; }
.cards-page .cards-month-nav .button { min-height:28px; padding:4px 9px; font-size:12px; }
.cards-page .cards-metrics { gap:0; border:1px solid var(--line); border-radius:6px; background:var(--panel); grid-template-columns:1.6fr 1fr 1fr 1fr; }
.cards-page .cards-metrics article { flex-direction:row; align-items:center; justify-content:space-between; gap:8px; padding:8px 10px; min-height:0; border:0; border-radius:0; background:transparent; text-align:left; }
.cards-page .cards-metrics article + article { border-left:1px solid var(--line); }
.cards-page .cards-metrics article > span { font-size:12px; }
.cards-page .cards-metrics strong,.cards-page .cards-metrics .metric-money-stack { margin:0; font-size:17px; line-height:1.2; }
.cards-page .cards-metrics strong small { display:inline; font-size:12px; }
.cards-page .cards-chart-panel { padding:8px 10px; }
.cards-page .cards-chart-panel summary { padding:0; font-size:12px; font-weight:600; }
.cards-page .cards-chart-panel[open] summary { margin-bottom:4px; }
.cards-page .cards-chart-panel .cards-chart-legend { position:absolute; top:8px; right:10px; font-size:11px; }
.cards-page .cards-chart-panel canvas { height:160px; }
.cards-page .checklist-filters { padding:0; gap:8px; border:0; background:transparent; }
.cards-page .cards-list-scope { margin:4px 0; font-size:11px; }
.cards-page .checklist-table :is(th,td) { padding:5px 6px; }
.cards-page .card-entity-heading strong { font-size:13px; }
.cards-page .card-entity-heading > div { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; }
.cards-page .card-entity-heading small { font-size:11px; }
.cards-page .card-entity-heading > span,.cards-page .card-group-heading > span { font-size:11px; }
.cards-page .card-group-heading strong { font-size:12px; }
.cards-page .card-group-heading > div > span { font-size:11px; }
.cards-page .checklist-table .card-group-row th { padding:4px 6px 2px 16px; }
.cards-page .checklist-table .card-identity-text strong { font-size:13px; }
.cards-page .checklist-table .card-identity-text small { font-size:11px; }
.cards-page .checklist-table .card-identity .bank-avatar { width:24px; height:24px; }
.cards-page .checklist-table .cards-money-cell { font-size:13px; }
.cards-page .checklist-table .invoice-status { padding:2px 6px; font-size:11px; }
.cards-page .checklist-table .invoice-files a { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:11px; line-height:1.35; }
.cards-page .checklist-table .invoice-due-date small { display:inline; margin-left:4px; font-size:10px; }
.cards-page .checklist-table .icon-action { width:28px; height:28px; min-height:28px; padding:5px; }
.cards-page .checklist-table .ui-icon { width:16px; height:16px; }
.cards-page .checklist-table .table-actions { flex-wrap:nowrap; gap:4px; }
.cards-page .card-zero-action { padding:4px; font-size:11px; white-space:nowrap; }
.cards-page .cards-catalog-filter { margin-bottom:8px; padding:0; border:0; background:transparent; }
.cards-page .cards-catalog-filter > span { font-size:11px; }
.cards-page .card-catalog-entity + .card-catalog-entity { margin-top:12px; }
.cards-page .card-catalog-entity > .card-entity-heading { padding:5px 8px; }
.cards-page .card-catalog-holder { margin-top:6px; }
.cards-page .card-catalog-holder > .card-group-heading { padding:0 0 4px; }
.cards-page .card-catalog-grid { gap:8px; align-items:start; }
.cards-page .card-catalog-item { padding:8px; gap:6px; border-radius:6px; }
.cards-page .card-catalog-item .card-identity { gap:6px; }
.cards-page .card-catalog-item .card-identity .bank-avatar { width:24px; height:24px; }
.cards-page .card-catalog-item .card-identity-text strong { font-size:13px; }
.cards-page .card-catalog-item .card-identity-text small { font-size:11px; line-height:1.3; }
.cards-page .card-catalog-facts { grid-template-columns:minmax(0,1.5fr) minmax(0,1fr) minmax(0,1fr); gap:4px 8px; }
.cards-page .card-catalog-facts > div:first-child { grid-column:auto; }
.cards-page .card-catalog-facts dt { font-size:10px; }
.cards-page .card-catalog-facts dd { margin:0; font-size:12px; line-height:1.4; }
.cards-page .card-catalog-facts > div:first-child dd { font-size:14px; white-space:nowrap; }
.cards-page .card-catalog-footer { display:flex; align-items:center; justify-content:space-between; gap:6px; border-top:1px solid var(--line); padding-top:4px; }
.cards-page .card-pdf-secret { flex:1; min-width:0; border:0; padding:0; gap:2px; font-size:11px; }
.cards-page .card-pdf-secret > span:first-child { flex:initial; }
.cards-page .card-pdf-secret small { display:inline; font-size:10px; margin-right:3px; }
.cards-page .card-pdf-secret [data-secret-state] { display:inline; }
.cards-page .card-pdf-secret [data-secret-state][hidden] { display:none; }
.cards-page .secret-error:empty { display:none; }
.cards-page .card-catalog-actions { flex:0 0 auto; gap:4px; margin:0; }
.cards-page .card-catalog-footer .icon-action { width:28px; height:28px; min-height:28px; padding:5px; }
.cards-page .card-catalog-footer .ui-icon { width:16px; height:16px; }
@media(max-width:1000px) {
    .cards-page .cards-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
    .cards-page .cards-metrics article:nth-child(3) { border-left:0; }
    .cards-page .cards-metrics article:nth-child(n+3) { border-top:1px solid var(--line); }
}
@media(max-width:760px) {
    .cards-page .checklist-table .card-invoice-item { grid-template-areas:"card card" "due amount" "state actions" "files files"; padding:8px 0; gap:4px 8px; }
    .cards-page .checklist-table .card-invoice-item td { padding:0; }
    .cards-page .checklist-table .invoice-actions .table-actions { justify-content:flex-end; }
    .cards-page .checklist-table .card-invoice-item td[data-label]::before { margin:0; font-size:10px; }
    .cards-page .checklist-table .invoice-state::before,.cards-page .checklist-table .invoice-files:has(> .muted)::before { display:none; }
    .cards-page .checklist-table .invoice-files:has(> .muted) { display:none; }
    .cards-page .checklist-table .icon-action,.cards-page .card-catalog-footer .icon-action { width:36px; height:36px; min-height:36px; }
    .cards-page .checklist-table .card-zero-action { min-height:36px; }
    .cards-page .cards-month-heading > div:first-child { display:block; }
    .cards-page .cards-month-heading .cards-month-nav { flex-direction:row; flex-wrap:nowrap; }
    .cards-page .cards-month-heading .cards-month-nav .button { min-height:36px; }
    .cards-page .cards-metrics article { padding:6px 8px; }
    .cards-page .cards-metrics article > span { font-size:11px; }
    .cards-page .cards-metrics strong,.cards-page .cards-metrics .metric-money-stack { font-size:15px; }
    .cards-page .cards-chart-panel canvas { height:140px; }
    .cards-page .cards-chart-panel .cards-chart-legend { position:static; margin:0; font-size:10px; }
}
.cards-page .card-catalog-actions .icon-action:not(.blue) { background:var(--panel); color:var(--muted); border:1px solid var(--line); }
@media(max-width:600px) {
    .cards-page .checklist-filters > button[type=submit] { grid-column:auto; }
}

/* Card statements remain in the normal monthly card workflow. */
.card-credit-conditions[hidden], [data-statement-new][hidden], [data-statement-link][hidden] { display: none; }
.card-prepaid-facts { margin: 8px 0; color: var(--muted); font-size: 12px; }
.card-statement-item .cards-money-cell small { display: block; font-size: 11px; font-weight: 400; color: var(--muted); white-space: normal; }
.card-statement-page .panel { margin: 0; min-width: 0; }
.statement-note { margin: 0; font-size: 12px; }
.statement-table-scroll { width: 100%; overflow-x: auto; }
.statement-table, .statement-review-table { width: 100%; table-layout: fixed; }
.statement-table th:nth-child(1) { width: 12%; }
.statement-table th:nth-child(2) { width: 29%; }
.statement-table th:nth-child(3) { width: 18%; }
.statement-table th:nth-child(4) { width: 41%; }
.statement-table td, .statement-review-table td { vertical-align: top; overflow-wrap: anywhere; padding: 12px 10px; }
.statement-table td strong, .statement-review-table td strong { font-size: 13px; }
.statement-id, .statement-decision small, .statement-review-table small { display: block; color: var(--muted); font-size: 11px; margin-top: 4px; }
.statement-id { font-variant-numeric: tabular-nums; }
.statement-decision label { display: grid; gap: 4px; margin-bottom: 8px; font-size: 12px; }
.statement-decision input, .statement-decision select { width: 100%; min-width: 0; min-height: 40px; }
.statement-decision .statement-ack { display: flex; gap: 8px; align-items: flex-start; }
.statement-ack input { width: 16px; min-height: 16px; flex: 0 0 16px; }
.statement-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 12px; }
.statement-toolbar label { min-width: 200px; }
.statement-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.statement-linked-item { border-top: 1px solid var(--line); padding: 12px 0; }
.statement-linked-item summary { cursor: pointer; font-size: 13px; overflow-wrap: anywhere; }
.statement-linked-item form { margin-top: 12px; }
.statement-metrics strong { font-variant-numeric: tabular-nums; }
@media (max-width: 767px) {
    .statement-toolbar { display: grid; grid-template-columns: 1fr; }
    .statement-toolbar label { min-width: 0; }
    .statement-table thead { display: none; }
    .statement-table, .statement-table tbody, .statement-table tr, .statement-table td { display: block; width: 100%; }
    .statement-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
    .statement-table td { border: 0; padding: 6px 0; text-align: left; }
    .statement-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
    .statement-table td:first-child { font-size: 12px; }
    .statement-review-table { min-width: 650px; }
    .statement-actions { justify-content: flex-start; }
}
@media (max-width: 767px) {
    .card-statement-page .table-scroll .statement-table { min-width: 0; }
}
