@media screen {
    .print-only {
        display: block !important;
    }
}

@media print {
    .print-only {
        display: none !important;
    }
}

/* ================================
   SandX Sidebar / Rail (clean)
   ================================ */
.sandx {
    --rail-width: 64px;
    --menu-width: 268px;
    --header-h: 52px;
}

    /* Sidebar container */
    .sandx .inner-menu-wrapper {
        position: relative;
        width: var(--menu-width);
        min-width: var(--menu-width);
        max-width: var(--menu-width);
        transition: width .2s ease, min-width .2s ease, max-width .2s ease, transform .25s ease;
        border-right: 1px solid #e5e7eb;
        background-color: #fff;
        display: flex;
        flex-direction: column;
        /* Flyout must not be clipped & must stack above content */
        overflow: visible;
        z-index: 1200;
        height: max-content;
    }

        /* Collapsed → icon rail */
        .sandx .inner-menu-wrapper.collapsed {
            width: var(--rail-width);
            min-width: var(--rail-width);
            max-width: var(--rail-width);
        }

/* Off-canvas on small screens */
@media (max-width: 991.98px) {
    .sandx .inner-menu-wrapper {
        position: absolute;
        height: 100%;
        transform: translateX(0);
        box-shadow: 0 4px 24px rgba(0,0,0,.12);
    }

        .sandx .inner-menu-wrapper.hidden {
            transform: translateX(-110%);
        }
}

/* Header */
.sandx .sandx-header {
    height: var(--header-h);
    padding: 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #f1f5f9;
    min-height: 57px;
}

.sandx .sandx-title {
    font-weight: 600;
    font-size: 15px;
    margin-top: 5px;
    margin-left: 5px;
}

.sandx .sandx-logo {
    width: 20px;
    height: 20px;
    border-radius: 6px;
}

/* Buttons */
.sandx .hamburger-btn,
.sandx .rail-toggle {
    border: 0;
    background: transparent;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease;
}

.sandx .rail-toggle {
    position: absolute;
    right: -14px;
    top: 12px;
    z-index: 1210;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

    .sandx .hamburger-btn:hover,
    .sandx .rail-toggle:hover {
        background: #f8fafc;
    }

/* Sections & lists */
.sandx .submenu-title-wrapper {
    padding: 10px 8px;
}

.sandx .submenu-section {
    text-transform: uppercase;
    color: #94a3b8;
    font-weight: 600;
    letter-spacing: .04em;
    font-size: 11px;
    padding: 6px 8px 4px;
}

/* Keep lists inside sidebar width */
.sandx .submenu-list-wrapper,
.sandx .submenu-sub-list-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
    gap: 4px;
}

/* Items (top-level & sub) */
.sandx .submenu-item,
.sandx .submenu-sub-item {
    height: 36px;
    border-radius: 8px;
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #0f172a;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

    .sandx .submenu-item:hover,
    .sandx .submenu-sub-item:hover {
        background: #f8fafc;
    }

    .sandx .submenu-item.selected,
    .sandx .submenu-sub-item.selected {
        background: #eef2ff;
        color: #3730a3;
    }

/* Left block (icon + text) — allow shrink so arrow fits */
.sandx .submenu-left {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
}

/* Icons */
.sandx .submenu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}
/* Smaller sub-menu bullet (keeps fa fa-circle but scaled) */
.sandx .submenu-sub-item .submenu-icon,
.sandx .rail-flyout .submenu-icon.is-dot {
    font-size: 0.625rem;
    line-height: 1;
    color: #94a3b8;
}

/* Sub-menu row layout + indent */
.sandx .submenu-sub-item {
    justify-content: flex-start;
    gap: 8px;
    padding-left: 12px;
}

    /* Truncate labels (top-level + sub-items) */
    .sandx .submenu-item .submenu-text,
    .sandx .submenu-sub-item .submenu-text {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 175px;
        /*overflow: hidden;
        white-space: nowrap;*/
        text-overflow: ellipsis;
    }

/* Arrow stays fixed at right */
.sandx .submenu-arrow {
    flex: 0 0 auto;
    width: 16px;
    margin-left: 8px;
    position: relative;
    z-index: 1;
}

    .sandx .submenu-arrow.rotated {
        transform: rotate(-90deg);
        transition: transform .15s ease;
    }

