/*
    pac-ledger.css — shared design system for the rebuilt PAC pages
    (Overview, Transaction History, Add New Transaction, Line 10 New/Edit).

    Deploy at /Content/css/pac-ledger.css and link it from each page:
        <link rel="stylesheet" href="~/Content/css/pac-ledger.css" />

    Every page's root element carries class="pac-page" — that's what scopes
    these rules. Each page's own id (e.g. id="l10-root") is still used by
    that page's script for element lookups, not for styling.
*/

@import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&family=Inter:wght@400;500;600;700&display=swap');

.pac-page, .pac-page * {
    box-sizing: border-box;
}

:root {
    --ink: #1c2b4a;
    --paper: #f6f3ea;
    --card: #fffdf8;
    --rule: #dcd4bf;
    --muted: #606672;
    --brass: #a9822f;
    --brass-text: #7d6023;
    --green: #2f6e4f;
    --rust: #9c4b3a;
    --navy2: #34518c;
    --sand: #c8a96a;
}

.pac-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--ink);
    background: var(--paper);
    padding: 28px clamp(16px, 3vw, 40px) 60px;
    line-height: 1.4;
}

    .pac-page .serif {
        font-family: 'Source Serif 4', Georgia, serif;
    }

    /* ---- page header ---- */
    .pac-page .pac-header {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 12px;
        border-bottom: 2px solid var(--ink);
        padding-bottom: 14px;
        margin-bottom: 26px;
    }

        .pac-page .pac-header h1 {
            font-family: 'Source Serif 4', Georgia, serif;
            font-weight: 700;
            font-size: clamp(22px, 3vw, 32px);
            margin: 0;
            letter-spacing: -0.01em;
        }

        .pac-page .pac-header .sub {
            color: var(--muted);
            font-size: 14px;
        }

            .pac-page .pac-header .sub b {
                color: var(--ink);
                font-weight: 600;
            }

        .pac-page .pac-header .actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }

    .pac-page .back-link {
        font-size: 13px;
        font-weight: 600;
        color: var(--brass-text);
        text-decoration: none;
    }

        .pac-page .back-link:hover {
            text-decoration: underline;
        }

    .pac-page .line-tag {
        display: inline-block;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        background: #f4e6e2;
        color: var(--rust);
        padding: 3px 9px;
        border-radius: 20px;
        margin-bottom: 8px;
    }

    /* ---- buttons ---- */
    .pac-page .btn {
        font-family: 'Inter', sans-serif;
        font-size: 13.5px;
        font-weight: 600;
        border: 1px solid var(--rule);
        background: var(--card);
        color: var(--ink);
        padding: 9px 16px;
        border-radius: 3px;
        cursor: pointer;
        text-decoration: none;
        display: inline-flex;
        align-items: center;
        gap: 6px;
    }

        .pac-page .btn:hover {
            border-color: var(--brass);
        }

        .pac-page .btn.primary {
            background: var(--ink);
            color: var(--card);
            border-color: var(--ink);
        }

            .pac-page .btn.primary:hover {
                background: #142140;
            }

        .pac-page .btn.danger-text {
            color: var(--rust);
        }

        .pac-page .btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

            .pac-page .btn:disabled:hover {
                border-color: var(--rule);
                background: var(--card);
            }

        .pac-page .btn.primary:disabled:hover {
            background: var(--ink);
        }

        /* collapsible toggle button (e.g. Filters) with a count badge */
        .pac-page .btn.filter-toggle.active {
            border-color: var(--brass);
            background: #f1ede1;
        }

        .pac-page .btn .filter-count {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 16px;
            height: 16px;
            padding: 0 4px;
            margin-left: 5px;
            background: var(--brass-text);
            color: #fff;
            font-size: 10.5px;
            font-weight: 700;
            border-radius: 20px;
        }

    /* ---- generic ledger-tab card ---- */
    .pac-page .ov-card {
        background: var(--card);
        border: 1px solid var(--rule);
        border-radius: 3px;
        position: relative;
        padding: 20px 22px 22px 26px;
        margin-bottom: 20px;
        box-shadow: 0 1px 2px rgba(28, 43, 74, 0.04);
    }

        .pac-page .ov-card::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 5px;
            background: var(--tab-color, var(--brass));
            border-radius: 3px 0 0 3px;
        }

        .pac-page .ov-card.tab-green {
            --tab-color: var(--green);
        }

        .pac-page .ov-card.tab-rust {
            --tab-color: var(--rust);
        }

        .pac-page .ov-card.tab-brass {
            --tab-color: var(--brass);
        }

        .pac-page .ov-card.tab-navy {
            --tab-color: var(--navy2);
        }

        .pac-page .ov-card h2 {
            font-family: 'Source Serif 4', Georgia, serif;
            font-size: 18px;
            font-weight: 600;
            margin: 0 0 4px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .pac-page .ov-card .ov-card-note {
            font-size: 12.5px;
            color: var(--muted);
            margin-bottom: 14px;
        }

    /* single-form card used by New/Edit-style pages, narrower & centered */
    .pac-page .form-wrap {
        max-width: 680px;
        margin: 0 auto;
    }

    .pac-page .form-card {
        background: var(--card);
        border: 1px solid var(--rule);
        border-radius: 3px;
        padding: 26px 30px 30px;
        position: relative;
    }

        .pac-page .form-card::before {
            content: "";
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 5px;
            background: var(--tab-color, var(--brass));
            border-radius: 3px 0 0 3px;
        }

        .pac-page .form-card.tab-green {
            --tab-color: var(--green);
        }

        .pac-page .form-card.tab-rust {
            --tab-color: var(--rust);
        }

        .pac-page .form-card.tab-brass {
            --tab-color: var(--brass);
        }

        .pac-page .form-card h2 {
            font-family: 'Source Serif 4', Georgia, serif;
            font-size: 19px;
            font-weight: 600;
            margin: 0 0 4px;
        }

        .pac-page .form-card .form-intro {
            color: var(--muted);
            font-size: 13.5px;
            margin: 0 0 22px;
        }

    /* ---- grid helpers ---- */
    .pac-page .ov-grid {
        display: grid;
        gap: 20px;
    }

        .pac-page .ov-grid.cols-3 {
            grid-template-columns: repeat(3, 1fr);
        }

        .pac-page .ov-grid.cols-2 {
            grid-template-columns: repeat(2, 1fr);
        }

@media (max-width: 900px) {
    .pac-page .ov-grid.cols-3, .pac-page .ov-grid.cols-2 {
        grid-template-columns: 1fr;
    }
}

/* ---- account tiles (Overview) ---- */
.pac-page .ov-acct-tile {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 16px 18px;
}

    .pac-page .ov-acct-tile a {
        color: var(--brass-text);
        text-decoration: none;
        font-weight: 600;
        font-size: 13px;
        letter-spacing: 0.02em;
        text-transform: uppercase;
    }

        .pac-page .ov-acct-tile a:hover {
            text-decoration: underline;
        }

.pac-page .ov-acct-balance {
    font-family: 'Source Serif 4', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    margin: 6px 0 2px;
    font-variant-numeric: tabular-nums;
}

.pac-page .ov-acct-balance-label {
    color: var(--muted);
    font-size: 12px;
}

.pac-page .ov-acct-tile-negative {
    border-color: var(--rust);
    border-width: 2px;
    background: #fdf3f0;
}

.pac-page .ov-acct-balance.negative {
    color: var(--rust);
}

.pac-page .ov-acct-tile-negative .ov-acct-balance-label {
    color: var(--rust);
    font-weight: 700;
}

/* ---- ledger rows (summary lists) ---- */
.pac-page .ov-ledger-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 11px 0;
    border-bottom: 1px dashed var(--rule);
}

    .pac-page .ov-ledger-row:last-child {
        border-bottom: none;
    }

    .pac-page .ov-ledger-row .lbl {
        font-weight: 500;
        font-size: 14px;
    }

    .pac-page .ov-ledger-row .desc {
        display: block;
        color: var(--muted);
        font-size: 12px;
        margin-top: 2px;
    }

    .pac-page .ov-ledger-row .amt {
        font-family: 'Source Serif 4', Georgia, serif;
        font-weight: 700;
        font-size: 17px;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

/* ---- tabs / mode toggle ---- */
.pac-page .ov-tabs, .pac-page .mode-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--rule);
}

