/* ============================================================
   MisDashboard.css
   Shared styles for all MIS Dashboard feature components.
   Replaces inline <style> blocks in individual razor files.
   Class prefix: mis-  (consistent with shell classes)
   ============================================================ */

/* ── CSS Variables ─────────────────────────────────────────── */
:root {
    --mis-primary: #4338ca;
    --mis-primary-rgb: 67, 56, 202;
    --mis-border: #e5e7eb;
    --mis-text-muted: #6b7280;
    --mis-header-bg: #e8e4f3;
    --mis-header-color: #2d1a6e;
    --mis-header-divider: #c5bde0;
}

/* ============================================================
   PAGE / CARD SHELL
   ============================================================ */
.mis-page {
    display: flex;
    flex-direction: column;
}

.mis-data-card {
    display: flex;
    flex-direction: column;
}

.mis-data-card-hd {
    border-bottom: 1px solid var(--mis-border) !important;
    padding: 13px 20px !important;
    gap: 14px;
    flex-wrap: wrap;
}

/* ============================================================
   HEADER CONTROLS — Tabs / Group By / Download
   ============================================================ */

/* View tabs (Graph / Table) */
.mis-view-tabs {
    display: flex;
    height: 34px;
    border: 1.5px solid #c4c4d8;
    border-radius: 7px;
    overflow: hidden;
}

.mis-view-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 100%;
    padding: 0 16px;
    border: none;
    border-right: 1.5px solid #c4c4d8;
    background: #fff;
    color: #374151;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    transition: background .12s, color .12s;
    white-space: nowrap;
}

    .mis-view-tab:last-child {
        border-right: none;
    }

    .mis-view-tab:hover:not(.--active) {
        background: #f0f0ff;
        color: var(--mis-primary);
    }

    .mis-view-tab.--active {
        background: var(--mis-primary);
        color: #fff;
        font-weight: 700;
    }

/* Group By buttons */
.mis-groupby {
    display: flex;
    height: 34px;
    min-width: 360px;
    border: 1.5px solid #c4c4d8;
    border-radius: 7px;
    overflow: hidden;
}

.mis-gb-btn {
    flex: 1 1 0;
    min-width: 82px;
    height: 100%;
    padding: 0 4px;
    border: none;
    border-right: 1.5px solid #c4c4d8;
    background: #fff;
    color: #374151;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, color .12s;
    text-align: center;
}

    .mis-gb-btn:last-child {
        border-right: none;
    }

    .mis-gb-btn:hover:not(.--active) {
        background: #f0f0ff;
        color: var(--mis-primary);
    }

    .mis-gb-btn.--active {
        background: var(--mis-primary);
        color: #fff;
        font-weight: 700;
    }

/* Download buttons */
.mis-dl-group {
    display: flex;
    height: 34px;
    border: 1.5px solid #c4c4d8;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
}

.mis-dl-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    height: 100%;
    padding: 0 14px;
    border: none;
    border-right: 1.5px solid #c4c4d8;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .12s;
}

    .mis-dl-btn:last-child {
        border-right: none;
    }

    .mis-dl-btn.--excel {
        color: #16a34a;
    }

        .mis-dl-btn.--excel:hover {
            background: #f0fdf4;
        }

    .mis-dl-btn.--pdf {
        color: #dc2626;
    }

        .mis-dl-btn.--pdf:hover {
            background: #fef2f2;
        }

/* ============================================================
   KPI ROW  (table tab — 5 stat cards)
   ============================================================ */
.mis-kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    padding: 16px 20px 8px;
}

@media (max-width: 1100px) {
    .mis-kpi-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 600px) {
    .mis-kpi-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

.mis-kpi {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border: 1px solid var(--mis-border);
    border-radius: 10px;
    padding: 10px 14px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    transition: box-shadow .16s, transform .16s;
}

    .mis-kpi:hover {
        box-shadow: 0 4px 14px rgba(0,0,0,.09);
        transform: translateY(-1px);
    }

.mis-kpi-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 10px 0 0 10px;
}

.mis-kpi.--total .mis-kpi-accent {
    background: #6366f1;
}

