
/* ============================================================
   MODERN TEMPLATE STYLESHEET
   Brand palette: #7CBE42 green · #F08C23 orange · #DDEECE light-green · #434143 charcoal · #E7E7E7 gray
   ============================================================ */

:root {
    /* Dynamic portal colour shades */
    --main-color:            #7cbe42;
    --main-color-rgb:        124, 190, 66;
    --main-color-darker-1:   #6aa239;
    --main-color-darker-2:   #5d8f32;
    --main-color-darker-3:   #517c2b;
    --main-color-lighter-1:  #90c85f;
    --main-color-lighter-2:  #9dcf72;
    --main-color-lighter-2-5:#aad585;
    --main-color-lighter-3:  #dfefd0;
    --main-color-lighter-4:  #ecf6e3;
    --main-color-lighter-5:  #f9fcf6;

    /* Brand fixed colours */
    --brand-green:       #7CBE42;
    --brand-orange:      #F08C23;
    --brand-orange-bg:   #FFF3E4;
    --brand-orange-rgb:  240, 140, 35;
    --brand-light-green: #DDEECE;
    --brand-charcoal:    #434143;
    --brand-gray:        #E7E7E7;

    /* Layout */
    --sidebar-width:  240px;
    --topbar-height:  52px;

    /* Sidebar */
    --sidebar-bg:          rgba(255,255,255,0.90);
    --sidebar-border:      rgba(124,190,66,0.20);
    --sidebar-text:        #5a6652;
    --sidebar-text-hover:  #2d3822;
    --sidebar-hover-bg:    rgba(124,190,66,0.09);
    --sidebar-active-bg:   rgba(124,190,66,0.15);
    --sidebar-active-text: var(--main-color-darker-2);

    /* Surface */
    --surface:        #ffffff;
    --surface-alt:    #f7f8f6;
    --content-bg:     #f2f3f0;
    --border:         #E7E7E7;
    --border-strong:  #d0d0cc;

    /* Text */
    --text-primary:   #434143;
    --text-secondary: #6b6870;
    --text-muted:     #9e9ba0;

    /* Interaction */
    --focus-ring: 0 0 0 3px rgba(124, 190, 66, 0.20);

    --radius-sm: 4px;
    --radius:    6px;
    --radius-lg: 10px;
    --radius-xl: 14px;

    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow:    0 1px 4px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);

    --transition: 0.15s ease;

    /* Radius aliases kept for gardenWaste component compat */
    --alt-radius-bottom: 0 0 6px 6px;
    --alt-radius-left:   6px 0 0 6px;

    /* Gradient design language (carried from login page) */
    --grad-sidebar-start: #527a2a;
    --grad-sidebar-end:   #7d4e1a;
    --grad-accent-start:  #8cc066;
    --grad-accent-end:    #c89050;

    /* Glassmorphism base parameters — override per-element via CSS custom properties */
    --glass-blur:        1px;
    --glass-bg-opacity:  0.5;
    --glass-tint-start:  rgba(238, 238, 238, 0.12);
    --glass-tint-end:    rgba(95, 95, 95, 0.01);
    --glass-tint-angle:    135deg;
    --glass-border-color:  rgba(140,192,102,0.3);
}


/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(160deg, #edf4e6 0%, #f4ede4 100%) fixed;
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--main-color); text-decoration: none; }
a:hover { text-decoration: none; color: var(--main-color-darker-1); }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }
hr { border: 0; border-bottom: 1px solid var(--border); margin: 16px 0; }

::-webkit-input-placeholder { color: var(--text-muted); }
::-moz-placeholder           { color: var(--text-muted); }
:-ms-input-placeholder        { color: var(--text-muted); }
::placeholder                 { color: var(--text-muted); }


/* ============================================================
   LAYOUT SHELL
   ============================================================ */
#app {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 10;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
#sidebar {
    /* Glass override — stronger blur, slightly more opaque than top/footer */
    width: var(--sidebar-width);
    background:
        linear-gradient(var(--glass-tint-angle), var(--glass-tint-start) 0%, var(--glass-tint-end) 100%),
        rgba(255, 255, 255, var(--glass-bg-opacity));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-right: 1px solid var(--glass-border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0; top: var(--topbar-height); bottom: 0;
    z-index: 300;
    transition: width 0.25s ease, transform 0.25s ease;
    overflow: hidden;
}

/* Scrollable nav area */
#sidebar-scroll {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 0 4px;
}

#sidebar-scroll::-webkit-scrollbar { width: 3px; }
#sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
#sidebar-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.10); border-radius: 2px; }

/* Footer */
#sidebar-footer {
    padding: 8px 10px 10px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

/* Mobile overlay */
#sidebar-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 299;
    backdrop-filter: blur(2px);
}
#sidebar-overlay.visible { display: block; }


/* ============================================================
   SIDEBAR COLLAPSE BUTTON
   ============================================================ */
.sidebarCollapseBtn,
.sidebarFooterBtn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: 12px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
}
.sidebarCollapseBtn:hover,
.sidebarFooterBtn:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text-hover); }
.sidebarCollapseBtn .collapse-icon { font-size: 10px; transition: transform 0.25s ease; }
.sidebar-pin-icon  { font-size: 11px; transition: transform 0.25s ease, color var(--transition); }
.sidebar-hide-icon { font-size: 11px; }
#app.sidebar-pinned .sidebar-pin-icon { transform: rotate(-45deg); color: var(--main-color); }

/* Collapsed (icon-only / pinned) state */
#app.sidebar-collapsed #sidebar   { width: 56px; overflow: visible; }
#app.sidebar-collapsed #sidebar-scroll { overflow: visible; }
#app.sidebar-collapsed #main-wrap { margin-left: 56px; }

#app.sidebar-collapsed .menuText,
#app.sidebar-collapsed .sub-arrow,
#app.sidebar-collapsed .collapseText,
#app.sidebar-collapsed .sidebarBtnText { display: none; }

#app.sidebar-collapsed .sidebarCollapseBtn .collapse-icon { transform: rotate(180deg); }

#app.sidebar-collapsed #menu ul li a {
    justify-content: center;
    padding: 8px 6px;
}
#app.sidebar-collapsed .menuIcon          { width: auto; opacity: 0.85; }
#app.sidebar-collapsed .sidebarCollapseBtn { justify-content: center; padding: 6px; }
#app.sidebar-collapsed .sidebarFooterBtn   { justify-content: center; padding: 6px; }
#app.sidebar-collapsed .reportBug         { justify-content: center; padding: 6px; }

/* Hidden (completely off-screen) state */
#app.sidebar-hidden #sidebar   { transform: translateX(calc(-1 * var(--sidebar-width))); }
#app.sidebar-hidden #main-wrap { margin-left: 0; }

/* Sub-menu flyouts in icon-only mode
   JS only manages .flyout-open; all positioning is pure CSS. */

/* Remove h-padding from the icon-bar ul so each li spans the full 56px sidebar width,
   making left:100% land exactly at the sidebar's right edge. */
#app.sidebar-collapsed #menu > ul { padding: 2px 0; }

/* Every li.has-sub at any level becomes the containing block for its flyout. */
#app.sidebar-collapsed #menu ul li.has-sub { position: relative; }

#app.sidebar-collapsed #menu ul .subMenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    min-width: 200px;
    background:
        linear-gradient(var(--glass-tint-angle), var(--glass-tint-start) 0%, var(--glass-tint-end) 100%),
        rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border-color);
    border-radius: var(--radius);
    padding: 4px 4px 4px 0;
    z-index: 400;
    box-shadow: var(--shadow-md);
}
#app.sidebar-collapsed #menu ul li.has-sub.flyout-open > .subMenu { display: block; }
#app.sidebar-collapsed #menu ul .subMenu li a {
    color: var(--text-primary);
    font-size: 12px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    justify-content: flex-start;
}
#app.sidebar-collapsed #menu ul .subMenu li a:hover {
    background: var(--sidebar-hover-bg);
    color: var(--text-primary);
}
/* Show text elements that are hidden in icon-only mode */
#app.sidebar-collapsed #menu ul .subMenu .menuText { display: block; }
#app.sidebar-collapsed #menu ul .subMenu .sub-arrow { display: flex; }


/* ============================================================
   NAVIGATION MENU
   ============================================================ */
#menu { padding: 0; }

#menu ul { padding: 2px 8px; }
#menu ul li { margin-bottom: 1px; }

#menu ul li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius);
    color: var(--sidebar-text);
    font-size: 13px;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
    white-space: nowrap;
    overflow: hidden;
}

#menu ul li a:hover {
    background: var(--sidebar-hover-bg);
    color: var(--sidebar-text-hover);
}

#menu ul li.active > a {
    background: var(--sidebar-active-bg);
    color: var(--sidebar-active-text);
    font-weight: 600;
}

.menuIcon {
    width: 14px;
    font-size: 12px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.75;
}

#menu ul li a:hover .menuIcon,
#menu ul li.active > a .menuIcon { opacity: 1; }

.menuText { flex: 1; overflow: hidden; text-overflow: ellipsis; }

.sub-arrow {
    font-size: 9px;
    opacity: 0.35;
    flex-shrink: 0;
    transition: transform var(--transition);
}
#menu ul li.has-sub.active > a .sub-arrow { transform: rotate(90deg); opacity: 0.6; }

/* Sub-menus */
#menu ul .subMenu {
    padding: 2px 4px 2px 23px;
    border-left: 1px solid var(--sidebar-border);
    margin-left: 13px;
    margin-bottom: 2px;
}