.pac-page .ov-tab-btn, .pac-page .mode-btn {
    font-family: 'Inter', sans-serif;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: none;
    border: none;
    padding: 8px 4px;
    margin-right: 18px;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transform: translateY(1px);
}

    .pac-page .ov-tab-btn:hover, .pac-page .mode-btn:hover {
        color: var(--ink);
    }

    .pac-page .ov-tab-btn.active, .pac-page .mode-btn.active {
        color: var(--ink);
        border-bottom-color: var(--brass);
    }

.pac-page .mode-panel {
    display: none;
}

    .pac-page .mode-panel.active {
        display: block;
    }

/* ---- detail layout: table + donut (Overview) ---- */
.pac-page .ov-detail-layout {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 26px;
    align-items: start;
}

@media (max-width: 820px) {
    .pac-page .ov-detail-layout {
        grid-template-columns: 1fr;
    }
}

.pac-page .ov-subtable {
    width: 100%;
    margin-bottom: 18px;
}

    .pac-page .ov-subtable caption {
        caption-side: top;
        text-align: left;
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: 0.06em;
        text-transform: uppercase;
        color: var(--muted);
        padding-bottom: 6px;
        border-bottom: 1px solid var(--rule);
        margin-bottom: 2px;
    }

    .pac-page .ov-subtable td {
        padding: 8px 4px;
        font-size: 14px;
        border-bottom: 1px dashed var(--rule);
    }

    .pac-page .ov-subtable tr:last-child td {
        border-bottom: none;
    }

    .pac-page .ov-subtable td.num {
        text-align: right;
        font-family: 'Source Serif 4', Georgia, serif;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
    }

