/* =========================================
   1. GLOBAL RESETS & TYPOGRAPHY
========================================= */

html, body {
    width: 100%;
    margin: 0;
    padding: 0;
    /* overflow-x: hidden; <-- Keep this commented out unless you absolutely need it, it hides layout bugs! */
}

body {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 14px;
    color: #000;
    letter-spacing: 1px; 
    
    /* THE STICKY FOOTER ENGINE */
    display: flex;
    flex-direction: column;
    min-height: 100vh; 
}

/* Grouping the zero-margins for cleaner code */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    line-height: 20px;
}

.normal_text {
    text-align: justify;
    font-size: 0.9em;
}

.com_tx {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 14px;
    font-style: normal;
    font-weight: 600;
    color: #666666;
    line-height: 20px;
    letter-spacing: 1px;
}

/* Now we only specify what makes each heading unique! */
h1 { font-size: 20px; font-weight: bold; color: #FFF; font-style: italic; padding: 11px 0 0 20px; }
h2 { font-size: 10px; font-weight: bold; color: #FFF; padding: 13px 0 0 20px; }
h3 { font-size: 12px; font-weight: bold; color: #666; font-style: italic; padding: 0 0 0 20px; }
h4 { font-size: 16px; font-weight: bold; color: #666; font-style: italic; padding: 20px 0 0 20px; }
h5 { font-size: 16px; font-weight: bold; color: #E67300; font-style: italic; padding: 30px 0 0 20px; text-align: left; }

p {
    font-size: 12px;
    color: #333;
    line-height: 20px;
}

/* Removes blue borders on linked images */
a img { border: none; } 

/* =========================================
   Security / Hidden Fields
========================================= */
.stopit { display: none; }
.loading { background: url("images/ajax-loader.gif") no-repeat center; }

/* =========================================
    GLOBAL LINKS (Simplified)
========================================= */
a { color: #E67300; text-decoration: none; } /* Default base link */
a:hover { text-decoration: underline; } /* Default hover effect */

a.class1 { color: #E67300; text-decoration: underline; }
a.class2 { color: #FFF; text-decoration: none; }
a.class3 { color: #FFF; text-decoration: underline; }
a.class4 { color: #E67300; text-decoration: none; }
a.class5 { color: #AEAEAE; text-decoration: none; }
a.class5:hover { background-color: #F5FFD9; }
a.class6 { color: #E67300; font-weight: bold; text-decoration: none; }
a.class6:visited { color: #BEBEBE; }
a.class7 { color: #666; font-weight: bold; text-decoration: underline; }
a.class8 { color: #666; font-weight: bold; text-decoration: none; }
a.class9 { color: #666; text-decoration: none; }
a.class9:hover { background-color: #F5FFD9; }
a.class10, a.class12 { color: #E67300; font-weight: bold; text-decoration: none; }
a.class11 { color: #999; text-decoration: underline; }
a.class13 { color: #E67300; font-weight: bold; text-decoration: none; }
a.class13:visited { color: #2B82AC; }
a.class14 { color: #FFF; font-weight: bold; text-decoration: none; text-shadow: 1px 1px #666; }

/* =========================================
    LAYOUT CONTAINERS
========================================= */
.container, .container-flex {
    flex: 1 0 auto;       
    width: 100%;
    max-width: 1920px;
    
    /* THE FIX: Delete margin-left: 0px; and use auto centering! */
    margin: 0 auto;       
    
    padding: 0; /* Keep this 0 so the inner wrappers do the padding */
    box-sizing: border-box; 
}

.container-flex {
    padding: 0 20px;      /* Only the flex container gets the inner safety gap */
}

/* =========================================
    THE REUSABLE TABLE WRAPPER
========================================= */
.main-table-wrapper {
    width: 98%;           /* Tiny safety gutter on small screens */
    max-width: 1920px;    
    margin: 30px auto;    /* Centers the table gracefully under your tools */
    background: #FFF;     
    border-radius: 8px;   
    box-sizing: border-box;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 10px; 
    color: #333;
    line-height: 20px;
    letter-spacing: 1px;
}
 /* =========================================
   MEMBERS AREA HEADER (CONSOLIDATED)
========================================= */

/* 1. THE OUTER STRIP (Background spans edge-to-edge) */
header.site-header {
    width: 100%;
    background-color: transparent; 
    border-bottom: 1px solid #ddd;
    margin: 0;
    padding: 0;
}


.member-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1920px;
    margin: 0;            /* Strips the 'auto' centering */
    margin-left: 0px;     /* Pins to the left */
    padding: 10px 20px;
    box-sizing: border-box;
}

/* 3. HEADER LEFT (Hamburger & Logo) */
.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger-btn {
    cursor: pointer;
    transition: opacity 0.2s;
}
.hamburger-btn:hover { opacity: 0.8; }

/* 4. HEADER RIGHT (The Gray Bar) */
.header-right {
    display: flex;
    align-items: center;
    background-color: #666666;
    border-radius: 10px;
    height: 45px;
    padding: 0 20px;      /* Balanced padding for the bar */
    position: relative;    /* Traps the dropdown! */
}

.header-title {
    color: #FFF;
    font-size: 16px;
    font-weight: bold;
    font-style: italic;
    margin: 0;
    padding-right: 20px;
    border-right: 1px solid #888;
}

/* 5. PROFILE & DROPDOWN */
.profile-trigger {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 0 15px;
    color: #FFF;
    font-weight: 600;
}

#profile_menu {
    display: none;
    position: absolute;
    top: 55px; 
    right: 0; 
    width: 250px;
    background-color: #666;
    padding: 10px 0;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    z-index: 100;
}

#profile_menu .profile_items a {
    display: block;
    color: #FFF;
    text-decoration: none;
    padding: 12px 20px;
    transition: background 0.2s;
}
#profile_menu .profile_items a:hover {
    background-color: #E67300; 
}

/* =========================================
   6. SLIDING SIDEBAR (.sidenav2)
========================================= */
.sidenav2 {
    height: 100%;
    width: 0; 
    position: fixed; 
    z-index: 1000; /* Ensure it covers everything */
    top: 0;
    left: 0;
    background: rgba(224, 224, 224, 0.98); /* Solidified slightly for readability */
    overflow-x: hidden; 
    padding-top: 60px; 
    transition: 0.3s; /* Sped up from 0.5s for a snappier feel */
    border-right: 2px solid #9F9F9F;
    box-shadow: 2px 0 15px rgba(0,0,0,0.2);
}

.sidenav2 ul {
    padding: 0;
    margin: 0;
}

.sidenav2 ul li {
    list-style: none;
}

.sidenav2 a {
    padding: 15px 20px 15px 40px;
    text-decoration: none;
    font-size: 1.1em;
    color: #666;
    display: block;
    font-weight: 600;
    transition: 0.2s;
}

.sidenav2 a:hover { color: #E67300; }

.sidenav2 .closebtn {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 36px;
    padding: 0;
    color: #999;
}
.sidenav2 .closebtn:hover { color: #E67300; }

/* =========================================
   4. MODERN UNIFIED FOOTER
========================================= */

/* The main outer wrapper: Full-width dark gray background */
.modern_footer_wrp { 
    flex-shrink: 0; 
    width: 100%;
    background-color: #4C4C4C;
    padding: 40px 15px; 
    box-sizing: border-box;
    /* Top seam: a line slightly darker than the #4C4C4C footer, with a soft drop
       shadow falling just beneath it (inset, so it stays inside the footer). All modes. */
    border-top: 5px solid #333333;
    box-shadow: inset 0 7px 8px -7px rgba(0, 0, 0, 0.5);
}

/* Container to keep desktop text from stretching too wide */
.footer_inner {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    text-align: center;
}

/* The Magic Flexbox Rows */
.footer_flex_row {
    display: flex;
    justify-content: center; 
    align-items: center;
    flex-wrap: wrap; 
    gap: 60px; 
}

.top_links { margin-bottom: 25px; }
.sub_links { margin-top: 25px; margin-bottom: 35px; }

/* Clean styling for the divider lines */
.footer_divider {
    border: 0;
    border-top: 1px solid #777;
    margin: 0;
}

/* Copyright Text */
.footer_copyright {
    color: #E1E1E1;
    font-size: 14px;
    line-height: 1.8;
    margin-top: 30px;
}

/* --- FOOTER TYPOGRAPHY & LINK STYLES --- */

.modern_footer_wrp a {
    text-decoration: none; 
    transition: opacity 0.2s ease-in-out; 
}

.modern_footer_wrp a:hover {
    opacity: 0.7; 
}

/* TOP ROW: Bright White, Bold, and Thick */
.top_links a {
    color: #FFFFFF; 
    font-size: 18px; 
    font-weight: bold;
    letter-spacing: 1px; 
}

/* BOTTOM ROW: Matches the copyright text */
.sub_links a {
    color: #E1E1E1; 
    font-size: 14px;
    font-weight: normal;
}

/* =========================================
   8. GLOBAL FORM STYLES (UI KIT)
========================================= */
/* Form Rows */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}
.form-group label {
    font-family: Verdana, sans-serif;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}
.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    font-family: Verdana, sans-serif;
}
.form-control:focus {
    border-color: #E67300;
    outline: none;
    box-shadow: 0 0 5px rgba(230, 115, 0, 0.3);
}

/* Modern Buttons */
.btn-modern {
    background: #E67300;
    color: #fff;
    border: none;
    padding: 12px 25px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
    min-width: 150px;
}
.btn-modern:hover { background: #cc6600; }
.btn-secondary { background: #999; }
.btn-secondary:hover { background: #777; }
.btn-group { display: flex; gap: 15px; justify-content: center; margin-top: 20px; }

/* jQuery Validation Error Styles */
label.error {
    color: #ED7476;
    font-size: 0.85em;
    font-weight: 600;
    display: block;
    margin-top: 5px;
}
input.error, select.error {
    border: 1px solid #ED7476;
    background: #FFEDED;
}

/* =========================================
   9. PAGE SPECIFIC: ACCOUNT DETAILS
========================================= */
.account-container {
    max-width: 800px;
    margin: 40px auto;
    background: #FFFFFF;
    border: 2px solid #9F9F9F;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}
.account-header {
    background-color: #E67300;
    color: #FFFFFF;
    padding: 15px 25px;
    font-family: Verdana, Geneva, sans-serif;
    font-size: 1.1em;
    font-weight: 600;
    letter-spacing: 1px;
}
.account-body {
    padding: 30px;
}
.security-section {
    background: #fdf5ef; 
    border: 1px solid #fbdcb8;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 40px;
}

/* Keep the Tokyo clock on a single line */
#tP {
    white-space: nowrap;
}

/* =========================================
   QUICK SEARCH DROPDOWN ACCORDION (DASHBOARD)
========================================= */
.quick-search-wrapper {
    position: relative;
}

#qs-trigger {
    cursor: pointer;
}

/* 1. The Main Dropdown Container */
.qs-dropdown-panel {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 10px;
    width: 400px;          
    background-color: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    z-index: 1000;
    max-height: 800px;
    overflow-y: auto;
    display: none;
}

/* Show class for JS toggle */
.qs-dropdown-panel.show {
    display: block;
}

/* --- QUICK SEARCH CUSTOM SCROLLBAR (Stops ragged horizontal lines) --- */
.qs-dropdown-panel::-webkit-scrollbar {
    width: 12px; /* Slightly wider so it's easy to grab */
}
.qs-dropdown-panel::-webkit-scrollbar-track {
    background: #ffffff; 
    border-left: 1px solid #eeeeee; /* Creates a clean vertical wall to cap the rows */
    border-radius: 0 6px 6px 0;
}
.qs-dropdown-panel::-webkit-scrollbar-thumb {
    background: #cccccc; 
    border-radius: 10px;
    border: 3px solid #ffffff; /* Creates a beautiful padding effect around the thumb */
}
.qs-dropdown-panel::-webkit-scrollbar-thumb:hover {
    background: #E67300; 
}

/* 2. Reset all button defaults inside the panel */
.qs-dropdown-panel button {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    width: 100%;
    text-align: left;
    border: none;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- LIGHT MODE: Country Toggles --- */
.qs-country-toggle {
    padding: 14px 20px;
    background-color: #f8f9fa; 
    color: #333333;            
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: 3px 4px 8px rgba(0,0,0,0.08); 
    transition: all 0.2s ease-in-out;
    cursor: pointer;
    position: relative; 
}

.qs-country-toggle:hover,
.qs-country-toggle.active {
    color: #E67300 !important;
    background-color: #ffffff !important; 
    box-shadow: 0 6px 16px rgba(0,0,0,0.08); 
    z-index: 10; 
}

/* --- LIGHT MODE: Make Toggles --- */
/* --- LIGHT MODE: Make Toggles --- */
.qs-make-toggle,
.qs-post-link {
    transition: all 0.2s ease; 
    background-color: #ffffff; 
    border-bottom: 1px solid #eeeeee; 
    color: #333333; 
    
    /* THE FIX: 14px top/bottom padding to make it a fat, thumb-friendly row! */
    padding: 14px 25px 14px 20px; 
    font-size: 14px; /* Ensures the text size matches the models perfectly */
}

/* Merged the hover/active states so they don't fight */
.qs-make-toggle:hover,
.qs-make-toggle.active,
li.qs-post-link:hover,
li.qs-post-link.active-model {
    background-color: #f0f0f0 !important;
    border-left: 4px solid #E67300 !important; 
    padding-left: 11px !important; 
    color: #E67300 !important;
}

li.qs-post-link.active-model {
    font-weight: bold; 
}

li.qs-make-toggle:active,
li.qs-post-link:active {
    background-color: #ffe0b2 !important; 
    border-left: 4px solid #cc6600 !important; 
    padding-left: 11px !important;
    transition: none !important; 
}

/* --- PILLS & COUNTS (Fatter & Light Mode Correct) --- */
.model-count-badge {
    background-color: #f0f0f0;
    color: #888888;
}

/* --- PILLS & COUNTS (White bg, crisp border, nudged left) --- */
.model-count-badge,
.qs-count {
    font-size: 11px;
    font-weight: bold;
    background-color: #ffffff !important; 
    border: 1px solid #cccccc !important; 
    padding: 2px 10px !important;   
    border-radius: 12px !important;
    color: #555555 !important;            
    margin-right: 20px !important; /* THE FIX: A massive 20px bumper so they safely clear the scrollbar! */
}

/* --- LIGHT MODE: Models List (Fatter Rows, Safety Padding) --- */
.qs-model-list {
    background-color: #ffffff; /* Pure white base */
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.qs-model-list a {
    color: #333333; 
    text-decoration: none;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    padding: 14px 30px 14px 30px; 
    font-size: 14px;
    border-bottom: 1px solid #F1F1F1 !important; /* THE FIX: A much softer, lighter grey */
    transition: all 0.2s ease;
}

.qs-model-list a:hover {
    color: #E67300;
    padding-left: 36px; 
    background-color: #f5f5f5; /* Clean light grey highlight */
}

/* =========================================
   DATATABLES (MERGED)
========================================= */

/* 1. The Flattened Table */
table.dataTable,
.reborn-table {
    width: 100%;
    border-collapse: collapse !important; 
    font-size: 10px !important; /* Shrunk to 12px */
}

/* 2. Modern Header (Replacing the old heavy #999898) */
table.dataTable thead th,
.reborn-table th {
    background-color: #F8F9FA !important; 
    color: #555555 !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 10px !important; /* Headers shrunk to 11px */
    letter-spacing: 0.5px;
    padding: 6px !important; /* Tighter header padding */
    border-bottom: 2px solid #EAEAEA !important;
    text-align: left;
    text-shadow: none !important; 
    white-space: normal !important;
}

/* 3. Tight Cell Padding (Preserved from your code) */
table.dataTable tbody td,
.reborn-table td {
    padding: 2px 4px !important; /* Ultra-tight cell padding */
    border-bottom: 1px solid #F0F0F0;
    color: #444444;
    vertical-align: middle;
    white-space: normal !important; 
    word-wrap: break-word !important;
    word-break: break-word !important; /* Forces long unbroken strings to wrap */
}

/* 4. Full Background Cells (Preserved) */
td.full-bg-cell {
    padding: 0 !important; /* Remove cell padding so inner div expands perfectly */
}

td.full-bg-cell > div {
    min-height: 52px;      /* Ensure background div reaches top/bottom of photo rows */
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 4px;      /* Restores inner text spacing */
}

/* 5. Utility Classes (Preserved) */
.center-all td, .center-all th { text-align: center; }
.ppics { text-align: center; padding: 3px 0px !important; }
.numbs { text-align: right; padding-right: 10px; }
.vwide { text-align: center; width: 200px; }

/* 6. Zebra striping and hover */
.reborn-table tbody tr:nth-child(even) { background-color: #FAFAFA; }
.reborn-table tbody tr:hover { background-color: #FFF5EB; }

div.dt-container div.dt-search input {
    width: 170px !important;
    min-width: 170px !important;
    max-width: 170px !important;
    flex: 0 0 170px !important; 
    box-sizing: border-box !important;
}

/* SS Button */
.ss-action-btn {
    display: inline-block;
    padding: 4px 12px;
    min-width: 180px;
    background-color: #f8f9fa; /* Clean light gray */
    border: 1px solid #ddd;    /* Subtle light border */
    border-radius: 4px;
    color: #333333;            /* Dark text for contrast */
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

/* 2. Hover State (Brand orange looks great in both modes!) */
.ss-action-btn:hover {
    background-color: #e67300; 
    border-color: #e67300;
    color: #ffffff;
}

/* =========================================
   DATATABLES 2.0 - GLOBAL TOP/BOTTOM CONTROLS 
========================================= */

/* 1. The Labels (Search & Dropdown text) */
.dt-search label,
.dt-length label {
    font-size: 0px !important;
    display: none;
}
/* 2. The Inputs & Select Boxes (Merged and Cleaned) */
.dt-length select,
.dt-search input {
    font-size: 10px;        
    color: #555555;
    padding: 2px 6px; 
    margin-right: 10px;      
    height: auto; 
    border: 1px solid #ccc; 
    border-radius: 3px;
}
.dt-search input { margin-right: 20px; }
.dt-length select { margin-left: 20px; width: 50px !important; height: 26px !important;}
.dt-buttons { margin-right: 20px; }

/* 3. The Bottom Info Text ("Showing 1 to 10...") */
.dt-info {
    padding: 15px 25px !important;
    color: #888888;
    font-size: 10px; 
}

.dt-paging .pagination .page-link {
    font-size: 10px;
    padding: 4px 8px;
}

/* =========================================
   TABLE SUMMARY AREA
========================================= */
.table-summary-container {
    width: 98%;           
    max-width: 1920px;
    margin: 10px auto 0;  
    padding: 0 10px;      
    box-sizing: border-box;
}

.summary-top-row {
    display: flex;
    align-items: center;  
    gap: 30px;            
    margin-bottom: 5px;   
}

.overdue-text {
    color: #CC3300;       
    font-weight: bold;
}

/* =========================================
   SEARCH RESULTS DATATABLES CSS
========================================= */
.results-card { margin-top: 30px; }
.results-card-header {
    background: #fafafa; border-bottom: 1px solid #eeeeee; padding: 15px 20px; 
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;
}
.results-title-group { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.results-title { margin: 0; font-size: 18px; color: #333; font-weight: bold; }
.results-count { font-weight: bold; color: #E67300; font-size: 14px; margin-top:12px; }
.results-total { color: #666; font-size: 14px; margin-top:12px; }
.live-inventory-label { font-size: 12px; color: #888; }
.table-scroll-wrapper { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 10px; }
.results-footer-gap { padding: 30px 30px 0px 30px; font-size:12px; color:#FF6600; }
.results-footer-text { padding: 0px 30px 0px 40px; font-size:12px; line-height:5px; }

/* =========================================
   MEMBERS HEADER (FINAL POLISH)
========================================= */
.members-top-nav {
    display: flex;
    align-items: stretch; 
    width: 100vw;
    min-width: 0;        /* was 980px — let the header narrow below 980 (see responsive rules below) */
    padding-top: 6px;
}

.nav-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    /* Bridge the logo into the grey menu button (left) and title panel (right):
       the #666 leaks in from both flush edges and fades to transparent behind the
       wordmark, so the logo still floats on the dark. Tune the 18%/82% stops to
       widen or narrow the clear centre (smaller % = shorter, quicker fade). */
    background: linear-gradient(to right,
        #666666 0%,
        rgba(102, 102, 102, 0) 28%,
        rgba(102, 102, 102, 0) 72%,
        #666666 100%);
}
.nav-logo img { display: block; }

.nav-dashboard-panel {
    display: flex;
    flex-grow: 1;
    background-color: #666666;
    border-radius: 0px 10px 10px 0px;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    margin-right: 20px;
    height: 45px;
    overflow: hidden; 
}

.nav-page-name {
    margin: 0;
    color: #FFFFFF !important;
    font-size: 22px;
    font-style: italic;
    font-weight: bold;
    margin-right: 20px;
    line-height: 45px;
}

.nav-balance-text {
    color: #FFFFFF !important;
    font-size: 16px;
    font-style: italic;
    line-height: 45px;
}

.profile-name-text {
    color: #FFFFFF !important;
    font-weight: bold;
    margin-right: 12px;
    font-size: 14px;
    white-space: nowrap; 
}

.nav-profile-group {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0; 
}

.profile-icon img { vertical-align: middle; }

/* =========================================
   MEMBERS HEADER (UNIFIED H1)
========================================= */
.nav-combined-heading {
    margin: 0;
    margin-top: -10px;    
    color: #FFFFFF !important;
    font-size: 20px;
    font-style: italic;
    font-weight: bold;
    white-space: nowrap;
    display: flex;
    align-items: center;
    line-height: 1;      
}

.nav-balance-sep { margin: 0 12px; font-weight: normal; opacity: 0.8; }
.nav-balance-inline { font-size: 16px; font-weight: normal; color: #FFFFFF !important; display: inline-block; min-width: 60px; }

/* =========================================
   RESPONSIVE HEADER — progressive disclosure
   As the window narrows, drop the least-important
   items first so the bar never overflows:
     1. balance  ->  2. member name  ->  3. page title
   (Breakpoints are easy to nudge once seen live.)
========================================= */

/* 1. Balance is the first to go */
@media (max-width: 1080px) {
    .nav-balance-sep,
    .nav-balance-inline {
        display: none;
    }
}

/* 2. Then the member's name (they already know who they are) */
@media (max-width: 860px) {
    .profile-name-text {
        display: none;
    }
}

/* 3. Last, the page title — the page itself already shows its own heading */
@media (max-width: 680px) {
    .nav-title-group {
        display: none;
    }
}

/* =========================================
   DASHBOARD ACTION BAR (MATCHING PROFILE MENU)
========================================= */
.dashboard-action-bar {
    display: flex; flex-wrap: wrap; gap: 15px; padding: 20px 0;       
    border: none; background: transparent; margin-left: 20px;     
}

.btn-action-primary, 
.btn-action-secondary {
    display: inline-flex; align-items: center; padding: 10px 18px;
    font-size: 14px; font-weight: bold; text-decoration: none; border-radius: 4px; border: none;
    background-color: #666666; color: #FFFFFF !important; transition: background-color 0.15s ease-in-out;
    position: relative; 
}

.btn-action-primary img { filter: brightness(0) invert(1); }

.btn-action-primary:hover, 
.btn-action-secondary:hover,
.btn-action-primary:active, 
.btn-action-secondary:active {
    background-color: #E67300; 
    color: #FFFFFF !important;
    transform: scale(0.98); 
}

.notice-dot {
    position: absolute; top: -8px; right: -8px; background-color: #E67300;
    color: #ffffff; font-size: 11px; font-weight: bold; min-width: 20px;
    height: 18px;          /* was 20px */
    padding-bottom: 2px;   /* pushes the centred number up ~1px; 20px+border footprint unchanged */
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 2px solid #ffffff; box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn-action-secondary:hover .notice-badge {
    background-color: #ffffff;
    color: #E67300;
}

/* =========================================
   DARK ACCORDION SIDENAV
========================================= */
.dark-accordion-nav { background-color: #333333 !important; }
.dark-accordion-nav .closebtn { color: #FFFFFF !important; }
.accordion-wrapper { margin-top: 20px; display: flex; flex-direction: column; }

.acc-main-link,
.acc-toggle {
    background-color: transparent; color: #FFFFFF !important; padding: 16px 20px !important; 
    margin: 0 !important; text-decoration: none; font-size: 16px !important; 
    font-weight: bold; border: none; border-bottom: 1px solid #444444; text-align: left;
    cursor: pointer; width: 100%; outline: none; transition: color 0.2s ease-in-out;
    font-family: inherit; display: block; box-sizing: border-box;        
}

.acc-main-link:hover,
.acc-toggle:hover,
.acc-toggle.active {
    color: #E67300 !important; 
}

.acc-content { background-color: #262626; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out; }

.acc-content a {
    color: #CCCCCC; padding: 12px 20px 12px 30px !important; margin: 0 !important;
    text-decoration: none; display: block; font-size: 14px !important;
    border-bottom: 1px solid #333333; transition: all 0.2s ease-in-out;
}

.acc-content a:hover { color: #E67300; padding-left: 36px !important; }

.logout-confirm-link { font-weight: bold; }
.logout-confirm-link:hover { color: #ff4c4c !important; }

/* =========================================
   REBORN CARDS & DATATABLES
========================================= */
.reborn-card {
    min-width: 500px; background-color: #FFFFFF; border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12); margin-bottom: 35px;
    overflow: hidden; border: 1px solid #F0F0F0; 
}

.reborn-card-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px 15px 25px; border-bottom: 1px solid #EAEAEA;
    background-color: #FFFFFF; position: relative; 
}

.reborn-time-badge {
    position: absolute; left: 50%; transform: translateX(-50%); 
    font-size: 12px; font-weight: 500; color: #666666; background-color: #F4F4F4;
    padding: 4px 12px; border-radius: 20px; letter-spacing: 0.5px; margin: 0; 
}

.reborn-card-title {
    font-size: 18px; font-weight: bold; color: #333333; margin: 0;
    padding: 0 !important; line-height: 1 !important; display: flex; align-items: center; gap: 10px;
}
.reborn-card-body { overflow-x: auto; }
.reborn-header-actions { display: flex; gap: 12px; align-items: center; }

.btn-reborn-primary {
    background-color: #E67300; color: #FFFFFF !important; padding: 8px 16px;
    border-radius: 6px; text-decoration: none; font-weight: bold; font-size: 13px;
    border: none; transition: all 0.2s ease; cursor: pointer;
}
.btn-reborn-primary:hover { background-color: #CC6600; }

.btn-reborn-ghost {
    background-color: transparent; color: #555555 !important; padding: 8px 16px;
    border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 13px;
    border: 1px solid #CCCCCC; transition: all 0.2s ease; cursor: pointer;
}
.btn-reborn-ghost:hover { border-color: #E67300; color: #E67300 !important; }

.btn-reborn-danger {
    background-color: transparent; color: #999999 !important; padding: 6px 12px;
    text-decoration: none; font-weight: bold; font-size: 13px; border: none;
    transition: color 0.2s ease; cursor: pointer;
}
.btn-reborn-danger:hover { color: #FF4C4C !important; }

.reborn-header-center-pill {
    position: absolute; left: 50%; transform: translateX(-50%); display: flex;
    align-items: center; background: #F4F4F4; padding: 4px 15px; border-radius: 20px; z-index: 5;
}

.reborn-switch { position: relative; display: inline-block; width: 34px; height: 18px; }
.reborn-switch input { opacity: 0; width: 0; height: 0; }
.reborn-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .3s; border-radius: 18px; }
.reborn-slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 3px; bottom: 3px; background-color: white; transition: .3s; border-radius: 50%; }

input:checked + .reborn-slider { background-color: #E67300; }
input:checked + .reborn-slider:before { transform: translateX(16px); }

/* =========================================
   MINI SLIDER (For DataTables Rows)
========================================= */
.reborn-switch-sm { position: relative; display: inline-block; width: 28px; height: 14px; margin: 0; }
.reborn-switch-sm input { opacity: 0; width: 0; height: 0; }
.reborn-slider-sm { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: #ccc; transition: .3s; border-radius: 14px; }
.reborn-slider-sm:before { position: absolute; content: ""; height: 10px; width: 10px; left: 2px; bottom: 2px; background-color: white; transition: .3s; border-radius: 50%; }
.reborn-switch-sm input:checked + .reborn-slider-sm { background-color: #E67300; }
.reborn-switch-sm input:checked + .reborn-slider-sm:before { transform: translateX(14px); }

/* =========================================
   REBORN TOAST NOTIFICATIONS (Action Row)
========================================= */
.reborn-toast {
    visibility: hidden; min-width: 270px; background-color: #FFF3CD; color: #856404; 
    text-align: center; border-radius: 6px; padding: 8px 12px; position: absolute; 
    z-index: 50; left: 50%; top: 50%; transform: translate(-50%, 10px); 
    font-size: 11px; font-weight: 600; box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    border: 1px solid #FFEEBA; opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease; pointer-events: none; 
}
.reborn-toast.show { visibility: visible; opacity: 1; transform: translate(-50%, -50%); }

/* =========================================
   SVG HAMBURGER WRAPPER
========================================= */
.nav-burger {
    display: flex; justify-content: center; align-items: center; cursor: pointer;
    background-color: #666666; padding: 10px 15px; border-radius: 10px 0px 0px 10px; 
    box-sizing: content-box; margin-left: 10px; width: 32px; height: 25px;              
}
.nav-burger svg { width: 100%; height: 100%; display: block; }

/* =========================================
   GLOBAL SVG SPINNER (.aj-spinner)
========================================= */
.aj-spinner { animation: aj-spin 1s linear infinite; vertical-align: middle; }
@keyframes aj-spin { 100% { transform: rotate(360deg); } }


/* =========================================
   DARK MODE OVERRIDES
========================================= */
body.dark-mode { background-color: #121212 !important; color: #E0E0E0 !important; }

body.dark-mode .reborn-card,
body.dark-mode .reborn-card-header,
body.dark-mode .reborn-card-body { background-color: #222222 !important; border-color: #333333 !important; }
body.dark-mode .reborn-card-header { border-bottom: 1px solid #333333 !important; }
body.dark-mode .reborn-card-title { color: #E0E0E0 !important; }
body.dark-mode .results-card-header { background: #222; border-color: #333; }
body.dark-mode .results-title { color: #fff; }

body.dark-mode table.dataTable thead th,
body.dark-mode .reborn-table th { background-color: #2D2D2D !important; color: #E0E0E0 !important; border-bottom: 2px solid #444444 !important; }

body.dark-mode table.dataTable tbody td,
body.dark-mode .reborn-table td { color: #CCCCCC !important; border-bottom: 1px solid #333333 !important; }
body.dark-mode .reborn-table tbody tr:nth-child(even) { background-color: #222222 !important; }
body.dark-mode .reborn-table tbody tr:hover { background-color: #383838 !important; }

body.dark-mode .arrow-down { border-top-color: #AAAAAA !important; }
body.dark-mode .dt-length label,
body.dark-mode .dt-search label,
body.dark-mode .dt-info { color: #AAAAAA !important; }
body.dark-mode .reborn-time-badge,
body.dark-mode .reborn-header-center-pill { background-color: #333333 !important; color: #AAAAAA !important; border: 1px solid #444444 !important; }

.dark-mode table.dataTable th,
.dark-mode table.dataTable td { color: #e0e0e0 !important; }
.dark-mode .dataTables_info,
.dark-mode .dataTables_length,
.dark-mode .dataTables_filter { color: #b0b0b0 !important; }
.dark-mode .dataTables_wrapper { background-color: transparent !important; }

/* =========================================
   DARK MODE: QUICK SEARCH (DASHBOARD)
========================================= */

/* 1. Base Dropdown & Country Toggles */
.dark-mode .qs-dropdown-panel, 
.dark-mode .qs-dropdown-panel ul { background-color: #2b2b2b !important; border-color: #444444 !important; }

.dark-mode .qs-country-toggle { background-color: #2b2b2b !important; color: #e0e0e0 !important; box-shadow: 3px 4px 8px rgba(0,0,0,0.4); }
.dark-mode .qs-country-toggle:hover, 
.dark-mode .qs-country-toggle.active { background-color: #3a3a3a !important; color: #E67300 !important; box-shadow: 5px 8px 20px rgba(0,0,0,0.6); }

/* 2. Makes List */
.dark-mode .qs-dropdown-panel li, 
.dark-mode .qs-make-toggle, 
.dark-mode .qs-post-link { background-color: #2b2b2b !important; color: #e0e0e0 !important; border-bottom: 1px solid #3a3a3a !important; }

.dark-mode .qs-make-toggle:hover, 
.dark-mode li.qs-post-link:hover, 
.dark-mode li.qs-post-link.active-model { background-color: #3a3a3a !important; border-left: 4px solid #E67300 !important; padding-left: 11px !important; color: #E67300 !important; }

/* 3. Models List */
.dark-mode .qs-model-list { background-color: #2b2b2b !important; }
.dark-mode .qs-model-list a { color: #cccccc !important; border-bottom: 1px solid #3a3a3a !important; }
.dark-mode .qs-model-list a:hover { background-color: #3a3a3a !important; color: #E67300 !important; }

/* 4. Number Pills / Counts (Consolidated to the final crisp borders) */
.dark-mode .model-count-badge,
.dark-mode .qs-count { 
    background-color: #333333 !important; 
    color: #ffffff !important; 
    font-weight: normal !important; 
    border: 1px solid #555555 !important; 
}

/* 5. Custom Scrollbar */
.dark-mode .qs-dropdown-panel::-webkit-scrollbar-track { background: #2b2b2b !important; border-left: 1px solid #3a3a3a !important; }
.dark-mode .qs-dropdown-panel::-webkit-scrollbar-thumb { background: #666666 !important; border: 3px solid #2b2b2b !important; }
.dark-mode .qs-dropdown-panel::-webkit-scrollbar-thumb:hover { background: #E67300 !important; }

/* SS Button */
.dark-mode .ss-action-btn {background-color: #2a2a2a; border-color: #444; color: #ccc;}

/* =========================================
   GLOBAL RESPONSIVE MEDIA QUERIES
========================================= */
@media (min-width: 768px) {
    .form-group { flex-direction: row; align-items: flex-start; }
    .form-group label { width: 180px; margin-bottom: 0; text-align: right; margin-right: 20px; padding-top: 12px; }
    .input-wrapper { flex: 1; max-width: 400px; }
}

@media (max-width: 900px) {
    .main-table-wrapper { margin: 10px auto 30px auto; }
    table.dataTable { min-width: 800px; }
}

@media (max-width: 768px) {
    .reborn-card-header { display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 12px !important; padding-bottom: 15px !important; height: auto !important; }
    .reborn-card-header button, .reborn-card-header .btn, .reborn-card-header a, .reborn-card-header input[type="button"], .reborn-card-header input[type="submit"], .reborn-card-header form { width: 100% !important; margin: 0 !important; box-sizing: border-box !important; display: flex !important; justify-content: center !important; align-items: center !important; }
    div.dt-layout-row { flex-direction: column !important; align-items: flex-start !important; gap: 15px !important; }
    .dt-length select, .dt-search input, .dt-buttons { margin-left: 0 !important; margin-right: 0 !important; }
    .dt-search, .dt-search input { width: 100% !important; }
    .footer_flex_row { gap: 20px; flex-direction: column; }
    .mobile-hide {display: none !important;}
}