/* ============================================================================
   FCE brand layer — a MODERN design system on Bootstrap 5.3.3.
   Goal: a clean, contemporary look & feel (not a pixel reproduction of the
   legacy purchased marketing template), keeping the FCE green brand identity.
   Load order: bootstrap.min.css -> fce-brand.css -> site.css
   ========================================================================== */

:root {
    /* ---- Brand palette ---- */
    --fce-green: #24a828;
    --fce-green-hover: #1f9123;
    --fce-green-dark: #18761b;
    --fce-green-soft: #e8f6e9;      /* tints for badges / active states */
    --fce-green-rgb: 36, 168, 40;

    /* ---- Neutrals (modern, slightly cool gray scale) ---- */
    --fce-ink: #1f2733;             /* primary text */
    --fce-muted: #6b7785;           /* secondary text */
    --fce-line: #e6e9ed;            /* hairline borders */
    --fce-surface: #ffffff;         /* cards / panels */
    --fce-canvas: #f5f7fa;          /* page background */

    --fce-header-top: #1f2733;      /* utility bar (modern dark slate) */
    --fce-header-top-border: #2a3340;
    --fce-footer: #1b222c;
    --fce-footer-text: #aab3c0;

    /* ---- Design tokens ---- */
    --fce-radius: .6rem;
    --fce-radius-sm: .4rem;
    --fce-radius-pill: 50rem;
    --fce-shadow-sm: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.10);
    --fce-shadow: 0 4px 12px rgba(16,24,40,.08), 0 2px 4px rgba(16,24,40,.05);
    --fce-shadow-lg: 0 12px 32px rgba(16,24,40,.14);
    --fce-transition: .18s ease;

    /* ---- Bootstrap variable overrides ---- */
    --bs-body-color: var(--fce-ink);
    --bs-body-bg: var(--fce-canvas);
    --bs-link-color-rgb: var(--fce-green-rgb);
    --bs-link-hover-color-rgb: 31, 145, 35;
    --bs-border-color: var(--fce-line);
    --bs-primary-rgb: var(--fce-green-rgb);
    --bs-border-radius: var(--fce-radius-sm);
    --bs-border-radius-lg: var(--fce-radius);
}

/* ============================ Base typography ============================ */
/* Page body */
body {
    font-family: 'Roboto', system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--fce-ink);
    background-color: var(--fce-canvas);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Raleway', system-ui, sans-serif;
    font-weight: 600;
    color: var(--fce-ink);
    letter-spacing: -0.01em;
}

/* Navbar / nav / breadcrumb font family */
.navbar, .nav, .breadcrumb { font-family: 'Raleway', system-ui, sans-serif; }

/* Logo text utility class */
.logo-font { font-family: 'Raleway', system-ui, sans-serif; font-weight: 700; letter-spacing: -0.02em; }

/* Links */
a { transition: color var(--fce-transition); }

/* Brand-green text utility */
.text-fce { color: var(--fce-green) !important; }

/* Soft-green background utility */
.bg-fce-soft { background-color: var(--fce-green-soft) !important; }

/* Consistent page-title rhythm (views use <h1 class="h3"> after a breadcrumb) */
main > .container, main > .container-fluid, main { }
main h1.h3, main h1:first-of-type { margin-bottom: 1.25rem; }

/* ============================ Buttons (modern) ============================ */
/* Base button */
.btn {
    --bs-btn-border-radius: var(--fce-radius-sm);
    font-weight: 500;
    transition: background-color var(--fce-transition), border-color var(--fce-transition),
                box-shadow var(--fce-transition), transform var(--fce-transition);
}

/* Button — pressed state */
.btn:active { transform: translateY(1px); }

/* Primary / brand button */
.btn-primary, .btn-fce {
    --bs-btn-bg: var(--fce-green);
    --bs-btn-border-color: var(--fce-green);
    --bs-btn-hover-bg: var(--fce-green-hover);
    --bs-btn-hover-border-color: var(--fce-green-hover);
    --bs-btn-active-bg: var(--fce-green-dark);
    --bs-btn-active-border-color: var(--fce-green-dark);
    --bs-btn-disabled-bg: var(--fce-green);
    --bs-btn-disabled-border-color: var(--fce-green);
    box-shadow: 0 1px 2px rgba(var(--fce-green-rgb), .35);
}

/* Primary / brand button — hover state */
.btn-primary:hover, .btn-fce:hover { box-shadow: 0 4px 10px rgba(var(--fce-green-rgb), .30); }