/* ---- donut (pure CSS conic-gradient) ---- */
.pac-page .ov-donut-box {
    background: #f1ede1;
    border-radius: 8px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}

.pac-page .ov-donut {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: conic-gradient(var(--slices, #ccc 0deg 360deg));
    position: relative;
    flex-shrink: 0;
}

    .pac-page .ov-donut::after {
        content: "";
        position: absolute;
        inset: 22px;
        border-radius: 50%;
        background: #f1ede1;
    }

.pac-page .ov-legend {
    width: 100%;
    font-size: 13px;
}

    .pac-page .ov-legend .row {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
    }

    .pac-page .ov-legend .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%;
        flex-shrink: 0;
    }

    .pac-page .ov-legend .row span.pct {
        margin-left: auto;
        font-weight: 600;
    }

/* ---- collapsible filter panel (Transaction History) ---- */
.pac-page .filter-card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 18px 20px;
    margin-bottom: 20px;
    position: relative;
    display: none;
}

    .pac-page .filter-card.open {
        display: block;
    }

    .pac-page .filter-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 5px;
        background: var(--brass);
        border-radius: 3px 0 0 3px;
    }

.pac-page .filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    align-items: end;
}

/* ---- results card ---- */
.pac-page .results-card {
    background: var(--card);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 18px 20px 20px;
    position: relative;
}

    .pac-page .results-card::before {
        content: "";
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 5px;
        background: var(--navy2);
        border-radius: 3px 0 0 3px;
    }

    .pac-page .results-card h2 {
        font-family: 'Source Serif 4', Georgia, serif;
        font-size: 18px;
        font-weight: 600;
        margin: 0 0 14px;
    }

/* ---- data table (sortable / paginated) ---- */
.pac-page .ov-datatable-wrap {
    overflow-x: auto;
}