#menu ul .subMenu li a {
    font-size: 12px;
    padding: 5px 8px;
    color: var(--text-muted);
    font-weight: 400;
}
#menu ul .subMenu li a:hover { color: var(--sidebar-text-hover); }
#menu ul .subMenu li.active > a {
    color: var(--sidebar-active-text);
    font-weight: 500;
}

#menu ul .subMenu .subMenu {
    margin-left: 10px;
    padding-left: 10px;
}

/* Bug report link */
.reportBug {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius);
    color: rgba(176,174,177,0.65);
    font-size: 12px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    width: 100%;
    border: none;
    background: none;
    font-family: inherit;
}
.reportBug:hover { background: var(--sidebar-hover-bg); color: var(--sidebar-text); }
.bugIcon { font-size: 11px; }


/* ============================================================
   MAIN WRAP
   ============================================================ */
#main-wrap {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;      /* prevent flex item expanding past viewport when table content overflows */
    overflow-x: clip;  /* clip without creating a scroll container — keeps position:sticky working */
    transition: margin-left 0.25s ease;
}


/* ============================================================
   TOP BAR
   ============================================================ */
#top-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-height);
    background:
        linear-gradient(var(--glass-tint-angle), var(--glass-tint-start) 0%, var(--glass-tint-end) 100%),
        rgba(255, 255, 255, var(--glass-bg-opacity));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-bottom: 1px solid var(--glass-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 350;
    gap: 12px;
    flex-shrink: 0;
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
}

#top-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

#sidebar-toggle {
    display: flex;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px 8px;
    border-radius: var(--radius);
    font-size: 15px;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}
#sidebar-toggle:hover { background: var(--surface-alt); color: var(--text-primary); }

.page-title-icon {
    font-size: 14px;
    color: var(--main-color);
    flex-shrink: 0;
}

#page-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#top-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#top-bar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.topbar-logo {
    height: 26px;
    width: auto;
    flex-shrink: 0;
    filter: brightness(0);
}

.topbar-brand-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.topbar-product {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    line-height: 1.2;
    letter-spacing: 0.01em;
}

.topbar-portal {
    font-size: 10px;
    color: var(--text-secondary);
    white-space: nowrap;
    line-height: 1.2;
}

.topbar-divider {
    width: 1px;
    height: 20px;
    background: var(--glass-border-color);
    flex-shrink: 0;
    margin: 0 4px;
}


/* ============================================================
   CONTENT
   ============================================================ */
#content {
    flex: 1;
    padding: 24px;
}

/* Headings */
#content h1 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    margin-bottom: 20px;
    padding-bottom: 12px;
    position: relative;
}
#content h1::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 40px; height: 2px;
    background: var(--main-color);
    border-radius: 2px;
}

h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); margin-bottom: 16px; position: relative; display: block; width: 100%; }
h2 { font-size: 17px; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; }
h3 { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 10px; }
h4 { font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.04em; }

h1::before { content: none; }


/* ============================================================
   FOOTER
   ============================================================ */
#footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background:
        linear-gradient(var(--glass-tint-angle), var(--glass-tint-start) 0%, var(--glass-tint-end) 100%),
        rgba(255, 255, 255, var(--glass-bg-opacity));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--glass-border-color);
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* Back to top */
.backToTop {
    position: fixed;
    bottom: 20px; right: 20px;
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), color var(--transition);
    z-index: 100;
}
.backToTop:hover { color: var(--text-primary); box-shadow: var(--shadow-md); }

@keyframes animateArrow {
    0%      { transform: translateY(0);     opacity: 1; }
    50%     { transform: translateY(-150%); opacity: 0; }
    50.01%  { transform: translateY(150%);  opacity: 0; }
    100%    { transform: translateY(0);     opacity: 1; }
}
.btt-icon.animate { animation: animateArrow 0.9s ease-in-out forwards; }


/* ============================================================
   USER PANEL / STATUS WIDGET
   ============================================================ */
#user_panel { position: relative; display: flex; align-items: center; gap: 8px; }

/* Status badge */
#status_badge {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
    letter-spacing: 0.02em;
}
#user_panel.testing #status_badge { color: #7a4a00; background: #fff4e0; border-color: #fac36a; }
#user_panel.live    #status_badge { color: #2a6534; background: #eaf7ee; border-color: #7ed49a; }

.status-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
#user_panel.testing .status-dot { background: var(--brand-orange); }
#user_panel.live    .status-dot { background: #3cb86a; animation: pulse-green 2s infinite; }

@keyframes pulse-green {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* User button */
#user_button {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 8px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface-alt);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition);
    user-select: none;
}
#user_button:hover { background: var(--brand-gray); border-color: var(--border-strong); }
#user_button .fa-circle-user { font-size: 16px; color: var(--main-color); }
#user_button .user_chevron { font-size: 9px; color: var(--text-muted); transition: transform var(--transition); }
#user_panel.open #user_button .user_chevron { transform: rotate(180deg); }
#user_button .fa-circle-user, #user_button_icon { font-size: 20px; }

/* Dropdown */
#user_panel_content {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    min-width: 216px;
    overflow: hidden;
    z-index: 500;
}
#user_panel.open #user_panel_content { display: block; }

#user_panel_status_text {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 500;
    border-bottom: 1px solid var(--border);
}
#user_panel.testing #user_panel_status_text { color: #7a4a00; background: #fff9f0; }
#user_panel.live    #user_panel_status_text { color: #2a6534; background: #f3faf5; }

#user_panel_links { padding: 6px; }

.user_panel_link {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-primary);
    transition: background var(--transition);
}
.user_panel_link:hover { background: var(--surface-alt); color: var(--text-primary); }
.user_panel_link i { width: 14px; text-align: center; color: var(--text-muted); font-size: 12px; }
.user_panel_logout { color: #c0392b; }
.user_panel_logout:hover { background: #fff5f5; }
.user_panel_logout i { color: #e74c3c; }


/* ============================================================
   SESSION EXPIRY POPUP
   ============================================================ */
.expiryPopup {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--brand-orange-bg);
    border: 1px solid var(--brand-orange);
    color: #7a3c00;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    white-space: nowrap;
    font-family: inherit;
    transition: box-shadow var(--transition);
}
.expiryPopup:hover { box-shadow: var(--shadow-lg); }
.expiryPopupIcon { color: var(--brand-orange); }


/* ============================================================
   BACKGROUND AJAX REQUESTS
   ============================================================ */
#backgroundAjaxRequests {
    position: fixed;
    top: 70px; right: 16px;
    z-index: 9000;
    width: 300px;
    display: none;
}

.backgroundAjaxRequest {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 12px 14px;
    margin-bottom: 8px;
    font-size: 13px;
    position: relative;
}
.hideRequest { position: absolute; right: 10px; top: 10px; cursor: pointer; color: var(--text-muted); border: none; background: none; }
.hideRequest:hover { color: var(--text-primary); } }
.requestName { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.requestState { font-size: 10px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.requestText { font-size: 11px; color: var(--text-secondary); }
.requestProgress { width: 100%; margin-top: 6px; }
.requestLink:hover { text-decoration: underline; }

progress[value] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 100%;
    height: 4px;
    background: var(--brand-gray);
    border-radius: 2px;
}
progress::-webkit-progress-bar  { background: var(--brand-gray); border-radius: 2px; }
progress::-webkit-progress-value{ background: var(--main-color); border-radius: 2px; }
progress::-moz-progress-bar     { background: var(--main-color); border-radius: 2px; }


/* ============================================================
   CARDS & PANELS
   ============================================================ */
.card, .panel {
    background: rgba(255,255,255,0.78);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.55);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 20px;
    margin-bottom: 16px;
}

.card-header, .panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-title, .panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Section wrapper (replaces .wrapper in gardenWaste) */
.wrapper { max-width: 100%; margin: 0 auto; }
.wrapper_head { max-width: 100%; margin: 0 auto; padding-bottom: 5px; }
.clear { clear: both; }
.margin-top { margin-top: 10px; }


/* ============================================================
   BUTTONS
   ============================================================ */
.buttonRow, .btn-row {
    display: flex;
    gap: 8px;
    flex-flow: row wrap;
    width: 100%;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-sizing: border-box;
    padding: 8px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), color var(--transition), box-shadow var(--transition);
    text-align: center;
    white-space: nowrap;
    line-height: 1.4;
    text-decoration: none;
    flex-grow: 1;
    flex-shrink: 0;
}

.btn:hover {
    background: var(--surface-alt);
    border-color: var(--main-color);
    color: var(--main-color);
}

.btn.active,
.btn-primary {
    background: var(--main-color);
    border-color: var(--main-color-darker-1);
    color: #ffffff;
    box-shadow: 0 1px 3px rgba(var(--main-color-rgb), 0.30);
}
.btn.active:hover,
.btn-primary:hover {
    background: var(--main-color-darker-1);
    border-color: var(--main-color-darker-2);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(var(--main-color-rgb), 0.35);
}

/* Orange / accent variant */
.btn-accent, .btn-orange {
    background: var(--brand-orange);
    border-color: #c9701a;
    color: #ffffff;
}
.btn-accent:hover, .btn-orange:hover {
    background: #c9701a;
    border-color: #a85c12;
    color: #ffffff;
}

.btn-danger {
    background: #e74c3c;
    border-color: #c0392b;
    color: #ffffff;
}
.btn-danger:hover { background: #c0392b; color: #ffffff; }

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-alt); border-color: var(--border); color: var(--text-primary); }

