/* =====================================================================
   ACTS Colleges — Automated Class Scheduling Portal
   Theme tokens & shell styles
   ---------------------------------------------------------------------
   Sidebar modes:
   1) Expanded — full labels (desktop default when not .acs-app--collapsed).
   2) Icon rail — .acs-app--collapsed on .acs-app (≥768px): 64px column,
      centered icons; group labels hidden; nav scrolls inside sidebar if tall.
   3) Mobile drawer — max-width 767px: sidebar off-canvas; .acs-app--mobile-open
      slides it in with .acs-app__backdrop + body.acs-app--locked.

   Brand accent (--acs-accent): official ACTS warm orange for rails, login
   hero wash, and focus affordances; keep semantic warning yellow separate.
   --------------------------------------------------------------------- */

:root {
    --acs-primary:      #1f4e79;
    --acs-primary-700:  #173a5b;
    --acs-primary-300:  #4a7bad;

    /* Official ACTS warm accent — keep aligned with config/app.php theme.accent */
    --acs-accent:       #dd6b20;
    --acs-accent-700:   #ad4d12;
    --acs-accent-300:   #f3a672;
    --acs-accent-tint:  #fdf1e7;

    --acs-sidebar:      #0f2436;
    --acs-sidebar-hov:  #1a3550;
    --acs-sidebar-act:  #234770;

    --acs-status-draft:     #6c757d;
    --acs-status-active:    #198754;
    --acs-status-committed: #0d6efd;
    --acs-status-published: #6f42c1;
    --acs-status-conflict:  #dc3545;
    --acs-status-warning:   #ffc107;

    --acs-modality-f2f:     #198754;
    --acs-modality-online:  #0d6efd;
    --acs-modality-hybrid:  #6f42c1;
    --acs-modality-self:    #20c997;

    --acs-bg:            #f4f6fa;
    --acs-surface:       #ffffff;
    --acs-border:        #e3e7ee;
    --acs-text:          #1d2433;
    --acs-text-muted:    #6c7689;

    --acs-sidebar-w:     272px;
    --acs-topbar-h:      56px;
    /** Scope bar min-height; also used by module CSS for sticky offsets */
    --acs-scope-h:       44px;
    --acs-content-pad-x: 1.25rem;

    /* Bootstrap primary aligns with shell navy */
    --bs-primary: var(--acs-primary);
    --bs-primary-rgb: 31, 78, 121;
}

/* ----- Base ---------------------------------------------------------- */
html, body { height: 100%; }
body {
    background: var(--acs-bg);
    color: var(--acs-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}
a { color: var(--acs-primary); }
a:hover { color: var(--acs-primary-700); }

/* ----- App shell layout --------------------------------------------- */
.acs-app {
    display: grid;
    grid-template-columns: var(--acs-sidebar-w) 1fr;
    grid-template-rows: var(--acs-topbar-h) 1fr;
    grid-template-areas:
        "topbar topbar"
        "sidebar main";
    min-height: 100vh;
    height: 100dvh;
    height: 100vh;
    max-height: 100dvh;
    max-height: 100vh;
}
.acs-topbar  { grid-area: topbar;  }
.acs-sidebar { grid-area: sidebar; }
.acs-main    { grid-area: main; min-width: 0; min-height: 0; }

/* Collapsed sidebar state (toggled via .acs-app--collapsed on root, desktop/tablet) */
.acs-app--collapsed { grid-template-columns: 64px 1fr; }
.acs-app--collapsed .acs-sidebar__group-label,
.acs-app--collapsed .acs-sidebar__label,
.acs-app--collapsed .acs-sidebar__caret { display: none; }
.acs-app--collapsed .acs-sidebar__item { justify-content: center; padding: 10px 0; }
.acs-app--collapsed .acs-sidebar__item .bi { margin-right: 0; }
.acs-app--collapsed .acs-sidebar__sub .acs-sidebar__item {
    padding-left: 0;
    justify-content: center;
    font-size: 1rem;
}
.acs-app--collapsed .acs-sidebar__group[data-acs-group-divider] {
    padding: .35rem 0;
    border-top: 1px solid #1a2c41;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    letter-spacing: 0;
}

/* ----- Topbar ------------------------------------------------------- */
.acs-topbar {
    background: var(--acs-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1040;
    box-shadow: 0 1px 0 rgba(0,0,0,0.15);
    min-height: var(--acs-topbar-h);
}
.acs-topbar__start,
.acs-topbar__end {
    display: flex;
    align-items: center;
    min-width: 0;
}
.acs-topbar__start {
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: .35rem;
    overflow: hidden;
    padding-right: .25rem;
}
.acs-topbar__end {
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: .75rem;
}
.acs-topbar__brand-cluster {
    display: flex;
    align-items: center;
    gap: .35rem;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
}
.acs-topbar__brand {
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-right: 0;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
}
.acs-topbar__brand-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.98);
    padding: 2px;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}
