﻿/* =========================================================
   RKTALLY — SHARED APP DESIGN SYSTEM
   Used by list/report pages (Sales, Purchase, Customer, etc.)
   so every page shares the same compact, professional look
   as the dashboard, without repeating CSS per page.
   ========================================================= */

:root {
    --rk-ink: #0f172a;
    --rk-muted: #64748b;
    --rk-faint: #94a3b8;
    --rk-border: #e2e8f0;
    --rk-bg-soft: #f8fafc;
    --rk-primary: #2563eb;
    --rk-primary-soft: #eff6ff;
    --rk-success: #15803d;
    --rk-success-soft: #f0fdf4;
    --rk-danger: #b91c1c;
    --rk-danger-soft: #fef2f2;
    --rk-warning: #b45309;
    --rk-warning-soft: #fffbeb;
    --rk-info: #0e7490;
    --rk-info-soft: #ecfeff;
}

.rk-page {
    color: var(--rk-ink);
    font-size: .92rem;
}

    .rk-page .rk-num {
        font-variant-numeric: tabular-nums;
        font-feature-settings: "tnum";
    }


/* ---------------------------------------------------------
   PAGE HEAD
   --------------------------------------------------------- */

.rk-page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--rk-border);
}

    .rk-page-head h1 {
        font-size: 1.15rem;
        font-weight: 700;
        margin: 0;
        letter-spacing: -.01em;
    }

    .rk-page-head p {
        font-size: .8rem;
        color: var(--rk-muted);
        margin: 2px 0 0;
    }

.rk-page-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

    .rk-page-actions .btn {
        font-size: .8rem;
        padding: 5px 12px;
        border-radius: 6px;
    }


/* ---------------------------------------------------------
   KPI ROW (same look as the dashboard)
   --------------------------------------------------------- */

.rk-kpi-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.rk-kpi {
    background: #fff;
    border: 1px solid var(--rk-border);
    border-left: 3px solid var(--kpi-color, var(--rk-primary));
    border-radius: 7px;
    padding: 10px 12px;
}

    .rk-kpi .rk-kpi-label {
        display: flex;
        align-items: center;
        justify-content: space-between;
        font-size: .7rem;
        font-weight: 600;
        color: var(--rk-muted);
        text-transform: uppercase;
        letter-spacing: .03em;
    }

        .rk-kpi .rk-kpi-label i {
            color: var(--rk-faint);
            font-size: .82rem;
        }

    .rk-kpi .rk-kpi-value {
        font-size: 1.15rem;
        font-weight: 700;
        margin-top: 4px;
    }


/* ---------------------------------------------------------
   CARD / PANEL
   --------------------------------------------------------- */

.rk-card {
    background: #fff;
    border: 1px solid var(--rk-border);
    border-radius: 7px;
}

.rk-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--rk-border);
}

    .rk-card-head h2 {
        font-size: .9rem;
        font-weight: 700;
        margin: 0;
    }

    .rk-card-head .rk-card-sub {
        font-size: .72rem;
        color: var(--rk-muted);
    }


/* ---------------------------------------------------------
   SEARCH + FILTER TOOLBAR
   --------------------------------------------------------- */

.rk-toolbar-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rk-search {
    position: relative;
}

    .rk-search i {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--rk-faint);
        font-size: .85rem;
    }

    .rk-search input {
        padding-left: 30px;
        font-size: .82rem;
        border: 1px solid var(--rk-border);
        border-radius: 6px;
        height: 34px;
        min-width: 220px;
    }

.rk-select {
    font-size: .82rem;
    border: 1px solid var(--rk-border);
    border-radius: 6px;
    height: 34px;
}


/* ---------------------------------------------------------
   TABLE
   --------------------------------------------------------- */

.rk-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .83rem;
}

    .rk-table thead th {
        text-align: left;
        font-size: .68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: .03em;
        color: var(--rk-faint);
        padding: 8px 12px;
        border-bottom: 1px solid var(--rk-border);
        background: var(--rk-bg-soft);
        white-space: nowrap;
    }

    .rk-table tbody td {
        padding: 9px 12px;
        border-bottom: 1px solid var(--rk-border);
        vertical-align: middle;
    }

    .rk-table tbody tr:last-child td {
        border-bottom: none;
    }

    .rk-table tbody tr:hover {
        background: var(--rk-bg-soft);
    }

    .rk-table .text-end {
        text-align: right;
    }