/* Expanded sub-list spacing */
.sandx .submenu-sub-list-wrapper {
    gap: 2px;
    padding-left: 28px;
}

/* Collapsed rail tweaks */
.sandx .inner-menu-wrapper.collapsed .submenu-item {
    padding: 0 6px;
    justify-content: center;
}

    .sandx .inner-menu-wrapper.collapsed .submenu-item.rail .submenu-left {
        gap: 0;
    }
    /* Hide labels/sections/sub-lists in rail (but not in flyout) */
    .sandx .inner-menu-wrapper.collapsed .submenu-item .submenu-text,
    .sandx .inner-menu-wrapper.collapsed .submenu-section,
    .sandx .inner-menu-wrapper.collapsed .submenu-arrow,
    .sandx .inner-menu-wrapper.collapsed .submenu-sub-list-wrapper {
        display: none !important;
    }

.sandx .inner-menu-wrapper.collapsed .rail-flyout .submenu-text {
    display: inline !important;
}

/* Flyout (anchors to sidebar edge and stacks above content) */
.sandx .rail-flyout {
    position: absolute;
    left: calc(100% - 2px); /* stick to the sidebar’s right edge */
    top: 0;
    min-width: 220px;
    max-width: 280px;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    border-radius: 10px;
    padding: 8px;
    z-index: 1300;
}

    .sandx .rail-flyout .flyout-title {
        font-weight: 600;
        font-size: 13px;
        color: #334155;
        padding: 4px 6px 8px;
        border-bottom: 1px solid #f1f5f9;
        margin-bottom: 6px;
    }

    .sandx .rail-flyout .flyout-list {
        display: grid;
        gap: 4px;
    }

/* Content top bar (unchanged) */
.sandx .content-topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    padding: 10px 12px;
    border-bottom: 1px solid #eef2f7;
}

/* A11y helper */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* ========================================================
   End of Sidebar Menu
   ======================================================== */

.ui-wrapper-padder {
    height: 98% !important;
}

.bg-input-yellow {
    background-color: #ffd965 !important;
    color: #000 !important;
}

.no-transform {
    text-transform: none !important;
}

.sandx .ag-table-toolbox {
    margin-bottom: 5px;
}

    .sandx .ag-table-toolbox .btn-default {
        color: #2f2f2f;
        background: #e7e7e7;
        border: 1px solid #ffffff;
    }

.grid-editor .ag-table {
    --ag-column-border: 1px solid #ccc !important;
    --ag-spacing: 5px !important;
}

.well-grid-editor .ag-cell-not-inline-editing.ag-column-first {
    background-color: #f3f3f3;
}

.nav-tabs .nav-link {
    border: none;
    font-size: 13px !important;
    background-color: #f0f4fd;
    color: #2060c3;
    margin-left: 0px;
    margin-right: 15px;
    border-radius: 26px;
    padding: 7px 24px;
}

    .nav-tabs .nav-link.active {
        color: #ffffff;
        border-left: none !important;
        border-right: none !important;
        background-color: var(--primary);
        background: linear-gradient(315deg, var(--primary) 0%, var(--primary-gradient) 86%);
    }

    .nav-tabs .nav-link:not(.active):focus, .tabs-container .nav-tabs .nav-link:not(.active):hover {
        font-weight: bold;
    }

.nav-tabs .nav-link {
    border: none;
    font-size: 13px !important;
    background-color: #f0f4fd;
    color: #2060c3;
    margin-left: 0px;
    margin-right: 15px;
    border-radius: 26px;
    padding: 7px 24px;
}

.nav > li > a {
    padding: 5px 16px 5px 16px;
}

.nav-tabs > li {
    margin-bottom: 5px;
    min-width: 125px;
    text-align: center;
}

.ag-cell.readonly-cell {
    background-color: #f3f3f3 !important;
    cursor: not-allowed;
}

.component-wrapper h2.no-transform {
    text-transform: none !important;
}

.component-wrapper h3 {
    font-size: 16px;
    color: #42495E;
    font-weight: bold;
    margin-top: 12px;
}