.mis-kpi.--pending .mis-kpi-accent {
    background: #f59e0b;
}

.mis-kpi.--verified .mis-kpi-accent {
    background: #22c55e;
}

.mis-kpi.--unverified .mis-kpi-accent {
    background: #ef4444;
}

.mis-kpi.--discarded .mis-kpi-accent {
    background: #9ca3af;
}

.mis-kpi-icon {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.mis-kpi.--total .mis-kpi-icon {
    background: #ede9fe;
    color: #6366f1;
}

.mis-kpi.--pending .mis-kpi-icon {
    background: #fffbeb;
    color: #d97706;
}

.mis-kpi.--verified .mis-kpi-icon {
    background: #dcfce7;
    color: #16a34a;
}

.mis-kpi.--unverified .mis-kpi-icon {
    background: #fee2e2;
    color: #dc2626;
}

.mis-kpi.--discarded .mis-kpi-icon {
    background: #f3f3f3;
    color: #6b7280;
}

.mis-kpi-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.mis-kpi-lbl {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mis-text-muted);
}

.mis-kpi-vr {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.mis-kpi-val {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
}

.mis-kpi-pct {
    font-size: 11px;
    font-weight: 600;
    color: var(--mis-text-muted);
}

/* ============================================================
   GRAPH CARD
   ============================================================ */
.mis-graph-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px 20px;
}

/* Donut row: KPI summary left, donut right */
.mis-donut-row {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 14px;
    align-items: stretch;
}

@media (max-width: 800px) {
    .mis-donut-row {
        grid-template-columns: 1fr;
    }
}

.mis-donut-panel {
    width: 100%;
}

.mis-graph-kpi-panel {
    display: flex;
    flex-direction: column;
}

.mis-graph-kpi-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    justify-content: center;
    padding: 4px 0;
}

.mis-graph-kpi {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #f9f8fd;
    border: 1px solid #ede9f5;
}

