:root {
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffffcc;
    --border-color: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;

    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);

    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.15);
    
    --warning: #f59e0b;
    --warning-light: rgba(245, 158, 11, 0.15);

    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.15);

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;

    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background:
        radial-gradient(circle at top left, rgba(99, 102, 241, 0.1), transparent 22%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Non-blocking application toaster */
.toast-container {
    position: fixed;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    width: min(380px, calc(100vw - 1rem));
    pointer-events: none;
}

.app-toast {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.65rem;
    padding: 0.7rem 0.8rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 9px;
    background-color: rgba(255, 255, 255, 0.97);
    color: var(--text-primary);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
    opacity: 0;
    transform: translateY(-10px) scale(0.98);
    transition: opacity 180ms ease, transform 180ms ease;
    pointer-events: auto;
}

.app-toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.app-toast.removing {
    opacity: 0;
    transform: translateX(20px);
}

.app-toast-icon {
    color: var(--success);
    font-size: 1rem;
}

.app-toast.error {
    border-color: rgba(239, 68, 68, 0.35);
}

.app-toast.error .app-toast-icon {
    color: var(--danger);
}

.app-toast-message {
    min-width: 0;
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.4;
}

.app-toast-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem;
    border: 0;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
}

.app-toast-close:hover {
    color: var(--text-primary);
}

@media (prefers-reduced-motion: reduce) {
    .app-toast {
        transition: none;
    }
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-base);
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Topbar */
.topbar {
    min-height: 48px;
    background-color: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.35rem 1rem;
    flex-shrink: 0;
}

.logo-area {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-area i {
    color: var(--primary);
}

#app-title-trigger {
    user-select: none;
    cursor: default;
}

.hidden-settings-panel {
    /* position:fixed (not absolute) — it's reparented to <body> on init and
       positioned via getBoundingClientRect() of the title at open time, the
       same escape-the-stacking-context pattern used by .col-filter-panel.
       Nesting it inside .topbar and relying on z-index alone silently fails:
       .topbar's backdrop-filter creates its own stacking context, which
       traps any z-index inside it — .main-content's later DOM-order
       siblings (the stat cards) then paint on top and swallow clicks. */
    position: fixed;
    width: 260px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    z-index: 500;
    font-family: var(--font-body);
    font-weight: 400;
    font-size: 0.8rem;
}

.hidden-settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    color: var(--text-primary);
}

.hidden-settings-header .btn-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    padding: 0.2rem;
}

.hidden-settings-header .btn-close:hover {
    color: var(--danger);
}

.hidden-settings-toggle {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem;
    cursor: pointer;
    color: var(--text-primary);
}

.hidden-settings-toggle input {
    cursor: pointer;
}

.nav-menu {
    display: flex;
    flex-direction: row;
    gap: 0.35rem;
    margin-left: 0.5rem;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition-fast);
}

.nav-item:hover, .nav-item.active {
    color: var(--text-primary);
    background-color: var(--primary-light);
}

.nav-item.active i {
    color: var(--primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-left: auto;
    min-width: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
}

.topbar-actions .btn {
    gap: 0.35rem;
    padding: 0.45rem 0.7rem;
    border-radius: 7px;
    font-size: 0.78rem;
    white-space: nowrap;
}

.system-time {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 0.4rem 0.5rem;
    overflow-y: auto;
    max-width: 100%;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-with-badge {
    position: relative;
}

.btn-count-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background-color: var(--danger);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg-surface);
}

.btn-primary {
    background-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--border-color);
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.btn-xs {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* "Request Invoice" button on unmapped AR rows (mapping cell) */
.btn-request-invoice {
    background-color: var(--warning-light);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.btn-request-invoice:hover:not(:disabled) {
    background-color: var(--warning);
    color: #fff;
}

.btn-request-invoice:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
    justify-content: center;
    padding: 0.85rem;
}

/* Stats Cards */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

/* AR Dashboard: stat cards + search/filter controls share a single row
   instead of stacking as two sections, to save vertical space for the
   table. Scoped to this wrapper only — the Status Piutang tab's
   .stats-container (its own instance) keeps the default grid layout. */
.stats-filter-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

/* Collapse toggle (AR Dashboard): hides stats/filter rows to free up table
   height, Google Sheets-style. The totals-summary-bar itself stays visible
   in both states — it's the permanent strip that hosts the toggle (and the
   fullscreen button), so there's always a way back to expanded. */
#view-ar-dashboard.ar-toolbar-collapsed .stats-filter-row,
#view-ar-dashboard.ar-toolbar-collapsed .active-filters-row {
    display: none !important;
}

