:root {
    /* Aliases onto the Innovative Encompass brand tokens (brand/brand-tokens.css). */
    --brand: var(--ie-brand-red);
    --ink: var(--ie-charcoal);
    --muted: #5F5F5F;
    --line: #E3E3E3;
    --surface: var(--ie-white);
    --bg: var(--ie-light-grey);
}

html, body { font-family: var(--ie-font-body); color: var(--ie-charcoal); }
h1, h2, h3, .mud-typography-h5, .mud-typography-h6 { font-family: var(--ie-font-heading); }
html[dir="rtl"] body, .urdu { font-family: "Noto Nastaliq Urdu", Montserrat, sans-serif; line-height: 2; }

.fw-600 { font-weight: 600 !important; }
.text-muted { color: var(--mud-palette-text-secondary); }
.small { font-size: .8rem; }
.text-right { text-align: end; white-space: nowrap; }
.text-error { color: var(--mud-palette-error); }
.text-success { color: var(--mud-palette-success); }
code { font-size: .85em; background: var(--mud-palette-background-gray); padding: 1px 5px; border-radius: 4px; }

/* Shell */
.app-bar { border-bottom: 3px solid transparent; border-image: var(--ie-gradient-innov) 1; }
.app-bar .brand { font-weight: 700; letter-spacing: .2px; }
.brand-icon { width: 28px; height: 28px; }
.app-drawer { border-inline-end: 1px solid var(--mud-palette-lines-default); }

.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Stat cards */
.stat-card { display: flex; gap: 14px; align-items: center; padding: 16px; height: 100%; }
.stat-icon { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;  background: var(--ie-light-grey); color: var(--ie-charcoal); }
.stat-card--highlight .stat-icon { background: rgba(143, 0, 0, .08); color: var(--ie-brand-red); }
.stat-card--highlight { border-top: 3px solid var(--ie-brand-red) !important; }
.stat-label { font-size: .8rem; color: var(--mud-palette-text-secondary); }
.stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: .75rem; color: var(--mud-palette-text-secondary); }

/* Tax calculator */
.calc-row strong { white-space: nowrap; }
.calc-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--mud-palette-lines-default); font-variant-numeric: tabular-nums; }
.calc-row:last-child { border-bottom: 0; }
.calc-row.big { font-size: 1.15rem; }
.slab-active { background: rgba(143, 0, 0, .07); font-weight: 600; }

/* Self service */
.balance-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.balance-tile { border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; padding: 10px; text-align: center; }
.balance-value { font-size: 1.5rem; font-weight: 700; color: var(--mud-palette-primary); }
.balance-label { font-size: .8rem; font-weight: 600; }

.setup-steps { padding-inline-start: 20px; line-height: 1.9; }