.btn-sm { padding: 5px 11px; font-size: 12px; }
.btn-xs { padding: 3px 8px;  font-size: 11px; }

/* Icon-only batch buttons */
.btn-row .btn { flex: 1 1 auto; }

.quarantineBatchBtn {
    flex-grow: 0 !important;
    padding: 7px 12px;
    border-radius: var(--radius);
}
.quarantineBatchBtn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    pointer-events: none;
}

.submitButton {
    width: 100%;
    padding: 11px 16px;
    background: var(--main-color);
    border: 1px solid var(--main-color-darker-1);
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    font-family: inherit;
    color: #ffffff;
    transition: background var(--transition), box-shadow var(--transition);
}
.submitButton:hover {
    background: var(--main-color-darker-1);
    box-shadow: 0 2px 8px rgba(var(--main-color-rgb), 0.30);
}

.btn-bottom-margin { margin-bottom: 10px; }
.btn-full-width, .div-full-width { width: 100%; box-sizing: border-box; }

/* Disabled state */
.disabled, button:disabled, input:disabled {
    background: #f0f0ef !important;
    color: var(--text-muted) !important;
    border-color: var(--border) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}


/* ============================================================
   TABS
   ============================================================ */
.tabs {
    width: 100%;
    margin-bottom: 16px;
    position: relative;
}

/* Tab list */
.tabs > ul {
    width: 100%;
    list-style: none;
    display: flex;
    flex-flow: row wrap;
    gap: 3px;
    padding: 0;
    margin: 0;
    position: relative;
    border-bottom: 2px solid var(--border);
    padding-bottom: 0;
}

.tabs > ul li { padding: 0 !important; }
.tabs > ul a { white-space: nowrap; box-sizing: border-box; }

/* Individual tab */
.tabs > ul > li {
    position: relative;
    flex: 1 1 auto;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--surface-alt);
    margin-bottom: -2px;
    transition: background var(--transition);
}

.tabs > ul > li > a {
    display: block;
    width: 100%;
    padding: 10px 16px;
    text-align: center;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    text-overflow: ellipsis;
    overflow: hidden;
    transition: color var(--transition);
    text-decoration: none;
}

/* Sub-tab chevron indicator */
.tabs > ul li > a:after {
    font-family: "Font Awesome 6 Free";
    content: "\f0d7";
    font-weight: 900;
    margin-left: 8px;
    font-size: 10px;
    opacity: 0.5;
}
.tabs > ul li > a:only-child:after { content: ''; margin-left: 0; }

.tabs > ul > li:hover {
    background: var(--brand-light-green);
}
.tabs > ul > li:hover > a { color: var(--main-color); }

/* Active tab */
.tabs > ul > li:has(a.active),
.tabs > ul > li > a.active {
    border-color: var(--border);
    background: var(--surface);
    border-bottom-color: var(--surface);
}
.tabs > ul > li > a.active {
    color: var(--main-color);
    font-weight: 600;
}
.tabs > ul > li:has(a.active) { border-color: var(--border); border-bottom-color: var(--surface); }

/* Tab content panels */
.tabs > div,
.tabs > form {
    display: none;
    border: 1px solid var(--border);
    border-top: none;
    padding: 20px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    background: var(--surface);
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-sm);
}

/* Sub-menu dropdown */
.tabs > ul > li > ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 0 var(--radius) var(--radius) var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 101;
    padding: 4px;
    list-style: none;
}

.tabs > ul > li:hover > ul { display: block; }

.tabs > ul > li > ul > li > a {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}
.tabs > ul > li > ul > li:hover a {
    background: var(--brand-light-green);
    color: var(--main-color);
}

/* Scroll tabs */
.tabs.scroll { overflow-x: clip; }
.tabs.scroll > ul { flex-flow: row; flex-wrap: nowrap; white-space: nowrap; }

.tabs.scroll .scroll-icon {
    position: absolute;
    top: 0;
    padding: 10px;
    width: 60px;
    z-index: 2;
    display: block;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    color: var(--main-color);
    background: none;
    font-family: inherit;
}
.tabs.scroll .scroll-icon.left  { left: 0;  text-align: left;  background: linear-gradient(to right, var(--surface), transparent); }
.tabs.scroll .scroll-icon.right { right: 0; text-align: right; background: linear-gradient(to left,  var(--surface), transparent); }
.tabs.scroll .scroll-icon.left:hover  { padding-left:  20px; }
.tabs.scroll .scroll-icon.right:hover { padding-right: 20px; }

/* Mini tabs */
.tabs.mini > ul > li { flex: 0 1 auto; }

/* Display sub-tab name beneath label */
.tabs.displaySubTab > ul > li > a { padding-bottom: 28px; }
.tabs.displaySubTab > ul > li > a:before {
    content: attr(data-selected-sub-tab);
    position: absolute;
    top: 28px;
    font-size: 11px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 100%;
    padding: 0 10px;
    box-sizing: border-box;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: var(--text-muted);
    font-weight: 400;
}

/* Left tabs */
.tabs.leftTabs { display: flex; flex-flow: row; }
.tabs.leftTabs > ul { flex-flow: column; flex: 1 10 auto; max-width: 220px; border-bottom: none; border-right: 2px solid var(--border); gap: 2px; padding-right: 0; }
.tabs.leftTabs > ul > li {
    flex: 0 1 auto;
    border-radius: var(--radius) 0 0 var(--radius);
    border: 1px solid transparent;
    border-right: none;
    margin-bottom: 0;
    margin-right: -2px;
}
.tabs.leftTabs > ul > li:has(a.active) { border-color: var(--border); border-right-color: var(--surface); }
.tabs.leftTabs > div { flex: 100 1 100%; border-radius: 0 var(--radius-lg) var(--radius-lg) var(--radius-lg); border: 1px solid var(--border); }

.tabs.leftTabs > ul li > a:after { content: "\f0da"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.tabs.leftTabs > ul li > a:only-child:after { content: ''; }
.tabs.leftTabs > ul > li > ul { top: 0; left: 100%; border-left: 1px solid var(--border); min-width: 180px; }

/* Tab search */
.tabSearchInput { border-bottom: 1px solid var(--border); }
.tabSearchInput .labelLeft, .tabSearchInput input[type="text"] { border-radius: 0 !important; }
.tabSearchInput input[type="text"] { border: 0; border-right: 1px solid var(--border); border-top: 1px solid var(--border); height: 36px; }
.tabs.limitTabDropDown > ul > li > ul { max-height: 280px; overflow-y: auto; }

/* Mobile tabs */
@media only screen and (max-width: 600px) {
    .tabs > div, .tabs > form { padding: 12px; }
    .tabs:not(.scroll) > ul { flex-flow: column; border-bottom: none; }
    .tabs:not(.scroll) > ul > li { border-radius: var(--radius); border: 1px solid var(--border); margin-bottom: 2px; }
    .tabs:not(.scroll) > ul > li:has(a.active) { border-color: var(--main-color); }
}
@media only screen and (max-width: 1000px) {
    .tabs .tabSearchInput .labelLeft { display: none; }
    .tabs .tabSearchInput input[type="text"] { border-left: 1px solid var(--border); }
}


/* ============================================================
   FILTER BARS
   ============================================================ */
.filterBar {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    background:
        linear-gradient(var(--glass-tint-angle), var(--glass-tint-start) 0%, var(--glass-tint-end) 100%),
        rgba(255, 255, 255, var(--glass-bg-opacity));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border-color);
    border-radius: var(--radius-lg);
    padding: 12px 14px;
    display: flex;
    flex-flow: row wrap;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-sm);
}

/* Primary search filter bar */
.filterBar.searchFilterBar {
    background:
        linear-gradient(var(--glass-tint-angle), var(--glass-tint-start) 0%, var(--glass-tint-end) 100%),
        rgba(255, 255, 255, var(--glass-bg-opacity));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border-color);
}

.filterBarAlt { border-top-left-radius: 0; }

.filterBar form {
    width: 100%;
    padding: 0;
    display: flex;
    flex-flow: row wrap;
    justify-content: flex-start;
    gap: 8px;
    align-items: center;
}

.filterBar .formItem {
    width: auto;
    flex-grow: 1;
    margin: 0;
    min-width: 140px;
}

.filterBar .formItem label { display: none; } /* hide labels in filter bars */

.filterBar .btn {
    flex-grow: 0;
    flex-shrink: 0;
    padding: 0 14px;
    height: 38px;
    font-size: 12px;
}

/* Compact inputs in filter bars */
.filterBar input[type="text"],
.filterBar input[type="number"],
.filterBar input[type="search"],
.filterBar select {
    height: 38px;
    padding: 0 10px;
    font-size: 13px;
}

.filterBar .select2.select2-container { height: 38px; }
.filterBar .select2.select2-container .select2-selection { height: 36px; }
.filterBar .select2.select2-container .select2-selection .select2-selection__rendered {
    height: auto;
    line-height: 34px;
    padding-top: 0;
}

.filterBar .formItemFlex label {
    width: 38px;
    height: 38px;
    font-size: 13px;
}

/* Search input (left-icon variant) */
.searchInput {
    flex: 100 1 300px;
    margin-bottom: 0 !important;
}

.searchFilterBar > .btn { flex: 0 1 auto; }

