/* Immutabl brand: Lato, Immutabl Orange (#ff841f) + Immutabl Blue (#104862). */
:root {
    --immutabl-orange: #ff841f;
    --immutabl-orange-hover: #ed7616;
    --immutabl-blue: #104862;
    --immutabl-blue-hover: #0c3a4f;
    --immutabl-blue-dark: #061b27;
    --immutabl-accent: #3b82f6;
}

html, body {
    font-family: 'Lato', sans-serif;
    color: #1e293b;
}

h1, h2, h3, h4, .navbar-brand {
    font-weight: 300;
}

/* Standard controls (buttons/inputs/dropdowns) inherit Syncfusion's theme — no custom styling here.
   Brand overrides for them will be added back deliberately once the baseline is reviewed. */

/* Auth form styling (carried over from the previous site). */
.form-title { font-weight: 400; font-size: 1.5rem; color: #1e293b; margin: 0 0 0.5rem; }
.form-subtitle { color: #64748b; font-size: 0.9rem; margin: 0 0 2rem; }
.form-row { display: flex; gap: 1rem; }
.form-row .form-group { flex: 1; }
.form-group { margin-bottom: 1.25rem; }
.form-group label { display: block; font-size: 0.85rem; color: #475569; margin-bottom: 0.4rem; font-weight: 400; }
.form-group .e-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    box-sizing: border-box;
    background: #fff;
    color: #1e293b;
    font-family: 'Lato', sans-serif;
}
.form-group .e-input:focus { outline: none; border-color: var(--immutabl-accent); box-shadow: 0 0 0 3px rgba(59,130,246,0.1); }
.form-group .e-input::placeholder { color: #94a3b8; }

.password-wrapper { position: relative; }
.password-wrapper .e-input { padding-right: 3.5rem; }
.password-toggle {
    position: absolute; right: 0.5rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #94a3b8; font-size: 0.8rem; cursor: pointer; padding: 0.25rem 0.5rem;
}
.password-toggle:hover { color: #475569; }

.message { padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.85rem; margin-bottom: 1rem; }
.message-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.message-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

.auth-link { text-align: center; font-size: 0.85rem; color: #64748b; margin: 1.25rem 0; }
.auth-link a { color: var(--immutabl-accent); text-decoration: none; font-weight: 400; }
.auth-link a:hover { text-decoration: underline; }

.divider { display: flex; align-items: center; margin: 0.5rem 0 1.25rem; color: #94a3b8; font-size: 0.85rem; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: #e2e8f0; }
.divider span { padding: 0 1rem; }

.btn-microsoft { text-decoration: none; color: #475569; border-color: #e2e8f0; }
.btn-microsoft:hover { background: #f8fafc; color: #1e293b; }

.field-validation-error, .validation-message { color: #dc2626; font-size: 0.8rem; }

/* ── App shell: top branding bar + full-width content (replaces the old left sidebar) ── */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.app-bar { background: linear-gradient(120deg, var(--immutabl-blue) 0%, var(--immutabl-blue-dark) 100%); color: #fff; position: sticky; top: 0; z-index: 50; }
.app-bar-top { display: flex; align-items: center; gap: 1rem; padding: 0.7rem 1.5rem; }
.app-brand { font-weight: 300; font-size: 1.7rem; text-decoration: none; white-space: nowrap; }
.app-brand:hover { text-decoration: none; }
.app-brand-name, .app-brand-sub { color: var(--immutabl-orange); }

.app-bar-utils { margin-left: auto; display: flex; align-items: center; gap: 1rem; }
.app-bar-link { color: #fff; text-decoration: none; }
.app-bar-link:hover { color: #fff; text-decoration: underline; }
.app-icon-btn { color: rgba(255,255,255,0.85); display: inline-flex; align-items: center; justify-content: center; width: 2.1rem; height: 2.1rem; border-radius: 8px; }
.app-icon-btn:hover { color: #fff; background: rgba(255,255,255,0.12); }
.app-bar-utils .notif-bell { color: rgba(255,255,255,0.85); }
.app-bar-utils .notif-bell:hover { color: #fff; }

.app-ask { margin: 0 1.5rem 0.8rem; position: relative; }
.app-ask-input { width: 100%; border: none; border-radius: 10px; padding: 0.7rem 2.6rem 0.7rem 1rem; font-size: 1rem; font-family: 'Lato', sans-serif; background: #fff; color: #1e293b; box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
.app-ask-input::placeholder { color: #94a3b8; }
.app-ask-spark { position: absolute; right: 0.9rem; top: 50%; transform: translateY(-50%); color: var(--immutabl-accent); }

.app-breadcrumb { padding: 0 1.5rem 0.7rem; font-size: 0.92rem; color: rgba(255,255,255,0.75); min-height: 0.4rem; }
.app-breadcrumb a { color: rgba(255,255,255,0.75); text-decoration: none; }
.app-breadcrumb a:hover { color: #fff; text-decoration: underline; }
.app-breadcrumb .crumb-sep { margin: 0 0.45rem; opacity: 0.5; }
.app-breadcrumb .crumb-current { color: #fff; }

.app-main { flex: 1; background: #fbfcfd; padding: 1.4rem 1.5rem 3rem; }

/* User avatar + dropdown (native <details> = obvious, accessible, no hidden-panel ambiguity). */
.user-menu { position: relative; }
.user-menu > summary { list-style: none; cursor: pointer; }
.user-menu > summary::-webkit-details-marker { display: none; }
.user-avatar { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--immutabl-orange); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.85rem; font-weight: 700; user-select: none; }
.user-menu-panel { position: absolute; right: 0; top: calc(100% + 0.5rem); background: #fff; color: #1e293b; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); min-width: 13rem; padding: 0.35rem; z-index: 60; }
.user-menu-head { padding: 0.5rem 0.65rem; border-bottom: 1px solid #eef2f7; margin-bottom: 0.25rem; }
.user-menu-name { font-weight: 600; font-size: 0.92rem; }
.user-menu-email { font-size: 0.8rem; color: #64748b; word-break: break-all; }
.user-menu-item { display: block; width: 100%; text-align: left; padding: 0.5rem 0.65rem; border-radius: 7px; color: #1e293b; text-decoration: none; font-size: 0.92rem; background: none; border: none; cursor: pointer; font-family: 'Lato', sans-serif; }
.user-menu-item:hover { background: #f1f5f9; color: #1e293b; text-decoration: none; }
.user-menu-signout { margin-top: 0.25rem; border-top: 1px solid #eef2f7; padding-top: 0.25rem; }

@media (max-width: 640px) {
    .app-brand { font-size: 1.35rem; }
    .app-bar-top { padding: 0.6rem 1rem; }
    .app-ask, .app-breadcrumb { margin-left: 0; margin-right: 0; padding-left: 1rem; padding-right: 1rem; }
    .app-main { padding: 1rem 1rem 2.5rem; }
}

/* In-app page content (rendered inside the content area of MainLayout). */
.app-page { max-width: 44rem; }
.app-page-narrow { max-width: 32rem; }
.app-page-wide { max-width: 100%; }

/* ── Module page: 75/25 main + cross-cutting rail ─────────────────────────────────── */
.module-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(16rem, 1fr); gap: 1.5rem; align-items: start; margin-top: 1rem; }
.module-main { min-width: 0; }
.module-rail { display: flex; flex-direction: column; gap: 1rem; }
.rail-box { border: 1px solid #e7ecf2; border-radius: 10px; background: #fff; padding: 0.75rem 0.85rem; }
.rail-heading { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748b; margin: 0 0 0.5rem; }
@media (max-width: 900px) { .module-grid { grid-template-columns: 1fr; } }

.type-tag { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; color: var(--immutabl-accent); background: rgba(59,130,246,0.12); border-radius: 5px; padding: 0.12rem 0.45rem; vertical-align: middle; margin-left: 0.4rem; }

/* Module secondary (instance) title under the type heading. */
.module-instance-title { margin: 0.1rem 0 0; font-size: 1.05rem; color: #64748b; }

/* Risk toolbar — subtle grey icons (like the cog), version chip opens a context menu. */
.risk-toolbar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.version-menu { position: relative; }
.version-chip { font-size: 0.82rem; color: #475569; background: #eef2f7; border: none; border-radius: 6px; padding: 0.2rem 0.55rem; cursor: pointer; font-family: 'Lato', sans-serif; display: inline-flex; align-items: center; gap: 0.3rem; }
button.version-chip:hover { background: #e2e8f0; }
.version-chip .caret { font-size: 0.65rem; opacity: 0.6; }
.popover-backdrop { position: fixed; inset: 0; z-index: 90; }
.popover-panel { position: absolute; top: calc(100% + 0.35rem); left: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); min-width: 9rem; padding: 0.3rem; z-index: 100; }
.popover-item { display: block; width: 100%; text-align: left; padding: 0.4rem 0.6rem; border-radius: 6px; border: none; background: none; cursor: pointer; font-size: 0.88rem; color: #1e293b; font-family: 'Lato', sans-serif; }
.popover-item:hover { background: #f1f5f9; }
.popover-item.active { font-weight: 700; color: var(--immutabl-blue); }
.toolbar-spacer { flex: 1; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.4rem; border-radius: 8px; border: none; background: none; color: #94a3b8; cursor: pointer; line-height: 0; transition: color 0.15s, background 0.15s; }
.icon-btn:hover { color: var(--immutabl-blue); background: #f1f5f9; }

/* Compact note / comment tool. */
.note-tool-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.mini-icon { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 0.2rem; border-radius: 6px; display: inline-flex; line-height: 0; transition: color 0.15s, background 0.15s; }
.mini-icon:hover { color: var(--immutabl-blue); background: #f1f5f9; }
.mini-icon.danger:hover { color: #b00020; }
.note-empty { color: #94a3b8; font-size: 0.85rem; margin: 0; }
.note-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.note-item { display: flex; align-items: flex-start; gap: 0.5rem; font-size: 0.88rem; }
.avatar-sm { flex-shrink: 0; width: 1.55rem; height: 1.55rem; border-radius: 50%; background: var(--immutabl-blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.62rem; font-weight: 700; }
.note-text { flex: 1; min-width: 0; color: #1e293b; line-height: 1.4; word-break: break-word; }
.note-date { color: #94a3b8; font-variant-numeric: tabular-nums; }
.note-row-actions { flex-shrink: 0; display: flex; gap: 0.05rem; opacity: 0; transition: opacity 0.12s; }
.note-item:hover .note-row-actions { opacity: 1; }

/* Change-kind badges. */
.change-kind { font-size: 0.78rem; font-weight: 600; padding: 0.05rem 0.4rem; border-radius: 5px; }
.change-new { background: #dcfce7; color: #166534; }
.change-removed { background: #fee2e2; color: #991b1b; }
.change-increased { background: #fef3c7; color: #92400e; }
.change-decreased { background: #dbeafe; color: #1e40af; }
.change-unchanged { background: #f1f5f9; color: #475569; }

/* ── Update Report (single-record "slide" landing) §5.7 ─────────────────────────── */
.report-slide { background: #fff; border: 1px solid #e7edf3; border-radius: 14px; padding: 1.5rem 1.75rem; box-shadow: 0 1px 3px rgba(15,30,42,0.05); }
.report-slide.is-clickable { cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s; }
.report-slide.is-clickable:hover { box-shadow: 0 6px 20px rgba(15,30,42,0.1); border-color: var(--immutabl-blue); }

.report-rag-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.85rem; margin-bottom: 1.5rem; }
.rag-tile { border-radius: 10px; padding: 0.85rem 1rem; display: flex; flex-direction: column; gap: 0.2rem; border: 1px solid transparent; }
.rag-tile .rag-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.8; }
.rag-tile .rag-value { font-size: 1.35rem; font-weight: 300; }

.report-sections { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem 1.75rem; }
.report-section { min-width: 0; }
.report-section-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--immutabl-blue); margin: 0 0 0.4rem; }
.report-section-body { color: #1e293b; line-height: 1.5; font-size: 0.92rem; word-break: break-word; }
.report-section-body :first-child { margin-top: 0; }
.report-section-body :last-child { margin-bottom: 0; }
.report-meta { margin: 1.5rem 0 0; font-size: 0.8rem; color: #94a3b8; font-variant-numeric: tabular-nums; }

@media (max-width: 720px) { .report-sections { grid-template-columns: 1fr; } .report-rag-strip { grid-template-columns: 1fr; } }

/* RAG colour scales — shared by tiles, pills and the editor's status picker. */
.rag-green { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.rag-amber { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.rag-red { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.rag-pill { display: inline-block; font-size: 0.74rem; font-weight: 700; padding: 0.12rem 0.55rem; border-radius: 999px; border: 1px solid transparent; }

.rag-select { position: relative; display: flex; align-items: center; }
.rag-select .rag-swatch { position: absolute; left: 0.6rem; width: 0.7rem; height: 0.7rem; border-radius: 50%; pointer-events: none; }
.rag-select .e-input { padding-left: 1.7rem; }
.rag-select.rag-green .rag-swatch { background: #10b981; }
.rag-select.rag-amber .rag-swatch { background: #f59e0b; }
.rag-select.rag-red .rag-swatch { background: #ef4444; }

/* ── Order of Cost Estimate (single-record NRM1 build-up) §5.8 ──────────────────── */
.oce-slide { background: #fff; border: 1px solid #e7edf3; border-radius: 14px; padding: 1.5rem 1.75rem; box-shadow: 0 1px 3px rgba(15,30,42,0.05); }
.oce-slide.is-clickable { cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s; }
.oce-slide.is-clickable:hover { box-shadow: 0 6px 20px rgba(15,30,42,0.1); border-color: var(--immutabl-blue); }

.oce-headline { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin-bottom: 1.25rem; }
.oce-headline-tile { border-radius: 10px; padding: 0.85rem 1.1rem; background: #f5f8fb; border: 1px solid #e7edf3; display: flex; flex-direction: column; gap: 0.2rem; }
.oce-headline-tile.is-total { background: var(--immutabl-blue); border-color: var(--immutabl-blue); color: #fff; }
.oce-h-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.8; }
.oce-h-value { font-size: 1.5rem; font-weight: 300; font-variant-numeric: tabular-nums; }

.oce-table { width: 100%; }
.oce-table td, .oce-table th { vertical-align: middle; }
.oce-c-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.oce-c-driver { text-align: right; white-space: nowrap; color: #64748b; }
.oce-c-ref { width: 3rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.oce-c-basis { color: #94a3b8; font-size: 0.82rem; }
.oce-row.oce-subtotal td { font-weight: 600; background: #f5f8fb; border-top: 1px solid #dbe4ec; }
.oce-row.oce-total td { font-weight: 700; background: #eef4f9; border-top: 2px solid var(--immutabl-blue); color: var(--immutabl-blue); font-size: 1.02rem; }
.oce-up { color: #b91c1c; }
.oce-down { color: #15803d; }

.oce-assumptions { margin: 1rem 0 0; font-size: 0.82rem; color: #64748b; }

/* Editor — driver rows with two-way % ↔ £ entry. */
.oce-driver { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid #f1f5f9; }
.oce-driver-label { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.oce-driver-name { font-weight: 600; color: #1e293b; font-size: 0.92rem; }
.oce-driver-basis { font-size: 0.76rem; color: #94a3b8; }
.oce-driver-inputs { display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0; }
.oce-input-pct, .oce-input-amount { display: inline-flex; align-items: center; gap: 0.25rem; }
.oce-input-pct .e-input { width: 5rem; text-align: right; }
.oce-input-amount .e-input { width: 8.5rem; text-align: right; }
.oce-input-amount.oce-input-wide .e-input { width: 11rem; }
.oce-unit { color: #94a3b8; font-size: 0.9rem; }
.oce-eq { color: #cbd5e1; }
.oce-row-subtotal { background: #f5f8fb; border-radius: 8px; padding: 0.5rem 0.75rem; border-bottom: none; margin: 0.25rem 0; }
.oce-row-subtotal .oce-driver-name { font-weight: 700; }
.oce-row-total { background: var(--immutabl-blue); color: #fff; border-radius: 8px; padding: 0.7rem 0.9rem; border-bottom: none; margin-top: 0.5rem; }
.oce-row-total .oce-driver-name { color: #fff; font-weight: 700; }
.oce-total-value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.oce-checkbox { display: inline-flex; align-items: center; gap: 0.45rem; font-size: 0.88rem; color: #1e293b; cursor: pointer; white-space: nowrap; }
.oce-check { display: flex; align-items: flex-end; padding-bottom: 0.4rem; }

/* Construction departmental items (editor). */
.oce-item-row { display: flex; align-items: center; gap: 0.5rem; padding: 0.25rem 0; }
.oce-item-title { flex: 1; }
.oce-add-item { display: inline-block; margin: 0.35rem 0 0.25rem; }

/* Summary construction sub-items (indent 2). */
.oce-row.oce-itemrow td { background: #fbfdff; }
.oce-c-item.oce-subitem { padding-left: 1.6rem; color: #475569; font-size: 0.88rem; }

/* Decomposition strip (TPI indices, VAT rate × proportion). */
.oce-decomp { display: flex; align-items: center; flex-wrap: wrap; gap: 0.45rem; padding: 0.15rem 0 0.6rem 0; margin-left: 0.25rem; border-bottom: 1px solid #f1f5f9; }
.oce-decomp-label { font-size: 0.76rem; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.03em; }
.oce-decomp-input { width: 7rem; }
.oce-decomp-input[placeholder="base"], .oce-decomp-input[placeholder="projected"], .oce-decomp-input[placeholder="VAT rate %"], .oce-decomp-input[placeholder="VATable %"] { width: 5.5rem; }

/* Cost plan section (summary). */
.oce-costplan { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid #eef2f7; }
.oce-costplan-meta { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; font-size: 0.88rem; color: #475569; margin-bottom: 0.5rem; }
.oce-costplan-meta strong { color: #1e293b; font-weight: 600; }

/* ── Profile / notification settings ───────────────────────────────────────────── */
.profile-grid { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1.25rem; align-items: center; }
.day-toggles { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.day-toggle { border: 1px solid #cbd5e1; background: #fff; color: #475569; border-radius: 8px; padding: 0.4rem 0.7rem; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.12s; min-width: 3rem; }
.day-toggle:hover { border-color: var(--immutabl-blue); }
.day-toggle.on { background: var(--immutabl-blue); border-color: var(--immutabl-blue); color: #fff; }

/* ── E-signature pad (§assurance) ──────────────────────────────────────────────── */
.sig-pad-wrap { position: relative; max-width: 600px; }
.sig-pad { width: 100%; height: auto; border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.sig-pad-baseline { position: absolute; left: 1.5rem; right: 1.5rem; bottom: 2.2rem; border-bottom: 1px dashed #cbd5e1; pointer-events: none; }
.sig-current { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.75rem; }
.sig-current-img { max-height: 64px; max-width: 280px; border: 1px solid #eef2f7; border-radius: 8px; background: #fff; padding: 0.25rem; }
.sig-current-meta { font-size: 0.8rem; color: #94a3b8; }

/* ── Governance roster (§assurance) ────────────────────────────────────────────── */
.gov-row { display: flex; align-items: center; gap: 0.6rem; padding: 0.3rem 0; flex-wrap: wrap; }
.gov-role { min-width: 12rem; font-weight: 600; color: #1e293b; }
.gov-person { min-width: 16rem; }
.gov-person-static { color: #475569; }
.gov-label { width: 12rem; }
.gov-days { width: 5rem; text-align: right; }
.gov-unit { color: #64748b; }

/* ── Approval policy editor (§assurance) ───────────────────────────────────────── */
.ap-enable { display: flex; align-items: center; gap: 0.5rem; margin: 0.75rem 0 0.25rem; }
.ap-block { border-left: 3px solid #e7edf3; padding: 0.5rem 0 0.5rem 1rem; margin-bottom: 1rem; }
.ap-sub { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--immutabl-blue); margin: 0.6rem 0 0.3rem; }
.ap-sub2 { font-size: 0.78rem; font-weight: 600; color: #64748b; margin: 0.4rem 0 0.2rem; }
.ap-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: #94a3b8; font-size: 0.8rem; }
.ap-checks { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }
.ap-check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; }
.ap-band { border: 1px solid #e7edf3; border-radius: 10px; padding: 0.6rem 0.8rem; margin: 0.4rem 0; background: #fbfdff; }
.ap-band-head { display: flex; align-items: center; gap: 0.75rem; }
.ap-band-name { width: 12rem; }
.ap-conds { display: flex; flex-direction: column; gap: 0.3rem; margin: 0.4rem 0; }
.ap-cond { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.ap-cond-when { color: #94a3b8; font-size: 0.85rem; }
.ap-cond-max { width: 8rem; text-align: right; }
.ap-assure { margin-top: 0.5rem; }

/* ── Approval panel (§assurance) ───────────────────────────────────────────────── */
.appr-panel { border: 1px solid #e7edf3; border-radius: 12px; padding: 1rem 1.1rem; margin: 1rem 0; background: #fbfdff; }
.appr-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.appr-state { font-size: 0.75rem; font-weight: 700; padding: 0.15rem 0.6rem; border-radius: 999px; }
.appr-locked, .appr-inapproval { background: #fef3c7; color: #92400e; }
.appr-approved { background: #dcfce7; color: #166534; }
.appr-declined { background: #fee2e2; color: #991b1b; }
.appr-waived, .appr-cancelled { background: #f1f5f9; color: #475569; }
.appr-preview { list-style: none; padding: 0; margin: 0.25rem 0; display: flex; flex-direction: column; gap: 0.3rem; }
.appr-preview li { display: flex; align-items: center; gap: 0.6rem; }
.appr-role { font-weight: 600; min-width: 11rem; }
.appr-name { color: #1e293b; }
.appr-unassigned { color: #b91c1c; font-size: 0.85rem; }
.appr-kind { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; padding: 0.05rem 0.4rem; border-radius: 5px; }
.appr-kind-authority { background: #dbeafe; color: #1e40af; }
.appr-kind-assurance { background: #ede9fe; color: #6d28d9; }
.appr-parties { width: 100%; margin: 0.5rem 0; }
.appr-pstatus { font-size: 0.74rem; font-weight: 700; padding: 0.08rem 0.45rem; border-radius: 999px; }
.appr-pending { background: #f1f5f9; color: #475569; }
.appr-sent { background: #fef3c7; color: #92400e; }
.appr-signed { background: #dcfce7; color: #166534; }
.appr-actions { display: flex; gap: 0.4rem; align-items: center; }
.e-btn-sm { background: var(--immutabl-blue); color: #fff; border: none; border-radius: 6px; padding: 0.25rem 0.6rem; font-size: 0.82rem; cursor: pointer; }
.appr-form { background: #fff; border: 1px solid #e7edf3; border-radius: 10px; padding: 0.75rem; margin-top: 0.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.appr-otp { display: flex; align-items: center; gap: 0.6rem; }
.appr-task-badge { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; background: #ede9fe; color: #6d28d9; padding: 0.06rem 0.4rem; border-radius: 5px; margin-left: 0.4rem; }

/* ── Modal ─────────────────────────────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,30,42,0.45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 1rem; z-index: 200; overflow-y: auto; }
.modal-panel { background: #fff; border-radius: 14px; box-shadow: 0 16px 48px rgba(0,0,0,0.28); width: 100%; max-width: 34rem; max-height: 92vh; display: flex; flex-direction: column; }
.modal-sm { max-width: 26rem; }
.modal-md { max-width: 34rem; }
.modal-lg { max-width: 52rem; }
.modal-xl { max-width: 64rem; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.25rem; border-bottom: 1px solid #eef2f7; }
.modal-title { font-size: 1.2rem; font-weight: 300; color: var(--immutabl-blue); margin: 0; }
.modal-head-actions { display: flex; align-items: center; gap: 0.5rem; }
.modal-close { background: none; border: none; color: #94a3b8; cursor: pointer; display: inline-flex; padding: 0.25rem; border-radius: 6px; }
.modal-close:hover { color: #1e293b; background: #f1f5f9; }
.modal-body { padding: 1.25rem; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; gap: 0.75rem; margin-top: 1.25rem; }

/* Record / edit form. */
.field { margin-bottom: 0.85rem; }
.field > .settings-label { display: block; margin-bottom: 0.25rem; }
.field-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 0.85rem; }
.form-section { font-size: 0.95rem; font-weight: 700; color: var(--immutabl-blue); border-bottom: 1px solid #eef2f7; padding-bottom: 0.3rem; margin: 1.25rem 0 0.75rem; }
.form-section:first-child { margin-top: 0; }
.score-pill { background: #eef2f7; border-radius: 6px; padding: 0.4rem 0.8rem; font-weight: 700; color: #475569; min-width: 3rem; text-align: center; }
.danger-link { color: #b00020; }

/* Change-log list. */
.changelog-list { display: flex; flex-direction: column; gap: 0.75rem; }
.changelog-entry { border: 1px solid #eef2f7; border-radius: 8px; padding: 0.6rem 0.75rem; }
.changelog-head { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.changelog-item { font-weight: 600; }
.changelog-author { margin-left: auto; color: #94a3b8; font-size: 0.85rem; }
.changelog-diffs { margin: 0.4rem 0 0; padding-left: 1.1rem; font-size: 0.88rem; color: #475569; }
.changelog-note { margin: 0.4rem 0 0; font-size: 0.88rem; color: #475569; line-height: 1.4; }

/* Stakeholder slots + people picker. */
.sh-slot { margin-bottom: 0.75rem; }
.sh-slot-head { display: flex; align-items: center; gap: 0.35rem; }
.sh-label { font-size: 0.8rem; font-weight: 600; color: #475569; }
.sh-empty { color: #94a3b8; font-size: 0.85rem; }
.sh-people { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.3rem; }
.person-chip { display: inline-flex; align-items: center; gap: 0.35rem; background: #f1f5f9; border-radius: 999px; padding: 0.12rem 0.6rem 0.12rem 0.2rem; font-size: 0.82rem; }
.avatar-xs { width: 1.4rem; height: 1.4rem; border-radius: 50%; background: var(--immutabl-blue); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.56rem; font-weight: 700; flex-shrink: 0; }
.picker-list { max-height: 18rem; overflow-y: auto; margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.15rem; }
.picker-row { display: flex; align-items: center; gap: 0.5rem; width: 100%; text-align: left; background: none; border: none; padding: 0.4rem 0.5rem; border-radius: 8px; cursor: pointer; font-family: 'Lato', sans-serif; font-size: 0.9rem; color: #1e293b; }
.picker-row:hover { background: #f1f5f9; }
.picker-row.selected { background: rgba(16,72,98,0.08); }
.picker-name { flex: 1; }
.picker-check { color: var(--immutabl-blue); flex-shrink: 0; }

/* File manager. */
.file-toolbar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.file-crumbs { display: flex; align-items: center; gap: 0.1rem; flex-wrap: wrap; }
.file-row-actions { display: flex; align-items: center; gap: 0.5rem; }
/* Keep action-cell buttons from making file rows taller than plain rows. */
.file-row-actions .e-link { padding-top: 0; padding-bottom: 0; }
.file-lock { color: #94a3b8; display: inline-flex; }

/* Three-state action icon (design system): available (grey, orange on hover) / locked (subtle grey + tooltip) /
   not-applicable (very light grey, no tooltip). Locked icons advertise features available at higher access. */
.icon-btn { background: none; border: none; padding: 0.2rem; cursor: pointer; color: var(--immutabl-orange); display: inline-flex; align-items: center; line-height: 0; border-radius: 6px; text-decoration: none; }
button.icon-btn:hover, a.icon-btn:hover { background: rgba(255,132,31,0.12); text-decoration: none; }
.icon-btn-locked { color: #94a3b8; cursor: default; }   /* not authorised — grey */
.icon-btn-na { color: #cbd5e1; cursor: default; }        /* unavailable / not yet active — light grey */
.file-contexts { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.85rem; }
.file-context { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.7rem; border: 1px solid #e2e8f0; border-radius: 8px; text-decoration: none; color: #1e293b; font-size: 0.9rem; background: #fff; }
.file-context:hover { background: #f1f5f9; text-decoration: none; }
.context-arrow { color: #94a3b8; }

/* Rich upload dialog. */
.upload-fields { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1rem; }
.upload-list { list-style: none; margin: 0.75rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.5rem; }
.upload-item { border: 1px solid #eef2f7; border-radius: 8px; padding: 0.5rem 0.65rem; }
.upload-row { display: flex; align-items: center; gap: 0.6rem; }
.upload-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.upload-status { font-size: 0.82rem; color: #64748b; white-space: nowrap; }
.upload-status.ok { color: #166534; }
.upload-status.fail { color: #b00020; }
.upload-bar { height: 5px; background: #eef2f7; border-radius: 3px; margin-top: 0.35rem; overflow: hidden; }
.upload-bar-fill { height: 100%; background: var(--immutabl-blue); transition: width 0.15s; }
.upload-error { color: #b00020; font-size: 0.82rem; margin-top: 0.3rem; }
.diff-from { color: #94a3b8; }
.diff-to { color: #1e293b; font-weight: 600; }
.page-heading { font-weight: 300; font-size: 1.75rem; color: var(--immutabl-blue); margin: 0 0 0.35rem; }
.page-heading .page-heading-code { color: #94a3b8; font-size: 1.1rem; font-weight: 300; }
.page-subtitle { color: #64748b; font-size: 0.95rem; margin: 0 0 1.75rem; }
.section-heading { font-weight: 400; font-size: 1.05rem; color: var(--immutabl-blue); margin: 1.75rem 0 0.75rem; }

/* Card list (organisations, invitations). */
.org-list { display: flex; flex-direction: column; gap: 0.6rem; }
.org-card {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.15rem; background: #fff; border: 1px solid #e2e8f0;
    border-left: 3px solid var(--immutabl-orange); border-radius: 10px;
    text-decoration: none; color: inherit;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
a.org-card:hover { border-color: #cbd5e1; border-left-color: var(--immutabl-orange); box-shadow: 0 4px 12px rgba(16,72,98,0.08); transform: translateY(-1px); }
.org-card-name { font-weight: 700; color: #1e293b; }
.org-card-code { color: #94a3b8; font-weight: 400; margin-left: 0.4rem; }
.org-card-meta { color: #475569; font-size: 0.9rem; }

/* Selector card grid (organisations → programmes → projects → modules). */
.entity-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 1rem; margin: 0.5rem 0 1.75rem; }
.entity-card {
    display: flex; flex-direction: column; min-height: 6.5rem;
    background: #fff; border: 1px solid #e2e8f0; border-left: 3px solid var(--immutabl-orange);
    border-radius: 10px; padding: 0.9rem 1rem;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.entity-card:hover { border-color: #cbd5e1; box-shadow: 0 4px 12px rgba(16,72,98,0.08); transform: translateY(-1px); }
.entity-card-body { display: flex; flex-direction: column; gap: 0.1rem; text-decoration: none; color: inherit; flex: 1; }
.entity-card-body:hover .entity-card-name { color: var(--immutabl-orange); }
.entity-card-name { font-weight: 700; color: #1e293b; }
.entity-card-code { font-size: 0.78rem; color: #94a3b8; }
.entity-card-count { margin-top: 0.55rem; font-size: 0.84rem; color: #475569; }
.entity-card-actions { display: flex; align-items: center; gap: 0.1rem; margin-top: 0.6rem; padding-top: 0.55rem; border-top: 1px solid #f1f5f9; }
.entity-card-actions .role-badge { margin-left: auto; }
.entity-card-add {
    flex-direction: row; align-items: center; justify-content: center; gap: 0.45rem;
    border-left-width: 1px; border-style: dashed; border-color: #cbd5e1;
    color: var(--immutabl-orange); text-decoration: none; font-size: 0.92rem; font-weight: 600;
}
.entity-card-add:hover { background: #fff7f0; border-color: var(--immutabl-orange); }
.entity-card-add-plus { font-size: 1.5rem; line-height: 1; }
.entity-section-head { display: flex; align-items: center; gap: 0.6rem; margin: 1.5rem 0 0; }
.entity-section-head .section-heading { margin: 0; }

/* Sysadmin feature toggles (settings pages). */
.sysadmin-tag { font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #fff; background: var(--immutabl-blue); padding: 0.1rem 0.4rem; border-radius: 4px; vertical-align: middle; }
.feature-toggles { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1.25rem; padding: 0.85rem 1rem; border: 1px solid #e7ecf2; border-radius: 10px; background: #fff; max-width: 40rem; }
.feature-toggle { display: flex; align-items: center; gap: 0.45rem; font-size: 0.92rem; color: #334155; cursor: pointer; }
.feature-toggle input { width: 1rem; height: 1rem; accent-color: var(--immutabl-orange); cursor: pointer; }
.feature-toggle-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.feature-toggle-msg { font-size: 0.82rem; color: #64748b; }
.role-badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
    background: rgba(16,72,98,0.08); color: var(--immutabl-blue);
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em;
}
.proxy-badge {
    display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
    background: rgba(255,132,31,0.12); color: var(--immutabl-orange-hover);
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em; margin-left: 0.5rem;
}

.e-link { background: none; border: none; color: #64748b; text-decoration: none; font-size: 0.9rem; padding: 0.5rem 0.25rem; cursor: pointer; }
.e-link:hover { color: var(--immutabl-blue); text-decoration: underline; }

.empty-state { color: #64748b; font-size: 0.95rem; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 1.5rem; text-align: center; }

/* In-app log viewer console. */
.logs-pre { max-height: 58vh; overflow: auto; background: #0f172a; color: #e2e8f0; padding: 0.75rem 0.9rem; border-radius: 8px; font-size: 0.78rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; margin: 0.25rem 0; }

/* App-wide pager (Pager.razor). */
.pager { display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; margin-top: 0.6rem; }
.pager-status { font-size: 0.82rem; }

/* My Tasks — grouped, collapsible task list (clean/minimal: Lato, subtle dividers). */
.task-add { display: flex; gap: 0.5rem; margin: 0.5rem 0 0.5rem; }
.task-toolbar { display: flex; align-items: center; gap: 0.75rem; margin: 0.5rem 0 1rem; }

.task-group { margin-bottom: 1.1rem; }
.task-group-head { display: flex; align-items: center; gap: 0.55rem; width: 100%; background: none; border: none; padding: 0.3rem 0; cursor: pointer; font-family: 'Lato', sans-serif; }
.task-group-caret { color: #94a3b8; font-size: 0.7rem; width: 0.9rem; }
.task-group-name { font-size: 1.02rem; font-weight: 700; color: #104862; }
.task-group-kind { font-size: 0.64rem; letter-spacing: 0.04em; text-transform: uppercase; padding: 0.08rem 0.45rem; border-radius: 999px; color: #64748b; background: #f1f5f9; }
.task-group-kind.kind-personal { color: #9a5b14; background: #fff3e6; }
.task-group-count { margin-left: auto; font-size: 0.78rem; color: #94a3b8; }

.task-rows { margin-top: 0.35rem; border-top: 1px solid #eef2f6; }
.task-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.55rem 0.4rem; border-bottom: 1px solid #eef2f6; text-decoration: none; color: #1e293b; }
.task-row:hover { background: #f8fafc; }
.task-dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; flex: none; }
.task-dot.is-open { background: #cbd5e1; }
.task-dot.is-progress { background: var(--immutabl-orange); }
.task-title { font-size: 0.94rem; }
.task-module { font-size: 0.68rem; letter-spacing: 0.03em; text-transform: uppercase; color: #104862; background: #e7eef2; padding: 0.08rem 0.45rem; border-radius: 5px; }
.task-due { margin-left: auto; font-size: 0.8rem; color: #94a3b8; white-space: nowrap; }

/* Unified module task list (under the risk table) + per-row add + rail preview. */
.module-tasks { margin-top: 1.5rem; }
.module-tasks-head { display: flex; align-items: baseline; gap: 0.5rem; margin-bottom: 0.5rem; }
.module-tasks-title { font-family: 'Lato', sans-serif; font-weight: 700; font-size: 1.05rem; color: #104862; margin: 0; }
.module-tasks-count { font-size: 0.8rem; color: #94a3b8; }
.mtask-list { list-style: none; margin: 0.5rem 0 0; padding: 0; border-top: 1px solid #eef2f6; }
.mtask-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0.3rem; border-bottom: 1px solid #eef2f6; }
.mtask-title { font-size: 0.94rem; color: #1e293b; }
.mtask-ref { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.03em; color: #9a5b14; background: #fff3e6; padding: 0.08rem 0.45rem; border-radius: 5px; }
/* A task/item's own reference code (its identity). */
.task-ref { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.72rem; font-weight: 600; color: #475569; background: #f1f5f9; padding: 0.08rem 0.4rem; border-radius: 4px; margin-right: 0.4rem; white-space: nowrap; }
.task-ref-line { margin: 0 0 0.5rem; }

/* Milestone status chips (RAG) + date slippage. */
.ms-status { display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.01em; padding: 0.12rem 0.5rem; border-radius: 999px; white-space: nowrap; color: #fff; background: #94a3b8; }
.ms-waiting { background: #94a3b8; }
.ms-started { background: #2563eb; }
.ms-on-track { background: var(--immutabl-green); }
.ms-start-risk, .ms-finish-risk { background: var(--immutabl-orange); }
.ms-delayed-start, .ms-delayed-finish { background: var(--immutabl-red); }
.ms-completed { background: #0f766e; }
.ms-cancelled { background: #cbd5e1; color: #475569; text-decoration: line-through; }
.ms-slip { margin-left: 0.4rem; font-size: 0.72rem; font-weight: 700; }
.ms-slip.late { color: var(--immutabl-red); }
.ms-slip.early { color: var(--immutabl-green); }

/* Change-request status chips. */
.cr-status { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 999px; white-space: nowrap; color: #fff; background: #94a3b8; }
.cr-scoping { background: #94a3b8; }
.cr-reviewing { background: var(--immutabl-orange); }
.cr-project-approved { background: #2563eb; }
.cr-programme-approved { background: #0f766e; }
.cr-accepted { background: var(--immutabl-green); }
.cr-rejected { background: var(--immutabl-red); }

/* Module export menu (download PDF / Word / Excel). */
.export-menu { display: inline-flex; }
.export-panel { min-width: 11rem; right: 0; }
.export-panel-label { font-size: 0.68rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.04em; padding: 0.35rem 0.7rem 0.15rem; }
.export-panel .popover-item { text-decoration: none; display: block; }
.mtask-due { margin-left: auto; font-size: 0.8rem; color: #94a3b8; white-space: nowrap; }
.mtask-row-link { text-decoration: none; color: inherit; }
.mtask-row-link:hover { background: #f8fafc; }
.mtask-assignee { font-size: 0.78rem; color: #64748b; }

.icon-btn-sm { background: none; border: none; color: #94a3b8; cursor: pointer; padding: 0.15rem; display: inline-flex; border-radius: 6px; }
.icon-btn-sm:hover { color: var(--immutabl-orange); background: #fff3e6; }
.risk-row-action { text-align: right; width: 2.2rem; }
.risk-addrow td { background: #f8fafc; }

.rail-empty { font-size: 0.85rem; color: #94a3b8; margin: 0.3rem 0 0; }
.rail-task-list { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.rail-task { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0; border-bottom: 1px solid #f1f5f9; }
.rail-task-link { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: inherit; width: 100%; }
.rail-task-link:hover .rail-task-title { color: var(--immutabl-orange); }
.rail-task-title { font-size: 0.86rem; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-task .mtask-ref { margin-left: auto; }
.rail-task-all { display: inline-block; margin-top: 0.55rem; font-size: 0.82rem; color: var(--immutabl-orange); text-decoration: none; }
.rail-task-all:hover { text-decoration: underline; }
.rail-task-due { margin-left: auto; font-size: 0.78rem; color: #94a3b8; white-space: nowrap; }
.rail-task-due.due-soon { color: var(--immutabl-red); font-weight: 600; }

/* Stats rail panel (My Tasks). */
.stat-big { display: flex; align-items: baseline; gap: 0.5rem; font-size: 2rem; font-weight: 300; color: var(--immutabl-blue); margin: 0.2rem 0 0.6rem; }
.stat-big-label { font-size: 0.82rem; font-weight: 400; color: #94a3b8; }
.stat-rows { display: flex; flex-direction: column; gap: 0.5rem; }
.stat-row { display: grid; grid-template-columns: minmax(0, 1fr) 5rem 2.4rem; align-items: center; gap: 0.5rem; }
.stat-row-name { display: flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-row-bar { height: 0.5rem; border-radius: 999px; background: #f1f5f9; overflow: hidden; }
.stat-row-fill { display: block; height: 100%; border-radius: 999px; }
.stat-row-val { font-size: 0.8rem; color: #64748b; text-align: right; }

/* Task detail page. */
.task-field { margin-bottom: 0.9rem; }
.task-save-row { margin: 0.75rem 0 1.25rem; }
.task-content-readonly { border: 1px solid #eef2f6; border-radius: 8px; padding: 0.75rem 0.9rem; font-size: 0.94rem; color: #1e293b; }
.label-picker { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.label-chip { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.82rem; padding: 0.12rem 0.55rem; border-radius: 999px; background: #f1f5f9; color: #1e293b; }
.label-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; display: inline-block; }

/* Simple data table (module content grids, e.g. the risk register). */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; margin: 0.5rem 0; }
.data-table th { text-align: left; font-weight: 600; color: #475569; border-bottom: 2px solid #e2e8f0; padding: 0.4rem 0.6rem; }
.data-table td { border-bottom: 1px solid #eef2f7; padding: 0.4rem 0.6rem; vertical-align: top; }
/* File manager: let the Name column take the slack so the actions column stays compact (not floated far right). */
.files-table th, .files-table td { white-space: nowrap; }
.files-table th:nth-child(2), .files-table td:nth-child(2) { width: 100%; white-space: normal; }
/* Clickable table rows (e.g. a risk row opening its detail page). */
.data-table tr.row-link { cursor: pointer; }
.data-table tr.row-link:hover td { background: rgba(16,72,98,0.05); }

/* Composition outline: each discrete on-page tool sits in a solid card; sub-parts within a tool
   get a lighter dashed box. A small floating tag names the block. Purely a structural aid — tune
   the borders down (or drop the tags) once the layout reads clearly. */
.ui-block { position: relative; border: 1px solid #d8dee6; border-radius: 12px; padding: 1.1rem 1.15rem 1.15rem; margin: 1.4rem 0; background: #fff; }
.ui-block > .ui-tag,
.ui-subblock > .ui-tag {
    position: absolute; top: -0.62rem; left: 0.9rem;
    font-size: 0.66rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase;
    padding: 0.08rem 0.5rem; border-radius: 6px;
}
.ui-block > .ui-tag { background: #eef2f7; color: #475569; border: 1px solid #d8dee6; }
.ui-block > .section-heading:first-of-type,
.ui-block > .page-header:first-of-type { margin-top: 0.15rem; }
.ui-subblock { position: relative; border: 1px dashed #c9d3df; border-radius: 10px; padding: 1rem 0.95rem 0.95rem; margin: 1.1rem 0 0; }
.ui-subblock > .ui-tag { background: #f6f8fb; color: #7587a0; border: 1px solid #dde4ec; }
.ui-subblock > .section-heading:first-of-type { margin-top: 0; }

/* Vertical form layout used by module create / content forms. */
.stack-form { display: flex; flex-direction: column; gap: 0.35rem; max-width: 40rem; }
.stack-form .settings-label { margin-top: 0.5rem; }

/* Informational plan/notice banner. */
.notice { padding: 0.85rem 1.1rem; border-radius: 10px; font-size: 0.9rem; margin-bottom: 1.5rem; background: rgba(16,72,98,0.05); border: 1px solid rgba(16,72,98,0.15); color: var(--immutabl-blue); }
.notice strong { font-weight: 700; }

/* Inline edit-in-place (pencil) fields. */
.pencil-btn {
    background: none; border: none; color: #94a3b8; cursor: pointer;
    padding: 0 0.35rem; vertical-align: middle; line-height: 0;
}
.pencil-btn:hover { color: var(--immutabl-blue); }
.editable-line { display: block; }
.inline-edit { display: flex; gap: 0.5rem; align-items: center; margin: 0.25rem 0 1rem; flex-wrap: wrap; }
.inline-edit .e-input { width: auto; min-width: 18rem; padding: 0.5rem 0.7rem; }
.archived-badge {
    display: inline-block; padding: 0.15rem 0.55rem; border-radius: 999px;
    background: #fee2e2; color: #b91c1c; font-size: 0.7rem; font-weight: 700;
    vertical-align: middle; margin-left: 0.5rem; letter-spacing: 0.02em;
}

/* Top-of-content back link. */
.back-link { margin: 0 0 1.25rem; font-size: 0.9rem; }

/* Page header row: heading on the left, settings cog on the right. */
.page-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.cog-btn {
    flex-shrink: 0; color: #94a3b8; padding: 0.4rem; border-radius: 8px; line-height: 0;
    display: inline-flex; transition: color 0.15s, background 0.15s;
}
.cog-btn:hover { color: var(--immutabl-blue); background: #f1f5f9; }

/* Settings page field rows. */
.settings-field { margin: 0 0 0.85rem; color: #1e293b; }
.settings-label { display: inline-block; min-width: 8rem; color: #64748b; font-size: 0.85rem; }
.settings-value { font-weight: 400; }

/* Tags (§7.1). */
.tag-area { margin-bottom: 0.5rem; }
.tag-list { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.85rem; }
.tag-chip {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.25rem 0.6rem; border-radius: 999px; background: #fff;
    border: 1px solid #e2e8f0; font-size: 0.8rem; color: #1e293b;
}
.tag-chip.tag-inherited { background: #f8fafc; color: #64748b; }
.tag-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; flex-shrink: 0; }
.tag-level { font-size: 0.65rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.03em; margin-left: 0.1rem; }
.tag-remove-form { display: inline; margin: 0; }
.tag-remove {
    background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 1rem;
    line-height: 1; padding: 0 0 0 0.15rem;
}
.tag-remove:hover { color: #dc2626; }
.tag-add-form { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.tag-add-form .e-input { width: auto; min-width: 12rem; padding: 0.45rem 0.7rem; }
.tag-colour { width: 2.4rem; height: 2.2rem; padding: 0; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; cursor: pointer; }

/* Notifications (§9). */
.app-topbar { display: flex; justify-content: flex-end; align-items: center; padding: 0.6rem 1.5rem 0; min-height: 2.5rem; }
.notif-bell { position: relative; color: #64748b; display: inline-flex; padding: 0.35rem; border-radius: 8px; transition: color 0.15s, background 0.15s; }
.notif-bell:hover { color: var(--immutabl-blue); background: #f1f5f9; }
.notif-badge {
    position: absolute; top: -2px; right: -2px; min-width: 1.05rem; height: 1.05rem; padding: 0 0.25rem;
    background: var(--immutabl-orange); color: #fff; border-radius: 999px; font-size: 0.65rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center; line-height: 1;
}
.notif-list { display: flex; flex-direction: column; gap: 0.5rem; max-width: 44rem; }
.notif-item-form { margin: 0; }
.notif-item {
    width: 100%; text-align: left; display: flex; align-items: center; gap: 0.6rem;
    padding: 0.85rem 1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
    cursor: pointer; font-family: 'Lato', sans-serif; font-size: 0.9rem; color: #334155;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.notif-item:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(16,72,98,0.06); }
.notif-item.notif-unread { background: rgba(255,132,31,0.05); border-left: 3px solid var(--immutabl-orange); font-weight: 700; color: #1e293b; }
.notif-unread-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--immutabl-orange); flex-shrink: 0; }
.notif-message { flex: 1; }
.notif-time { font-size: 0.75rem; color: #94a3b8; font-weight: 400; white-space: nowrap; }

/* Conversations (§7.3). */
.conv-form { margin-bottom: 1.25rem; max-width: 40rem; }
.conv-input { width: 100%; resize: vertical; font-family: 'Lato', sans-serif; }
.conv-form-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.conv-list { display: flex; flex-direction: column; gap: 0.85rem; max-width: 40rem; }
.conv-entry { padding: 0.85rem 1rem; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; }
.conv-entry.conv-system { background: #f8fafc; border-style: dashed; }
.conv-meta { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.conv-author { font-weight: 700; font-size: 0.85rem; color: #1e293b; }
.conv-kind { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; color: var(--immutabl-orange-hover); background: rgba(255,132,31,0.12); padding: 0.1rem 0.45rem; border-radius: 999px; }
.conv-time { font-size: 0.75rem; color: #94a3b8; margin-left: auto; }
.conv-body { font-size: 0.9rem; color: #334155; white-space: pre-wrap; }

/* Overview count strip. */
.stat-strip { display: flex; gap: 1.5rem; margin: 1.25rem 0 0.5rem; flex-wrap: wrap; }
.stat { color: #64748b; font-size: 0.9rem; }
.stat-num { font-weight: 700; color: var(--immutabl-blue); font-size: 1.1rem; margin-right: 0.15rem; }

/* ───────────────────────────────────────────────────────────────────────────
   Brand overrides over the Syncfusion theme (loaded after material.css).
   Semantic colours: green = good, orange = standard emphasis, red = bad,
   dark blue = headings. Lato light for chrome (headers/labels/buttons/tooltips/
   prompts); Lato regular for body text.
   ─────────────────────────────────────────────────────────────────────────── */
:root {
    --immutabl-green: #4EA72E;
    --immutabl-green-hover: #45941f;
    --immutabl-red: #C00000;
    --immutabl-red-hover: #a30000;
}

/* The ONLY button styling: the basic Syncfusion button, with our font, colour and case override.
   No variants — every button is the same. (brand.css loads after material.css, so this wins.) */
.e-btn {
    text-transform: none;
    /* Match the link (.e-link) font, but white text, centred in the button. */
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    font-size: 0.9rem;
    background-color: var(--immutabl-orange);
    border-color: var(--immutabl-orange);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.e-btn:hover, .e-btn:focus, .e-btn:active {
    background-color: var(--immutabl-orange-hover);
    border-color: var(--immutabl-orange-hover);
    color: #fff;
}
/* Disabled = the same orange button, just faded (not Syncfusion's grey). */
.e-btn:disabled, .e-btn.disabled, .e-btn.e-disabled {
    background-color: var(--immutabl-orange);
    border-color: var(--immutabl-orange);
    color: #fff;
    opacity: 0.45;
}

/* Typography: Lato light for chrome; Lato regular for body text.
   Headings are consistent everywhere: ALL Lato Light, no caps.
   Main = 24pt Immutabl dark blue; sub = 20pt light grey. */
h1, .page-heading {
    font-family: 'Lato', sans-serif; font-weight: 300; font-size: 24pt;
    color: var(--immutabl-blue); text-transform: none; letter-spacing: normal;
}
h2, h3, h4, h5, h6, .rail-heading, .form-section, .module-tasks-title {
    font-family: 'Lato', sans-serif; font-weight: 300; font-size: 20pt;
    color: #64748b; text-transform: none; letter-spacing: normal;
}
label, .e-btn, .settings-label, .e-tooltip-wrap, .e-tooltip-wrap .e-tip-content { font-family: 'Lato', sans-serif; font-weight: 300; }
p { font-family: 'Lato', sans-serif; font-weight: 400; }
::placeholder { font-family: 'Lato', sans-serif; font-weight: 300; }

/* "Sign in with Microsoft" keeps Microsoft's own branding (Segoe UI, standard case). */
.btn-microsoft {
    display: flex; align-items: center; justify-content: center;
    width: 100%;
    padding: 0.6rem 0.9rem;
    background: #fff;
    border: 1px solid #8C8C8C;
    border-radius: 2px;
    color: #5E5E5E;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: none;
    text-decoration: none;
    cursor: pointer;
}
.btn-microsoft:hover { background: #f3f3f3; color: #5E5E5E; border-color: #8C8C8C; }

/* Risk matrix rating control + risk record bits. */
.risk-matrix-body { display: flex; align-items: stretch; gap: 0.4rem; }
.risk-axis-y { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 0.7rem; color: #64748b; text-align: center; }
.risk-matrix-grid { display: grid; grid-template-columns: repeat(5, 104px); grid-auto-rows: 58px; gap: 2px; }
.risk-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.05rem; padding: 0.2rem; border: 1px solid rgba(0,0,0,0.12); color: #fff; cursor: pointer; border-radius: 3px; font-family: 'Lato', sans-serif; text-align: center; }
.risk-cell-text { font-size: 0.58rem; line-height: 1.05; font-weight: 600; }
.risk-cell-score { font-size: 0.9rem; font-weight: 700; }
.risk-cell:hover:not(:disabled) { outline: 2px solid var(--immutabl-blue); }
.risk-cell.selected { outline: 3px solid var(--immutabl-blue); box-shadow: inset 0 0 0 2px #fff; }
.risk-cell:disabled { cursor: default; }
.risk-axis-x { font-size: 0.7rem; color: #64748b; margin: 0.2rem 0 0 3rem; }
.risk-matrix-value { margin-top: 0.4rem; font-size: 0.85rem; font-weight: 700; color: var(--immutabl-blue); }
.risk-ratings { display: flex; gap: 2.5rem; flex-wrap: wrap; margin: 0.5rem 0 1rem; }
.rating-pill { display: inline-block; padding: 0.12rem 0.5rem; border-radius: 4px; color: #fff; font-weight: 600; font-size: 0.74rem; white-space: nowrap; }
.risk-owner-cell { font-size: 0.85rem; color: #475569; }
.record-meta { font-size: 0.8rem; color: #94a3b8; margin: 0.5rem 0; }

/* User multi-select. */
.user-multiselect { display: flex; flex-direction: column; gap: 0.35rem; }
.user-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.user-chip { display: inline-flex; align-items: center; gap: 0.25rem; background: #e7eef2; color: var(--immutabl-blue); padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.82rem; }
.user-chip-x { background: none; border: none; color: #64748b; cursor: pointer; font-size: 0.95rem; line-height: 1; padding: 0; }
.user-empty { color: #94a3b8; font-size: 0.82rem; }
.user-add { max-width: 14rem; }

/* Stacked concern cards (comments / tag cloud / files) on the task detail main column. */
.panel-card { margin-bottom: 1rem; }

/* Module task list: grouped by status, table columns. */
.tstatus-group { margin-bottom: 1.25rem; }
.tstatus-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.status-chip { display: inline-block; padding: 0.12rem 0.6rem; border-radius: 999px; color: #fff; font-size: 0.78rem; font-weight: 600; }
.tasks-table th { font-size: 0.72rem; text-transform: none; color: #94a3b8; font-weight: 600; letter-spacing: normal; }
.tasks-table td { vertical-align: middle; }
.tstatus-title { color: var(--immutabl-blue); text-decoration: none; font-weight: 600; }
.tstatus-title:hover { color: var(--immutabl-orange); }
.tdates { white-space: nowrap; font-size: 0.85rem; color: #475569; }
.due-alert { display: inline-flex; align-items: center; justify-content: center; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #e2e8f0; color: #94a3b8; font-weight: 700; font-size: 0.75rem; margin-left: 0.35rem; }
.due-alert.due-soon { background: #fde2e1; color: #C00000; }
.tag-mini { display: inline-flex; align-items: center; gap: 0.25rem; border: 1px solid #e2e8f0; border-radius: 999px; padding: 0.05rem 0.45rem; font-size: 0.72rem; color: #475569; background: #fff; margin: 0.1rem 0.1rem 0.1rem 0; }
.tag-more { color: #94a3b8; font-weight: 700; }
.tassignees { font-size: 0.85rem; color: #475569; }
.task-row-actions-cell { white-space: nowrap; text-align: right; }

/* ── Unified File Explorer (§6) — Windows-Explorer-style two-pane browser ───────────── */
.fx { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: 0; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; overflow: hidden; min-height: 30rem; }
@media (max-width: 820px) { .fx { grid-template-columns: 1fr; } }

/* Left navigation tree. */
.fx-nav { border-right: 1px solid #eef2f7; background: #f8fafc; padding: 0.6rem 0.4rem; display: flex; flex-direction: column; }
.fx-nav-head { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #94a3b8; padding: 0.2rem 0.5rem 0.5rem; }
.fx-nav-loading { color: #64748b; font-size: 0.85rem; padding: 0.5rem; margin: 0; }
.fx-tree { list-style: none; margin: 0; padding: 0; }
.fx-tree .fx-tree { margin: 0; }
.fx-tree-li { margin: 0; }
.fx-node { display: flex; align-items: center; gap: 0.35rem; padding: 0.32rem 0.5rem; border-radius: 7px; cursor: pointer; color: #334155; font-size: 0.88rem; user-select: none; }
.fx-node:hover { background: #eef2f7; }
.fx-node.sel { background: rgba(16,72,98,0.1); color: var(--immutabl-blue); font-weight: 600; }
.fx-node.sel .fx-node-ic { color: var(--immutabl-blue); }
.fx-node-ic { color: #94a3b8; display: inline-flex; line-height: 0; flex-shrink: 0; }
.fx-node-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-node-folder .fx-node-label { color: #64748b; }
.fx-node-folder.sel .fx-node-label { color: var(--immutabl-blue); }
.fx-twist { background: none; border: none; padding: 0; width: 1.1rem; height: 1.1rem; display: inline-flex; align-items: center; justify-content: center; color: #94a3b8; cursor: pointer; flex-shrink: 0; transition: transform 0.12s; }
.fx-twist.open { transform: rotate(90deg); }
.fx-twist-spacer { width: 1.1rem; flex-shrink: 0; display: inline-block; }
.fx-local { margin-top: auto; display: flex; align-items: center; gap: 0.4rem; width: 100%; border: 1px dashed #cbd5e1; background: #fff; border-radius: 8px; padding: 0.5rem 0.6rem; color: #475569; font-size: 0.85rem; cursor: pointer; font-family: 'Lato', sans-serif; }
.fx-local:hover:not(:disabled):not(.disabled) { border-color: var(--immutabl-orange); color: var(--immutabl-blue); }
.fx-local:disabled, .fx-local.disabled { opacity: 0.5; cursor: default; pointer-events: none; }

/* Right pane. */
.fx-main { padding: 0.75rem 0.9rem 1rem; min-width: 0; }
.fx-toolbar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; flex-wrap: wrap; border-bottom: 1px solid #eef2f7; padding-bottom: 0.6rem; }
.fx-crumbs { display: flex; align-items: center; gap: 0.15rem; flex-wrap: wrap; min-width: 0; }
.fx-crumb { background: none; border: none; padding: 0.2rem 0.35rem; border-radius: 6px; color: var(--immutabl-blue); font-size: 0.9rem; cursor: pointer; font-family: 'Lato', sans-serif; }
.fx-crumb:hover { background: #f1f5f9; text-decoration: underline; }
.fx-crumb-sep { color: #cbd5e1; }
.fx-ops { display: flex; align-items: center; gap: 0.15rem; }
.fx-op { position: relative; background: none; border: none; padding: 0.4rem; border-radius: 7px; color: #64748b; cursor: pointer; display: inline-flex; line-height: 0; }
.fx-op:hover:not(:disabled):not(.disabled) { background: #f1f5f9; color: var(--immutabl-blue); }
.fx-op:disabled, .fx-op.disabled { opacity: 0.35; cursor: default; pointer-events: none; }
.fx-op-danger:hover:not(:disabled):not(.disabled) { background: #fef2f2; color: #b91c1c; }
.fx-op-sep { width: 1px; height: 1.3rem; background: #e2e8f0; margin: 0 0.25rem; }
.fx-op-badge { position: absolute; top: -0.1rem; right: -0.1rem; background: var(--immutabl-orange); color: #fff; font-size: 0.6rem; font-weight: 700; border-radius: 999px; min-width: 0.95rem; height: 0.95rem; display: inline-flex; align-items: center; justify-content: center; padding: 0 0.15rem; }
.fx-view { display: inline-flex; border: 1px solid #e2e8f0; border-radius: 7px; overflow: hidden; }
.fx-view-btn { background: #fff; border: none; padding: 0.35rem 0.45rem; color: #94a3b8; cursor: pointer; display: inline-flex; line-height: 0; }
.fx-view-btn.on { background: rgba(16,72,98,0.1); color: var(--immutabl-blue); }
.fx-view-btn:hover { color: var(--immutabl-blue); }

/* Details table tweaks. */
.fx-table .fx-check { width: 1.5rem; }
.fx-table tr.fx-sel td { background: rgba(255,132,31,0.08); }
.fx-namebtn { background: none; border: none; padding: 0; color: #1e293b; font-size: 0.9rem; cursor: pointer; font-family: 'Lato', sans-serif; text-align: left; }
.fx-namebtn:hover { color: var(--immutabl-blue); text-decoration: underline; }
.fx-context-row td { background: #fcfdfe; }
.fx-context-tag { display: inline-block; font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: #64748b; background: #eef2f7; border-radius: 5px; padding: 0.05rem 0.35rem; margin-left: 0.35rem; vertical-align: middle; }
.fx-rowmenu { background: none; border: none; color: #94a3b8; cursor: pointer; font-size: 1.1rem; line-height: 1; padding: 0 0.3rem; border-radius: 6px; }
.fx-rowmenu:hover { background: #f1f5f9; color: var(--immutabl-blue); }
.fx-pickbtn { background: var(--immutabl-blue); color: #fff; border: none; border-radius: 6px; padding: 0.25rem 0.7rem; font-size: 0.78rem; font-weight: 600; cursor: pointer; font-family: 'Lato', sans-serif; }
.fx-pickbtn:hover { background: #0a3247; }

/* Attach mode (routed attach page) — banner + per-row attach action over the standard manager. */
.fx-attach-banner { display: flex; align-items: center; gap: 0.5rem; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; border-radius: 8px; padding: 0.5rem 0.75rem; margin-bottom: 0.75rem; font-size: 0.85rem; }
.fx-attach-banner svg { flex-shrink: 0; color: #2563eb; }
.fx-attachbtn { background: var(--immutabl-blue); color: #fff; border: none; border-radius: 6px; padding: 0.25rem 0.7rem; font-size: 0.78rem; font-weight: 600; cursor: pointer; font-family: 'Lato', sans-serif; white-space: nowrap; }
.fx-attachbtn:hover:not(:disabled) { background: #0a3247; }
.fx-attachbtn.done { background: #dcfce7; color: #15803d; cursor: default; }
.fx-attachbtn:disabled:not(.done) { opacity: 0.5; cursor: default; }

/* Inline upload progress strip (replaces the old upload modal). */
.fx-uploads { border: 1px solid #e2e8f0; border-radius: 10px; background: #fafcfe; padding: 0.5rem 0.7rem; margin-bottom: 0.75rem; }
.fx-uploads-head { display: flex; align-items: center; justify-content: space-between; font-size: 0.8rem; font-weight: 700; color: #475569; margin-bottom: 0.35rem; }
.fx-uploads-dismiss { background: none; border: none; color: var(--immutabl-blue); cursor: pointer; font-size: 0.78rem; font-family: 'Lato', sans-serif; }
.fx-uploads-dismiss:hover { text-decoration: underline; }
.fx-upload-item { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.5rem; padding: 0.2rem 0; }
.fx-upload-name { font-size: 0.82rem; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-upload-status { font-size: 0.75rem; color: #64748b; font-variant-numeric: tabular-nums; }
.fx-upload-status.ok { color: #15803d; }
.fx-upload-status.warn { color: #b45309; }
.fx-upload-status.fail { color: #b91c1c; }
.fx-upload-bar { grid-column: 1 / -1; height: 4px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.fx-upload-bar-fill { height: 100%; background: var(--immutabl-orange); transition: width 0.15s ease; }
.fx-upload-err { grid-column: 1 / -1; font-size: 0.72rem; color: #b91c1c; }

/* Settings landing — a menu of cards, each opening one focused settings page. */
.settings-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 0.6rem; margin: 0 0 1.75rem; }
.settings-menu-card { display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.9rem 1rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; text-decoration: none; color: inherit; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.settings-menu-card:hover { border-color: var(--immutabl-blue); box-shadow: 0 1px 6px rgba(16,72,98,0.08); }
.settings-menu-ic { color: var(--immutabl-blue); flex-shrink: 0; display: inline-flex; margin-top: 0.1rem; }
.settings-menu-body { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.settings-menu-title { font-weight: 600; color: #1e293b; }
.settings-menu-desc { font-size: 0.85rem; color: #64748b; line-height: 1.4; }

/* Grid / graphic view. */
.fx-gridwrap { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: 0.6rem; }
.fx-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; text-align: center; padding: 0.9rem 0.5rem 0.7rem; border: 1px solid transparent; border-radius: 10px; background: none; cursor: pointer; font-family: 'Lato', sans-serif; }
.fx-tile:hover { background: #f8fafc; border-color: #eef2f7; }
.fx-tile.fx-sel { background: rgba(255,132,31,0.08); border-color: rgba(255,132,31,0.4); }
.fx-tile-ic { position: relative; line-height: 0; }
.fx-tile-lock { position: absolute; bottom: -2px; right: -6px; color: #64748b; background: #fff; border-radius: 999px; padding: 1px; line-height: 0; }
.fx-tile-name { font-size: 0.8rem; color: #1e293b; word-break: break-word; max-width: 100%; }
.fx-tile-sub { font-size: 0.68rem; color: #94a3b8; }
.fx-tile-context .fx-tile-ic { color: #64748b; }

/* Context menu. */
.fx-menu-backdrop { position: fixed; inset: 0; z-index: 200; }
.fx-menu { position: fixed; z-index: 201; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,0.16); min-width: 9rem; padding: 0.3rem; }
.fx-menu-item { display: block; width: 100%; text-align: left; padding: 0.4rem 0.65rem; border-radius: 6px; border: none; background: none; cursor: pointer; font-size: 0.86rem; color: #1e293b; font-family: 'Lato', sans-serif; text-decoration: none; }
.fx-menu-item:hover { background: #f1f5f9; text-decoration: none; }
.fx-menu-item:disabled { opacity: 0.4; cursor: default; }
.fx-menu-item.fx-menu-danger { color: #b91c1c; }
.fx-menu-item.fx-menu-danger:hover { background: #fef2f2; }
