/* ==========================================
   INVOICE LIST PAGE — DARK/LIGHT THEME COMPATIBLE
   ========================================== */

.invoice-list-layout-root {
    padding: 1.5rem;
    max-width: 80rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1024px) {
    .invoice-list-layout-root {
        padding: 2.5rem;
    }
}

.invoice-list-content-stack {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* ---------- Header ---------- */
.invoice-list-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

@media (min-width: 640px) {
    .invoice-list-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}

.invoice-list-header-text h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.invoice-list-header-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

.invoice-list-header-actions {
    display: flex;
    gap: 0.5rem;
}

.invoice-list-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.invoice-list-filter-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.invoice-list-filter-btn.active {
    background: var(--btn-gradient-start);
    color: #ffffff;
    border-color: var(--btn-gradient-start);
}

.invoice-list-filter-btn svg {
    width: 0.875rem;
    height: 0.875rem;
}

/* ---------- Summary Cards ---------- */
.invoice-list-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (min-width: 640px) {
    .invoice-list-summary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.invoice-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.invoice-summary-card .label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.invoice-summary-card .value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.invoice-summary-card .value.paid {
    color: #10b981;
}

.invoice-summary-card .value.unpaid {
    color: #ef4444;
}

.invoice-summary-card .value.pending {
    color: #f59e0b;
}

/* ---------- Table Wrapper ---------- */
.invoice-list-table-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.invoice-list-table-wrapper::-webkit-scrollbar {
    height: 4px;
}

.invoice-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
    color: var(--text-secondary);
}

.invoice-list-table thead {
    background: var(--bg-input);
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}

.invoice-list-table thead th {
    padding: 1rem 1.25rem;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
}

.invoice-list-table thead th:hover {
    color: var(--text-primary);
}

.invoice-list-table thead th.sortable::after {
    content: '↕';
    margin-left: 0.25rem;
    opacity: 0.5;
    font-size: 0.85rem;
}

.invoice-list-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.15s ease;
}

.invoice-list-table tbody tr:last-child {
    border-bottom: none;
}

.invoice-list-table tbody tr:hover {
    background-color: var(--bg-toggle-track);
}

.invoice-list-table tbody td {
    padding: 1rem 1.25rem;
    font-weight: 500;
    vertical-align: middle;
}

/* ---------- Invoice Link ---------- */
.invoice-list-link {
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    letter-spacing: 0.025em;
}