/* Date range filter */
.dateRangeFilter {
    display: flex;
    flex-flow: row;
    align-items: center;
    gap: 8px;
    flex: 1 0 auto;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.filterBar form .doubleInput {
    width: auto;
    flex-grow: 1;
    margin: 0;
    display: flex;
    flex-flow: row wrap;
    gap: 6px;
}

/* Batch action bar (sticky bottom) */
#quarantineBatchBar {
    position: sticky;
    bottom: 0;
    z-index: 100;
    border-radius: 0;
    margin-top: 10px;
    background: var(--surface) !important;
    border: none !important;
    border-top: 2px solid var(--main-color) !important;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
}
#quarantineBatchBar #quarantineSelectedCount {
    font-size: 13px;
    font-weight: 600;
    color: var(--main-color);
    flex-shrink: 0;
}

/* Filter builder */
#filtersListDisplay { display: none; }
#filtersListContainer {
    width: 100%;
    min-height: 50px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 10px;
    position: relative;
}
#filtersListBackground {
    color: var(--text-muted);
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-transform: uppercase;
    font-size: 16px;
    z-index: 0;
}
#filtersList { width: 100%; }
.filterGroup {
    display: flex;
    flex-flow: row;
    border: 1px solid var(--border);
    width: 100%;
    padding: 6px;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
    border-radius: var(--radius);
}
.filterGroupSortable {
    flex: 1 1 auto;
    border: 1px solid var(--border);
    min-height: 52px;
    padding: 6px;
    border-radius: var(--radius-sm);
}
.filterContainer {
    display: flex;
    flex-flow: row;
    border: 1px solid var(--border);
    width: 100%;
    padding: 6px;
    margin-bottom: 8px;
    align-items: stretch;
    gap: 8px;
    background: var(--surface-alt);
    border-radius: var(--radius);
    z-index: 1;
    position: relative;
}
.filterContainer:last-of-type { margin-bottom: 0; }
.filterContainer .formItem { flex: 1 1 180px; }
.filterOperator {
    display: flex;
    flex-flow: row;
    border: 1px solid var(--border);
    width: 100%;
    padding: 6px;
    gap: 6px;
    margin-bottom: 8px;
    border-radius: var(--radius-sm);
}
.handle { flex: 0 0 auto; padding: 0 8px; display: flex; align-items: center; cursor: grab; color: var(--text-muted); }
.filterGroup .filterGroup:last-of-type,
.filterGroup .filterContainer:last-of-type,
.filterGroup .filterOperator:last-of-type { margin-bottom: 0; }

