/* ==================== */
/* 1. TABLE STYLES */
/* ==================== */

/* Conditional formatting for currency cells */
.table .note {
    color: black;
    background-color: white;
}

.table .currency-usd,
.table .currency-dollar {
    color: #ffff00 !important;
    background-color: #00b050 !important;
    text-align: right;
    font-weight: bold;
}

.table .currency-aed,
.table .currency-dirham {
    color: #ffff00 !important;
    background-color: #7030a0 !important;
    text-align: right;
    font-weight: bold;
}

.table .currency-birr {
    color: #ffff00 !important;
    background-color: #00b0f0 !important;
    text-align: right;
    font-weight: bold;
}

.table .currency-rmb,
.table .currency-yuan {
    color: #ffff00 !important;
    background-color: #ff0000 !important;
    text-align: right;
    font-weight: bold;
}

/* Small text and currency symbol */
.table .small-currency {
    font-size: 0.65em;
    vertical-align: middle;
    float: left;
    margin-right: 1px;
}

.table .small-text {
    font-size: 0.75em;
    vertical-align: middle;
}

/* Responsive table improvements */
.table {
    font-size: 0.85rem;
}

.table th,
.table td {
    white-space: nowrap;
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
}

.table th {
    font-weight: 600;
}

/* Better on small screens */
@media (max-width: 575.98px) {

    .table th,
    .table td {
        padding: 0.3rem 0.25rem;
        font-size: 0.8rem;
    }

    .table .small-currency {
        font-size: 0.6em;
    }
}

/* ==================== */
/* 2. PAGINATION */
/* ==================== */

.pagination {
    --bs-pagination-font-size: 0.8rem;
    --bs-pagination-padding-x: 0.4rem;
    --bs-pagination-padding-y: 0.2rem;
    --bs-pagination-border-radius: 0.25rem;
    justify-content: center;
}

.pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    font-size: 0.85rem;
}

/* Touch-friendly on mobile */
@media (max-width: 575.98px) {
    .pagination .page-link {
        min-width: 1.6rem;
        min-height: 1.6rem;
        font-size: 0.9rem;
    }
}

/* ==================== */
/* 3. FORMS & INPUTS */
/* ==================== */

/* Improve input height for touch */
.form-control,
.form-select {
    min-height: 38px;
    padding: 0.375rem 0.75rem;
    font-size: 0.9rem;
}

/* Consistent focus ring */
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 176, 80, 0.25);
    border-color: #00b050;
}

/* ==================== */
/* 4. BUTTONS & ICONS */
/* ==================== */

/* Icon size */
.fas.fa-edit,
.fas.fa-save,
.fas.fa-trash-alt,
.fas.fa-plus-circle,
.fas.fa-download,
.fas.fa-sync-alt {
    font-size: 0.9rem;
}

/* Button padding for touch */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.85rem;
}

/* Responsive button spacing */
.btn-group .btn {
    padding: 0.25rem 0.5rem;
}

/* ==================== */
/* 5. GENERAL MOBILE UX */
/* ==================== */

/* Prevent zoom on iOS */
input,
select,
textarea,
button {
    font-size: 16px;
}

/* Ensure tap targets are large enough */
.btn,
.nav-link,
.page-link,
input,
select {
    touch-action: manipulation;
}

/* Container padding on mobile */
.container-fluid {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Card spacing */
.card {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.card-header {
    border-bottom: 1px solid #e9ecef;
}

/* Alert spacing */
.alert {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

/* Text truncate */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==================== */
/* 6. PRINT-FRIENDLY STYLES (Optional) */
/* ==================== */

@media print {

    .navbar,
    .footer,
    .btn,
    .card-header,
    .alert,
    .modal {
        display: none !important;
    }

    .container-fluid {
        max-width: 100%;
        padding: 0;
    }

    h1,
    h2,
    h3,
    table {
        page-break-inside: avoid;
    }

    table {
        font-size: 12px;
    }

    body {
        -webkit-print-color-adjust: exact;
        color-adjust: exact;
    }
}