/*
 * Styling for the global data-scope UI injected via panel render hooks
 * (institution switcher + semester/exam_type/campus filter bar).
 *
 * Self-contained on purpose: the panel loads only Filament's compiled CSS (which
 * ships just the utilities Filament itself uses) and there is no app Vite build,
 * so these components cannot rely on Tailwind utility classes.
 */

/* ---- Filter bar (PAGE_START) ---- */
.esi-scope {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.75rem 1.25rem;
    margin-bottom: -0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgb(203 213 225);
    border-radius: 0.75rem;
    background: rgba(241, 245, 249, 0.9);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
}

.dark .esi-scope {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.08);
}

.esi-scope__title {
    padding-bottom: 0.55rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgb(156 163 175);
}

.esi-field {
    display: flex;
    flex-direction: column;
    min-width: 10rem;
}

.esi-field__label {
    margin-bottom: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: rgb(107 114 128);
}

.dark .esi-field__label {
    color: rgb(156 163 175);
}

.esi-field__req {
    color: rgb(239 68 68);
}

/* ---- The styled native <select> (chevron drawn as a background) ---- */
.esi-select {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(17 24 39);
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem 1rem;
    border: 1px solid rgb(209 213 219);
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.esi-select:hover {
    border-color: rgb(156 163 175);
}

.esi-select:focus {
    outline: none;
    border-color: var(--primary-500, #6366f1);
    box-shadow: 0 0 0 1px var(--primary-500, #6366f1);
}

.dark .esi-select {
    color: rgb(243 244 246);
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

/* ---- Dashboard welcome hero ---- */

/* The hero owns its full surface, so strip the shared widget glass from its
   wrapper (otherwise we get a doubled border/shadow). */
.fi-wi-widget.esi-hero-wi {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

.esi-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem 2rem;
    padding: 1.5rem 1.75rem;
    border-radius: var(--lg-radius, 18px);
    color: #0f172a;
    /* A brighter, more opaque frosted surface + a colour sheen and elevation, so
       the hero reads as a distinct card against the tinted page backdrop. */
    background:
        radial-gradient(120% 150% at 0% 0%, rgba(99, 102, 241, 0.28), transparent 60%),
        radial-gradient(120% 150% at 100% 100%, rgba(217, 70, 239, 0.22), transparent 60%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 249, 255, 0.82) 100%);
    -webkit-backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
    backdrop-filter: blur(var(--lg-blur, 22px)) saturate(var(--lg-saturate, 180%));
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 14px 36px -16px rgba(79, 70, 229, 0.4);
}

.dark .esi-hero {
    color: #e5e7eb;
    background:
        radial-gradient(120% 150% at 0% 0%, rgba(129, 140, 248, 0.32), transparent 60%),
        radial-gradient(120% 150% at 100% 100%, rgba(232, 121, 249, 0.24), transparent 60%),
        linear-gradient(135deg, rgba(40, 44, 62, 0.95) 0%, rgba(28, 31, 44, 0.82) 100%);
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 14px 36px -16px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.09);
}

.esi-hero__id {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.esi-hero__avatar {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #a855f7 100%);
    box-shadow: 0 8px 18px -8px rgba(99, 102, 241, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.esi-hero__eyebrow {
    margin-bottom: 0.1rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.55;
}

.esi-hero__title {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.15;
}

.esi-hero__email {
    margin-top: 0.1rem;
    font-size: 0.85rem;
    opacity: 0.65;
}

.esi-hero__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
}

.esi-hero__tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.7rem;
    font-size: 0.76rem;
    font-weight: 600;
    border-radius: 999px;
    color: #4338ca;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.dark .esi-hero__tag {
    color: #c7d2fe;
    background: rgba(129, 140, 248, 0.16);
    border-color: rgba(129, 140, 248, 0.3);
}

.esi-hero__tag svg {
    width: 0.9rem;
    height: 0.9rem;
}

.esi-hero__tag--inst {
    color: #6d28d9;
    background: rgba(168, 85, 247, 0.12);
    border-color: rgba(168, 85, 247, 0.28);
}

.dark .esi-hero__tag--inst {
    color: #ddd6fe;
    background: rgba(192, 132, 252, 0.16);
    border-color: rgba(192, 132, 252, 0.3);
}

/* Term switcher (right side of the hero) */
.esi-hero__term {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 14rem;
}

.esi-hero__term-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.55;
}

.esi-hero__term-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.esi-hero__term-controls .esi-select {
    width: auto;
    min-width: 7rem;
    font-weight: 600;
}

/* ---- Master schedule matrix ---- */
.esi-ms-none {
    color: rgb(100 116 139);
    font-size: 0.9rem;
}

.esi-ms-caption {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1rem;
    padding: 0.35rem 0.85rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #4338ca;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.dark .esi-ms-caption {
    color: #c7d2fe;
    background: rgba(129, 140, 248, 0.14);
    border-color: rgba(129, 140, 248, 0.28);
}

.esi-ms-caption svg {
    width: 1rem;
    height: 1rem;
}

.esi-ms-wrap {
    overflow: auto;
    max-height: calc(100vh - 16rem);
    border-radius: var(--lg-radius, 18px);
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: var(--lg-surface-strong, rgba(255, 255, 255, 0.8));
    -webkit-backdrop-filter: blur(var(--lg-blur, 22px));
    backdrop-filter: blur(var(--lg-blur, 22px));
    box-shadow: var(--lg-shadow, 0 8px 32px rgba(31, 38, 135, 0.12));
}

.esi-ms-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.875rem;
}

.esi-ms-table td {
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    padding: 0.55rem 0.75rem;
    vertical-align: top;
}

/* Header row: slot columns */
.esi-ms-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0.7rem 0.85rem;
    text-align: center;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: #3730a3;
    background: linear-gradient(180deg, rgba(238, 240, 255, 0.96), rgba(232, 234, 252, 0.96));
    border-bottom: 1px solid rgba(99, 102, 241, 0.28);
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    white-space: nowrap;
}