/* Outline-primary button */
.btn-outline-primary {
    --bs-btn-color: var(--fce-green-hover);
    --bs-btn-border-color: var(--fce-green);
    --bs-btn-hover-bg: var(--fce-green);
    --bs-btn-hover-border-color: var(--fce-green);
    --bs-btn-active-bg: var(--fce-green-hover);
}

/* Success button */
.btn-success { --bs-btn-bg: var(--fce-green); --bs-btn-border-color: var(--fce-green); --bs-btn-hover-bg: var(--fce-green-hover); --bs-btn-hover-border-color: var(--fce-green-hover); }

/* DataTables export buttons (Excel/PDF/Print/etc.) share one bg color, so bootstrap5's
   btn-group border-merging makes them read as a single block. Give each its own border
   and spacing so they're visually distinct buttons. */
.dt-buttons.btn-group { gap: 4px; }
.dt-buttons.btn-group > .btn-primary {
    margin-left: 0;
    border-radius: var(--fce-radius-sm) !important;
    border-color: var(--fce-green-dark);
}

/* ============================ Cards / panels (modern) ============================ */
/* Card container */
.card {
    --bs-card-border-color: var(--fce-line);
    --bs-card-border-radius: var(--fce-radius);
    --bs-card-bg: var(--fce-surface);
    box-shadow: var(--fce-shadow-sm);
    transition: box-shadow var(--fce-transition), transform var(--fce-transition);
}

/* Card header */
.card-header {
    background-color: #fbfcfd;
    border-bottom-color: var(--fce-line);
    font-weight: 600;
}

/* Subtle lift on cards that act as links/tiles (role hubs, nav cards) */
.card.card-hover:hover,
a.card:hover,
.card > a.stretched-link:hover ~ * { }
a.text-decoration-none .card:hover,
.card-hover:hover { box-shadow: var(--fce-shadow); transform: translateY(-2px); }

/* ============================ Tables (modern) ============================ */
/* Table base */
.table {
    --bs-table-border-color: var(--fce-line);
    --bs-table-striped-bg: #e9edf1;
    --bs-table-hover-bg: rgba(var(--fce-green-rgb), .06);
    vertical-align: middle;
}

/* Table head */
.table > thead {
    --bs-table-bg: #f3f5f8;
    color: var(--fce-muted);
}

/* Table head cells */
.table > thead th {
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .03em;
    border-bottom: 1px solid var(--fce-line);
    white-space: nowrap;
}

/* DataTables-enabled grids: comfortable cell spacing, even under table-sm */
.fce-datatable > thead > tr > th,
.fce-datatable > tbody > tr > td {
    padding: .75rem .25rem;
}

/* The tight .25rem horizontal padding above leaves the first column crammed against
   the card's left border and the last column against its right border; give just
   those two columns room to breathe without loosening every inter-column gap. */
.fce-datatable > thead > tr > th:first-child,
.fce-datatable > tbody > tr > td:first-child {
    padding-left: .75rem;
}
.fce-datatable > thead > tr > th:last-child,
.fce-datatable > tbody > tr > td:last-child {
    padding-right: .75rem;
}

/* Headers carry the bold weight; keep body cell text regular so grids don't read heavy. */
.fce-datatable > tbody > tr > td {
    font-weight: 400;
}

/* Zebra stripes for every fce-datatable, even ones that don't add table-striped
   explicitly; harmless no-op overlap on tables that already do (same var/selector
   as Bootstrap's .table-striped). */
.fce-datatable > tbody > tr:nth-of-type(odd) > td {
    background-color: var(--bs-table-striped-bg);
}

/* DataTables 2.x nests its dt-container (buttons/filter/length/pagination rows)
   directly inside our table-responsive/fce-table-card panel; give it room to
   breathe instead of sitting flush against the card edges. */
.table-responsive .dt-container,
.fce-table-card .dt-container {
    padding: .5rem .0rem;
}

/* Bootstrap5 integration zeroes the first/last column gutters inside
   table-responsive for edge-to-edge scrolling tables; override it since our
   table-responsive is styled as a bordered/shadowed card, not a bare scroller. */
div.table-responsive > div.dt-container > div.row > div[class^="col-"]:first-child,
div.fce-table-card > div.dt-container > div.row > div[class^="col-"]:first-child,
div.table-responsive > div.dt-container > div.row > div[class^="col-"]:last-child,
div.fce-table-card > div.dt-container > div.row > div[class^="col-"]:last-child {
    padding-left: var(--bs-gutter-x, .375rem);
    padding-right: var(--bs-gutter-x, .375rem);
}

/* Soften the heavy default grid of table-bordered for a cleaner look */
.table-bordered { --bs-table-border-color: var(--fce-line); }