.mis-graph-kpi-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mis-graph-kpi-left {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.mis-graph-kpi-lbl {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: .04em;
    white-space: nowrap;
}

.mis-graph-kpi-pct {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    white-space: nowrap;
}

.mis-graph-kpi-val {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    font-variant-numeric: tabular-nums;
    text-align: right;
    flex-shrink: 0;
}

.mis-graph-kpi.--total {
    border-left: 4px solid #6366f1;
}

.mis-graph-kpi.--verified {
    border-left: 4px solid #22c55e;
}

.mis-graph-kpi.--pending {
    border-left: 4px solid #f59e0b;
}

.mis-graph-kpi.--unverified {
    border-left: 4px solid #ef4444;
}

.mis-graph-kpi.--discarded {
    border-left: 4px solid #9ca3af;
}

/* Chart panels */
.mis-chart-panel {
    background: #fff;
    border: 1px solid var(--mis-border);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.mis-chart-hd {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f8;
}

.mis-chart-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.mis-chart-sub {
    font-size: 10.5px;
    color: var(--mis-text-muted);
    margin-top: 1px;
}

/* Donut legend */
.mis-donut-legend {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
}

.mis-legend-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.mis-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mis-legend-lbl {
    flex: 1;
    font-weight: 500;
    color: #374151;
}

.mis-legend-val {
    font-weight: 700;
    color: #111827;
    font-variant-numeric: tabular-nums;
}

/* ============================================================
   TABLE — sticky thead, single-table layout
   ============================================================ */
.mis-tbl-outer {
    margin: 6px 20px 20px;
    border: 1px solid #d5cfe8;
    border-radius: 10px;
    overflow: hidden;
}

.mis-tbl-scroll {
    max-height: calc(100vh - 430px);
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--mis-primary) #e8e4f3;
}

    .mis-tbl-scroll::-webkit-scrollbar {
        height: 8px;
        width: 8px;
    }

    .mis-tbl-scroll::-webkit-scrollbar-track {
        background: #e8e4f3;
    }

    .mis-tbl-scroll::-webkit-scrollbar-thumb {
        background: var(--mis-primary);
        border-radius: 4px;
    }

.mis-tbl {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
}

/* ── Band row (top header) ─────────────────────────────────── */
.mis-th-band {
    background: var(--mis-header-bg) !important;
    color: var(--mis-header-color) !important;
    text-align: center;
    height: 36px;
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    box-shadow: inset 0 -2px 0 var(--mis-header-divider);
    position: sticky;
    top: 0;
    z-index: 6;
}

    .mis-th-band.mis-td-sd {
        border-right: 3px solid #9b8fc4 !important;
    }

    .mis-th-band.mis-td-sd-inner {
        border-right: 1px solid #c8c0e0 !important;
    }

    .mis-th-band.--l {
        text-align: left;
        padding-left: 14px;
    }

.mis-th-band-merged {
    vertical-align: middle;
}

/* ── Sub-header row ────────────────────────────────────────── */
.mis-th-sub {
    background: var(--mis-header-bg) !important;
    color: var(--mis-header-color) !important;
    padding: 7px 12px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    white-space: nowrap;
    border-bottom: 2px solid var(--mis-header-divider) !important;
    border-right: 1px solid rgba(0,0,0,.07);
    position: sticky;
    top: 36px;
    z-index: 5;
}

    .mis-th-sub:last-child {
        border-right: none;
    }

    .mis-th-sub.--l {
        text-align: left;
    }

    .mis-th-sub.--r {
        text-align: right;
    }

    .mis-th-sub.mis-th-sub-sd {
        border-right: 3px solid #9b8fc4 !important;
    }

    .mis-th-sub.mis-th-sub-sd-inner {
        border-right: 1px solid rgba(0,0,0,.07) !important;
    }

/* ── Body cells ────────────────────────────────────────────── */
.mis-tbl tbody td {
    vertical-align: middle;
    padding: 6px 14px;
    color: #1f2937;
    border-bottom: 1px solid #eeecf2 !important;
    border-right: 1px solid #eeecf2;
    font-size: 13px;
    background-color: #ffffff !important;
}

    .mis-tbl tbody td:last-child {
        border-right: none;
    }

    .mis-tbl tbody td.--l {
        text-align: left;
    }

    .mis-tbl tbody td.--r {
        text-align: right;
        font-variant-numeric: tabular-nums;
    }

    .mis-tbl tbody td.mis-td-sd {
        border-right: 3px solid #c5bde0 !important;
    }

    .mis-tbl tbody td.mis-td-sd-inner {
        border-right: 1px solid #d5cfe8 !important;
    }

/* ── Row hover ─────────────────────────────────────────────── */
.mis-tbl tbody tr:not(.mis-total-grand):not(.mis-total-cat):not(.mis-total-div):not(.mis-total-ps):not(.mis-subrow):hover > td {
    background-color: rgba(44,26,110,.08) !important;
}

/* ── Total rows ────────────────────────────────────────────── */
.mis-tbl tbody tr.mis-total-ps > td,
.mis-tbl tbody tr.mis-total-ps:nth-child(odd) > td,
.mis-tbl tbody tr.mis-total-ps:nth-child(even) > td {
    background-color: #f3f1f9 !important;
    font-weight: 600;
    color: #555;
    border-bottom: 2px solid #d5d0e4;
}

.mis-tbl tbody tr.mis-total-div > td,
.mis-tbl tbody tr.mis-total-div:nth-child(odd) > td,
.mis-tbl tbody tr.mis-total-div:nth-child(even) > td {
    background-color: #ebe6f2 !important;
    font-weight: 600;
    color: #3a3a4a;
    border-bottom: 2px solid #c5bde0;
}

.mis-tbl tbody tr.mis-total-cat > td,
.mis-tbl tbody tr.mis-total-cat:nth-child(odd) > td,
.mis-tbl tbody tr.mis-total-cat:nth-child(even) > td {
    background-color: #e3deec !important;
    font-weight: 700;
    color: #222;
    border-bottom: 2.5px solid #9b8fc4;
    padding-top: 7px;
    padding-bottom: 7px;
}

.mis-tbl tbody tr.mis-total-grand > td,
.mis-tbl tbody tr.mis-total-grand:nth-child(odd) > td,
.mis-tbl tbody tr.mis-total-grand:nth-child(even) > td {
    background-color: #dad3e8 !important;
    font-weight: 800;
    color: #111;
    border-bottom: 3px solid #7c6faa;
    padding-top: 8px;
    padding-bottom: 8px;
}

/* ── Expand chevron ────────────────────────────────────────── */
.mis-cat-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mis-expand-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: var(--mis-primary);
    font-size: 10px;
    flex-shrink: 0;
    transition: background .12s;
}

    .mis-expand-btn:hover {
        background: #ede9fe;
    }

