/* ═══ LAMTANS ERP — Shared Corporate Theme v8 ═══
   Hostinger-style two-tier navigation: dark navy icon rail (module switcher)
   + white second-level menu. Content styling carried over from v7. */

:root { --sidebar-width: 13.5rem; --lam-rail-w: 4.5rem; }
*, *::before, *::after { font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif !important; }

/* ── TIER 1: module rail (injected by panel providers) ── */
.lam-rail { position: fixed; top: 0; bottom: 0; left: 0; width: var(--lam-rail-w); background: #0F172A; z-index: 45; display: flex; flex-direction: column; align-items: center; padding-top: 0.75rem; gap: 0.35rem; }
.lam-rail-logo { display: flex; align-items: center; justify-content: center; width: 2.6rem; height: 2.6rem; margin-bottom: 0.75rem; border-radius: 0.55rem; background: #1B52A3; color: #FFFFFF; font-weight: 800; font-size: 0.85rem; letter-spacing: 0.02em; text-decoration: none; }
.lam-rail-item { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; width: 3.6rem; padding: 0.55rem 0 0.45rem; border-radius: 0.55rem; color: #8BA4C0; font-size: 0.6rem; font-weight: 600; letter-spacing: 0.02em; text-decoration: none; transition: background-color .12s ease, color .12s ease; }
.lam-rail-item svg { width: 1.3rem; height: 1.3rem; }
.lam-rail-item:hover { background: #1E293B; color: #FFFFFF; }
.lam-rail-item.lam-active { background: #1B52A3; color: #FFFFFF; box-shadow: 0 2px 8px rgb(27 82 163 / .45); }

/* shift the whole app right of the rail (desktop) */
.fi-layout { margin-left: var(--lam-rail-w) !important; }
.fi-topbar { margin-left: var(--lam-rail-w) !important; }
@media (max-width: 1023px) { .lam-rail { display: none; } .fi-layout, .fi-topbar { margin-left: 0 !important; } }

/* ── TIER 2: white menu panel (Hostinger-style) ── */
.fi-sidebar { background-color: #FFFFFF !important; border-right: 1px solid #E3E6EF !important; }
.fi-sidebar-header { background-color: #FFFFFF !important; border-bottom: 1px solid #EEF0F5 !important; }
.fi-sidebar-footer { background-color: #FFFFFF !important; border-top: 1px solid #EEF0F5 !important; }
.fi-sidebar-group-label { color: #98A2B3 !important; font-size: 0.64rem !important; font-weight: 700 !important; letter-spacing: 0.12em !important; text-transform: uppercase !important; margin-top: 0.5rem !important; }
.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn { border-radius: 0.5rem !important; padding: 0.5rem 0.75rem !important; margin-bottom: 0.1rem !important; color: #344054 !important; background-color: transparent !important; }
.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-label { font-size: 0.83rem !important; font-weight: 500 !important; color: #344054 !important; }
.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn svg,
.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-icon { color: #667085 !important; width: 1.1rem !important; height: 1.1rem !important; }
.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover { background-color: #F2F4F7 !important; }
.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover .fi-sidebar-item-label { color: #101828 !important; }
.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover svg,
.fi-sidebar-item:not(.fi-active) .fi-sidebar-item-btn:hover .fi-sidebar-item-icon { color: #1B52A3 !important; }
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn { background-color: #EFF4FF !important; border-radius: 0.5rem !important; box-shadow: none !important; }
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn > .fi-sidebar-item-label { color: #1B52A3 !important; font-weight: 600 !important; font-size: 0.83rem !important; }
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn svg,
.fi-sidebar-item.fi-active > .fi-sidebar-item-btn .fi-sidebar-item-icon { color: #1B52A3 !important; width: 1.1rem !important; height: 1.1rem !important; }

/* ── Topbar ── */
.fi-topbar { position: relative !important; overflow: visible !important; background-color: #FFFFFF !important; border-bottom: 1px solid #E3E6EF !important; box-shadow: none !important; }

/* ── Canvas ── */
.fi-main, .fi-body, .fi-simple-main { background-color: #EEF0F6 !important; }
.fi-main, .fi-main-ctn, .fi-page-content, .fi-content { max-width: none !important; }
.fi-page, .fi-page-ctn, .fi-simple-page { padding-inline: 1.75rem !important; padding-block: 1.25rem !important; }
.fi-page-header, .fi-page-header-ctn { padding-inline: 0 !important; margin-bottom: 0.5rem !important; }

/* ── Typography ── */
.fi-header-heading { font-size: 1.5rem !important; font-weight: 700 !important; color: #101828 !important; line-height: 1.35 !important; letter-spacing: -0.01em !important; }
.fi-breadcrumbs, .fi-breadcrumbs ol, .fi-breadcrumbs li, .fi-breadcrumbs a { font-size: 0.75rem !important; color: #667085 !important; }

/* ── Cards / Sections ── */
.fi-section { background-color: #FFFFFF !important; border-radius: 1rem !important; border: 1px solid #E3E6EF !important; box-shadow: 0 1px 2px rgb(16 24 40 / 0.05), 0 4px 12px rgb(16 24 40 / 0.05) !important; }
.fi-section-header { padding: 1rem 1.5rem !important; border-bottom: 1px solid #F0F1F6 !important; }
.fi-section-header-heading { font-size: 1rem !important; font-weight: 600 !important; color: #101828 !important; }
.fi-section-content, .fi-section-content-ctn { padding: 1rem 1.25rem !important; gap: 0.75rem !important; }

/* ── Tables (compact-row engine v4+v5 — do not remove) ── */
.fi-ta { background-color: #FFFFFF !important; border-radius: 1rem !important; border: 1px solid #E3E6EF !important; overflow: hidden !important; box-shadow: 0 1px 2px rgb(16 24 40 / 0.05), 0 4px 12px rgb(16 24 40 / 0.05) !important; }
.fi-ta-header-cell, th.fi-ta-header-cell { padding-top: 0.55rem !important; padding-bottom: 0.55rem !important; font-size: 0.7rem !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: 0.07em !important; color: #667085 !important; background-color: #F8F9FC !important; }
.fi-ta-cell, td.fi-ta-cell { padding: 0 !important; height: auto !important; font-size: 0.8125rem !important; color: #1F2937 !important; line-height: 1.3 !important; }
.fi-ta-row { height: auto !important; transition: background-color 0.12s ease !important; }
.fi-ta-row:hover { background-color: #F5F8FE !important; }
.fi-ta-cell *:not(.fi-badge):not(input) { padding-block: 0 !important; }
.fi-ta-cell > div, .fi-ta-cell > a, .fi-ta-cell > span, .fi-ta-cell > button { padding: 0.35rem 1rem !important; }
.fi-ta-cell > * { margin-block: 0.25rem !important; }
.fi-ta-cell > input { padding: 0 !important; margin-inline: 1rem !important; }
.fi-checkbox-input { width: 1rem !important; height: 1rem !important; padding: 0 !important; }
.fi-ta-actions, .fi-ta-row-actions { padding: 0.3rem 1rem !important; }

/* ── Buttons / badges ── */
.fi-btn { font-size: 0.8125rem !important; font-weight: 600 !important; padding: 0.5rem 1.15rem !important; border-radius: 9999px !important; }
.fi-icon-btn { border-radius: 9999px !important; }
.fi-badge { font-size: 0.7rem !important; font-weight: 600 !important; padding: 0.2rem 0.65rem !important; border-radius: 9999px !important; }
.fi-ta-cell .fi-badge { padding: 0.2rem 0.65rem !important; }

/* ── Forms (compact v7.1) ── */
.fi-fo-field-wrp-label label { font-size: 0.78rem !important; font-weight: 550 !important; color: #344054 !important; }
.fi-input, .fi-select-input, .fi-textarea, .fi-input-wrp input, .fi-input-wrp select { font-size: 0.8125rem !important; padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }
.fi-input-wrp { border-radius: 0.5rem !important; }
.fi-fo-field-wrp { gap: 0.2rem !important; }
.fi-fo-component-ctn, .fi-sc, .fi-sc-component-ctn { gap: 0.75rem !important; }
.fi-textarea { min-height: 4.5rem !important; }
.fi-modal-header-heading { font-size: 1.05rem !important; font-weight: 650 !important; }

/* ── KPI stat cards ── */
.fi-wi-stats-overview-stat { background-color: #FFFFFF !important; padding: 1.25rem 1.5rem !important; border-radius: 1rem !important; border: 1px solid #E3E6EF !important; box-shadow: 0 1px 2px rgb(16 24 40 / 0.05), 0 4px 12px rgb(16 24 40 / 0.05) !important; transition: transform 0.15s ease, box-shadow 0.15s ease !important; }
.fi-wi-stats-overview-stat:hover { transform: translateY(-2px) !important; box-shadow: 0 4px 8px rgb(16 24 40 / 0.06), 0 10px 24px rgb(16 24 40 / 0.09) !important; }
.fi-wi-stats-overview-stat-label { font-size: 0.72rem !important; font-weight: 600 !important; color: #667085 !important; text-transform: uppercase !important; letter-spacing: 0.07em !important; }
.fi-wi-stats-overview-stat-value { font-size: 1.9rem !important; font-weight: 700 !important; color: #101828 !important; line-height: 1.15 !important; margin-top: 0.3rem !important; }
.fi-wi-stats-overview-stat-description { font-size: 0.74rem !important; margin-top: 0.45rem !important; color: #667085 !important; }
.fi-wi-stats-overview-stat-icon { width: 2.75rem !important; height: 2.75rem !important; border-radius: 9999px !important; padding: 0.6rem !important; }
.fi-wi-stats-overview-stat-icon svg { width: 1.4rem !important; height: 1.4rem !important; }
[data-stat-color="info"]    .fi-wi-stats-overview-stat-icon { background-color: rgba(14,165,233,0.12) !important; }
[data-stat-color="info"]    .fi-wi-stats-overview-stat-icon svg { color: #0EA5E9 !important; }
[data-stat-color="success"] .fi-wi-stats-overview-stat-icon { background-color: rgba(79,175,61,0.13) !important; }
[data-stat-color="success"] .fi-wi-stats-overview-stat-icon svg { color: #4FAF3D !important; }
[data-stat-color="warning"] .fi-wi-stats-overview-stat-icon { background-color: rgba(245,158,11,0.13) !important; }
[data-stat-color="warning"] .fi-wi-stats-overview-stat-icon svg { color: #F59E0B !important; }
[data-stat-color="danger"]  .fi-wi-stats-overview-stat-icon { background-color: rgba(228,35,43,0.12) !important; }
[data-stat-color="danger"]  .fi-wi-stats-overview-stat-icon svg { color: #E4232B !important; }

/* ── v8.2: thin form inputs (owner request — less padding everywhere) ── */
.fi-input, .fi-select-input, .fi-input-wrp input, .fi-input-wrp select {
    padding-top: 0.3rem !important; padding-bottom: 0.3rem !important;
    font-size: 0.8125rem !important; min-height: 0 !important;
}
.fi-input-wrp { min-height: 0 !important; }
.fi-textarea { min-height: 3.25rem !important; }
/* keep multi-select chips (e.g. Interested In) compact inside the thinner field */
.fi-input-wrp .fi-badge, .fi-select .fi-badge { padding: 0.1rem 0.5rem !important; }

/* ── v8.3: kill horizontal overflow — content width must shrink by the
      rail's width, not just shift right (scrollbar-since-v8 bug) ── */
.fi-layout { width: calc(100% - var(--lam-rail-w)) !important; }
.fi-topbar { width: calc(100% - var(--lam-rail-w)) !important; }
@media (max-width: 1023px) { .fi-layout, .fi-topbar { width: 100% !important; } }

/* ── v8.4: vertical density — tighter page top, section cards and field gaps ── */
.fi-page, .fi-page-ctn, .fi-simple-page { padding-block: 0.75rem !important; }
.fi-page-header, .fi-page-header-ctn { margin-bottom: 0.25rem !important; }
.fi-header-heading { font-size: 1.25rem !important; }
.fi-section-header { padding: 0.6rem 1.1rem !important; }
.fi-section-header-heading { font-size: 0.9rem !important; }
.fi-section-content, .fi-section-content-ctn { padding: 0.75rem 1.1rem !important; gap: 0.6rem !important; }
.fi-sc, .fi-sc-component-ctn, .fi-fo-component-ctn { gap: 0.6rem !important; }
.fi-fo-field-wrp { gap: 0.15rem !important; }
.fi-fo-field-wrp-label label { font-size: 0.76rem !important; }
.fi-textarea { min-height: 2.75rem !important; }

/* ── v8.5: overdue task rows glow red ── */
.lam-overdue-row {
    background: #FEF3F2 !important;
    box-shadow: inset 3px 0 0 #E4232B;
}
.lam-overdue-row:hover {
    background: #FEE4E2 !important;
}

/* ── v8.6: compact sidebar — whole menu on one screen ── */
.fi-sidebar-nav { padding-top: 0.5rem !important; padding-bottom: 0.75rem !important; gap: 0.6rem !important; }
.fi-sidebar-nav-groups { gap: 0.6rem !important; }
.fi-sidebar-group { gap: 0.15rem !important; }
.fi-sidebar-group-items { gap: 0.1rem !important; }
.fi-sidebar-group-label { margin-bottom: 0.1rem !important; padding-top: 0 !important; font-size: 0.68rem !important; }
.fi-sidebar-item-button { padding-top: 0.34rem !important; padding-bottom: 0.34rem !important; }
.fi-sidebar-item-label { font-size: 0.85rem !important; }
.fi-sidebar-item-icon { height: 1.1rem !important; width: 1.1rem !important; }

/* ── v8.7: flagged records — red rows + red page wash ── */
.lam-flagged-row {
    background: #FEE4E2 !important;
    box-shadow: inset 4px 0 0 #E4232B;
}
.lam-flagged-row:hover {
    background: #FECDCA !important;
}
.fi-main:has(.lam-flag-banner) {
    background: #FEF3F2 !important;
}

/* ═══ v8.8 — ULTRA-COMPACT SIDEBAR (scrollbar returned as menu grew) ═══ */
.fi-sidebar-nav { padding-top: .35rem !important; padding-bottom: .5rem !important; gap: .3rem !important; }
.fi-sidebar-nav-groups { gap: .45rem !important; }
.fi-sidebar-group { gap: .1rem !important; }
.fi-sidebar-group-label { font-size: .62rem !important; padding-top: .1rem !important; padding-bottom: .1rem !important; }
.fi-sidebar-item-button { padding-top: .26rem !important; padding-bottom: .26rem !important; }
.fi-sidebar-item-label { font-size: .8rem !important; }
.fi-sidebar-item-icon { height: 1.05rem !important; width: 1.05rem !important; }

/* ═══ v8.9 — sidebar squeeze round 2 (v8.8 was too gentle) ═══ */
.fi-sidebar-header { height: 3rem !important; min-height: 3rem !important; }
.fi-sidebar-nav { padding-top: .2rem !important; padding-bottom: .3rem !important; gap: .15rem !important; }
.fi-sidebar-nav-groups { gap: .25rem !important; }
.fi-sidebar-group { gap: .05rem !important; }
.fi-sidebar-group-items { gap: 0 !important; }
.fi-sidebar-group-label { font-size: .6rem !important; margin-bottom: 0 !important; padding-bottom: 0 !important; }
.fi-sidebar-item-button { padding-top: .16rem !important; padding-bottom: .16rem !important; }
.fi-sidebar-item-label { font-size: .78rem !important; }
.fi-sidebar-item-icon { height: 1rem !important; width: 1rem !important; }

/* ═══ v9.0 — FULL-WIDTH CONTENT (remove framework max-width cap on all pages) ═══ */
.fi-main { max-width: none !important; }

/* ═══ v9.1 — full-width, round 2: hit every wrapper the framework caps ═══ */
.fi-main, .fi-main-ctn, .fi-page, .fi-page-content, form.fi-form, .fi-form {
    max-width: none !important;
}
.fi-main { width: 100% !important; }

/* ═══ v9.2 — section brand tints (colour header AND body) ═══ */
.lam-sec-blue, .lam-sec-blue > * { background: #F5F8FD !important; }
.lam-sec-blue { border: 1px solid #D7E3F7 !important; }
.lam-sec-green, .lam-sec-green > * { background: #F6FBF4 !important; }
.lam-sec-green { border: 1px solid #DCF0D8 !important; }

/* ═══ v9.3 — nested tinted section bleeds to parent walls ═══ */
.lam-sec-blue .lam-sec-green {
    margin-left: -1.5rem !important;
    margin-right: -1.5rem !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
}

/* ═══ v9.4 — Professionals: colour-coded role section HEADERS (headers only) ═══ */
.lam-prof-coordinator           { --lam-prof-c: #1B52A3; }  /* Retrofit Coordinator — brand blue   */
.lam-prof-assessor              { --lam-prof-c: #0EA5E9; }  /* Retrofit Assessor — sky             */
.lam-prof-designer              { --lam-prof-c: #7C3AED; }  /* Retrofit Designer — purple          */
.lam-prof-operative             { --lam-prof-c: #4FAF3D; }  /* Operative / Installer — brand green */
.lam-prof-independent_inspector { --lam-prof-c: #D97706; }  /* Independent Inspector — amber       */
.lam-prof-general               { --lam-prof-c: #64748B; }  /* General — slate                     */
.lam-prof-sec {
    border-top: 4px solid var(--lam-prof-c, #1B52A3) !important;
    overflow: hidden;
}
.lam-prof-sec .fi-section-header,
.lam-prof-sec > header {
    background: color-mix(in srgb, var(--lam-prof-c, #1B52A3) 7%, #ffffff) !important;
    border-bottom: 1px solid color-mix(in srgb, var(--lam-prof-c, #1B52A3) 18%, #ffffff) !important;
}
.lam-prof-sec .fi-section-header-heading,
.lam-prof-sec > header h2,
.lam-prof-sec > header h3 {
    color: var(--lam-prof-c, #1B52A3) !important;
    font-weight: 700 !important;
}
/* Collapsed evidence rows: give the bar a touch of the role colour too */
.lam-prof-sec .fi-fo-repeater-item-header {
    background: color-mix(in srgb, var(--lam-prof-c, #1B52A3) 4%, #ffffff);
}

/* ═══ v9.5 — DWP gate: whole-page wash while a funded project's DWP is not Verified ═══ */
.fi-main:has(.lam-dwp-banner) { background: #FFF5F5 !important; }

/* w61b: extra section tones */
.lam-sec-amber, .lam-sec-amber > * { background: #FFFAF0 !important; }
.lam-sec-amber { border: 1px solid #F6E3BF !important; }
.lam-sec-purple, .lam-sec-purple > * { background: #F8F5FD !important; }
.lam-sec-purple { border: 1px solid #E4DAF5 !important; }
.lam-sec-teal, .lam-sec-teal > * { background: #F2FAFA !important; }
.lam-sec-teal { border: 1px solid #CDEBEA !important; }
.lam-sec-rose, .lam-sec-rose > * { background: #FDF5F6 !important; }
.lam-sec-rose { border: 1px solid #F4D7DC !important; }