/* Sign-in (static render, no MudBlazor JS) */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: var(--bg); }
.auth-brand { background: var(--ie-charcoal); color: #fff; padding: 64px; display: flex; flex-direction: column; justify-content: center; }
.auth-logo { width: 280px; max-width: 100%; }
.innov-bar { height: 4px; width: 120px; background: var(--ie-gradient-innov); border-radius: 2px; margin: 28px 0 20px; }
.auth-brand .brand-mark { font-family: var(--ie-font-heading); font-size: 2.2rem; font-weight: 700; letter-spacing: -.5px; }
.auth-brand p { max-width: 460px; opacity: .88; line-height: 1.7; margin-top: 12px; }
.auth-main { display: grid; place-items: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 32px; box-shadow: 0 10px 30px rgba(15, 23, 42, .06); }
.auth-card h1 { font-family: var(--ie-font-heading); margin: 0; font-size: 1.5rem; color: var(--ink); }
.auth-card .muted { color: var(--muted); margin: 4px 0 20px; }
.auth-card label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink); margin: 14px 0 6px; }
.auth-input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #CBD5E1; border-radius: 8px; font: inherit; }
.auth-input:focus { outline: 2px solid rgba(143, 0, 0, .25); border-color: var(--brand); }
.auth-check { display: flex !important; gap: 8px; align-items: center; font-weight: 400 !important; }
.auth-button { width: 100%; margin-top: 20px; padding: 11px; border: 0; border-radius: 8px; background: var(--brand); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.auth-button:hover { background: var(--ie-tagline-red); }
.auth-error { background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA; padding: 10px 12px; border-radius: 8px; font-size: .9rem; }
.auth-validation { color: #B91C1C; font-size: .8rem; }
.auth-footer { margin: 20px 0 0; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; font-size: .85rem; color: var(--muted); }
.auth-footer a { color: var(--brand); font-weight: 600; text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }

@media (max-width: 900px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-brand { padding: 32px 24px; }
}

#blazor-error-ui { display: none; position: fixed; bottom: 0; inset-inline: 0; padding: 12px 20px; background: #FEF3C7; box-shadow: 0 -1px 4px rgba(0,0,0,.15); z-index: 2000; }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; inset-inline-end: 12px; top: 10px; }

.tenant-chip { color: #fff !important; border-color: rgba(255, 255, 255, .45) !important; }
.stat-value { font-size: clamp(1.05rem, 1.6vw, 1.35rem); }
.nowrap { white-space: nowrap; }
.drawer-credit { padding: 12px 20px; font-size: .75rem; color: var(--mud-palette-text-secondary); }

/* Team calendar */
.cal-scroll { overflow-x: auto; border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; background: var(--mud-palette-surface); }
.cal-table { border-collapse: collapse; font-size: .8rem; width: 100%; }
.cal-table th, .cal-table td { border: 1px solid var(--mud-palette-lines-default); text-align: center; min-width: 28px; height: 34px; padding: 0 2px; }
.cal-table th { font-weight: 600; background: var(--mud-palette-background-gray); }
.cal-table .cal-name { text-align: start; min-width: 180px; padding: 4px 8px; position: sticky; inset-inline-start: 0; background: var(--mud-palette-surface); z-index: 1; }
.cal-off { background: var(--ie-light-grey); }
.cal-today { outline: 2px solid var(--ie-brand-red); outline-offset: -2px; }
.cal-leave { background: var(--ie-brand-red) !important; color: #fff; }
.cal-wfh { background: var(--ie-charcoal) !important; color: #fff; }
.cal-duty { background: var(--ie-accent-orange-red) !important; color: #fff; }
.cal-pending { opacity: .45; }
.cal-holiday { background: var(--ie-light-grey); border: 1px solid var(--mud-palette-lines-default); }
.cal-key { display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: middle; margin-inline-end: 4px; }
.roster-set { font-weight: 600; background: rgba(143, 0, 0, .06); }

/* Announcements */
.announcement-pinned { border-inline-start: 4px solid var(--ie-brand-red) !important; }

/* Org chart: indented tree with connector lines */
.org-tree, .org-tree ul { list-style: none; margin: 0; padding-inline-start: 28px; position: relative; }
.org-tree { padding-inline-start: 0; }
.org-tree ul::before { content: ""; position: absolute; inset-inline-start: 12px; top: 0; bottom: 18px; border-inline-start: 1px solid var(--mud-palette-lines-default); }
.org-tree ul > li { position: relative; }
.org-tree ul > li::before { content: ""; position: absolute; inset-inline-start: -16px; top: 24px; width: 16px; border-top: 1px solid var(--mud-palette-lines-default); }
.org-card { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; margin: 6px 0; border: 1px solid var(--mud-palette-lines-default); border-radius: 8px; background: var(--mud-palette-surface); min-width: 260px; }
.org-hit { border-color: var(--ie-brand-red); box-shadow: 0 0 0 2px rgba(143, 0, 0, .15); }
.appraisal-steps { display: flex; gap: 20px; flex-wrap: wrap; }
.appraisal-steps .step { display: inline-flex; align-items: center; gap: 6px; color: var(--mud-palette-text-secondary); }
.appraisal-steps .step.done { color: var(--ie-charcoal); }
.appraisal-steps .step.done .mud-icon-root { color: var(--mud-palette-success); }
.appraisal-steps .step.current { color: var(--ie-brand-red); font-weight: 600; }

/* Recruitment pipeline */
.pipeline { display: grid; grid-template-columns: repeat(7, minmax(150px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.pipeline-col { background: var(--mud-palette-background-gray); border-radius: 8px; padding: 8px; min-height: 120px; }
.pipeline-head { font-weight: 600; font-size: .85rem; margin-bottom: 8px; display: flex; justify-content: space-between; }
.pipeline-card { background: var(--mud-palette-surface); border: 1px solid var(--mud-palette-lines-default); border-radius: 6px; padding: 8px; margin-bottom: 6px; cursor: pointer; }
.pipeline-card.selected { border-color: var(--ie-brand-red); box-shadow: 0 0 0 2px rgba(143, 0, 0, .15); }

/* Public pages */
.public-shell { min-height: 100vh; display: flex; flex-direction: column; background: var(--ie-light-grey); }
.public-header { display: flex; align-items: center; gap: 10px; padding: 14px 24px; background: var(--ie-charcoal); color: #fff; border-bottom: 3px solid transparent; border-image: var(--ie-gradient-innov) 1; }
.public-main { flex: 1; }
.public-footer { text-align: center; padding: 16px; font-size: .75rem; color: var(--muted); }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