.deleteFilterBtn {
    flex: 0 0 auto;
    padding: 0 10px;
    align-items: center;
    display: flex;
    cursor: pointer;
    background: #e74c3c;
    color: #ffffff;
    border-radius: var(--radius-sm);
}
.deleteFilterBtn:hover { background: #c0392b; }


/* ============================================================
   FORMS
   ============================================================ */
form {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
}

fieldset {
    width: 100%;
    margin: 0 auto 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
legend {
    padding: 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.formColumns, .dataColumns {
    display: flex;
    flex-flow: row wrap;
    width: 100%;
    gap: 0 12px;
    margin-bottom: 12px;
}
.formColumnsSmall { display: flex; flex-flow: row wrap; width: 100%; gap: 0 10px; }

.formColumnGroup, .dataColumnGroup { flex: 1 1 500px; }
.dataColumnHalfWidth { box-sizing: border-box; max-width: 50%; }

.formItem {
    width: 100%;
    margin: 0 auto 12px;
    position: relative;
    line-height: 1.4;
}
.formItem:last-child { margin-bottom: 0; }
td .formItem { margin-bottom: 0; }
.formItemNoMarginBottom { margin-bottom: 0 !important; }
.formItemNoWidth { width: auto; }

.formColumns .formItem  { flex: 1 1 500px; }
.formColumnsSmall .formItem { flex: 1 1 250px !important; }

/* Label */
.formItem > label {
    display: block;
    width: 100%;
    padding-bottom: 5px;
    margin-bottom: 6px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: relative;
}

label::before { content: none; }

.formItem .inputInfo {
    font-size: 11px;
    color: var(--text-muted);
    padding-top: 4px;
    font-style: italic;
}

.formItem .rightLinks {
    float: right;
    position: relative;
    top: -3px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.formItem .rightLinks a { margin-left: 0; font-size: 12px; }

/* Icon-left input layout */
.formItemFlex {
    display: flex;
    flex-flow: row nowrap;
    align-items: flex-start;
    width: 100%;
    position: relative;
}

.formItemFlex label {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    background: var(--main-color);
    color: #ffffff;
    border-radius: var(--radius) 0 0 var(--radius);
    font-size: 14px;
}

.inputContainer { flex: 1 1 200px; position: relative; width: 100%; }
.inputContainer:has(.squaredCheck) { width: fit-content; }

/* Core inputs */
input[type="password"],
input[type="text"],
input[type="number"],
input[type="email"],
input[type="tel"],
input[type="search"],
select {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border-strong);
    padding: 0 12px;
    color: var(--text-primary);
    box-sizing: border-box;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

input[type="password"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="search"]:focus,
select:focus {
    border-color: var(--main-color);
    box-shadow: var(--focus-ring);
    background: #fafff7;
}

input:disabled, textarea:disabled, select:disabled {
    background: #f5f5f3;
    color: var(--text-muted);
    cursor: not-allowed;
    border-color: var(--border);
}

/* Textarea */
.formItem textarea, textarea {
    width: 100%;
    min-height: 110px;
    border: 1px solid var(--border-strong);
    padding: 10px 12px;
    resize: vertical;
    box-sizing: border-box;
    color: var(--text-primary);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 13px;
    background: var(--surface);
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    line-height: 1.5;
}
textarea:focus { border-color: var(--main-color); box-shadow: var(--focus-ring); background: #fafff7; }

/* File input */
input[type="file"] {
    width: 100%;
    border: 1px solid var(--border-strong);
    padding: 10px 12px;
    color: var(--text-primary);
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    box-sizing: border-box;
    font-family: inherit;
    font-size: 13px;
}
.filenameDisplay {
    width: 100%;
    padding: 10px 12px;
    color: #ffffff;
    background: var(--main-color);
    border-radius: 0 0 var(--radius) var(--radius);
    box-sizing: border-box;
    font-size: 12px;
}

/* Radius helpers for joined inputs */
.labelLeft { border-radius: var(--radius) 0 0 var(--radius) !important; }
.labelLeft::before { display: none; }
.inputRight  { border-radius: 0 var(--radius) var(--radius) 0 !important; }
.inputLeft   { border-radius: var(--radius) 0 0 var(--radius) !important; }
.inputNoRadius { border-radius: 0 !important; }
.labelLeft ~ .select2-container { border-radius: 0 var(--radius) var(--radius) 0; }

/* Validation */
.requirementsContainer {
    position: relative;
    top: 4px;
    font-size: 11px;
    line-height: 1.3;
    display: none;
    background: #e74c3c;
    border-radius: var(--radius);
    z-index: 1;
}
.requirementsContainer::before {
    content: '';
    position: absolute;
    top: -5px;
    left: calc(100% - 50px);
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid #e74c3c;
}
.validationRequirements, .requiredRequirements {
    padding: 5px 8px;
    color: white;
    text-align: left;
    text-transform: uppercase;
    font-size: 11px;
}
.validationInvalid, .requiredInvalid, .checkInvalid, .invalid { border-color: #e74c3c !important; }
.check {
    padding: 3px 8px;
    color: white;
    background: var(--main-color-darker-2);
    flex: 1 1 auto;
    display: none;
    text-align: left;
    text-transform: uppercase;
    font-size: 11px;
}
.requiredText { color: #e74c3c; padding-left: 4px; }

/* Password toggle */
.showPasswordToggle {
    flex: 0 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 42px;
    height: 42px;
    margin-left: -42px;
    cursor: pointer;
    color: var(--text-muted);
}
.showPasswordToggle:hover { color: var(--text-primary); }
.passwordPaddingRight { padding-right: 42px !important; }

/* Number stepper */
.numberScroller { flex: 0 0 auto; display: flex; flex-direction: column; width: 42px; height: 42px; cursor: pointer; }
.numberStepUp, .numberStepDown {
    flex: 1 0 auto;
    background: var(--main-color);
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-size: 11px;
    transition: background var(--transition);
}
.numberStepUp  { border-radius: 0 var(--radius) 0 0; }
.numberStepDown{ border-radius: 0 0 var(--radius) 0; }
.numberStepUp:hover, .numberStepDown:hover { background: var(--main-color-darker-1); }

/* CHECKBOX */
.squaredCheck { position: relative; display: flex; align-items: center; }
.squaredCheck::before { content: none; }
.squaredCheck input[type=checkbox] {
    position: absolute;
    height: 1px; width: 1px;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
    white-space: nowrap;
}
.squaredCheck .squaredCheck-checkbox {
    display: inline-block;
    margin-bottom: 0;
    padding-bottom: 0;
    height: 20px; width: 20px;
}
.squaredCheck .squaredCheck-checkbox:before {
    content: "";
    display: inline-block;
    width: 18px; height: 18px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    position: relative;
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition);
}
.squaredCheck input[type=checkbox]:checked + .squaredCheck-checkbox:before {
    background: var(--main-color);
    border-color: var(--main-color);
}
.squaredCheck input[type=checkbox] + .squaredCheck-checkbox:after {
    content: "✔";
    color: var(--main-color);
    font-size: 12px;
    position: absolute;
    left: 50%; top: 50%;
    cursor: pointer;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity 0.2s ease;
    line-height: 1;
}
.squaredCheck input[type=checkbox]:checked + .squaredCheck-checkbox:after { opacity: 1; color: #ffffff; }
.squaredCheck input[type=checkbox]:hover + .squaredCheck-checkbox:after { opacity: 0.3; }
.squaredCheck input[type=checkbox]:checked:hover + .squaredCheck-checkbox:after { opacity: 1; }
.squaredCheck:focus-within .squaredCheck-checkbox::before { border-color: var(--main-color); box-shadow: var(--focus-ring); }

/* Small checkbox (used in tables) */
.squaredCheckSmall { position: relative; display: flex; align-items: center; }
.squaredCheckSmall::before { content: none; }
.squaredCheckSmall input[type=checkbox] {
    position: absolute;
    opacity: 0; overflow: hidden;
    clip: rect(0,0,0,0);
    height: 10px; width: 10px;
    padding: 0; border: 0; left: 0;
}
.squaredCheckSmall .squaredCheck-checkbox {
    display: block;
    width: 16px; height: 16px;
    background: var(--surface);
    border: 1.5px solid var(--border-strong);
    cursor: pointer;
    border-radius: var(--radius-sm);
}
.squaredCheckSmall .squaredCheck-checkbox:after {
    content: "✔";
    position: absolute;
    top: 50%; left: 50%;
    background: transparent;
    opacity: 0;
    transform: translate(-50%, -50%);
    font-size: 11px;
}
.squaredCheckSmall input[type=checkbox]:hover + .squaredCheck-checkbox:after { opacity: 0.3; }
.squaredCheckSmall input[type=checkbox]:checked + .squaredCheck-checkbox { background: var(--main-color); border-color: var(--main-color); }
.squaredCheckSmall input[type=checkbox]:checked + .squaredCheck-checkbox:after { opacity: 1; color: #ffffff; }
.squaredCheckSmall > label { margin-bottom: 0; }

/* Radio */
.circledRadio {
    width: 42px; height: 42px;
    position: relative;
    background: var(--main-color);
    display: inline-block;
    border-radius: 50%;
}
.circledRadio label {
    width: 40px; height: 40px;
    cursor: pointer;
    position: absolute;
    left: 1px; top: 1px;
    background: var(--surface);
    margin: 0;
    border-radius: 50%;
}
.circledRadio label:after {
    content: '';
    width: 28px; height: 28px;
    position: absolute;
    top: 6px; left: 6px;
    background: var(--main-color);
    opacity: 0;
    border-radius: 50%;
    transition: opacity var(--transition);
}
.circledRadio label:before { content: none; }
.circledRadio label:hover::after { opacity: 0.3; }
.circledRadio input[type=radio] { visibility: hidden; }
.circledRadio input[type=radio]:checked + label:after { opacity: 1; }
.disabledRadio { background: #ccc; }

.circledRadioSmall {
    width: 26px; height: 26px;
    position: relative;
    background: var(--main-color);
    display: inline-block;
    border-radius: 50%;
}
.circledRadioSmall label {
    width: 22px; height: 22px;
    cursor: pointer;
    position: absolute;
    left: 1px; top: 1px;
    background: var(--surface);
    margin: 0;
    border-radius: 50%;
}
.circledRadioSmall label:after {
    content: '';
    width: 16px; height: 16px;
    position: absolute;
    top: 3px; left: 3px;
    background: var(--main-color);
    opacity: 0;
    border-radius: 50%;
    transition: opacity var(--transition);
}
.circledRadioSmall label:before { content: none; }
.circledRadioSmall label:hover::after { opacity: 0.3; }
.circledRadioSmall input[type=radio] { visibility: hidden; }
.circledRadioSmall input[type=radio]:checked + label:after { opacity: 1; }

/* Multi option */
.multiOptionContainer { display: flex; flex-flow: row wrap; gap: 8px; }
.verticalOptions { flex-flow: column; width: fit-content; }
.multiOptionOption { display: flex; flex-flow: row; align-items: center; }
.inputText { display: inline-block; padding: 0 0 0 8px; position: relative; }
.centerAlignInput { width: min-content; }

/* Block options */
.blockOptionContainer { gap: 0; }
.blockOptionContainer .multiOptionOption { border: 1px solid var(--border-strong); border-left: 0; }
.blockOptionContainer .multiOptionOption:first-of-type { border-left: 1px solid var(--border-strong); border-radius: var(--radius) 0 0 var(--radius); }
.blockOptionContainer .multiOptionOption:last-of-type  { border-radius: 0 var(--radius) var(--radius) 0; }
.blockOption { position: absolute; opacity: 0; width: 0; height: 0; }
.blockOptionLabel { cursor: pointer; padding: 10px 16px; color: var(--text-primary); font-size: 13px; }
.blockOptionLabel::before { content: none; }
.blockOption:checked + .blockOptionLabel { background: var(--main-color); color: #ffffff; }

/* Separated value list */
.seperatedValueList.combined { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-alt); }
.seperatedValueListDisplay {
    border-radius: var(--radius) var(--radius) 0 0;
    border: 1px solid var(--border-strong);
    border-bottom: 0;
    min-height: 34px;
    padding: 8px;
    display: flex;
    gap: 6px;
    background: var(--surface-alt);
    flex-flow: row wrap;
}
.seperatedValueList.combined .seperatedValueListDisplay { border: 0; border-radius: 0; background: none; }
.seperatedValueListDisplay .value {
    border-radius: var(--radius);
    background: var(--main-color);
    color: #ffffff;
    padding: 4px 10px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
}
.seperatedValueListInput { border-radius: 0 0 var(--radius) var(--radius) !important; }
.seperatedValueList.combined .seperatedValueListInput { border: 0; border-radius: 0 !important; background: none; flex: 1 1 50px; padding: 5px; height: auto; }
.seperatedValueList.combined .seperatedValueListInputContainer { flex: 1 1 50px; position: relative; }
.seperatedValueListSuggestions { display: none; position: absolute; border-top: 0; background: var(--surface); border: 1px solid var(--border); width: 100%; z-index: 1000; border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow); }
.seperatedValueListSuggestions.showSuggestions { display: block; }
.seperatedValueListSuggestion { padding: 8px 12px; cursor: pointer; font-size: 13px; }
.seperatedValueListSuggestion.highlighted,
.seperatedValueListSuggestion:hover { background: var(--brand-light-green); color: var(--main-color); }

/* Autofill */
.autofillResults {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 0;
    position: absolute;
    top: 100%;
    display: none;
    z-index: 1000;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-md);
}
.autofillResult { width: 100%; padding: 10px 12px; font-size: 13px; }
.autofillResult:hover { background: var(--brand-light-green); cursor: pointer; }

/* Dropzone */
.dropzone {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 14px;
    color: var(--text-primary);
    background: var(--surface);
}
.dropzoneStyle {
    width: 100%;
    padding: 24px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    text-align: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: border-color var(--transition), background var(--transition);
}
.dropzoneStyle:hover { border-color: var(--main-color); background: var(--brand-light-green); }
.dz-upload { display: block; background: var(--main-color-lighter-2); height: 4px; width: 0; border-radius: 2px; }
.dz-filetype { color: var(--main-color-lighter-2); }
.dz-success-mark, .dz-error-mark { display: none; }
.dz-remove { color: var(--main-color-lighter-3); }

/* Gallery */
.galleryContainer { display: flex; flex-flow: row wrap; width: 100%; gap: 10px; }
.galleryFile { max-width: 260px; height: 260px; flex: 1 1 180px; border: 1px solid var(--border); border-radius: var(--radius); padding: 10px; display: flex; flex-flow: column; }
.galleryFile:hover { background: var(--brand-light-green); cursor: pointer; }
.galleryFile.selected { background: var(--main-color-lighter-4); border-color: var(--main-color); }
.galleryFilePreview { width: 100%; flex: 1 1 auto; display: flex; font-size: 100px; background-position: center; background-size: contain; background-repeat: no-repeat; align-content: center; }
.galleryFilePreview i { margin: auto; color: var(--main-color-lighter-2); }
.galleryFileName { width: 100%; text-align: center; flex: 0 1 auto; background: var(--main-color); border-radius: 0 0 var(--radius) var(--radius); color: #fff; padding: 8px; font-size: 12px; }

/* Colour picker */
.sp-replacer { width: 100%; min-width: 200px; box-sizing: border-box; }
.sp-preview { width: calc(100% - 20px); overflow: hidden; box-sizing: border-box; }
.sp-container { border-radius: 0 var(--radius) var(--radius) var(--radius) !important; top: 42px !important; }
.sp-disabled { opacity: 0.35; }

/* UI Slider */
.ui-slider { width: calc(100% - 50px); margin: 0 auto; top: 14px; background: var(--brand-light-green); border: 1px solid var(--main-color) !important; margin-bottom: 30px; border-radius: 4px; }
.ui-slider .ui-slider-handle { width: 44px; height: 14px; padding: 4px 0; border-radius: var(--radius-sm); text-align: center; outline: 0 none !important; margin-left: -22px; font-size: 12px; margin-top: -8px; top: 0; background: var(--main-color); border: 1px solid var(--main-color-darker-1) !important; color: #ffffff; }
.ui-slider .ui-slider-handle.ui-state-active { background: var(--main-color-darker-1) !important; }
.ui-slider-horizontal { height: 8px; }
.ui-slider .ui-slider-range { opacity: 0.4; }
.sliderTickmark { box-sizing: border-box; height: 8px; float: left; border-right: 1px solid var(--border-strong); }
.sliderTickmark span { position: relative; left: 100%; top: 16px; font-size: 11px; white-space: nowrap; transform: translateX(-50%); display: inline-block; }
.sliderTickmarks .sliderTickmark:first-child,
.sliderTickmarks .sliderTickmark:last-of-type { border-right: 0; }

/* File manager */
.file-manager-view { width: 100%; min-height: 400px; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: clip; }
.file-manager-breadcrumbs { width: 100%; padding: 10px 14px; display: flex; gap: 8px; flex-direction: row; background: var(--surface-alt); border-bottom: 1px solid var(--border); box-sizing: border-box; font-size: 13px; }
.file-manager-access-type-readonly { width: 100%; padding: 8px 14px; background: #fff5f5; color: #e74c3c; font-size: 12px; box-sizing: border-box; }
.file-manager-content { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 8px; padding: 12px; box-sizing: border-box; }
.file-manager-btn { position: relative; padding: 10px 8px; cursor: pointer; border-radius: var(--radius); text-align: center; color: var(--main-color) !important; border: 1px solid transparent; font-size: 12px; }
.file-manager-btn:hover { background: var(--brand-light-green); border-color: var(--border); }
.file-manager-delete-button { position: absolute; top: -4px; right: -4px; color: #e74c3c; cursor: pointer; font-size: 18px; display: none; }
.file-manager-btn:hover .file-manager-delete-button { display: block; }
.file-manager-btn-icon { width: 60px; height: 60px; font-size: 48px; display: flex; justify-content: center; align-items: center; margin: auto; }
.file-manager-btn-text { display: block; font-size: 11px; word-break: break-word; margin-top: 4px; }
.file-manager-text-input { display: none; width: 100% !important; height: fit-content !important; padding: 0 4px !important; border: 0 !important; font-size: 11px !important; margin: 0 !important; text-align: center !important; position: relative; box-sizing: border-box !important; }
.file-upload-content { width: 100%; padding: 20px; box-sizing: border-box; }
.file-upload-content .dropzoneStyle { min-height: 180px; align-content: center; }
.file-manager-drop-active, .file-manager-can-drop { border: 1px dashed var(--main-color) !important; }
.file-manager-can-drop { background: var(--brand-light-green); }

/* Font awesome picker */
.fontawesomeContainer { width: 100%; }
.fontawesomeSearchBar { width: 100%; }
.fontawesomeSearchResults { width: 100%; min-height: 240px; max-height: 240px; overflow-y: scroll; border: 1px solid var(--border); border-radius: var(--radius); margin-top: 4px; }
.fontawesomePreview { width: 130px; margin: 4px; padding: 6px; float: left; min-height: 56px; border-radius: var(--radius); }
.fontawesomePreview:hover { border: 1px solid var(--main-color); background: var(--brand-light-green); color: var(--main-color); cursor: pointer; }
.activeFont { color: #fff; border: 1px solid var(--main-color); border-radius: var(--radius); background: var(--main-color); }

/* SELECT2 overrides */
.select2.select2-container {
    width: 100%;
    height: 42px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    color: var(--text-primary);
    min-width: 160px;
}
.select2.select2-container .select2-selection {
    border: 0;
    border-radius: var(--radius);
    height: 40px;
    outline: none !important;
    transition: all var(--transition);
    text-align: left;
}
.select2.select2-container .select2-selection .select2-selection__rendered {
    color: var(--text-primary);
    padding: 0 32px 0 12px;
    line-height: 40px;
    height: 40px;
}
.select2.select2-container .select2-selection .select2-selection__arrow {
    height: 37px;
    width: 28px;
    color: var(--text-secondary);
    top: 0px;
    border: 0px;
    right: 0px;
    border-radius: 0px 5px 5px 0px;
}
.select2-container--default .select2-selection--single .select2-selection__arrow b {
    border-color: var(--text-secondary) transparent transparent transparent !important;
}
.select2.select2-container.select2-container--open .select2-selection.select2-selection--single { background: #fafff7; }
.select2-container .select2-dropdown { background: transparent; border: none; margin-top: -3px; }
.select2-container .select2-dropdown .select2-search { padding: 0; }
.select2-container .select2-dropdown .select2-search input {
    outline: none !important;
    border: 1px solid var(--main-color) !important;
    border-bottom: none !important;
    padding: 10px 12px !important;
    height: 42px;
    color: var(--text-primary);
    border-radius: var(--radius) var(--radius) 0 0;
}
.select2-container .select2-dropdown .select2-results ul {
    background: var(--surface);
    border: 1px solid var(--main-color);
    max-height: 320px;
    border-radius: var(--alt-radius-bottom);
    box-shadow: var(--shadow-md);
}
.select2-container .select2-dropdown .select2-results ul .select2-results__option {
    background: var(--surface);
    padding: 10px 12px !important;
    color: var(--text-primary);
    font-size: 13px;
}
.select2-container .select2-dropdown .select2-results ul .select2-results__option--highlighted[aria-selected] {
    background: var(--brand-light-green);
    color: var(--main-color);
}
.select2.select2-container .select2-selection--multiple .select2-selection__rendered {
    display: block;
    padding: 0 12px;
    line-height: 38px;
    height: 42px;
    border-radius: var(--radius);
}
.select2.select2-container .select2-selection--multiple .select2-selection__choice {
    background: var(--main-color-lighter-4);
    border: 1px solid var(--main-color);
    border-radius: var(--radius-sm);
    margin: 5px 8px 0 -4px;
    padding: 0 6px 0 20px;
    height: 22px;
    line-height: 22px;
    font-size: 12px;
    position: relative;
    color: var(--main-color);
}
.select2.select2-container .select2-selection--multiple .select2-selection__choice .select2-selection__choice__remove {
    position: absolute;
    top: 0; left: 0;
    height: 20px; width: 20px;
    margin: 0;
    text-align: center;
    color: var(--main-color);
    font-weight: bold;
}
.select2-container--default.select2-container--focus .select2-selection--multiple { border: none !important; }
.select2-search { padding: 0 !important; }
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { border: none !important; }
.select2.select2-container .select2-selection--multiple .select2-search--inline .select2-search__field {
    margin-top: 6px;
    width: 100% !important;
    padding-top: 8px;
    color: var(--text-primary);
}
.filterBar .select2.select2-container .select2-selection__rendered { line-height: 32px; }
.select2InPopup { z-index: 10000; }
.fontawsomePlaceholder { font-family: Arial, FontAwesome !important; }
.fontawesomeSearchResults { margin-top: 4px; border-radius: var(--radius); border: 1px solid var(--border); }
.dialogSelect { margin-left: -1px; }
.select2 #content ul li { padding: 0; }
.select2-results__options { z-index: 9999; }


/* ============================================================
   TABLES
   ============================================================ */
.tableContainer {
    width: 100%;
    overflow-x: auto;
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    background: none;
}

/* Scroll fade overlays — applied to a JS-injected wrapper */
.tableContainerWrap {
    position: relative;
}
.tableContainerWrap::before,
.tableContainerWrap::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 48px;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
    border-radius: var(--radius-lg);
}
.tableContainerWrap::before {
    left: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.07), transparent);
}
.tableContainerWrap::after {
    right: 0;
    background: linear-gradient(to left, rgba(0,0,0,0.07), transparent);
}
.tableContainerWrap.fade-left::before  { opacity: 1; }
.tableContainerWrap.fade-right::after  { opacity: 1; }

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
    font-size: 13px;
}

thead.clone { display: table; width: 100%; position: absolute; left: 0; top: 0; }

th {
    padding: 9px 12px;
    background: #f7f8f6;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
    border-right: 1px solid var(--border);
    vertical-align: middle;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    text-align: left;
}
th:last-child { border-right: none; }
th a { color: var(--text-secondary); }

td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    vertical-align: middle;
    white-space: nowrap;
    color: var(--text-primary);
}
td:last-child { border-right: none; }
td .text { cursor: text; }

.optionsColumn { width: 1%; white-space: nowrap; }

tr {
    transition: background var(--transition);
    -webkit-backdrop-filter: blur(var(--glass-blur));
    backdrop-filter: blur(var(--glass-blur));
}
tr:last-child td { border-bottom: none; }
tr:nth-child(even) { background: #ffffffb5; }
tr:nth-child(odd)  { background: #f9faf7b5; }
tr.evenRow { background: #ffffffb5; }
tr.oddRow  { background: #f9faf7b5; }
tr:hover   { background: var(--brand-light-green); }

.clickableRow { cursor: pointer; }

.fa-sort, .fa-sort-down, .fa-sort-up { margin-left: 4px; opacity: 0.4; }
th:hover .fa-sort { opacity: 0.8; }

.rowHighlight         { background: var(--main-color-lighter-5) !important; color: var(--main-color); }
.rowHighlightSelected { background: var(--main-color-lighter-3) !important; color: var(--text-primary); }
.leftAlignData td     { text-align: left; }

/* Info table (key-value) */
.infoTable { font-size: 13px; }
.infoTable th {
    padding: 7px 12px;
    background: var(--surface-alt);
    color: var(--text-secondary);
    border: 0;
    border-right: 2px solid var(--border);
    vertical-align: top;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.infoTable td {
    width: 100%;
    padding: 7px 12px;
    background: none;
    border: 0;
    color: var(--text-primary);
    vertical-align: middle;
    text-align: left;
}
.infoTable tr          { border-bottom: 1px solid var(--border); }
.infoTable tr:nth-child(even) { background: none; }
.infoTable tr:nth-child(odd)  { background: none; }
.infoTable tr:hover    { background: none; }
.infoTable td.header   { font-weight: 600; text-align: center; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 6px 12px; }
.infoTable tr:first-child { border-top: 1px solid var(--border); }
.infoTable tr:last-child  { border-bottom: 1px solid var(--border); }
.infoTable.noBorder tr:first-child { border-top: 0; }
.infoTable.noBorder tr:last-child  { border-bottom: 0; }

/* Row context menu */
.rowContextMenu {
    position: absolute;
    display: none;
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
    overflow: clip;
    z-index: 500;
    padding: 4px;
}
.rowContextMenu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    font-family: inherit;
}
.rowContextMenu button:hover { background: var(--brand-light-green); color: var(--main-color); }

/* Mobile */
@media only screen and (max-width: 600px) {
    table, table.infoTable { font-size: 11px; }
    td, th { padding: 6px 8px; }
}


/* ============================================================
   PAGINATION
   ============================================================ */
#pagination_range {
    margin: 0 auto 8px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.pagination_nav {
    width: 100%;
    text-align: center;
    margin: 0;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
}

.pagination_nav li {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 6px !important;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    background: var(--surface);
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    cursor: pointer;
    user-select: none;
}

.pagination_nav li:hover {
    background: var(--brand-light-green);
    border-color: var(--main-color);
    color: var(--main-color);
}

.pagination_nav .current_page {
    background: var(--main-color);
    border-color: var(--main-color-darker-1);
    color: #ffffff;
    font-weight: 600;
    cursor: default;
    box-shadow: 0 1px 3px rgba(var(--main-color-rgb), 0.30);
}
.pagination_nav .current_page:hover { background: var(--main-color); color: #ffffff; border-color: var(--main-color-darker-1); }

.pagination_nav .disabled_page_nav {
    cursor: default;
    color: var(--text-muted);
    background: var(--surface-alt);
    border-color: var(--border);
}
.pagination_nav .disabled_page_nav:hover { background: var(--surface-alt); color: var(--text-muted); border-color: var(--border); }

.paginate {
    padding: 8px 0;
    width: 100%;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.paginate select {
    border: 1px solid var(--border-strong);
    padding: 4px 8px;
    border-radius: var(--radius);
    color: var(--text-primary);
    background: var(--surface);
    font-size: 12px;
    height: auto;
    width: auto;
    cursor: pointer;
}


/* ============================================================
   BADGES & STATUS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge-green,  .badge-success { background: #eaf7ee; color: #2a6534; }
.badge-red,    .badge-danger  { background: #fff0f0; color: #c0392b; }
.badge-orange, .badge-warning { background: var(--brand-orange-bg); color: #7a3c00; }
.badge-blue,   .badge-info    { background: #eaf3ff; color: #1a5fa8; }
.badge-gray                   { background: var(--brand-light-green); color: var(--main-color-darker-2); }


/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid;
}
.alert-success { background: #f3faf5; color: #2a6534; border-color: #b7dfbf; }
.alert-error,
.alert-danger   { background: #fff5f5; color: #c0392b; border-color: #f5b7b1; }
.alert-warning  { background: var(--brand-orange-bg); color: #7a3c00; border-color: #fac36a; }
.alert-info     { background: #eaf3ff; color: #1a5fa8; border-color: #a9cdf0; }


/* ============================================================
   DIALOGS / jQuery UI
   ============================================================ */

/* Sit above the sidebar (z-index 300) and top-bar (z-index 200) */
.ui-dialog         { z-index: 600 !important; }
.ui-widget-overlay { z-index: 599 !important; background: rgba(0,0,0,0.35) !important; }

/* No close button — dialogs always use the button pane */
.ui-dialog-titlebar-close { display: none !important; }

.ui-dialog {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    margin: 0 !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-xl) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0 !important;
    font-family: inherit !important;
    font-size: 13px !important;
}
.ui-dialog-titlebar {
    background: var(--surface) !important;
    border: none !important;
    border-bottom: 1px solid var(--border) !important;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0 !important;
    padding: 14px 18px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
}
.ui-dialog-content { padding: 18px !important; background: var(--surface) !important; font-family: inherit !important; font-size: 13px !important; }
.ui-dialog-buttonpane { background: var(--surface-alt) !important; border-top: 1px solid var(--border) !important; padding: 12px 18px !important; border-radius: 0 0 var(--radius-xl) var(--radius-xl) !important; }
.ui-dialog-buttonset button {
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    transition: background var(--transition);
    margin-left: 6px;
}
.ui-dialog-buttonset button:hover { background: var(--surface-alt); }
.ui-dialog-buttonset button:first-child { background: var(--main-color); color: #fff; border-color: var(--main-color-darker-1); }
.ui-dialog-buttonset button:first-child:hover { background: var(--main-color-darker-1); }
.ui-datepicker { border-color: var(--border) !important; border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-md) !important; font-family: inherit !important; font-size: 13px !important; }


/* ============================================================
   CUSTOM / APP-SPECIFIC STYLES
   ============================================================ */

/* Field enabled / disabled indicator (from customStyle) */
.fieldEnabled  { background: #eaf7ee !important; color: #2a6534 !important; }
.fieldDisabled  { background: #fff0f0 !important; color: #c0392b !important; }

/* Permit display */
.permit {
    padding: 12px;
    border: 4px solid var(--main-color);
    border-radius: var(--radius);
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(140,192,102,0.10) 0%, rgba(200,144,80,0.08) 100%), rgba(255,255,255,0.82);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
}
.permit h2, .section h2 {
    font-size: 16px;
    background: var(--main-color);
    color: #fff;
    padding: 10px 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: var(--radius-sm);
}
.permitOptions { display: flex; flex-flow: row wrap; gap: 10px; }
.permitOptionsSection { flex: 1 1 320px; }
.permitSectionsContainer { display: flex; flex-flow: row wrap; gap: 12px; }
.section {
    flex: 1 1 280px;
    background: linear-gradient(135deg, rgba(140,192,102,0.10) 0%, rgba(200,144,80,0.08) 100%), rgba(255,255,255,0.82);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
    border: 1px solid rgba(140,192,102,0.22);
    border-radius: var(--radius-lg);
    padding: 12px;
}
.section.permitDetails { flex: 1 1 700px; }
.section.permitDetails .formItems { display: flex; flex-flow: row wrap; gap: 10px; }
.section.permitDetails .formItems .formItem { flex: 1 1 calc(50% - 6px); min-width: 280px; }

/* Log entries */
#permitLogs { display: none; border-top: 1px solid var(--border); margin-top: 12px; }
.permitLogHeader {
    padding: 10px 14px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background var(--transition);
}
.permitLogHeader:hover { background: var(--brand-light-green); }
.permitLogToggleIcon { margin-right: 8px; color: var(--text-muted); }
.permitLogHeaderText { display: flex; justify-content: space-between; align-items: center; flex: 1 1 auto; }
.permitLogBody { border-bottom: 1px solid var(--border); }
.permitLogData tr { background: none; }
.permitLogData th { text-align: right; background: none; color: var(--text-secondary); vertical-align: top; border-left: 0; white-space: nowrap; font-size: 12px; }
.permitLogData tr:first-child th, .permitLogData tr:first-child td { border-top: none; }
.permitLogData tr:last-child  th, .permitLogData tr:last-child  td { border-bottom: none; }
.permitLogData td { width: 100%; text-align: left; border-right: 0; }
.permitLogChange { display: flex; gap: 8px; align-items: center; }
.changed-field  { padding: 3px 0; }
.old-value { color: #c0392b; margin-right: 6px; }
.old-value del { text-decoration-color: #c0392b; }
.new-value { color: #2a6534; }

/* Editing lock */
.editingLockMessage {
    width: 100%;
    background: #fff0f0;
    border: 1px solid #e74c3c;
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 12px;
    color: #c0392b;
    text-align: center;
    font-weight: 600;
    font-size: 13px;
}

/* Search/filter specific */
.settingsIcon { margin-right: 8px; }
.disabledIcon { color: var(--text-muted) !important; }
.noBorder { border: none; }
.testInputDateResult { padding: 14px 0; color: var(--text-secondary); font-size: 13px; }


/* ============================================================
   QUARANTINE PAGE
   ============================================================ */
#quarantineResults .tableContainer {
    will-change: transform;
}

#quarantineTable {
    border-collapse: separate;
    border-spacing: 0;
}

#quarantineTable td,
#quarantineTable th {
    border-top: 0;
    border-left: 0;
}
#quarantineTable thead tr:first-child th {

}
#quarantineTable td:first-child,
#quarantineTable th:first-child {

}

/* Sticky columns */
#quarantineTable th.q-sticky-left,
#quarantineTable td.q-sticky-left {
    position: sticky;
    left: 0;
    z-index: 1;
    background-color: inherit;
}
#quarantineTable th.q-sticky-right,
#quarantineTable td.q-sticky-right {
    position: sticky;
    right: 0;
    z-index: 2;
    background-color: inherit;
}
#quarantineTable th.q-sticky-right-inner,
#quarantineTable td.q-sticky-right-inner {
    position: sticky;
    right: 0;
    z-index: 1;
    background-color: inherit;
    box-shadow: -1px 0 0 var(--border);
}
#quarantineTable th.q-sticky-left, #quarantineTable th.q-sticky-right, #quarantineTable th.q-sticky-right-inner {
    background-color: #f7f8f6;
}
#quarantineTable thead th.q-sticky-left,
#quarantineTable thead th.q-sticky-right { z-index: 3; }
#quarantineTable thead th.q-sticky-right-inner { z-index: 2; }

/* Scroll fade indicators — pseudo-elements match the tableContainerWrap overflow fades exactly */
#quarantineTable th.q-sticky-left::after,
#quarantineTable td.q-sticky-left::after,
#quarantineTable th.q-sticky-right-inner::before,
#quarantineTable td.q-sticky-right-inner::before {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 48px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
}
#quarantineTable th.q-sticky-left::after,
#quarantineTable td.q-sticky-left::after {
    left: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.07), transparent);
}
#quarantineTable th.q-sticky-right-inner::before,
#quarantineTable td.q-sticky-right-inner::before {
    right: 100%;
    background: linear-gradient(to left, rgba(0,0,0,0.07), transparent);
}
#quarantineTable th.q-sticky-left.q-shadow-right::after,
#quarantineTable td.q-sticky-left.q-shadow-right::after,
#quarantineTable th.q-sticky-right-inner.q-shadow-left::before,
#quarantineTable td.q-sticky-right-inner.q-shadow-left::before {
    opacity: 1;
}

.q-row-actions {
    display: flex;
    gap: 4px;
    justify-content: center;
    white-space: nowrap;
}
.q-action-btn {
    padding: 4px 7px;
    line-height: 1;
}


/* ============================================================
   FLEX / LAYOUT UTILITIES
   ============================================================ */
#content .flex-container {
    display: flex;
    flex-flow: row wrap;
    width: 100%;
    gap: 12px;
    margin-bottom: 12px;
}
#content .flex-item { flex: 1 1 480px; }

.dataContainer {
    width: 100%;
    padding: 0;
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
    gap: 10px;
}

.dataItem { width: 100%; margin: 0 auto 10px; position: relative; }
.formItem p { padding: 14px 0; }


/* ============================================================
   LOADING BAR
   Inline results loader: branded icon with dual counter-rotating arcs
   ============================================================ */
.loading_bar {
    width: 32px;
    height: 32px;
    background-image: url('../../images/dynamic_permiserv_icon.php');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    margin: 80px auto 80px;
}

/* Inner arc — spins clockwise */
.loading_bar::before {
    content: '';
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    border: 2.5px solid var(--border);
    border-top-color: var(--brand-green);
    animation: spin 0.85s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Outer arc — spins counter-clockwise */
.loading_bar::after {
    content: '';
    position: absolute;
    inset: -26px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: var(--brand-green);
    animation: spin 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite reverse;
}


/* ============================================================
   LOADING OVERLAY
   Full-screen overlay injected by showLoadingOverlay() in sharedFunctions.js
   ============================================================ */
#loadingOverlay {
    position: fixed;
    inset: 0;
    z-index: 100001;
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

#loadingOverlaySpinner {
    position: fixed;
    z-index: 100002;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    background-image: url('../../images/dynamic_permiserv_icon.php');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
#loadingOverlaySpinner i { display: none !important; }
#loadingOverlaySpinner::before {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 2.5px solid var(--border);
    border-top-color: var(--brand-green);
    animation: spin 0.85s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
#loadingOverlaySpinner::after {
    content: '';
    position: absolute;
    inset: -30px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-bottom-color: var(--brand-green);
    animation: spin 1.4s cubic-bezier(0.4, 0, 0.6, 1) infinite reverse;
}

#loadingOverlayText {
    position: fixed;
    z-index: 100002;
    top: calc(50% + 60px);
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    white-space: nowrap;
}


