/* Colours and type follow the Aezion site: blue primary, orange call to action, soft pink/lavender hero, pastel cards. */
:root {
    --ink: #111418;
    --body: #3a3f47;
    --muted: #5f6670;
    --paper: #ffffff;
    --accent: #1471ff;           /* Aezion blue */
    --accent-dark: #0060e0;
    --accent-deep: #0a3d91;
    --accent-soft: #e6f1ff;
    --cta: #ed8600;              /* Aezion orange */
    --cta-dark: #d47700;
    --rule: #e3e6ec;
    --mid: #e6f1ff;
    --radius: .75rem;
    --shadow: 0 2px 8px rgba(17, 20, 24, .05), 0 12px 32px rgba(17, 20, 24, .06);
    --hero-wash:
        radial-gradient(900px 480px at 100% 10%, rgba(246, 210, 248, .85), transparent 70%),
        radial-gradient(700px 360px at 0% 100%, rgba(193, 196, 252, .55), transparent 70%),
        linear-gradient(180deg, #f6f6f8 0%, #faf4fb 100%);
    --bs-body-color: var(--body);
    --bs-body-bg: var(--paper);
    --bs-emphasis-color: var(--ink);
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: 20, 113, 255;
    --bs-link-hover-color: var(--accent-dark);
    --bs-link-hover-color-rgb: 0, 96, 224;
    --bs-body-font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6 { color: var(--ink); font-weight: 700; letter-spacing: -0.01em; }

/* ---- Buttons: rounded pills ---- */
.btn { font-weight: 500; border-radius: 999px; padding-left: 1.1rem; padding-right: 1.1rem; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s, transform .15s; }
.btn-sm { padding-left: .85rem; padding-right: .85rem; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1.1rem; }
.btn-primary {
    --bs-btn-bg: var(--accent);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-bg: var(--accent-dark);
    --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: var(--accent-deep);
    --bs-btn-active-border-color: transparent;
    --bs-btn-disabled-bg: var(--accent);
    --bs-btn-disabled-border-color: transparent;
    background-image: linear-gradient(180deg, #2e8ffa 0%, #0075f4 100%);
    box-shadow: 0 6px 16px rgba(20, 113, 255, .28);
}
.btn-primary:hover { background-image: linear-gradient(180deg, #1a7ff5 0%, #0062d6 100%); box-shadow: 0 8px 20px rgba(20, 113, 255, .34); }
.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-border-color: var(--accent);
    --bs-btn-hover-bg: var(--accent);
    --bs-btn-hover-border-color: var(--accent);
    --bs-btn-active-bg: var(--accent-dark);
    --bs-btn-active-border-color: var(--accent-dark);
}
.btn-outline-secondary {
    --bs-btn-color: var(--body);
    --bs-btn-bg: #fff;
    --bs-btn-border-color: #cfd5de;
    --bs-btn-hover-color: var(--accent);
    --bs-btn-hover-bg: var(--accent-soft);
    --bs-btn-hover-border-color: #a8c8ff;
    --bs-btn-active-color: var(--accent-dark);
    --bs-btn-active-bg: #d6e7ff;
    --bs-btn-active-border-color: #a8c8ff;
}
/* The orange call-to-action pill (Contact Us on the site; Sign in / Sign out here). */
.btn-cta {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--cta);
    --bs-btn-border-color: var(--cta);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--cta-dark);
    --bs-btn-hover-border-color: var(--cta-dark);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--cta-dark);
    --bs-btn-active-border-color: var(--cta-dark);
    padding: .45rem 1.25rem;
}
.btn-link { --bs-btn-color: var(--accent); --bs-btn-hover-color: var(--accent-dark); }
.btn-link.px-0 { border-radius: 0; }

/* ---- Header: white bar, logo left, text menu right, orange pill last ---- */
.app-header { position: sticky; top: 0; z-index: 1030; background: #fff; box-shadow: 0 1px 0 var(--rule), 0 4px 14px rgba(17, 20, 24, .04); }
.app-nav { padding-top: .7rem; padding-bottom: .7rem; }
.brand-logo { height: 44px; width: auto; display: block; }
.brand-app { padding-left: .9rem; border-left: 1px solid var(--rule); color: var(--muted); font-size: .9rem; font-weight: 600; letter-spacing: .02em; }
.app-nav .navbar-nav { gap: .25rem 1.25rem; }
.app-nav .nav-link {
    color: #4a4f57; font-weight: 500; font-size: .975rem;
    padding: .5rem .1rem; border: 0; background: none;
    position: relative;
}
.app-nav .nav-link:hover, .app-nav .nav-link:focus-visible, .app-nav .nav-link.show { color: var(--accent); }
.app-nav .nav-link.active { color: var(--accent); font-weight: 600; }
.app-nav .nav-link.active::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.2rem; height: 3px; border-radius: 3px; background: var(--accent); }
.app-nav .nav-link.dropdown-toggle.active::after { left: 0; right: 0; border: 0; margin: 0; vertical-align: 0; }
.app-nav .dropdown-menu { border: 0; border-radius: .6rem; padding: .4rem; margin-top: .6rem; }
.app-nav .dropdown-item { border-radius: .4rem; padding: .5rem .8rem; font-size: .95rem; }
.app-nav .dropdown-item.active, .app-nav .dropdown-item:active { background: var(--accent); }
.user-box { margin-left: 1.75rem; }
.user-name { max-width: 15rem; color: var(--muted); }

@media (max-width: 991.98px) {
    .app-nav .navbar-nav { padding: .75rem 0 .25rem; gap: 0; }
    .app-nav .nav-link { padding: .6rem 0; }
    .app-nav .nav-link.active::after { left: -1rem; right: auto; top: .5rem; bottom: .5rem; width: 3px; height: auto; }
    .user-box { margin-left: 0; padding: .75rem 0 .25rem; border-top: 1px solid var(--rule); justify-content: space-between; }
}

.skip-link:focus { position: fixed; top: .5rem; left: .5rem; z-index: 2000; background: #fff; padding: .5rem .75rem; }

/* ---- Page: soft hero wash behind the content, white panel on top ---- */
.app-main { background: var(--hero-wash); background-repeat: no-repeat; background-size: 100% 560px; background-color: #fff; }
.page-surface { background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(1rem, 3vw, 2.25rem); }
.app-footer { color: var(--muted); padding: 1.5rem 0; border-top: 1px solid var(--rule); background: #fff; }

/* ---- Tables ---- */
.table { --bs-table-bg: #fff; --bs-table-color: var(--body); --bs-table-hover-bg: #f3f8ff; margin-bottom: 0; }
.table > thead th { background: #f4f7fb; color: var(--ink); font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.table > tbody > tr:hover > * { background-color: var(--bs-table-hover-bg); }
.table > :not(caption) > * > * { padding-left: .8rem; padding-right: .8rem; }
.table-responsive { border: 1px solid var(--rule); border-radius: .6rem; background: #fff; margin-bottom: 1rem; }
.table-responsive > .table > :last-child > tr:last-child > * { border-bottom: 0; }

/* ---- Forms ---- */
.form-control, .form-select { border-color: #cfd5de; border-radius: .5rem; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: #6fa8ff; box-shadow: 0 0 0 .2rem rgba(20, 113, 255, .18); }
.form-check-input:checked { background-color: var(--accent); border-color: var(--accent); }
.form-label { font-weight: 500; color: var(--ink); }

/* ---- Alerts and badges ---- */
.alert { border-radius: .6rem; border-width: 0 0 0 4px; }
.alert-success { border-left-color: #198754; }
.alert-danger { border-left-color: #dc3545; }
.alert-warning { border-left-color: var(--cta); background: #fff4e5; color: #6b3d00; }
.alert-info { border-left-color: var(--accent); background: var(--accent-soft); color: var(--accent-deep); }
.badge { font-weight: 600; padding: .45em .8em; border-radius: 999px; }

/* ---- Page headers, sign-in and message pages ---- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin-bottom: 1.25rem; }
.page-icon { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; flex: none; border-radius: .7rem; background: linear-gradient(135deg, #e5f4ff, #dce8ff); color: var(--accent); font-size: 1.2rem; }
.auth-card { max-width: 30rem; margin: clamp(1rem, 6vh, 3.5rem) auto; background: #fff; border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); padding: 2.25rem; }
.auth-card .page-icon { width: 3rem; height: 3rem; font-size: 1.4rem; margin-bottom: 1rem; }
.message-page { text-align: center; padding: 1.5rem 0; }
.message-page .page-icon { width: 3.5rem; height: 3.5rem; font-size: 1.6rem; margin-bottom: 1rem; }
.message-page p { max-width: 34rem; margin-left: auto; margin-right: auto; }
.empty-state { text-align: center; padding: 2rem 1rem; color: var(--muted); background: linear-gradient(135deg, #f0f8ff, #eef2ff); border: 1px dashed #bcd3f5; border-radius: .6rem; }
.empty-state > .bi { display: block; font-size: 2rem; color: var(--accent); margin-bottom: .5rem; }
.empty-state p:last-child { margin-bottom: 0; }

.narrow { max-width: 28rem; }

/* ---- Landing: text left, panel right, pastel cards below (as on the site) ---- */
.hero { padding: clamp(.5rem, 3vw, 2rem) 0 2.5rem; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); line-height: 1.12; }
.hero .hero-sub { font-size: clamp(1.15rem, 2vw, 1.6rem); color: #3a3f47; font-weight: 500; line-height: 1.35; }
.hero-panel { background: rgba(255, 255, 255, .85); backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, .9); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.feature-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 1.75rem; margin: 0; padding: 0; list-style: none; }
.feature-card { border-radius: .6rem; padding: 1.75rem 1.75rem 1.5rem; color: #23272e; }
.feature-card h3 { font-size: 1.3rem; margin-bottom: .6rem; }
.feature-card p { margin: 0; line-height: 1.55; }
.tint-1 { background: linear-gradient(135deg, #e5f4ff 0%, #eafcff 100%); }
.tint-2 { background: linear-gradient(135deg, #e6f1ff 0%, #ecebff 100%); }
.tint-3 { background: linear-gradient(135deg, #ecebeb 0%, #e4e4e4 100%); }
.tint-4 { background: linear-gradient(135deg, #e7f1ff 0%, #d6e6ff 100%); }

/* The 1-5 scale from the templates: the one distinctive element on the page. */
.scale { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--rule); border-radius: .6rem; overflow: hidden; background: #fff; }
.scale li { padding: 1rem .4rem; text-align: center; border-right: 1px solid var(--rule); }
.scale li:last-child { border-right: 0; }
.scale-mid { background: var(--mid); }
.scale-n { display: block; font-size: 2rem; font-weight: 700; line-height: 1; color: var(--accent); }
.scale-l { display: block; margin-top: .4rem; font-size: .78rem; color: var(--muted); }
.scale-note { color: var(--muted); }
@media (max-width: 575.98px) {
    .scale { grid-template-columns: 1fr; }
    .scale li { display: flex; align-items: center; gap: .75rem; text-align: left; border-right: 0; border-bottom: 1px solid var(--rule); padding: .6rem .9rem; }
    .scale li:last-child { border-bottom: 0; }
    .scale-n { font-size: 1.4rem; min-width: 1.5rem; }
    .scale-l { margin-top: 0; font-size: .9rem; }
}

/* Section headings inside forms and results: blue bar on the left. */
.section-title { margin: 1.75rem 0 .85rem; padding: .1rem 0 .1rem .75rem; border-left: 4px solid var(--accent); }
.col-rating { width: 7rem; }
.rating { min-width: 5.5rem; }
.code-input { font-size: 1.5rem; letter-spacing: .35rem; text-align: center; }

/* Sticky action bar at the bottom of the long forms. */
.form-actions { position: sticky; bottom: 0; z-index: 5; background: rgba(255, 255, 255, .95); backdrop-filter: blur(4px); border-top: 1px solid var(--rule); margin: 1.5rem calc(-1 * clamp(1rem, 3vw, 2.25rem)) calc(-1 * clamp(1rem, 3vw, 2.25rem)); padding: .9rem clamp(1rem, 3vw, 2.25rem); border-radius: 0 0 var(--radius) var(--radius); }

/* Supervisor review: label on the left, value or input on the right, like the Department Head sheet. */
.review-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(12rem, 20rem); gap: .25rem 1rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--rule); }
.review-label { margin: 0; }
.review-value .choice { max-width: 10rem; }
@media (max-width: 575.98px) { .review-row { grid-template-columns: 1fr; } }
.self-assessment { background: linear-gradient(135deg, #f3f9ff, #f2f3ff); border: 1px solid var(--rule); border-radius: .6rem; padding: 0 1rem 1rem; }
.self-assessment > summary { cursor: pointer; margin-top: 1rem; font-weight: 600; color: var(--accent); }
.self-assessment .answer { white-space: pre-line; }

/* ---- Reports charts: palette roles validated with the dataviz checks (categorical slots 1-2; one-hue ordinal pair). ---- */
.viz-root {
    --surface-1: #fff;
    --text-primary: #0b0b0b;
    --text-secondary: #52514e;
    --text-muted: #898781;
    --grid: #e1e0d9;
    --baseline: #c3c2b7;
    --series-1: #2a78d6;   /* Level 1 */
    --series-2: #eb6834;   /* Level 2 */
    --seq-light: #86b6ef;  /* employee (self) */
    --seq-dark: #1c5cab;   /* supervisors */
}
.viz-card { background: var(--surface-1, #fff); border: 1px solid var(--rule); border-radius: .6rem; padding: 1rem 1rem .5rem; box-shadow: 0 1px 3px rgba(17, 20, 24, .04); }
/* Drawn at design size (marks <= 24px, 11-12px text); only shrinks on narrow screens. */
.viz { max-width: 100%; height: auto; display: block; overflow: visible; }
.viz .grid { stroke: var(--grid); stroke-width: 1; }
.viz .axis { stroke: var(--baseline); stroke-width: 1; }
.viz .tick { fill: var(--text-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz .tick.strong { fill: var(--text-secondary); font-weight: 600; }
.viz .label { fill: var(--text-secondary); font-size: 12px; }
.viz .value { fill: var(--text-primary); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.viz .connector { stroke: var(--baseline); stroke-width: 2; stroke-linecap: round; }
.viz .ringed { stroke: var(--surface-1); stroke-width: 2; }
.viz .hit { fill: transparent; }
.viz .mark:hover .hit { fill: rgba(11, 11, 11, .04); }
.fill-s1 { fill: var(--series-1); background: var(--series-1); }
.fill-s2 { fill: var(--series-2); background: var(--series-2); }
.fill-light { fill: var(--seq-light); background: var(--seq-light); }
.fill-dark { fill: var(--seq-dark); background: var(--seq-dark); }
.viz-legend { display: flex; flex-wrap: wrap; gap: .25rem 1rem; font-size: .85rem; color: var(--text-secondary); margin-bottom: .25rem; }
.viz-legend .swatch { display: inline-block; width: .75rem; height: .75rem; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.viz-legend .dot { display: inline-block; width: .65rem; height: .65rem; border-radius: 50%; margin-right: .35rem; vertical-align: 0; }
.table-view summary { font-size: .85rem; color: var(--text-secondary, #52514e); cursor: pointer; margin: .25rem 0 .5rem; }
.tabular td, .tabular th { font-variant-numeric: tabular-nums; }

/* Status markers: always an icon plus text, never color alone. */
.status-dot { display: inline-block; min-width: 1.1rem; text-align: center; font-weight: 700; }
.status-good { color: #0b7a0b; }
.status-warning { color: #a86a00; }
.status-serious { color: #b4512a; }
.status-critical { color: #d03b3b; }
.status-muted { color: #898781; }
.insight-card { background: linear-gradient(135deg, #f3f9ff, #f2f3ff); border: 1px solid var(--rule); border-radius: .6rem; padding: .9rem 1.1rem; height: 100%; }

/* Stat tiles: pastel cards like the site's Design / Develop / Validate / Steward row. */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 1rem; margin: 0; }
.stats > div { background: linear-gradient(135deg, #e5f4ff 0%, #eef0ff 100%); border-radius: .6rem; padding: 1rem 1.1rem; }
.stats > div:nth-child(4n+2) { background: linear-gradient(135deg, #e6f1ff 0%, #ecebff 100%); }
.stats > div:nth-child(4n+3) { background: linear-gradient(135deg, #f0efef 0%, #e6e6e6 100%); }
.stats > div:nth-child(4n+4) { background: linear-gradient(135deg, #e7f1ff 0%, #d6e6ff 100%); }
.stats dt { font-weight: 600; font-size: .85rem; color: #3a3f47; display: flex; align-items: center; gap: .45rem; }
.stats dt .bi { color: var(--tile, var(--accent)); }
.stats dd { margin: .3rem 0 0; font-size: 1.9rem; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

details.reset summary { list-style: none; cursor: pointer; }
details.reset summary::-webkit-details-marker { display: none; }
details.reset[open] { min-width: 16rem; }

:focus-visible { outline: 3px solid var(--cta); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- Supporting files ---- */
.attach-box { margin-top: .4rem; }
.attach-list:empty { display: none; }
.attach-list { margin-bottom: .35rem !important; }
.attach-item { display: flex; align-items: center; gap: .35rem; font-size: .875rem; padding: .1rem 0; min-width: 0; }
.attach-item a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.attach-item .bi { color: var(--accent); flex: none; }
.attach-meta { color: var(--muted); font-size: .8rem; flex: none; }
.attach-remove { padding: 0 .3rem; color: var(--muted); flex: none; }
.attach-remove:hover, .attach-remove:focus-visible { color: #b02a37; }
.attach-add { padding: .15rem .7rem; font-size: .8rem; cursor: pointer; }
.attach-add:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.attach-status { color: var(--muted); }
.attach-empty { color: var(--muted); font-size: .875rem; font-style: italic; }

/* ---- Character counters ---- */
.char-count { font-size: .75rem; color: var(--muted); text-align: right; margin-top: .15rem; }
.char-count.near-limit { color: #b35c00; font-weight: 600; }

/* ---- Employee view: Aetrack data and supervisor feedback ---- */
.data-card { border: 1px solid var(--rule); border-radius: .6rem; padding: .75rem .9rem; background: #fafbfd; }
.data-value { font-size: 1.25rem; font-weight: 700; color: var(--ink); }
.feedback-card { background: linear-gradient(135deg, #f3f9ff, #f2f3ff); border: 1px solid var(--rule); border-radius: .6rem; padding: .9rem 1.1rem; }
.feedback-card .answer { white-space: pre-line; }
.overall-rating { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; }
