/* ══════════════════════════════════════════════════════════════════════════════
   Excel-Style Table Styling for Accounting Module
   ══════════════════════════════════════════════════════════════════════════════
   
   This CSS file provides a reusable Excel-style bordered table design that can
   be applied to any accounting table by adding the .inv-table class.
   
   Features:
   - Visible cell borders (2px solid #bfbfbf outer, 1px solid #d0d0d0 inner)
   - Alternating row shading (#ffffff and #f2f2f2)
   - Professional header styling with dark background
   - Dark mode support
   
   Usage: <table class="inv-table">...</table>
   ══════════════════════════════════════════════════════════════════════════════ */

/* ── Table base ── */
.inv-table { 
    width: 100%; 
    border-collapse: collapse; 
    font-size: 0.8rem; 
    border: 2px solid #bfbfbf; 
}

/* ── Table header ── */
.inv-table thead tr { 
    background: var(--primary-color, #7c1d1d); 
}

.inv-table thead th {
    padding: 0.55rem 0.75rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    border-right: 1px solid rgba(255, 255, 255, 0.35);
    border-bottom: 2px solid rgba(255, 255, 255, 0.4);
}

.inv-table thead th:last-child { 
    border-right: none; 
}

.inv-table thead th small {
    display: block;
    font-size: 0.62rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    text-transform: none;
    letter-spacing: 0;
}

.inv-table thead th.num { 
    text-align: right; 
}

/* ── Body rows ── */
.inv-table tbody tr { 
    border-bottom: 1px solid #d0d0d0; 
    transition: background 0.12s; 
}

.inv-table tbody td { 
    padding: 0.45rem 0.75rem; 
    vertical-align: middle; 
    color: var(--text-dark, #374151); 
    border-right: 1px solid #d0d0d0; 
    border-bottom: 1px solid #d0d0d0; 
}

.inv-table tbody td:last-child { 
    border-right: none; 
}

.inv-table tbody tr:last-child td { 
    border-bottom: none; 
}

/* Alternating row shading (Excel-style) */
.inv-table tbody tr:nth-child(odd) { 
    background: #ffffff; 
}

.inv-table tbody tr:nth-child(even) { 
    background: #f2f2f2; 
}

/* ── Footer ── */
.inv-table tfoot tr td { 
    padding: 0.5rem 0.75rem; 
    background: #e8e8e8; 
    border-top: 2px solid #bfbfbf; 
    border-right: 1px solid #d0d0d0; 
    font-weight: 700; 
}

.inv-table tfoot tr td:last-child { 
    border-right: none; 
}

/* ── Cell helpers ── */
.inv-table .num { 
    text-align: right; 
    font-variant-numeric: tabular-nums; 
}

.inv-table .fw-bold { 
    font-weight: 700; 
}

.inv-table .fw-semi { 
    font-weight: 600; 
}

.inv-table .muted-text { 
    color: #94a3b8; 
    font-size: 0.75rem; 
}

/* ── Dark mode ── */
[data-theme="dark"] .inv-table { 
    border-color: #4b5563; 
}

[data-theme="dark"] .inv-table tbody td { 
    color: var(--text-dark); 
    border-color: #4b5563; 
}

[data-theme="dark"] .inv-table tbody tr:nth-child(odd) { 
    background: rgba(0, 0, 0, 0.1); 
}

[data-theme="dark"] .inv-table tbody tr:nth-child(even) { 
    background: rgba(0, 0, 0, 0.2); 
}

[data-theme="dark"] .inv-table tfoot tr td { 
    background: rgba(0, 0, 0, 0.3); 
    border-color: #4b5563; 
}
