/* PWA Safe Areas & Native App Ergonomics */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
}

body {
    padding-top: var(--safe-top);
    padding-bottom: var(--safe-bottom);
    padding-left: var(--safe-left);
    padding-right: var(--safe-right);
    background-color: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

input, textarea, select {
    user-select: auto;
}

/* Offline Notification Banner */
.offline-banner {
    position: sticky;
    top: 0;
    z-index: 1060;
    background-color: #343a40;
    color: #f8f9fa;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
    border-bottom: 2px solid #ffc107;
}

/* App Shell Desktop & Mobile Sizing */
.offcanvas-size-lg { 
    width: 800px; 
    max-width: 100vw; 
}

@media (max-width: 768px) {
    .container-fluid.app-shell-container {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .app-logo {
        height: 42px;
    }

    /* Enforce 44px touch targets on handheld touch devices */
    .btn, .form-select, .form-control {
        min-height: 44px;
    }

    .dataTables_wrapper .dataTables_filter input {
        width: 100% !important;
        margin-left: 0 !important;
        margin-top: 0.5rem;
    }
}

.table-clickable tbody tr { 
    cursor: pointer; 
    transition: background-color 0.2s ease; 
}

.table-clickable tbody tr:hover { 
    background-color: #f1f3f5; 
}

table.dataTable.table-bordered { 
    border-collapse: collapse; 
}

div.dataTables_wrapper div.dataTables_filter input { 
    border-radius: 6px; 
    padding: 0.375rem 0.75rem; 
    border: 1px solid #ced4da; 
}

.nav-tabs .nav-link { 
    color: #6c757d; 
    border: none; 
    border-bottom: 2px solid transparent; 
    padding: 1rem; 
    font-weight: 500; 
}

.nav-tabs .nav-link:hover { 
    border-color: transparent; 
    color: #212529; 
}

.nav-tabs .nav-link.active { 
    border-color: transparent; 
    border-bottom: 2px solid #0d6efd; 
    color: #0d6efd; 
    background-color: transparent; 
}

.finance-card { 
    border: 1px solid #e9ecef; 
    border-radius: 12px; 
    padding: 1.25rem; 
    background: #fff; 
}

.finance-icon { 
    width: 40px; 
    height: 40px; 
    border-radius: 8px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    margin-bottom: 1rem; 
}

.select2-container .select2-selection--single { 
    height: 38px; 
    border: 1px solid #ced4da; 
    border-radius: 0.375rem; 
}

.select2-container--default .select2-selection--single .select2-selection__rendered { 
    line-height: 36px; 
    color: #212529; 
}

.select2-container--default .select2-selection--single .select2-selection__arrow { 
    height: 36px; 
}

.tracking-wide { 
    letter-spacing: 1.5px; 
}