.acs-topbar__brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    line-height: 1.15;
}
@media (min-width: 992px) {
    .acs-topbar__brand-text {
        flex-direction: row;
        align-items: center;
        gap: .5rem;
    }
}
.acs-topbar__brand-primary {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: .95rem;
}
.acs-topbar__brand-secondary {
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .03em;
    color: rgba(255,255,255,.88);
    background: rgba(255,255,255,.12);
    padding: .12rem .45rem;
    border-radius: 999px;
    flex-shrink: 0;
}
.acs-topbar__brand .bi { font-size: 1.25rem; }
.acs-topbar__nav {
    display: flex;
    gap: .25rem;
    flex: 1 1 0;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.acs-topbar__nav::-webkit-scrollbar { display: none; }
.acs-topbar__nav a {
    color: rgba(255,255,255,0.85);
    padding: .35rem .75rem;
    border-radius: .375rem;
    text-decoration: none;
    font-size: .925rem;
    flex-shrink: 0;
    white-space: nowrap;
}
.acs-topbar__nav a:hover, .acs-topbar__nav a.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.acs-topbar__nav a:focus-visible {
    outline: 2px solid var(--acs-accent);
    outline-offset: 2px;
}
.acs-topbar__search { margin: 0; }
.acs-topbar__search .input-group { align-items: stretch; }
.acs-topbar__notify-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.375rem;
    height: 2.375rem;
    padding: 0;
    margin: 0;
    border-radius: .375rem;
    flex-shrink: 0;
}
.acs-topbar__notify-btn .bi { font-size: 1.15rem; line-height: 1; }
.acs-topbar__notify-btn:hover { background: rgba(255, 255, 255, 0.12); }
.acs-topbar__user-trigger {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
}
.acs-topbar__user-trigger:hover {
    box-shadow: inset 0 -2px 0 0 var(--acs-accent);
}
.acs-topbar__user {
    display: flex; align-items: center; gap: .5rem;
    color: #fff;
}
.acs-topbar__sidebar-toggle {
    background: transparent;
    border: 0;
    color: #fff;
    padding: .25rem .5rem;
    margin-right: 0;
    border-radius: .375rem;
    flex-shrink: 0;
}
.acs-topbar__sidebar-toggle:hover { background: rgba(255,255,255,0.15); }
.acs-topbar__sidebar-toggle:focus-visible {
    outline: 2px solid var(--acs-accent);
    outline-offset: 2px;
}

/* ----- Sidebar ------------------------------------------------------ */
.acs-sidebar {
    background: var(--acs-sidebar);
    color: #c8d2dd;
    padding: .5rem 0 1rem;
    border-right: 1px solid #000;
    position: sticky;
    top: var(--acs-topbar-h);
    align-self: start;
    height: calc(100dvh - var(--acs-topbar-h));
    height: calc(100vh - var(--acs-topbar-h));
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 1035;
}
.acs-sidebar__group {
    padding: 1rem 1rem .25rem;
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6f7d8e;
    font-weight: 600;
}
.acs-sidebar__item {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .5rem 1rem;
    color: #c8d2dd;
    text-decoration: none;
    font-size: .925rem;
    border-left: 3px solid transparent;
}
.acs-sidebar__item .bi { font-size: 1rem; width: 1.1em; text-align: center; }
.acs-sidebar__item:hover {
    background: var(--acs-sidebar-hov);
    color: #fff;
}
.acs-sidebar__item--active {
    background: var(--acs-sidebar-act);
    color: #fff;
    border-left-color: var(--acs-accent);
}
.acs-sidebar__sub .acs-sidebar__item { padding-left: 2.5rem; font-size: .875rem; }
.acs-sidebar__caret { margin-left: auto; font-size: .75rem; opacity: .65; }

