body { line-height: 1.2};

/* Coordinator portal. Loaded after ../css/faculty.css (which defines the colour variables, buttons, tables and dialogs). */
.topbar .actions { display: flex; align-items: center; gap: 10px; }
.small { font-size: 0.78rem; }

/* login */
.loginwrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.loginbox { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; }
.loginbox h1 { font-size: 1.35rem; color: var(--accent); }
.loginbox p.muted { margin-bottom: 18px; }
.loginbox .btn { width: 100%; min-height: 44px; margin-top: 12px; }
.loginbox .foot { margin-top: 18px; text-align: center; }
.formerr { color: var(--danger); font-size: 0.84rem; min-height: 1.3em; margin-top: 8px; }

/* live indicator */
.live { font-size: 0.78rem; color: var(--text-light); white-space: nowrap;padding-right: 1.5rem; }
.live::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #9aa3af; vertical-align: middle; }
.live.live::before { background: #1f9d55; }
.live.connecting::before { background: #d9822b; }

/* filters */
.trainingline { font-weight: 600; color: var(--accent); margin-bottom: 10px; }
.trainingline:empty { display: none; }
.crdfilters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.multi { position: relative; }
.multi > summary { list-style: none; min-height: 40px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: 0.9rem; }
.multi > summary::-webkit-details-marker { display: none; }
.multi[open] > summary { border-color: var(--accent); }
.multi-panel { position: absolute; z-index: 6; left: 0; right: 0; top: 100%; margin-top: 2px; max-height: 260px; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); }
.multi-panel label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.86rem; cursor: pointer; }
.multi-panel label:last-child { border-bottom: 0; }

/* counts */
.stats3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat strong { display: block; font-size: 1.4rem; font-weight: 600; line-height: 1.2; }

/* table */
td .main { display: block; font-weight: 500; }
td .sub { display: block; font-size: 0.76rem; font-weight: 400; color: var(--text-light); }
td.sticky, th.sticky { position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line); }
th.sticky { background: var(--bg); z-index: 2; }
tr.reached td { background: #f1f8f4; }
tr.reached td.sticky { background: #f1f8f4; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-align: left; }
.link:hover { text-decoration: underline; }
.call { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.call svg { width: 16px; height: 16px; }

/* switches */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; vertical-align: middle; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; min-height: 0; padding: 0; border: 0; }
.switch span { position: absolute; inset: 0; background: #cbd2dc; border-radius: 999px; cursor: pointer; transition: background 0.15s; }
.switch span::before { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform 0.15s; }
.switch input:checked + span { background: #1f9d55; }
.switch input:checked + span::before { transform: translateX(20px); }
.switch input:disabled + span { opacity: 0.45; cursor: not-allowed; }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* dialogs */
.sheet-pad { padding: 16px 20px; }
#detailBody div { font-weight: 500; }

.foot2 { padding: 18px 16px; text-align: center; color: var(--text-light); font-size: 0.78rem; border-top: 1px solid var(--line); }
@media (max-width: 520px) { .stat strong { font-size: 1.15rem; } }


.crdfilters[hidden] { display: none; }
.filterbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }

/* toast (top of screen, hidden by the script after 5 seconds) */
#msg { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 1000; width: max-content; max-width: calc(100% - 24px); margin: 0; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18); }

/* table scrolls inside its own box, header row frozen */
#tableWrap .table-wrap { max-height: 75vh; max-height: 65dvh; overflow: auto; }
#tableWrap .table-wrap thead th { position: sticky; top: 0; z-index: 3; box-shadow: 0 1px 0 var(--line); }
#tableWrap .table-wrap thead th.sticky { left: 0; z-index: 5; }

/* mobile */
@media (max-width: 768px) {
    .c-topic, .c-class, .c-time, .c-students { display: none; }
    .crdfilters { grid-template-columns: 1fr 1fr; }
    .multi > summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* column widths: long text wraps to a second line instead of stretching the column */
#tableWrap td.sticky, #tableWrap th.sticky { white-space: normal; width: 180px; min-width: 180px; max-width: 180px; }
#tableWrap td.c-topic, #tableWrap th.c-topic { white-space: normal; width: 240px; min-width: 240px; max-width: 240px; }

@media (max-width: 768px) {
    #tableWrap td.sticky, #tableWrap th.sticky { width: 160px; min-width: 160px; max-width: 160px; }
}