/*
 * MajiSafi portal — institutional theme.
 *
 * Loaded on every portal page via PortalPanelProvider (HEAD_END render hook).
 * Design intent: a public-service operations tool, not a marketing page.
 *   - Neutral surfaces, 1px hairline borders, small radii, no decorative shadows,
 *     gradients, glows, coloured card edges or tinted icon chips.
 *   - One accent blue (#3fa9f5) for interactive elements and data series.
 *   - Colour only where it carries meaning (status, change direction).
 *   - Numbers are the content: tabular figures, generous size, quiet labels.
 * Always rendered on Filament's forced dark mode, whose "gray" palette is a
 * navy scale (PortalPanelProvider): the deep-water colours.
 * Plain CSS: no build step needed.
 */

:root {
    --ms-canvas: #05213f;
    --ms-chrome: #031a33;
    --ms-surface: #0a2c52;
    --ms-surface-sunken: #072746;
    --ms-line: rgba(255, 255, 255, 0.08);
    --ms-line-strong: rgba(255, 255, 255, 0.14);
    --ms-text: #f2f8ff;
    --ms-text-2: #b7cde4;
    --ms-text-3: #7f9dbd;
    --ms-accent: #3fa9f5;
    --ms-accent-soft: rgba(63, 169, 245, 0.14);
    --ms-series: #3fa9f5;
    --ms-track: rgba(255, 255, 255, 0.08);
    --ms-hover: rgba(255, 255, 255, 0.04);
    --ms-good: #4ade80;
    --ms-warn: #fbbf24;
    --ms-bad: #fb7185;
    --ms-radius: 6px;
    color-scheme: dark;
}

/* ------------------------------------------------------------------ */
/* Canvas & type                                                       */
/* ------------------------------------------------------------------ */

body.fi-body {
    background: var(--ms-canvas);
    color: var(--ms-text);
    font-feature-settings: "tnum" 1;
}

/* ------------------------------------------------------------------ */
/* Sidebar & top bar                                                   */
/* ------------------------------------------------------------------ */

.fi-sidebar {
    background: var(--ms-chrome);
    border-right: 1px solid var(--ms-line);
}

.fi-sidebar-header {
    background: var(--ms-chrome);
    box-shadow: none !important;
    border-bottom: 1px solid var(--ms-line);
    --tw-ring-shadow: 0 0 #0000;
}

