/* ============================================================
   Fiance — Design System
   Layers: reset → tokens → base → components → utilities
   ============================================================ */

@layer reset, tokens, base, components, utilities;

/* ---------- reset ---------- */
@layer reset {
    *, *::before, *::after { box-sizing: border-box; }
    * { margin: 0; padding: 0; }
    html, body { height: 100%; }
    body {
        line-height: 1.5;
        -webkit-font-smoothing: antialiased;
        font-synthesis: none;
    }
    img, svg, video { display: block; max-width: 100%; }
    button, input, select, textarea { font: inherit; color: inherit; }
    button { cursor: pointer; background: none; border: 0; }
    a { color: inherit; text-decoration: none; }
    table { border-collapse: collapse; width: 100%; }
}

/* ---------- tokens ---------- */
@layer tokens {
    :root {
        /* Spacing */
        --space-1: 4px;
        --space-2: 8px;
        --space-3: 12px;
        --space-4: 16px;
        --space-5: 20px;
        --space-6: 24px;
        --space-8: 32px;
        --space-10: 40px;
        --space-12: 48px;
        --space-16: 64px;

        /* Type scale */
        --text-xs: 0.75rem;
        --text-sm: 0.875rem;
        --text-base: 1rem;
        --text-lg: 1.125rem;
        --text-xl: 1.25rem;
        --text-2xl: 1.5rem;
        --text-3xl: 1.875rem;

        /* Font weights */
        --font-normal: 400;
        --font-medium: 500;
        --font-semibold: 600;
        --font-bold: 700;

        /* Radius */
        --radius-sm: 4px;
        --radius-md: 6px;
        --radius-lg: 8px;
        --radius-xl: 12px;
        --radius-full: 9999px;

        /* Shadows */
        --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.08), 0 2px 4px -2px rgb(0 0 0 / 0.06);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

        /* Transitions */
        --transition-fast: 100ms cubic-bezier(0.4, 0, 0.2, 1);
        --transition-base: 150ms cubic-bezier(0.4, 0, 0.2, 1);
        --transition-slow: 250ms cubic-bezier(0.4, 0, 0.2, 1);

        /* Fonts */
        --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
                     Roboto, Oxygen, Ubuntu, "Helvetica Neue", sans-serif;
        --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas,
                     "Liberation Mono", Menlo, monospace;

        /* Light theme colors */
        --color-bg: #ffffff;
        --color-bg-subtle: #fafafa;
        --color-bg-muted: #f4f4f5;
        --color-surface: #ffffff;
        --color-border: #e4e4e7;
        --color-border-strong: #d4d4d8;
        --color-fg: #18181b;
        --color-fg-muted: #71717a;
        --color-fg-subtle: #a1a1aa;

        --color-accent: #2563eb;
        --color-accent-hover: #1d4ed8;
        --color-accent-bg: #eff6ff;
        --color-accent-fg: #ffffff;

        --color-success: #16a34a;
        --color-success-bg: #f0fdf4;
        --color-warning: #d97706;
        --color-warning-bg: #fffbeb;
        --color-danger: #dc2626;
        --color-danger-bg: #fef2f2;
    }

    /* Dark theme (auto via media) */
    @media (prefers-color-scheme: dark) {
        :root:not([data-theme="light"]) {
            --color-bg: #09090b;
            --color-bg-subtle: #18181b;
            --color-bg-muted: #27272a;
            --color-surface: #18181b;
            --color-border: #27272a;
            --color-border-strong: #3f3f46;
            --color-fg: #fafafa;
            --color-fg-muted: #a1a1aa;
            --color-fg-subtle: #71717a;

            --color-accent: #3b82f6;
            --color-accent-hover: #2563eb;
            --color-accent-bg: #1e3a8a;
            --color-accent-fg: #ffffff;

            --color-success: #22c55e;
            --color-success-bg: #14532d;
            --color-warning: #f59e0b;
            --color-warning-bg: #78350f;
            --color-danger: #ef4444;
            --color-danger-bg: #7f1d1d;
        }
    }

    /* Dark theme (manual override) */
    [data-theme="dark"] {
        --color-bg: #09090b;
        --color-bg-subtle: #18181b;
        --color-bg-muted: #27272a;
        --color-surface: #18181b;
        --color-border: #27272a;
        --color-border-strong: #3f3f46;
        --color-fg: #fafafa;
        --color-fg-muted: #a1a1aa;
        --color-fg-subtle: #71717a;

        --color-accent: #3b82f6;
        --color-accent-hover: #2563eb;
        --color-accent-bg: #1e3a8a;
        --color-accent-fg: #ffffff;

        --color-success: #22c55e;
        --color-success-bg: #14532d;
        --color-warning: #f59e0b;
        --color-warning-bg: #78350f;
        --color-danger: #ef4444;
        --color-danger-bg: #7f1d1d;
    }
}