/* ---------------------------------------------------------
   STATUS PILL
   --------------------------------------------------------- */

.rk-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .7rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 999px;
    white-space: nowrap;
}

    .rk-pill::before {
        content: "";
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: currentColor;
    }

.rk-pill-success {
    background: var(--rk-success-soft);
    color: var(--rk-success);
}

.rk-pill-warning {
    background: var(--rk-warning-soft);
    color: var(--rk-warning);
}

.rk-pill-danger {
    background: var(--rk-danger-soft);
    color: var(--rk-danger);
}

.rk-pill-muted {
    background: var(--rk-bg-soft);
    color: var(--rk-muted);
}

.rk-pill-info {
    background: var(--rk-info-soft);
    color: var(--rk-info);
}


/* ---------------------------------------------------------
   ROW ACTION BUTTONS
   --------------------------------------------------------- */

.rk-row-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.rk-icon-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--rk-border);
    background: #fff;
    color: var(--rk-muted);
    text-decoration: none;
    font-size: .82rem;
}

    .rk-icon-btn:hover {
        border-color: var(--rk-primary);
        color: var(--rk-primary);
        background: var(--rk-primary-soft);
    }

    .rk-icon-btn.rk-danger:hover {
        border-color: var(--rk-danger);
        color: var(--rk-danger);
        background: var(--rk-danger-soft);
    }


/* ---------------------------------------------------------
   EMPTY STATE
   --------------------------------------------------------- */

.rk-empty-block {
    text-align: center;
    padding: 40px 20px;
    color: var(--rk-muted);
}

    .rk-empty-block i {
        font-size: 1.8rem;
        color: var(--rk-faint);
        display: block;
        margin-bottom: 10px;
    }

    .rk-empty-block h3 {
        font-size: .95rem;
        font-weight: 700;
        color: var(--rk-ink);
        margin-bottom: 4px;
    }

    .rk-empty-block p {
        font-size: .8rem;
        margin-bottom: 12px;
    }


/* ---------------------------------------------------------
   CARD FOOTER SUMMARY STRIP
   --------------------------------------------------------- */

.rk-card-foot {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 10px 14px;
    border-top: 1px solid var(--rk-border);
    background: var(--rk-bg-soft);
    font-size: .8rem;
}

    .rk-card-foot strong {
        font-variant-numeric: tabular-nums;
    }


/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 991.98px) {
    .rk-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .rk-kpi-row {
        grid-template-columns: 1fr;
    }

    .rk-search input {
        min-width: 140px;
    }
}

/* =========================================================
   RKTALLY — PARTY LEDGER COMPACT / SMART UI
   Add at the END of wwwroot/css/rk-app.css
   ========================================================= */

.party-ledger-page {
    --ledger-control-h: 34px;
    --ledger-radius: 8px;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.party-ledger-head {
    margin-bottom: 12px;
}

.party-ledger-title-area {
    gap: 10px;
}

.party-ledger-ai-icon {
    width: 38px;
    height: 38px;
    min-width: 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    font-size: 17px;
}

.party-ledger-eyebrow {
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .08em;
    color: var(--rk-primary);
    margin-bottom: 3px;
}

.party-ledger-heading h1 {
    margin: 0;
    font-size: 20px;
    line-height: 1.2;
}

.party-ledger-heading p {
    margin: 3px 0 0;
    font-size: 11px;
}

.party-heading-separator {
    margin: 0 5px;
    color: var(--rk-faint);
}

.party-ledger-role {
    margin-left: 4px;
}

    .party-ledger-role .rk-pill {
        font-size: 10px;
        padding: 4px 8px;
    }


/* =========================================================
   PRINT BUTTON
   ========================================================= */

.party-print-button {
    height: 34px;
    padding: 0 10px;
    border-radius: 7px;
    font-size: 12px;
}


/* =========================================================
   LINKED PARTY CARD
   ========================================================= */

.party-linked-card {
    margin-bottom: 10px !important;
    padding: 10px 12px;
}

.party-linked-main {
    gap: 9px;
}

.party-linked-ai {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 8px;
    font-size: 15px;
}

.party-linked-title {
    font-size: 12px;
}

.party-linked-text {
    font-size: 10px;
    margin-top: 2px;
}

.party-linked-details {
    gap: 8px;
}

.party-linked-item {
    padding: 7px 10px;
    border-radius: 7px;
}

    .party-linked-item span {
        font-size: 9px;
    }

    .party-linked-item strong {
        font-size: 11px;
    }

    .party-linked-item small {
        font-size: 9px;
    }


/* =========================================================
   ACCOUNT INFORMATION — COMPACT
   ========================================================= */

.party-account-strip {
    display: flex;
    align-items: center;
    min-height: 48px;
    padding: 7px 10px;
    margin-bottom: 10px !important;
    gap: 0;
}

.party-account-item {
    min-height: 32px;
    padding: 2px 14px;
    flex: 1;
    border-right: 1px solid var(--rk-border);
}

    .party-account-item:first-child {
        padding-left: 4px;
    }

    .party-account-item:last-child {
        border-right: 0;
        padding-right: 4px;
    }

    .party-account-item span {
        display: block;
        font-size: 9px;
        line-height: 1.1;
        color: var(--rk-muted);
        margin-bottom: 3px;
    }

        .party-account-item span i {
            font-size: 9px;
            margin-right: 3px;
        }

    .party-account-item strong {
        display: block;
        font-size: 11px;
        line-height: 1.15;
        font-weight: 700;
    }

.party-period-arrow {
    margin: 0 3px;
    color: var(--rk-muted);
}

.party-live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rk-success);
    margin-right: 4px;
    vertical-align: 1px;
}