/* Muted parent label in sub-row when office grouping active */
.mis-subrow-parent {
    color: #b0a8cc;
    font-size: 11px;
    font-style: italic;
}

/* ── Sub-rows (expandable categories) ─────────────────────── */
.mis-tbl tbody tr.mis-subrow > td,
.mis-tbl tbody tr.mis-subrow:nth-child(odd) > td,
.mis-tbl tbody tr.mis-subrow:nth-child(even) > td {
    background-color: #f7f4ff !important;
    color: #374151;
    font-size: 12.5px;
}

.mis-tbl tbody tr.mis-subrow:hover > td {
    background-color: rgba(124,58,237,.08) !important;
}

.mis-subrow-cat {
    border-left: 3px solid #7c3aed !important;
}

.mis-subrow-cell {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 18px;
}

.mis-subrow-arrow {
    color: #7c3aed;
    font-size: 11px;
    opacity: .7;
    flex-shrink: 0;
}

.mis-tbl tbody tr.mis-subrow-loading > td {
    background-color: #f9f7ff !important;
    color: #6b7280;
    font-size: 12px;
    font-style: italic;
    padding: 10px 20px;
    text-align: center;
}

.mis-subrow-loading-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ── Drill-through buttons ─────────────────────────────────── */
.mis-drill-btn {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    font-variant-numeric: tabular-nums;
    transition: color .12s;
}

    .mis-drill-btn:hover {
        color: var(--mis-primary);
        text-decoration: underline;
    }

    .mis-drill-btn:disabled {
        cursor: default;
        color: #9ca3af;
        text-decoration: none;
    }

    .mis-drill-btn.--zero {
        color: #9ca3af;
    }

        .mis-drill-btn.--zero:hover {
            color: #9ca3af;
            text-decoration: none;
            cursor: default;
        }

/* ============================================================
   DRILL PANEL — base
   ============================================================ */
.mis-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17,24,39,.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
    z-index: 1040;
}

    .mis-overlay.--active {
        opacity: 1;
        pointer-events: auto;
    }

/* ── Panel shell ───────────────────────────────────────────── */
.mis-drill-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    box-shadow: -8px 0 32px rgba(0,0,0,.18);
    transform: translateX(100%);
    transition: transform .28s cubic-bezier(.2,.8,.2,1);
    z-index: 1050;
    display: flex;
    flex-direction: column;
    width: 90vw;
    max-width: 1100px;
    min-width: 320px;
}

    .mis-drill-panel.--active {
        transform: translateX(0);
    }

/* ── Panel header shell ────────────────────────────────────── */
.mis-drill-hd {
    display: flex !important;
    flex-direction: column !important;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--mis-border);
    background: #fafbff;
    flex-shrink: 0;
}

/* ── Row 1: close | title | badge | ··· | search | excel ───── */
.mis-drill-hd-top {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    min-width: 0;
    width: 100%;
}

.mis-drill-back {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border: 1px solid var(--mis-border);
    background: #fff;
    border-radius: 7px;
    cursor: pointer;
    color: #374151;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s;
}

    .mis-drill-back:hover {
        background: #fee2e2;
        color: #dc2626;
        border-color: #fecaca;
    }

.mis-drill-title {
    font-size: 13px;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    flex-shrink: 0;
}

.mis-drill-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--mis-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 20px;
    flex-shrink: 0;
    line-height: 1.5;
}