.invoice-list-link:hover {
    color: var(--btn-gradient-start);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ---------- Status Badge ---------- */
.invoice-list-status {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 9999px;
    text-transform: capitalize;
    white-space: nowrap;
}

.invoice-list-status.paid {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.invoice-list-status.unpaid {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.invoice-list-status.pending {
    color: #fbbf24;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ---------- Amount ---------- */
.invoice-list-amount {
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
}

.invoice-list-amount.paid {
    color: var(--text-primary);
}

.invoice-list-amount.unpaid {
    color: #ef4444;
}

/* ---------- Method Badge ---------- */
.invoice-list-method {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.375rem;
    text-transform: capitalize;
}

.invoice-list-method.bkash {
    color: #ec4899;
    background: rgba(236, 72, 153, 0.1);
    border: 1px solid rgba(236, 72, 153, 0.2);
}

.invoice-list-method.nagad {
    color: #f97316;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.invoice-list-method.rocket {
    color: #a855f7;
    background: rgba(168, 85, 247, 0.1);
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.invoice-list-method.cards {
    color: #06b6d4;
    background: rgba(6, 182, 212, 0.1);
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.invoice-list-method.manual {
    color: var(--text-muted);
    background: var(--bg-toggle-track);
    border: 1px solid var(--border-color);
}

/* ---------- Action Buttons ---------- */
.invoice-list-actions {
    display: flex;
    gap: 0.375rem;
    white-space: nowrap;
}

.invoice-list-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: none;
}

.invoice-list-action-btn.view {
    background: var(--bg-input);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.invoice-list-action-btn.view:hover {
    background: var(--bg-toggle-track);
    color: var(--text-primary);
}

.invoice-list-action-btn.pdf {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.invoice-list-action-btn.pdf:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.invoice-list-action-btn.pay {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.invoice-list-action-btn.pay:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* ---------- Pagination ---------- */
.invoice-list-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-input);
}

.invoice-list-pagination-info {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.invoice-list-pagination-actions {
    display: flex;
    gap: 0.25rem;
}

.invoice-list-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.invoice-list-page-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-muted);
}

.invoice-list-page-btn.active {
    background: var(--btn-gradient-start);
    color: #ffffff;
    border-color: var(--btn-gradient-start);
}

.invoice-list-page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ---------- Empty State ---------- */
.invoice-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
    gap: 1rem;
}

.invoice-list-empty-icon {
    width: 3rem;
    height: 3rem;
    color: var(--text-muted);
    opacity: 0.5;
}

.invoice-list-empty h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.invoice-list-empty p {
    font-size: 0.85rem;
    color: var(--text-muted);
    max-width: 20rem;
}

/* ---------- Switch Prompt ---------- */
.invoice-list-switch-prompt {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.invoice-list-switch-prompt button {
    background: none;
    border: none;
    color: var(--btn-gradient-start);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}

/* ==========================================
   BILL / INVOICE DETAILS — DARK/LIGHT THEME COMPATIBLE
   ========================================== */

.bill-layout-root {
    padding: 1.5rem;
    max-width: 80rem;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1024px) {
    .bill-layout-root {
        padding: 2.5rem;
    }
}

.bill-content-stack {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ---------- Invoice Header Card ---------- */
.bill-invoice-header {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.bill-invoice-meta {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .bill-invoice-meta {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.bill-invoice-left h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.025em;
}

.bill-invoice-left .ref {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 0.25rem;
}

.bill-invoice-left .date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
}

.bill-invoice-right {
    text-align: left;
}

@media (min-width: 768px) {
    .bill-invoice-right {
        text-align: right;
    }
}

.bill-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 9999px;
}

.bill-status-badge.paid {
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.bill-status-badge.unpaid {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.bill-invoice-right .amount {
    font-size: 2rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-top: 0.5rem;
    letter-spacing: -0.025em;
}

/* ---------- Invoice Details Grid ---------- */
.bill-details-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .bill-details-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.bill-detail-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.bill-detail-card h4 {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.bill-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.bill-detail-row:last-child {
    border-bottom: none;
}

.bill-detail-row .label {
    color: var(--text-secondary);
}

.bill-detail-row .value {
    color: var(--text-primary);
    font-weight: 600;
}

.bill-detail-row.total {
    padding-top: 1rem;
    margin-top: 0.5rem;
    border-top: 2px solid var(--border-color);
    border-bottom: none;
    font-weight: 700;
}

.bill-detail-row.total .label,
.bill-detail-row.total .value {
    font-size: 0.875rem;
    font-weight: 800;
    color: var(--text-primary);
}

.bill-detail-row.total .value {
    color: var(--btn-gradient-start);
}

/* ---------- Line Items Table ---------- */
.bill-line-items {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow-x: auto;
}

.bill-line-items::-webkit-scrollbar {
    height: 4px;
}

.bill-line-items table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.bill-line-items thead {
    background: var(--bg-input);
    border-bottom: 1px solid var(--border-color);
}

.bill-line-items thead th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    white-space: nowrap;
}

.bill-line-items tbody td {
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.bill-line-items tbody tr:last-child td {
    border-bottom: none;
}

.bill-line-items tbody tr:hover {
    background-color: var(--bg-toggle-track);
}

.bill-line-items .item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.bill-line-items .item-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.bill-line-items .item-price {
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
    white-space: nowrap;
}

/* ---------- Payment Info ---------- */
.bill-payment-info {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.bill-payment-info strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ---------- Action Buttons ---------- */
.bill-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bill-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    border: none;
}

.bill-action-btn.primary {
    background: linear-gradient(to right, var(--btn-gradient-start), var(--btn-gradient-end));
    color: #ffffff;
    box-shadow: 0 8px 20px -4px rgba(99, 102, 241, 0.3);
}

.bill-action-btn.primary:hover {
    filter: brightness(1.1);
}

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

.bill-action-btn.secondary:hover {
    background: var(--bg-toggle-track);
}

/* ---------- Switch Prompt ---------- */
.bill-switch-prompt {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.bill-switch-prompt button {
    background: none;
    border: none;
    color: var(--btn-gradient-start);
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
}