/* Wrap server-rendered tables in a clean rounded surface */
.table-responsive, .fce-table-card {
    background: var(--fce-surface);
    border: 1px solid var(--fce-line);
    border-radius: var(--fce-radius);
    box-shadow: var(--fce-shadow-sm);
    overflow-x: auto;
    overflow-y: hidden;
}

/* Table nested in the responsive/card wrapper — remove double bottom margin */
.table-responsive > .table, .fce-table-card > .table { margin-bottom: 0; }

/* Colored table head variant */
.table-colored > thead { --bs-table-bg: var(--fce-green); color: #fff; }

/* ============================ Forms (modern) ============================ */
/* Text inputs / selects */
.form-control, .form-select {
    border-color: var(--fce-line);
    border-radius: var(--fce-radius-sm);
    transition: border-color var(--fce-transition), box-shadow var(--fce-transition);
}

/* Text inputs / selects — focus state */
.form-control:focus, .form-select:focus {
    border-color: var(--fce-green);
    box-shadow: 0 0 0 .2rem rgba(var(--fce-green-rgb), .18);
}

/* Field labels */
.form-label { font-weight: 500; color: var(--fce-ink); margin-bottom: .35rem; }

/* Radios / checkboxes */
.form-check-input { border-color: var(--fce-muted); border-width: 1.5px; }

/* Radios / checkboxes — checked state */
.form-check-input:checked { background-color: var(--fce-green); border-color: var(--fce-green); }

/* Radios / checkboxes — focus state */
.form-check-input:focus { border-color: var(--fce-green); box-shadow: 0 0 0 .2rem rgba(var(--fce-green-rgb), .18); }

/* Input-group prefix/suffix (e.g. "$" or unit labels) */
.input-group-text { background-color: #f3f5f8; border-color: var(--fce-line); }

/* ============================ Badges / status pills ============================ */
/* Badge base */
.badge { font-weight: 600; border-radius: var(--fce-radius-pill); padding: .4em .7em; }

/* Success badge */
.badge.bg-success, .badge.text-bg-success { background-color: var(--fce-green) !important; }

/* "Active" status pill */
.fce-pill-active { background-color: var(--fce-green-soft); color: var(--fce-green-dark); }

/* "Inactive" status pill */
.fce-pill-inactive { background-color: #f1f3f5; color: var(--fce-muted); }

/* ============================ Top utility bar ============================ */
/* Utility bar container */
.fce-header-top {
    background-color: var(--fce-header-top);
    border-bottom: 1px solid var(--fce-header-top-border);
    color: #c8d0da;
    font-size: .82rem;
    padding: 6px 0;
}

/* Utility bar links */
.fce-header-top a { color: #e9ecef; text-decoration: none; transition: color var(--fce-transition); }

/* Utility bar links — hover state */
.fce-header-top a:hover { color: #fff; }

/* Utility bar icons */
.fce-header-top .fa { color: var(--fce-green); }

/* ============================ Header band (white, sticky) ============================ */
/* Header band container */
.fce-header {
    padding-top: 8px;
    padding-bottom: 8px;
    box-shadow: var(--fce-shadow-sm);
    transition: padding var(--fce-transition), box-shadow var(--fce-transition);
}

/* Header band — sticky positioning */
.fce-page-header { position: sticky; top: 0; z-index: 1030; }

/* Header band — condensed state once the page has scrolled */
.fce-header.fce-header--scrolled { padding-top: 4px; padding-bottom: 4px; box-shadow: var(--fce-shadow); }

/* Brand logo image */
.fce-header .navbar-brand img { max-height: 46px; width: auto; transition: max-height var(--fce-transition); }

/* Brand logo image — condensed once scrolled */
.fce-header.fce-header--scrolled .navbar-brand img { max-height: 38px; }

/* Nav links */
.fce-header .nav-link {
    color: #3c4654;
    font-weight: 500;
    border-radius: var(--fce-radius-sm);
    padding-left: .85rem;
    padding-right: .85rem;
    transition: color var(--fce-transition), background-color var(--fce-transition);
}

/* Nav links — hover/focus state */
.fce-header .nav-link:hover, .fce-header .nav-link:focus { color: var(--fce-green); }

/* Nav links — active/current-page state */
.fce-header .nav-link.active, .fce-header .show > .nav-link {
    color: var(--fce-green-dark);
    background-color: var(--fce-green-soft);
}

/* Nav dropdown menu panel */
.fce-header .dropdown-menu {
    border: 1px solid var(--fce-line);
    border-radius: var(--fce-radius);
    box-shadow: var(--fce-shadow);
    padding: .35rem;
}

/* Nav dropdown menu items */
.fce-header .dropdown-item { border-radius: var(--fce-radius-sm); padding: .45rem .75rem; }

/* Nav dropdown menu items — hover/focus state */
.fce-header .dropdown-item:hover, .fce-header .dropdown-item:focus { background-color: var(--fce-green-soft); color: var(--fce-green-dark); }

/* Nav dropdown menu items — active/selected state */
.fce-header .dropdown-item.active, .fce-header .dropdown-item:active { background-color: var(--fce-green); color: #fff; }

/* Open nav dropdowns on hover at desktop widths (navbar-expand-lg); below that the navbar
   collapses to a tap-driven mobile menu, where hover-open would trap touch users. */
@media (min-width: 992px) {
    .fce-header .nav-item.dropdown:hover > .dropdown-menu { display: block; }
}

/* ============================ Client banner (page hero) ============================ */
/* Banner container */
.client-banner {
    position: relative;
    background-size: cover;
    background-position: 50% 27%;      /* default (no client selected) — legacy parity */
    min-height: 250px;                 /* legacy parity (.dark-translucent-bg min-height) */
    padding: 48px 0 28px;
    margin-bottom: 1.75rem;
}

/* Banner — client-selected image crop */
.client-banner.client-banner-client { background-position: 50% 45%; }   /* client selected — legacy parity */

/* Banner — gradient overlay (modern, richer than flat black) */
.client-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(16,24,40,.45) 0%, rgba(16,24,40,.62) 100%);
    z-index: 1;
}

/* Banner content wrapper (sits above the gradient overlay) */
.client-banner > .container { position: relative; z-index: 2; }

/* Banner text color */
.client-banner, .client-banner p, .client-banner .title { color: #fff; }

/* Banner title */
.client-banner .title { font-weight: 700; margin: 0; text-shadow: 0 1px 12px rgba(0,0,0,.25); }

/* Banner title — logo-font variant sizing */
.client-banner .title.logo-font { font-size: 2.4rem; }

/* Banner paragraph text */
.client-banner p { margin: 0; opacity: .92; }

/* Home page banner tagline — legacy parity (.large_white) */
.client-banner-home p { font-size: 42px; line-height: 1.2; font-family: 'Raleway', sans-serif; }

/* Login: image + form are one self-sized block (legacy parity — FCEPortal Login.cshtml) */
.client-banner-login {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    margin-bottom: 0;              /* no gap before the footer */
    padding: 56px 0;
}

/* Login banner content wrapper */
.client-banner-login > .container { width: 100%; }

/* Banner separator rule (gradient underline) */
.client-banner-separator {
    width: 100%;
    height: 1px;
    border: 0;
    margin: 14px auto;
    background: linear-gradient(to right,
        rgba(var(--fce-green-rgb), 0) 0%,
        rgba(var(--fce-green-rgb), 0.45) 35%,
        rgba(var(--fce-green-rgb), 0.45) 65%,
        rgba(var(--fce-green-rgb), 0) 100%);
}

/* Generic page-header separator — legacy parity with .separator-2 (login underline),
   not legacy's .separator (renamed above to .client-banner-separator). */
.separator { height: 1px; border: 0; margin: 0 0 1.5rem; opacity: 1;
    background: linear-gradient(to right, rgba(0,0,0,.18) 0%, rgba(0,0,0,.12) 35%, rgba(0,0,0,.05) 70%, rgba(0,0,0,0) 100%); }

/* Per-client logo chip overlaid on the hero (white plate so any logo reads on the photo) */
.client-banner-logo { display: inline-block; }
.client-banner-logo img {
    max-height: 76px;
    max-width: 220px;
    width: auto;
    background: #fff;
    padding: 8px 14px;
    border-radius: var(--fce-radius);
    box-shadow: var(--fce-shadow);
}

/* In-page breadcrumbs (views render a plain <nav><ol class="breadcrumb">) */
main .breadcrumb { font-size: .85rem; background: transparent; padding: 0; }

/* ============================ Detail cards (read-only Person/Contact/Employment panels) ============================ */
/* Detail card header row */
.detail-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    margin-bottom: .5rem;
}

/* Detail card title */
.detail-card__title {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin: 0;
    padding-bottom: .4rem;
    width: fit-content;
    border-bottom: 2px solid transparent;
    border-image: linear-gradient(to right, #7c848f 0%, #7c848f59 60%, #7c848f00 100%) 1;
}

/* Detail card subheading */
.detail-subhead {
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--bs-secondary-color);
    margin: 1rem 0 .4rem;
}

/* Keeps layout rules only */
.detail-grid {
    display: grid;
    grid-template-columns: minmax(120px, 40%) 1fr;
    margin: 0;
}

    /* Base structural lines */
    .detail-grid dt,
    .detail-grid dd {
        margin: 0;
        border-bottom: 1px solid var(--bs-border-color);
    }

    /* Vertical separating line between columns */
    .detail-grid dt {
        font-weight: 900;
        color: var(--bs-secondary-color);
        border-right: 1px solid var(--bs-border-color);
    }

    .detail-grid dd {
        font-weight: 400;
        text-align: right;
    }

        /* Empty fallback rule */
        .detail-grid dd:empty::after {
            content: "\2014";
            color: var(--bs-secondary-color);
            font-weight: 400;
        }

    /* Zebra stripes, same color as .table-striped elsewhere. Literal hex, not
       var(--bs-table-striped-bg) — that var is scoped to .table and doesn't
       cascade to this dl-based grid. */
    .detail-grid dt:nth-of-type(odd),
    .detail-grid dd:nth-of-type(odd) {
        background-color: #e9edf1;
    }

/* ============================ Footer (dark, branded) ============================ */
/* Footer container */
.fce-footer { background-color: var(--fce-footer); color: var(--fce-footer-text); font-size: .9rem; }

/* Footer links */
.fce-footer a { color: var(--fce-footer-text); text-decoration: none; transition: color var(--fce-transition); }

/* Footer links — hover state */
.fce-footer a:hover { color: #fff; }

/* Footer image (logo) */
.fce-footer img { max-height: 38px; width: auto; }

/* Footer brand-green text */
.fce-footer .text-fce { color: var(--fce-green); }

/* ============================ Scroll-to-top button ============================ */
/* Button container */
.fce-scroll-top {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: var(--fce-radius-pill);
    background-color: var(--fce-green);
    color: #fff;
    box-shadow: var(--fce-shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity var(--fce-transition), transform var(--fce-transition), background-color var(--fce-transition);
    z-index: 1040;
}

/* Button — hover state */
.fce-scroll-top:hover { background-color: var(--fce-green-hover); }

/* Button — visible/shown state */
.fce-scroll-top.show { opacity: 1; visibility: visible; transform: translateY(0); }

/* ============================ Legacy spacing/util shims ============================ */
/* Lets any markup copied from legacy views lay out correctly under BS5. */
.pull-right { float: right !important; }
.pull-left { float: left !important; }
.pr-5 { padding-right: 5px !important; }  .pl-5 { padding-left: 5px !important; }
.pr-10 { padding-right: 10px !important; } .pl-10 { padding-left: 10px !important; }
.pt-10 { padding-top: 10px !important; }   .pb-10 { padding-bottom: 10px !important; }
.pv-10 { padding-top: 10px !important; padding-bottom: 10px !important; }
.pv-20 { padding-top: 20px !important; padding-bottom: 20px !important; }
.ph-20 { padding-left: 20px !important; padding-right: 20px !important; }
.mt-10 { margin-top: 10px !important; }    .mb-10 { margin-bottom: 10px !important; }
.mt-20 { margin-top: 20px !important; }    .mb-20 { margin-bottom: 20px !important; }

/* Neutralize the legacy reveal-animation trap: never leave content invisible
   if stray legacy markup carries these classes (the JS framework isn't loaded). */
.object-non-visible { opacity: 1 !important; visibility: visible !important; }

/* ============================ Rich-text editor (Quill) ============================ */
/* Editor surface */
.fce-richtext { background: #fff; border-radius: 0 0 var(--fce-radius-sm) var(--fce-radius-sm); }

/* Editor content area */
.fce-richtext .ql-editor { min-height: 12rem; font-family: 'Roboto', sans-serif; font-size: .95rem; }

/* Toolbar */
.ql-toolbar.ql-snow { border-color: var(--fce-line); border-radius: var(--fce-radius-sm) var(--fce-radius-sm) 0 0; background: #fbfcfd; }

/* Editor container border */
.ql-container.ql-snow { border-color: var(--fce-line); }

/* Toolbar icon strokes */
.ql-snow .ql-stroke { stroke: var(--fce-muted); }

/* Toolbar icon strokes — hover state */
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow .ql-toolbar button:hover .ql-stroke { stroke: var(--fce-green); }

/* Toolbar icon strokes — active/selected state */
.ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--fce-green-dark); }

/* ============================ Reduced-motion respect ============================ */
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