/* Actions: search + excel — pushed right */
.mis-drill-hd-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ── Integrated search group ───────────────────────────────── */
.mis-drill-search-group {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    height: 32px;
    border: 1.5px solid #c5cad3;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}

    .mis-drill-search-group:focus-within {
        border-color: var(--mis-primary);
        box-shadow: 0 0 0 3px rgba(var(--mis-primary-rgb), .13);
    }

.mis-drill-sg-icon {
    display: flex;
    align-items: center;
    padding: 0 6px 0 10px;
    color: #9ca3af;
    font-size: 12px;
    flex-shrink: 0;
    pointer-events: none;
}

.mis-drill-sg-input {
    flex: 1 1 auto;
    width: 180px;
    min-width: 100px;
    max-width: 240px;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 12.5px;
    font-weight: 500;
    color: #212529;
    padding: 0;
}

    .mis-drill-sg-input::placeholder {
        color: #adb5bd;
    }

.mis-drill-sg-clear {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 100%;
    border: none;
    background: transparent;
    color: #9ca3af;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition: color .15s;
}

    .mis-drill-sg-clear:hover {
        color: #dc3545;
    }

.mis-drill-sg-btn {
    height: 100%;
    padding: 0 12px;
    border: none;
    border-left: 1.5px solid #c5cad3;
    background: var(--mis-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background .15s;
}

    .mis-drill-sg-btn:hover {
        background: #3730a3;
    }

/* ── Excel button ──────────────────────────────────────────── */
.mis-drill-dl {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    height: 32px;
    flex-shrink: 0;
    border: 1.5px solid #c5cad3;
    border-radius: 7px;
    background: #fff;
    color: #16a34a;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s, border-color .12s;
}

    .mis-drill-dl:hover:not(:disabled) {
        background: #f0fdf4;
        border-color: #86efac;
    }

    .mis-drill-dl:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

/* ── Row 2: breadcrumb ─────────────────────────────────────── */
.mis-drill-hd-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
    font-size: 11.5px;
    padding-left: 2px;
    min-width: 0;
    line-height: 1.4;
}

    .mis-drill-hd-meta .bc-dim {
        color: var(--mis-text-muted);
    }

    .mis-drill-hd-meta .bc-sep {
        margin: 0 4px;
        color: #cbd5e1;
    }

    .mis-drill-hd-meta .bc-cur {
        color: #374151;
        font-weight: 600;
    }

.mis-drill-meta-count {
    color: var(--mis-primary);
    font-weight: 600;
    margin-left: 6px;
}

/* ── Panel body ────────────────────────────────────────────── */
.mis-drill-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mis-drill-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 80px 20px;
    color: var(--mis-text-muted);
    font-size: 13px;
}

.mis-drill-tbl-wrap {
    flex: 1;
    overflow: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--mis-primary) #e8e4f3;
}

    .mis-drill-tbl-wrap::-webkit-scrollbar {
        height: 8px;
        width: 8px;
    }

    .mis-drill-tbl-wrap::-webkit-scrollbar-track {
        background: #e8e4f3;
    }

    .mis-drill-tbl-wrap::-webkit-scrollbar-thumb {
        background: var(--mis-primary);
        border-radius: 4px;
    }

.mis-drill-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 12.5px;
}

    .mis-drill-tbl thead th {
        background: var(--mis-header-bg) !important;
        color: var(--mis-header-color) !important;
        font-weight: 700;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: .3px;
        padding: 8px 12px;
        white-space: nowrap;
        border-bottom: 2px solid var(--mis-header-divider);
        border-right: 1px solid #d5cfe8;
        position: sticky;
        top: 0;
        z-index: 2;
    }

        .mis-drill-tbl thead th:last-child {
            border-right: none;
        }

    .mis-drill-tbl tbody td {
        padding: 6px 12px;
        border-bottom: 1px solid #eeecf2;
        border-right: 1px solid #eeecf2;
        color: #1f2937;
        vertical-align: middle;
    }

        .mis-drill-tbl tbody td:last-child {
            border-right: none;
        }

    .mis-drill-tbl tbody tr:nth-child(odd) > td {
        background-color: #ffffff;
    }

    .mis-drill-tbl tbody tr:nth-child(even) > td {
        background-color: #edeaf5;
    }

    .mis-drill-tbl tbody tr:hover > td {
        background-color: rgba(44,26,110,.08) !important;
    }