/* =========================================================
   KPI CARDS — SMALL
   ========================================================= */

.party-ledger-kpis {
    gap: 8px;
    margin-bottom: 10px;
}

    .party-ledger-kpis .rk-kpi {
        min-height: 82px;
        padding: 10px 12px;
        border-radius: 9px;
    }

    .party-ledger-kpis .rk-kpi-label {
        font-size: 9px;
        margin-bottom: 5px;
    }

        .party-ledger-kpis .rk-kpi-label i {
            font-size: 12px;
        }

    .party-ledger-kpis .rk-kpi-value {
        font-size: 16px;
        line-height: 1.2;
    }

        .party-ledger-kpis .rk-kpi-value small {
            font-size: 9px;
            padding: 2px 4px;
            border-radius: 4px;
        }

.party-kpi-foot {
    margin-top: 4px;
    font-size: 8px;
    color: var(--rk-muted);
}


/* =========================================================
   MAIN LEDGER CARD
   ========================================================= */

.party-ledger-card {
    border-radius: 10px;
    overflow: visible;
}

.party-ledger-card-head {
    min-height: 52px;
    padding: 8px 12px;
}

.party-ledger-card-title {
    gap: 8px;
}

.party-ledger-title-icon {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 7px;
    font-size: 13px;
}

.party-ledger-card-head h2 {
    margin: 0;
    font-size: 13px;
    line-height: 1.15;
}

.party-ledger-card-head .rk-card-sub {
    font-size: 9px;
    margin-top: 2px;
}

.party-ai-status {
    height: 25px;
    padding: 0 8px;
    border-radius: 6px;
    font-size: 9px;
}

.party-ai-dot {
    width: 5px;
    height: 5px;
}


/* =========================================================
   FILTER PANEL — COMPACT
   ========================================================= */

.party-filter-panel {
    padding: 8px 10px;
    border-top: 1px solid var(--rk-border);
    border-bottom: 1px solid var(--rk-border);
    background: var(--rk-bg-soft);
}

.party-filter-main-row {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    width: 100%;
}


/* SEARCH */

.party-global-search {
    position: relative;
    flex: 1 1 250px;
    min-width: 190px;
}

    .party-global-search .form-control {
        height: var(--ledger-control-h);
        min-height: var(--ledger-control-h);
        padding: 0 10px 0 30px;
        border-radius: var(--ledger-radius);
        font-size: 11px;
    }

    .party-global-search > i {
        position: absolute;
        left: 10px;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
        font-size: 11px;
        color: var(--rk-muted);
    }

.party-search-hint {
    display: none !important;
}


/* =========================================================
   PARTY BUTTON
   ========================================================= */

.party-filter-dropdown {
    position: relative;
    flex: 0 0 145px;
}