.input-header-bg {
    background-color: #f9be28 !important;
}

.sandx-accordion-list.manage .accordion-expand-wrapper {
    width: 100%;
}

.sandx-accordion-list.manage .sandx-wrapper {
    padding: 25px 35px;
}

.sandx-list-item {
    border-radius: 15px;
    background: white;
    box-shadow: 0px 0px 13px #ddd;
    margin: 10px 5px;
    cursor: pointer;
    transition: all 0.3s;
}

    .sandx-list-item .bg-yellow {
        background-color: #f9be28;
        border-radius: 15px;
    }

    .sandx-list-item .icon {
        height: 30px;
    }

    .sandx-list-item .title {
        font-size: 14px;
        margin: 0px 15px;
        font-weight: 600;
        text-transform: capitalize;
    }

    .sandx-list-item .subtitle {
        font-size: 12px;
        margin: 0px 15px;
        font-weight: 400;
    }

    .sandx-list-item .sub-info {
        font-size: 14px;
        margin: 20px 20px 0px 0px;
    }

        .sandx-list-item .sub-info.lower {
            text-transform: lowercase;
        }

    .sandx-list-item .arrow {
        font-size: 20px;
        margin: 15px 26px 0px 0px;
    }

    .sandx-list-item .header {
        margin: 15px;
    }

        .sandx-list-item .header img {
            height: 35px;
        }

    .sandx-list-item .input-col {
        width: 185px;
    }

    .sandx-list-item .unit-col {
        width: 90px;
    }

    .sandx-list-item .scaling-col {
        width: 90px;
    }

.sand-monitoring-graph {
    margin-top: 0 !important;
}

    .sand-monitoring-graph .ibox {
        border-radius: 15px !important;
        overflow: hidden;
        margin-bottom: 0 !important;
    }

        .sand-monitoring-graph .ibox .ibox-title {
            border: none !important;
            padding: 15px 0px 8px 15px;
        }

            .sand-monitoring-graph .ibox .ibox-title i.fa {
                margin-right: 8px;
                color: #1c84c6;
            }

        .sand-monitoring-graph .ibox .ibox-content {
            border: none !important;
        }

            .sand-monitoring-graph .ibox .ibox-content h1 {
                font-weight: 400;
            }

        .sand-monitoring-graph .ibox .ibox-content-value {
            border-left: 3px solid #1c84c6;
            padding-left: 15px;
        }

    .sand-monitoring-graph .ibox-content .feed-element {
        cursor: pointer;
        border-bottom: none;
        transition: all 0.1s;
        padding: 10px 20px 10px;
    }

        .sand-monitoring-graph .ibox-content .feed-element:hover {
            cursor: pointer;
            border-bottom: none;
            background: #fafafa;
            transform: scale(1.1);
        }

/* Sand Sample Core */

.sand-sample-core-column {
    min-width: 300px;
    max-width: 300px;
}

.sand-sample-core-level-image {
    object-fit: contain;
    height: 400px;
    width: 100%;
}

/* End of Sand Sample Core */

.highcharts-plot-line-label {
    font-size: 16px !important;
    font-weight: bold;
}

.hamburger-btn {
    background: none;
    border: none;
    font-size: 24px;
}

/* Tile Box */

.field-matrix-column {
    min-width: 250px;
    max-width: 250px;
}

/* Card */
.well-card {
    width: 240px; /* tweak as needed */
    background: #fff;
    border: 1px solid #e6e8ef;
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

/* Title */
.tile-box-title {
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

/* Matrix container: force a square-ish look */
.tile-box-matrix {
    display: flex;
    gap: 8px; /* space between columns */
    height: 200px; /* overall height (tune to taste) */
}

/* Columns */
.tile-box-col {
    display: flex;
    flex-direction: column;
    gap: 12px; /* consistent gap if content grows */
    flex: 1 1 0;
}

/* Tile styles */
.tile-box {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 2px solid #23344a; /* dark stroke like your mock */
    border-radius: 6px;
    padding: 6px; /* keeps multiline comfortable */
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
    line-height: 1.15;
    font-size: 0.8rem;
}

/* Sizes � tuned to fill the 240px height nicely */
.tile-box--lg {
    height: 90px;
}

.tile-box--sm {
    height: 56px;
}

.tile-line,
.tile-box .tile-line {
    line-height: 1.15;
}

/* Create or Edit Form */
.matrix-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: min-content;
    grid-column-gap: .75rem;
    grid-row-gap: .75rem;
}

.cell {
    display: flex;
    flex-direction: column;
}

.cell-lg {
}

.cell-sm {
}

.spacer {
}

/* End of Create or Edit Form */

/* End of Tile Box*/

/* Dashboard */

/* Layout */
.sx-container {
    display: grid;
    grid-template-columns: repeat(12,1fr);
    gap: 20px;
    grid-auto-flow: row dense;
}

.sx-panel {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06)
}

    .sx-panel .sx-list, .sx-panel .sx-traffic {
        flex: 1 1 auto;
    }