/* Collapsible category headers */
button.acs-sidebar__group {
    font-family: inherit;
}
.acs-sidebar__group-toggle {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    cursor: pointer;
    color: inherit;
}
.acs-sidebar__group-toggle:hover {
    color: #c8d2dd;
}
.acs-sidebar__group-toggle:focus-visible {
    outline: 2px solid var(--acs-accent);
    outline-offset: -2px;
    border-radius: .25rem;
}
.acs-sidebar__group-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.acs-sidebar__group-caret {
    font-size: .7rem;
    transition: transform .15s ease;
    opacity: .7;
    flex-shrink: 0;
}
.acs-sidebar__group-toggle[aria-expanded="false"] .acs-sidebar__group-caret {
    transform: rotate(-90deg);
}

/* Icon rail: hide header chrome; never hide leaf icons behind collapsed groups */
.acs-app--collapsed .acs-sidebar__group-caret,
.acs-app--collapsed .acs-sidebar__group-text { display: none; }
.acs-app--collapsed .acs-sidebar__sub[hidden] {
    display: block !important;
}

@media (prefers-reduced-motion: reduce) {
    .acs-sidebar__group-caret { transition: none; }
}

.acs-sidebar__group-toggle--locked {
    cursor: default;
    color: #d8e1ec;
}
.acs-sidebar__group-toggle--locked:hover {
    color: #d8e1ec;
}
.acs-sidebar__group-toggle--locked .acs-sidebar__group-caret {
    opacity: 0;
}

/* ----- Scope bar (sticky context summary) --------------------------- */
.acs-scope-bar {
    background: #fff;
    border-bottom: 1px solid var(--acs-border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    row-gap: .35rem;
    padding: .5rem var(--acs-content-pad-x);
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: var(--acs-scope-h);
    font-size: .875rem;
}
.acs-scope-bar__main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .65rem;
    min-width: 0;
    flex: 1 1 auto;
}
.acs-scope-bar__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem .65rem;
    margin-left: auto;
    justify-content: flex-end;
    min-width: 0;
}
@media (max-width: 575.98px) {
    .acs-scope-bar__meta {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
    }
}
.acs-scope-bar__label {
    color: var(--acs-text-muted);
    text-transform: uppercase;
    font-size: .7rem;
    letter-spacing: .08em;
    font-weight: 600;
}
.acs-scope-bar__chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    background: #eef3fb;
    color: var(--acs-primary-700);
    padding: .15rem .55rem;
    border-radius: 999px;
    font-weight: 500;
    max-width: min(40vw, 18ch);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.acs-scope-bar__divider { color: #c0c8d3; flex-shrink: 0; }
.acs-scope-bar .btn-primary:focus-visible {
    box-shadow: 0 0 0 .2rem rgba(221, 107, 32, 0.35);
}

/* ----- Draft Mode banner (Phase 2 sandbox) -------------------------- */
.acs-draft-banner {
    background: repeating-linear-gradient(
        45deg,
        #fff3cd,
        #fff3cd 14px,
        #ffe9a3 14px,
        #ffe9a3 28px
    );
    color: #6b4f0c;
    border-bottom: 1px solid #f0d684;
    padding: .4rem var(--acs-content-pad-x);
    font-size: .85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.acs-draft-banner--combined {
    flex-wrap: wrap;
    align-items: flex-start;
    padding: .55rem var(--acs-content-pad-x);
    font-weight: 500;
}
.acs-draft-banner--combined .fw-semibold {
    font-weight: 600;
}

/* ----- Breadcrumbs -------------------------------------------------- */
.acs-breadcrumbs {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--acs-surface);
    border-bottom: 1px solid var(--acs-border);
    padding: .55rem var(--acs-content-pad-x);
    min-height: 2.25rem;
    font-size: .85rem;
    overflow-x: auto;
    scrollbar-width: thin;
    white-space: nowrap;
}
.acs-breadcrumbs::-webkit-scrollbar { height: 4px; }
.acs-breadcrumbs::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,.15);
    border-radius: 4px;
}
.acs-breadcrumbs ol {
    margin: 0;
    padding: 0;
    list-style: none;
    display: inline-flex;
    flex-wrap: nowrap;
    gap: .35rem;
    align-items: center;
}
.acs-breadcrumbs li { display: inline-flex; align-items: center; gap: .35rem; color: var(--acs-text-muted); }
.acs-breadcrumbs li + li::before { content: "/"; color: #c0c8d3; }
.acs-breadcrumbs a { color: var(--acs-text-muted); text-decoration: none; }
.acs-breadcrumbs a:hover { color: var(--acs-primary); }
.acs-breadcrumbs li.active { color: var(--acs-text); font-weight: 500; }

/* ----- Page container ---------------------------------------------- */
.acs-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100dvh;
    height: 100vh;
    overflow: hidden;
}
/* Page body scrolls inside .acs-main so footer/topbar/sidebar never overlap long module content */
.acs-page {
    padding-block: 1.25rem 2rem;
    padding-inline: max(var(--acs-content-pad-x), calc((100% - 1400px) / 2));
    width: auto;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}