.party-filter-button {
    width: 100%;
    height: var(--ledger-control-h);
    padding: 0 9px;
    display: flex;
    align-items: center;
    gap: 7px;
    border: 1px solid var(--rk-border);
    background: #fff;
    color: var(--rk-ink);
    border-radius: var(--ledger-radius);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

    .party-filter-button > i:first-child {
        font-size: 12px;
        color: var(--rk-primary);
    }

    .party-filter-button:hover {
        border-color: var(--rk-primary);
    }

.party-chevron {
    margin-left: auto;
    font-size: 9px !important;
}

.party-filter-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 5px;
    background: var(--rk-primary-soft);
    color: var(--rk-primary);
    font-size: 9px;
    font-weight: 700;
}

    .party-filter-count:not(.has-selection) {
        display: none;
    }


/* =========================================================
   PARTY MENU
   ========================================================= */

.party-filter-menu {
    position: absolute;
    z-index: 1050;
    top: calc(100% + 5px);
    left: 0;
    width: 330px;
    max-width: min(330px, calc(100vw - 24px));
    padding: 0;
    background: #fff;
    border: 1px solid var(--rk-border);
    border-radius: 10px;
    box-shadow: 0 14px 35px rgba(15, 23, 42, .15);
    display: none;
    overflow: hidden;
}

    .party-filter-menu.show {
        display: block;
    }

.party-filter-menu-head {
    padding: 9px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--rk-border);
}

    .party-filter-menu-head strong {
        display: block;
        font-size: 11px;
    }

    .party-filter-menu-head small {
        display: block;
        margin-top: 2px;
        color: var(--rk-muted);
        font-size: 8px;
    }

.party-clear-button {
    border: 0;
    background: transparent;
    color: var(--rk-danger);
    font-size: 9px;
    font-weight: 600;
    padding: 3px 5px;
    cursor: pointer;
}


/* PARTY SEARCH */

.party-menu-search {
    position: relative;
    padding: 7px 8px;
}

    .party-menu-search i {
        position: absolute;
        left: 18px;
        top: 50%;
        transform: translateY(-50%);
        color: var(--rk-muted);
        font-size: 10px;
    }

    .party-menu-search input {
        width: 100%;
        height: 30px;
        padding: 0 9px 0 27px;
        border: 1px solid var(--rk-border);
        border-radius: 6px;
        font-size: 10px;
        outline: none;
    }

        .party-menu-search input:focus {
            border-color: var(--rk-primary);
        }


/* =========================================================
   PARTY TYPE TABS
   ========================================================= */

.party-type-tabs {
    display: flex;
    gap: 3px;
    padding: 0 8px 7px;
}

.party-type-tab {
    flex: 1;
    height: 27px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: var(--rk-bg-soft);
    color: var(--rk-muted);
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
}

    .party-type-tab:hover {
        color: var(--rk-ink);
    }

    .party-type-tab.active {
        background: var(--rk-primary-soft);
        color: var(--rk-primary);
        border-color: rgba(99, 216, 74, .25);
    }


/* =========================================================
   PARTY OPTIONS
   ========================================================= */

.party-options {
    max-height: 260px;
    overflow-y: auto;
    padding: 0 7px 6px;
}

.party-option {
    min-height: 37px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 7px;
    margin-bottom: 2px;
    border-radius: 6px;
    cursor: pointer;
    transition: background .15s ease;
}

    .party-option:hover {
        background: var(--rk-bg-soft);
    }

.party-option-hidden {
    display: none !important;
}

.party-option input {
    display: none;
}

.party-check-ui {
    width: 15px;
    height: 15px;
    min-width: 15px;
    display: grid;
    place-items: center;
    border: 1px solid var(--rk-border);
    border-radius: 4px;
    color: #fff;
    font-size: 8px;
}

.party-option input:checked + .party-check-ui {
    background: var(--rk-primary);
    border-color: var(--rk-primary);
}

.party-option-icon {
    width: 25px;
    height: 25px;
    min-width: 25px;
    display: grid;
    place-items: center;
    border-radius: 6px;
    background: var(--rk-bg-soft);
    color: var(--rk-muted);
    font-size: 11px;
}

.party-option-content {
    min-width: 0;
    flex: 1;
}

    .party-option-content strong {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 10px;
    }

    .party-option-content small {
        display: block;
        margin-top: 1px;
        font-size: 8px;
        color: var(--rk-muted);
    }