/* ---------- base ---------- */
@layer base {
    body {
        font-family: var(--font-sans);
        font-size: var(--text-base);
        background: var(--color-bg-subtle);
        color: var(--color-fg);
    }

    h1, h2, h3, h4 {
        font-weight: var(--font-semibold);
        line-height: 1.25;
        color: var(--color-fg);
    }
    h1 { font-size: var(--text-3xl); letter-spacing: -0.02em; }
    h2 { font-size: var(--text-xl); }
    h3 { font-size: var(--text-base); color: var(--color-fg-muted); font-weight: var(--font-medium); }

    p { color: var(--color-fg-muted); }

    a { color: var(--color-accent); transition: color var(--transition-fast); }
    a:hover { color: var(--color-accent-hover); }

    code {
        font-family: var(--font-mono);
        font-size: 0.9em;
        background: var(--color-bg-muted);
        padding: 0.1em 0.3em;
        border-radius: var(--radius-sm);
    }

    :focus-visible {
        outline: 2px solid var(--color-accent);
        outline-offset: 2px;
    }
}

/* ---------- components ---------- */
@layer components {
    /* === Layout === */
    .app-header {
        position: sticky;
        top: 0;
        z-index: 10;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        padding: var(--space-3) var(--space-6);
        display: flex;
        align-items: center;
        gap: var(--space-6);
        flex-wrap: wrap;
    }

    .brand {
        font-weight: var(--font-bold);
        font-size: var(--text-lg);
        color: var(--color-accent);
    }

    .main-nav {
        display: flex;
        gap: var(--space-1);
        flex: 1;
        flex-wrap: wrap;
    }

    .nav-link {
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius-md);
        font-size: var(--text-sm);
        color: var(--color-fg-muted);
        transition: background var(--transition-fast), color var(--transition-fast);
    }
    .nav-link:hover {
        background: var(--color-bg-muted);
        color: var(--color-fg);
    }
    .nav-link.active {
        background: var(--color-accent-bg);
        color: var(--color-accent);
    }

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

    .main-content {
        padding: var(--space-8) var(--space-6);
        max-width: 1280px;
        margin: 0 auto;
    }

    .page-header {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        margin-bottom: var(--space-6);
        gap: var(--space-4);
    }
    .page-header .subtitle {
        color: var(--color-fg-muted);
        font-size: var(--text-sm);
    }

    .section { margin-bottom: var(--space-10); }
    .section + .section { margin-top: var(--space-10); }

    /* === Cards === */
    .cards-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: var(--space-4);
    }

    .card {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        padding: var(--space-4) var(--space-5);
        transition: border-color var(--transition-fast), transform var(--transition-fast);
    }
    .card:hover { border-color: var(--color-border-strong); }

    .card-label {
        font-size: var(--text-xs);
        font-weight: var(--font-medium);
        color: var(--color-fg-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    .card-value {
        font-size: var(--text-2xl);
        font-weight: var(--font-semibold);
        margin-top: var(--space-2);
        font-variant-numeric: tabular-nums;
    }
    .card-sub {
        font-size: var(--text-sm);
        color: var(--color-fg-muted);
        margin-top: var(--space-1);
    }

    /* === Tables === */
    .table-wrap {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        overflow: hidden;
    }
    .table {
        font-size: var(--text-sm);
    }
    .table th {
        text-align: left;
        font-weight: var(--font-medium);
        font-size: var(--text-xs);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        color: var(--color-fg-muted);
        padding: var(--space-3) var(--space-4);
        background: var(--color-bg-subtle);
        border-bottom: 1px solid var(--color-border);
        white-space: nowrap;
    }
    .table th[data-sort] { cursor: pointer; user-select: none; }
    .table th[data-sort]:hover { color: var(--color-fg); }
    .table th[data-sort]::after { content: " ⇅"; opacity: 0.3; font-size: 0.85em; }
    .table th[data-sort="asc"]::after { content: " ↑"; opacity: 1; color: var(--color-accent); }
    .table th[data-sort="desc"]::after { content: " ↓"; opacity: 1; color: var(--color-accent); }
    .table td {
        padding: var(--space-3) var(--space-4);
        border-bottom: 1px solid var(--color-border);
        font-variant-numeric: tabular-nums;
    }
    .table tr:last-child td { border-bottom: none; }
    .table tr.hidden { display: none; }
    .text-end { text-align: right; }
    .text-muted { color: var(--color-fg-muted); }
    .text-danger { color: var(--color-danger); }
    .text-success { color: var(--color-success); }
    .nowrap { white-space: nowrap; }

    /* === Forms === */
    .form-card {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        padding: var(--space-5) var(--space-6);
        max-width: 720px;
    }
    .form-grid {
        display: grid;
        gap: var(--space-4);
    }
    .form-grid.cols-2 { grid-template-columns: 1fr 1fr; }
    .form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
    .form-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
    @media (max-width: 640px) {
        .form-grid.cols-2, .form-grid.cols-3, .form-grid.cols-4 { grid-template-columns: 1fr; }
    }

    .field {
        display: flex;
        flex-direction: column;
        gap: var(--space-1);
    }
    .field label {
        font-size: var(--text-sm);
        font-weight: var(--font-medium);
        color: var(--color-fg);
    }
    .field .hint {
        font-size: var(--text-xs);
        color: var(--color-fg-muted);
    }

    .input, .select, .textarea {
        font-size: var(--text-sm);
        padding: var(--space-2) var(--space-3);
        border: 1px solid var(--color-border-strong);
        border-radius: var(--radius-md);
        background: var(--color-surface);
        color: var(--color-fg);
        transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
        width: 100%;
    }
    .input:focus, .select:focus, .textarea:focus {
        outline: none;
        border-color: var(--color-accent);
        box-shadow: 0 0 0 3px var(--color-accent-bg);
    }
    .input::placeholder { color: var(--color-fg-subtle); }
    .input[type="date"] { font-family: inherit; }

    .form-actions {
        display: flex;
        gap: var(--space-2);
        margin-top: var(--space-5);
    }

    /* === Buttons === */
    .btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: var(--space-2);
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-sm);
        font-weight: var(--font-medium);
        border: 1px solid transparent;
        border-radius: var(--radius-md);
        transition: background var(--transition-fast), border-color var(--transition-fast),
                    color var(--transition-fast);
        white-space: nowrap;
    }
    .btn-primary {
        background: var(--color-accent);
        color: var(--color-accent-fg);
    }
    .btn-primary:hover { background: var(--color-accent-hover); }

    .btn-secondary {
        background: var(--color-surface);
        border-color: var(--color-border-strong);
        color: var(--color-fg);
    }
    .btn-secondary:hover { background: var(--color-bg-muted); }

    .btn-danger {
        background: var(--color-surface);
        border-color: var(--color-danger);
        color: var(--color-danger);
    }
    .btn-danger:hover {
        background: var(--color-danger);
        color: white;
    }

    .btn-ghost {
        background: transparent;
        color: var(--color-fg-muted);
        padding: var(--space-1) var(--space-2);
    }
    .btn-ghost:hover {
        background: var(--color-bg-muted);
        color: var(--color-fg);
    }

    .btn-sm { padding: var(--space-1) var(--space-3); font-size: var(--text-xs); }
    .btn-block { width: 100%; }

    .btn-icon {
        padding: var(--space-2);
        aspect-ratio: 1;
    }

    /* === Alert === */
    .alert {
        padding: var(--space-3) var(--space-4);
        border-radius: var(--radius-md);
        font-size: var(--text-sm);
        margin-bottom: var(--space-4);
        border: 1px solid;
    }
    .alert-error {
        background: var(--color-danger-bg);
        border-color: var(--color-danger);
        color: var(--color-danger);
    }

    /* === Progress bar === */
    .progress {
        background: var(--color-bg-muted);
        height: 6px;
        border-radius: var(--radius-full);
        overflow: hidden;
    }
    .col-progress { width: 30%; min-width: 160px; }
    .logout-form { display: inline; margin: 0; padding: 0; }
    .tx-filter-row { margin-bottom: var(--space-4); }
    .tx-filter-input { max-width: 320px; }
    .posting-line { font-size: var(--text-sm); line-height: 1.4; }

    .progress .bar {
        background: var(--color-accent);
        height: 100%;
        border-radius: var(--radius-full);
        transition: width var(--transition-slow);
    }

    /* === Login === */
    .login-page {
        display: grid;
        place-items: center;
        min-height: 80vh;
    }
    .login-card {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-xl);
        padding: var(--space-8);
        width: 360px;
        box-shadow: var(--shadow-md);
    }
    .login-card h1 {
        font-size: var(--text-2xl);
        margin-bottom: var(--space-1);
    }
    .login-card .subtitle {
        color: var(--color-fg-muted);
        font-size: var(--text-sm);
        margin-bottom: var(--space-6);
    }

    /* === Modal (uses native <dialog>) === */
    dialog.modal {
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        padding: 0;
        background: var(--color-surface);
        color: var(--color-fg);
        max-width: 480px;
        width: 90vw;
        box-shadow: var(--shadow-lg);
    }
    dialog.modal::backdrop { background: rgb(0 0 0 / 0.4); }
    dialog.modal .modal-header {
        padding: var(--space-5) var(--space-6);
        border-bottom: 1px solid var(--color-border);
    }
    dialog.modal .modal-header h2 { font-size: var(--text-lg); margin: 0; }
    dialog.modal .modal-body { padding: var(--space-5) var(--space-6); }
    dialog.modal .modal-footer {
        padding: var(--space-3) var(--space-6);
        border-top: 1px solid var(--color-border);
        display: flex;
        gap: var(--space-2);
        justify-content: flex-end;
    }

    /* === Toast === */
    .toast-stack {
        position: fixed;
        bottom: var(--space-6);
        right: var(--space-6);
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
        z-index: 100;
        pointer-events: none;
    }
    .toast {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        padding: var(--space-3) var(--space-4);
        font-size: var(--text-sm);
        box-shadow: var(--shadow-lg);
        min-width: 240px;
        max-width: 400px;
        pointer-events: auto;
        animation: slide-in var(--transition-base);
    }
    .toast.toast-success { border-color: var(--color-success); color: var(--color-success); }
    .toast.toast-error { border-color: var(--color-danger); color: var(--color-danger); }
    .toast.toast-info { border-color: var(--color-accent); color: var(--color-accent); }
    @keyframes slide-in {
        from { transform: translateX(100%); opacity: 0; }
        to { transform: translateX(0); opacity: 1; }
    }

    /* === Dynamic rows === */
    .dynamic-rows {
        display: flex;
        flex-direction: column;
        gap: var(--space-2);
    }
    .dynamic-row {
        display: grid;
        gap: var(--space-2);
        align-items: end;
    }
    .dynamic-row .field { gap: 0; }

    /* === Misc === */
    .stack { display: flex; flex-direction: column; gap: var(--space-3); }
    .row { display: flex; gap: var(--space-3); align-items: center; }
    .pill {
        display: inline-flex;
        align-items: center;
        padding: 2px var(--space-2);
        font-size: var(--text-xs);
        font-weight: var(--font-medium);
        border-radius: var(--radius-full);
        background: var(--color-bg-muted);
        color: var(--color-fg-muted);
    }
    .pill-success { background: var(--color-success-bg); color: var(--color-success); }
    .pill-warning { background: var(--color-warning-bg); color: var(--color-warning); }
    .pill-danger { background: var(--color-danger-bg); color: var(--color-danger); }
    .empty {
        padding: var(--space-8);
        text-align: center;
        color: var(--color-fg-muted);
        font-size: var(--text-sm);
        background: var(--color-bg-subtle);
        border: 1px dashed var(--color-border);
        border-radius: var(--radius-lg);
    }
}