.pac-page table.ov-datatable {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

    .pac-page table.ov-datatable thead th {
        text-align: left;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--muted);
        padding: 8px 10px;
        border-bottom: 2px solid var(--ink);
        cursor: pointer;
        white-space: nowrap;
        user-select: none;
    }

        .pac-page table.ov-datatable thead th:hover {
            color: var(--ink);
        }

        .pac-page table.ov-datatable thead th .arrow {
            opacity: 0.4;
            margin-left: 3px;
        }

        .pac-page table.ov-datatable thead th.sorted .arrow {
            opacity: 1;
            color: var(--brass);
        }

    .pac-page table.ov-datatable tbody td {
        padding: 9px 10px;
        border-bottom: 1px solid var(--rule);
        vertical-align: top;
    }

    .pac-page table.ov-datatable tbody tr:hover {
        background: #f1ede1;
    }

    /* Sticky column (e.g. row actions) — stays pinned to the right edge of the
   horizontally-scrolling table so it never requires scrolling to reach,
   and the row you're on doesn't get lost while scrolling to find it. */
    .pac-page table.ov-datatable th.ov-col-sticky,
    .pac-page table.ov-datatable td.ov-col-sticky {
        position: sticky;
        right: 0;
        background: var(--card);
        box-shadow: -6px 0 6px -6px rgba(28, 43, 74, 0.25);
    }

    .pac-page table.ov-datatable thead th.ov-col-sticky {
        z-index: 3;
        background: var(--card);
    }

    .pac-page table.ov-datatable tbody td.ov-col-sticky {
        z-index: 1;
    }

    .pac-page table.ov-datatable tbody tr:hover td.ov-col-sticky {
        background: #f1ede1;
    }

    /* Persistent row highlight (click-to-select) — a different color from the
   hover state so a clicked row stays visually distinct even after the
   mouse moves away. */
    .pac-page table.ov-datatable tbody tr.row-selected {
        background: #e7edf7;
    }

        .pac-page table.ov-datatable tbody tr.row-selected:hover {
            background: #dbe4f3;
        }

        .pac-page table.ov-datatable tbody tr.row-selected td.ov-col-sticky {
            background: #e7edf7;
        }

        .pac-page table.ov-datatable tbody tr.row-selected:hover td.ov-col-sticky {
            background: #dbe4f3;
        }

    /* Flagged rows ("worth a second look") — subtle amber tint + left accent,
   distinct from both the hover and row-selected colors so all three can
   be told apart if they overlap. */
    .pac-page table.ov-datatable tbody tr.row-flagged {
        background: #fbf3e2;
        box-shadow: inset 3px 0 0 var(--brass);
    }

        .pac-page table.ov-datatable tbody tr.row-flagged:hover {
            background: #f7ead0;
        }

        .pac-page table.ov-datatable tbody tr.row-flagged.row-selected {
            background: #f3ecdd;
            box-shadow: inset 3px 0 0 var(--brass), inset 0 0 0 1px #c9d6ec;
        }

        .pac-page table.ov-datatable tbody tr.row-flagged td.ov-col-sticky {
            background: #fbf3e2;
        }

        .pac-page table.ov-datatable tbody tr.row-flagged:hover td.ov-col-sticky {
            background: #f7ead0;
        }

        .pac-page table.ov-datatable tbody tr.row-flagged.row-selected td.ov-col-sticky {
            background: #f3ecdd;
        }

.pac-page .flag-btn {
    border: none;
    background: none;
    padding: 6px;
    margin-left: 0;
    cursor: pointer;
    color: var(--brass-text);
    font-size: 13px;
    vertical-align: middle;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
}

    .pac-page .flag-btn:hover {
        color: var(--rust);
    }

.pac-page table.ov-datatable td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.pac-page .ov-empty-row td {
    text-align: center;
    color: var(--muted);
    padding: 24px;
    font-style: italic;
}

.pac-page .ov-table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 12.5px;
    color: var(--muted);
    flex-wrap: wrap;
    gap: 10px;
}

.pac-page .ov-pager button {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid var(--rule);
    background: var(--card);
    color: var(--ink);
    padding: 5px 11px;
    border-radius: 3px;
    cursor: pointer;
    margin-left: 6px;
}

    .pac-page .ov-pager button:disabled {
        opacity: 0.4;
        cursor: default;
    }

    .pac-page .ov-pager button:not(:disabled):hover {
        border-color: var(--brass);
    }