.party-both-mini {
    padding: 2px 4px;
    border-radius: 4px;
    background: var(--rk-warning-soft);
    color: var(--rk-warning);
    font-size: 7px;
    font-weight: 800;
}

.party-options-empty {
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: var(--rk-muted);
    text-align: center;
    font-size: 9px;
}

    .party-options-empty i {
        font-size: 20px;
    }


/* =========================================================
   PARTY MENU FOOTER
   ========================================================= */

.party-filter-menu-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 8px;
    border-top: 1px solid var(--rk-border);
    background: var(--rk-bg-soft);
}

    .party-filter-menu-footer span {
        font-size: 9px;
        color: var(--rk-muted);
    }

    .party-filter-menu-footer .btn {
        height: 28px;
        padding: 0 10px;
        border-radius: 6px;
        font-size: 9px;
    }


/* =========================================================
   DATE / VOUCHER CONTROLS
   ========================================================= */

.party-date-filter,
.party-voucher-select {
    flex: 0 0 auto;
}

    .party-date-filter label,
    .party-voucher-select label {
        display: none;
    }

    .party-date-filter .form-control,
    .party-voucher-select .form-select {
        height: var(--ledger-control-h);
        min-height: var(--ledger-control-h);
        border-radius: var(--ledger-radius);
        font-size: 10px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .party-date-filter .form-control {
        width: 125px;
    }

    .party-voucher-select .form-select {
        width: 145px;
    }


/* =========================================================
   BUTTONS
   ========================================================= */

.party-more-filter-button,
.party-apply-button,
.party-reset-button {
    height: var(--ledger-control-h);
    min-height: var(--ledger-control-h);
    border-radius: var(--ledger-radius);
    font-size: 10px;
    white-space: nowrap;
}

.party-more-filter-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 9px;
    border: 1px solid var(--rk-border);
    background: #fff;
    color: var(--rk-ink);
}

    .party-more-filter-button:hover {
        border-color: var(--rk-primary);
        color: var(--rk-primary);
    }

.party-apply-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 11px;
}

.party-reset-button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--rk-muted);
    text-decoration: none;
    cursor: pointer;
}

    .party-reset-button:hover {
        color: var(--rk-danger);
        background: var(--rk-danger-soft);
    }


/* =========================================================
   ACTIVE FILTERS
   ========================================================= */

.party-active-filter-row {
    min-height: 0;
    display: none;
    align-items: center;
    gap: 6px;
    padding-top: 7px;
}

    .party-active-filter-row.has-filters {
        display: flex;
    }

.party-active-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 8px;
    font-weight: 700;
    color: var(--rk-muted);
    white-space: nowrap;
}

.party-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    min-width: 0;
}

.party-filter-chip {
    height: 23px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 6px 0 8px;
    border-radius: 5px;
    background: var(--rk-primary-soft);
    color: var(--rk-primary);
    font-size: 8px;
    font-weight: 600;
}

    .party-filter-chip button {
        width: 13px;
        height: 13px;
        padding: 0;
        border: 0;
        border-radius: 3px;
        background: transparent;
        color: inherit;
        line-height: 1;
        cursor: pointer;
    }

.party-clear-all {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--rk-danger);
    font-size: 8px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}


/* =========================================================
   COLUMN FILTERS
   ========================================================= */

.party-column-filter-panel {
    display: none;
    margin-top: 7px;
    padding: 8px;
    border: 1px solid var(--rk-border);
    border-radius: 8px;
    background: #fff;
}

    .party-column-filter-panel.show {
        display: block;
    }

.party-column-filter-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 7px;
    font-size: 9px;
}

    .party-column-filter-title > div {
        display: flex;
        align-items: center;
        gap: 5px;
    }

.party-column-close {
    width: 23px;
    height: 23px;
    border: 0;
    border-radius: 5px;
    background: var(--rk-bg-soft);
    color: var(--rk-muted);
}

.party-column-filter-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(80px, 1fr));
    gap: 6px;
}

.party-column-filter label {
    display: block;
    margin-bottom: 3px;
    font-size: 8px;
    color: var(--rk-muted);
    font-weight: 600;
}

.party-column-filter .form-control {
    height: 29px;
    min-height: 29px;
    padding: 0 7px;
    border-radius: 6px;
    font-size: 9px;
}



/* =========================================================
   PARTY LEDGER — CLEAR / READABLE TABLE
   Keep filters compact, make ledger table easy to read.
   ========================================================= */