.mis-drill-rn {
    color: var(--mis-text-muted);
    font-weight: 600;
    text-align: right;
    width: 50px;
}

/* ── Old standalone search bar — disabled ──────────────────── */
.mis-drill-search-bar,
.mis-drill-search-wrap,
.mis-drill-search-input,
.mis-drill-search-btn,
.mis-drill-search-clear,
.mis-drill-search-count {
    display: none !important;
}

/* ── Breadcrumb legacy class (if old razor still used) ─────── */
.mis-drill-bc {
    flex: 1;
    min-width: 0;
    font-size: 13px;
}

    .mis-drill-bc .bc-dim {
        color: var(--mis-text-muted);
    }

    .mis-drill-bc .bc-sep {
        margin: 0 6px;
        color: #cbd5e1;
    }

    .mis-drill-bc .bc-cur {
        color: #111827;
        font-weight: 700;
    }

/* ============================================================
   DRILL PANEL — RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Large desktops (1400px+) */
@media (min-width: 1400px) {
    .mis-drill-panel {
        width: 75vw;
        max-width: 1200px;
    }
}

/* Standard desktops / laptops (1024px–1399px) */
@media (min-width: 1024px) and (max-width: 1399px) {
    .mis-drill-panel {
        width: 82vw;
    }
}

/* Tablets (768px–1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .mis-drill-panel {
        width: 92vw;
    }

    .mis-drill-sg-input {
        width: 140px;
    }
}

/* Mobile landscape (576px–767px) — full width */
@media (max-width: 767px) {
    .mis-drill-panel {
        width: 100vw;
        min-width: unset;
        border-radius: 0;
    }

    .mis-drill-hd-top {
        flex-wrap: wrap;
    }

    .mis-drill-hd-actions {
        width: 100%;
        margin-left: 0;
    }

    .mis-drill-search-group {
        flex: 1;
    }

    .mis-drill-sg-input {
        width: 100%;
        max-width: unset;
    }
}

/* Mobile portrait (< 576px) — stacked actions */
@media (max-width: 575px) {
    .mis-drill-hd-actions {
        flex-direction: column !important;
        align-items: stretch;
    }

    .mis-drill-search-group {
        width: 100%;
    }

    .mis-drill-sg-input {
        width: 100%;
        max-width: unset;
    }

    .mis-drill-dl {
        width: 100%;
        justify-content: center;
        height: 36px;
    }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.mis-empty-state {
    padding: 56px 20px !important;
    text-align: center;
    color: var(--mis-text-muted);
}

    .mis-empty-state i {
        margin-bottom: 10px;
        display: block;
        color: var(--mis-primary);
        opacity: .4;
    }

/* ============================================================
   LOADER OVERLAY
   ============================================================ */
.mis-loader {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: rgba(255,255,255,.82);
    z-index: 20;
    border-radius: inherit;
}

    .mis-loader.--active {
        display: flex;
    }

.mis-loader-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e8e4f3;
    border-top-color: var(--mis-primary);
    border-radius: 50%;
    animation: mis-spin .7s linear infinite;
}

.mis-loader-text {
    font-size: 12px;
    color: var(--mis-text-muted);
}

@keyframes mis-spin {
    to {
        transform: rotate(360deg);
    }
}


/* ── Force width override — place at end of file ───────────── */
.mis-drill-panel {
    width: 90vw !important;
    max-width: 1400px !important;
}

@media (min-width: 1400px) {
    .mis-drill-panel {
        width: 75vw !important;
        max-width: 1400px !important;
    }
}

@media (min-width: 1024px) and (max-width: 1399px) {
    .mis-drill-panel {
        width: 82vw !important;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .mis-drill-panel {
        width: 92vw !important;
    }
}

@media (max-width: 767px) {
    .mis-drill-panel {
        width: 100vw !important;
    }
}