.fi-sidebar-group-label {
    color: var(--ms-text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.6875rem;
    font-weight: 600;
}

.fi-sidebar-item-button { border-radius: 4px; }
.fi-sidebar-item-button:hover { background: rgba(255, 255, 255, 0.05); }
.fi-sidebar-item-label { color: var(--ms-text-2); font-weight: 500; }
.fi-sidebar-item-icon { color: var(--ms-text-3); }

/* Active item: a solid left rule and stronger text, no tinted pill. */
.fi-sidebar-item-active .fi-sidebar-item-button {
    background: var(--ms-accent-soft);
    box-shadow: inset 3px 0 0 var(--ms-accent);
    border-radius: 0 4px 4px 0;
}

.fi-sidebar-item-active .fi-sidebar-item-label { color: var(--ms-text); font-weight: 600; }
.fi-sidebar-item-active .fi-sidebar-item-icon  { color: var(--ms-accent); }

.fi-topbar > nav {
    background: var(--ms-chrome);
    box-shadow: 0 1px 0 var(--ms-line) !important;
    --tw-ring-shadow: 0 0 #0000;
}

.ms-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

.ms-brand__logo {
    height: 2rem;
    width: 2rem;
    flex: none;
    object-fit: contain;
}

.ms-brand__name {
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25;
    color: var(--ms-text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ------------------------------------------------------------------ */
/* Page header                                                         */
/* ------------------------------------------------------------------ */

.fi-header-heading {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ms-text);
}

.fi-header-subheading { color: var(--ms-text-3); }
.fi-breadcrumbs-item-label { color: var(--ms-text-3); }

/* ------------------------------------------------------------------ */
/* Radius scale                                                        */
/*   containers (cards, tables, maps, panels)  var(--ms-radius) = 6px  */
/*   controls (buttons, inputs, menu items)    4px                     */
/*   badges                                    3px                     */
/* Hard-coded Tailwind radii in widget views are mapped onto the scale. */
/* :where() keeps these at one-class specificity so the component      */
/* rules further down (e.g. .fi-btn) still win. Pills (rounded-full)   */
/* and tiny data marks (rounded-sm) are left alone.                    */
/* ------------------------------------------------------------------ */

:where(.fi) :is(.rounded-lg, .rounded-xl, .rounded-2xl, .rounded-3xl) { border-radius: var(--ms-radius); }
:where(.fi) :is(.rounded, .rounded-md) { border-radius: 4px; }
:where(.fi) .rounded-t-xl { border-top-left-radius: var(--ms-radius); border-top-right-radius: var(--ms-radius); }
:where(.fi) .rounded-b-xl { border-bottom-left-radius: var(--ms-radius); border-bottom-right-radius: var(--ms-radius); }

.fi-icon-btn,
.fi-dropdown-list-item,
.fi-pagination-item-button,
.fi-ta-header-cell-sort-btn,
.fi-select-input,
.fi-ta-search-field .fi-input-wrp,
.leaflet-bar { border-radius: 4px; overflow: hidden; }

.fi-pagination-items { border-radius: 4px; overflow: hidden; }
.fi-checkbox-input { border-radius: 3px; }

.leaflet-container,
.leaflet-popup-content-wrapper { border-radius: var(--ms-radius); }

/* ------------------------------------------------------------------ */
/* Surfaces: sections, widgets, tables, stats                          */
/* ------------------------------------------------------------------ */

.fi-section:not(.fi-section-not-contained, .fi-aside),
.fi-ta-ctn,
.fi-wi-stats-overview-stat,
.fi-fo-tabs,
.fi-in-tabs,
.fi-tabs:not(.fi-page-sub-navigation-tabs),
.fi-fo-repeater-item,
.fi-fo-builder-item {
    background: var(--ms-surface);
    border-radius: var(--ms-radius);
    box-shadow: 0 0 0 1px var(--ms-line) !important;
    --tw-ring-shadow: 0 0 #0000;
}

.fi-section .fi-section:not(.fi-section-not-contained),
.fi-section .fi-ta-ctn {
    background: var(--ms-surface-sunken);
}

.fi-section-header,
.fi-section-content-ctn,
.fi-section-footer { border-color: var(--ms-line); }

.fi-section-header-heading {
    color: var(--ms-text);
    font-size: 0.9375rem;
    font-weight: 600;
}

.fi-section-header-description { color: var(--ms-text-3); font-size: 0.8125rem; }
.fi-section-header-icon { color: var(--ms-text-3); }

/* ---- KPI stat tiles ----
 * Label, number, comparison. The number is the visual weight; nothing else
 * competes with it. The sparkline sits inside the padding as a quiet trace
 * rather than bleeding off the card edge. */

.fi-wi-stats-overview-header-heading {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--ms-text);
}

.fi-wi-stats-overview-header-description { color: var(--ms-text-3); font-size: 0.8125rem; }

/* Tiles share borders like a ruled table instead of floating as separate cards. */
.fi-wi-stats-overview-stats-ctn {
    gap: 0 !important;
    background: var(--ms-surface);
    border-radius: var(--ms-radius);
    box-shadow: 0 0 0 1px var(--ms-line);
    overflow: hidden;
}

.fi-wi-stats-overview-stats-ctn > .fi-wi-stats-overview-stat {
    border-radius: 0;
    box-shadow: none !important;
    background: transparent;
    border-right: 1px solid var(--ms-line);
    border-bottom: 1px solid var(--ms-line);
    margin: 0 -1px -1px 0;
    padding: 1.1rem 1.25rem 1.25rem;
    display: flex;
    flex-direction: column;
}

.fi-wi-stats-overview-stat-icon {
    width: 1rem;
    height: 1rem;
    color: var(--ms-text-3);
}

.fi-wi-stats-overview-stat-label {
    color: var(--ms-text-2);
    font-size: 0.8125rem;
    font-weight: 500;
}

.fi-wi-stats-overview-stat-value {
    font-size: 1.75rem;
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: -0.015em;
    color: var(--ms-text);
    font-variant-numeric: tabular-nums;
}

.fi-wi-stats-overview-stat-description { font-size: 0.78rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.fi-wi-stats-overview-stat-description.text-gray-500 { color: var(--ms-text-3); }
.fi-wi-stats-overview-stat-description-icon { width: 1rem; height: 1rem; }

.fi-wi-stats-overview-stat-chart {
    position: static !important;
    margin-top: auto;
    padding-top: 0.85rem;
    border-radius: 0 !important;
}

.fi-wi-stats-overview-stat-chart canvas { height: 1.75rem !important; }

/* ------------------------------------------------------------------ */
/* Tables                                                              */
/* ------------------------------------------------------------------ */

.fi-ta-header-ctn,
.fi-ta-header-toolbar { border-color: var(--ms-line); }

.fi-ta-table thead tr,
.fi-ta-table thead th { background: var(--ms-surface-sunken); }

.fi-ta-header-cell-label {
    color: var(--ms-text-2);
    font-size: 0.75rem;
    font-weight: 600;
}

.fi-ta-row:hover { background: var(--ms-hover) !important; }
.fi-ta-text-item-label { font-variant-numeric: tabular-nums; }

.fi-ta-table,
.fi-ta-table > :not([hidden]) ~ :not([hidden]),
.fi-ta-table tbody > :not([hidden]) ~ :not([hidden]) { border-color: var(--ms-line); }

.fi-pagination { border-color: var(--ms-line); }

/* ------------------------------------------------------------------ */
/* Buttons, inputs, badges, tabs                                       */
/* ------------------------------------------------------------------ */

.fi-btn { border-radius: 4px; box-shadow: none; font-weight: 600; }

/* Solid primary buttons: white on the light accent blue is only ~2.6:1, so use
   the deep navy instead (~6.8:1), matching the selected date-range button. */
.fi-btn.fi-btn-color-primary:not(.fi-btn-outlined),
.fi-btn.fi-btn-color-primary:not(.fi-btn-outlined) .fi-btn-icon,
.fi-btn.fi-btn-color-primary:not(.fi-btn-outlined) .fi-btn-label { color: #031a33 !important; }
.fi-input-wrp { border-radius: 4px; }
.fi-badge { border-radius: 3px; }
.fi-tabs-item { border-radius: 4px; }

.fi-modal-window,
.fi-dropdown-panel {
    /* Solid: a modal rendered inside .fi-main would otherwise pick up the
       translucent .bg-white remap further down. */
    background-color: var(--ms-surface) !important;
    border-radius: var(--ms-radius) !important;
    box-shadow: 0 0 0 1px var(--ms-line-strong), 0 24px 48px -20px rgba(0, 0, 0, 0.7) !important;
}

/* ------------------------------------------------------------------ */
/* Login & other simple pages                                          */
/* ------------------------------------------------------------------ */

.fi-simple-main {
    border-radius: var(--ms-radius);
    box-shadow: 0 0 0 1px var(--ms-line) !important;
    --tw-ring-shadow: 0 0 #0000;
}

.fi-simple-header-heading { font-weight: 600; letter-spacing: -0.01em; }

/* ------------------------------------------------------------------ */
/* Safety net for custom views written for light mode                  */
/* ------------------------------------------------------------------ */

/* Skipped inside maps and inside .ms-light-ui: areas that are meant to stay
   light, such as the Mobile Dashboard Builder's phone preview (it mimics the
   app). Recolouring those makes light text sit on a white card. */
.fi-main .bg-white:not(.leaflet-container *, .ms-light-ui, .ms-light-ui *) { background-color: rgba(255, 255, 255, 0.04); }
.fi-main .bg-gray-50:not(.leaflet-container *, .ms-light-ui *) { background-color: rgba(255, 255, 255, 0.05); }
.fi-main .bg-gray-100:not(.leaflet-container *, .ms-light-ui *) { background-color: rgba(255, 255, 255, 0.07); }
.fi-main :is(.text-gray-950, .text-gray-900, .text-gray-800):not(.leaflet-container *, .ms-light-ui *) { color: var(--ms-text); }
.fi-main :is(.text-gray-700, .text-gray-600):not(.leaflet-container *, .ms-light-ui *) { color: var(--ms-text-2); }
.fi-main :is(.text-gray-500, .text-gray-400):not(.leaflet-container *, .ms-light-ui *) { color: var(--ms-text-3); }
.fi-main :is(.ring-gray-200, .border-gray-200, .border-gray-100):not(.ms-light-ui *) { --tw-ring-color: var(--ms-line); border-color: var(--ms-line); }

/* Light areas inside the dark portal: light text defaults and light form fields
   (Filament's dark-mode input styles would otherwise give white text on white). */
.ms-light-ui { color-scheme: light; color: #111827; }
/* Builder controls (e.g. "Add service") on white: the light accent is too faint there. */
.ms-light-ui .text-primary-600 { color: rgb(var(--primary-800)) !important; }
.ms-light-ui .fi-input,
.ms-light-ui input[type="text"],
.ms-light-ui input[type="number"],
.ms-light-ui textarea,
.ms-light-ui select {
    color: #111827 !important;
    background-color: #ffffff !important;
    border: 1px solid #d1d5db !important;
    border-radius: 4px;
}
.ms-light-ui .fi-input::placeholder,
.ms-light-ui input::placeholder,
.ms-light-ui textarea::placeholder { color: #6b7280; }
.ms-light-ui .fi-input:focus,
.ms-light-ui input:focus,
.ms-light-ui textarea:focus { border-color: var(--ms-accent) !important; outline: 2px solid rgba(63, 169, 245, 0.35); outline-offset: 0; }

/* ------------------------------------------------------------------ */
/* Maps                                                                */
/* ------------------------------------------------------------------ */

.fi-wi-widget .leaflet-tile-pane,
.ms-map .leaflet-tile-pane {
    filter: invert(1) hue-rotate(190deg) brightness(0.95) contrast(0.9) saturate(0.5);
}

.ms-map { border-color: var(--ms-line) !important; border-radius: var(--ms-radius) !important; }

/* ------------------------------------------------------------------ */
/* Dashboard header & date range                                       */
/* ------------------------------------------------------------------ */

/* Dashboard hero: solid deep-water panel with a static wave at the foot. */
.ms-hero {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding: 1.75rem 1.75rem 3.25rem;
    border-radius: var(--ms-radius);
    background: #0b3a6c;
    border: 1px solid var(--ms-line);
}

.ms-hero__waves {
    position: absolute;
    inset: auto 0 0 0;
    height: 64px;
    pointer-events: none;
}
.ms-hero__waves svg { display: block; width: 100%; height: 100%; }

.ms-hero__top,
.ms-hero .ms-range { position: relative; z-index: 1; }

.ms-hero__top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem 2rem;
}

.ms-hero__eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9cc4ea;
}

.ms-hero__title {
    margin-top: 0.35rem;
    font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.25rem);
    line-height: 1.15;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #ffffff;
}

.ms-hero__subtitle {
    margin-top: 0.5rem;
    max-width: 40rem;
    font-size: 0.9375rem;
    color: #c4dbf1;
}
.ms-hero__subtitle strong { color: #ffffff; font-weight: 600; }

.ms-hero__badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem 0.6rem 0.6rem;
    border-radius: 4px;
    background: rgba(2, 17, 38, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ms-hero__logo {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 4px;
    object-fit: contain;
    background: #ffffff;
    padding: 0.2rem;
}

.ms-hero__badge-label { font-size: 0.75rem; color: #9cc4ea; }
.ms-hero__badge-value { font-size: 0.9375rem; font-weight: 600; color: #ffffff; }

@media (max-width: 640px) {
    .ms-hero { padding: 1.25rem 1rem 3rem; }
}

.ms-range {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1.25rem;
}

.ms-range__label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--ms-text-3);
}

.ms-segmented {
    display: inline-flex;
    flex-wrap: wrap;
    border-radius: 4px;
    box-shadow: 0 0 0 1px var(--ms-line-strong);
    background: var(--ms-surface-sunken);
    overflow: hidden;
}

.ms-segmented button {
    height: 2.25rem;
    padding: 0 0.85rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--ms-text-2);
    border-left: 1px solid var(--ms-line-strong);
}

.ms-segmented button:first-child { border-left: 0; }
.ms-segmented button:hover { background: rgba(255, 255, 255, 0.06); color: var(--ms-text); }

.ms-segmented button[aria-pressed="true"] {
    color: #031a33;
    background: var(--ms-accent);
    font-weight: 600;
}

.ms-segmented button:focus-visible { outline: 2px solid var(--ms-accent); outline-offset: -2px; }

.ms-dates {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.ms-date {
    height: 2.25rem;
    padding: 0 0.6rem;
    border-radius: 4px;
    border: 1px solid var(--ms-line-strong);
    font-size: 0.8125rem;
    color: var(--ms-text);
    background: var(--ms-surface-sunken);
    color-scheme: dark;
}
.ms-date:focus { outline: 2px solid var(--ms-accent); outline-offset: -1px; box-shadow: none; }
.ms-dates__sep { color: var(--ms-text-3); font-size: 0.8125rem; }
.ms-dates .fi-btn { height: 2.25rem; }

.ms-range__error { margin-top: 0.5rem; font-size: 0.8125rem; color: var(--ms-bad); }

/* Stand-alone date-range card (Reports) */
.ms-range-card {
    margin-bottom: 1.5rem;
    border-radius: var(--ms-radius);
    padding: 1rem 1.25rem;
    background: var(--ms-surface);
    box-shadow: 0 0 0 1px var(--ms-line);
}

.ms-range-card .ms-range { margin-top: 0.85rem; }
.ms-range-card__title { font-size: 0.9375rem; font-weight: 600; color: var(--ms-text); }
.ms-range-card__desc { margin-top: 0.15rem; font-size: 0.8125rem; color: var(--ms-text-3); }

/* ------------------------------------------------------------------ */
/* Data primitives: bar rows, meters, status dots                      */
/* ------------------------------------------------------------------ */

/* Horizontal proportional bar: label + value above, true-to-scale bar below. */
.ms-bars { display: grid; gap: 0.9rem; }

.ms-bars__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.8125rem;
}

.ms-bars__label { color: var(--ms-text); font-weight: 500; }
.ms-bars__value { color: var(--ms-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ms-bars__value small { margin-left: 0.4rem; font-size: 0.75rem; font-weight: 400; color: var(--ms-text-3); }

.ms-bars__track {
    margin-top: 0.35rem;
    height: 0.625rem;
    background: var(--ms-track);
    border-radius: 2px;
    overflow: hidden;
}

.ms-bars__fill { height: 100%; background: var(--ms-series); border-radius: 0 2px 2px 0; }

.ms-bars__note {
    margin-top: 0.3rem;
    font-size: 0.75rem;
    color: var(--ms-text-3);
    font-variant-numeric: tabular-nums;
}

.ms-bars__note--loss { color: var(--ms-text-2); }

.ms-footnote {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--ms-line);
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    font-size: 0.8125rem;
    color: var(--ms-text-3);
}

.ms-footnote strong { color: var(--ms-text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Inline meter for table cells */
.ms-meter {
    display: inline-block;
    vertical-align: middle;
    height: 0.4rem;
    width: 4.5rem;
    margin-right: 0.5rem;
    border-radius: 1px;
    background: var(--ms-track);
    overflow: hidden;
}

.ms-meter > span { display: block; height: 100%; background: var(--ms-series); }
.ms-meter--success > span { background: var(--ms-good); }
.ms-meter--warning > span { background: var(--ms-warn); }
.ms-meter--danger > span  { background: var(--ms-bad); }

.ms-dot { flex: none; display: inline-block; width: 0.5rem; height: 0.5rem; border-radius: 50%; }
.ms-dot--success { background: var(--ms-good); }
.ms-dot--warning { background: var(--ms-warn); }
.ms-dot--danger  { background: var(--ms-bad); }

/* Summary strip: a row of figures separated by rules, not floating chips. */
.ms-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    margin-bottom: 1.25rem;
    border: 1px solid var(--ms-line);
    border-radius: var(--ms-radius);
    overflow: hidden;
}

.ms-summary__item {
    padding: 0.75rem 1rem;
    border-right: 1px solid var(--ms-line);
    margin-right: -1px;
}

.ms-summary__label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--ms-text-3);
}

.ms-summary__value {
    margin-top: 0.2rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--ms-text);
    font-variant-numeric: tabular-nums;
}

/* Data table used inside custom widgets */
.ms-table { width: 100%; font-size: 0.8125rem; border-collapse: collapse; }

.ms-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--ms-text-2);
    white-space: nowrap;
    background: var(--ms-surface-sunken);
    border-bottom: 1px solid var(--ms-line);
}