.party-ledger-page .ledger-table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    border: 1px solid var(--rk-border);
    border-radius: 10px;
    background: #fff;
}

/* Table */
.party-ledger-page .ledger-table,
.party-ledger-page table.rk-table {
    width: 100%;
    min-width: 920px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

    /* Header */
    .party-ledger-page .ledger-table thead th,
    .party-ledger-page table.rk-table thead th {
        height: 42px;
        padding: 9px 12px;
        background: #f7f9fc;
        color: var(--rk-muted);
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .04em;
        text-transform: uppercase;
        white-space: nowrap;
        border-bottom: 1px solid var(--rk-border);
        vertical-align: middle;
    }

    /* Body rows */
    .party-ledger-page .ledger-table tbody td,
    .party-ledger-page table.rk-table tbody td {
        height: 40px;
        padding: 9px 12px;
        color: var(--rk-ink);
        font-size: 13px;
        line-height: 1.35;
        vertical-align: middle;
        border-bottom: 1px solid #edf0f4;
        white-space: nowrap;
    }

    /* Last row */
    .party-ledger-page .ledger-table tbody tr:last-child td,
    .party-ledger-page table.rk-table tbody tr:last-child td {
        border-bottom: 0;
    }

    /* Hover */
    .party-ledger-page .ledger-table tbody tr:hover td,
    .party-ledger-page table.rk-table tbody tr:hover td {
        background: #f8fbff;
    }

    /* Date */
    .party-ledger-page .ledger-table th:first-child,
    .party-ledger-page .ledger-table td:first-child,
    .party-ledger-page table.rk-table th:first-child,
    .party-ledger-page table.rk-table td:first-child {
        width: 105px;
        min-width: 105px;
    }

    /* Voucher */
    .party-ledger-page .ledger-table th:nth-child(2),
    .party-ledger-page .ledger-table td:nth-child(2),
    .party-ledger-page table.rk-table th:nth-child(2),
    .party-ledger-page table.rk-table td:nth-child(2) {
        width: 125px;
        min-width: 125px;
    }

    /* Voucher Type */
    .party-ledger-page .ledger-table th:nth-child(3),
    .party-ledger-page .ledger-table td:nth-child(3),
    .party-ledger-page table.rk-table th:nth-child(3),
    .party-ledger-page table.rk-table td:nth-child(3) {
        width: 110px;
        min-width: 110px;
    }

    /* Narration — give this the most space */
    .party-ledger-page .ledger-table th:nth-child(4),
    .party-ledger-page .ledger-table td:nth-child(4),
    .party-ledger-page table.rk-table th:nth-child(4),
    .party-ledger-page table.rk-table td:nth-child(4) {
        width: auto;
        min-width: 300px;
        white-space: normal;
    }

    /* Debit / Credit / Balance */
    .party-ledger-page .ledger-table th:nth-child(5),
    .party-ledger-page .ledger-table td:nth-child(5),
    .party-ledger-page .ledger-table th:nth-child(6),
    .party-ledger-page .ledger-table td:nth-child(6),
    .party-ledger-page .ledger-table th:nth-child(7),
    .party-ledger-page .ledger-table td:nth-child(7),
    .party-ledger-page table.rk-table th:nth-child(5),
    .party-ledger-page table.rk-table td:nth-child(5),
    .party-ledger-page table.rk-table th:nth-child(6),
    .party-ledger-page table.rk-table td:nth-child(6),
    .party-ledger-page table.rk-table th:nth-child(7),
    .party-ledger-page table.rk-table td:nth-child(7) {
        width: 125px;
        min-width: 125px;
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    /* Amounts */
    .party-ledger-page .ledger-table .amount,
    .party-ledger-page table.rk-table .amount {
        font-weight: 600;
        white-space: nowrap;
    }

    /* Balance */
    .party-ledger-page .ledger-table .balance,
    .party-ledger-page table.rk-table .balance {
        font-weight: 700;
        color: var(--rk-ink);
    }

    /* Voucher type badge */
    .party-ledger-page .ledger-table .voucher-type,
    .party-ledger-page table.rk-table .voucher-type {
        display: inline-flex;
        align-items: center;
        min-height: 24px;
        padding: 3px 8px;
        border-radius: 6px;
        background: #f1f4f8;
        color: var(--rk-muted);
        font-size: 11px;
        font-weight: 700;
        line-height: 1;
    }

    /* Narration */
    .party-ledger-page .ledger-table .narration,
    .party-ledger-page table.rk-table .narration {
        color: var(--rk-ink);
        line-height: 1.4;
    }

    /* Table footer / total row */
    .party-ledger-page .ledger-table tfoot td,
    .party-ledger-page table.rk-table tfoot td {
        min-height: 42px;
        padding: 10px 12px;
        background: #f7f9fc;
        font-weight: 700;
        border-top: 1px solid var(--rk-border);
        border-bottom: 0;
    }

    /* Sticky header when table is long */
    .party-ledger-page .ledger-table thead th,
    .party-ledger-page table.rk-table thead th {
        position: sticky;
        top: 0;
        z-index: 2;
    }

    /* Better visual separation */
    .party-ledger-page .ledger-table tbody tr:nth-child(even) td,
    .party-ledger-page table.rk-table tbody tr:nth-child(even) td {
        background: #fcfdff;
    }

    .party-ledger-page .ledger-table tbody tr:nth-child(even):hover td,
    .party-ledger-page table.rk-table tbody tr:nth-child(even):hover td {
        background: #f8fbff;
    }


/* =========================================================
   DESKTOP — MORE BREATHING ROOM
   ========================================================= */

@media (min-width: 1200px) {
    .party-ledger-page .ledger-table,
    .party-ledger-page table.rk-table {
        font-size: 13.5px;
    }

        .party-ledger-page .ledger-table tbody td,
        .party-ledger-page table.rk-table tbody td {
            height: 42px;
            padding: 10px 13px;
        }

        .party-ledger-page .ledger-table thead th,
        .party-ledger-page table.rk-table thead th {
            height: 44px;
            padding: 10px 13px;
        }

        .party-ledger-page .ledger-table th:nth-child(4),
        .party-ledger-page .ledger-table td:nth-child(4),
        .party-ledger-page table.rk-table th:nth-child(4),
        .party-ledger-page table.rk-table td:nth-child(4) {
            min-width: 380px;
        }
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {
    .party-ledger-page .ledger-table,
    .party-ledger-page table.rk-table {
        min-width: 850px;
    }

        .party-ledger-page .ledger-table tbody td,
        .party-ledger-page table.rk-table tbody td {
            height: 40px;
            padding: 8px 10px;
            font-size: 12.5px;
        }

        .party-ledger-page .ledger-table thead th,
        .party-ledger-page table.rk-table thead th {
            height: 40px;
            padding: 8px 10px;
            font-size: 10px;
        }
}


/* =========================================================
   MOBILE
   Keep readable table; scroll horizontally.
   ========================================================= */

@media (max-width: 600px) {
    .party-ledger-page .ledger-table-wrap {
        margin-left: -1px;
        margin-right: -1px;
        border-radius: 8px;
    }

    .party-ledger-page .ledger-table,
    .party-ledger-page table.rk-table {
        min-width: 820px;
    }

        .party-ledger-page .ledger-table tbody td,
        .party-ledger-page table.rk-table tbody td {
            height: 40px;
            padding: 8px 9px;
            font-size: 12px;
        }

        .party-ledger-page .ledger-table th:nth-child(4),
        .party-ledger-page .ledger-table td:nth-child(4),
        .party-ledger-page table.rk-table th:nth-child(4),
        .party-ledger-page table.rk-table td:nth-child(4) {
            min-width: 270px;
        }

        .party-ledger-page .ledger-table th:nth-child(5),
        .party-ledger-page .ledger-table td:nth-child(5),
        .party-ledger-page .ledger-table th:nth-child(6),
        .party-ledger-page .ledger-table td:nth-child(6),
        .party-ledger-page .ledger-table th:nth-child(7),
        .party-ledger-page .ledger-table td:nth-child(7),
        .party-ledger-page table.rk-table th:nth-child(5),
        .party-ledger-page table.rk-table td:nth-child(5),
        .party-ledger-page table.rk-table th:nth-child(6),
        .party-ledger-page table.rk-table td:nth-child(6),
        .party-ledger-page table.rk-table th:nth-child(7),
        .party-ledger-page table.rk-table td:nth-child(7) {
            min-width: 115px;
            width: 115px;
        }
}