/* ---------- utilities ---------- */
@layer utilities {
    .sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .text-muted { color: var(--color-fg-muted); }
    .text-sm { font-size: var(--text-sm); }
    .text-xs { font-size: var(--text-xs); }
    .nowrap { white-space: nowrap; }

    .mt-0 { margin-top: 0; }
    .mt-2 { margin-top: var(--space-2); }
    .mt-3 { margin-top: var(--space-3); }
    .mt-4 { margin-top: var(--space-4); }
    .mt-5 { margin-top: var(--space-5); }

    .self-start { align-self: flex-start; }

    .section {
        margin-top: var(--space-6);
    }
    .section:first-child { margin-top: 0; }
    .section > h2 {
        font-size: var(--text-lg);
        font-weight: var(--font-semibold);
        margin: 0 0 var(--space-3);
    }

    /* Dynamic-row column presets */
    .dynamic-row.cols-postings { grid-template-columns: 2fr 1fr 1fr auto; }
    .dynamic-row.cols-items { grid-template-columns: 2fr 1fr 1fr 1fr 1fr auto; }
    .dynamic-row.cols-shares { grid-template-columns: 2fr 1fr 1fr auto; }
}

/* ============================================================
   Transaction list — Receipt cards (M3-phase-3)
   Used on /transactions and dashboard "Последние транзакции".
   Base classes describe the full-detail card; modifiers --dash
   shrink it for the dashboard.
   ============================================================ */