#view-ar-dashboard.ar-toolbar-collapsed .ar-table-container {
    max-height: calc(100vh - 100px);
}

.stats-filter-row .stats-container {
    display: flex;
    flex: 0 0 auto;
    margin-bottom: 0;
}

.stats-filter-row .stat-card {
    flex: 0 0 auto;
    padding: 0.3rem 0.6rem;
    gap: 0.5rem;
}

.stats-filter-row .stat-icon {
    width: 23px;
    height: 23px;
    border-radius: 5px;
    font-size: 0.65rem;
}

.stats-filter-row .stat-info {
    gap: 0.05rem;
}

.stats-filter-row .stat-info h3 {
    font-size: 0.6rem;
}

.stats-filter-row .stat-info p {
    font-size: 0.92rem;
}

.stats-filter-row .controls-card {
    flex: 1 1 420px;
    margin-bottom: 0;
}

/* -sm size variant: compact search/filter controls, used in the AR
   Dashboard stats+filter row so the full row fits in less height. */
.controls-card.controls-sm {
    padding: 0.4rem 0.65rem;
    gap: 0.6rem;
}

.controls-card.controls-sm .search-box {
    padding: 0.4rem 0.7rem;
    gap: 0.5rem;
}

.controls-card.controls-sm .search-box input {
    font-size: 0.82rem;
}

.controls-card.controls-sm .filter-box select {
    padding: 0.4rem 0.65rem;
    font-size: 0.82rem;
}

.controls-card.controls-sm .search-column-box {
    flex: 0 0 140px;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

.stat-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.35rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.stat-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
}

.icon-blue { background-color: var(--primary-light); color: var(--primary); }
.icon-green { background-color: var(--success-light); color: var(--success); }
.icon-amber { background-color: var(--warning-light); color: var(--warning); }
.icon-red { background-color: var(--danger-light); color: var(--danger); }

/* Status Piutang tab: donut + aging bar charts side by side */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.chart-card {
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
}

.chart-card h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.chart-container {
    min-height: 220px;
}

.chart-container-donut {
    max-width: 280px;
    margin: 0 auto;
}

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

/* % Sisa progress bar (Status Piutang table) */
.pct-sisa-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.pct-sisa-track {
    flex: 1;
    height: 7px;
    border-radius: 50px;
    background-color: var(--bg-base);
    overflow: hidden;
}

.pct-sisa-fill {
    height: 100%;
    border-radius: 50px;
    background-color: var(--danger);
}

.pct-sisa-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}


.stat-info {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.stat-info h3 {
    font-size: 0.65rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.stat-info p {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
}

/* Control box */
.controls-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem 0.75rem;
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.65rem 1rem;
    flex-grow: 1;
}

.search-box i {
    color: var(--text-muted);
}

.search-box input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    flex: 1;
    min-width: 0;
}

.search-result-count {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-clear-search {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.btn-clear-search:hover {
    color: var(--danger);
}

/* Active Filter Chips */
.active-filters-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.4rem;
    margin-bottom: 0.4rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 50px;
    padding: 0.3rem 0.5rem 0.3rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.filter-chip button {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    opacity: 0.75;
    transition: var(--transition-fast);
}

.filter-chip button:hover {
    opacity: 1;
}

.filter-chip.chip-clear-all {
    background-color: transparent;
    color: var(--text-muted);
    border: 1px dashed var(--border-color);
    cursor: pointer;
    font-weight: 600;
}

.filter-chip.chip-clear-all:hover {
    color: var(--danger);
    border-color: var(--danger);
}

/* Range filter (date/number columns) */
.col-filter-range {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.col-filter-range label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.25rem;
}

.col-filter-range input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.filter-box select {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.95rem;
    padding: 0.65rem 1rem;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
}

.search-column-box {
    flex: 0 0 170px;
}

.search-column-box select {
    width: 100%;
}

/* Interactive Excel Table */
.grid-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.table-container {
    overflow-x: auto;
    max-width: 100%;
}

.ar-table-container {
    position: relative;
    max-height: calc(100vh - 165px);
    /* Always reserve and display both scrollbars so their controls do not
       appear/disappear as pagination or window size changes. */
    overflow-x: scroll;
    overflow-y: scroll;
    scrollbar-gutter: stable both-edges;
    scrollbar-width: thin;
    scrollbar-color: var(--primary) #eef2ff;
}

.ar-table-container::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.ar-table-container::-webkit-scrollbar-track {
    background: #eef2ff;
    border-radius: 999px;
}

.ar-table-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border: 2px solid #eef2ff;
    border-radius: 999px;
}

.ar-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.excel-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.76rem;
    text-align: left;
    border: 1px solid var(--border-color);
}