.pac-page .type-tag {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 20px;
}

    .pac-page .type-tag.receipt {
        background: #e4f0e9;
        color: var(--green);
    }

    .pac-page .type-tag.disbursement {
        background: #f4e6e2;
        color: var(--rust);
    }

.pac-page .reported-yes {
    color: var(--green);
    font-weight: 600;
}

.pac-page .reported-no {
    color: var(--muted);
}

.pac-page .row-actions a, .pac-page .row-actions button {
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 6px 4px;
    margin-right: 6px;
    display: inline-block;
    min-height: 24px;
    line-height: 12px;
}

.pac-page .row-actions a {
    color: var(--brass-text);
}

    .pac-page .row-actions a:hover {
        text-decoration: underline;
    }

.pac-page .row-actions button.del {
    color: var(--rust);
}

    .pac-page .row-actions button.del:hover {
        text-decoration: underline;
    }

/* ---- form fields ---- */
.pac-page .field {
    margin-bottom: 18px;
}

    .pac-page .field label {
        display: block;
        font-size: 11.5px;
        font-weight: 700;
        letter-spacing: 0.05em;
        text-transform: uppercase;
        color: var(--muted);
        margin-bottom: 6px;
    }

    .pac-page .field .req {
        color: var(--rust);
    }

    .pac-page .field input[type="text"], .pac-page .field input[type="date"], .pac-page .field select, .pac-page .field textarea {
        width: 100%;
        font-family: 'Inter', sans-serif;
        font-size: 14.5px;
        padding: 10px 11px;
        border: 1px solid var(--rule);
        border-radius: 3px;
        background: #fff;
        color: var(--ink);
    }

    .pac-page .field select {
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236c7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        padding-right: 34px;
    }

        .pac-page .field select:disabled {
            background-color: #f1ede1;
            color: var(--muted);
            cursor: not-allowed;
        }

        .pac-page .field input:focus, .pac-page .field select:focus, .pac-page .field textarea:focus {
            outline: none;
            border-color: var(--brass);
        }

    .pac-page .field textarea {
        resize: vertical;
        min-height: 64px;
    }

    .pac-page .field .hint {
        font-size: 12px;
        color: var(--muted);
        margin-top: 5px;
    }

    .pac-page .field .field-error {
        font-size: 12.5px;
        color: var(--rust);
        margin-top: 5px;
        display: none;
    }

    .pac-page .field.has-error input, .pac-page .field.has-error select, .pac-page .field.has-error .ts-control, .pac-page .field.has-error textarea {
        border-color: var(--rust);
    }

    .pac-page .field.has-error .field-error {
        display: block;
    }

    .pac-page .field.sub-category {
        display: none;
    }

        .pac-page .field.sub-category.visible {
            display: block;
        }

/* ---- segmented type toggle (Add New Transaction picker) ---- */
.pac-page .type-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

@media (max-width: 480px) {
    .pac-page .type-toggle {
        grid-template-columns: 1fr;
    }
}

.pac-page .type-option {
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 14px 16px;
    cursor: pointer;
    background: #fff;
    text-align: left;
    transition: border-color 0.15s;
    min-width: 0;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    list-style: none;
    background-image: none;
    forced-color-adjust: none;
}

    .pac-page .type-option::before, .pac-page .type-option::after,
    .pac-page .type-option .opt-label::before, .pac-page .type-option .opt-label::after {
        content: none;
        display: none;
    }

    .pac-page .type-option:hover {
        border-color: var(--brass);
    }

    .pac-page .type-option.selected.receipt {
        border-color: var(--green);
        background: #eef6f1;
    }

    .pac-page .type-option.selected.disbursement {
        border-color: var(--rust);
        background: #f7ede9;
    }

    .pac-page .type-option .opt-label {
        font-family: 'Source Serif 4', Georgia, serif;
        font-weight: 700;
        font-size: 16px;
        display: block;
        margin-bottom: 3px;
        white-space: normal;
        overflow-wrap: break-word;
    }

    .pac-page .type-option.receipt .opt-label {
        color: var(--green);
    }

    .pac-page .type-option.disbursement .opt-label {
        color: var(--rust);
    }

    .pac-page .type-option .desc {
        font-size: 12px;
        color: var(--muted);
    }

