/* =============================================
   CUSTOM STYLES - BaChe System
   ============================================= */

/* Card Improvements */
.card {
    border-radius: 12px;
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem 1.5rem;
}

.card-header h2,
.card-header h3,
.card-header h4,
.card-header h5 {
    color: white;
    margin: 0;
}

/* Table Styling */
.table {
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem 0.75rem;
}

.table-hover tbody tr {
    transition: all 0.2s ease;
    transform-origin: center center;
}

.table-hover tbody tr:hover {
    background-color: #f1f5f9;
    transform: scaleY(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.table tbody td {
    vertical-align: middle;
    padding: 0.875rem 0.75rem;
}

/* Striped tables */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,.02);
}

/* Button Improvements */
.btn {
    border-radius: 8px;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
    border: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-group .btn {
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* Badge Improvements */
.badge {
    font-weight: 500;
    padding: 0.4em 0.75em;
    border-radius: 6px;
    font-size: 0.85em;
}

/* Pagination Styling */
.pagination {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-link {
    border-radius: 8px;
    margin: 0 4px;
    border: 1px solid #dee2e6;
    color: #495057;
    font-weight: 500;
    padding: 0.5rem 0.875rem;
    transition: all 0.2s ease;
}

.page-link:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #212529;
    transform: translateY(-2px);
}

.page-item.active .page-link {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

.page-item.disabled .page-link {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

/* Search Form */
.search-form {
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #e9ecef;
}

.search-form .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.search-form .form-control,
.search-form .form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
    padding: 0.625rem 0.875rem;
}

.search-form .form-control:focus,
.search-form .form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Form Controls */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #ced4da;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Alert Styling */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

/* Modal Improvements */
.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    border-bottom: none;
    padding: 1.25rem 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
}

/* Loading Spinner */
.spinner-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Responsive Utilities */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 12px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        display: flex;
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 0.5rem;
    }
}

/* =============================================
   TABLE SCROLL + STICKY HEADER/FOOTER
   Usage: wrap your table with <div class="table-responsive table-scroll">
   ============================================= */
.table-responsive.table-scroll {
    max-height: 70vh;
    overflow: auto;
}

.table-responsive.table-scroll thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background-color: #f8f9fa;
}

.table-responsive.table-scroll tfoot th,
.table-responsive.table-scroll tfoot td {
    position: sticky;
    bottom: 0;
    z-index: 2;
    background-color: #f8f9fa;
}


/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6b3f8f 100%);
}

/* Action Buttons in Tables */
.action-buttons .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    margin: 0 2px;
}

/* Status Badges */
.status-active {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.status-inactive {
    background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
    color: white;
}

.status-pending {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.bg-transfer-out {
    background-color: #08306b !important;
    color: #fff !important;
}

.text-moveout-dark {
    color: #08306b !important;
}

/* Hover Effects */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Card Statistics */
.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
}

.stat-card p {
    margin: 0.5rem 0 0;
    opacity: 0.9;
}