@layer components {
    .tx-list {
        display: flex;
        flex-direction: column;
        gap: var(--space-3);
    }
    .tx-list--dash { gap: var(--space-2); }

    .tx-card {
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-lg);
        overflow: hidden;
        transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    }
    .tx-card:hover { border-color: var(--color-border-strong); }
    .tx-card--hidden { display: none; }
    .tx-card--highlight {
        border-color: var(--color-accent);
        box-shadow: 0 0 0 3px var(--color-accent-bg);
    }

    /* Dashboard variant — entire card is a link */
    a.tx-card--dash {
        display: block;
        text-decoration: none;
        color: inherit;
    }

    /* === Header (date · description · headline amount) === */
    .tx-card__head {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: var(--space-4);
        padding: var(--space-4) var(--space-5);
    }
    .tx-card__head--with-body { border-bottom: 1px solid var(--color-border); }

    .tx-card--dash .tx-card__head {
        padding: var(--space-2) var(--space-4);
        gap: var(--space-3);
        align-items: center;
    }

    .tx-card__head-left {
        display: flex;
        align-items: center;
        gap: var(--space-3);
        min-width: 0;
        flex: 1 1 auto;
    }

    .tx-date-badge {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        background: var(--color-bg-subtle);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-md);
        line-height: 1;
    }
    .tx-date-badge--sm { width: 36px; height: 36px; }
    .tx-date-day {
        font-size: var(--text-lg);
        font-weight: var(--font-semibold);
        line-height: 1;
        font-variant-numeric: tabular-nums;
    }
    .tx-date-badge--sm .tx-date-day { font-size: var(--text-base); }
    .tx-date-mon {
        font-size: var(--text-xs);
        color: var(--color-fg-muted);
        text-transform: uppercase;
        letter-spacing: 0.05em;
        margin-top: 2px;
    }
    .tx-date-badge--sm .tx-date-mon { font-size: 9px; }

    .tx-card__desc-block { min-width: 0; }
    .tx-card__desc {
        font-weight: var(--font-medium);
        line-height: 1.3;
        word-break: break-word;
    }
    .tx-card--dash .tx-card__desc {
        font-size: var(--text-sm);
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .tx-card__subline {
        font-size: var(--text-xs);
        color: var(--color-fg-muted);
        margin-top: 3px;
    }

    .tx-card__head-right {
        text-align: right;
        flex-shrink: 0;
    }
    .tx-headline {
        font-size: var(--text-xl);
        font-weight: var(--font-semibold);
        font-variant-numeric: tabular-nums;
        line-height: 1.2;
        white-space: nowrap;
    }
    .tx-headline--sm { font-size: var(--text-base); }
    .tx-headline--in { color: var(--color-success); }
    .tx-headline-meta {
        font-size: var(--text-xs);
        color: var(--color-fg-muted);
        margin-top: 3px;
    }

    /* === Body (line items) === */
    .tx-card__body {
        padding: var(--space-2) var(--space-5) var(--space-3);
    }
    .tx-card__body--dash {
        padding: var(--space-2) var(--space-4) var(--space-3) var(--space-4);
    }
    .tx-items {
        list-style: none;
        padding: 0;
        margin: 0;
    }
    .tx-item {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: var(--space-4);
        padding: 7px 0;
        align-items: baseline;
        border-bottom: 1px dashed var(--color-border);
        font-size: var(--text-sm);
        line-height: 1.4;
    }
    .tx-item:last-child { border-bottom: none; }
    .tx-item--hidden { display: none; }
    .tx-item--dash {
        padding: 3px 0;
        font-size: var(--text-xs);
        color: var(--color-fg-muted);
        border-bottom: none;
    }
    .tx-item__name {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .tx-item__qty {
        color: var(--color-fg-subtle);
        margin-left: var(--space-2);
        font-size: var(--text-xs);
        font-variant-numeric: tabular-nums;
    }
    .tx-item__total {
        font-variant-numeric: tabular-nums;
        color: var(--color-fg-muted);
        white-space: nowrap;
    }

    .tx-more-btn {
        display: block;
        width: 100%;
        margin-top: var(--space-2);
        padding: 6px 10px;
        background: transparent;
        border: 1px dashed var(--color-border-strong);
        color: var(--color-fg-muted);
        border-radius: var(--radius-md);
        font-size: var(--text-xs);
        cursor: pointer;
        text-align: center;
        transition: border-color var(--transition-fast), color var(--transition-fast);
    }
    .tx-more-btn:hover {
        border-color: var(--color-accent);
        color: var(--color-accent);
    }
    .tx-more-line {
        margin-top: 4px;
        font-size: var(--text-xs);
        color: var(--color-fg-subtle);
        font-style: italic;
    }

    /* === Footer (posting chips, full /transactions only) === */
    .tx-card__foot {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 10px;
        padding: var(--space-3) var(--space-5);
        border-top: 1px solid var(--color-border);
        background: var(--color-bg-subtle);
    }
    .tx-chip {
        display: inline-flex;
        align-items: baseline;
        gap: 6px;
        padding: 2px 10px;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: var(--radius-full);
        font-size: var(--text-xs);
        line-height: 1.4;
        white-space: nowrap;
    }
    .tx-chip__acc { color: var(--color-fg-muted); }
    .tx-chip__amt {
        font-variant-numeric: tabular-nums;
        font-weight: var(--font-medium);
    }
    .tx-chip__amt--neg { color: var(--color-danger); }
    .tx-chip__amt--pos { color: var(--color-success); }

    /* === Section header on dashboard with "все →" link === */
    .dash-section-head {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        margin-bottom: var(--space-3);
    }
    .dash-section-head h2 { margin: 0; }
    .dash-see-all {
        font-size: var(--text-sm);
        color: var(--color-accent);
    }
}
