/* ---------- Inter (the MiHCM design system font) – served by the app itself (wwwroot/fonts/inter, SIL Open Font License), no Google Fonts needed ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
             src: url('../fonts/inter/inter-latin-ext-wght-normal.woff2') format('woff2-variations'), url('../fonts/inter/inter-latin-ext-wght-normal.woff2') format('woff2');
             unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-display: swap; font-weight: 100 900;
             src: url('../fonts/inter/inter-latin-wght-normal.woff2') format('woff2-variations'), url('../fonts/inter/inter-latin-wght-normal.woff2') format('woff2');
             unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

/* ---------- MiHCM design system tokens (https://designsystem.mihcm.com, v0.21) – the same values as Components/Layout/AppTheme.cs ---------- */
:root {
    --mi-font-sans: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;   /* app font (same as AppTheme.Font) */
    --mi-primary: #003385; --mi-primary-600: #002870; --mi-primary-400: #5778B1; --mi-primary-50: #E6EBF3;
    --mi-accent: #F16012; --mi-accent-600: #C04D0E; --mi-accent-50: #FEF7F3;
    --mi-foreground: #00245D; --mi-muted-foreground: #53697E; --mi-subtle: #878DA0;
    --mi-border: #DFE0E5; --mi-border-strong: #C1C4CE; --mi-muted: #EBECEF; --mi-background: #F5F6F8;
    --mi-success: #558722; --mi-warning: #B45309; --mi-destructive: #ED3030;
    --mi-radius: 4px; --mi-radius-lg: 8px; --mi-radius-card: 10px; --mi-radius-xl: 12px;
    --mi-shadow-card: 0 1px 3px rgba(0,36,93,.06), 0 1px 2px rgba(0,36,93,.04);
    --mi-shadow-soft: 0 8px 18px 10px rgba(43,86,154,.05);
    --mi-shadow-input: 0 1px 2px rgba(0,36,93,.035);
    --mi-shadow-modal: 0 25px 50px -12px rgba(0,36,93,.25);
}
html { font-size: 15px; }   /* compact text: every rem size is ~6% smaller (body ≈13px, titles 22.5px) – change here to make the whole app bigger or smaller */
html, body { font-family: var(--mi-font-sans); color: var(--mi-foreground); }
body { background: var(--mi-background); }
.text-none { text-transform: none !important; }