.sx-span-8 {
    grid-column: span 8;
}

.sx-span-6 {
    grid-column: span 6;
}

.sx-span-4 {
    grid-column: span 4;
}

.sx-span-3 {
    grid-column: span 3;
}

.sx-rowspan-2 {
    grid-row: span 2;
}

@media (max-width: 992px) {
    .sx-span-8, .sx-span-6, .sx-span-4, .sx-span-3 {
        grid-column: 1 / -1
    }

    .sx-kpi {
        position: static;
    }

    .sx-container {
        gap: 14px;
    }
}

/* Titles & Utilities */
.sx-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 8px
}

.sx-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px
}

.sx-actions select {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 6px 8px;
    background: #fff
}

.sx-link {
    font-size: .9rem
}

/* KPI grid */
.sx-kpi {
    background: rgba(255,193,7,.15);
    border-color: #f0c36c;
    border-radius: 12px;
}

.sx-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit,minmax(220px,1fr));
    gap: 12px
}

.sx-tile {
    display: flex;
    gap: 12px;
    align-items: center;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 12px;
    transition: transform .15s ease, box-shadow .15s ease
}

    .sx-tile:hover {
        transform: translateY(-1px);
        box-shadow: 0 4px 10px rgba(0,0,0,.1)
    }

.sx-tile-icon {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center
}

    .sx-tile-icon img {
        max-width: 40px;
        max-height: 40px
    }

.sx-tile-value {
    font-weight: 700;
    font-size: 1.25rem;
    color: #0f172a
}

.sx-tile-label {
    font-size: .9rem;
    color: #6b7280
}

/* Charts / Map placeholders */
.sx-chart-placeholder, .sx-map-placeholder {
    height: 260px;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc
}

/* Traffic lights */
.sx-traffic {
    list-style: none;
    padding: 0;
    margin: 0
}

    .sx-traffic li {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 0;
        border-bottom: 1px solid #f1f5f9
    }

    .sx-traffic .dot {
        width: 10px;
        height: 10px;
        border-radius: 50%
    }

    .sx-traffic li.ok .dot {
        background: #16a34a
    }

    .sx-traffic li.warn .dot {
        background: #f59e0b
    }

    .sx-traffic li.bad .dot {
        background: #dc2626
    }

/* Alerts */
.sx-table {
    width: 100%;
    border-collapse: collapse
}

    .sx-table th, .sx-table td {
        padding: 8px;
        border-bottom: 1px solid #eef2f7;
        text-align: left
    }

    .sx-table tbody tr:hover {
        background: #fafafa;
    }

.sev {
    padding: 3px 8px;
    border-radius: 9999px;
    font-weight: 600;
}

.sev-red {
    background: #fee2e2;
    color: #b91c1c;
}

.sev-amber {
    background: #fef3c7;
    color: #b45309;
}

/* Insights & Lists */
.sx-insights, .sx-list {
    margin: 0;
    padding-left: 18px
}

    .sx-insights li {
        margin-bottom: 6px
    }

.sx-btn {
    margin-top: 10px;
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer
}

    .sx-btn:hover {
        background: #f8fafc
    }

.sx-kv {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    border-bottom: 1px solid #f1f5f9
}

.sx-footnote {
    margin-top: 6px;
    color: #94a3b8;
    font-size: .8rem
}

/* Dashboard */

.min-500h {
    min-height: 500px;
}