/* ---- ledger grid (debt/balance figures) ---- */
.pac-page .ledger-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px 18px;
    background: #f1ede1;
    border-radius: 6px;
    padding: 16px 18px 4px;
    margin-bottom: 22px;
}

@media (max-width: 480px) {
    .pac-page .ledger-grid {
        grid-template-columns: 1fr;
    }
}

.pac-page .ledger-grid .field {
    margin-bottom: 16px;
}

.pac-page .ledger-grid input[readonly] {
    background: #ece6d6;
    color: var(--ink);
    font-weight: 700;
    font-family: 'Source Serif 4', Georgia, serif;
}

.pac-page .ledger-formula {
    grid-column: 1 / -1;
    font-size: 11.5px;
    color: var(--muted);
    margin: -6px 0 4px;
}

/* ---- form action row ---- */
/* ---- collapsible optional-fields disclosure ---- */
.pac-page .form-disclosure-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    background: none;
    border: none;
    border-top: 1px dashed var(--rule);
    cursor: pointer;
    padding: 16px 0 10px;
    margin-top: 20px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--muted);
    text-align: left;
}

    .pac-page .form-disclosure-toggle:hover {
        color: var(--ink);
    }

    .pac-page .form-disclosure-toggle .disclosure-arrow {
        width: 14px;
        height: 14px;
        transition: transform 0.15s;
        flex-shrink: 0;
    }

    .pac-page .form-disclosure-toggle.expanded .disclosure-arrow {
        transform: rotate(90deg);
    }

.pac-page .form-disclosure-body {
    display: none;
}

    .pac-page .form-disclosure-body.expanded {
        display: block;
    }

.pac-page .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px dashed var(--rule);
}

/* ---- inline banner (errors) ---- */
.pac-page .banner {
    border-radius: 4px;
    padding: 12px 14px;
    font-size: 13.5px;
    margin-bottom: 18px;
    display: none;
}

    .pac-page .banner.show {
        display: block;
    }

    .pac-page .banner.error {
        background: #f7ede9;
        color: var(--rust);
        border: 1px solid #e7c9c0;
    }

/* ---- loading / skeleton ---- */
.pac-page .ov-skel {
    display: inline-block;
    background: linear-gradient(90deg, #e8e2d2 25%, #f1ede1 37%, #e8e2d2 63%);
    background-size: 400% 100%;
    animation: ov-shimmer 1.4s ease infinite;
    border-radius: 3px;
    color: transparent !important;
}

@keyframes ov-shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pac-page .ov-skel {
        animation: none;
    }
}

.pac-page .ov-error-note {
    color: var(--rust);
    font-size: 13px;
    padding: 10px 0;
}

.pac-page .ov-loading-note {
    color: var(--muted);
    font-size: 12.5px;
    padding: 10px 0;
    font-style: italic;
}

/* ---- Tom Select restyle to match the ledger look ---- */
.pac-page .ts-wrapper.single .ts-control {
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 8px 11px;
    font-family: 'Inter', sans-serif;
    font-size: 14.5px;
    background: #fff;
    min-height: 40px;
}

.pac-page .ts-wrapper.focus .ts-control {
    border-color: var(--brass);
    box-shadow: none;
}

.pac-page .ts-dropdown {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    border-color: var(--rule);
}

    .pac-page .ts-dropdown .active {
        background: #f1ede1;
        color: var(--ink);
    }

/* ---- SweetAlert2 popup restyle to match the ledger look ---- */
.swal2-popup.pac-swal {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    border-radius: 6px;
}

    .swal2-popup.pac-swal .swal2-title {
        font-family: 'Source Serif 4', Georgia, serif;
        color: #1c2b4a;
        font-size: 22px;
    }

    .swal2-popup.pac-swal .swal2-html-container {
        color: #6c7280;
        font-size: 14px;
    }

    .swal2-popup.pac-swal .swal2-styled {
        border-radius: 3px;
        font-weight: 600;
        font-size: 13.5px;
    }