.dark .esi-ms-table thead th {
    color: #c7d2fe;
    background: linear-gradient(180deg, rgba(49, 46, 129, 0.55), rgba(38, 38, 64, 0.6));
    border-bottom-color: rgba(129, 140, 248, 0.4);
}

/* Room column (sticky left) */
.esi-ms-room-h,
.esi-ms-room {
    position: sticky;
    left: 0;
    text-align: left;
    width: 10.5rem;
    min-width: 10.5rem;
    max-width: 10.5rem;
}

.esi-ms-table thead th.esi-ms-room-h {
    z-index: 3;
}

.esi-ms-room {
    z-index: 1;
    background: rgba(249, 250, 253, 0.96);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(148, 163, 184, 0.3);
}

.dark .esi-ms-room {
    background: rgba(26, 29, 42, 0.96);
}

.esi-ms-room-name {
    font-weight: 700;
    line-height: 1.2;
}

.esi-ms-room-cap {
    display: inline-block;
    margin-top: 0.3rem;
    padding: 0.05rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    color: rgb(71 85 105);
    background: rgba(148, 163, 184, 0.18);
}

.dark .esi-ms-room-cap {
    color: rgb(203 213 225);
    background: rgba(148, 163, 184, 0.2);
}

/* Zebra + hover */
.esi-ms-table tbody tr:nth-child(even) td {
    background-color: rgba(148, 163, 184, 0.05);
}

.esi-ms-table tbody tr:hover td {
    background-color: rgba(99, 102, 241, 0.07);
}

.esi-ms-table tbody tr:hover .esi-ms-room {
    background: rgba(238, 240, 255, 0.98);
}

.dark .esi-ms-table tbody tr:hover .esi-ms-room {
    background: rgba(49, 46, 129, 0.5);
}

/* Course chips inside each cell */
.esi-ms-cell {
    min-width: 17rem;
}

.esi-ms-chip {
    --esi-c: #6366f1;
    --esi-c-ink: #4338ca;
    margin-bottom: 0.4rem;
    padding: 0.4rem 0.55rem;
    border-radius: 10px;
    /* Fallback first, then a subtle tint of the course's accent colour. */
    background: rgba(148, 163, 184, 0.06);
    background: color-mix(in srgb, var(--esi-c) 8%, transparent);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-left: 3px solid var(--esi-c);
}

