.primary-bg {
    background-color: #005e89;
}

/* ========== Modern Table Styles ========== */
table {
    border-collapse: separate;
    border-spacing: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Generic table rows (for non-datatable tables) */
.vgt-table {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}
.vgt-table thead th {
    background: #f8fafc !important;
    color: #64748b !important;
    font-weight: 600 !important;
    font-size: 11px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 12px 20px !important;
    border-bottom: 1px solid #e2e8f0 !important;
}
.vgt-table tbody td {
    padding: 14px 20px !important;
    font-size: 13px !important;
    color: #334155 !important;
    border-bottom: 1px solid #f1f5f9 !important;
}
.vgt-table tbody tr {
    transition: background 0.15s ease;
}
.vgt-table tbody tr:hover {
    background: #f8fafc !important;
}
.vgt-table tbody tr:last-child td {
    border-bottom: none !important;
}

/* Materialize datatable icon overrides */
.material-table .material-icons {
    font-size: 18px !important;
    color: #64748b;
    vertical-align: middle;
}
/* Pagination row styling */
.material-table td.footer-pagination {
    padding: 12px 20px !important;
}
/* Row-per-page select */
.material-table select {
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 13px;
    color: #334155;
    background: #f8fafc;
    outline: none;
    cursor: pointer;
    font-family: inherit;
}
.material-table select:focus {
    border-color: #005e89;
    box-shadow: 0 0 0 2px rgba(0, 94, 137, 0.1);
}
/* Print / Export / Search icons in header */
.material-table .table-header .actions {
    display: flex;
    align-items: center;
    gap: 4px;
}
.material-table .table-header .actions a,
.material-table .table-header .actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    color: #64748b;
    transition: all 0.15s ease;
}
.material-table .table-header .actions a:hover,
.material-table .table-header .actions button:hover {
    background: #f1f5f9;
    color: #005e89;
}

/* Modal modernization */
.modal-content {
    border: 1px solid #e2e8f0 !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.04) !important;
    overflow: hidden;
}
.modal-header {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 16px 20px !important;
}
.modal-header .modal-title {
    font-weight: 600;
    font-size: 16px;
    color: #1e293b;
}
.modal-body {
    padding: 20px !important;
}
.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 12px 20px !important;
}
.modal-backdrop {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* Toast modernization */
.v-toast__item {
    border-radius: 10px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 13px !important;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1) !important;
}

/* ========== Responsive / Mobile-First Utilities ========== */

/* --- Responsive tables (horizontal scroll on small screens) --- */
@media (max-width: 768px) {
    .table-responsive, .dataTables_wrapper, .vgt-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .vgt-table {
        min-width: 600px;
    }
    table {
        font-size: 12px !important;
    }
    .vgt-table thead th {
        padding: 10px 12px !important;
        font-size: 11px !important;
    }
    .vgt-table tbody td {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }
    .modal-content {
        margin: 8px !important;
        border-radius: 12px !important;
    }
    .modal-body {
        padding: 16px !important;
    }
}

/* --- Mobile: full-width modals, tight padding --- */
@media (max-width: 480px) {
    .modal-dialog {
        margin: 16px !important;
        max-width: calc(100% - 32px) !important;
    }
    .modal-header {
        padding: 12px 16px !important;
    }
    .modal-body {
        padding: 12px 16px !important;
    }
    .modal-footer {
        padding: 10px 16px !important;
    }
    /* Stacked form groups on mobile */
    .row > [class*="col-md-"],
    .row > [class*="col-lg-"] {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
}

/* --- Touch device: always show action buttons (no hover required) --- */
@media (hover: none) and (pointer: coarse) {
    .payhead-actions {
        opacity: 1 !important;
    }
    .action-btn {
        opacity: 1 !important;
    }
    /* Slightly larger tap targets */
    .action-btn {
        width: 36px;
        height: 36px;
    }
    .sidebar-toggle-btn {
        width: 40px;
        height: 40px;
    }
}

/* --- Utility: prevent content overflow on all screens --- */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

/* --- Bootstrap row gutter fix on mobile --- */
@media (max-width: 576px) {
    .row.gy-4 {
        --bs-gutter-y: 0.75rem;
    }
    .row.gy-3 {
        --bs-gutter-y: 0.5rem;
    }
}