/* ---------- Layout ---------- */
.app-title { font-weight: 600; letter-spacing: .2px; }
.app-drawer { border-right: 1px solid var(--mi-border); }
.region-chip { background: rgba(255,255,255,.15) !important; color: #fff !important; }
.nav-section { display: block; padding: 16px 20px 4px; color: var(--mi-subtle); font-weight: 600; }
.mud-nav-link.active { font-weight: 600; }

/* ---------- Top menu bar ---------- */
.app-topnav { height: 100%; align-items: stretch; }
.top-nav { display: flex; align-items: center; gap: 2px; height: 100%; }
.top-nav .top-nav-btn { text-transform: none; font-weight: 500; letter-spacing: .1px; padding: 6px 12px; border-radius: 6px; opacity: .88; white-space: nowrap; }
.top-nav .top-nav-btn:hover { background: rgba(255,255,255,.12); opacity: 1; }
.top-nav .top-nav-btn.active { background: rgba(255,255,255,.18); opacity: 1; font-weight: 600; box-shadow: inset 0 -2px 0 #fff; }
.top-nav-badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px;
                 background: var(--mud-palette-warning); color: #fff; font-size: 11px; font-weight: 700; text-align: center; }
.top-nav-pop { margin-top: 4px; }
.top-nav-panel { display: grid; gap: 4px 16px; padding: 8px; align-items: start; }
.top-nav-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.top-nav-heading { padding: 8px 16px 4px; font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--mi-subtle); }
/* menu tooltips (NavTips): MudTooltip makes its wrapper only as wide as the link text – keep the menu links full width */
.nav-wrapper .mud-tooltip-root, .top-nav-group .mud-tooltip-root { display: block; width: 100%; }
/* inside the app bar MudBlazor lifts the menu panel (z-index 1302) above its tooltips (1204), so they opened behind it – keep tooltips on top */
.mud-popover.mud-tooltip { z-index: var(--mud-zindex-tooltip) !important; }
.top-nav-item { border-radius: 6px; min-height: 34px; padding-top: 4px !important; padding-bottom: 4px !important; }
.top-nav-panel .mud-list-item-icon { min-width: 36px; }
.top-nav-item.active { background: rgba(0,51,133,.08); font-weight: 600; color: var(--mud-palette-primary); }
.top-nav-item.active .mud-icon-root { color: var(--mud-palette-primary); }

/* ---------- Page header ---------- */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.page-header h1 { font-size: 1.5rem; font-weight: 600; margin: 0; color: var(--mi-foreground); }
.page-header .subtitle { color: var(--mi-muted-foreground); margin-top: 4px; max-width: 820px; }
.help-panel { border-left: 4px solid var(--mi-primary-400); }
.help-panel ul { margin: 6px 0 0 18px; padding: 0; }
.help-panel li { margin: 2px 0; }
.help-panel ol { margin: 6px 0 0 18px; padding: 0; }
.help-panel p { margin: 6px 0 0; }
.help-panel .help-title { font-weight: 600; font-size: .9rem; }
.help-panel code { background: var(--mud-palette-background-gray); padding: 0 4px; border-radius: 4px; font-size: .85em; }

/* ---------- Forms ---------- */
.form-section-title { font-weight: 600; color: var(--mi-primary); margin: 8px 0 2px; display: flex; align-items: center; gap: 6px; }
.form-section-hint { color: var(--mi-muted-foreground); font-size: .85rem; margin-bottom: 8px; }
.net-price-box { background: #F0F6FC; border: 1px dashed #9CC3E6; border-radius: 8px; padding: 10px 14px; }
.readonly-info { color: var(--mi-muted-foreground); font-size: .8rem; }
.grid-actions { white-space: nowrap; }

/* ---------- Dashboard ---------- */
.stat-card { height: 100%; }
.stat-card .value { font-size: 1.8rem; font-weight: 700; color: var(--mi-primary); }
.stat-card .label { color: var(--mi-muted-foreground); }

/* ---------- Login (as login.mihcm.com: light page with the MiHCM swoosh, logo and title above a rounded card) ---------- */
.login-page { position: relative; min-height: 100vh; overflow: hidden; display: flex; align-items: center; justify-content: center; padding: 32px 16px;
    background: #FFFFFF; color: var(--mi-foreground); }
.login-swoosh { position: absolute; top: -40%; left: -38%; width: 100%; height: 180%; background: var(--mi-background); border-radius: 0 260px 260px 0;
    transform: rotate(17deg); box-shadow: 16px 0 0 #EFF2F7, 34px 0 60px rgba(0,36,93,.10); pointer-events: none; }
.login-column { position: relative; z-index: 1; width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; }
.login-mi-logo { width: 84px; height: auto; margin-bottom: 14px; }
.login-title { margin: 0 0 18px; font-size: 1.2rem; font-weight: 400; color: var(--mi-muted-foreground); text-align: center; }
.login-title b { font-weight: 600; color: var(--mi-foreground); }
.login-card { width: 100%; box-sizing: border-box; background: #fff; border: 1px solid #A9BDEB; border-radius: 18px; padding: 28px 30px 22px;
    box-shadow: 0 10px 30px rgba(0,51,133,.06); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.login-brand h1 { font-size: 1.15rem; margin: 0; color: var(--mi-foreground); font-weight: 600; }
.login-brand p { margin: 2px 0 0; color: var(--mi-muted-foreground); font-size: .88rem; }
.login-card label { display: block; font-weight: 500; font-size: .85rem; margin: 14px 0 6px; color: var(--mi-foreground); }
.login-card label.login-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; margin: 0; }
.login-field { position: relative; margin-top: 14px; }
.login-card form > .login-field:first-of-type { margin-top: 0; }
.login-field input { padding-right: 40px !important; }
.login-field-icon { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--mi-border-strong); pointer-events: none; }
.login-card input { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--mi-muted); border-radius: 6px; font-size: .95rem; color: var(--mi-foreground);
    background: #fff; box-shadow: 0 2px 8px rgba(0,36,93,.07); }
.login-card input::placeholder { color: var(--mi-subtle); }
.login-card input:focus { outline: none; border-color: var(--mi-primary-400); box-shadow: 0 0 0 3px rgba(0,51,133,.15); }
.login-card button { width: 100%; margin-top: 20px; padding: 12px; border: none; border-radius: 6px; color: #fff; font-size: .9rem; font-weight: 600;
    letter-spacing: normal; text-transform: none; cursor: pointer; background: var(--mi-primary);
    box-shadow: var(--mi-shadow-card); }
.login-card button:hover { background: var(--mi-primary-600); }
.login-error { background: #FDECEC; color: #B91C1C; border-radius: 6px; padding: 10px 12px; font-size: .88rem; }
.field-error, .validation-message { color: #B91C1C; font-size: .8rem; margin-top: 4px; }
.login-link { display: block; text-align: center; margin-top: 14px; padding-top: 12px; border-top: 1px dotted var(--mi-border-strong); font-size: .85rem; color: var(--mi-muted-foreground); text-decoration: none; }
.login-link:hover { color: var(--mi-primary); }
.login-ok { background: #E6F4EA; color: #1E6B34; border-radius: 6px; padding: 10px 12px; font-size: .9rem; }
.login-info { background: #EEF2FB; color: var(--mi-primary); border-radius: 6px; padding: 10px 12px; font-size: .9rem; margin-bottom: 8px; }
.login-card textarea.login-textarea { width: 100%; box-sizing: border-box; padding: 11px 12px; border: 1px solid var(--mi-border); border-radius: 6px; font: inherit; }
.login-card button.login-secondary { background: transparent; color: var(--mi-muted-foreground); margin-top: 8px; box-shadow: none; text-transform: none; letter-spacing: 0; }
.login-card button.login-secondary:hover { background: #F4F6FA; }
.login-hint { color: var(--mi-subtle); font-size: .78rem; text-align: center; margin: 12px 0 0; }
/* "Keep me signed in" (Auth:AllowKeepSignedIn) */
.login-card label.login-keep { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-weight: 400; color: var(--mi-muted-foreground); cursor: pointer; }
.login-card label.login-keep input { width: 16px; height: 16px; padding: 0; margin: 0; box-shadow: none; accent-color: var(--mi-primary); }
.login-providers { width: 100%; margin-top: 18px; text-align: center; }
.login-providers-title { color: var(--mi-muted-foreground); font-size: .9rem; margin-bottom: 10px; }
.login-footer { margin-top: 26px; color: var(--mi-subtle); font-size: .78rem; text-align: center; }
.login-footer b { color: var(--mi-accent); font-weight: 600; }
.login-art { display: none; }
@media (min-width: 1100px) {
    /* form on the swoosh (left), illustration on the white side (right) */
    .login-page { justify-content: flex-start; padding-left: max(6vw, 40px); gap: max(6vw, 48px); }
    .login-column { flex: 0 0 380px; margin-left: max(4vw, 0px); }
    .login-art { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; flex: 1 1 auto; max-width: 600px; text-align: center; }
    .login-art img { width: 100%; height: auto; }
    .login-art-title { margin: 8px 0 6px; font-size: 1.25rem; font-weight: 600; color: var(--mi-foreground); }
    .login-art-text { margin: 0; max-width: 420px; color: var(--mi-muted-foreground); font-size: .92rem; line-height: 1.5; }
}

/* ---------- Grids: numbers right-aligned (counts, rates, prices) ---------- */
.mud-table-cell.col-num { text-align: right; }
/* header: title on the right edge (above the numbers), sort/menu icons move to its left */
.mud-table-cell.col-num .column-header { flex-direction: row-reverse; }
.mud-table-cell.col-num .column-header .sortable-column-header { text-align: right; }
.mud-table-cell.col-num .column-header .column-options { flex-direction: row; }
/* simple tables (<th>/<td class="col-num">) */
th.col-num, td.col-num { text-align: right !important; white-space: nowrap; }

/* ---------- Grids: column widths by content, resizable columns, visible sort arrows ----------
   Column classes (set on DataGrid columns as HeaderClass/CellClass):
   g-name = customer / partner / name / module columns – take the free width;
   g-text = reason / remarks / message columns – wrap between 220 and 420px;
   g-fit  = dates, numbers, codes, statuses – one line, as narrow as the content;
   g-act  = action buttons – as narrow as the buttons.
   Columns can be dragged wider/narrower on the header edge (ColumnResizeMode.Container: the table grows and scrolls; not remembered).
   TemplateColumns need Sortable="true" (their SortBy is ignored otherwise) and Resizable="null" – in MudBlazor 7.15 a TemplateColumn
   is not resizable by default, and an explicit Resizable="true" shows the handle but blocks the drag. */
.mud-table-container { overflow-x: auto; }
/* Container resize mode sizes the grid to its content (width: max-content, nothing wraps). Until a column is dragged, keep the grid at the
   page width (names and text wrap, dates/numbers/codes stay as narrow as their content); once a column has been dragged (its header gets
   an inline width) the grid follows the dragged widths and scrolls when wider than the page. */
.mud-data-grid > .mud-table-container { min-width: 100%; }
.mud-data-grid > .mud-table-container:not(:has(.mud-table-head th[style*="width"])) { width: 100% !important; }
.mud-data-grid > .mud-table-container:not(:has(.mud-table-head th[style*="width"])) .mud-table-cell.g-fit,
.mud-data-grid > .mud-table-container:not(:has(.mud-table-head th[style*="width"])) .mud-table-cell.g-act { width: 1%; }
.mud-table:not(.mud-data-grid) .mud-table-cell.g-fit { width: 1%; }
.mud-table-head .mud-table-cell { white-space: nowrap; vertical-align: bottom; }
.mud-table-head .mud-table-cell.g-text { white-space: normal; }
.mud-table-cell.g-fit { white-space: nowrap; }
.mud-table-cell.g-act { white-space: nowrap; }
/* action cells with CellClass "d-flex justify-end": as a flex box the <td> drops out of the table row (its border and height don't line up, and
   wrapped text of the row runs over the buttons) – keep it a table cell with the buttons on the right */
.mud-table-body td.mud-table-cell.d-flex { display: table-cell !important; text-align: right; vertical-align: middle; }
.mud-table-body td.mud-table-cell.d-flex > * { vertical-align: middle; }
.mud-table-body td.mud-table-cell.d-flex > * + * { margin-left: 4px; }
/* Send / Resend in the invoice e-mail lists: same size on every row */
.em-send-btn { min-width: 92px; white-space: nowrap; }
.mud-table-cell.g-name { min-width: 170px; }
.mud-table-body .mud-table-cell.g-name { overflow-wrap: anywhere; }
.mud-table-cell.g-text { width: 320px; min-width: 220px; white-space: normal; overflow-wrap: anywhere; }
.mud-table-dense .mud-table-row .mud-table-cell { padding: 6px 10px; }
/* sort arrows: faintly shown on every sortable header (not only on hover); the active sort in navy */
.mud-data-grid .mud-table-cell .column-header .sort-direction-icon { opacity: .3; }
.mud-table-sort-label .mud-table-sort-label-icon { opacity: .3; }
.mud-data-grid .mud-table-cell .column-header .sort-direction-icon.mud-direction-asc,
.mud-data-grid .mud-table-cell .column-header .sort-direction-icon.mud-direction-desc,
.mud-table-sort-label .mud-table-sort-label-icon.mud-direction-asc,
.mud-table-sort-label .mud-table-sort-label-icon.mud-direction-desc { opacity: 1; color: var(--mi-primary); }
.mud-data-grid .mud-table-cell .column-header .sortable-column-header { cursor: pointer; }
/* the arrow right next to the title (MudBlazor pushes it to the far edge of the column); number columns: arrow on the left of the right-aligned title */
.mud-data-grid .mud-table-cell .column-header { justify-content: flex-start; }
.mud-data-grid .mud-table-cell .column-header .sortable-column-header { width: auto; }
/* resize handle: a thin line on the header edge while the header row is hovered */
.mud-data-grid .mud-table-head:hover .mud-table-cell .mud-resizer { border-right: 1px solid var(--mi-border-strong); }
/* every number field (quantities, rates, prices, days, months, %) shows its value on the right */
.mud-input input[inputmode="numeric"], .mud-input input[inputmode="decimal"] { text-align: right; }
/* read-only boxes that show a number (e.g. net rate) */
.num-field input { text-align: right; }

/* ---------- Fields kept by the BC365 sync (read-only on records that come from BC365) ---------- */
.bc-record .mud-input:has(input[readonly]) { background: var(--mud-palette-background-gray); }
.bc-record .mud-input input[readonly] { color: var(--mud-palette-text-secondary); cursor: default; }

/* ---------- Blazor error bar ---------- */
#blazor-error-ui { background: #FFF4CE; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2); display: none; left: 0; padding: .6rem 1.25rem .7rem 1.25rem; position: fixed; width: 100%; z-index: 2000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }
h1:focus, h1:focus-visible { outline: none; }

/* ---------- Orders: subscription plan picker ---------- */
.plan-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.plan-group-title { font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--mud-palette-text-secondary); margin-bottom: 6px; }
.plan-cards { display: grid; gap: 8px; }
.plan-card { text-align: left; border: 1px solid var(--mud-palette-lines-default); border-radius: 10px; background: var(--mud-palette-surface); padding: 10px 12px;
             cursor: pointer; display: grid; grid-template-columns: 1fr; justify-items: start; justify-content: stretch; align-content: start; width: 100%; gap: 2px; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
.plan-card:hover:not(.disabled) { border-color: var(--mud-palette-primary); }
.plan-card:focus-visible { outline: 2px solid var(--mud-palette-primary); outline-offset: 2px; }
.plan-card.selected { border: 2px solid var(--mud-palette-primary); padding: 9px 11px; background: rgba(0,51,133,.05); box-shadow: 0 1px 4px rgba(0,0,0,.08); }

/* plan categories: Per employee = blue, Slabs = violet, Fixed fee = teal (not green / amber / red – those are the support pills) */
.plan-group { --cat: #1E66D0; --cat-soft: #EEF4FD; --cat-tint: #F7FAFE; }
.plan-cat-emp   { --cat: #1E66D0; --cat-soft: #EAF2FD; --cat-tint: #F7FAFF; }
.plan-cat-slab  { --cat: #7445C2; --cat-soft: #F2ECFC; --cat-tint: #FAF7FE; }
.plan-cat-fixed { --cat: #0E7F86; --cat-soft: #E6F5F5; --cat-tint: #F5FBFB; }
.plan-cat-usage { --cat: #B4571A; --cat-soft: #FBEFE5; --cat-tint: #FFF9F4; }
.plan-group-head { display: flex; align-items: center; gap: 10px; background: var(--cat-soft); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px;
                   border-left: 4px solid var(--cat); }
.plan-group-head .plan-group-title { color: var(--cat); margin-bottom: 0; }
.plan-group-icon { color: var(--cat); flex: none; }
.plan-group-text { flex: 1; min-width: 0; }
.plan-group-rule { font-size: .8rem; color: var(--mud-palette-text-primary); opacity: .8; }
.plan-group-chart { flex: none; }
.plan-group-chart .axis { stroke: var(--cat); stroke-opacity: .35; stroke-width: 1.5; }
.plan-group-chart .curve { fill: none; stroke: var(--cat); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.plan-group .plan-card { position: relative; border-left: 4px solid var(--cat); padding-left: 12px; background: var(--cat-tint); }
.plan-group .plan-card:hover:not(.disabled) { border-color: var(--cat); }
.plan-group .plan-card:focus-visible { outline-color: var(--cat); }
.plan-group .plan-card.selected { border: 2px solid var(--cat); border-left-width: 6px; padding: 9px 30px 9px 10px; background: var(--cat-soft);
                                  box-shadow: 0 2px 8px rgba(0,0,0,.10); }
.plan-check { position: absolute; top: 8px; right: 8px; color: var(--cat); }
.plan-card.disabled { opacity: .45; cursor: not-allowed; }
.plan-name { font-weight: 600; }
.plan-one { font-size: .85rem; color: var(--mud-palette-text-secondary); }
.plan-example { font-size: .8rem; color: var(--mud-palette-text-secondary); font-style: italic; }
.plan-pill { justify-self: start; font-size: .7rem; font-weight: 600; border-radius: 999px; padding: 1px 8px; margin-top: 4px; }
.plan-pill.ok { background: #E6F4EA; color: #1E6B34; }
.plan-pill.part { background: #FFF4DB; color: #7A5300; }
.plan-pill.warn { background: #FDE8E8; color: #9B1C1C; }
.estimate-box { background: var(--mud-palette-background-gray); border-radius: 10px; padding: 12px 14px; height: 100%; }
.estimate-line { font-size: .9rem; padding: 2px 0; }
.tier-table td, .tier-table th { vertical-align: middle; }
.order-line-dialog { max-height: 78vh; overflow-y: auto; }
.order-lines td { vertical-align: top; }
.line-muted { color: var(--mud-palette-text-secondary); font-size: .8rem; }
.order-summary .mud-typography-h6 { line-height: 1.2; }
.schedule-invoice { border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.schedule-table td, .schedule-table th { padding: 2px 8px !important; font-size: .82rem; }
.schedule-subtotal td { font-weight: 600; border-bottom: 2px solid var(--mud-palette-lines-default); }
.timing-option { border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; }
.timing-option.selected { border: 2px solid var(--mud-palette-primary); padding: 5px 9px; }

/* Partner commitment slabs */
.slab-table td { vertical-align: top; padding-top: 6px !important; padding-bottom: 6px !important; }
.slab-table .num-right input { text-align: right; }

/* Order list: renewal count on the history button */
.renew-badge .mud-badge.mud-badge-top.right.mud-badge-overlap { inset: auto auto calc(100% - 12px) calc(100% - 12px); }

/* ---------- Notification bell ---------- */
.bell-panel { width: 400px; max-width: 92vw; }
.bell-item { display: flex; gap: 10px; padding: 8px 16px; cursor: pointer; border-left: 3px solid transparent; }
.bell-item:hover { background: rgba(0,51,133,.06); }
.bell-item.unread { border-left-color: var(--mud-palette-warning); background: rgba(232,163,23,.06); }
.bell-title { font-weight: 600; font-size: .875rem; }
.bell-text { font-size: .8rem; color: var(--mi-muted-foreground); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bell-when { font-size: .72rem; color: var(--mi-subtle); margin-top: 2px; }
.mail-preview { max-height: 60vh; overflow: auto; font-family: 'Segoe UI', Arial, sans-serif; font-size: 14px; }
.mail-preview p { margin: 0 0 10px; }
.app-title { white-space: nowrap; }
@media (max-width: 1440px) {
    .top-nav .top-nav-btn { padding: 6px 8px; }
    .top-nav .top-nav-btn .mud-button-icon-start { display: none; }
}

/* ---------- QA site ---------- */
.app-bar { box-shadow: inset 0 -3px 0 var(--mi-accent), var(--mi-shadow-soft) !important; }   /* MiHCM orange line under the navy bar */
.app-bar-qa { box-shadow: none !important; background-image: repeating-linear-gradient(135deg, #F59E0B 0 10px, var(--mi-primary-600) 10px 20px) !important;
    background-size: 100% 6px !important; background-repeat: no-repeat !important; background-position: bottom !important; }   /* QA / DEV: striped – not the brand line */
.app-logo { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 3px 8px; margin: 0 10px 0 6px; background: #fff; border-radius: 8px; }
.app-logo img { height: 26px; width: auto; display: block; }
.uapi-response { max-height: 220px; overflow: auto; margin: 4px 0 0; padding: 8px 10px; background: var(--mi-background); border: 1px solid var(--mi-border); border-radius: 6px; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.site-badge { margin-left: 10px; padding: 2px 10px; border-radius: 12px; background: #F59E0B; color: var(--mi-foreground); font-weight: 700; font-size: 12px; letter-spacing: .8px; white-space: nowrap; }

/* ---------- Windows sign-in (an identity provider button below the card, as on login.mihcm.com) ---------- */
.login-or { display: none; }
.login-windows { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 8px 16px; border: 1px solid #A9BDEB; border-radius: 6px;
                 background: #fff; color: var(--mi-foreground); font-size: .85rem; font-weight: 500; text-decoration: none; box-sizing: border-box; box-shadow: 0 2px 8px rgba(0,36,93,.06); }
.login-windows svg { color: #0078D4; }
.login-windows:hover { border-color: var(--mi-primary); color: var(--mi-primary); }

/* ---------- Home: Customer / Order / Invoice summaries (colours as in the old dashboard) ---------- */
.dash-section { margin-bottom: 20px; }
.dash-title { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: 1.05rem; color: var(--mi-foreground); margin-bottom: 10px; }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
@media (max-width: 599px) { .dash-tile { gap: 8px; padding: 10px; } .dash-tile-icon { width: 34px; height: 34px; } .dash-tile-label { white-space: normal; } }
@media (min-width: 1100px) { .dash-tiles { grid-template-columns: repeat(4, 1fr); } }
.dash-tile { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 10px; background: #fff;
    border: 1.5px solid var(--tile); border-left-width: 6px; box-shadow: 0 1px 2px rgba(0,0,0,.05); color: inherit; text-decoration: none; min-width: 0; }
.dash-tile.link:hover { box-shadow: 0 3px 10px rgba(0,0,0,.12); transform: translateY(-1px); transition: all .12s; }
.dash-tile-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--tile) 13%, #fff); }
.dash-tile-text { display: flex; flex-direction: column; min-width: 0; }
.dash-tile-label { font-size: .82rem; color: var(--mi-muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-tile-value { font-size: 1.55rem; font-weight: 700; line-height: 1.2; color: var(--tile); }
.dash-month { font-weight: 600; font-size: .9rem; min-width: 70px; text-align: center; }
.dash-table-wrap { overflow-x: auto; border: 1px solid var(--mi-border); border-radius: 10px; background: #fff; }
.dash-inv { border-collapse: collapse; width: 100%; font-size: .85rem; }
.dash-inv th { background: var(--mi-background); color: var(--mi-foreground); font-weight: 600; padding: 8px 6px; text-align: center; white-space: nowrap; border-bottom: 2px solid var(--mi-border); }
.dash-inv th:first-child, .dash-inv th:nth-child(2) { text-align: left; }
.dash-inv th.g-make { border-bottom-color: #1E66D0; } .dash-inv th.g-del { border-bottom-color: #C62828; }
.dash-inv th.g-bal { border-bottom-color: #7445C2; } .dash-inv th.g-send { border-bottom-color: #0E7F86; } .dash-inv th.g-post { border-bottom-color: var(--mi-success); }
.dash-inv td { padding: 6px; text-align: center; border-bottom: 1px solid var(--mi-muted); white-space: nowrap; }
.dash-inv td:first-child, .dash-inv td:nth-child(2) { text-align: left; }
.dash-inv tr.total td { background: #F0F8F7; border-top: 2px solid #0E7F86; font-weight: 700; }
.dash-num { display: inline-block; min-width: 38px; padding: 2px 6px; border-radius: 6px; border: 1.5px solid var(--n); color: var(--n);
    background: color-mix(in srgb, var(--n) 8%, #fff); font-weight: 600; }
.dash-num.zero { --n: var(--mi-border-strong) !important; font-weight: 400; background: #fff; }
.n-make { --n: #1E66D0; } .n-del { --n: #C62828; } .n-bal { --n: #7445C2; } .n-send { --n: #0E7F86; }
.n-post { --n: var(--mi-success); } .n-skip { --n: var(--mi-muted-foreground); } .n-warn { --n: #E0671B; }
.dash-inv tr.total .dash-num:not(.zero) { color: #fff; background: var(--n); }
.dash-empty { color: var(--mi-muted-foreground); padding: 16px !important; }
.dash-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--mi-muted-foreground); margin-top: 6px; }
.dash-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.k-make { background: #1E66D0; } .k-del { background: #C62828; } .k-bal { background: #7445C2; } .k-send { background: #0E7F86; } .k-post { background: var(--mi-success); } .k-warn { background: #E0671B; }

/* ---------- Top 10 analysis (Finance reports) ---------- */
.t10-groups { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.t10-chip { cursor: pointer; font-size: .8rem; padding: 3px 10px; border-radius: 14px; border: 1.5px solid var(--t10); color: var(--t10); background: #fff; user-select: none; }
.t10-chip.on { background: var(--t10); color: #fff; }
.t10-group-title { font-weight: 600; font-size: 1rem; color: var(--t10); margin: 18px 0 8px; padding-left: 8px; border-left: 4px solid var(--t10); }
.t10-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(440px, 1fr)); gap: 14px; }
@media (max-width: 599px) { .t10-grid { grid-template-columns: 1fr; } }
.t10-card { background: #fff; border: 1px solid var(--mi-border); border-top: 4px solid var(--t10); border-radius: 10px; padding: 12px 14px; min-width: 0; }
.t10-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.t10-icon { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--t10) 13%, #fff); }
.t10-title { flex: 1 1 auto; min-width: 0; }
.t10-name { font-weight: 600; color: var(--mi-foreground); }
.t10-no { display: inline-block; min-width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 10px; font-size: .72rem; margin-right: 6px; color: #fff; background: var(--t10); }
.t10-headline { font-size: .78rem; color: var(--mi-muted-foreground); margin-top: 2px; }
.t10-info { color: var(--mi-subtle); cursor: help; }
.t10-empty { color: var(--mi-muted-foreground); font-size: .85rem; padding: 10px 0; }
.t10-cols { display: grid; grid-template-columns: 1fr 96px 52px 74px; gap: 6px; font-size: .7rem; color: var(--mi-subtle); text-transform: uppercase; letter-spacing: .02em; padding: 0 0 4px 30px; text-align: right; border-bottom: 1px solid var(--mi-muted); }
.t10-cols span:first-child { text-align: left; }
.t10-row { display: flex; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--mi-background); }
.t10-row:last-child { border-bottom: none; }
.t10-rank { flex: 0 0 22px; height: 22px; border-radius: 50%; font-size: .72rem; font-weight: 600; display: flex; align-items: center; justify-content: center; background: var(--mi-muted); color: var(--mi-muted-foreground); margin-top: 1px; }
.t10-rank.top { background: var(--t10); color: #fff; }
.t10-main { flex: 1 1 auto; min-width: 0; }
.t10-line { display: grid; grid-template-columns: 1fr 96px 52px 74px; gap: 6px; align-items: baseline; font-size: .86rem; }
.t10-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--mi-foreground); text-decoration: none; font-weight: 500; }
a.t10-label:hover { color: var(--t10); text-decoration: underline; }
.t10-value { text-align: right; font-weight: 700; color: var(--t10); font-variant-numeric: tabular-nums; }
.t10-value.pos { color: var(--mi-success); } .t10-value.neg { color: #C62828; }
.t10-share { text-align: right; color: var(--mi-muted-foreground); font-size: .78rem; font-variant-numeric: tabular-nums; }
.t10-cmp { text-align: right; font-size: .78rem; font-variant-numeric: tabular-nums; color: var(--mi-muted-foreground); }
.t10-cmp .up { color: var(--mi-success); font-weight: 600; } .t10-cmp .down { color: #C62828; font-weight: 600; } .t10-cmp .new { color: #1E66D0; font-weight: 600; }
.t10-bar { height: 5px; background: var(--mi-muted); border-radius: 3px; margin-top: 4px; overflow: hidden; }
.t10-bar i { display: block; height: 100%; border-radius: 3px; background: var(--t10); opacity: .75; }
.t10-bar i.pos { background: var(--mi-success); } .t10-bar i.neg { background: #C62828; }
.t10-detail { font-size: .74rem; color: var(--mi-muted-foreground); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 599px) { .t10-line, .t10-cols { grid-template-columns: 1fr 76px 0 56px; } .t10-share, .t10-cols span:nth-child(3) { display: none; } }

/* ---------- Reports → Master information ---------- */
.mr-variants { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.mr-variant { border: 1.5px solid var(--mi-primary); color: var(--mi-primary); background: #fff; border-radius: 16px; padding: 4px 14px; font-size: .85rem; cursor: pointer; font-family: inherit; }
.mr-variant:hover { background: #EEF4FA; }
.mr-variant.on { background: var(--mi-primary); color: #fff; }
.mr-colmenu { padding: 8px 12px; max-height: 420px; overflow-y: auto; min-width: 220px; }
.mr-colitem { display: flex; align-items: center; gap: 6px; font-size: .85rem; padding: 2px 0; cursor: pointer; }
.mr-summary { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.mr-stat { background: #fff; border: 1px solid var(--mi-border); border-left: 4px solid var(--mi-primary); border-radius: 8px; padding: 4px 10px; font-size: .82rem; color: var(--mi-muted-foreground); }
.mr-stat b { color: var(--mi-foreground); font-size: .95rem; margin-right: 3px; }
.mr-stat.search { border-left-color: #E0A100; }
.mr-note { font-size: .8rem; color: var(--mi-muted-foreground); margin-bottom: 6px; }
.mr-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--mi-border); border-radius: 10px; background: #fff; }
.mr-table { border-collapse: collapse; width: 100%; font-size: .83rem; }
.mr-table th { position: sticky; top: 0; z-index: 1; background: var(--mi-background); color: var(--mi-foreground); font-weight: 600; text-align: left; padding: 7px 8px; white-space: nowrap; border-bottom: 2px solid var(--mi-border); cursor: pointer; user-select: none; }
.mr-table th:hover { background: #E8EEF4; }
.mr-table td { padding: 5px 8px; border-bottom: 1px solid var(--mi-muted); vertical-align: top; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mr-table th.mr-open, .mr-table td.mr-open { width: 28px; padding: 4px 2px 4px 8px; cursor: default; }
.mr-table td.mr-open a { color: var(--mi-primary); }
.mr-table tbody tr:hover td { background: #F7FAFD; }
.mr-table tr.error td { background: #FDF1F1; } .mr-table tr.error td:first-child { box-shadow: inset 4px 0 0 #C62828; }
.mr-table tr.warning td { background: #FFF8E6; } .mr-table tr.warning td:first-child { box-shadow: inset 4px 0 0 #D99A00; }
.mr-table tr.muted td { color: var(--mi-subtle); }
.mr-table td.bad { color: #C62828; font-weight: 600; } .mr-table td.warn { color: #B07800; font-weight: 600; }
.mr-table td.good { color: var(--mi-success); font-weight: 600; } .mr-table td.dim { color: var(--mi-subtle); }
.mr-empty { color: var(--mi-muted-foreground); padding: 16px !important; }
.mr-pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; font-size: .82rem; color: var(--mi-muted-foreground); margin-top: 6px; flex-wrap: wrap; }

/* ---------- Sales agreements and approvals ---------- */
.agr-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.agr-status { display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .78rem; font-weight: 600; border: 1.5px solid; white-space: nowrap; }
.agr-status.draft { color: var(--mi-muted-foreground); border-color: var(--mi-border-strong); background: var(--mi-background); }
.agr-status.pending { color: #B07800; border-color: #E0A100; background: #FFF8E6; }
.agr-status.approved { color: var(--mi-success); border-color: var(--mi-success); background: #EEF8F2; }
.agr-status.rejected { color: #C62828; border-color: #C62828; background: #FDF1F1; }
.agr-status.used { color: #1E66D0; border-color: #1E66D0; background: #EEF4FC; }
.agr-status.closed { color: var(--mi-subtle); border-color: var(--mi-border); background: #fff; }
.agr-wait { color: #B07800; font-weight: 600; }
.agr-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 12px; color: var(--mi-muted-foreground); font-size: .9rem; }
.agr-you { margin-left: auto; background: #FFF8E6; border: 1px solid #E0A100; border-radius: 8px; padding: 2px 10px; color: #7A5600; }
.agr-steps { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.agr-step { flex: 1 1 240px; max-width: 360px; background: #fff; border: 1px solid var(--mi-border); border-top: 4px solid var(--mi-border-strong); border-radius: 10px; padding: 8px 12px; font-size: .84rem; }
.agr-step.pending { border-top-color: #E0A100; box-shadow: 0 0 0 2px rgba(224,161,0,.15); }
.agr-step.approved { border-top-color: var(--mi-success); }
.agr-step.rejected { border-top-color: #C62828; }
.agr-step.sentback { border-top-color: #E0671B; }
.agr-step.cancelled { opacity: .6; }
.agr-step-head { font-weight: 600; color: var(--mi-foreground); display: flex; align-items: center; gap: 6px; }
.agr-step-no { display: inline-flex; width: 20px; height: 20px; border-radius: 50%; background: var(--mi-primary); color: #fff; font-size: .72rem; align-items: center; justify-content: center; }
.agr-step-state { color: var(--mi-muted-foreground); margin-top: 2px; }
.agr-step-comment { font-style: italic; margin-top: 4px; }
.agr-step-why, .agr-step-who { color: var(--mi-muted-foreground); font-size: .78rem; margin-top: 4px; }
.agr-versions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 10px; font-size: .85rem; color: var(--mi-muted-foreground); }
.agr-diff-note { font-size: .78rem; color: #7445C2; }
.agr-diff { display: block; font-size: .74rem; color: #7445C2; font-weight: 500; }
.agr-sub { font-weight: 600; color: var(--mi-foreground); margin: 6px 0; }
.agr-reason { font-size: .85rem; color: var(--mi-foreground); margin: 2px 0; }
.agr-terms { white-space: pre-wrap; font-size: .88rem; background: var(--mi-background); border-left: 3px solid var(--mi-primary); padding: 6px 10px; border-radius: 4px; }
.agr-lines td { white-space: nowrap; }
.agr-legend { font-size: .78rem; color: var(--mi-muted-foreground); }
.agr-legend .good { color: var(--mi-success); font-weight: 600; } .agr-legend .warn { color: #B07800; font-weight: 600; } .agr-legend .bad { color: #C62828; font-weight: 600; }
.apr-levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.apr-level { background: #fff; border: 1px solid var(--mi-border); border-left: 5px solid var(--mi-primary); border-radius: 10px; padding: 10px 12px; }
.apr-level.off { border-left-color: var(--mi-border-strong); opacity: .75; }
.apr-level-head { display: flex; align-items: center; gap: 8px; }
.apr-level-no { min-width: 26px; height: 22px; border-radius: 11px; background: var(--mi-primary); color: #fff; font-size: .72rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.apr-off { font-size: .72rem; color: var(--mi-subtle); border: 1px solid var(--mi-border); border-radius: 8px; padding: 0 6px; }
.apr-desc { font-size: .78rem; color: var(--mi-muted-foreground); margin-top: 2px; }
.apr-dim { color: var(--mi-subtle); }
.apr-user { display: flex; align-items: center; gap: 6px; font-size: .85rem; padding: 3px 0; border-bottom: 1px solid var(--mi-muted); }
.apr-add { display: flex; gap: 6px; align-items: center; margin-top: 8px; }
@media (max-width: 599px) { .apr-levels { grid-template-columns: 1fr; } .agr-you { margin-left: 0; } }
.needs-approval .mud-input-helper-text { color: #B07800 !important; font-weight: 600; }
.needs-approval .mud-input-outlined-border { border-color: #E0A100 !important; }
.agr-prospect { border-left: 4px solid #E0A100 !important; }
.agr-prospect-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; margin-top: 6px; font-size: .85rem; }
.agr-prospect-grid span { display: block; font-size: .72rem; color: var(--mi-muted-foreground); }
/* sales pipeline (Phase 2) */
.opp-sum { font-size: .85rem; color: #3F4867; }
.opp-board { display: grid; grid-template-columns: repeat(7, minmax(170px, 1fr)); gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.opp-col { background: var(--mi-background); border-radius: 8px; border-top: 3px solid var(--mi-subtle); display: flex; flex-direction: column; min-height: 360px; }
.opp-col-qualified { border-top-color: #4A7FB5; } .opp-col-proposal { border-top-color: var(--mi-primary); } .opp-col-waiting { border-top-color: #E0A100; }
.opp-col-approved { border-top-color: var(--mi-success); } .opp-col-won { border-top-color: #1B6E3A; } .opp-col-lost { border-top-color: #C0392B; }
.opp-col-head { padding: 8px 10px 4px; font-weight: 600; font-size: .85rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.opp-count { background: #fff; border-radius: 10px; padding: 0 7px; font-size: .75rem; color: #3F4867; }
.opp-col-sum { width: 100%; font-weight: normal; font-size: .75rem; color: var(--mi-muted-foreground); }
.opp-zone { flex: 1; padding: 4px 6px 8px; display: flex; flex-direction: column; gap: 6px; min-height: 80px; border-radius: 0 0 8px 8px; }
.opp-candrop .opp-zone, .opp-zone.opp-candrop { background: #E3F0E8; outline: 2px dashed var(--mi-success); outline-offset: -3px; }
.opp-zone.opp-nodrop { opacity: .55; }
.opp-card { background: #fff; border-radius: 6px; padding: 7px 9px; box-shadow: 0 1px 2px rgba(0,0,0,.12); cursor: grab; font-size: .8rem; border-left: 3px solid transparent; }
.opp-card:hover { box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.opp-card.overdue { border-left-color: #C0392B; }
.opp-card-top { display: flex; gap: 6px; align-items: center; color: var(--mi-muted-foreground); font-size: .72rem; }
.opp-val { margin-left: auto; font-weight: 600; color: var(--mi-primary); font-size: .78rem; }
.opp-new { background: #FFF3D6; color: #8A6100; border-radius: 8px; padding: 0 5px; font-size: .68rem; }
.opp-card-title { font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-card-sub { color: #3F4867; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-card-meta { color: var(--mi-muted-foreground); font-size: .72rem; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-due { color: #C0392B; font-weight: 600; } .opp-today { color: #B07800; font-weight: 600; }
.opp-stage { border-radius: 10px; padding: 1px 8px; font-size: .75rem; background: var(--mi-muted); }
.opp-stage-waiting { background: #FFF3D6; } .opp-stage-approved, .opp-stage-won { background: #E3F0E8; } .opp-stage-lost { background: #FBE3E0; } .opp-stage-proposal { background: #E4EDF6; }
.opp-path { display: flex; gap: 2px; margin: 0 0 12px; flex-wrap: wrap; }
.opp-step { flex: 1; min-width: 90px; text-align: center; padding: 6px 4px; background: var(--mi-muted); color: var(--mi-muted-foreground); font-size: .8rem; clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%, 10px 50%); }
.opp-step.done { background: #C9DCEF; color: var(--mi-primary); }
.opp-step.on { background: var(--mi-primary); color: #fff; font-weight: 600; }
.opp-step.on.opp-step-lost { background: #C0392B; } .opp-step.on.opp-step-won { background: #1B6E3A; }
.opp-two { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 12px; }
@media (max-width: 960px) { .opp-two { grid-template-columns: 1fr; } }
.opp-acts { display: flex; flex-direction: column; gap: 8px; }
.opp-act { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 6px; }
.opp-act.open { background: #F4F8FC; } .opp-act.overdue { background: #FDF0EE; }
.opp-act-body { flex: 1; min-width: 0; font-size: .85rem; }
.opp-act-meta { color: var(--mi-muted-foreground); font-size: .75rem; }
.opp-act-notes { white-space: pre-wrap; color: #333; font-size: .82rem; }
.opp-act-follow { font-size: .8rem; display: flex; align-items: center; gap: 6px; }
.opp-agr { display: flex; align-items: center; gap: 8px; font-size: .85rem; padding: 3px 0; }
.opp-kv { display: grid; grid-template-columns: 90px 1fr; gap: 3px 8px; font-size: .85rem; }
.opp-kv > span:nth-child(odd) { color: var(--mi-muted-foreground); }
.opp-quick { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.opp-quick .mr-variant { padding: 1px 8px; font-size: .75rem; }
.sd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.sd-bars { display: flex; flex-direction: column; gap: 6px; }
.sd-bar-row { display: grid; grid-template-columns: 130px 1fr 110px; gap: 8px; align-items: center; font-size: .82rem; cursor: pointer; }
.sd-bar { background: var(--mi-muted); border-radius: 4px; height: 14px; overflow: hidden; display: block; }
.sd-bar > span { display: block; height: 100%; background: var(--mi-subtle); }
.sd-bar-val { text-align: right; color: #3F4867; white-space: nowrap; }
.opp-stage-bg-qualified { background: #4A7FB5 !important; } .opp-stage-bg-proposal { background: var(--mi-primary) !important; } .opp-stage-bg-waiting { background: #E0A100 !important; }
.opp-stage-bg-approved { background: var(--mi-success) !important; } .opp-stage-bg-won { background: #1B6E3A !important; } .opp-stage-bg-lost { background: #C0392B !important; }
.sd-line { display: flex; gap: 8px; align-items: baseline; font-size: .85rem; padding: 3px 0; border-bottom: 1px solid var(--mi-muted); cursor: pointer; }
.sd-main { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sd-sub { color: var(--mi-muted-foreground); font-size: .78rem; white-space: nowrap; }
.sd-stage-help { border-collapse: collapse; max-width: 560px; font-size: .78rem; text-align: left; }
.sd-stage-help th, .sd-stage-help td { padding: 3px 8px; vertical-align: top; border-bottom: 1px solid rgba(255,255,255,.2); }
.sd-stage-help td:first-child { white-space: nowrap; font-weight: 600; }
/* head count adjustments */
.adj-up { color: #1B6E3A; } .adj-down { color: #C0392B; }
.adj-cur { color: var(--mi-muted-foreground); font-size: .75rem; }
.adj-note { color: #8A6100; font-size: .72rem; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* left side bar menu (user's menu position "left") */
.app-sidebar { background: #fff; }
.app-sidebar .mud-navmenu { padding-bottom: 24px; }

/* filter fields (Orders list): outlined field with the label above the value – Components/Shared/FilterMenu.razor (Field) */
.filter-field { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; width: 100%; height: 40px;
                padding: 2px 32px 2px 12px; border: 1px solid var(--mud-palette-lines-inputs); border-radius: var(--mud-default-borderradius);
                background: var(--mud-palette-surface); cursor: pointer; text-align: left; font: inherit; color: var(--mud-palette-text-primary);
                transition: border-color .15s, box-shadow .15s; }
.filter-field:hover { border-color: var(--mud-palette-text-primary); }
.filter-field.open { border-color: var(--mud-palette-primary); box-shadow: 0 0 0 1px var(--mud-palette-primary); }
.filter-field.active { border-color: var(--mud-palette-primary); background: rgba(0,51,133,.04); }
.filter-field-label { font-size: .7rem; line-height: 1.15; color: var(--mud-palette-text-secondary); white-space: nowrap; }
.filter-field.active .filter-field-label { color: var(--mud-palette-primary); font-weight: 600; }
.filter-field-value { font-size: .85rem; line-height: 1.3; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filter-field:not(.active) .filter-field-value { color: var(--mud-palette-text-secondary); }
.filter-field-arrow { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); color: var(--mud-palette-action-default); }
.filter-field-count { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
                      background: var(--mud-palette-primary); color: #fff; font-size: .7rem; line-height: 20px; text-align: center; }
.filter-field-count + .filter-field-arrow { right: 8px; }
.filter-field:has(.filter-field-count) { padding-right: 58px; }
/* the search box has no label: line it up with the labelled fields next to it (their label takes 4px above the box) */
.filter-search.mud-input-control { margin-top: 4px !important; }
.filter-menu-field { margin-top: 4px; }
.filter-section-title { font-size: .7rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--mud-palette-text-secondary); }
.filter-panel { border-top: 1px dashed var(--mud-palette-lines-default); }

/* ---------- MiHCM design system: component look (colours, corners and shadows come from the tokens above) ---------- */
.mud-paper-outlined { border-color: var(--mi-border) !important; }
.mud-paper:not(.mud-paper-square):not(.mud-appbar):not(.mud-drawer):not(.mud-popover):not(.mud-menu) { border-radius: var(--mi-radius-lg); }
.mud-card { border-radius: var(--mi-radius-card) !important; }
.mud-dialog { border-radius: var(--mi-radius-xl) !important; box-shadow: var(--mi-shadow-modal) !important; }
.mud-popover { border-radius: var(--mi-radius-lg) !important; }
.mud-input.mud-input-outlined { box-shadow: var(--mi-shadow-input); border-radius: var(--mi-radius); }
.mud-input.mud-input-outlined:not(.mud-disabled) { background: #fff; }
.mud-input-outlined-border { border-color: var(--mi-border-strong); }
.mud-input.mud-input-outlined:hover:not(.mud-disabled):not(.mud-input-error) .mud-input-outlined-border { border-color: var(--mi-primary-400); }
.mud-button-root.mud-button { text-transform: none; letter-spacing: normal; }
/* tables: muted header, navy hover */
.mud-table-head .mud-table-cell { background: var(--mi-background); color: #3F4867; font-weight: 600; font-size: .8125rem; border-bottom: 1px solid var(--mi-border); }
.mud-table-root .mud-table-cell { border-bottom-color: var(--mi-border); }
.mud-chip { border-radius: var(--mi-radius-lg); }
/* side menu: navy active item */
.app-drawer .mud-nav-link.active:not(.mud-nav-link-disabled) { background: var(--mi-primary-50); color: var(--mi-primary); border-right: 3px solid var(--mi-primary); }
.app-drawer .mud-nav-link.active .mud-nav-link-icon { color: var(--mi-primary); }
.app-drawer .mud-nav-link:hover:not(.mud-nav-link-disabled):not(.active) { background: var(--mi-background); }
::selection { background: rgba(0,51,133,.15); }
/* ---------- Head count summary (HeadCountSummaryBox) ---------- */
.hc-summary { border: 1px solid var(--mi-border); border-radius: var(--mi-radius-lg); background: var(--mi-background); padding: 12px 14px; margin-top: 12px; }
.hc-summary-title { font-weight: 600; margin-bottom: 6px; }
.hc-summary-counts { border-collapse: collapse; margin-bottom: 8px; }
.hc-summary-counts td { padding: 3px 12px 3px 0; }
.hc-summary-counts td.num { text-align: right; font-variant-numeric: tabular-nums; min-width: 56px; }
.hc-summary-counts tr.now td { font-weight: 700; font-size: 1.05rem; color: var(--mi-primary); }
.hc-summary-counts td.change { font-weight: 600; font-size: .85rem; color: var(--mi-muted-foreground); }
.hc-summary-counts td.change.up { color: var(--mi-success); }
.hc-summary-counts td.change.down { color: var(--mi-destructive); }
.hc-summary-received { font-size: .875rem; margin-bottom: 4px; }
.hc-summary-split { display: flex; flex-wrap: wrap; gap: 6px; }
.hc-sum-item { display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid var(--mi-border); background: #fff; border-radius: var(--mi-radius-lg);
               padding: 5px 10px; font: inherit; font-size: .85rem; color: var(--mi-foreground); cursor: default; }
.hc-sum-item .mark { color: var(--mi-destructive); font-size: .8rem; }
.hc-sum-item.counted .mark { color: var(--mi-success); }
.hc-sum-item .n { font-weight: 700; font-variant-numeric: tabular-nums; }
.hc-sum-item .hint { color: var(--mi-muted-foreground); font-size: .75rem; }
.hc-sum-item.clickable { cursor: pointer; }
.hc-sum-item.clickable:hover { border-color: var(--mi-primary-400); }
.hc-sum-item.on { border-color: var(--mi-primary); background: var(--mi-primary-50); }
.hc-sum-item:disabled { opacity: 1; }
.hc-summary-calc { margin-top: 10px; font-size: .85rem; line-height: 1.5; }
.hc-summary-hint { margin-top: 6px; font-size: .75rem; color: var(--mi-muted-foreground); }
/* ---------- Early termination dialog ---------- */
.et-box { border: 1px solid var(--mi-border); border-radius: var(--mi-radius-lg); background: var(--mi-background); padding: 12px 14px; }
.et-row { display: flex; justify-content: space-between; gap: 12px; }
.et-row b { color: var(--mi-primary); font-size: 1.05rem; }
.et-hint { font-size: .8rem; color: var(--mi-muted-foreground); margin-top: 2px; }
.et-problem { font-size: .78rem; color: var(--mi-warning); }
.et-calc { font-size: .85rem; line-height: 1.5; }

/* ---------- Test a tenant – head count over a range of months (HeadCountPreviewDialog) ---------- */
.hc-range { overflow-x: auto; border: 1px solid var(--mi-border); border-radius: var(--mi-radius-lg, 8px); }
.hc-range table { border-collapse: collapse; width: 100%; font-size: .875rem; }
.hc-range th, .hc-range td { padding: 6px 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--mi-border); vertical-align: top; }
.hc-range th { background: var(--mi-background); font-weight: 600; }
.hc-range th.picked { background: var(--mi-primary-50); }
.hc-range .lbl { text-align: left; position: sticky; left: 0; background: #fff; z-index: 1; min-width: 220px; white-space: normal; }
.hc-range th.lbl { background: var(--mi-background); }
.hc-range .sub { font-size: .75rem; font-weight: 400; color: var(--mi-muted-foreground, #53697E); }
.hc-range tr.main td { font-size: .95rem; }
.hc-range tr.sep td { border-top: 2px solid var(--mi-border); }
.hc-range .up { color: #558722; } .hc-range .down { color: #C81E1E; }
.hc-range .warn { color: #B45309; font-weight: 600; }
.hc-range .note { color: var(--mi-muted-foreground, #53697E); font-style: italic; }
.hc-range-date { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--mi-primary); cursor: pointer; text-decoration: underline dotted; }

/* Rate cards (Master data → Products & pricing → Rate cards) */
.rc-lines td, .rc-lines th { vertical-align: middle; }
.rc-lines th.col-num, .rc-lines td.col-num, .rc-lines .col-num input { text-align: right; }
.rc-lines .mud-input-control { margin-top: 0; }
.rc-lines td .mud-button-root { text-transform: none; text-align: left; justify-content: flex-start; }
.rc-muted { color: var(--mi-muted-foreground, #53697E); }

/* Date / time pickers: MudBlazor copies the picker's Style (e.g. max-width:170px on a filter) to its calendar popup, which squeezed the
   calendar to the width of the input box. The calendar keeps its own size. */
.mud-picker-popover-paper { max-width: none !important; width: auto !important; }
