/* ====== GLOBAL THEME (Blue & White Dashboard) ====== */
 
.panel-body .rnr-gridtable {
 
    max-height: 400px;
    overflow-y: auto;
}
 
 /* 1. Target the specific dashboard data element panel block */
[id^="dashblockcollapse"] .panel-body,
[id^="dashblockcollapse"] .grid-body {
    max-height: 450px !important; /* Forces a maximum height limit on the panel */
    overflow-y: auto !important;   /* Spawns an internal vertical scrollbar if data overflows */
    overflow-x: auto !important;   /* Keeps your wide horizontal columns scrollable */
    position: relative !important; /* Creates a hard wall boundary for sticky headers */
}

/* 2. Lock the headers to the top of ONLY this specific scrolling panel */
[id^="dashblockcollapse"] table.r-grid > thead > tr > th {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;             /* Sticks to the absolute top of the internal panel box */
    z-index: 10 !important;        /* Higher layer value so text slides underneath seamlessly */
    background-color: #2a3f54 !important; /* Matches your dashboard panel's deep blue/gray color */
    color: #ffffff !important;
}

/* 3. Keep standard alignment anchors active */
[id^="dashblockcollapse"] .r-gridtr {
    position: static !important;
}


.r-left {
    z-index: 1050 !important; 
}
 
/* 3. Ensure the top bar also stays above the table contents but respects the layout */
.r-topheader {
    z-index: 1040 !important;
}


.rnr-gridtable thead th {
    
    position: -webkit-sticky !important; /* For Safari compatibility */
    position: sticky !important;
    
    
    /* If the table itself is the scrolling container, 0 is perfect. */
    /* If the whole page scrolls, you may need to change 0 to the height of your top bar (e.g., 55px) */
    top: 0 !important; 
    
    background: #ffffff;
    z-index: 999;
    border-bottom: 2px solid #ddd;
    
    
     background-clip: padding-box !important;
}

body.dashboard .rnr-gridtable thead th {
    top: 60px; /* adjust to match dashboard header height */
}


/* Global layout */
body {
    background-color: #f4f8ff;
    color: #222;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

/* Header */
.rnr-toplinks, .rnr-header {
    background: linear-gradient(90deg, #0d6efd, #0b5ed7);
    color: white;
    border: none;
}
.rnr-header a, .rnr-toplinks a {
    color: white !important;
    font-weight: 500;
}
.rnr-header a:hover, .rnr-toplinks a:hover {
    color: #dfe9ff !important;
}

/* Table styles */
.table, .rnr-gridtable {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
}
.rnr-grid td, .rnr-grid th {
    border-color: #e0e6f0 !important;
}
.rnr-grid tr:hover td {
    background-color: #e8f1ff !important;
}

/* Buttons */
.btn, .rnr-button {
    background-color: #0d6efd;
    color: white !important;
    border: none;
    border-radius: 8px;
    padding: 6px 16px;
    font-weight: 500;
    transition: 0.2s;
}
.btn:hover, .rnr-button:hover {
    background-color: #0b5ed7;
    box-shadow: 0 2px 6px rgba(13,110,253,0.4);
}

/* Input fields */
input[type=text], input[type=password], select, textarea {
    border: 1px solid #ccd6eb;
    border-radius: 6px;
    padding: 6px 10px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13,110,253,0.2);
    outline: none;
}

/* Cards / panels */
.panel, .rnr-cards, .rnr-fieldblock {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    padding: 16px;
}

/* Messages (success / error) */
.alert-success {
    background-color: #d1e7dd;
    border: none;
    color: #0f5132;
}
.alert-danger {
    background-color: #f8d7da;
    border: none;
    color: #842029;
}

/* Footer */
.rnr-bottom {
    background-color: #ffffff;
    color: #666;
    border-top: 1px solid #dfe6f1;
    text-align: center;
    padding: 10px;
    font-size: 13px;
}
.r-grid .r-grid-head {
    position: sticky;
    top: 60px; /* adjust based on your header height */
    z-index: 100;
    background: #fff;
}