.acs-page--full {
    --acs-content-pad-x: .5rem;
    padding-block: 0.75rem 1rem;
    padding-inline: var(--acs-content-pad-x);
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
}

/* Footer sits below scrollable page region; pinned to viewport bottom of main column */
.acs-footer {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: var(--acs-surface);
    border-top: 1px solid var(--acs-border);
    padding-block: .55rem;
    padding-inline: var(--acs-content-pad-x);
}
.acs-page__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}
.acs-page__title { margin: 0; font-size: 1.5rem; font-weight: 600; }
.acs-page__subtitle { color: var(--acs-text-muted); margin-top: .25rem; font-size: .95rem; }
.acs-page__actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ----- Cards & status badges --------------------------------------- */
.acs-card {
    background: var(--acs-surface);
    border: 1px solid var(--acs-border);
    border-radius: .65rem;
    box-shadow: 0 1px 0 rgba(20,30,50,.03);
}
.acs-card__body { padding: 1.1rem 1.25rem; }

.acs-status {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .15rem .55rem; border-radius: 999px;
    font-size: .75rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em;
}
.acs-status::before {
    content: ""; display: inline-block;
    width: .55rem; height: .55rem; border-radius: 50%;
    background: currentColor;
}
.acs-status--draft     { background:#eef0f3; color: var(--acs-status-draft); }
.acs-status--active    { background:#e6f4ec; color: var(--acs-status-active); }
.acs-status--committed { background:#e3edfd; color: var(--acs-status-committed); }
.acs-status--published { background:#efe7f9; color: var(--acs-status-published); }
.acs-status--conflict  { background:#fbe5e8; color: var(--acs-status-conflict); }
.acs-status--warning   { background:#fff7df; color: #8a6100; }

/* ----- Phase strip cards ------------------------------------------- */
.acs-phase-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}
.acs-phase-card {
    border-left: 4px solid var(--acs-primary);
    transition: box-shadow .15s ease, transform .15s ease;
    position: relative;
    overflow: hidden;
}
.acs-phase-card:hover {
    box-shadow: 0 4px 14px rgba(20, 40, 80, 0.08);
    transform: translateY(-1px);
}
.acs-phase-card--locked { opacity: .55; }
.acs-phase-card__phase {
    font-size: .7rem; text-transform: uppercase; letter-spacing: .08em;
    font-weight: 700; color: var(--acs-text-muted);
}
.acs-phase-card__title { font-size: 1.05rem; font-weight: 600; margin: .25rem 0; }
.acs-phase-card__desc  { color: var(--acs-text-muted); font-size: .875rem; min-height: 2.5em; }

/* Phase-specific accents */
.acs-phase-card--prerequisite { border-left-color: #6c757d; }
.acs-phase-card--phase1       { border-left-color: var(--acs-primary); }
.acs-phase-card--phase2       { border-left-color: var(--acs-status-warning); }
.acs-phase-card--phase3       { border-left-color: #0dcaf0; }
.acs-phase-card--phase4       { border-left-color: var(--acs-status-active); }

/* ----- Modality colour tokens (Phase 3/4 calendar previews) -------- */
.acs-modality-f2f    { background: var(--acs-modality-f2f);    color:#fff; }
.acs-modality-online { background: var(--acs-modality-online); color:#fff; }
.acs-modality-hybrid { background: var(--acs-modality-hybrid); color:#fff; }
.acs-modality-self   { background: var(--acs-modality-self);   color:#fff; }

/* ----- Filter chips ------------------------------------------------ */
.acs-chip {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .25rem .65rem;
    border: 1px solid var(--acs-border);
    border-radius: 999px;
    background: #fff;
    font-size: .825rem;
    color: var(--acs-text);
}
.acs-chip__close {
    border: 0; background: transparent;
    color: var(--acs-text-muted); cursor: pointer;
    padding: 0; line-height: 1;
}
.acs-chip__close:hover { color: var(--acs-status-conflict); }

/* ----- Wizard stepper --------------------------------------------- */
.acs-stepper { display: flex; gap: 0; align-items: stretch; margin-bottom: 1.25rem; }
.acs-stepper__step {
    flex: 1 1 0;
    display: flex; align-items: center; gap: .65rem;
    padding: .65rem 1rem;
    background: #fff;
    border: 1px solid var(--acs-border);
    color: var(--acs-text-muted);
    position: relative;
}
.acs-stepper__step + .acs-stepper__step { border-left: 0; }
.acs-stepper__step:first-child { border-radius: .5rem 0 0 .5rem; }
.acs-stepper__step:last-child  { border-radius: 0 .5rem .5rem 0; }
.acs-stepper__num {
    width: 1.75rem; height: 1.75rem; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e9edf3; color: var(--acs-text-muted);
    font-weight: 600; font-size: .9rem;
}
.acs-stepper__step--active { color: var(--acs-text); background: #f1f6fd; border-color: var(--acs-primary-300); }
.acs-stepper__step--active .acs-stepper__num { background: var(--acs-primary); color: #fff; }
.acs-stepper__step--done { color: var(--acs-status-active); }
.acs-stepper__step--done .acs-stepper__num { background: var(--acs-status-active); color: #fff; }

/* ----- Tri-state cell --------------------------------------------- */
.acs-tri {
    width: 36px; height: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--acs-border);
    border-radius: .35rem; cursor: pointer;
    color: transparent;
    user-select: none;
}
.acs-tri--primary   { background: #198754; color: #fff; }
.acs-tri--secondary { background: #b7e4c7; color: #176b3a; }
.acs-tri--none      { background: #fff; }

/* ----- Smart drop zone --------------------------------------------- */
.acs-drop-valid {
    background: rgba(25,135,84,.12);
    border: 1px dashed var(--acs-status-active);
}
.acs-drop-invalid {
    background: rgba(220,53,69,.10);
    border: 1px dashed var(--acs-status-conflict);
}

/* ----- Delta gap bar ---------------------------------------------- */
.acs-delta {
    background: #f0f2f6;
    border-radius: 999px;
    height: 18px;
    position: relative;
    overflow: hidden;
}
.acs-delta__actual {
    background: linear-gradient(90deg, var(--acs-status-conflict), #f08597);
    height: 100%;
    position: absolute; left: 0; top: 0;
}
.acs-delta__mediated {
    background: linear-gradient(90deg, var(--acs-status-active), #6cd39d);
    height: 100%;
    position: absolute; left: 0; top: 0;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}
.acs-delta__legend {
    display: flex; gap: 1rem;
    font-size: .8rem; color: var(--acs-text-muted);
    margin-top: .35rem;
}
.acs-delta__dot {
    display: inline-block; width: .65rem; height: .65rem; border-radius: 50%;
    margin-right: .25rem; vertical-align: middle;
}
.acs-delta__dot--actual    { background: var(--acs-status-conflict); }
.acs-delta__dot--mediated  { background: var(--acs-status-active); }

/* ----- Audit timeline -------------------------------------------- */
.acs-timeline { list-style: none; padding: 0; margin: 0; }
.acs-timeline__item {
    border-left: 2px solid var(--acs-border);
    padding: 0 0 1rem 1rem;
    position: relative;
}
.acs-timeline__item::before {
    content: ""; position: absolute; left: -7px; top: 4px;
    width: 12px; height: 12px; background: var(--acs-primary);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--acs-border);
}
.acs-timeline__time { font-size: .75rem; color: var(--acs-text-muted); }
.acs-timeline__title { font-weight: 600; font-size: .9rem; }

/* ----- Toast container -------------------------------------------- */
.acs-toast-container {
    position: fixed;
    top: calc(var(--acs-topbar-h) + 12px);
    right: 16px;
    z-index: 1090;
    display: flex; flex-direction: column; gap: .5rem;
    max-width: 360px;
}

/* ----- Empty state ------------------------------------------------ */
.acs-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--acs-text-muted);
}
.acs-empty .bi { font-size: 2.5rem; opacity: .35; display: block; margin-bottom: .5rem; }

/* ----- Login screen ---------------------------------------------- */
.acs-login {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--acs-primary) 0%, var(--acs-accent) 100%);
    display: flex; align-items: center; justify-content: center;
    padding: 2rem 1rem;
}
.acs-login__card {
    width: 100%; max-width: 460px;
    background: #fff; border-radius: 1rem;
    box-shadow: 0 20px 50px rgba(15,30,60,.25);
    overflow: hidden;
}
.acs-login__head {
    background: var(--acs-primary);
    color: #fff;
    padding: 1.25rem 1.5rem;
}
.acs-login__head h1 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.acs-login__body { padding: 1.5rem; }
.acs-login__demo-pill {
    display: inline-block;
    background: #fff3cd; color: #6b4f0c;
    padding: .15rem .55rem; border-radius: 999px;
    font-size: .7rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase;
    margin-bottom: .75rem;
}

/* ----- Misc -------------------------------------------------------- */
.acs-kbd {
    background: #f0f2f6;
    border: 1px solid var(--acs-border);
    padding: .05rem .35rem;
    border-radius: .25rem;
    font-size: .75rem;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ----- Card header (used across Phase 1 modules) ------------------ */
.acs-card__header {
    padding: .75rem 1.1rem;
    border-bottom: 1px solid var(--acs-border);
    background: #fafbfd;
    border-top-left-radius: .65rem;
    border-top-right-radius: .65rem;
    font-weight: 600;
    color: var(--acs-text);
    font-size: .95rem;
}

/* ----- Avatar (used in owner pickers, faculty roll, etc.) --------- */
.acs-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: var(--acs-primary);
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: .9rem;
    flex-shrink: 0;
}
.acs-avatar--sm { width: 1.75rem; height: 1.75rem; font-size: .75rem; }
.acs-avatar--lg { width: 3rem; height: 3rem; font-size: 1.1rem; }

/* ----- Dual multi-select component -------------------------------- */
.acs-dms__grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: stretch;
}
.acs-dms__col {
    display: flex; flex-direction: column;
    gap: .35rem;
    min-width: 0;
}
.acs-dms__head {
    display: flex; align-items: center; justify-content: space-between;
    font-size: .85rem;
}
.acs-dms__select {
    flex: 1 1 auto;
    min-height: 200px;
    font-size: .9rem;
}
.acs-dms__select option:hover {
    background: rgba(31, 78, 121, 0.08);
}
.acs-dms__buttons {
    display: flex; flex-direction: column;
    justify-content: center; gap: .35rem;
    align-self: center;
}
.acs-dms.is-invalid .acs-dms__select { border-color: var(--bs-danger); }
@media (max-width: 768px) {
    .acs-dms__grid {
        grid-template-columns: 1fr;
    }
    .acs-dms__buttons { flex-direction: row; justify-content: center; }
}

/* ----- HRIS / read-only banner used by Phase 1 modules ------------ */
.acs-banner {
    display: flex; align-items: flex-start; gap: .75rem;
    padding: .75rem 1rem;
    border-radius: .5rem;
    border: 1px solid;
    margin-bottom: 1rem;
}
.acs-banner i { font-size: 1.25rem; line-height: 1.1; }
.acs-banner--warning { background: #fff8e1; border-color: #ffe082; color: #6b4f0c; }
.acs-banner--info    { background: #e7f3ff; border-color: #9ec5fe; color: #084298; }
.acs-banner--success { background: #d1e7dd; border-color: #a3cfbb; color: #0f5132; }

@media (max-width: 575.98px) {
    :root {
        --acs-content-pad-x: 0.75rem;
    }
}

/* Mobile: sidebar off-canvas drawer (burger opens .acs-app--mobile-open) */
@media (max-width: 767.98px) {
    .acs-app {
        grid-template-columns: 0 minmax(0, 1fr);
    }
    .acs-sidebar {
        position: fixed;
        left: 0;
        top: var(--acs-topbar-h);
        width: min(280px, 86vw);
        height: calc(100dvh - var(--acs-topbar-h));
        height: calc(100vh - var(--acs-topbar-h));
        transform: translateX(-100%);
        transition: transform 0.22s ease;
        z-index: 1045;
        align-self: stretch;
        overscroll-behavior: contain;
    }
    .acs-app--mobile-open .acs-sidebar {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25);
    }
}

.acs-app__backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 30, 50, 0.45);
    z-index: 1034;
}
.acs-app--mobile-open .acs-app__backdrop {
    display: block;
}

body.acs-app--locked {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
    .acs-sidebar {
        transition: none;
    }
}

/* --- Scheduling Scope dashboard (scoped; list page only) --- */
.scope-dashboard .scope-kpi__tile {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.65rem 0.85rem;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.scope-dashboard a.scope-kpi__tile:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px rgba(15, 36, 54, 0.06);
}
.scope-dashboard .scope-kpi__tile.is-active {
    border-color: var(--acs-primary-300);
    background: #f1f6fc;
}
.scope-dashboard .scope-kpi__label {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--acs-text-muted);
}
.scope-dashboard .scope-kpi__value {
    font-size: 1.3rem;
    font-weight: 600;
}
.scope-dashboard .scope-kpi__dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.4rem;
    vertical-align: middle;
}
.scope-dashboard .scope-kpi__dot--muted {
    background: #94a3b8;
}
.scope-dashboard .scope-kpi__dot--active {
    background: var(--acs-status-active, #198754);
}
.scope-dashboard .scope-kpi__dot--draft {
    background: #64748b;
}
.scope-dashboard .scope-kpi__dot--locked {
    background: var(--acs-status-committed, #0d6efd);
}
.scope-dashboard .scope-kpi__dot--archived {
    background: #adb5bd;
}

.scope-dashboard .scope-active-card {
    border-left: 4px solid var(--acs-status-active, #198754);
    background: linear-gradient(180deg, rgba(25, 135, 84, 0.05), #fff 60%);
}
.scope-dashboard .scope-active-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}
.scope-dashboard .scope-active-card__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--acs-status-active, #198754);
    background: rgba(25, 135, 84, 0.12);
}
.scope-dashboard .scope-active-card__actions {
    margin-left: auto;
    display: inline-flex;
    gap: 0.35rem;
}
.scope-dashboard .scope-active-card__title {
    line-height: 1.25;
}
.scope-dashboard .scope-active-card__chips .acs-chip {
    background: #fff;
}
.scope-dashboard .scope-active-card__range .scope-range--lg {
    height: 6px;
    max-width: none;
    margin-top: 0;
}
.scope-dashboard .scope-active-card__pulse {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--acs-status-active, #198754);
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.18);
    flex-shrink: 0;
    animation: scopeActivePulse 2.4s ease-in-out infinite;
}
@keyframes scopeActivePulse {
    0%,
    100% {
        box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.18);
    }
    50% {
        box-shadow: 0 0 0 0.35rem rgba(25, 135, 84, 0.05);
    }
}
@media (max-width: 575.98px) {
    .scope-dashboard .scope-active-card__actions {
        width: 100%;
        margin-left: 0;
    }
}

.scope-dashboard .scope-toolbar .form-select-sm,
.scope-dashboard .scope-toolbar .form-control {
    background: #fff;
}
.scope-dashboard .scope-row td {
    vertical-align: middle;
}
.scope-dashboard .scope-row--active td {
    background: rgba(25, 135, 84, 0.07);
    box-shadow: none;
    border-top: 1px solid rgba(25, 135, 84, 0.25);
}
.scope-dashboard .scope-row--active td:first-child {
    box-shadow: inset 4px 0 0 var(--acs-status-active, #198754);
}
.scope-dashboard .scope-row--active:hover td {
    background: rgba(25, 135, 84, 0.12);
}
.scope-dashboard .scope-row--active .scope-row__name .fw-semibold {
    color: var(--acs-text, #1f2937);
}
.scope-dashboard .scope-row--active .scope-row__name > div:first-child {
    flex-wrap: wrap;
}
.scope-dashboard .scope-row--active .scope-range__fill {
    background: var(--acs-status-active, #198754);
    opacity: 0.55;
}
.scope-dashboard .scope-row__active-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--acs-status-active, #198754);
    background: rgba(25, 135, 84, 0.12);
    border: 1px solid rgba(25, 135, 84, 0.25);
    line-height: 1.1;
}
.scope-dashboard .scope-row--active .scope-row__active-pill {
    margin-left: auto;
}
@media (max-width: 767.98px) {
    .scope-dashboard .scope-row--active .scope-row__active-pill {
        margin-left: 0;
    }
}
.scope-dashboard .scope-row--archived td {
    color: var(--acs-text-muted);
}
.scope-dashboard .scope-range {
    display: block;
    height: 3px;
    border-radius: 99px;
    background: #e9edf3;
    position: relative;
    max-width: 120px;
    margin-top: 0.25rem;
}
.scope-dashboard .scope-range__fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--acs-primary-300);
    border-radius: 99px;
}
.scope-dashboard .scope-range__pin {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--acs-accent);
    transform: translateX(-50%);
}
.scope-dashboard .scope-owner-avatar {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    background: #e3edfd;
    color: var(--acs-status-committed);
    margin-right: 0.4rem;
    flex-shrink: 0;
}
.scope-dashboard .acs-status--archived {
    background: #eef0f3;
    color: var(--acs-text-muted);
}
.scope-dashboard .scope-active-filters .acs-chip {
    background: #f4f6fa;
}
.scope-dashboard .scope-status-cell .acs-status {
    white-space: nowrap;
}
.scope-dashboard .btn-icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.scope-dashboard .scope-sort-link .opacity-25 {
    opacity: 0.35;
}

/* --- Scheduling Scope form wizard (scoped) --- */
.scope-wizard .scope-wizard__steps {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin: 0 0 1rem;
    padding: 0;
    list-style: none;
}
.scope-wizard .scope-wizard__step {
    flex: 1 1 0;
    min-width: 9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 0.5rem;
    background: #f4f6fa;
    color: var(--acs-text-muted);
    cursor: not-allowed;
    border: 1px solid transparent;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.scope-wizard .scope-wizard__step.is-clickable {
    cursor: pointer;
}
.scope-wizard .scope-wizard__step.is-clickable:hover {
    background: #eef2f8;
}
.scope-wizard .scope-wizard__step.is-current {
    background: #e9f0fb;
    color: var(--acs-primary);
    box-shadow: inset 3px 0 0 var(--acs-primary);
    border-color: rgba(31, 78, 121, 0.15);
}
.scope-wizard .scope-wizard__step.is-done {
    background: #e8f5ee;
    color: #0f7a3a;
}
.scope-wizard .scope-wizard__step.is-disabled {
    opacity: 0.55;
}
.scope-wizard .scope-wizard__step .scope-wizard__num {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    background: #fff;
    flex-shrink: 0;
}
.scope-wizard .scope-wizard__pane[hidden] {
    display: none !important;
}
.scope-wizard .scope-wizard__pane--postform[hidden] {
    display: none !important;
}
.scope-wizard .scope-wizard__footer {
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--bs-border-color);
}
.scope-wizard .scope-wizard__review-tile {
    padding: 0.85rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 0.5rem;
    background: #fff;
}
.scope-wizard .scope-wizard__review-tile .acs-chip {
    background: #f4f6fa;
}
.scope-wizard .scope-range {
    display: block;
    height: 3px;
    border-radius: 99px;
    background: #e9edf3;
    position: relative;
    max-width: 220px;
    margin-top: 0.35rem;
}
.scope-wizard .scope-range__fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--acs-primary-300);
    border-radius: 99px;
}
.scope-wizard .scope-range__pin {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 2px;
    background: var(--acs-accent);
    transform: translateX(-50%);
}
@media (max-width: 720px) {
    .scope-wizard .scope-wizard__step {
        min-width: 0;
    }
    .scope-wizard .scope-wizard__step .label {
        display: none;
    }
}

/* Scope wizard — PCD bulk tools & grid matrix */
.scope-wizard .scope-pcd-tools .form-label {
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.scope-wizard .scope-pcd-grid {
    max-height: 70vh;
    overflow: auto;
}
.scope-wizard .scope-pcd-grid .scope-pcd-grid__sticky {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
}
.scope-wizard .scope-pcd-grid thead tr:first-child th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #f4f6fa;
}
.scope-wizard .scope-pcd-grid thead tr:nth-child(2) th {
    position: sticky;
    top: 2.35rem;
    z-index: 2;
    background: #eceef3;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.scope-wizard .scope-pcd-grid thead th.scope-pcd-grid__sticky {
    z-index: 4;
}
.scope-wizard .scope-pcd-grid input[type="date"] {
    min-width: 9rem;
}
.scope-wizard .scope-pcd-grid td.is-disabled {
    background: #f8f9fb;
}
.scope-wizard .scope-pcd-flash {
    outline: 2px solid var(--acs-accent, #dd6b20);
    outline-offset: 1px;
}