/* ============================================================
   TEXT & DISPLAY UTILITIES
   ============================================================ */
.clear         { clear: both; }
.capitalize    { text-transform: capitalize; }
.centerText, .fullWidthCentered { text-align: center; }
.underline     { text-decoration: underline; }
.boldText      { font-weight: 600; }
.italicText    { font-style: italic; }
.right-link    { float: right; }
.text-muted    { color: var(--text-muted); }
.textSuccess   { color: #2a6534; }
.textDanger    { color: #c0392b; }
.text-right    { text-align: right; }

.fa-spinner { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.faButton { cursor: pointer; }
.material-icons-small { font-family: 'Material Icons'; font-weight: normal; font-style: normal; font-size: 14px; line-height: 1; letter-spacing: normal; text-transform: none; display: inline-block; white-space: nowrap; -webkit-font-feature-settings: 'liga'; -webkit-font-smoothing: antialiased; }


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    #sidebar { transform: translateX(calc(-1 * var(--sidebar-width))); }
    #sidebar.open { transform: translateX(0); }
    #main-wrap { margin-left: 0; overflow-x: hidden; }
    #sidebar-toggle { align-items: center; justify-content: center; }
    #content { padding: 16px; }
    .sidebarCollapseBtn, .sidebarFooterBtn { display: none; }
    #app.sidebar-collapsed #main-wrap { margin-left: 0; }
    /* On mobile the hidden state maps to the regular off-canvas pattern */
    #app.sidebar-hidden #sidebar   { transform: translateX(calc(-1 * var(--sidebar-width))); }
    #app.sidebar-hidden #main-wrap { margin-left: 0; }
}

@media (max-width: 640px) {
    #status_badge { display: none; }
    #page-title   { display: none; }
    #user_button #user_name_display { display: none; }
    #user_button .user_chevron      { display: none; }
    .topbar-brand-text { display: none; }
    .topbar-divider    { display: none; }
}


/* ============================================================
   PRELOAD (suppress transition flash on page load)
   ============================================================ */
body.preload * { transition: none !important; }


/* ============================================================
   LOGIN PAGE
   ============================================================ */

body.bodyLogin {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #c2c2c2; /* shows through dot-grid holes in canvas */
    position: relative;
    overflow: hidden;
    padding: 24px 16px;
    box-sizing: border-box;
}

/* Canvas layers from loginTop.php handle the background — ::after not used */
body.bodyLogin::after { display: none; }

/* ---- Wrapper & card ---- */

.loginWrapper {
    position: relative;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 460px;
}

.login {
    width: 100%;
    background: rgba(255, 255, 255, 0.22);
    -webkit-backdrop-filter: blur(1px);
    backdrop-filter: blur(1px);
    border: 1px solid rgba(240, 240, 240, 0.45);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 28px rgba(0,0,0,0.12), 0 1px 4px rgba(0,0,0,0.06);
    overflow: hidden;
    margin: 0;
}

/* Card heading */
.login h1 {
    text-align: center;
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 700;
    padding: 18px 24px 16px;
    border-bottom: 1px solid var(--border);
    text-transform: none;
    letter-spacing: -0.01em;
    background: rgba(247,248,246,0.85);
    position: relative;
    margin-bottom: 0;
    width: auto;
}

.login h1::before {
    content: '';
    position: absolute;
    bottom: -1px; left: 50%;
    transform: translateX(-50%);
    width: 36px; height: 2px;
    background: var(--main-color);
    border-radius: 2px;
    display: block;
}

/* Logo / portal title */
.loginLogo {
    display: block;
    max-width: 160px;
    height: auto;
    margin: 20px auto 4px;
    padding: 0;
    width: auto;
}

.loginTitle {
    text-align: center;
    font-size: 18px;
    font-weight: 700;
    color: var(--main-color);
    padding: 20px 24px 4px;
    letter-spacing: -0.01em;
}

/* Form area */
.login fieldset {
    padding: 16px 24px 0;
    border: none;
    margin-bottom: 0;
}

.login form { padding-bottom: 20px; }

.login p {
    padding: 8px 24px;
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    clear: both;
}

/* Error / success messages */
.loginError {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin: 8px 0 0;
    border-radius: var(--radius);
    background: #fff5f5;
    color: #c0392b;
    border: 1px solid #f5b7b1;
    font-size: 12px;
    text-align: left;
    box-sizing: border-box;
}

.loginSuccess {
    display: block;
    width: 100%;
    padding: 8px 12px;
    margin: 8px 0 0;
    border-radius: var(--radius);
    background: #f3faf5;
    color: #2a6534;
    border: 1px solid #b7dfbf;
    font-size: 12px;
    text-align: left;
    box-sizing: border-box;
}

/* Captcha */
.captchaContainer {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 12px 24px 0;
    box-sizing: border-box;
}

.g-recaptcha { display: inline-block; }

/* Submit button */
.login .submitButton {
    margin: 16px 24px 0;
    width: calc(100% - 48px);
    border-radius: var(--radius) !important;
}

/* "Lost your password?" link */
.loginLink {
    display: block;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 10px;
    padding: 0 24px;
    text-decoration: none;
}
.loginLink:hover { color: var(--main-color); text-decoration: underline; }

/* Google / social login */
.quickLoginButtons {
    width: 100%;
    margin-top: 10px;
}

.googleLoginButton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.82);
    border: 1.5px solid rgba(255,255,255,0.95);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.10), inset 0 1px 0 rgba(255,255,255,0.9);
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
    width: 100%;
    box-sizing: border-box;
}
.googleLoginButton:hover {
    background: rgba(255,255,255,0.95);
    border-color: var(--main-color);
    color: var(--main-color);
    box-shadow: 0 3px 12px rgba(0,0,0,0.14), inset 0 1px 0 rgba(255,255,255,1);
}

/* Mobile */
@media (max-width: 480px) {
    .loginWrapper { padding: 0; }
    .login { border-radius: var(--radius-lg); }
    .login h1 { padding: 14px 16px 12px; font-size: 16px; }
    .login fieldset { padding: 12px 16px 0; }
    .login .submitButton { margin: 12px 16px 0; width: calc(100% - 32px); }
    .captchaContainer { padding: 10px 16px 0; }
    .loginLink { padding: 0 16px; }
}