#ar-table,
#pay-table {
    border-collapse: separate;
    border-spacing: 0;
}

#ar-table thead th,
#pay-table thead th {
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 1px 0 var(--border-color);
}

#ar-table thead th.sticky-col {
    z-index: 30;
}

.excel-table th {
    background-color: #f1f5f9;
    color: #334155;
    padding: 0.4rem 0.55rem;
    font-weight: 700;
    font-family: var(--font-heading);
    border: 1px solid var(--border-color);
    white-space: nowrap;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
}

.excel-table td {
    padding: 0.28rem 0.55rem;
    border: 1px solid var(--border-color);
    white-space: nowrap;
    color: #1e293b;
}

.excel-table tbody tr:nth-child(even) {
    background-color: rgba(15, 23, 42, 0.02);
}

.excel-table tbody tr:hover {
    background-color: rgba(99, 102, 241, 0.08);
}

/* Excel-style column header filters */
.excel-table th.th-with-filter {
    padding: 0;
}

.th-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    padding: 0.45rem 0.4rem 0.45rem 0.6rem;
}

.col-filter-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
    line-height: 1;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.col-filter-btn:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.col-filter-btn.active {
    color: #fff;
    background-color: var(--primary);
}

/* Optional horizontal pins for the key AR identifiers. The pin control sits
   immediately to the left of the header filter button. */
.col-pin-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 0.7rem;
    line-height: 1;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.col-pin-btn:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

.col-pin-btn.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

.col-pin-btn.active:hover {
    color: var(--primary);
    background-color: var(--primary-light);
}

#ar-table .pinned-ar-column {
    position: sticky;
    z-index: 40;
    background-color: #ffffff;
    box-shadow: 2px 0 0 var(--border-color), 5px 0 8px rgba(15, 23, 42, 0.06);
    background-clip: padding-box;
    overflow: hidden;
}

#ar-table tbody tr:nth-child(even) .pinned-ar-column {
    background-color: #f8fafc;
}

#ar-table tbody tr:hover > .pinned-ar-column {
    background-color: #eef2ff !important;
}

#ar-table thead .pinned-ar-column {
    z-index: 45;
    background-color: #f1f5f9;
}

.col-filter-panel {
    position: fixed;
    width: 240px;
    max-height: calc(100vh - 16px);
    overflow: hidden;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.15);
    z-index: 500;
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
}

.col-filter-sort-options {
    display: flex;
    flex-direction: column;
    padding: 0.35rem;
    border-bottom: 1px solid var(--border-color);
}

.col-filter-sort-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: var(--font-body);
    transition: var(--transition-fast);
}

.col-filter-sort-btn:hover {
    background-color: var(--bg-base);
}

.col-filter-sort-btn.active {
    color: var(--primary);
    font-weight: 600;
    background-color: var(--primary-light);
}

.col-sort-indicator {
    font-size: 0.65rem;
    color: var(--primary);
}

.col-filter-panel-search {
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.col-filter-panel-search input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.8rem;
    outline: none;
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.col-filter-panel-list {
    max-height: 220px;
    min-height: 0;
    overflow-y: auto;
    padding: 0.35rem 0;
}

.col-filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
}

.col-filter-option span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.col-filter-blank-option {
    border-top: 1px solid var(--border-color);
    padding-top: 0.6rem;
    margin-top: 0.4rem;
}

.col-filter-option:hover {
    background-color: var(--bg-base);
}

.col-filter-option input {
    cursor: pointer;
    flex-shrink: 0;
}

.col-filter-option.select-all {
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    padding-bottom: 0.45rem;
    margin-bottom: 0.2rem;
}