.esi-ms-chip:last-child {
    margin-bottom: 0;
}

/* A small, stable palette — each course keeps its colour across the grid. */
.esi-ms-chip--c0 { --esi-c: #6366f1; --esi-c-ink: #4338ca; } /* indigo  */
.esi-ms-chip--c1 { --esi-c: #10b981; --esi-c-ink: #047857; } /* emerald */
.esi-ms-chip--c2 { --esi-c: #f59e0b; --esi-c-ink: #b45309; } /* amber   */
.esi-ms-chip--c3 { --esi-c: #ec4899; --esi-c-ink: #be185d; } /* pink    */
.esi-ms-chip--c4 { --esi-c: #0ea5e9; --esi-c-ink: #0369a1; } /* sky     */
.esi-ms-chip--c5 { --esi-c: #8b5cf6; --esi-c-ink: #6d28d9; } /* violet  */

.esi-ms-chip-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.esi-ms-chip-code {
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #4338ca;
    color: var(--esi-c-ink);
}

.dark .esi-ms-chip-code {
    color: color-mix(in srgb, var(--esi-c) 55%, white);
}

.esi-ms-chip-sec {
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 600;
    color: rgb(71 85 105);
    background: rgba(148, 163, 184, 0.2);
    white-space: nowrap;
}

.dark .esi-ms-chip-sec {
    color: rgb(203 213 225);
}

.esi-ms-chip-count {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: auto;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    background: var(--esi-c, #6366f1);
    white-space: nowrap;
}

.esi-ms-chip-count svg {
    width: 0.8rem;
    height: 0.8rem;
    opacity: 0.9;
}

.esi-ms-chip-name {
    margin-top: 0.25rem;
    font-size: 0.76rem;
    line-height: 1.3;
    color: rgb(71 85 105);
}

.dark .esi-ms-chip-name {
    color: rgb(148 163 184);
}

.esi-ms-empty {
    opacity: 0.25;
}

/* ---- Summary by date report ---- */
.esi-sbd-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.esi-sbd-search {
    position: relative;
    flex: 1 1 22rem;
    max-width: 30rem;
}

.esi-sbd-search svg {
    position: absolute;
    left: 0.7rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    color: rgb(148 163 184);
    pointer-events: none;
}

.esi-sbd-search-input {
    width: 100%;
    padding: 0.55rem 0.75rem 0.55rem 2.2rem;
    font-size: 0.875rem;
    color: rgb(17 24 39);
    background: #fff;
    border: 1px solid rgb(209 213 219);
    border-radius: 0.6rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    outline: none;
}

.esi-sbd-search-input:focus {
    border-color: var(--primary-500, #6366f1);
    box-shadow: 0 0 0 1px var(--primary-500, #6366f1);
}

.dark .esi-sbd-search-input {
    color: rgb(243 244 246);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.esi-sbd-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgb(100 116 139);
    white-space: nowrap;
}

/* Report-specific room filter (Students By Venue) */
.esi-sbd-roomfilter {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.esi-sbd-roomfilter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgb(100 116 139);
}

.esi-sbd-roomfilter-select {
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: rgb(17 24 39);
    background: #fff;
    border: 1px solid rgb(209 213 219);
    border-radius: 0.6rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    outline: none;
    max-width: 18rem;
}

.esi-sbd-roomfilter-select:focus {
    border-color: var(--primary-500, #6366f1);
    box-shadow: 0 0 0 1px var(--primary-500, #6366f1);
}

.dark .esi-sbd-roomfilter-select {
    color: rgb(243 244 246);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.dark .esi-sbd-roomfilter-select option {
    color: rgb(17 24 39);
}

.esi-sbd-wrap {
    overflow: auto;
    max-height: calc(100vh - 18rem);
    border-radius: var(--lg-radius, 18px);
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: var(--lg-surface-strong, rgba(255, 255, 255, 0.8));
    -webkit-backdrop-filter: blur(var(--lg-blur, 22px));
    backdrop-filter: blur(var(--lg-blur, 22px));
    box-shadow: var(--lg-shadow, 0 8px 32px rgba(31, 38, 135, 0.12));
}

.esi-sbd-table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.85rem;
}

.esi-sbd-table th,
.esi-sbd-table td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    vertical-align: top;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.esi-sbd-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    font-weight: 700;
    color: #3730a3;
    background: linear-gradient(180deg, rgba(238, 240, 255, 0.97), rgba(232, 234, 252, 0.97));
    border-bottom: 1px solid rgba(99, 102, 241, 0.28);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.dark .esi-sbd-table thead th {
    color: #c7d2fe;
    background: linear-gradient(180deg, rgba(49, 46, 129, 0.55), rgba(38, 38, 64, 0.6));
    border-bottom-color: rgba(129, 140, 248, 0.4);
}

/* Column widths + alignment (mirrors the source report) */
.esi-sbd-c-date { width: 13%; text-align: center; }
.esi-sbd-c-time { width: 13%; text-align: center; }
.esi-sbd-c-code { width: 11%; text-align: left; }
.esi-sbd-c-name { width: 27%; text-align: left; }
.esi-sbd-c-dur { width: 10%; text-align: center; }
.esi-sbd-c-venue { width: 16%; text-align: center; }
.esi-sbd-c-cand { width: 10%; text-align: center; }

.esi-sbd-table tbody tr:hover td {
    background-color: rgba(99, 102, 241, 0.05);
}

.esi-sbd-date-main {
    font-weight: 700;
}

.esi-sbd-date-day {
    font-size: 0.74rem;
    opacity: 0.6;
}

td.esi-sbd-c-time {
    font-weight: 600;
}

td.esi-sbd-c-code {
    font-weight: 700;
    color: #4338ca;
}

.dark td.esi-sbd-c-code {
    color: #c7d2fe;
}

.esi-sbd-remark {
    color: rgb(100 116 139);
}

td.esi-sbd-c-cand {
    font-weight: 600;
}

/* Group subtotal row */
.esi-sbd-sub td {
    padding: 0.45rem 0.9rem;
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(99, 102, 241, 0.22);
    border-top: 1px solid rgba(99, 102, 241, 0.22);
}

.dark .esi-sbd-sub td {
    background: rgba(129, 140, 248, 0.14);
}

.esi-sbd-sub-text {
    display: block;
    text-align: right;
    font-weight: 700;
    color: #3730a3;
}

.dark .esi-sbd-sub-text {
    color: #c7d2fe;
}

.esi-sbd-sub-total {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.05rem 0.6rem;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* ---- By venue: reuses .esi-sbd-* table; 7 columns, Venue first ---- */
.esi-bv-c-venue { width: 15%; text-align: center; }
.esi-bv-c-date { width: 15%; text-align: center; }
.esi-bv-c-time { width: 15%; text-align: center; }
.esi-bv-c-code { width: 10%; text-align: left; }
.esi-bv-c-name { width: 25%; text-align: left; }
.esi-bv-c-dur { width: 10%; text-align: center; }
.esi-bv-c-cand { width: 10%; text-align: center; }

td.esi-bv-c-venue { font-weight: 700; }
td.esi-bv-c-time { font-weight: 600; }

td.esi-bv-c-code {
    font-weight: 700;
    color: #4338ca;
}

.dark td.esi-bv-c-code {
    color: #c7d2fe;
}

td.esi-bv-c-cand { font-weight: 600; }

/* ---- By course: reuses .esi-sbd-* table; 9 columns incl. Subgroup + Seat Range ---- */
.esi-bc-c-code { width: 10%; text-align: left; }
.esi-bc-c-name { width: 24%; text-align: left; }
.esi-bc-c-sub { width: 6%; text-align: center; }
.esi-bc-c-date { width: 11%; text-align: center; }
.esi-bc-c-time { width: 13%; text-align: center; }
.esi-bc-c-dur { width: 9%; text-align: center; }
.esi-bc-c-venue { width: 14%; text-align: center; }
.esi-bc-c-cand { width: 6%; text-align: center; }
.esi-bc-c-seat { width: 7%; text-align: center; }

td.esi-bc-c-code {
    font-weight: 700;
    color: #4338ca;
}

.dark td.esi-bc-c-code {
    color: #c7d2fe;
}

td.esi-bc-c-sub { font-weight: 600; }
td.esi-bc-c-cand { font-weight: 600; }

/* ---- Invigilator schedule: reuses .esi-sbd-* table; 7 columns ---- */
.esi-iv-c-id { width: 13%; text-align: left; }
.esi-iv-c-name { width: 22%; text-align: left; }
.esi-iv-c-date { width: 12%; text-align: center; }
.esi-iv-c-time { width: 15%; text-align: center; }
.esi-iv-c-dur { width: 10%; text-align: center; }
.esi-iv-c-venue { width: 15%; text-align: center; }
.esi-iv-c-pos { width: 13%; text-align: left; }

td.esi-iv-c-id {
    font-weight: 700;
    color: #4338ca;
}

.dark td.esi-iv-c-id {
    color: #c7d2fe;
}

/* ---- Invigilator by venue: reuses .esi-sbd-* table; 7 columns ---- */
.esi-ivv-c-venue { width: 15%; text-align: center; }
.esi-ivv-c-date { width: 12%; text-align: center; }
.esi-ivv-c-time { width: 15%; text-align: center; }
.esi-ivv-c-id { width: 15%; text-align: left; }
.esi-ivv-c-name { width: 20%; text-align: left; }
.esi-ivv-c-dur { width: 10%; text-align: center; }
.esi-ivv-c-pos { width: 13%; text-align: left; }

td.esi-ivv-c-venue { font-weight: 700; }

/* ---- Position badges (invigilator reports) ---- */
.esi-pos-badge {
    display: inline-block;
    padding: 0.12rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.02em;
    white-space: nowrap;
    border: 1px solid transparent;
}

.esi-pos-none {
    color: #9ca3af;
    font-weight: 600;
}

/* Chief — amber/gold */
.esi-pos-chief {
    background: #fef3c7;
    color: #92400e;
    border-color: #fcd34d;
}
.dark .esi-pos-chief {
    background: rgba(180, 83, 9, 0.28);
    color: #fde68a;
    border-color: rgba(217, 119, 6, 0.5);
}

/* Deputy chief — indigo */
.esi-pos-deputy {
    background: #e0e7ff;
    color: #3730a3;
    border-color: #c7d2fe;
}
.dark .esi-pos-deputy {
    background: rgba(67, 56, 202, 0.28);
    color: #c7d2fe;
    border-color: rgba(99, 102, 241, 0.5);
}

/* Assistant — teal/green */
.esi-pos-assistant {
    background: #ccfbf1;
    color: #115e59;
    border-color: #99f6e4;
}
.dark .esi-pos-assistant {
    background: rgba(15, 118, 110, 0.28);
    color: #99f6e4;
    border-color: rgba(20, 184, 166, 0.5);
}

/* Any other named position — neutral slate */
.esi-pos-other {
    background: #f1f5f9;
    color: #334155;
    border-color: #e2e8f0;
}
.dark .esi-pos-other {
    background: rgba(51, 65, 85, 0.4);
    color: #cbd5e1;
    border-color: rgba(71, 85, 105, 0.6);
}

td.esi-ivv-c-id {
    font-weight: 700;
    color: #4338ca;
}

.dark td.esi-ivv-c-id {
    color: #c7d2fe;
}

/* ---- Students by venue: reuses .esi-sbd-* table; 10 columns ---- */
.esi-svv-c-venue { width: 12%; text-align: center; }
.esi-svv-c-date { width: 9%; text-align: center; }
.esi-svv-c-time { width: 10%; text-align: center; }
.esi-svv-c-course { width: 18%; text-align: left; }
.esi-svv-c-no { width: 3%; text-align: right; }
.esi-svv-c-id { width: 9%; text-align: left; }
.esi-svv-c-name { width: 19%; text-align: left; }
.esi-svv-c-dur { width: 8%; text-align: center; }
.esi-svv-c-seat { width: 6%; text-align: center; }
.esi-svv-c-rem { width: 6%; text-align: left; }

td.esi-svv-c-venue { font-weight: 700; }
td.esi-svv-c-course { font-weight: 600; }
td.esi-svv-c-no { color: rgb(100 116 139); }

td.esi-svv-c-id {
    font-weight: 700;
    color: #4338ca;
}

.dark td.esi-svv-c-id {
    color: #c7d2fe;
}

td.esi-svv-c-seat { font-weight: 700; }

/* ---- Students by course: reuses .esi-sbd-* table; 10 columns ---- */
.esi-sbc-c-course { width: 17%; text-align: left; }
.esi-sbc-c-date { width: 9%; text-align: center; }
.esi-sbc-c-time { width: 10%; text-align: center; }
.esi-sbc-c-dur { width: 8%; text-align: center; }
.esi-sbc-c-venue { width: 12%; text-align: center; }
.esi-sbc-c-no { width: 3%; text-align: right; }
.esi-sbc-c-id { width: 9%; text-align: left; }
.esi-sbc-c-name { width: 18%; text-align: left; }
.esi-sbc-c-seat { width: 5%; text-align: center; }
.esi-sbc-c-rem { width: 9%; text-align: left; }

td.esi-sbc-c-course { font-weight: 700; }
td.esi-sbc-c-venue { font-weight: 600; }
td.esi-sbc-c-no { color: rgb(100 116 139); }
td.esi-sbc-c-seat { font-weight: 700; }

td.esi-sbc-c-id {
    font-weight: 700;
    color: #4338ca;
}

.dark td.esi-sbc-c-id {
    color: #c7d2fe;
}

/* Course grand-total row: centred, stronger accent */
.esi-sbc-grand td {
    background: rgba(99, 102, 241, 0.18);
    border-top: 2px solid rgba(99, 102, 241, 0.4);
}

.dark .esi-sbc-grand td {
    background: rgba(129, 140, 248, 0.22);
}

.esi-sbc-grand-text {
    display: block;
    text-align: center;
    font-weight: 800;
    color: #3730a3;
}

.dark .esi-sbc-grand-text {
    color: #c7d2fe;
}

/* Course dropdown is long — allow it to breathe */
.esi-sbd-coursefilter-select {
    max-width: 32rem;
}

/* ---- Schedule summary: venues rendered as badges ---- */
.esi-ss-venues {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
}

.esi-ss-venue {
    display: inline-block;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    color: rgb(51 65 85);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.22);
    white-space: nowrap;
}

.dark .esi-ss-venue {
    color: rgb(203 213 225);
    background: rgba(129, 140, 248, 0.16);
    border-color: rgba(129, 140, 248, 0.3);
}

/* ---- Summary by date (venue): reuses .esi-sbd-* table; 7 columns incl. Venue ---- */
.esi-sbv-c-date { width: 13%; text-align: center; }
.esi-sbv-c-time { width: 13%; text-align: center; }
.esi-sbv-c-venue { width: 15%; text-align: center; }
.esi-sbv-c-code { width: 10%; text-align: left; }
.esi-sbv-c-name { width: 27%; text-align: left; }
.esi-sbv-c-dur { width: 10%; text-align: center; }
.esi-sbv-c-cand { width: 10%; text-align: center; }

td.esi-sbv-c-time { font-weight: 600; }
td.esi-sbv-c-venue { font-weight: 700; }

td.esi-sbv-c-code {
    font-weight: 700;
    color: #4338ca;
}

.dark td.esi-sbv-c-code {
    color: #c7d2fe;
}

td.esi-sbv-c-cand {
    font-weight: 600;
}

/* ---- Institution switcher (top bar, USER_MENU_BEFORE) ---- */
.esi-switch {
    display: inline-flex;
    align-items: center;
    margin-inline-end: 0.75rem;
}

.esi-switch .esi-select {
    width: auto;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
    font-weight: 600;
}
