/* 2026-10-28 — Monitoring Dashboard (HseMonitoringDashboard.razor + MonitoringDashboard/*), after the client's
   reference design cuadro_mando_monitoreo_compacto. Everything is scoped under .mdb / .mdb-* so it never
   collides with Bootstrap (.card, .tile, .btn…) or the other HSE pages. Motion respects prefers-reduced-motion. */

.mdb {
    --navy: #0B1B3F; --navy2: #16307A; --blue: #1F4FCE; --blue2: #7C9CE8; --blue3: #E4EBFB;
    --gold: #D08A14; --gold2: #FDEBC8; --red: #B03A1E; --green: #1E7B45;
    --ink: #1B2437; --mute: #6A7488; --line: #E4E7EE; --bg: #F5F6F9;
    --ease: cubic-bezier(.22,.8,.24,1);
    --row: 150px;
    background: var(--bg);
    color: var(--ink);
    font-size: 13px;
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    position: relative;
}
.mdb *, .mdb *::before, .mdb *::after { box-sizing: border-box; }
.mdb .up { color: var(--green); }
.mdb .dn { color: var(--red); }

/* ---------------------------------------------------------------- header */
.mdb-top { background: #fff; border-bottom: 1px solid var(--line); min-height: 58px; display: flex; align-items: center; gap: 18px; padding: 8px 20px; flex-wrap: wrap; }
.mdb-ttl { display: flex; align-items: center; gap: 10px; font-weight: 600; color: var(--navy); font-size: 16px; line-height: 1.15; white-space: nowrap; }
.mdb-ttl small { display: block; font-weight: 400; color: var(--mute); font-size: 11px; }
.mdb-ttl-ic { width: 34px; height: 34px; border-radius: 9px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.mdb-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: #F0F2F6; border-radius: 10px; padding: 3px; }
.mdb-tabs button { position: relative; z-index: 1; border: 0; background: none; padding: 7px 16px; border-radius: 8px; font: inherit; font-size: 13px; color: var(--mute); display: flex; align-items: center; gap: 7px; justify-content: center; cursor: pointer; white-space: nowrap; transition: color .25s; }
.mdb-tabs button.on { color: var(--blue); font-weight: 500; }
.mdb-tab-ind { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(11,27,63,.15); transform: translateX(calc(var(--tab) * 100%)); transition: transform .38s var(--ease); }
.mdb-pj { margin-left: auto; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 20px; padding: 4px 6px 4px 12px; color: var(--blue); }
.mdb-pj select { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--ink); max-width: 280px; outline: none; cursor: pointer; }

/* ---------------------------------------------------------------- toolbar */
.mdb-toolbar { display: flex; align-items: flex-end; gap: 12px; padding: 9px 20px 10px; background: #fff; border-bottom: 1px solid var(--line); position: relative; z-index: 40; flex-wrap: wrap; }
.mdb-tbs, .mdb-tbr { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.mdb-tbr { margin-left: auto; }
.mdb-fl { position: relative; }
.mdb-fl > label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin-bottom: 3px; }
.mdb-seg { display: inline-flex; border: 1px solid #C9D1DB; border-radius: 7px; overflow: hidden; background: #fff; }
.mdb-seg button { border: 0; background: none; font: inherit; font-size: 12.5px; padding: 5px 12px; cursor: pointer; color: var(--ink); transition: background .2s, color .2s; }
.mdb-seg button + button { border-left: 1px solid #E1E6EE; }
.mdb-seg button.on { background: var(--navy); color: #fff; }
.mdb-seg button:not(.on):hover { background: #F0F4FD; }
.mdb-box { display: flex; align-items: center; gap: 8px; border: 1px solid #C9D1DB; background: #fff; border-radius: 7px; padding: 5px 10px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--ink); min-height: 31px; transition: border-color .15s, box-shadow .15s; }
.mdb-box:hover { border-color: #9FB2DA; }
.mdb-box small { color: var(--mute); font-size: 11px; }
.mdb-box .mdb-car { color: var(--mute); transition: transform .25s var(--ease); }
.mdb-dd.open .mdb-box { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,79,206,.12); }
.mdb-dd.open .mdb-car { transform: rotate(180deg); }
.mdb-fbtn b { background: var(--blue3); color: var(--navy2); font-size: 10.5px; border-radius: 9px; padding: 0 6px; }
.mdb-fbtn.has { border-color: var(--blue); }
.mdb-menu { position: absolute; left: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 16px 40px rgba(11,27,63,.2); padding: 8px; min-width: 210px; z-index: 60;
    opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top left; pointer-events: none; visibility: hidden; transition: opacity .18s ease, transform .22s var(--ease), visibility 0s .22s; }
.mdb-dd.r .mdb-menu { left: auto; right: 0; transform-origin: top right; }
.mdb-dd.open .mdb-menu { opacity: 1; transform: none; pointer-events: auto; visibility: visible; transition: opacity .18s ease, transform .22s var(--ease); }
.mdb-opt { display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 10px; border: 0; background: none; text-align: left; font: inherit; font-size: 12.5px; padding: 7px 10px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.mdb-opt small { color: var(--mute); font-size: 10.5px; }
.mdb-opt:hover:not(:disabled) { background: #F0F4FD; }
.mdb-opt.on { color: var(--blue); font-weight: 600; background: var(--blue3); }
.mdb-opt:disabled { opacity: .55; cursor: default; }
.mdb-osep { font-size: 9.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--mute); padding: 8px 10px 3px; border-top: 1px solid var(--line); margin-top: 4px; }
.mdb-pmenu { display: grid; grid-template-columns: 170px 210px; gap: 8px; padding: 10px; }
.mdb-plist { display: flex; flex-direction: column; border-right: 1px solid var(--line); padding-right: 8px; }
.mdb-plist button { border: 0; background: none; text-align: left; font: inherit; font-size: 12.5px; padding: 6px 10px; border-radius: 7px; cursor: pointer; color: var(--ink); }
.mdb-plist button:hover { background: #F0F4FD; }
.mdb-plist button.on { background: var(--blue); color: #fff; }
.mdb-pcustom { display: flex; flex-direction: column; gap: 8px; padding: 2px 4px; }
.mdb-pc-t { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.mdb-pcustom label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--mute); }
.mdb-pcustom input { border: 1px solid #C9D1DB; border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 12.5px; color: var(--ink); }
.mdb-more { display: grid; grid-template-columns: repeat(3, minmax(170px, 240px)); gap: 10px 12px; padding: 14px; width: max-content; max-width: calc(100vw - 80px); }
.mdb-fsel { display: flex; flex-direction: column; gap: 3px; margin: 0; }
.mdb-fsel span { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); }
.mdb-fsel select { width: 100%; min-width: 0; text-overflow: ellipsis; }
.mdb-fsel select { border: 1px solid #C9D1DB; border-radius: 6px; padding: 5px 8px; font: inherit; font-size: 12.5px; background: #fff; color: var(--ink); }
.mdb-more .mdb-btn { grid-column: 1 / -1; justify-self: start; }
.mdb-backdrop { position: fixed; inset: 0; z-index: 35; }
.mdb-btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; color: var(--ink); transition: background .2s, border-color .2s, color .2s, transform .12s; }
.mdb-btn:hover:not(:disabled) { border-color: #9FB2DA; }
.mdb-btn:active:not(:disabled) { transform: scale(.97); }
.mdb-btn.pri { background: var(--blue); border-color: var(--blue); color: #fff; }
.mdb-btn.pri:hover:not(:disabled) { background: #1A43B3; }
.mdb-btn.ghost { border-color: transparent; color: var(--mute); }
.mdb-btn:disabled { opacity: .5; cursor: default; }
.mdb-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--blue3); border-top-color: var(--blue); animation: mdb-rot .8s linear infinite; margin-bottom: 7px; }
@keyframes mdb-rot { to { transform: rotate(360deg); } }

.mdb-bn { margin: 10px 20px 0; padding: 7px 12px; background: var(--gold2); color: #6B4E0E; border-radius: 8px; font-size: 12px; display: flex; gap: 8px; align-items: center; animation: mdb-drop .35s var(--ease); }
@keyframes mdb-drop { from { opacity: 0; transform: translateY(-6px); } }

/* ---------------------------------------------------------------- KPI strip */
.mdb-kstrip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; padding: 12px 20px 0; position: relative; transition: opacity .25s, filter .25s; }
.mdb-kpi { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px 8px; min-width: 0; transition: box-shadow .2s, transform .2s var(--ease); }
.mdb-kpi:hover { box-shadow: 0 6px 16px rgba(11,27,63,.07); transform: translateY(-1px); }
.mdb-kpi .kl { font-size: 10px; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 64px; }
.mdb-kpi .kv { font-size: 22px; font-weight: 600; color: var(--navy); line-height: 1.2; font-variant-numeric: tabular-nums; }
.mdb-kpi .kd { font-size: 10.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdb-kpi .kd span { color: var(--mute); font-weight: 400; }
.mdb-kpi .kn { font-size: 10.5px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdb-kpi .ks { position: absolute; top: 9px; right: 10px; width: 58px; }
.mdb-kpi .ks svg { width: 58px; height: 22px; display: block; }
.mdb-ktag { position: absolute; top: -9px; left: 26px; z-index: 2; font-size: 10px; font-weight: 600; background: var(--navy); color: #fff; border-radius: 8px; padding: 1px 8px; display: flex; gap: 5px; align-items: center; animation: mdb-pop .25s var(--ease); }
.editing .mdb-kstrip { outline: 2px dashed #BFD0F6; outline-offset: -2px; margin: 8px 12px 0; padding: 14px 8px 8px; border-radius: 14px; }
.mdb-kstrip.hid .mdb-kpi { opacity: .4; filter: grayscale(.8); }
.mdb-ktag { border: 0; font-family: inherit; cursor: pointer; }
.mdb-ktag:hover { background: var(--navy2); }
.mdb-kstrip.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .mdb-kstrip.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mdb-kstrip.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mdb-kstrip.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mdb-kstrip.n1 { grid-template-columns: minmax(0, 1fr); }
.mdb-kpi .keye { position: absolute; top: 6px; right: 6px; z-index: 1; width: 24px; height: 24px; border-radius: 50%; border: 1px solid #BFD0F6; background: #fff; color: var(--blue); display: flex; align-items: center; justify-content: center; padding: 0; font-size: 13px; cursor: pointer;
    animation: mdb-pop .25s var(--ease); transition: color .2s, border-color .2s, transform .2s var(--ease); }
.mdb-kpi .keye:hover { color: var(--red); border-color: #EDB5A5; transform: scale(1.08); }
.editing .mdb-kpi .ks { opacity: 0; }
.editing .mdb-kpi { transition: opacity .3s, filter .3s, background .3s; }
.editing .mdb-kpi.off { background: #F7F8FA; }
.mdb-kpi.off .kl, .mdb-kpi.off .kv, .mdb-kpi.off .kd, .mdb-kpi.off .kn { opacity: .35; filter: grayscale(1); }
.mdb-kpi.off .keye { color: #8A93A6; border-color: var(--line); }
.mdb-kpi.off .keye:hover { color: var(--blue); border-color: #BFD0F6; }

/* ---------------------------------------------------------------- grid + cards */
.mdb-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: var(--row); grid-auto-flow: row dense; gap: 12px; padding: 12px 20px 24px; position: relative; }
.editing .mdb-grid { padding-bottom: 96px; }
.mdb-tile.w-3 { grid-column: span 3; } .mdb-tile.w-4 { grid-column: span 4; } .mdb-tile.w-6 { grid-column: span 6; }
.mdb-tile.w-8 { grid-column: span 8; } .mdb-tile.w-12 { grid-column: span 12; }
.mdb-tile.h-1 { grid-row: span 1; } .mdb-tile.h-2 { grid-row: span 2; } .mdb-tile.h-3 { grid-row: span 3; } .mdb-tile.h-4 { grid-row: span 4; }
@media (max-width: 1280px) {
    .mdb-tile.w-3, .mdb-tile.w-4 { grid-column: span 6; }
    .mdb-tile.w-8 { grid-column: span 12; }
    .mdb-kstrip[class] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
    .mdb-tile { grid-column: span 12 !important; }
    .mdb-kstrip[class] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mdb-tbr { margin-left: 0; }
    .mdb-pj { margin-left: 0; }
    .mdb-rz, .mdb-dragh, .mdb-sizes { display: none !important; }
}

.mdb-tile { container-type: size; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; min-width: 0; min-height: 0; cursor: pointer; position: relative; overflow: hidden;
    transition: border-color .2s, box-shadow .25s var(--ease), background .25s; will-change: transform; }
.mdb-tile:hover { border-color: #BFD0F6; box-shadow: 0 10px 26px rgba(11,27,63,.10); }
.mdb-tile:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.mdb-tile .th { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; min-height: 26px; }
.mdb-tile .ic { width: 26px; height: 26px; border-radius: 7px; background: var(--blue3); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; font-size: 15px; transition: transform .3s var(--ease); }
.mdb-tile:hover .ic { transform: scale(1.08); }
.mdb-tile .tt { font-size: 10.5px; letter-spacing: .07em; text-transform: uppercase; color: var(--navy); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.mdb-tile .bdg, .mdb-chip { font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; background: var(--blue3); color: var(--navy2); }
.mdb-tile .bdg.red, .mdb-chip.red { background: #F6DDDA; color: #8A2D27; }
.mdb-tile .bdg.gold, .mdb-chip.gold { background: var(--gold2); color: #6B4E0E; }
.mdb-tile .bdg.green, .mdb-chip.green { background: #DDF0E5; color: #25623D; }
.mdb-tile .bdg.mute { background: #EEF0F4; color: var(--mute); }
@container (max-width: 300px) { .mdb-tile .th .bdg { display: none; } }
.mdb-tile .eye { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: #8A93A6; background: #fff; cursor: pointer; flex: none; padding: 0; font-size: 14px; transition: opacity .2s, color .2s, border-color .2s, transform .2s var(--ease); }
.mdb-tile .eye.hov { opacity: 0; transform: scale(.8); }
.mdb-tile:hover .eye.hov, .mdb-tile:focus-within .eye.hov { opacity: 1; transform: none; }
.mdb-tile .eye:hover { color: var(--red); border-color: #EDB5A5; }
.mdb-tile .chev { color: #9AA3B5; font-size: 14px; transition: transform .25s var(--ease), color .2s; }
.mdb-tile:hover .chev { color: var(--blue); transform: scale(1.15); }
.mdb-tile .mb { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 6px; overflow: hidden; font-size: 11.5px; transition: opacity .3s, filter .3s; }
.mdb-tile.h-1 .mb { gap: 3px; }

/* customise mode */
.editing .mdb-tile { cursor: grab; outline: 2px dashed #BFD0F6; outline-offset: -2px; animation: mdb-edit-in .35s var(--ease); }
@keyframes mdb-edit-in { from { outline-color: transparent; } }
.editing .mdb-tile:hover { outline-color: var(--blue2); }
.editing .mdb-tile.off { background: #F7F8FA; }
.mdb-tile.off .mb, .mdb-tile.off .ic, .mdb-tile.off .tt, .mdb-tile.off .bdg { opacity: .35; filter: grayscale(1); }
.editing .mdb-tile .eye { color: var(--blue); border-color: #BFD0F6; }
.editing .mdb-tile.off .eye { color: #8A93A6; border-color: var(--line); }
.mdb-tile.dragging { cursor: grabbing; z-index: 30; box-shadow: 0 24px 50px rgba(11,27,63,.28); outline-color: var(--blue) !important; transition: box-shadow .2s; }
.mdb-grid.is-dragging .mdb-tile:not(.dragging) { transition: none; }
.mdb-grid.is-dragging { user-select: none; isolation: isolate; }
.mdb-ph { position: absolute; left: 0; top: 0; z-index: -1; pointer-events: none; border: 2px dashed var(--blue2); background: rgba(31,79,206,.06); border-radius: 14px; box-sizing: border-box;
    transition: transform .44s var(--ease), width .44s var(--ease), height .44s var(--ease); }
.mdb-tile.resizing { z-index: 20; outline: 2px solid var(--blue) !important; box-shadow: 0 0 0 6px rgba(31,79,206,.10); }
.mdb-sizes { display: flex; gap: 2px; background: #F0F2F6; border-radius: 7px; padding: 2px; animation: mdb-pop .3s var(--ease); }
.mdb-sizes button { border: 0; background: none; font: inherit; font-size: 10px; font-weight: 600; color: var(--mute); padding: 2px 6px; border-radius: 5px; cursor: pointer; transition: background .2s, color .2s; }
.mdb-sizes button:hover { color: var(--navy); background: #fff; }
.mdb-sizes button.on { background: var(--blue); color: #fff; }
@container (max-width: 330px) { .mdb-sizes button:nth-child(n+4) { display: none; } }
.mdb-dragh { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); color: #A9B4C8; font-size: 14px; line-height: 1; pointer-events: none; animation: mdb-pop .3s var(--ease); }
.mdb-rz { position: absolute; right: 3px; bottom: 3px; width: 18px; height: 18px; cursor: nwse-resize; border-radius: 4px; animation: mdb-pop .3s var(--ease);
    background: linear-gradient(135deg, transparent 45%, var(--blue2) 45%, var(--blue2) 55%, transparent 55%, transparent 68%, var(--blue2) 68%, var(--blue2) 78%, transparent 78%); }
.mdb-rz:hover, .mdb-tile.resizing .mdb-rz { background-color: var(--blue3); }
.mdb-szlbl { position: absolute; right: 26px; bottom: 5px; font-size: 10px; font-weight: 600; color: #fff; background: var(--navy); border-radius: 6px; padding: 1px 6px; opacity: 0; transform: translateY(4px); transition: opacity .2s, transform .2s var(--ease); pointer-events: none; }
.mdb-tile:hover .mdb-szlbl, .mdb-tile.resizing .mdb-szlbl { opacity: 1; transform: none; }
@keyframes mdb-pop { from { opacity: 0; transform: scale(.85); } }

.mdb-empty { grid-column: 1 / -1; grid-row: span 2; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; color: var(--mute); border: 2px dashed var(--line); border-radius: 14px; background: #fff; }
.mdb-empty i { font-size: 30px; color: var(--blue2); }
.mdb-empty b { color: var(--navy); }

/* ---------------------------------------------------------------- card content: compact pieces */
.mdb-mbig { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; line-height: 1.15; }
.mdb-mbig b { font-size: 24px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.mdb-mbig span { color: var(--mute); font-size: 11px; }
.mdb-mbig span b { font-size: inherit; }
.mdb-mrow { display: grid; grid-template-columns: minmax(0, 1fr) 34% 40px; align-items: center; gap: 7px; font-size: 11px; min-height: 16px; }
.mdb-mrow.x { grid-template-columns: minmax(0, 1fr) 26% 36px 54px; }
.mdb-mrow .l { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdb-mrow .bar { height: 7px; background: #F0F3F7; border-radius: 4px; overflow: hidden; }
.mdb-mrow .bar i, .mdb-hb .fl, .mdb-db i, .mdb-cr .fl { display: block; height: 100%; border-radius: 4px; transform-origin: left; animation: mdb-grow-x .7s var(--ease) both; }
@keyframes mdb-grow-x { from { transform: scaleX(0); } }
.mdb-mrow .v { text-align: right; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mdb-mrow .xx { text-align: right; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.mdb-mstk { display: flex; height: 14px; border-radius: 7px; overflow: hidden; flex: none; background: #F0F3F7; }
.mdb-mstk.sm { height: 8px; }
.mdb-mstk i { display: flex; align-items: center; justify-content: center; height: 100%; color: #fff; font-size: 9.5px; font-style: normal; transform-origin: left; animation: mdb-grow-x .7s var(--ease) both; }
.mdb-mleg { display: flex; flex-wrap: wrap; gap: 3px 10px; font-size: 10.5px; color: var(--mute); }
.mdb-mleg i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; }
.mdb-mcols { flex: 1; min-height: 34px; display: flex; gap: 4px; }
.mdb-mc { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }
.mdb-mcb { flex: 1; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; transform-origin: bottom; animation: mdb-grow-y .7s var(--ease) both; }
.mdb-mc:nth-child(2n) .mdb-mcb { animation-delay: .04s; } .mdb-mc:nth-child(3n) .mdb-mcb { animation-delay: .08s; }
@keyframes mdb-grow-y { from { transform: scaleY(0); } }
.mdb-mcb i { display: block; width: 100%; flex: none; }
.mdb-mcb i:first-child { border-radius: 2px 2px 0 0; }
.mdb-mc small { font-size: 9.5px; color: var(--mute); white-space: nowrap; overflow: hidden; max-width: 100%; text-overflow: ellipsis; }
.mdb-mheat { flex: 1; min-height: 0; display: grid; gap: 2px; animation: mdb-fade .5s ease both; }
.mdb-mheat .hl { font-size: 10px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: center; padding-right: 4px; }
.mdb-mheat i { border-radius: 2px; min-height: 3px; }
@keyframes mdb-fade { from { opacity: 0; } }
.mdb-mflex { flex: 1; min-height: 0; display: flex; gap: 12px; align-items: center; }
.mdb-mflex.lg { max-width: 560px; }
.mdb-mflex.lg .mdb-mring { max-height: 170px; height: 170px; }
.mdb-mring { height: 100%; max-height: 118px; aspect-ratio: 1; flex: none; animation: mdb-spin-in .8s var(--ease) both; }
@keyframes mdb-spin-in { from { opacity: 0; transform: rotate(-60deg) scale(.85); } }
.mdb-mring svg { width: 100%; height: 100%; display: block; }
.mdb-mlist { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mdb-mli { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }
.mdb-mli span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdb-mli i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.mdb-mli b { color: var(--navy); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mdb-msep { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--mute); margin-top: 2px; }
.mdb-mnote, .mdb-note { font-size: 10.5px; color: var(--mute); line-height: 1.4; }
.mdb-note { font-size: 11px; margin-top: 10px; line-height: 1.55; }
.mdb-mnote b, .mdb-note b { color: var(--navy); }
.mdb-mtxt { overflow: hidden; }
.mdb-mtxt ul { margin: 0; padding-left: 16px; line-height: 1.5; font-size: 11.5px; }
.mdb-mtxt li { margin-bottom: 4px; }
.mdb-mtxt b { color: var(--navy); }
/* 2026-11-03 - the marker of each summary line says how it reads the situation (DashNarrative). */
.mdb-mtxt li { list-style: none; position: relative; }
.mdb-mtxt li::before { content: ""; position: absolute; left: -13px; top: .5em; width: 7px; height: 7px; border-radius: 50%; background: var(--blue2); }
.mdb-mtxt li.good::before { background: var(--green); }
.mdb-mtxt li.watch::before { background: var(--gold); }
.mdb-mtxt li.problem::before { background: var(--red); }
.mdb-mtab { width: 100%; border-collapse: collapse; font-size: 11px; }
.mdb-mtab td, .mdb-mtab th { padding: 2px 4px; text-align: right; white-space: nowrap; }
.mdb-mtab th { font-size: 9.5px; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.mdb-mtab td:first-child, .mdb-mtab th:first-child { text-align: left; overflow: hidden; text-overflow: ellipsis; max-width: 0; width: 50%; }
.mdb-mtab td.dn { color: var(--red); font-weight: 600; }
.mdb-msort tr:not(:last-child) td { border-bottom: 1px solid #F0F2F6; }
.mdb-msort th { cursor: pointer; user-select: none; border-bottom: 1px solid var(--line); }
.mdb-msort th:hover { color: var(--navy); }
.mdb-msort th.desc::after { content: " ▾"; color: var(--blue); }
.mdb-msort th.asc::after { content: " ▴"; color: var(--blue); }
@container (max-width: 460px) { .mdb-msort .wide { display: none; } }
.mdb-adj { font-size: 11.5px; padding: 4px 0; border-bottom: 1px solid #F0F2F6; color: var(--ink); }
.mdb-adj:last-of-type { border-bottom: 0; }
.mdb-adj b { color: var(--navy); }
.mdb-adj small { display: block; color: var(--mute); font-size: 10.5px; }
.mdb-mcal { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.mdb-mcal span { border-radius: 4px; font-size: 9.5px; display: flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; min-height: 0; animation: mdb-fade .4s ease both; }
.mdb-mcal .hd, .mdb-cal .hd { color: var(--mute); background: none; font-weight: 600; }
.mdb-mcal .blank, .mdb-cal .blank { background: none; }
.mdb-mscat { flex: 1; min-height: 40px; position: relative; }
.mdb-mscat svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mdb-flat { color: var(--mute); }
.mdb-nosrc, .mdb-empty-card { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 4px; color: var(--mute); font-size: 11px; padding: 6px 10px; }
.mdb-nosrc i, .mdb-empty-card i { font-size: 22px; color: #B3BDD0; }
.mdb-nosrc b { color: var(--navy); font-size: 12px; }
.mdb-err i { color: var(--red); }
.mdb-skel { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.mdb-skel i { display: block; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #EEF1F6 0, #F7F9FC 40%, #EEF1F6 80%); background-size: 300% 100%; animation: mdb-shimmer 1.3s linear infinite; }
.mdb-skel i:nth-child(1) { width: 45%; height: 22px; } .mdb-skel i:nth-child(2) { width: 90%; } .mdb-skel i:nth-child(3) { width: 70%; }
@keyframes mdb-shimmer { to { background-position: -300% 0; } }

/* calendar status colours (compact and detail) */
.mdb-mcal .ok, .mdb-cal .ok { background: #E3F3EA; color: #14582F; }
.mdb-mcal .warn, .mdb-cal .warn { background: #FDEBC8; color: #7A4E07; }
.mdb-mcal .bad, .mdb-cal .bad { background: #F8DDD5; color: #8A2B12; }
.mdb-mcal .future, .mdb-cal .future { background: #E4EBFB; color: #2B4A9E; }
.mdb-mcal .off, .mdb-cal .off { background: #F0F2F6; color: #B5BCCB; }
.mdb-mcal .none, .mdb-cal .none { background: #F7F8FA; color: #9AA3B5; }

/* ---------------------------------------------------------------- card content: detail pieces */
.mdb-svg { display: block; width: 100%; height: auto; }
.mdb-svg text { font-family: inherit; }
.mdb-grow { transform-origin: bottom; transform-box: fill-box; animation: mdb-grow-y .7s var(--ease) both; }
.mdb-hb { display: grid; grid-template-columns: minmax(120px, 230px) 1fr 56px 90px; align-items: center; gap: 10px; margin: 7px 0; font-size: 12px; }
.mdb-hb .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdb-hb .tr { position: relative; height: 16px; background: #F0F3F7; border-radius: 3px; }
.mdb-hb .fl { border-radius: 3px; }
.mdb-hb .rf { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--red); }
.mdb-hb .vl { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); }
.mdb-hb .ex { font-size: 11px; color: var(--mute); }
.mdb-cr { display: grid; grid-template-columns: 16px minmax(120px, 240px) 1fr 56px 70px; align-items: center; gap: 8px; padding: 5px 4px; font-size: 12px; border-radius: 6px; }
.mdb-cr.hs { cursor: pointer; }
.mdb-cr.hs:hover { background: #F5F7FB; }
.mdb-cr.sb { font-size: 11.5px; color: #3A4458; animation: mdb-drop .3s var(--ease); }
.mdb-cr.sb .lb { padding-left: 14px; }
.mdb-cr .cv { color: var(--mute); }
.mdb-cr .lb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mdb-cr .tr { height: 12px; background: #F0F3F7; border-radius: 3px; overflow: hidden; }
.mdb-cr .vl { text-align: right; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.mdb-cr .ex { text-align: right; font-size: 11px; font-weight: 600; }
.mdb-ddrow { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.mdb-twrap { overflow-x: auto; }
table.mdb-t { width: 100%; border-collapse: collapse; font-size: 12px; }
table.mdb-t th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--mute); font-weight: 600; padding: 6px 8px; border-bottom: 2px solid var(--line); white-space: nowrap; }
table.mdb-t td { padding: 7px 8px; border-bottom: 1px solid #F0F2F6; vertical-align: middle; }
table.mdb-t tr:not(:first-child) { transition: background .15s; }
table.mdb-t tr:not(:first-child):hover { background: #F7F9FD; }
table.mdb-t td.n, table.mdb-t th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.mdb-t td.rk { width: 28px; color: var(--mute); font-weight: 600; }
table.mdb-t tr.tot td { font-weight: 600; border-top: 2px solid var(--line); background: #FAFBFD; }
table.mdb-t .mdb-sort { cursor: pointer; user-select: none; }
table.mdb-t .mdb-sort:hover { color: var(--navy); }
table.mdb-t .mdb-sort.desc::after { content: " ▾"; color: var(--blue); }
table.mdb-t .mdb-sort.asc::after { content: " ▴"; color: var(--blue); }
.mdb-na { color: #A9B1C2; font-style: italic; }
.mdb-pct { color: var(--mute); font-size: 10.5px; }
.mdb-hml { display: block; color: var(--mute); font-size: 10.5px; letter-spacing: .02em; }
.mdb-hml span { font-weight: 600; margin: 0 1px; }
.mdb-db { display: flex; align-items: center; gap: 8px; }
.mdb-db span { flex: 1; height: 14px; background: #F0F3F7; border-radius: 3px; overflow: hidden; }
.mdb-db i { border-radius: 3px; }
.mdb-db b { min-width: 34px; text-align: right; font-size: 11.5px; color: var(--navy); font-variant-numeric: tabular-nums; }
table.mdb-hm { border-collapse: separate; border-spacing: 2px; font-size: 11px; width: 100%; }
table.mdb-hm th { font-size: 10px; color: var(--mute); font-weight: 600; padding: 3px 4px; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.mdb-hm th.rw { text-align: left; max-width: 180px; }
table.mdb-hm td { text-align: center; padding: 6px 2px; border-radius: 3px; font-variant-numeric: tabular-nums; min-width: 26px; animation: mdb-fade .5s ease both; }
.mdb-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; max-width: 760px; }
.mdb-calh { grid-column: 1 / -1; font-weight: 600; color: var(--navy); margin-bottom: 4px; }
.mdb-cal span { border-radius: 6px; padding: 8px 6px; min-height: 52px; display: flex; flex-direction: column; justify-content: space-between; font-size: 12px; font-weight: 600; animation: mdb-fade .4s ease both; }
.mdb-cal span small { font-weight: 500; font-size: 11px; }
.mdb-cal .hd { min-height: 0; padding: 2px 6px; }
.mdb-detail-narrow { max-width: 520px; height: 200px; display: flex; flex-direction: column; }
.mdb-axis { text-align: center; font-size: 10.5px; color: var(--mute); margin-top: 6px; }
.mdb-scat-lg { max-width: 760px; }

/* ---------------------------------------------------------------- detail modal */
.mdb-mod { position: fixed; inset: 0; background: rgba(11,27,63,.38); backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center; z-index: 1050; padding: 3vh 3vw; animation: mdb-fade .22s ease both; }
.mdb-mbox { background: var(--bg); border-radius: 16px; width: min(1280px, 100%); max-height: 100%; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(11,27,63,.35); overflow: hidden; animation: mdb-zoom .32s var(--ease) both; }
@keyframes mdb-zoom { from { opacity: 0; transform: translateY(18px) scale(.96); } }
.mdb-mod.closing { animation: mdb-fade-out .17s ease forwards; }
.mdb-mod.closing .mdb-mbox { animation: mdb-zoom-out .17s ease forwards; }
@keyframes mdb-fade-out { to { opacity: 0; } }
@keyframes mdb-zoom-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }
.mdb-mhd { display: flex; align-items: center; gap: 16px; padding: 16px 22px; background: #fff; border-bottom: 1px solid var(--line); }
.mdb-mic { width: 46px; height: 46px; border-radius: 12px; background: var(--blue3); color: var(--blue); display: flex; align-items: center; justify-content: center; flex: none; font-size: 24px; }
.mdb-mtt { min-width: 0; flex: 1; }
.mdb-mtt h2 { margin: 0; font-size: 18px; letter-spacing: .07em; text-transform: uppercase; color: var(--navy); font-weight: 600; }
.mdb-mtt p { margin: 3px 0 0; color: var(--mute); font-size: 12.5px; }
.mdb-chips { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.mdb-mact { display: flex; gap: 6px; align-self: flex-start; }
.mdb-ib { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); transition: background .15s, transform .12s; }
.mdb-ib:hover:not(:disabled) { background: #F0F4FD; }
.mdb-ib:active:not(:disabled) { transform: scale(.94); }
.mdb-ib:disabled { opacity: .35; cursor: default; }
.mdb-mbd { padding: 18px 22px 22px; overflow: auto; min-height: 200px; background: #fff; margin: 14px 18px; border-radius: 12px; border: 1px solid var(--line); animation: mdb-slide .3s var(--ease) both; }
@keyframes mdb-slide { from { opacity: 0; transform: translateX(14px); } }
.mdb-mbd .mdb-mtxt ul { font-size: 13.5px; line-height: 1.75; }
.mdb-mbd .mdb-mbig b { font-size: 30px; }
.mdb-mbd .mdb-mbig span { font-size: 12.5px; }
.mdb-mbd .mdb-mstk { height: 22px; border-radius: 4px; margin: 10px 0 4px; max-width: 720px; }
.mdb-mbd .mdb-mstk.sm { height: 8px; margin: 0; }
.mdb-mbd .mdb-mleg { font-size: 11.5px; gap: 4px 14px; margin-top: 6px; }
.mdb-mbd .mdb-mcols { min-height: 160px; gap: 8px; }
.mdb-mbd .mdb-mc small { font-size: 11px; }
.mdb-mbd .mdb-mnote { font-size: 12px; margin-top: 8px; }
.mdb-mbd .mdb-nosrc, .mdb-mbd .mdb-empty-card { min-height: 220px; font-size: 13px; }
.mdb-mbd .mdb-nosrc i, .mdb-mbd .mdb-empty-card i { font-size: 34px; }
.mdb-mft { padding: 0 22px 12px; font-size: 11px; color: var(--mute); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- customise bar + toast */
.mdb-editbar { position: fixed; bottom: 18px; left: 50%; transform: translate(-50%, 140%); opacity: 0; pointer-events: none; background: var(--navy); color: #DCE4F7; border-radius: 14px; padding: 9px 10px 9px 16px; display: flex; gap: 12px; align-items: center; box-shadow: 0 14px 40px rgba(11,27,63,.4); z-index: 90; font-size: 12.5px; max-width: calc(100vw - 40px);
    transition: transform .42s var(--ease), opacity .3s; }
.editing .mdb-editbar { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.mdb-editbar b { color: #fff; }
.mdb-editbar .etext { display: flex; flex-direction: column; gap: 2px; line-height: 1.35; }
.mdb-editbar .etext i { vertical-align: -2px; }
.mdb-editbar .ecount { background: #16307A; border-radius: 8px; padding: 2px 8px; font-size: 11.5px; white-space: nowrap; }
.mdb-editbar .mdb-btn { white-space: nowrap; }
.mdb-editbar .mdb-btn:not(.pri) { background: transparent; color: #DCE4F7; border-color: #3A4E80; }
.mdb-toast { position: fixed; bottom: 18px; left: 50%; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; background: var(--navy); color: #fff; border-radius: 10px; padding: 9px 10px 9px 14px; font-size: 12.5px; display: flex; gap: 12px; align-items: center; z-index: 95; box-shadow: 0 10px 30px rgba(11,27,63,.35); transition: transform .35s var(--ease), opacity .25s; }
.mdb-toast.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.editing .mdb-toast.show { transform: translate(-50%, -64px); }
.mdb-toast button { border: 1px solid #3A4E80; background: transparent; color: #BFD0F6; border-radius: 7px; padding: 4px 10px; font: inherit; font-size: 12px; cursor: pointer; }

/* 2026-11-03 - every card keeps its content apart down to the smallest size (3 × 1). The card is a size
   container, so its content reacts to the card's own width and height, not the window's. Fixed-size
   pieces never shrink (what does not fit is cut at the bottom of the card); the pieces that stretch to
   fill the card (ring, columns, heat map, calendar, scatter) clip their own content instead of spilling
   onto the next piece; and what is secondary (.mdb-sec) goes away when the card is too low for it. */
:where(.mdb-tile .mb) > * { flex-shrink: 0; }
/* The fade lives in the body's bottom padding: content that fits ends above it and stays sharp, only what
   does not fit runs into it and fades out (the card gives that padding back from its own). */
.mdb-tile { padding-bottom: 2px; }
.mdb-tile .mb { padding-bottom: 8px; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 8px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 8px), transparent); }
.mdb-mflex, .mdb-mcols, .mdb-mheat, .mdb-mcal, .mdb-mscat, .mdb-nosrc, .mdb-empty-card { overflow: hidden; }
.mdb-mtxt { flex: 1 1 auto; min-height: 0; }
.mdb-mstk i { overflow: hidden; white-space: nowrap; min-width: 0; }
.mdb-mleg span { white-space: nowrap; }
.mdb-mheat .hl { line-height: 1; overflow: hidden; }
@container (max-height: 240px) {
    .mdb-tile .mdb-sec { display: none; }
    .mdb-mheat { --hl: 0px; }
    .mdb-mheat .hl { display: none; }
    .mdb-mcal { gap: 2px; }
    .mdb-mcal span { font-size: 0; }
    .mdb-mcal .hd { display: none; }
    .mdb-mring { max-height: 92px; }
    .mdb-mli { font-size: 10.5px; }
    .mdb-mbig b { font-size: 20px; }
    .mdb-empty-card i { display: none; }
}
@container (max-width: 380px) {
    .mdb-msort .c2 { display: none; }
    .mdb-mtab td:first-child, .mdb-mtab th:first-child { min-width: 72px; }
    .mdb-mtab th { white-space: normal; line-height: 1.15; vertical-align: bottom; }
    .mdb-mflex { gap: 8px; }
    .mdb-mrow.x { grid-template-columns: minmax(0, 1fr) 22% 34px 46px; }
}
@container (max-width: 300px) {
    .mdb-tile .tt { letter-spacing: .02em; }
    .mdb-mring { max-height: 72px; }
    .mdb-mc small { text-overflow: clip; font-size: 8.5px; letter-spacing: -.02em; }
    .mdb-mcols { gap: 2px; }
}

@media (prefers-reduced-motion: reduce) {
    .mdb *, .mdb *::before, .mdb *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