.col-filter-empty {
    padding: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.col-filter-panel-footer {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.col-filter-panel-footer .btn {
    flex: 1;
    justify-content: center;
    padding: 0.4rem;
    font-size: 0.78rem;
}

.sticky-col {
    position: sticky;
    right: 0;
    background-color: #ffffff !important;
    z-index: 10;
    border-left: 2px solid var(--primary) !important;
}

/* Briefly forced onto pinned/sticky AR cells during resyncArTable() so
   Chromium drops its sticky-constraints map for them before it gets
   rebuilt, instead of just reusing a possibly-stale one. */
.resync-unstick {
    position: static !important;
}

.btn-view-detail {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
    padding: 0.28rem 0.4rem !important;
    font-size: 0.7rem !important;
}

.btn-edit-ar {
    color: var(--primary) !important;
    border-color: #c7d2fe !important;
    padding: 0.28rem 0.4rem !important;
}

.btn-edit-ar:hover {
    color: #ffffff !important;
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.btn-view-detail:hover {
    background-color: var(--primary-hover) !important;
    transform: translateY(-1px);
}

/* Grand Totals Styling */
.totals-summary-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    background-color: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.4rem 1rem;
}

.totals-summary-items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.totals-summary-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.btn-icon-toolbar {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.btn-icon-toolbar:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.summary-item {
    display: flex;
    align-items: baseline;
    gap: 0.4rem;
    min-width: 0;
}

.summary-item .label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.summary-item .value {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: var(--font-heading);
}

.grand-total-row {
    background-color: #eef2f7;
}

.rcv-detail-grand-total-row {
    background-color: #dbe4f0;
}

.rcv-detail-grand-total-row td {
    border-top: 2px solid var(--border-color);
}

.rcv-detail-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.rcv-detail-result-count {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Detail Invoice modal table: fixed column widths sized to fit modal-xl
   without horizontal scroll (vs. the default excel-table nowrap, which lets
   long Nama Customer/Proyek values force overflow). */
#rcv-detail-table {
    table-layout: fixed;
    width: 100%;
}

#rcv-detail-table th,
#rcv-detail-table td {
    white-space: normal;
    overflow-wrap: break-word;
}

#rcv-detail-table th:nth-child(1),
#rcv-detail-table td:nth-child(1) {
    width: 7%;
}

#rcv-detail-table th:nth-child(2),
#rcv-detail-table td:nth-child(2) {
    width: 5%;
}

#rcv-detail-table th:nth-child(3),
#rcv-detail-table td:nth-child(3) {
    width: 12%;
}

#rcv-detail-table th:nth-child(4),
#rcv-detail-table td:nth-child(4) {
    width: 6%;
}

#rcv-detail-table th:nth-child(5),
#rcv-detail-table td:nth-child(5) {
    width: 11%;
}

#rcv-detail-table th:nth-child(6),
#rcv-detail-table td:nth-child(6),
#rcv-detail-table th:nth-child(7),
#rcv-detail-table td:nth-child(7) {
    width: 8%;
}

#rcv-detail-table th:nth-child(8),
#rcv-detail-table td:nth-child(8),
#rcv-detail-table th:nth-child(9),
#rcv-detail-table td:nth-child(9),
#rcv-detail-table th:nth-child(10),
#rcv-detail-table td:nth-child(10) {
    width: 11%;
    white-space: nowrap;
}

#rcv-detail-table th:nth-child(11),
#rcv-detail-table td:nth-child(11) {
    width: 10%;
}

/* Subtotal/grand-total label cell spans columns 1-7 via colspan, so its
   width comes from those columns combined -- keep its text on one line too. */
#rcv-detail-table .grand-total-row td:first-child {
    white-space: nowrap;
}

.grand-total-row td {
    padding: 0.5rem 0.6rem !important;
    border-top: 2px solid var(--border-color) !important;
    border-bottom: 2px solid var(--border-color) !important;
    font-size: 0.8rem;
}

/* Inline Edit Field */
.mapping-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mapping-input {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.74rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    outline: none;
    width: 190px;
    transition: var(--transition-fast);
}

.mapping-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    gap: 0.35rem;
}

.badge-success { background-color: var(--success-light); color: var(--success); }
.badge-warning { background-color: var(--warning-light); color: var(--warning); }
.badge-danger { background-color: var(--danger-light); color: var(--danger); }
.badge-neutral { background-color: var(--bg-base); color: var(--text-secondary); border: 1px solid var(--border-color); }

/* Slide-over Drawer */
.drawer-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.drawer-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.drawer-content {
    width: min(640px, 100vw);
    min-width: 320px;
    background-color: var(--bg-surface);
    border-left: 1px solid var(--border-color);
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-overlay.open .drawer-content {
    transform: translateX(0);
}

.drawer-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-title-area h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
}

.drawer-title-area p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.btn-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-close:hover {
    color: var(--text-primary);
}