.ms-table td {
    padding: 0.65rem 0.75rem;
    color: var(--ms-text-2);
    border-bottom: 1px solid var(--ms-line);
    vertical-align: middle;
}

.ms-table tbody tr:last-child td { border-bottom: 0; }
.ms-table tbody tr:hover td { background: var(--ms-hover); }
.ms-table .ms-strong { color: var(--ms-text); font-weight: 600; }
.ms-table .ms-sub { font-size: 0.75rem; color: var(--ms-text-3); }
.ms-num { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }

.ms-status {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    color: var(--ms-text);
    white-space: nowrap;
}

.ms-health-table { min-width: 52rem; }
.ms-health-table td:last-child { min-width: 12rem; }

.ms-empty { font-size: 0.8125rem; color: var(--ms-text-3); }

/* ------------------------------------------------------------------ */
/* Drilldown: clickable stat cards and the records popup               */
/* ------------------------------------------------------------------ */

.ms-drillable { cursor: pointer; transition: background-color 0.12s ease; }
.ms-drillable:hover { background-color: var(--ms-hover) !important; }
.ms-drillable:focus-visible { outline: 2px solid var(--ms-accent); outline-offset: -2px; }

.ms-drill {
    /* Wide tables scroll inside the popup instead of widening it past the screen. */
    contain: inline-size;
    max-height: 60vh;
    overflow: auto;
    border: 1px solid var(--ms-line);
    border-radius: var(--ms-radius);
}

.ms-drill__table { width: 100%; min-width: 40rem; border-collapse: collapse; font-size: 0.8125rem; }

.ms-drill__table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 0.55rem 0.75rem;
    text-align: left;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ms-text-3);
    background: var(--ms-surface-sunken);
    border-bottom: 1px solid var(--ms-line);
    white-space: nowrap;
}

.ms-drill__table td {
    padding: 0.5rem 0.75rem;
    color: var(--ms-text-2);
    border-bottom: 1px solid var(--ms-line);
    vertical-align: top;
    white-space: nowrap;
}

/* The last column holds free text (reasons, comments, errors): let it wrap. */
.ms-drill__table td:last-child { white-space: normal; min-width: 12rem; }

.ms-drill__table td:first-child { color: var(--ms-text); white-space: nowrap; }
.ms-drill__table tbody tr:last-child td { border-bottom: 0; }
.ms-drill__table tbody tr:hover td { background: var(--ms-hover); }
.ms-drill__table .ms-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.ms-drill__count { margin-top: 0.75rem; font-size: 0.75rem; color: var(--ms-text-3); }