.drawer-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Status Banner */
.status-banner {
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    align-items: center;
}

.banner-info { background-color: rgba(99, 102, 241, 0.1); color: #4338ca; border: 1px solid rgba(99, 102, 241, 0.2); }
.banner-success { background-color: var(--success-light); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.2); }
.banner-warning { background-color: var(--warning-light); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.2); }
.banner-danger { background-color: var(--danger-light); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.2); }

.drawer-section h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    background-color: var(--bg-base);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-group label {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.info-value {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.text-bold { font-weight: 700; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-indigo { color: #4338ca; }
.text-danger { color: var(--danger); }
.text-slate-400 { color: #94a3b8; }
.text-slate-500 { color: #64748b; }

/* Detail Table inside Drawer */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.detail-table th {
    background-color: var(--bg-base);
    color: var(--text-secondary);
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.detail-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.detail-table tfoot td {
    background: var(--bg-base);
    font-weight: 600;
}

.detail-table tfoot tr:last-child td {
    color: var(--text-primary);
    font-weight: 700;
    border-top: 2px solid var(--border-color);
}

.detail-table input {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    outline: none;
    width: 100%;
}

.detail-table input:focus {
    border-color: var(--primary);
}

.btn-delete-row {
    background: transparent;
    border: none;
    color: var(--danger);
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.btn-delete-row:hover {
    color: #dc2626;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.mr-2 { margin-right: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.border-t { border-top: 1px solid var(--border-color); }
.section-desc { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.4; }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }

/* Reconciliation summary (linked ERP invoices vs AR total) */
.reconcile-summary {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 1rem;
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.reconcile-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.reconcile-row strong {
    color: var(--text-primary);
    font-family: var(--font-heading);
}

/* Import AR drop zone */
.import-drop-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-align: center;
    padding: 2rem 1rem;
    border: 2px dashed var(--border-color);
    border-radius: 10px;
    cursor: pointer;
    transition: var(--transition-fast);
    color: var(--text-secondary);
}

.import-drop-zone i {
    font-size: 2rem;
    color: var(--text-muted);
}

.import-drop-zone:hover,
.import-drop-zone.dragover {
    border-color: var(--primary);
    background-color: var(--primary-light);
    color: var(--primary);
}

.import-drop-zone:hover i,
.import-drop-zone.dragover i {
    color: var(--primary);
}

.import-drop-zone.has-file {
    border-style: solid;
    border-color: var(--success);
}

/* Pagination Styling */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background-color: #f8fafc;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
    flex-wrap: wrap;
}

.pagination-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.pagination-info span {
    color: var(--text-primary);
    font-weight: 600;
}

.pagination-info .page-size-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.page-size-select {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
}

.pagination-divider {
    color: var(--border-color);
    font-weight: 700;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-indicator {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.page-indicator strong {
    color: var(--text-primary);
}

.span-2 {
    grid-column: span 2;
}

.drawer-form-input {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    outline: none;
    width: 100%;
    margin-top: 0.25rem;
    transition: var(--transition-fast);
}

.drawer-form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.drawer-form-input.field-error {
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.12);
}

.drawer-form-input.field-error:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.input-reset-wrapper {
    position: relative;
}

.input-reset-wrapper .drawer-form-input {
    padding-right: 2.5rem;
}

.btn-reset-input {
    position: absolute;
    top: 0.55rem;
    right: 0.35rem;
    width: 1.75rem;
    height: 1.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-reset-input:hover,
.btn-reset-input:focus-visible {
    background-color: var(--border-color);
    color: var(--text-primary);
    outline: none;
}

/* Customer Suggestions Dropdown */
.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    margin-top: 4px;
}

/*
 * The generic table wrapper scrolls horizontally and therefore clips
 * absolutely-positioned dropdowns. The invoice item table fits inside the
 * drawer, so let its product suggestions escape the wrapper and keep this
 * section above the Totals card that follows it.
 */
.erp-invoice-items-section {
    position: relative;
    z-index: 20;
}

.erp-invoice-items-container {
    position: relative;
    overflow: visible;
    z-index: 20;
}

#erp-inv-items-table,
#erp-inv-items-table td {
    overflow: visible;
}

#erp-inv-items-table .item-product-suggestions {
    min-width: 280px;
    z-index: 2000;
}

.suggestion-item {
    padding: 0.6rem 0.8rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: var(--bg-base);
    color: var(--primary);
}

.suggestion-item.add-new {
    color: var(--success);
    font-weight: 600;
    border-top: 1px solid var(--border-color);
    background-color: rgba(16, 185, 129, 0.05);
}

.suggestion-item.add-new:hover {
    background-color: rgba(16, 185, 129, 0.1);
}

@media (max-width: 1200px) {
    .topbar-actions .btn {
        padding: 0.5rem;
    }

    .topbar-actions .btn span {
        display: none;
    }
}

@media (max-width: 920px) {
    .controls-card,
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
    }

    .controls-card {
        gap: 0.75rem;
    }

    .search-column-box {
        flex: 0 0 auto;
        width: 100%;
    }

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

@media (max-width: 720px) {
    .main-content {
        padding: 0.5rem;
    }

    .topbar {
        height: auto;
        padding: 0.75rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .nav-menu {
        margin-left: 0;
        flex-wrap: wrap;
        justify-content: center;
    }

    .topbar-right {
        width: 100%;
        margin-left: 0;
        flex-direction: column;
        align-items: stretch;
    }

    .topbar-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .topbar-actions .btn span {
        display: inline;
    }

    .system-time {
        justify-content: center;
    }

    .stats-container {
        grid-template-columns: 1fr;
    }

    .totals-summary-items {
        grid-template-columns: 1fr 1fr;
    }

    .drawer-content {
        width: 100vw;
    }
}

@media (max-width: 520px) {
    .ar-table-container {
        max-height: 60vh;
    }

    .totals-summary-bar {
        flex-wrap: wrap;
    }

    .totals-summary-items {
        grid-template-columns: 1fr;
    }

    .stat-card,
    .controls-card,
    .grid-card,
    .totals-summary-bar {
        border-radius: 10px;
    }
}

/* Modal Popup styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content-popup {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90vw;
    min-width: 900px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content-popup.modal-xl {
    width: min(96vw, 1500px);
    min-width: min(96vw, 1100px);
}

.modal-content-popup.export-pdf-modal {
    width: min(92vw, 820px);
    min-width: min(92vw, 680px);
}

.export-column-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0 0.75rem;
}

.export-column-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    max-height: 48vh;
    overflow-y: auto;
    padding: 0.75rem;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.export-column-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
    padding: 0.55rem 0.65rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.82rem;
}

.export-column-option:hover {
    border-color: var(--primary);
}

.export-column-option input {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    accent-color: var(--primary);
}

.modal-overlay.open .modal-content-popup {
    transform: scale(1);
}

.modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex-grow: 1;
}

.lookup-table-container {
    max-height: 65vh;
    overflow-y: auto;
}

.auto-map-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.auto-map-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 0.9rem;
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
}

.auto-map-stat strong {
    color: var(--text-primary);
    font-size: 1rem;
}

.auto-map-table-container {
    max-height: 52vh;
    overflow: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.auto-map-table {
    min-width: 1050px;
}

.auto-map-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    white-space: nowrap;
}

.auto-map-table thead tr:first-child th {
    background: var(--bg-surface);
    color: var(--text-primary);
    text-align: center;
}

.auto-map-table thead tr:nth-child(2) th {
    top: 41px;
}

.auto-map-table .auto-map-divider {
    width: 42px;
    text-align: center;
    color: var(--primary);
}

.auto-map-row-check,
#auto-map-select-all {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

@media (max-width: 900px) {
    .modal-content-popup.modal-xl {
        width: 96vw;
        min-width: 0;
    }

    .auto-map-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .modal-content-popup.export-pdf-modal {
        width: 96vw;
        min-width: 0;
    }

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

.lookup-selection-footer {
    position: sticky;
    bottom: -1.5rem;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem -1.5rem -1.5rem;
    padding: 0.85rem 1.5rem;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -8px 20px rgba(15, 23, 42, 0.06);
}

.lookup-selection-summary,
.lookup-selection-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lookup-selection-summary {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.lookup-selection-summary strong {
    color: var(--text-primary);
}

#lookup-selected-total {
    color: var(--success);
}

#lookup-table tbody tr.lookup-row-selected {
    background: rgba(99, 102, 241, 0.08);
}

#lookup-table .btn-select-lookup.is-selected {
    background: var(--success);
    border-color: var(--success);
}

/* Inline Grid lookup buttons */
.btn-lookup-invoice {
    background-color: var(--primary-light);
    color: var(--primary);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-lookup-invoice:hover {
    background-color: var(--primary);
    color: #ffffff;
}
